Repository navigation
chore: Delete the durable-reference transition actuator - #5079
Conversation
The `maintenance durable-reference-transition` route existed to carry user.db/audit.db references across a candidate-to-predecessor index generation swap during the source-transition campaign. The fresh archive is rebuilt from scratch, so it has no predecessor generation to bridge from, and the standing recovery design for a moved derived-schema identity is a typed `SchemaSkew` plus full reconvergence through the daemon -- not a hand-run rebind. Removed, with every caller accounted for: - polylogue/maintenance/durable_reference_transition.py - polylogue/maintenance/assertion_transition.py (sole consumer of the above; no other importer) - polylogue/storage/sqlite/archive_tiers/durable_references.py (only assertion_transition read it) - polylogue/operations/durable_reference_transition.py - polylogue/cli/commands/maintenance/_durable_reference_transition.py and its `_COMMANDS` / `_NESTED_GROUP_COMMANDS` registrations - the re-exports in polylogue/maintenance/__init__.py - docs/maintenance.md "Rebinding durable references across an index rebuild" - the file's entry in the sqlite-degradation ratchet baseline (shrinks) Tests: tests/unit/maintenance/test_durable_reference_transition.py and tests/unit/maintenance/test_assertion_transition.py covered only the removed route and are deleted with it; tests/unit/storage/test_durable_references.py covered the deleted declaration module. tests/unit/operations/test_maintenance_read_profiles.py is retargeted: its attachment_convergence reader-census assertion stays, the two durable-transition assertions go. No test was weakened to pass. 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. |
|
Warning Review limit reachedNext included review available in 23 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 (13)
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 |
## Summary Reopens the work from #5083, rebased onto current master. The original PR's base branch (#5079) was squash-merged and deleted, which closed it and left the branch conflicting. Deletes `archive-root-relocation` and `source-continuity-recovery` end to end, plus the relocation coupling inside `durable_change_train.py`. ## Problem Both are self-documented as acting on an old archive root: `--old-root` names "the retired pre-move root", and the other is "a one-purpose bridge for a committed **pre-#3868** receipt". Both are dead by construction once the archive is rebuilt with current code. Tracked by `polylogue-2x6xu`, whose earlier "already landed" claim was verified false — all three route groups were fully live, including three `assert_no_prepared_*` calls on the `polylogued run` startup path. ## Solution −8,887/+29 across 23 files: operations modules, registered CLI groups, generated CLI output schemas, docs sections, tests. Also fixes a deletion hazard the sweep caught: the docstring of `_released_train_proven_floor` justified the fresh-bootstrap marker's retirement on evidence that "archive-root relocation already rebinds" — it would have merged clean in a different file and stood as authoritative over a deleted mechanism. ## Verification ``` devtools verify --quick 15/15 gates ok (exit 0) ``` Rebase checked for silent revert: the first rebase attempt was cut against a master predating #5085 and its diff showed 117 deletions in `tests/unit/storage/test_blob_gc.py` — it would have reverted that PR's protection tests. Re-cut against current master; the diff now touches no blob-GC file. ## Timing `devtools schema closure` reports `operations/archive_root_relocation.py` and `storage/sqlite/durable_change_train.py` as **IN** the derived schema closure. Must merge before a fresh rebuild starts, never during one. ## Residuals `_SOURCE_CONTINUITY_REFRESH_V1_FORMAT` and its `_legacy_source_continuity_*` helpers are left in place: they sit on the *retained* refresh path, which `maintenance/blob_ref_liveness_reconciliation.py` still calls. Separate blast radius, separate decision. 🤖 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]>
) ## Summary Works the 15 unrecorded Codex P1 findings on `polylogue/maintenance` (bead polylogue-1tyq5.196). One real defect is fixed here; 13 are already fixed on master or cite deleted code; one is real but needs a durable owner-resolution reason and is tracked in its own bead. ## Problem `_source_exists` only understood the snapshot's `archive!member` coordinate. The ZIP readers (`decoder_zip.py:304-380`, `import_explain.py:648`) record `archive:member`, so a raw whose blob reference was absent was typed blocking `source_lost` while its archive and member were still on disk. ## Solution Resolve the colon form through `polylogue.core.raw_coordinates.zip_member_coordinate`, which tries each colon and accepts only a prefix that is a real ZIP, so a loose file with a colon in its name still resolves literally. ## Verification AgentCTL: `verify_quick` job 2727, `pytest_focused` job 2728 (passed). ## Self-review - **Sibling sites:** The other consumer of member coordinates in this module is the frontier join, which already builds `root:member` (source_conservation.py:895); `_source_exists` was the only `!`-only parser. - **Fail closed:** A colon prefix counts only when it is a real ZIP; a missing ZIP or member returns False, and an unreadable ZIP keeps the existing container-existence rule. - **Tests prove the production route:** The tests call `_source_exists`, the function `audit_source_conservation` uses; the first fails on master because the colon form returned False. - **Unbounded work / compatibility / identity:** No new I/O beyond one namelist per container (cached); no shim or dual path; no hashed or derived-identity file touched. ## Findings | Finding | Disposition | Evidence | Test | |---|---|---|---| | F001 | fixed-already | Already fixed on master: the blob-integrity owner passes `active_index_context` through to `_check_blob_integrity` (polylogue/maintenance/archive_verification.py:1047), introduced in #4149. | | | F002 | stale | The browser-capture export-denominator branch and `_iter_chatgpt_conversations` were removed when #4188 rebased ChatGPT conservation on the real denominator; nothing on master still runs this code. | | | F003 | stale | `polylogue/maintenance/assertion_transition.py` was deleted in #5079 (9d5a020, the durable-reference transition actuator). | | | F004 | stale | `polylogue/maintenance/assertion_transition.py` was deleted in #5079 (9d5a020), including the successor-manifest holdout path. | | | F005 | stale | The closure repair planner (`plan_blob_reference_closure`, `_acquired_attachment_ids`) was deleted with the generic repair product in #4698 (cfc4c73); blob_reference_closure.py is now a read-only law whose predicate excludes ref_count 0. | | | F006 | stale | `polylogue/maintenance/cursor_authority_reconcile.py` was deleted in #4618 (63f2043) with the historical source control planes. | | | F007 | fixed-already | Already fixed on master: a present parent with unresolved references is classified `materialized_unresolved` (parent_session_accounting.py:397-402) and those references count in `unresolved_reference_total`, which is part of `blocking_count` (:144, :493-498). | | | F008 | tracked | Still real: the writer stores a metadata-only attachment whose named owner message is absent with ref_count 0 and no ref, and conservation classifies every such row as the non-blocking `attachment_unowned`; the owner-resolution reason (`MESSAGE_MISSING` vs `OWNER_AMBIGUOUS`) is not durable, so the check cannot tell them apart. | polylogue-3ezec | | F009 | fixed-already | Already fixed on master: `acquired_attachment_missing_ref_predicate` requires `ref_count != 0` (polylogue/storage/blob_liveness.py:27-34), so typed-unowned rows (ref_count 0) no longer trip attachment-coverage or blob-reference-closure. | | | F010 | fixed-already | Already fixed on master: a raw at a configured path whose digest is not the member's current one is skipped as an ordinary historical revision (source_conservation.py:930-943). | | | F011 | fixed-already | Already fixed on master: the content witness is per membership, matched against any session the raw materialized, so sibling sessions of a grouped raw no longer report `content_mismatch` (source_conservation.py:947-970). | | | F012 | fixed-already | Already fixed on master: mutable-SQLite members compare the logical-revision digest; the path-only disjunct is gone (source_conservation.py:899-913). | | | F013 | fixed-already | Already fixed on master: raws are indexed by canonical source path once, making the member loop linear (source_conservation.py:863-872). | | | F014 | fixed | `_source_exists` now also resolves the `<container>:<member>` coordinate the ZIP readers record, through the shared `zip_member_coordinate` parser, so a present member of a present ZIP is conserved instead of reported `source_lost`. | tests/unit/maintenance/test_source_conservation_zip_coordinates.py::test_colon_member_coordinate_of_a_present_zip_is_conserved | | F015 | fixed-already | Already fixed on master: `build_wanted_source_receipt` raises when no source is declared (source_manifest_continuity.py:508-513). | | ## Residuals F008 stays open in its own bead: telling a missing owner message apart from an ambiguous owner needs the writer to persist the owner-resolution reason. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Summary
Deletes the
maintenance durable-reference-transitionactuator and everything that existed only to serve it: the transition engine, its assertion-classification core, the durable-relation declaration module it read, the operations facade, the CLI group and its registrations, the docs section, and the tests that covered the removed route. Net −2,290 lines of maintained product and test mass, +0 replacement mechanism.Part of
polylogue-2x6xu(delete the campaign-only source-transition actuators).Problem
maintenance durable-reference-transition plan|applyexisted to carryuser.db/audit.dbreferences across a candidate → predecessor index-generation swap during the source-transition campaign. Its own docstring states the axis:sessions.session_id,messages.message_idandblocks.block_idare generated columns, so their text moves when the index schema moves, and the campaign needed a hand-run rebind to carry irreplaceable durable references across that move.Two facts make it dead:
SchemaSkew, and "the required recovery design is reconvergence through the production daemon" — not an offline hand-run rebind with its own receipt directory.Caller census at this head confirms no survivor depends on it:
polylogue/maintenance/assertion_transition.py— imported only bydurable_reference_transition.pyand themaintenance/__init__.pyre-exportpolylogue/storage/sqlite/archive_tiers/durable_references.py— read only byassertion_transition.pypolylogue/operations/durable_reference_transition.py— reached only from the deleted CLI group and one testSolution
Deleted, with every reference accounted for (source, CLI registration, generated surfaces, docs, ratchet baseline, tests):
polylogue/maintenance/durable_reference_transition.pypolylogue/maintenance/assertion_transition.pypolylogue/storage/sqlite/archive_tiers/durable_references.pyassertion_transitionpolylogue/operations/durable_reference_transition.pypolylogue/cli/commands/maintenance/_durable_reference_transition.py_COMMANDS+_NESTED_GROUP_COMMANDSentriespolylogue/maintenance/__init__.pyre-exportsdocs/maintenance.md"Rebinding durable references across an index rebuild"docs/plans/sqlite-degradation-baseline.jsonentryNo compatibility shim, no deprecation stub, no absence gate was added in their place.
Test disposition, stated deliberately:
tests/unit/maintenance/test_durable_reference_transition.py(474 lines) — covered only the removed route; deleted with it.tests/unit/maintenance/test_assertion_transition.py(747 lines) — likewise; deleted.tests/unit/storage/test_durable_references.py— covered the deleted declaration module; deleted.tests/unit/operations/test_maintenance_read_profiles.py— retargeted, not weakened. Its live assertion (attachment_convergencecontains no rawsqlite3.connect) is kept verbatim; only the two assertions naming the deleted module were removed, along with a now-unused_readonlyprobe against it. The remaining test keeps its named anti-vacuity condition: a direct reader in a convergence operation fails the census.No test was relaxed to let a deletion pass.
Per the epic's deletion hazard note, the removed symbol names were grepped across comments and docstrings as well as call sites;
polylogue,devtools,tests,docsand.agentctlreturn zero residual references.Verification
consumer-reachabilityis the deciding gate: it is what would go red if a deleted module were still reachable from a registered surface.Selection scope is honest: this is a focused run, so it proves the selected maintenance/CLI/operations scope plus the full static gate set, not the whole corpus.
Residuals
polylogue-2x6xunames three campaign route groups. This PR lands one.archive-root-relocationandsource-continuity-recovery— together with their coupling intostorage/sqlite/durable_change_train.py— are still live and follow separately;durable_change_train.pyis inside the derived schema closure (devtools schema closurereportsIN), so that change must land before the rebuild starts.refresh_released_source_train_continuity,write_source_continuity_pending_intent,assert_source_continuity_apply_allowed) is not campaign-only —maintenance/blob_ref_liveness_reconciliation.py, a retained blob-owner module, calls it. It stays.🤖 Generated with Claude Code
https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK