Repository navigation
ci: converge codex-review.yml onto the shared guarded_comment_upsert - #20332
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check: when two runs race on one head, the second gets rc 3 ("already in this lane's slot"), lands as [DESIGN-REVIEWED] e972155 Description read[DESCRIPTION-READ] ff9803824a6fce06a1a1964d7141c415b2973e099636e2406edc37cbf4866bff That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS One thing to check before merge: a repeat stopped at an accepted override now turns the step red. It only goes green again if the override handler cancels and re-runs that same-repo GPT run. What this change shipsInventory (7 items) — 7 justifiedIntent: one guarded publication path for the GPT review comment, which also removes the known over-delete in its notice strip (#8462). FIX.
[FIRST-PRINCIPLES-REVIEWED] e972155 Description read[DESCRIPTION-READ] fc4a981b38254008fb88208b07278e8252d29f852a188990fa9a5b28d25442df That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
43651de to
eb2e664
Compare
The same-repo GPT lane's posting step carried its own inline comment
lookup, verdict guard and a position-blind `sed -e '1,8{...}'` notice
strip, under which a bare quoted begin marker on lines 6-8 of preserved
review prose deleted up to three lines of a verdict. Every other review
lane publishes through one byte-identical `guarded_comment_upsert()`
function. The GPT lane now defines the same function and calls it with
`[GPT-REVIEWED]`, or `[GPT-OVERRIDE]` for an accepted human override;
an incomplete or refused run leaves a standing verdict untouched instead
of merging a staleness notice back over it. The lane stays fail-closed:
after the function returns, the step reads its `publication` output back
and exits non-zero when a body stamped for this head reached neither
`published` nor `superseded`. The `Gate on findings` step is untouched.
The lane joins the parametrized guarded-lane suite (identity test
included) with a per-lane `missed_slot_rc`; the tests that pinned the
inline shape are replaced by a structural pin of the call sites and the
untouched gate. docs/ci/ci-and-reviews.md describes the new shape.
Closes #8462
eb2e664 to
e972155
Compare
[operator: bolichen97] |
[operator: bolichen97] |
mbriones98
left a comment
There was a problem hiding this comment.
Checks green and PR Readiness passed at e972155; non-feature change.
Problem / Motivation
Goal: The GPT review lane posts its comment through the same guarded upsert every other review lane uses, so one spelling of the verdict-visibility invariant exists in the repository.
Bug / debt:
codex-review.ymlwas the one review lane still carrying its own inline comment lookup, verdict guard and notice strip (the merged #8342 shape). That strip,sed -e '1,8{...}', is position-blind: a bare quoted<!-- codex-stale-notice-begin -->on lines 6-8 of preserved review prose deletes up to three lines of a standing verdict even with no end marker. It was also the one site left with a read-modify-write window on the comment slot, which the shared function's own comments explain is unsafe: a verdict published between the read and the merged write is restored away. Deferred from #8450 as issue #8462 and overdue since 2026-09-18.Why it matters
Two maintained spellings of one invariant drift apart. Since #8450 the shared function gained head confirmation, a retried lookup and the
publicationrecord, none of which the GPT lane's inline copy had; it could still PATCH a verdict for a superseded head over the current one. A maintainer reading a GPT comment also has to know that this one lane behaves differently from the other eleven.Not a goal
Gate on findingsstep or what blocks a merge. The gate is byte-identical.claude-review.yml. It has no notice path and the issue scopes it out; it keeps its inline arms and is still pinned by the same tests.guarded_comment_upsertorretry_comment_writefunctions. Both stay byte-identical across every lane.What changed (motivation → approach → change)
Motivation: one invariant, one spelling, and the known over-delete gone.
Approach: copy the function in, keep the lane fail-closed outside it. The shared function returns 0 on every arm because the advisory lanes must never invent a BLOCK from an infrastructure fault. The GPT lane is the opposite: its gate reads the captured review text, not the PR, so a verdict that missed the slot would pass the check while the PR shows an older head's verdict. The function records what reached the slot as the
publicationstep output, so the lane reads that back after the call instead of changing the function.Change, in
.github/workflows/codex-review.yml, posting step only:[GPT-REVIEWED]body guard, the preserve-and-prepend branch with itssedstrip and the four exit arms are deleted.guarded_comment_upsert()is defined byte-identical to the other eleven lanes and called once: with[GPT-OVERRIDE]whenkindisoverride, else with[GPT-REVIEWED]. Thehead_needlevariable is gone; the stamp is named at the call site, afterkindis assigned.publicationis read back from$GITHUB_OUTPUT; when the body carries a head-scoped stamp for$HEADandpublicationis neitherpublishednorsuperseded, the step annotates::error::and exits 1. A body with no stamp for this head (incomplete or refused) does not exit here: the gate already fails it closed on its own evidence.Behaviour that changes for a reader of the comment:
::warning::, like every other lane. It no longer prepends a dated staleness notice to the comment. The gate's red check and its message carry the incomplete/refused state, as before.supersededand stays green, as status 4 did before.not_published, the same record the fork GPT finalize fails on, and the override handler cancels and re-runs the in-flight lane with the human decision, so the green comes from that re-run.test/test_ai_review_workflows.py:codex-review.ymljoins_GUARDED_LANES(so the identity test and every behavioural case now run against its real step bash) with a per-lanemissed_slot_rcthat the completed-but-missed cases assert through_missed_slot_rc(lane).TestGptVerdictVisibilitynow pins the two call sites, their order afterkind="override", the absence of the inline shape, and the untouched gate;test_only_the_fail_closed_lanes_exit_on_a_verdict_that_missed_the_slotpins the one tail arm.docs/ci/ci-and-reviews.mddescribes the converged shape.Backwards compatibility
Compatible: no input, output name, marker, stamp or check name changes; the posting step's exit stays non-zero on every outcome it was non-zero on before, and additionally on a withheld-unreadable-head and an override-stopped repeat.
Reader:
.github/workflows/codex-review.yml:Gate on findings-- release -- readscodex-review-output.md, untouched;test_the_gate_is_untouchedReader:
.github/workflows/codex-review.yml:Retain this run's unpublished verdict-- release -- readssteps.post.outputs.retained_verdict_artifact, still written by the sharedretain_unpublished_verdict;test_withheld_verdict_retention.pyReader:
src/kiro_crew/builtin_skills/kirocrew-dev/kirocrew-prepare-pr/scripts/pr_status.py-- chat -- matches[GPT-REVIEWED] <head>in the comment, which the body still carries;test_prepare_pr_status.pyReader:
.github/workflows/ai-review-human-override.yml-- release -- re-runs this lane and reads nothing from the deleted notice markers;test_ai_review_workflows.py::TestHumanOverrideHandlerReader:
docs/ci/ci-and-reviews.md-- release -- the section namingcodex-review.ymlas the excluded lane is rewritten in this PRTests
TestReviewLaneVerdictVisibility[codex]andTestTheGuardedUpsertRecordsWhatReachedTheSlot[codex]: every shared contract case now runs against the GPT lane's real step bash with the stubbedgh: incomplete never overwrites, failed lookup posts nothing, superseded leaves the slot alone, unreadable head withholds, completed replaces, lost write retried and never claimed, duplicate ruled out before create, override repeat stopped. The fail-closed cases assert exit 1 for this lane and 0 for the advisory lanes.test_guard_function_is_byte_identical_across_all_lanes: now eleven lanes.TestForkLanePublishesTheOverrideNote[codex]: the override note replaces a standing block for this head through the guarded slot.TestGptVerdictVisibility: structural pin of both call sites, their order, the removed inline shape and the untouched gate.test_only_the_fail_closed_lanes_exit_on_a_verdict_that_missed_the_slot: Opus keeps four inline arms; GPT has exactly one tail arm gated on a head-scoped stamp, and the shared function carries no exit in any lane.Determinism proof (testing-conventions, Proving a determinism fix), on the 38 new or changed node ids (
[codex]cases,TestGptVerdictVisibility, the identity, call-site and fail-closed structural tests, the refusal pin):for i in $(seq 20); do python -m pytest -n0 -p no:cacheprovider -q @ids.txt; done-- 38 passed, 20/20 green. Then 10 runs at-n 4 --dist loadgroup --max-worker-restart=2withtest/test_withheld_verdict_retention.py test/test_review_slot_read_error.pyas co-tenants -- 10/10 green.seed=9272,python -m pytest -n0 -p no:cacheprovider -q @shuffled.txt-- 38 passed.test/test_ai_review_workflows.py test/test_withheld_verdict_retention.py test/test_review_slot_read_error.py test/test_ai_review_workflows_fork_verdict.pyat-n 4 --dist worksteal, 3 runs -- 1643 passed each.scripts/local-gate.pybackend related set: 2037 passed. The frontend related set could not run on this host (npm registry 401); CI runs it. No frontend file changes.Not a flaky-test fix, so there is no forced condition or negative control to show.
Manual verification
bash -non the extracted posting step passes. N/A beyond that: the step is driven end to end by the stubbed-ghharness above; the live path is a review comment on this PR itself, which the GPT lane posts on this head.Related Issues
Closes #8462
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)