Skip to content

Persist planning request lifecycle bindings - #43

Merged
mchwang merged 1 commit into
mainfrom
codex/planning-request-lifecycle
Sep 24, 2026
Merged

mchwang merged 1 commit into
mainfrom
codex/planning-request-lifecycle

Conversation

@mchwang

@mchwang mchwang commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #34.

Suggestion requests now persist their repository snapshot and terminal reason alongside the plan revision. Completion and Apply compare the saved binding with the current plan atomically, while settleSuggestion can clean up only the exact pending attempt, so a losing cleanup cannot destroy a result completed by another process.

Plan or snapshot changes retain completed replies as invalidated history with a concrete reason. Schema v4 safely terminalizes active v3 requests that lack snapshot bindings, and restart recovery preserves failed and cancelled reasons without allowing late completion or Apply.

Validation on pushed head 884c7ef1f2b6f873d5514c5bbaa9a67fe1c52c46:

  • npm test — 346 passed
  • npm run typecheck — passed
  • npm run test:browser — 43 passed
  • git diff --check — passed
  • GitHub CI — passed

Review readiness:

Review round 1: Copilot recommended approval with no findings. Nothing changed or declined.

Review-lesson audit: no review findings. Existing repository async-job rules already cover guarded publication, persisted state separation, cancellation settlement, and snapshot-staleness regressions; no new AGENTS.md rule is needed.

Copilot AI lite review requested due to automatic review settings September 24, 2026 17:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

All reviewed changes have no unresolved findings, and validation passes.

Review effort: Lite
Findings: None

What changed in this PR

Persists snapshot bindings and terminal reasons for planning suggestion requests, preventing stale completion or Apply operations across revisions, restarts, and processes.

Changes:

  • Adds schema v4 migration and lifecycle metadata.
  • Makes completion, settlement, and Apply operations binding-aware and atomic.
  • Adds migration, concurrency, restart, and invalidation coverage.
File Description
test/​store.test.ts Covers races, migration, restart recovery, and stale requests.
test/​review.test.ts Updates legacy database migration coverage.
runner/​store.ts Implements persistent request bindings, reasons, migration, and guarded lifecycle transitions.
docs/​implementation/​persistent-review-store.md Documents lifecycle and schema behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mchwang
mchwang merged commit ff2daca into main Sep 24, 2026
3 checks passed
@mchwang
mchwang deleted the codex/planning-request-lifecycle branch September 24, 2026 17:25
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.

F1/G4: persist planning failure reasons and atomic snapshot binding

2 participants