Skip to content

fix(context-cli): keep later production stages and cancel partial revision delivery on rollback - #108

Merged
qiansc merged 1 commit into
mainfrom
fix/task-rollback-later-production
Nov 13, 2026
Merged

qiansc merged 1 commit into
mainfrom
fix/task-rollback-later-production

Conversation

@qiansc

@qiansc qiansc commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #107 with two rollback fixes found in review.

A production stage prepared after a rollback could be deleted

A rollback recorded production only when a stage existed, and cleanup treated a missing record as an older state that discards whatever stage it finds. A stage prepared after the rollback was applied (for example with a prepare-current command obtained earlier) was therefore deleted when the rollback finished.

  • New rollbacks always record production: the stage and whether it is discarded, or null when no stage existed. A missing field still means an older state.
  • Finishing a rollback discards only the stage it recorded with discard: true. A stage it did not record (null, or a different stage id) is kept; only the rollback record is removed and the result reports production: "kept". Previously a changed stage id threw an error that could not be resolved while the rollback stayed active.

Partial delivery of a page revision stopped close after a rollback

Rolling back replaced the revision pointer but left revision-delivery.json, so context close validated the old selection and failed with "Partial revision delivery is no longer active".

  • The rollback deletes the delivery selection in the same transaction, includes its bytes in the plan digest, and lists its pages in the preview as discarded_revision_delivery.

Guides (3 copies) and the CHANGELOG Unreleased section are updated.

Tests

  • New: a stage prepared after a rollback without one is kept when the rollback finishes.
  • New: rolling back a partially delivered page revision closes, builds and finishes.
  • Both fail on main and pass with this change.
  • 34 related test files: 206 pass, 0 fail; guide consistency tests pass; typecheck and lint clean (no new warnings).

🤖 Generated with Claude Code

…ision delivery on rollback

A rollback now always records the production stage it found (null when none),
so finishing it never discards a stage prepared afterwards. Rolling back also
deletes the partial revision delivery selection of the replaced revision, which
otherwise stopped close.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qiansc
qiansc merged commit 6eed4b0 into main Nov 13, 2026
2 checks passed
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