Persist planning request lifecycle bindings - #43
Merged
Merged
Conversation
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
settleSuggestioncan 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 passednpm run typecheck— passednpm run test:browser— 43 passedgit diff --check— passedReview readiness:
884c7ef1f2b6f873d5514c5bbaa9a67fe1c52c46Review 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.mdrule is needed.