Repository navigation
feat(#1520): review by exception — a computed "Read first" PR comment partitions the diff into residue (nothing vouches for it), tests by seam class, and AC-explained hunks - #1587
Merged
admarble merged 10 commits intoOct 26, 2026
Conversation
…, AC-explained files Entire-Checkpoint: fa8cef753adc
…d by reading the PR Entire-Checkpoint: bcc791fbf411
…o read-only provider lists Entire-Checkpoint: b42b05e59f36
Entire-Checkpoint: 5e73974075ac
…nexport internals Entire-Checkpoint: f9fcc48db225
Entire-Checkpoint: 930df015ea50
…on records from the PR body, class prose seams by the #1566 rule QA on PR #1587 found the receipt missed two paths: a run ending AC_NOT_MET and a failing qa-only re-run never reached the post, which sat in the success-only PR branch. postReadFirstForPR now runs after the last QA iteration and resolves the PR itself: the post-QA PR, else the PR opened after exec (kept on IssueRunState.earlyPr), else the PR the state recorded. Mutation records merge the PR body with this run's exec output, so the cited gh pr view command is the real source. The prose seam class uses isProseGate, moved from health-report.ts to src/lib/prose-gate.ts so both surfaces count the same files. Two new AC-4 cases cover the failing-verdict paths. Entire-Checkpoint: f8fdd21b7523
… PR's own fix commits QA 2 risk finding: git log on HEAD included the branch's own commits, so a PR made of fix(...) commits flagged its own files as hot. The log now ends at the diff base, and the rendered command names that base. Entire-Checkpoint: 9aae3c696852
…ribution, fixtures are not tests, open-PR gate on the state fallback, dedup before collection, quotepath off, typed vi.mock form, log restricted to the diff's paths From the independent review of PR #1587. The Tests line now matches a SEQUANT_MUTATION record by the #939 classifier's rule (equal or bare-name suffix). A bare file name in evidence explains only a root-level file (R-2). __tests__/fixtures and __tests__/helpers are inputs, not tests. The state-record fallback posts only on a PR that is still open. The dedup read runs before the git collection. numstat and log run with core.quotepath=off; the log is restricted to the diff's paths so it is the query the comment prints. MOCK_CALL_RE recognises vi.mock(import("x")). Left as follow-ups: the live-provider default on the test path (same pattern as the postComment seam) and the fourth local git() wrapper. Entire-Checkpoint: 4dce7585c645
So AC-2's recorded mutation (removing src/lib/alpha.ts from the shared fixture's AC-1 evidence) fails exactly the gate test, as the record says, and no other case. Entire-Checkpoint: 6e2c4bad49ac
admarble
deleted the
feature/1520-feat-run-review-by-exception-a-computed-read-first
branch
October 26, 2026 05:01
This was referenced Oct 26, 2026
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.
Summary
Mutation-verified: AC-2 — removed
src/lib/alpha.tsfrom AC-1's evidence in the fixture issue body;review-residue.test.ts > buildReviewResidue > explains the 2 files AC-1's evidence names and leaves 3 as residuefailed (only that test); restored.(
parseMutationMarkersclassifies this markervalid.)After QA, every PR the orchestrator opens gets one comment starting
## Read first, with three sections in this order:real,mockorprose), any mocked module the project doesn't own, and its mutation record.Every line under Residue and Tests ends with the command that produced it. Before posting, it reads the PR's comments and skips if a Read-first comment is already there. If the git reads fail, it logs a warning and posts nothing.
scripts/qa/ac-attribution-rate.ts; the evidence command printsok. Result posted on #1520: 346 of 622 ACs (55.6%) across 215 issues.review-residue.test.ts: 11 passed-t "command": 2 casesreview-residue.post.test.ts: 4 passed. Runs QA, loop, QA throughrunIssueWithLoggingon a temp git repo and a fake provider: one post, none on a re-run, none when no qa ran, none when the git reads fail.scripts/qa/residue-outcomes.ts --since 2026-10-24 --jsonprintsok; all four counters are 0 today03Files:
src/lib/workflow/review-residue.ts(the partition, no I/O) andreview-residue.post.ts(git reads and the post).batch-executor.ts, where the newpostReadFirstForPRruns after the post-QA PR update.types.ts: areadFirstProvidertest hook on the issue context.github.ts: two read-only list methods; theghoutput buffer is raised to 32 MB because lists with bodies passed the 1 MB default.ghfixtures, the two scripts and their tests.docs/reference/review-residue.md, ADR-0021 and a CHANGELOG entry.Checks:
npm run build,npm run lintandnpm run lint:healthpass ("no metric rose above the baseline").npx vitest run --changed origin/mainin 3 shards (205 files) plus the whole-tree scanners and the tests that read changed files. 4,760 pass, 1 fails.The one failure is in a file this branch doesn't touch:
Settled against base
5ba85c18dorigin/main@683ce66e1driver-conformance.test.ts› codex › "git add and git commit succeed inside the driver's default sandbox": it was already failing on main, and #1480 tracks it.Weakest part: the comment isn't refreshed. A later run that changes the diff leaves the first comment in place, and only the
commitfield in its marker shows it's stale (see ADR-0021). The path matching also only counts exact paths or path suffixes in evidence; a directory named in evidence explains nothing.Coverage gaps: the two new provider methods are tested through the scripts' fixture tests only, not in
github.test.ts.Branch:
feature/1520-feat-run-review-by-exception-a-computed-read-first.Fixes #1520
Follow-ups
🤖 Generated by
sequant runRunner verification (2026-10-25, head
1858c1273)History. QA 1 on
5ba85c18d: AC_NOT_MET. Its class finding was real and visible on this PR: the Read-first post sat inside the success-only PR branch ofdeliverIssueBranch, so a run ending AC_NOT_MET (this PR's own run; it got no comment) or a failing qa-only re-run never posted. Owner's word: runner fixes, then qa-only re-runs.b5957373a:postReadFirstForPRruns after the last QA iteration on every verdict and resolves the PR itself (post-QA PR, else the PR opened after exec, kept onIssueRunState.earlyPr, else the state record); mutation records merge the PR body (fetchIssueon the PR number) with this run's exec output; theproseseam uses fix(qa): the proseGate metric counts any test file that mentions SKILL.md — 34 of 76 counted files are not prose gates; count only files that read a SKILL.md and assert on it #1566'sisProseGate, moved tosrc/lib/prose-gate.tsand imported byhealth-report.tstoo; two new AC-4 cases cover the failing-verdict paths.b5957373a: AC_MET_BUT_NOT_A_PLUS, 7/8 (AC-5 runner-owned).2a5a5f7bd: hot files are counted from history up to the diff base, so a PR made offix(...)commits no longer flags its own files; the rendered command names the base.57928b907: aSEQUANT_MUTATIONrecord matches its test file by the feat(qa): mutation-verification becomes a parseable §7 gate instead of honor-system prose #939 classifier's rule (equal or bare-name suffix); a bare file name in evidence explains only a root-level file (R-2);__tests__/fixturesand__tests__/helpersare not test files; the state-record fallback posts only on a PR that is still open; the dedup read runs before the git collection;core.quotepath=offon the numstat and the log; the log is restricted to the diff's paths so it is the query the comment prints;MOCK_CALL_RErecognisesvi.mock(import("x")). Left as follow-ups: the liveGitHubProviderdefault on the test path (the same pattern as the existingpostCommentseam) and a fourth localgit()wrapper.1858c1273: the bare-name attribution case carries its own issue body, so AC-2's mutation fails exactly the gate test.1858c1273: AC_MET_BUT_NOT_A_PLUS, 8/8. Its twofix_nowitems are test gaps on runner code, left as follow-ups by the owner's merge decision: no unit test feeds a PR body with aSEQUANT_MUTATIONrecord throughdeliverReadFirstComment, and none drivesresolveReadFirstPR's state-record fallback and open-PR guard (the fake provider always answers open andstateManageris null in the post tests). Its advisory notes: the test-line grep does not reproduce the classifier (doMock,vi.mock(import()), the prose rule); the attribution rate counts directory and ref tokens the comment rejects (reported, not gated); the verdict link names the issue, not the comment; rendered paths are not shell-quoted;residue-outcomes.tscounts issue-thread comments only.2a5a5f7bd; the PR-body marker merge and the state-manager fallback have no dedicated unit test (the fake-provider cases inreview-residue.post.test.tsand the testbed runs exercise the paths); the tautology command names a sequant-repo script (the issue's R-4 choice; a project without it gets an empty tautology line).ACs re-run on
1858c1273(branch worktree): AC-1ok(346 of 622, 55.6%, posted on #1520); AC-2 13 passed; AC-3 2 passed; AC-4 6 passed; AC-6ok(four zero counters); AC-70; AC-83. Execution-verification record for both scripts is on #1520.AC-5 (testbed). ad-motion #285 "(run 6)" on this head's dist: PR admarble/ad-motion#291;
gh pr view 291 --json comments --jq '[.comments[].body | select(startswith("## Read first"))] | length'→1, and it is comment index 0, the only comment. Sections: Residue none, Tests none, Explaineddocs/golden-run.md — AC-1, AC-2, verdict link, marker{"pr":291,"commit":"75b483d"}.suppressed12/other as in runs 3 to 5. Run 5 (#290) gave the same result on2a5a5f7bd. Both PRs closed unmerged; testbed reset. Details on #1520.Mutation reproduced by the runner on
1858c1273: removed`src/lib/alpha.ts` exports itfrom AC-1's evidence in the fixture issue body;review-residue.test.ts > buildReviewResidue > explains the 2 files AC-1's evidence names and leaves 3 as residuewas the only failure (1 failed, 12 passed); restored; 13 pass.Other checks. Freeze grep
0; no session links, attribution lines or home paths in the diff or commit messages; branch 0 behindmain;tsc,eslinton the changed sources,lint:health("no metric rose above the baseline") andnpm run buildpass;batch-executor.test.ts, model-ladder, suppressed-integration andmutation-marker.test.tspass.knip-advisoryfails with the pre-existing list, as on #1578 and #1585. The one known local failure is codexdriver-conformance(#1480), also failing onmain.