Skip to content

chore: share one review checklist and gate pushes on the quick gate - #5788

Merged
Sinity merged 2 commits into
masterfrom
review-checklist-self-review
Sep 29, 2026
Merged

Sinity merged 2 commits into
masterfrom
review-checklist-self-review

Conversation

@Sinity

@Sinity Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • docs/review/codex-review-guide.md gains a Review exhaustively rule (report every issue in one pass, including every sibling site of a defect class) and a fifteen-item Checklist that replaces "Checks that are easy to miss". The checklist was mined from past review findings and keeps every still-valid rule of the old list.
  • Authors run the same checklist on their own full diff before every push, loop until a pass is clean, and narrate the last pass in a new Self-review PR-body section (AGENTS.md, "Commits and PRs").
  • .githooks/pre-push runs devtools verify --quick on the pushed HEAD. The hosted ci/circleci: quick-gate stays the enforced record.

Problem

We looked at 33 PRs with three or more Codex review rounds: 1,071 findings over 344 rounds. Of the 917 findings from round 2 onward, a per-finding relation label gives 368 (40%) as the same defect class at a site an earlier fix missed, 332 (36%) as a defect inside an earlier fix, 205 (22%) as new, and 12 (1.3%) as restatements. Codex kept finding about three real issues per round without decay, diffs grew 2.3x during review, and 29% of pushed heads came back red on CI. Most later rounds were paying for incomplete fixes that a review of our own diff could have caught.

Solution

Each finding got one primary defect-class label (a second when clearly applicable). Primary counts:

Class Findings
Same rule missing on a sibling route, caller, or record 184
Memory growing with input 83
Identity, hash, and key fields 80
Ordering, races, check-then-use 70
Interruption, cancellation, restart 64
Failure classification (transient, typed refusal) 56
Consumers and contract drift 50
Tests that miss the production route, stale stubs 50
Arbitrary caps, truncation, fixed timeouts 46
Silent skips and misreported outcomes 44
Cleanup on failure or refusal 44
Per-unit cost growing with the archive 31
Trust boundaries 21
Paging shape 20
Compatibility paths 1
Other domain logic 227

Across the classes, two more patterns recur by title: a copy, retry, or rerun that drops state it should keep (117 titles start with "Preserve", "Retain", or "Keep … across", in 30 PRs) and degenerate inputs such as zero, empty, or non-positive values (38 titles, 16 PRs). They became items 11 and 12. Memory and caps share one item because the remedy for one is the defect of the other; paging joins per-unit cost. "The fix itself" (item 2) covers the defects-inside-a-fix relation.

The pre-push hook gates only a pushed commit that is the checked-out HEAD with no tracked changes on top, because the gate reads the working tree. Tracked changes refuse the push; a pushed ref that is not HEAD is left to CI with a notice; a deletion runs nothing; a missing devtools refuses the push.

Verification

  • agentctl job start polylogue pytest_focused --workspace <worktree> --wait -- tests/unit/devtools/test_pre_push_hook.py (job 1961, head 38c6b126; later commits do not touch the hook or its test): devtools test: PASSED exit=0 diagnosis=pytest_passed, 6 passed.
  • agentctl job start polylogue verify_quick --workspace <worktree> --wait on 38c6b126 (job 1962): failed, render docs-surface: out of sync. The docs index row is generated from devtools/docs_surface.py; fixed at the source in 84f754af.
  • The same command on 84f754af (job 1985): polylogue:verify_quick succeeded.

Self-review

Two passes. Pass 1 found three defects, fixed before the first push: the checklist rewrite dropped still-valid details of the old items (item 11); the docs index row was edited in generated output instead of its source (item 13, caught by the quick gate); and the hook test asserted on stderr wording, which AGENTS.md rules out for behaviour tests (item 14). Pass 2 found nothing.

  • 1. Siblings and owners. The new rules are "authors self-review before every push" and "pre-push runs the quick gate". I grepped for older statements of each (grep -rn -i 'pre-push\|before pushing\|push hook' over docs, root Markdown, devtools, CI config): the only other claim, that a local verify --quick was optional, was in AGENTS.md and is replaced; CONTRIBUTING.md "Git Hooks" is updated. The checklist has one owner, the guide; AGENTS.md points to it rather than copying it.
  • 2. The fix itself. The docs-surface fix changes one description string in devtools/docs_surface.py. The rerun quick gate (job 1985) checks every generated surface, and all of them are in sync.
  • 3. Memory and limits. The hook caps nothing: it reads git's ref lines and then execs devtools verify --quick, which runs under 1 GiB.
  • 4. Cost per unit. One gate run per push, and only when HEAD is among the refs pushed. Deletions and refs the remote already has run nothing.
  • 5. Interruption. An interrupted hook aborts the push and leaves no state behind; nothing is written.
  • 6. Ordering and races. The gate reads the working tree, so the hook gates only when the pushed sha equals HEAD and git diff --quiet HEAD -- shows no tracked changes. Untracked files are not inspected, and the header comment says so.
  • 7. Failure classification. A missing devtools refuses the push (tested). A non-zero gate exit refuses it (tested).
  • 8. Silent outcomes. A pushed ref that is not HEAD is not gated. The hook says so on stderr and names CI as the check; it does not report a pass.
  • N/A 9. Cleanup on failure. The hook acquires nothing.
  • N/A 10. Identity and keys. No hash, ID, or key changes.
  • 11. Lossless transforms. Pass 1 compared the old eight checks with the new items line by line and restored what the rewrite had dropped: the P1 rule for unrecorded skips, the except sqlite3.Error pattern, "two classifiers that agree on today's fixtures", two interruption examples, and the definition of per-unit cost.
  • 12. Degenerate inputs. An empty ref list, a deletion (all-zero sha), and an unchanged ref each exit 0 without running the gate. The deletion case is tested.
  • 13. Consumers. Consumers of the guide and the hook: AGENTS.md (pointer and PR format), CONTRIBUTING.md, the docs index and its generator devtools/docs_surface.py. The main checkout's .githooks is the installed consumer (see Residuals).
  • 14. Tests and stubs. tests/unit/devtools/test_pre_push_hook.py pushes through a real git push to a bare remote with the repository's .githooks, so git supplies the hook's input. By reading the assertions (not by running mutants), each test fails on a named mutation: remove the exec devtools line and the first test fails (no gate call); ignore the gate's exit and the second fails (the remote advances); drop the dirty-tree check and the third fails; gate refs that are not HEAD and the fourth fails.
  • 15. Trust boundaries. No secrets, paths, or data from the operator's environment. The fixtures are synthetic ([email protected]), and the finding counts in this body are aggregates only.

Residuals

  • Hooks are read from the main checkout's .githooks (core.hooksPath is anchored there), so the new pre-push hook takes effect in every worktree once the main checkout is on a commit that includes it.
  • The hook runs the quick gate inside the pushing process, under about 1 GiB; an agent's memory scope has to hold it.
  • Class counts come from model labels over finding titles and bodies; the three labelers used "other domain logic" at different rates (120, 59, 48 of 357 each), so the smaller classes are approximate.
  • AGENTS.md "Code Review Rules" still repeats the compatibility and caps rules that the guide also states; they are left in place so Codex sees them even when it does not open the guide.

🤖 Generated with Claude Code

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

Sinity and others added 2 commits September 29, 2026 04:19
The Codex review guide gains an exhaustive-review rule and a fifteen-item
checklist mined from 1,071 findings on 33 multi-round PRs. Authors run the
same checklist on their own diff before every push and narrate the last pass
in a new Self-review PR-body section. A pre-push hook runs
`devtools verify --quick` on the pushed HEAD; the hosted quick gate stays
the enforced record.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Sinity
Sinity enabled auto-merge (squash) September 29, 2026 02:34
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 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
🔒 Security Review ✅ Completed 2026-09-29T02:43:35.153868Z 84f754a 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.

@Sinity
Sinity merged commit c9ef7bb into master Sep 29, 2026
3 of 4 checks passed
@Sinity
Sinity deleted the review-checklist-self-review branch September 29, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant