Repository navigation
feat(daemon): apply declared durable migrations at archive open - #5689
Conversation
Applying a declared durable migration had no production route once the maintenance command was deleted. polylogued run now applies every pending durable change train when it opens the archive, under the exclusive ownership it already holds and before it serves. A step that changes existing data runs only behind a backup the daemon takes and scratch-verifies under that ownership. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
|
You have reached your Codex usage limits for security reviews. Please try again later. |
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: 9618bcc7da
ℹ️ 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".
…orage One open now advances each durable tier step by step to the declared version, taking a backup before each data-changing step, and refuses to loop if a train does not advance. The daemon reaches archive ownership through operations rather than importing storage directly. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Summary
polylogued runnow applies pending declared durable migrations when it opens the archive, before it serves anything. A step that changes existing data runs only behind a backup the daemon takes itself and scratch-verifies.Problem
source,user,audit) evolve by numbered migrations with change-train sidecars. refactor(maintenance): delete archive repair and bootstrap commands #5646 deletedops maintenance migrate-tier, their only application route, soexecute_durable_change_trainhad no production caller.Solution
operations/durable_change_train.pygainspending_durable_migrations. It lists each durable tier standing below the runtime's declared version that has a complete declared route (every step from the current version to the target) and says whether any step requires a backup. A tier with no declared route is left alone, and schema preflight still reports its skew.daemon/durable_migrations.pyaddsapply_declared_durable_migrations. For each pending tier it runsexecute_durable_change_trainunder the daemon's write lease, with the daemon's exclusive archive ownership. The daemon keeps that ownership afterwards, so the train's release is a no-op.pre_migration_backupfirst runsbackup_archive(verify=True)into.maintenance-state/pre-migration-backups/:user_overlaysprofile for user and audit, andrebuildable_cache_excludefor source, which carries its blobs.backup_archiveacceptsarchive_owner: the caller's existing exclusive ownership. The backup copies under that ownership instead of acquiring its own, which the daemon's own lock would refuse at open.daemon/cli.pycalls the route right after durable-change-train reconciliation, inside the same ownership scope, and emitsdaemon.durable_migration.appliedfor each applied tier.docs/maintenance.mddescribes the route.Verification
tests/unit/daemon/test_durable_migrations.pyships synthetic numbered migration packages:sourcestep applies without a backup, and a second open is a no-op.userstep applies only after a verified backup; the manifest and verification receipt are present.devtools testovertest_durable_migrations.py,test_daemon_cli.pyandtest_backup.py:185 passed, 3 failed.test_run_daemon_services_parks_operation_recovery_on_audit_schema_mismatchfailed because the first version tried to migrate a tier with no declared route. That is fixed, and it passes on rerun with the migration tests.test_run_daemon_services_waits_for_fts_startup_before_watcher(2 parametrizations) fails the same way on current master: its fake converger lacks thederivation_barrierargument fix(daemon): repair backup scope, restart resume and derivation barrier #5664 added.devtools gate mypy:Success.devtools gate schema-closure:ok, no change (567).Residuals
🤖 Generated with Claude Code
https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4