Recover exact Change delivery after central retirement #748

Open
toasterson wants to merge 5 commits from fix/central-retired-delivery-recovery into main
Owner

Central sessions that retired after producing an unsuperseded Change could remain retained forever when Git publication failed or never began. The normal publisher correctly fences retired owners, but no audited recovery path could preserve the exact Change and finish required Git/PR delivery.

This adds a PAT-only, project-authorized recovery tool. It persists a successor publication request before effects, requires a fresh authenticated snapshot from the original retired workspace, refuses unrelated pending or unknown publication outcomes, and revalidates ownership and the Change under the work-item lock. Only an exact recovery that reaches published reopens that Change to the existing PR delivery path; the session itself remains retired and owned until ordinary completion proves the PR applied.

Validation:

  • cargo check -p anima-server --tests
  • 2 focused delivery-recovery unit tests
  • PostgreSQL fault-injection regression cancelled_primary_publishes_completed_owned_followup against an owned ephemeral PostgreSQL 17 container, covering known failed publication, outsider RBAC denial, closing-owner denial, same-request idempotency, fresh snapshot reread, and retained lifecycle ownership

Tracks Anima work item 01a0c8a0-8f6f-77e0-86ce-81183a209f53.

Central sessions that retired after producing an unsuperseded Change could remain retained forever when Git publication failed or never began. The normal publisher correctly fences retired owners, but no audited recovery path could preserve the exact Change and finish required Git/PR delivery. This adds a PAT-only, project-authorized recovery tool. It persists a successor publication request before effects, requires a fresh authenticated snapshot from the original retired workspace, refuses unrelated pending or unknown publication outcomes, and revalidates ownership and the Change under the work-item lock. Only an exact recovery that reaches `published` reopens that Change to the existing PR delivery path; the session itself remains retired and owned until ordinary completion proves the PR applied. Validation: - `cargo check -p anima-server --tests` - 2 focused delivery-recovery unit tests - PostgreSQL fault-injection regression `cancelled_primary_publishes_completed_owned_followup` against an owned ephemeral PostgreSQL 17 container, covering known failed publication, outsider RBAC denial, closing-owner denial, same-request idempotency, fresh snapshot reread, and retained lifecycle ownership Tracks Anima work item `01a0c8a0-8f6f-77e0-86ce-81183a209f53`.
fix: keep recovery publication state monotonic
Some checks failed
CI / conflict-check (push) Successful in 7m10s
CI / test (push) Failing after 19m46s
d52b7ccf2f
Fix delivery recovery monotonic-state lint
Some checks failed
CI / conflict-check (push) Successful in 29m28s
CI / test (push) Failing after 35m0s
f625776787
Some checks failed
CI / conflict-check (push) Successful in 29m28s
CI / test (push) Failing after 35m0s
This pull request has changes conflicting with the target branch.
  • crates/anima-server/src/central_sessions.rs
  • crates/anima-server/src/mcp/handlers.rs
  • crates/anima-server/tests/central_session_results.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/central-retired-delivery-recovery:fix/central-retired-delivery-recovery
git switch fix/central-retired-delivery-recovery

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff fix/central-retired-delivery-recovery
git switch fix/central-retired-delivery-recovery
git rebase main
git switch main
git merge --ff-only fix/central-retired-delivery-recovery
git switch fix/central-retired-delivery-recovery
git rebase main
git switch main
git merge --no-ff fix/central-retired-delivery-recovery
git switch main
git merge --squash fix/central-retired-delivery-recovery
git switch main
git merge --ff-only fix/central-retired-delivery-recovery
git switch main
git merge fix/central-retired-delivery-recovery
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
toasterson/Anima!748
No description provided.