Skip to content

fix: block uncertain writes across checkpoint resume paths - #33

Merged
TaewoooPark merged 2 commits into
mainfrom
codex/fix-7-uncertain-write-resume
Sep 24, 2026
Merged

TaewoooPark merged 2 commits into
mainfrom
codex/fix-7-uncertain-write-resume

Conversation

@TaewoooPark

@TaewoooPark TaewoooPark commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Fixes #7.

An interrupted write was classified as read-only, and interactive /resume / --continue could load its pending checkpoint without the uncertainty check. This can continue a conversation without knowing whether the write took effect.

This patch records new writes as mutating and checks both the stored flag and current classification, covering legacy journals with mutating: false. Core, journal and interactive continuation refuse uncertain execution before installing history or calling the model. A failed --continue also does not silently submit its initial task as a new run. Read-only and completed interactive conversations remain resumable; existing compatibility checks and journal format are unchanged.

Validation:

  • 24 added regressions: lifecycle interruption boundaries, legacy/current flags, stored true flags, corruption/compatibility precedence, and all continuation entry points. The relevant refusal cases fail on the original implementation.
  • Built CLI against a localhost fixture: legacy false write goes from exit 0 / one model request to exit 2 / zero requests; a durable completion checkpoint still resumes. This proves unsafe acceptance was blocked, not that the baseline repeated the write.
  • Actual macOS PTY: /resume and --continue × legacy false / true write / read-only / completed, all 8 cases pass. Refusal leaves history/channel intact and sends zero model requests.
  • pnpm test: 726 tests across 42 files; pnpm typecheck, pnpm build, pnpm lint:tools, and git diff --check pass locally. GitHub CI passes all five jobs: Node 20/22, Linux ARM64, Python, and template goldens.

Review window: until 2026-09-25 00:30 KST (2026-09-24 15:30 UTC). Please review this PR over the next two days, especially legacy journal compatibility and interactive continuation. It will remain open for review; no merge or release is part of this change.

@TaewoooPark

Copy link
Copy Markdown
Owner Author

The previously announced review window has not quite ended, but there are no outstanding change requests, so I am wrapping up the review and merging this now.

The head remains 502bb67. The maintainer checks covered legacy/current uncertain writes, read-only and durably completed resumptions, and the interactive continuation paths. The combined build with current main and #34 passed 770 tests plus the actual CLI/PTY fixture checks; all five checks on this PR are green: https://github.com/TaewoooPark/Motifcode/actions/runs/35745240399.

This will close #7 and is planned for 0.3.4. Thanks to everyone following the session-recovery work!

@TaewoooPark
TaewoooPark merged commit 524369d into main Sep 24, 2026
5 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.

Block resuming checkpoints with an uncertain in-flight write

1 participant