Repository navigation
docs: Record the workload artifact consolidation census and dispositions - #5029
Conversation
Measure tests/infra growth and the workload artifact hotspot, name every remaining non-canonical archive builder, and record a disposition for each instead of refactoring during a census. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details🧰 Additional context used📓 Path-based instructions (2)Classify every schema change first: durable tier means additive numbered migration plus verified backup manifest; derived tier means canonical DDL plus declared lifecycle delta.📄 CodeRabbit inference engine (CLAUDE.md) Files:
Use `devtools`, never bare `pytest`.📄 CodeRabbit inference engine (CLAUDE.md) Files:
🪛 markdownlint-cli2 (0.23.2)docs/plans/workload-artifact-consolidation-ledger.md[warning] 131-131: Ordered list item prefix (MD029, ol-prefix) 📝 WalkthroughWalkthroughThe change adds a ledger for workload-artifact builders. It records module metrics, ownership, candidate dispositions, and criterion status. The new page is registered in the documentation registry and linked from the Design Notes table. ChangesWorkload Artifact Ledger
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other Merge Risk: ⚪ Minimal · up to This documentation-only change adds and indexes the ledger, with no remaining merge-blocking defect identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit reads each line, Comment |
…nfig (#5032) Advances `polylogue-7lhl5`. Resolves 47 of the 108 failures reproduced at `14e1d821f`. ## Summary Replace embedding-status config doubles with a real `PolylogueConfig` behind one shared helper, and retarget four leftover insight rebuilds onto the shared materializer. ## Problem The full corpus could not collect as one unit until #5031, so most of these tests had never run. The measured red surface at `14e1d821f` is 108 failures. Two clusters account for 47. ## Production is right — deliberately unchanged Before editing test files, the question was whether the production nominal dispatch in `embedding_status_settings_from_config` is itself wrong. It is not, for two reasons worth recording: 1. **It is a lossy projection where identical attribute names mean different things.** A legacy `Config` has no `embedding_enabled` and no `embedding_max_cost_usd`, and reaches its Voyage key via `index_config`; `PolylogueConfig` has all of them directly. `EmbeddingStatusSettings`'s own docstring makes `None` mean *"the supplied configuration did not observe that fact — not disabled, not unbounded."* A Protocol can express which attributes an object has, never **which vocabulary it speaks**, so the two branches would collapse and emit `None`s that read as observed-absent rather than unobservable. 2. **No production caller can reach the refusal.** `status_payload.py:1297` uses `load_polylogue_config()`; `status_payload.py:1179` and `operations/daemon_status.py:77` are typed `Config | PolylogueConfig | None` and their production callers (`daemon/cli.py:3052,3057`, `daemon/status_snapshot.py:420`, `cli/shared/check_workflow.py:134`) pass no config at all. So it is a fail-loud partition guard: a third config type must be a deliberate edit there, not a silent structural match. Fixing the tests was correct. ## Solution **`24d060ebf`** — the `_Cfg` cluster (29, and confined to a single file rather than spread across the suite as first assumed). #5026's pattern is factored into `tests/infra/embedding_config.py` and used from both call sites instead of per-file copies — that duplication is exactly what the consolidation census (#5029) is trying to reduce. `test_embed_status_fast.py` 32 failed → 15; zero `_Cfg` TypeErrors. **`96e79d095`** — cluster B (18). Four callers that `f494b276f` missed, retargeted onto `materialize_session_insights`. Readiness 4→0, taxonomy 6→0, snapshots 15→7. ### Anti-vacuity - `_Cfg`: tests still drive the real `load_polylogue_config → embedding_status_settings_from_config → EmbeddingStatusSettings` route. The helper was verified behavior-identical (same five values; `config.py:411-429` are plain pass-throughs), so nothing was relaxed. Reverting to a double makes them red with the same `TypeError`, and a production field rename now breaks these tests instead of being absorbed by a double that matches only itself. - Cluster B: the tests assert what the materializer *produces*, and `materialize_session_insights` calls `rebuild_session_insights_sync` — the same function both sanctioned owners reach — so deleting it leaves every assertion red. Authorization-route coverage stays separate in `test_operation_executor_routes.py`. ## Verification ``` devtools test <5 selections> receipts 20260913T213830Z-...-1607196-b7978ae1, ...-1617758-93b10ec5, ...-1633508-61a11e02, ...-1635467, ...-1640057 devtools verify --quick 14/14 gates ok ``` No full-corpus run (a host reaper kills long background tasks; the corpus gate runs through the declared `verify_all` operation instead). ## A measurement that refuted a confident inference Cluster C was triaged as "small and clear: widen the lambdas to `**_kwargs`." It was implemented and **measured to be wrong** — it peeled three layers (`index_path` → `operation_vector_connection` → `index_db_path`) with 7 failures surviving each round. `test_query_exec_laws.py` holds **38 hand-written `FakeArchiveStore` copies** that have drifted from a production class that moved. Re-synchronizing them is the duplication problem itself, not a one-liner. It was **reverted rather than chased attribute by attribute**, and needs its own owner. ## Deliberately left, with owners - **Cluster A residual, 15** — `test_embed_status_fast.py`. Pre-existing and previously masked by the `TypeError` (confirmed three ways). Cause: `EMBEDDINGS_SCHEMA_VERSION` 5→6 added `message_content_hash`, so the v5-shaped fixture's metadata alone no longer certifies a vector. Needs a v6 fixture with real physical vectors under sqlite-vec, not a pragma bump. - **Cluster C, 7** — the `FakeArchiveStore` drift above. - **D1–4, 34** — reset / excise / archive-maintenance / json-output, all stale against daemon sole-write authority. Mechanical but needs a judgment call about what each should now assert; one owner for all four. - **D5, 3 — a genuine PRODUCT BUG**, filed separately: `cli/commands/status.py` rejects any non-builtin `daemon_url` and then renders the refusal as **"Daemon: running"** with `daemon_reachable = True` when no daemon exists. - **D6** — mostly environment/timing, but `test_daemon_resilience.py:362` (`(None,'signal') != ('SIGTERM','signal')`) is a real shape mismatch. - **D7** — `.archive-ownership.lock` PermissionError, carrying a real question about whether a pure read should need write access. The `no running event loop` traceback there is **not** a defect — caught by design at `core/async_bridge.py:50-53`. Attribution is more spread than expected: only cluster A traces to the convergence rewrite; B to `f494b276f`; C and D5 to `1d901ec73`; D1–3 to `6be5d2fd7`; D4 to `cfc4c73ec`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Advances
polylogue-1xc.14.1, a direct blocker of the final archive build. Thebead stays open — AC2 and AC11's deletion half are explicitly not closed, and
the ledger says so.
Summary
Record the workload-artifact consolidation census and a per-duplicate
disposition ledger. Documentation only: no test infrastructure was retired.
Problem
polylogue-1xc.14.1AC2/AC11 require a before/after census and the retirementof duplicate artifact builders. Neither had been produced, and the notes citing
tests/infra/pathology_zoo.pywere stale — it was retired byeb8be9427.What the census actually found
tests/infrarecursive*.py, first-parent master:The hotspot shrank (3,542 → 3,191), but only by extracting 509 lines into a
second owner: the pair now totals 3,700 against a 3,542 single-file peak, while
tests/infragrew 25% overall. Consolidation has redistributed, not reduced.That is the honest reading and it is why AC11's deletion half stays open.
Fan-in on
workload_artifactsis 21; the real hubs arestorage_records(144)and
live_ingest(73).pathology_zoo.pyandpathology_composer.pyare bothgone.
Dispositions (AC2)
No code was retired. Every candidate was a deliberate production seam, a
shared primitive, or too widely called to touch inside a census — and the bead's
own caution governs here: create a narrow leaf only for a true duplicate with an
explicit owner.
Two genuine duplicates, both deferred with an owner rather than retired:
archive_scenarios.py(ArchiveScenario.seed,seed_workspace_scenarios) — atrue direct-index seeder with no manifest, but 25 importing modules; migration
would touch many test files.
whale_fixtures.py(acquire_codex_revision_chain) — cacheable scaleartifacts published without a manifest; wrapping the production acquisition
seam is a design change, not a deletion.
Kept, with reasons:
query_corpus.py(materializes through the productionwriter, caches nothing, so owns no artifact identity),
corpus_program.pyandconvergence_harness.py(delegate to production seams, own no cached artifact),storage_records.py(SessionBuilderis the primitive the manifest route isbuilt on). Not duplicates:
live_ingest.pyis the single test seam ontowrite_parsed_session_to_archive— retiring it would create duplication;reference_model.pyandsource_composer.pywere grep false positives.AC13 — the earlier claim was overbroad
It was previously reported that AC13's mutation testing is unimplementable
because the substrate carries no semantic output. That is only half true.
CorpusArtifactManifest.__post_init__callsreject_semantic_metadata, andSEMANTIC_METADATA_PREFIXES = ("expected_", "oracle_", "pathology_", "case_")refuses oracle-shaped keys — so oracle substitution genuinely has no seam. But
the other four mutation classes do have seams and are already covered by
hostile tests in
test_workload_artifacts.py: identity reuse, schema-identitykeying, forged receipts, same-size corruption, tampered clones, sibling
isolation, lease mutation.
Proposed replacement wording is in the ledger; it needs acceptance before AC13
can close.
AC6 — satisfied
No
pathology_zoo/pathology_composer.PathologyName/REQUIRED_PATHOLOGIESlive in
query_contract.pybeside the query laws that consume them, which AC5requires rather than forbids. No scale-tier enum survives; the remaining
session_countis a bundle-shape parameter. Malformed material exists only asfuzz corpora and Hypothesis strategies beside their laws.
Verification
docs/README.mdis generated, so the ledger is registered indevtools/docs_surface.pyand re-rendered rather than hand-edited — the firstverify --quickcaught exactly that and it was fixed at source.devtools test tests/unit/devtools -k workloadexits 2 withInterrupted: 2 errors during collectionfrom_UnprintableCode.__repr__intest_devtools_main.pyandtest_project_motd.py. That is the pre-existingcollection break owned by
polylogue-6rcy2, not this change: 0 of 2 selectedtests ran, and running both selected nodes directly passes (receipt
20260913T195657Z-focused-test-1331568-6a55f3fe).Per CLAUDE.md these greens prove only the selected scopes.
Bead status after this
Satisfied: AC1, AC3–AC10, AC11's reporting obligation, AC12.
Open: AC2 (two real duplicates recorded, not retired), AC11's deletion half (the
aggregate did not fall), AC13 (needs the reworded criterion accepted), AC14
(blocked only by the unrelated collection break).
🤖 Generated with Claude Code
https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
Summary by CodeRabbit