Skip to content

fix: preserve review provenance and validate loop readiness - #85

Merged
roodboi merged 2 commits into
mainfrom
codex/review-quality-recovery
Sep 14, 2026
Merged

roodboi merged 2 commits into
mainfrom
codex/review-quality-recovery

Conversation

@roodboi

@roodboi roodboi commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T16:39:07.608365Z eaa720d PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment thread src/evolution-loop.ts
Comment on lines +1270 to +1272
let writeback = existing.find(
(entry) =>
signal.writebackRefs.includes(entry.id) ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread src/reconciliation.ts
Comment on lines +1145 to +1147
args.coverageState !== "stale" &&
latestSourceAt &&
Date.parse(latestSourceAt) <= Date.parse(cursorAt)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@roodboi
roodboi merged commit b0d5cae into main Sep 14, 2026
4 of 5 checks passed
@roodboi
roodboi deleted the codex/review-quality-recovery branch September 14, 2026 16:41
github-actions Bot pushed a commit that referenced this pull request Sep 14, 2026
## [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))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.31.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant