Summary
Turn durable run state into actual token-saving and correctness policy.
Scope
- Compute stable review scope/diff/prompt-policy keys.
- Adopt/reuse active matching runs before launch.
- Classify current, superseded, obsolete, inactive, lost, failed, skipped, and cancelled runs.
- Cancel only for explicit user stop, duplicate, obsolete/superseded scope, dead/lost process, hard budget exhaustion, or policy-backed inactivity.
- Never cancel solely because elapsed runtime is high.
Acceptance Criteria
Relationships
Parent: #324
Depends on: #325, #326
Related: #50
Finish Line
Every Code adopts or reuses matching live Auto Reviews before launching new ones, classifies superseded/obsolete runs from snapshot and activity evidence, and cancels only through explicit harness-owned policy.
Current Status
State: In PR review/checks.
PR #337 implements the first dedupe policy slice: Auto Review now persists a stable base+diff SHA-256 fingerprint plus changed-path metadata, skips launching duplicate reviews once an equivalent review is actually running, reuses completed equivalent reviews, and preserves duplicate-skipped ledger rows when the synthetic completion event is recorded.
A read-only reviewer caught two P1 adoption hazards before merge: duplicate in-flight skips were being surfaced as clean completions, and Pending rows could be mutually adopted before either session launched a model run. The PR now fixes both: only Reviewing/Resolving rows are adoptable, and duplicate-skip completions no longer carry a snapshot marker that would mark the target as reviewed.
Validation completed locally after the reviewer fixes:
cargo test -p code-core duplicate_lookup --lib
cargo test -p code-tui duplicate_skipped_background_review_does_not_mark_snapshot_reviewed --features test-helpers
cargo test -p code-tui auto_review_diff_fingerprint --features test-helpers
./build-fast.sh
Next action: wait for PR #337 GitHub checks/review, merge when clean, then rebuild the PATH code binary and dogfood whether equivalent auto reviews now skip without falsely reporting clean completion.
Blocked by: PR #337 checks/review.
Last verified: 2026-06-02 after pushing commit dae7ad3bac to PR #337.
Summary
Turn durable run state into actual token-saving and correctness policy.
Scope
Acceptance Criteria
Relationships
Parent: #324
Depends on: #325, #326
Related: #50
Finish Line
Every Code adopts or reuses matching live Auto Reviews before launching new ones, classifies superseded/obsolete runs from snapshot and activity evidence, and cancels only through explicit harness-owned policy.
Current Status
State: In PR review/checks.
PR #337 implements the first dedupe policy slice: Auto Review now persists a stable base+diff SHA-256 fingerprint plus changed-path metadata, skips launching duplicate reviews once an equivalent review is actually running, reuses completed equivalent reviews, and preserves duplicate-skipped ledger rows when the synthetic completion event is recorded.
A read-only reviewer caught two P1 adoption hazards before merge: duplicate in-flight skips were being surfaced as clean completions, and
Pendingrows could be mutually adopted before either session launched a model run. The PR now fixes both: onlyReviewing/Resolvingrows are adoptable, and duplicate-skip completions no longer carry a snapshot marker that would mark the target as reviewed.Validation completed locally after the reviewer fixes:
cargo test -p code-core duplicate_lookup --libcargo test -p code-tui duplicate_skipped_background_review_does_not_mark_snapshot_reviewed --features test-helperscargo test -p code-tui auto_review_diff_fingerprint --features test-helpers./build-fast.shNext action: wait for PR #337 GitHub checks/review, merge when clean, then rebuild the PATH
codebinary and dogfood whether equivalent auto reviews now skip without falsely reporting clean completion.Blocked by: PR #337 checks/review.
Last verified: 2026-06-02 after pushing commit
dae7ad3bacto PR #337.