fix: preserve review provenance and validate loop readiness - #85
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eaa720d3a5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let writeback = existing.find( | ||
| (entry) => | ||
| signal.writebackRefs.includes(entry.id) || |
There was a problem hiding this comment.
Attach every source writeback in a signal family
When reconciliation correlates two or more existing writebacks into one signal—for example, because they target the same asset—this find selects only the first match. The subsequent proposeEvolution call receives only that writeback, and the active-proposal path likewise links only it, so the remaining source writebacks never enter sourceWritebacks; their evidence is omitted from the draft, verification baseline, and apply/verify status transitions. Preserve or link every matching source writeback rather than collapsing the family to one record.
AGENTS.md reference: AGENTS.md:L62-L65
Useful? React with 👍 / 👎.
| args.coverageState !== "stale" && | ||
| latestSourceAt && | ||
| Date.parse(latestSourceAt) <= Date.parse(cursorAt) |
There was a problem hiding this comment.
Treat quiet non-Git sources as caught up
After a normal scheduled run, the next window starts at lastSuccessfulCoverageUntil, which can be later than the source watermark. If no new data exists, the writeback and evidence-export adapters return a successful empty scan without latestSourceAt; this condition therefore skips source_caught_up and eventually falls through to threshold_exceeded. The default writeback source consequently emits persistent stale alerts after a quiet week even though every requested window was scanned successfully, so caught-up handling must also cover authoritative empty scans or those adapters must report their latest observed timestamp.
Useful? React with 👍 / 👎.
## [2.31.2](v2.31.1...v2.31.2) (2026-09-14) ### Bug Fixes * preserve review provenance and validate loop readiness ([#85](#85)) ([b0d5cae](b0d5cae))
|
🎉 This PR is included in version 2.31.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Restoring missing review source files exposed two misleading behaviors: write-access preflight reported ready without valid source configuration, and proposal materialization copied existing writebacks and marked their families resolved while the proposals were still pending.
This change validates configuration and source selection during preflight, stops retrying deterministic configuration errors, reuses original writeback provenance, keeps pending families open with one decision action owned by their proposal, and suppresses age-only freshness warnings when a scan proves the source is caught up. Git freshness uses the same branch/path scope as its scan, avoiding permanent stale warnings from unrelated commits. AI JSON output awaits stdout completion; proposal review JSON excludes human-readable prefixes.
Regression coverage exercises missing/malformed/empty/disabled selections, retained source evidence, terminal disposition, pending proposal action identity, idle versus lagging source cursors, and parsed review JSON. Validation: lint and typecheck pass; 82 evolution-loop/action tests, 56 reconciliation tests, and 33 CLI/preflight tests pass. Compiled binary verification and package dry-run pass on the final candidate. Fresh Codex sandbox runs completed for the two repaired projects and the cleanup regression scope, retaining original writebacks without duplicate creation. A follow-up sandbox verification after the Git scope fix cleared the false stale item without creating new proposals or writebacks. Portable source definitions stay project-scoped; runtime queues and scheduler identity remain machine-local. No state-directory migration.