Skip to content

chore: Delete the campaign archive-root transition bridges - #5083

Closed
Sinity wants to merge 1 commit into
delete-durable-reference-transitionfrom
delete-campaign-root-transition-bridges
Closed

Sinity wants to merge 1 commit into
delete-durable-reference-transitionfrom
delete-campaign-root-transition-bridges

Conversation

@Sinity

@Sinity Sinity commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Summary

Deletes the two remaining campaign-only archive-root transition bridges named in polylogue-2x6xu's census — maintenance archive-root-relocation and maintenance source-continuity-recovery — together with their operations modules, daemon startup assertions, durable-train coupling, generated CLI output schemas, docs and tests. Net −8,887 / +29 lines across 23 files, with no replacement mechanism added.

Stacked on #5079 (delete-durable-reference-transition); review only the second commit.

Problem

Both routes act on an old configured archive root, and both say so themselves at this head:

  • archive-root-relocation is documented as usable "only after an offline inode-preserving root move", with --old-root naming "the retired pre-move root". It CAS-revises released source/user/audit train manifests and remaps every retained index generation's sealed archive_root, index_path and absolute tier symlinks.
  • source-continuity-recovery is documented verbatim as "a one-purpose bridge for a committed pre-fix(storage): attest source mutations across train continuity #3868 blob-reference-liveness receipt that lacks the modern manifest digest and post-orphan fields."

The archive is about to be wiped and rebuilt from current code. A fresh archive has no retired pre-move root and no pre-#3868 receipt, so neither bridge has an input it can act on — they are dead by construction the moment the rebuild happens, not merely unused today. Nothing in either points forward at an unfinished new shape: the forward route for changing a root is a verified full_evidence backup restored at the new root plus ordinary daemon reconvergence, which is what the rewritten docs/archive-backup.md section now documents.

They also sat on the daemon's hot path. polylogued run, polylogued watch, and _reconcile_durable_change_train_startup_locked each called assert_no_prepared_archive_root_relocation / assert_no_prepared_historical_source_continuity_recovery before any other startup work — a fail-closed check for prepared campaign state that a fresh root can never contain.

Timing: devtools schema closure reports polylogue/operations/archive_root_relocation.py and polylogue/storage/sqlite/durable_change_train.py as IN the derived schema closure. This must land before the rebuild starts; landing it mid-run would silently invalidate the run.

Solution

Deleted outright — no shim, no deprecation stub, no absence gate:

Removed Note
operations/archive_root_relocation.py (2083) in the derived schema closure
operations/historical_source_continuity_recovery.py (1447)
operations/historical-source-continuity-operation-20260807.json dated campaign operation descriptor
cli/commands/maintenance/_archive_root_relocation.py, _source_continuity_recovery.py + _COMMANDS / _NESTED_GROUP_COMMANDS entries
daemon/cli.py × 3 call sites prepared-receipt startup assertions
migration_runner.validate_full_evidence_backup_for_archive_root_relocation reachable only from the deleted operation
render_cli_output_schemas.py × 2 specs + both docs/schemas/cli-output/*.schema.json + README rows generated surface
docs: maintenance.md, archive-backup.md, sqlite-connection-policy.md sections rewritten, not merely trimmed
devtools/patterns/baselines/{exclusive-create-write,replace-without-parent-fsync}.txt, sqlite-degradation-baseline.json ratchet baselines shrink

Durable-train surgery — where the cut lands, and why there. The bead requires "stripping only campaign source-continuity recovery from the general durable train implementation. Do not delete the general train engine." Removed from durable_change_train.py as reachable only from the two deleted operations:

  • rebind_released_durable_train_archive_identity ("the one permitted root-relocation revision of a durable train")
  • recover_released_source_train_continuity
  • write_source_continuity_relocation_transition, _read_source_continuity_relocation_receipt, _validate_archive_root_relocation_receipts
  • the relocation branch of the authority-chain validator; _SourceContinuityAuthorityKind is now Literal["refresh"] and _validate_source_continuity_refresh_receipt lost its allowed_pending_relocation_receipt_sha256 parameter

Kept, deliberately: the general train engine, and the source-continuity refresh API — refresh_released_source_train_continuity, write_source_continuity_pending_intent, assert_source_continuity_apply_allowed. These are not campaign-only: maintenance/blob_ref_liveness_reconciliation.py, a retained blob-owner module the bead explicitly excludes, is a live caller of all three. That caller is the boundary this change cuts along.

Deletion-hazard check. Per the epic's note that "a comment that names a mechanism is an uncaught reference to code", removed symbol names were grepped across comments and docstrings, not only call sites. One hit: the docstring of _released_train_proven_floor explained the fresh-bootstrap marker as a fact "carried by evidence archive-root relocation already rebinds". It is corrected in this PR rather than left describing a deleted mechanism. Post-change grep for all removed names across polylogue, devtools, tests, docs, .agentctl returns zero hits.

Test disposition, stated deliberately:

  • tests/unit/storage/test_archive_root_relocation.py (4412 lines) — covered only the deleted route; deleted with it. It was also the only coverage of the removed relocation branch of the chain validator, so that logic and its tests leave together.
  • test_archive_maintenance_cli.py — the two archive-root-relocation CLI tests removed; the rest of the file is untouched and still runs.
  • test_daemon_cli.py — test_daemon_archive_root_relocation_prepared_receipt_blocks_components removed: it asserted the startup block this PR deletes.
  • test_archive_identity.py — kept unchanged in behavior, only renamed off the deleted route's name (..._after_archive_root_relocation → ..._after_a_root_move). It exercises ArchiveLocation pointer resolution after a plain filesystem move, which survives.

No test was weakened or relaxed to let a deletion pass.

Verification

$ devtools test tests/unit/storage/test_durable_change_train.py tests/unit/storage/test_archive_identity.py \
      tests/unit/storage/test_blob_ref_liveness.py tests/unit/storage/test_durable_migrations.py \
      tests/unit/daemon/test_daemon_cli.py tests/unit/cli/test_archive_maintenance_cli.py \
      tests/unit/cli/test_maintenance_registration.py tests/unit/devtools/test_verify_distribution_surface.py
============ 454 passed, 2 xfailed, 1 warning in 201.07s (0:03:21) =============
devtools test: PASSED exit=0 diagnosis=pytest_passed

That selection is the point: test_durable_change_train.py and test_blob_ref_liveness.py are the retained owners of the machinery the surgery cut around, and both are green.

$ devtools verify --quick        # exit 0 — all 16 gates ok
  gate consumer-reachability ... ok (29.9s)
  gate layering ... ok (21.3s)
  gate mypy ... ok (17.4s)

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

$ devtools render all --check    # exit 0; grep -ci "out of sync" → 0
$ devtools schema closure polylogue/storage/sqlite/durable_change_train.py
IN   polylogue/storage/sqlite/durable_change_train.py

Scope is honest: focused run plus the full static gate set, not the whole corpus.

Residuals

  • The derived schema identity moves with this change. It must land before the rebuild starts; landing it during a run silently invalidates that run.
  • polylogue-2x6xu should be closeable once this and chore: Delete the durable-reference transition actuator #5079 land. Its earlier "already implemented" claim was wrong — all three route groups were live at f90c94d79.
  • Not touched, and still carrying "legacy"-shaped surface under the operator directive: _SOURCE_CONTINUITY_REFRESH_V1_FORMAT and its _legacy_source_continuity_* helpers in durable_change_train.py. These read a v1 refresh receipt shape from disk. They are dead against a fresh archive for the same reason as the above, but they belong to the retained refresh path, so removing them is a separate decision with a separate blast radius — I did not fold it in unasked. Flagging it rather than silently leaving it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK

Two one-purpose campaign bridges are removed with their CLI groups,
operations modules, daemon startup assertions, durable-train coupling,
generated schemas, docs and tests:

- `maintenance archive-root-relocation` — moved an OLD archive root to a
  new one in place, rebinding released durable-train identity and every
  retained index generation's sealed paths.
- `maintenance source-continuity-recovery` — a self-described
  "one-purpose bridge for a committed pre-#3868 blob-reference-liveness
  receipt that lacks the modern manifest digest and post-orphan fields".

Both act on an old configured root. A rebuilt-from-scratch archive has no
retired pre-move root and no pre-#3868 receipt, so both are dead by
construction after the restart; the replacement for changing a root is a
verified full_evidence backup restored at the new root plus ordinary
daemon reconvergence. Neither points forward at an unfinished shape.

Also removed as reachable only from these two:

- `migration_runner.validate_full_evidence_backup_for_archive_root_relocation`
- `durable_change_train`: `rebind_released_durable_train_archive_identity`,
  `recover_released_source_train_continuity`,
  `write_source_continuity_relocation_transition`,
  `_read_source_continuity_relocation_receipt`,
  `_validate_archive_root_relocation_receipts` and the relocation branch
  of the continuity authority chain (`_SourceContinuityAuthorityKind` is
  now `Literal["refresh"]`).

The general durable train engine stays, and so does the source-continuity
*refresh* API (`refresh_released_source_train_continuity`,
`write_source_continuity_pending_intent`,
`assert_source_continuity_apply_allowed`): `maintenance/
blob_ref_liveness_reconciliation.py`, a retained blob-owner module, is a
live caller. That is the boundary this change cuts along.

Per the deletion-hazard rule, a comment in `_released_train_proven_floor`
that explained the fresh-bootstrap marker as "carried by evidence
archive-root relocation already rebinds" was corrected rather than left
describing a deleted mechanism.

Test disposition: tests/unit/storage/test_archive_root_relocation.py
(4412 lines) covered only the deleted route and is removed with it; the
two archive-root-relocation CLI tests in test_archive_maintenance_cli.py
and the prepared-receipt startup-block test in test_daemon_cli.py are
removed for the same reason. test_archive_identity.py keeps its
pointer-resolution test unchanged, renamed off the deleted route's name.
No test was weakened.

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

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: cf25e257-d58b-4d06-9b1c-a37023e4aa7b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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 deleted the branch delete-durable-reference-transition September 14, 2026 15:52
@Sinity Sinity closed this Sep 14, 2026
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]>
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