Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ TDD required. Red → Green → Refactor. No production code without a failing t

Python 3.12, uv, hatchling src layout, pytest, ruff.

**co-core is pinned exactly (`==0.38.0`); Processor owns the pin** (spec D5, §5; since watcher#350 nothing else extracts). `processor_version` = `"<co-core version>+<LOCAL_GENERATION>"`; a pin test makes every bump a deliberate, test-failing act. Never let a dependency bot or `uv lock --upgrade` move co-core. A bump gives Watcher notice (it re-baselines on `processor_version`). It is coordinated with Watcher only if it changes the contract: the `content.process` / `content.derived` models or `canonical_text` semantics. Procedure: [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md#bumping-co-core). The extraction stack (co-core's `extract` extra, closure: pypdf, lxml, …) is held too: moving it outside a co-core bump bumps `LOCAL_GENERATION` (#71, [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md#extraction-dependencies)).
**co-core is pinned exactly (`==0.51.1`); Processor owns the pin** (spec D5, §5; since watcher#350 nothing else extracts). `processor_version` = `"<co-core version>+<LOCAL_GENERATION>"`; a pin test makes every bump a deliberate, test-failing act. Never let a dependency bot or `uv lock --upgrade` move co-core. A bump gives Watcher notice (it re-baselines on `processor_version`). It is coordinated with Watcher only if it changes the contract: the `content.process` / `content.derived` models or `canonical_text` semantics. Procedure: [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md#bumping-co-core). The extraction stack (co-core's `extract` extra, closure: pypdf, lxml, …) is held too: moving it outside a co-core bump bumps `LOCAL_GENERATION` (#71, [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md#extraction-dependencies)).

**The co-pypi index.** `co-core`, `co-core-aio`, `co-core-sync` resolve only from the explicit `co-pypi` Artifact Registry index (`pyproject.toml`, #121). The lock holds each file's sha256, and `uv sync --locked` refuses a miss. `uv lock`, and a `uv sync` that downloads, need the reader's token: `bash scripts/co-pypi.sh uv …` mints it for that one `uv`, and never prints it. After the first `uv sync` in a fresh checkout, `uv sync --reinstall-package processor` if `import processor` fails.

Expand Down
4 changes: 2 additions & 2 deletions docs/DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ co-core is pinned `==`, and Processor owns the pin (spec D5, §5; amended 2026-1
1. Update the pin in `pyproject.toml` (all three names) and `EXPECTED` in `tests/test_pin.py`, then `bash scripts/co-pypi.sh uv lock --upgrade-package co-core --upgrade-package co-core-aio --upgrade-package co-core-sync`, never `--upgrade`. Nothing else moves: no wheelhouse, no digest table (#121).
- **The lock carries the digests.** Each co-core file gets its sha256 from the index, and `uv sync --locked` refuses a miss. cannobserv's publish run fails unless the index lists every file under its local sha256 (from v0.41.0, CannObserv/cannobserv#554).
- **Check the diff:** each co-core `source` is the index URL, and nothing outside the bump moved. A moved extraction-stack package belongs to the bump (§ Extraction dependencies).
- **Drop an override the new co-core makes redundant.** `tests/test_lock_floors.py` fails when co-core's own requirement admits an `override-dependencies` floor: remove the entry and its `OVERRIDDEN` row, and keep the floor as a constraint if co-core's own is lower. At ≥ 0.46.1 that is soupsieve's (`>=4.1,<5` in co-core itself; #138).
- **Drop an override the new co-core makes redundant.** `tests/test_lock_floors.py` fails when co-core's own requirement admits an `override-dependencies` floor: remove the entry and its `OVERRIDDEN` row. Keep the floor as a constraint if co-core's own is lower, or as a `CO_CORE_FLOORED` row if co-core's own holds it (a test checks that it still does). #140 did this for soupsieve: co-core 0.51.1 declares `>=4.1,<5` itself (#138's override).
2. A release that adds an essence or an extraction rule gets its cases in `tests/fixtures/parity/cases.json` first, so their goldens come from co-core. Then regenerate the goldens from co-core directly: `uv run python scripts/gen_parity_goldens.py tests/fixtures/parity`. It prints every digest that moved, and every case that started or stopped being refused. Paste that list into the bump note: each line is a deliberate re-baseline. Never regenerate to make a parity test pass outside a bump. A catch-up across releases reads each CHANGELOG's Downstream lines for the extract, bus and blob-store surfaces, and diffs those packages' code between the tags (#29 did 0.19.7 → 0.32.0).
3. The real corpus (`tests/fixtures/parity/real/`) is never regenerated. It passes unchanged, or the bump note says which recorded fingerprints moved.
4. **Notice to Watcher** before deploy: the new `processor_version`, and the moved digests. A change to the contract needs coordination with Watcher first, not just notice. The contract is the `content.process` / `content.derived` models and `canonical_text` semantics. A change to essence resolution is notice, not coordination (spec §5, #57).
Expand All @@ -154,7 +154,7 @@ co-core is pinned `==`, and Processor owns the pin (spec D5, §5; amended 2026-1
3. Measure what moved: the parity tests (goldens, real corpus) must pass unchanged (a golden that moves is a co-core-pin question, not this one), and run co-core's extractor for the moved package over a wider corpus on both versions (#71 used pypdf's and py-pdf's sample PDFs: 4 of 106 moved). Put the result in the PR.
4. **Notice to Watcher** before deploy: the new `processor_version` and the evidence. Merge, then `scripts/deploy.sh`.

Since #71: `0.38.0+2`, pypdf 6.21.2, opentelemetry-api 1.45.1 (not stack; a floor only). Since #112: `0.38.0+3`, pypdf 6.21.4, pyasn1 0.6.5 (not stack; a floor only). Since #138: `0.38.0+4`, soupsieve 4.1.1 by override past co-core's `<3` (no fingerprint moved over 289 HTML files × 34 selector configs; a complex or nested `:has()` now refuses), opentelemetry-api 1.45.2 (not stack; a floor only).
Since #71: `0.38.0+2`, pypdf 6.21.2, opentelemetry-api 1.45.1 (not stack; a floor only). Since #112: `0.38.0+3`, pypdf 6.21.4, pyasn1 0.6.5 (not stack; a floor only). Since #138: `0.38.0+4`, soupsieve 4.1.1 by override past co-core's `<3` (no fingerprint moved over 289 HTML files × 34 selector configs; a complex or nested `:has()` now refuses), opentelemetry-api 1.45.2 (not stack; a floor only). Since #140: `0.51.1+4`, at the co-core bump, so the generation stayed. soupsieve 4.1.3 rode along (no result moved over 311 HTML files × 34 selector configs), and the override went: co-core floors it at 4.1 itself.

## Parity goldens

Expand Down
2 changes: 1 addition & 1 deletion docs/DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ A stop mid-reclaim finishes the command in hand and leaves the rest pending. A c

- **Drift:** `journalctl -u processor-drift` (MONITORING.md § The drift check).
- **Liveness:** `journalctl -u processor -o cat | jq -cR 'fromjson? | select(.logger == "processor.liveness")'` (MONITORING.md § Liveness).
- **Logs:** `journalctl -u processor`. A record's journald `PRIORITY` follows its `level` (CRITICAL 2, ERROR 3, WARNING 4, INFO 6, DEBUG 7; #76), so `journalctl -u processor -p warning` lists WARNING and above, with systemd's own warning lines for the unit; add `-o cat | jq -cR 'fromjson?'` for the JSON alone. Every `processor` entry point (so every unit that runs it: `processor`, `processor-drift`, `processor-patching`) writes an sd-daemon `<N>` prefix only when its stderr is the journal (`JOURNAL_STREAM` names stderr's own device and inode), and journald strips it, so `MESSAGE` stays pure JSON. A terminal, `processor_cli` and any `systemd-run --pipe` never see one. Records from before #76's deploy (`live -> 431b7b569300` at 2026-10-25T15:50:36Z in `journalctl -t processor-deploy`) are all `PRIORITY=6`: filter those by `.level`. Only `logging` records carry a priority: a bare traceback or a `print` to stderr is still `PRIORITY=6`. A record past journald's `LineMax` (48K) is split, and only its first part carries the priority (neither part is JSON). `starting` names the `build`, `child_containment`, `landlock_abi` and `liveness`. Deploys: `journalctl -t processor-deploy`. Each outcome has `command_id`, `info_source_id`, `action` (`ack` / `strike` / `leave_pending` / `dead_letter`), `reason`, `detail`, and timings in `*_ms`. Each also has `input_digest` once it is valid, as bare hex like the command's. A complete fact adds `output_digest` (`sha256:<hex>`, as on the fact; the object is `blobs/<hex>.bin`; absent when `empty`), `output_size_bytes`, `empty` and `processor_version`, and so does a `leave_pending` whose publish failed after the store. A shadow command's output: `journalctl -u processor -o cat | jq -cR 'fromjson? | select(.command_id == "<id>") | {action, reason, input_digest, output_digest}'` (`-R … fromjson?` skips systemd's own lines, which `-u` includes and plain `jq` aborts on).
- **Logs:** `journalctl -u processor`. A record's journald `PRIORITY` follows its `level` (CRITICAL 2, ERROR 3, WARNING 4, INFO 6, DEBUG 7; #76), so `journalctl -u processor -p warning` lists WARNING and above, with systemd's own warning lines for the unit; add `-o cat | jq -cR 'fromjson?'` for the JSON alone. Every `processor` entry point (so every unit that runs it: `processor`, `processor-drift`, `processor-patching`) writes an sd-daemon `<N>` prefix only when its stderr is the journal (`JOURNAL_STREAM` names stderr's own device and inode), and journald strips it, so `MESSAGE` stays pure JSON. A terminal, `processor_cli` and any `systemd-run --pipe` never see one. Records from before #76's deploy (`live -> 431b7b569300` at 2026-10-25T15:50:36Z in `journalctl -t processor-deploy`) are all `PRIORITY=6`: filter those by `.level`. Only `logging` records carry a priority: a bare traceback or a `print` to stderr is still `PRIORITY=6`. A record past journald's `LineMax` (48K) is split, and only its first part carries the priority (neither part is JSON). `starting` names the `processor_version`, `build`, `child_containment`, `landlock_abi` and `liveness`. Deploys: `journalctl -t processor-deploy`. Each outcome has `command_id`, `info_source_id`, `action` (`ack` / `strike` / `leave_pending` / `dead_letter`), `reason`, `detail`, and timings in `*_ms`. Each also has `input_digest` once it is valid, as bare hex like the command's. A complete fact adds `output_digest` (`sha256:<hex>`, as on the fact; the object is `blobs/<hex>.bin`; absent when `empty`), `output_size_bytes`, `empty` and `processor_version`, and so does a `leave_pending` whose publish failed after the store. A stored output also has `output_created` (#140): `true` if this call wrote the object, `false` if it was already there. It's a log signal only, because each backend is exact one way only (spec §4). A shadow command's output: `journalctl -u processor -o cat | jq -cR 'fromjson? | select(.command_id == "<id>") | {action, reason, input_digest, output_digest}'` (`-R … fromjson?` skips systemd's own lines, which `-u` includes and plain `jq` aborts on).
- **Dead letters:** `processor_cli dlq list | show <id> | drop <id>` (PROVISIONING.md § `/etc/processor/`). There is no replay. An entry failed to decode, was not a command, or is a command that raised outside the handler on every attempt (`reason` starts `gave up on attempt`): that one is a bug to fix. Before dead-lettering such a command, Processor published a terminal `dead_lettered` whose `detail` starts `dead-lettered:` (best effort), so Watcher has closed it (#17; `extraction_error` before co-core 0.37.0, #21). The journal's `dead-lettering` record says which: `failure_fact` is `published`, `skipped` (a fact had already gone out) or `refused`. On a command given up at the cap, `handle_skipped` is `true` when the record retries a give-up that did not finish (the failure fact refused transiently, or the dead-letter refused), with no re-run of the command and the original traceback (#28). The same entry logging that every ~11 min while it stays pending means `content.process.dlq` refuses it: `journalctl -u processor -o cat | jq -cR 'fromjson? | select(.handle_skipped) | {timestamp, command_id, message_id, reason}'`.
- **Lag / missing group:** the broker probe watches `processor.process` (broker#75).
- **Strikes** are counted in memory. A restart resets them, so a poison command gets at most 3 more attempts.
Expand Down
73 changes: 73 additions & 0 deletions docs/plans/2026-11-23-140-co-core-0.51.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: co-core 0.38.0 → 0.51.1, the soupsieve override dropped, soupsieve 4.1.3, store_reporting (#140)
date: 2026-11-23
status: per #140 (body; 2026-11-21 comment; coordinator brief 7107994788, recommendations accepted by the operator; implementer corrections 7110222346); procedure per docs/DEPENDENCIES.md § Bumping co-core
---

# co-core 0.51.1

## Problem

- co-core 0.38.0's `extract` extra caps soupsieve `<3`, so #138 reached 4.1.1 by `override-dependencies`, which replaces co-core's requirement. co-core ≥ 0.46.1 declares `soupsieve>=4.1,<5` itself (cannobserv#667), and `tests/test_lock_floors.py` fails the bump until the override goes.
- co-core 0.51.0 maps `extraction.include_description` (cannobserv#559). Archiver's schema accepts the key (archiver#353) only once Processor runs ≥ 0.51.0. On 0.38.0, a spec that sets the key extracts as if it were absent.
- Since v0.41.0 the blob store reports whether a write created the object (cannobserv#530, `store_reporting`). The epic records that Processor adopts it at this bump.

## Approach

**Target:** v0.51.1, the latest tag on 2026-11-23. Nothing Processor imports changed between 0.51.0 and 0.51.1.

**The bump** (one commit, green on its own):
- `pyproject.toml`: pin all three names `==0.51.1`, and remove `override-dependencies` and its comment.
- Re-lock: `bash scripts/co-pypi.sh uv lock --upgrade-package co-core --upgrade-package co-core-aio --upgrade-package co-core-sync --upgrade-package soupsieve`. Expected: the three move to 0.51.1, soupsieve 4.1.1 → 4.1.3, the `overrides` entry goes, and nothing else moves.
- `tests/test_pin.py`: `EXPECTED` 0.51.1, and `EXTRACTION_STACK` soupsieve 4.1.3. `LOCAL_GENERATION` stays 4 (DEPENDENCIES.md § Extraction dependencies, step 2), so `processor_version` = `0.51.1+4`.
- `tests/test_lock_floors.py`:
- `OVERRIDDEN` is empty, and one test holds `override-dependencies` to exactly its names, so a stale override fails.
- soupsieve's 4.1 floor is held by co-core's own requirement (`CO_CORE_FLOORED`), with a test that the requirement floors at 4.1 or higher. If a later co-core drops below that, the test says to add a constraint.
- The guard's parsing tests stay. The override route is still the documented route for the next capped floor.

**Parity** (DEPENDENCIES.md step 2: the cases come first, so their goldens come from co-core):
- `tests/fixtures/parity/cases.json`:
- `include_description: true` on `tailscale_security_bulletins.xml` (RSS) and `feed.atom` (Atom), `full_page`;
- refusals: on `css`, on an HTML body, on `register.xml` (non-feed root), and a non-bool (`"true"`).
- Regenerate: `uv run python scripts/gen_parity_goldens.py tests/fixtures/parity`. Expected: only the new cases appear, and no existing digest moves. The real corpus passes unchanged.

**`store_reporting`** (its own commit, TDD):
- `handler.py` calls `deps.stores.output.store_reporting(...)` and takes `.uri` for the fact.
- `output_created` goes into the outcome record of a stored, non-empty output, alongside `output_digest`. An empty output stores nothing and logs no `output_created`. (Planned as `created`. That's a `LogRecord` attribute, and the scratch-bus consumer tests failed on it with `KeyError`, so it was renamed, with a guard test.)
- It's a log signal only, never a branch. A GCS `False` may be this call's own retried create; a local `True` may be a race.
- `FlakyStore` cases that inject on `store` move to `store_reporting` (correction 5). A test holds that the handler never calls plain `store`.

**Docs** (spec amended 2026-11-23, history kept as written):
- An **Amended** entry in the header;
- D5 `:211` and the Dependencies row `:250`;
- the failure table's refusal list `:437`, which gains `include_description`;
- Section 4's log fields `:529–533`, which gain `output_created`;
- §5: the pin `:572`ff, and the override note `:562` marked removed;
- the pin test `:745`, the quick-reference heading `:818`, and `:859`;
- `docs/DEPENDENCIES.md:157`: a "Since #140" entry;
- `AGENTS.md:27`: `==0.51.1`, with no growth.

## Evidence

- **Catch-up:** `git diff v0.38.0 v0.51.1` over every co-core module Processor imports (correction comment).
- The five contract classes are AST-identical.
- Extraction differs only by `include_description` (+105/−32 over 8 files).
- The blob store adds the reporting twins; plain `store` behaves the same.
- **Parity:** the goldens (moved list in the PR), the real corpus unchanged, and `tests/test_child.py` under `required`.
- **soupsieve 4.1.1 → 4.1.3, measured as #138 did:**
- co-core 0.51.1's `HtmlExtractor`, then `canonical_text_fingerprint`.
- Inputs: the parity HTML, the real corpus, and host HTML files over 3 KB, each under a selector battery.
- It runs in two venvs that differ in soupsieve alone. Counts go in the PR.

## Tradeoffs

- **soupsieve rides along:** one more package in the same re-baseline, instead of a later generation bump with its own Watcher notice.
- **`output_created` is a log signal only:** it's exact in one direction per backend. As a branch it would be wrong on one of them.

## Ship

- PR, with `Refs #140` while live checks remain, then CI green by job.
- Watcher notice on watcher#394, approved before posting.
- FF merge outside Tue 2026-11-24 05:00–10:00Z, then `scripts/deploy.sh`.
- The live `starting` record reads `processor_version` `0.51.1+4`, containment `required`.
- The Archiver relay is the coordinator's.
Loading