Skip to content

chore: Delete the durable-reference transition actuator - #5079

Merged
Sinity merged 1 commit into
masterfrom
delete-durable-reference-transition
Sep 14, 2026
Merged

Sinity merged 1 commit into
masterfrom
delete-durable-reference-transition

Conversation

@Sinity

@Sinity Sinity commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Summary

Deletes the maintenance durable-reference-transition actuator 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|apply existed to carry user.db / audit.db references across a candidate → predecessor index-generation swap during the source-transition campaign. Its own docstring states the axis: sessions.session_id, messages.message_id and blocks.block_id are 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:

  1. The archive is about to be rebuilt from scratch. A fresh archive has no predecessor index generation, so the plan step has nothing to classify against. The actuator becomes dead by construction the moment the rebuild happens.
  2. The standing design already owns this concern. Per CLAUDE.md, a moved derived-schema identity is a typed 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 by durable_reference_transition.py and the maintenance/__init__.py re-export
  • polylogue/storage/sqlite/archive_tiers/durable_references.py — read only by assertion_transition.py
  • polylogue/operations/durable_reference_transition.py — reached only from the deleted CLI group and one test

Solution

Deleted, with every reference accounted for (source, CLI registration, generated surfaces, docs, ratchet baseline, tests):

Removed Why it has no survivor
polylogue/maintenance/durable_reference_transition.py the actuator itself
polylogue/maintenance/assertion_transition.py sole consumer was the above
polylogue/storage/sqlite/archive_tiers/durable_references.py sole consumer was assertion_transition
polylogue/operations/durable_reference_transition.py operations facade for the deleted route
polylogue/cli/commands/maintenance/_durable_reference_transition.py CLI group
_COMMANDS + _NESTED_GROUP_COMMANDS entries command registration
polylogue/maintenance/__init__.py re-exports left the module a bare docstring
docs/maintenance.md "Rebinding durable references across an index rebuild" documented only the deleted verbs
docs/plans/sqlite-degradation-baseline.json entry ratchet baseline shrinks, never grows

No 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_convergence contains no raw sqlite3.connect) is kept verbatim; only the two assertions naming the deleted module were removed, along with a now-unused _readonly probe 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, docs and .agentctl return zero residual references.

Verification

$ devtools test tests/unit/maintenance tests/unit/operations/test_maintenance_read_profiles.py \
      tests/unit/cli/test_maintenance_registration.py tests/unit/cli/test_archive_maintenance_cli.py
============ 460 passed, 2 xfailed, 1 warning in 132.46s (0:02:12) =============
devtools test: PASSED exit=0 diagnosis=pytest_passed
$ devtools verify --quick        # exit 0
  gate format/lint/mypy/generated-surfaces/layering/patterns/doc-commands ... ok
  gate schema-manifest/oracle-integrity/testmon-selection ... ok
  gate consumer-reachability ... ok (26.2s)
  gate test-packages/timestamp-doctrine/durable-enum-checks/schema-privacy ... ok

consumer-reachability is the deciding gate: it is what would go red if a deleted module were still reachable from a registered surface.

$ devtools gate layering          # count: 0, status: passed
$ devtools render all --check     # exit 0, zero "out of sync"

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-2x6xu names three campaign route groups. This PR lands one. archive-root-relocation and source-continuity-recovery — together with their coupling into storage/sqlite/durable_change_train.py — are still live and follow separately; durable_change_train.py is inside the derived schema closure (devtools schema closure reports IN), so that change must land before the rebuild starts.
  • The train's general source-continuity refresh API (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.
  • Enum/vocabulary surfaces were untouched, so no durable migration is implied.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK

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
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 20891c0d-50ea-47b7-af70-11a8b11fafeb

📥 Commits

Reviewing files that changed from the base of the PR and between f90c94d and 6248e5c.

📒 Files selected for processing (13)
  • docs/maintenance.md
  • docs/plans/sqlite-degradation-baseline.json
  • polylogue/cli/commands/maintenance/__init__.py
  • polylogue/cli/commands/maintenance/_durable_reference_transition.py
  • polylogue/maintenance/__init__.py
  • polylogue/maintenance/assertion_transition.py
  • polylogue/maintenance/durable_reference_transition.py
  • polylogue/operations/durable_reference_transition.py
  • polylogue/storage/sqlite/archive_tiers/durable_references.py
  • tests/unit/maintenance/test_assertion_transition.py
  • tests/unit/maintenance/test_durable_reference_transition.py
  • tests/unit/operations/test_maintenance_read_profiles.py
  • tests/unit/storage/test_durable_references.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Sinity
Sinity merged commit 9d5a020 into master Sep 14, 2026
3 checks passed
@Sinity
Sinity deleted the delete-durable-reference-transition branch September 14, 2026 15:52
Sinity added a commit that referenced this pull request Sep 14, 2026
## 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]>
Sinity added a commit that referenced this pull request Sep 29, 2026
)

## 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant