Skip to content

ci: enforce the review findings that kept coming back - #165

Merged
ThomasK33 merged 9 commits into
mainfrom
ci/enforce-review-findings
Nov 24, 2026
Merged

ThomasK33 merged 9 commits into
mainfrom
ci/enforce-review-findings

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Turns five mistake classes that kept coming back in review into checks that fail in CI (or into code that can no longer be written), and records the rest as rules in AGENTS.md. The module zip check found a live bug: go test of the module zip fails on main today.

Classes, evidence and fix

Class Evidence Fix
A test reads files that the module zip leaves out #148, #158 (bench corpus); #143's TestUnion_MarshalJSON_RoundTripsTheG2Transcripts still fails in the module zip on main repoFiles (repo_files_test.go) is the one way to read such a file: it skips in the module zip, fails in a checkout when nothing matches. make test-module-zip builds the real zip with golang.org/x/mod/zip (new scripts/modzip module) and runs go vet + go test there. CI step added.
Line numbers in the barrier skill's model-to-code table go stale 9 PRs that touched connection.go rewrote 31-55 rows each (#68, #88, #89, #110, #129, #135, #139, #142, #153); a verifier on #135 found 153 of 258 numbers moved Rows now name the function and quote the code, as verify-session-cancel already did (its SKILL.md loses a stale "line numbers in this file" clause, and (1024) becomes 1024 entries so the check does not mistake a constant for a line). scripts/check-code-citations in make check fails on a line-number citation in any skill with a fingerprint.txt.
Code that a TLA+ model covers changes without the model main landed with a stale fingerprint.txt at 70aab41 and 2ca53de scripts/check-model-fingerprints in make check recomputes each fingerprint (no TLC, < 1 s), compares, restores the file on every exit (interrupts included) and names the steps.
int wraps on 32-bit Raised in #100, #118, #124, #138, #150, #152, #159; a 2^31 error code hung a request on 386 before #160 make test-386 (GOARCH=386 vet + test for the SDK and cmd/generate). CI step added.
A hand-typed count in a doc drifts "N types more" was wrong on #143, #150, #152, and again on main (says 114, is 126) Count removed from MIGRATION_v0.21.md; the v0.20.0 count (80), which a tag fixes, stays. Rule added.

AGENTS.md now ends with a table that pairs each rule with what enforces it. False doc sentences, fixes that miss a sibling path, and assertions that cannot fail stay "Nothing: judgment": no cheap mechanical check covers them. AGENTS.md also stops suggesting gofumpt -w ., which rewrites 13 files that the repo formats with gofmt.

Proof that each check fails on a real past mistake

  • make test-module-zip without the union test change: find the G2 transcripts: <nil> (0 files), exit 1.
  • scripts/check-code-citations on main's barrier SKILL.md: 94 citations, exit 1.
  • scripts/check-model-fingerprints at 70aab41: exit 1, lists receive. A one-line edit inside receive on this branch also fails it. (Commit 04b6206's message names three other functions; that is wrong, and 048c7ab corrects it.)
  • GOARCH=386 go test ./... in cmd/generate at 6c4769e: TestWriteTypesJen_ValidateChecksIntegerRanges fails with cannot unmarshal number 2147483648 ... of type int.

Protocol impact

None. No schema, generated file or SDK code changes; test, script, CI and doc changes only.

Validation

An independent verifier re-derived the claims above and re-ran the checks (module zip contents match a CreateFromVCS zip of a fresh clone byte for byte; every rewritten barrier row quotes code that exists in the named function).

  • make check (TREEFMT_NO_CACHE=1): pass
  • make test: pass
  • make test-module-zip: pass (~40 s)
  • make test-386: pass (~85 s on a loaded host)
  • actionlint .github/workflows/ci.yaml: pass

Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

The module zip that the Go proxy serves leaves out every folder with a
go.mod of its own, so a test that reads one passes in the checkout and
fails in a consumer's `go test all`. That happened twice: the bench corpus
tests (#148, #158) and TestUnion_MarshalJSON_RoundTripsTheG2Transcripts
(#143), which still fails on main in the module zip.

- repoFiles (repo_files_test.go) is the one way to read such a file: it
  skips in the module zip and fails in a checkout when nothing matches.
  The corpus loader and the union transcript test use it.
- make test-module-zip (scripts/test-module-zip) builds the real module zip
  with golang.org/x/mod/zip from the files git tracks or would track, and
  runs go vet and go test there. CI runs it after make test.

Without the union test change, make test-module-zip fails with
"find the G2 transcripts: <nil> (0 files)".

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…e numbers

The barrier's model-to-code tables cited connection.go by line number, so
every edit to connection.go moved them: nine PRs (#68, #88, #89, #110, #129,
#135, #139, #142, #153) rewrote 60 to 110 rows each, and a verifier on #135
found 153 of 258 numbers moved. check.sh already finds every line by its
text, so the numbers bought nothing.

- Each row now names the function and quotes the code, as
  verify-session-cancel/SKILL.md already did. Rows that held only a range
  quote the code that check.sh reads.
- scripts/check-code-citations fails on a line-number citation in the
  SKILL.md of any skill with a fingerprint.txt, and names the form to use.
  make check (and so CI) runs it first.

On the SKILL.md of main the check reports 94 citations and exits 1.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
Integer width came up in review seven times (#100, #118, #124, #138, #150,
#152, #159): an int that wraps on 386, a 2^31 error code that hung a
request on 386 before #160, and a generator test that cannot hold 2^31 in
int. Each was found by Codex or a verifier who ran GOARCH=386 by hand.

make test-386 runs go vet and go test for the SDK and cmd/generate with
GOARCH=386, and CI runs it after the module zip step. At 6c4769e it fails
TestWriteTypesJen_ValidateChecksIntegerRanges ("cannot unmarshal number
2147483648 into ... of type int"); it passes on main.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…again

MIGRATION_v0.21.md said "114 types more than in v0.20.0"; main has 126
since the 1.34.1 bump (#161). The same count was wrong on #143 (112 vs
119) and on #150 and #152 (112 vs 114): every PR that adds a type moves
it. The sentence now gives the v0.20.0 count, which a tag fixes, and
names the examples.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
verify-notification-barrier and verify-session-cancel record a sha256 of
every function and constant their models cover in fingerprint.txt, but
only check.sh compares it, and check.sh runs by hand (it needs Java). Main
twice landed covered changes with a stale fingerprint.txt (70aab41,
2ca53de).

scripts/check-model-fingerprints computes each fingerprint the way
check.sh --update-fingerprint does (no TLC, under a second), compares it
with the committed file, restores the file, and names the steps to take.
make check (and so CI) runs it. At 70aab41 it exits 1 and lists
shutdownReceive, processNotifications and handleResponse; a one-line edit
inside receive on main also fails it.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
AGENTS.md now ends with a table of the rules that came from repeated
review findings and the check that enforces each, or "Nothing: judgment"
where no check can. It also stops suggesting `gofumpt -w .`: the repo
formats Go with gofmt through treefmt, and gofumpt rewrites 13 files
that no change touched.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 9fbab8b59f

ℹ️ 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".

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T14:48:54.128785Z ef8352e Manual request
ℹ️ 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.

An independent verifier of #165 found:

- check-model-fingerprints left a rewritten fingerprint.txt behind if it
  was interrupted between check.sh and the restore. It now keeps every
  committed file in a temp folder and puts it back on any exit; a TERM
  mid-run exits 130 with the files unchanged.
- check-code-citations said nine PRs rewrote "60 to 110 rows"; that
  counted added and removed lines. They rewrote 31 to 55 rows each.
- The AGENTS.md fingerprint row now says what the check does: it
  recomputes the fingerprint; nothing checks that TLC ran.

Correction to 04b6206's message: at 70aab41 the check lists only
`receive`, not shutdownReceive, processNotifications and handleResponse.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

timeout and Ctrl-C signal the whole process group, so the INT/TERM trap
could fire again inside the EXIT trap and cut restore short before it
removed its temp folder (3 of 24 interrupted runs, found by the #165
verifier). restore now ignores INT and TERM first. 40 interrupted runs
under `timeout -s INT|TERM` leave no temp folder (the old script leaked 3)
and every fingerprint.txt unchanged.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 048c7abd1f

ℹ️ 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".

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@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: b6cf7d49ae

ℹ️ 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 scripts/test-module-zip Resolved
Comment thread scripts/test-module-zip Resolved
Codex on #165: test-module-zip ran `rm -rf "$MODZIP_OUT"`, so
MODZIP_OUT=$PWD or another kept folder deleted it (reproduced: a file in
the named folder was gone), and a relative MODZIP_OUT unpacked under
scripts/modzip and then failed with "cd: rel/out: No such file or
directory".

MODZIP_OUT must now be a new or empty folder: the script creates it,
resolves it to an absolute path, and exits 2 when it holds anything. A
non-empty folder keeps its files; MODZIP_OUT=rel/out unpacks there and
the tests pass.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: ef8352eb9e

ℹ️ 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".

@ThomasK33
ThomasK33 added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 3527267 Nov 24, 2026
6 checks passed
@ThomasK33
ThomasK33 deleted the ci/enforce-review-findings branch November 24, 2026 14:50
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.

2 participants