Repository navigation
fix(cli): stop daemon_client pulling storage, and seed embed-status tiers - #5478
Conversation
…iers Two unrelated failures that had been red on master unseen: the pytest and pytest-heavy pueue groups auto-paused on a verify_all failure on 2026-09-22 and nothing resumed them, so no pytest ran on master for over a day while verify --quick stayed green (it is static-only). 1. daemon_client loaded 42 polylogue.storage modules. operations/daemon_protocol.py imported one integer, MAX_ANNOTATION_IMPORT_BYTES, from annotations.importer -- which executes annotations/__init__ -> annotations.write -> the storage substrate. The same constant was separately duplicated as a literal in cli/commands/annotations.py, deliberately, because that package may not import the annotation substrate under the mutation-authority layering rule. Both now read polylogue/core/annotation_limits.py, a leaf module with no substrate imports. One owner instead of one leak plus one copy. Storage modules after importing daemon_client: 42 -> 0. 2. test_embed_status_fast seeded an archive production cannot see. The helper hand-wrote sessions/messages into archive.db, but the fast path resolves ArchiveLocation.active_index_path and requires sessions in index.db, so every assertion read an archive it considered empty. These fixtures predate the split-tier layout. Seeding is retargeted to the tier each table actually lives in -- index for sessions/messages, embeddings for embedding_status, ops for embedding_catchup_runs -- and seeded derived tiers are stamped with the runtime user_version, since version 0 is schema skew rather than an empty archive. Verification: devtools test tests/unit/cli/test_daemon_client.py -> PASSED exit=0 devtools test tests/unit/cli/test_embed_status_fast.py -> 2 failed (was 10) Residual, tracked separately: test_status_json_reports_ready_next_action and test_status_json_includes_latest_catchup_run still fail, and not for a fixture reason. embed.py's fast path performs no ATTACH at all -- it opens index.db read-only and never attaches the sibling ops or embeddings tiers -- so embedding_status (read through the attached embeddings schema) and embedding_catchup_runs (read through ops_tier) are structurally unreachable from it. Those two tests assert output the route cannot produce. Whether the fast path should attach those tiers or the assertions are obsolete is a product decision, not a test edit. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy
|
Warning Review limit reachedNext included review available in 25 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (5)
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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 27e2ad8ab6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Closing out open Codex review threads on this PR (evidence checked against master at bf68918):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
Summary
Master had 11 failing tests that nobody had seen. This fixes 9 and diagnoses the other 2 as a product question rather than a test bug (filed as
polylogue-gqkae).Why they were invisible
The
pytestandpytest-heavypueue groups auto-paused when a scheduledverify_allfailed on 2026-09-22 and nothing resumed them. No pytest ran on master for over a day, whileverify --quickstayed green throughout — it is static gates only. Both groups are resumed.Confirmed at
5f9210b6d^: these predate the campaign waves.1.
daemon_clientloaded 42polylogue.storagemodulesoperations/daemon_protocol.pyimported one integer —MAX_ANNOTATION_IMPORT_BYTES— fromannotations.importer, which executesannotations/__init__→annotations.write→ the storage substrate.The same constant was separately duplicated as a literal in
cli/commands/annotations.py, with a comment explaining that importing that module frompolylogue/cliwould violate the mutation-authority layering rule. So one consumer leaked the substrate and the other hand-copied the value to avoid it.Both now read
polylogue/core/annotation_limits.py, a leaf module with no substrate imports.2.
test_embed_status_fastseeded an archive production cannot seeThe helper hand-wrote
sessions/messagesintoarchive.db. The fast path resolvesArchiveLocation.active_index_pathand requiressessionsinindex.db— so every assertion in the file read an archive production considered empty, which is why the symptom was uniformly'empty'/0against seeded values of 2.These fixtures predate the split-tier layout. Seeding is retargeted to the tier each table actually lives in (index for sessions/messages, embeddings for
embedding_status, ops forembedding_catchup_runs), and seeded derived tiers are stamped with the runtimeuser_version— version 0 is schema skew, refused before any row is read, not an empty archive.Verification
Residual — deliberately not fixed here
test_status_json_reports_ready_next_actionandtest_status_json_includes_latest_catchup_runstill fail, for a structural reason:embed.py's fast path performs noATTACHat all. It opensindex.dbread-only and never attaches the sibling ops or embeddings tiers. Soembedding_status(read via the attached embeddings schema) andembedding_catchup_runs(viaops_tier, which returns(None, None)when the schema is absent fromPRAGMA database_list) are unreachable from that route. Correct tier files with correct versions do not help, because nothing attaches them.That makes the status surface report unmeasured state as absent — the same defect class as
polylogue-xvwpi. Either the fast path should attach those tiers, or it is index-only by design and the assertions are obsolete. Weakening the assertions to match current output would encode the bug, so I have not done that. Filed aspolylogue-gqkaewith the anti-vacuity condition for either route.🤖 Generated with Claude Code
https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy