Repository navigation
ci: check the PR author's self-review and its resolution - #5348
Conversation
…sion reviews Prerequisite for a self-review CI check. review-pr-team now: - runs scripts/review_identity.py preflight first. It stops if this session wrote code in the PR (its own Claude Code or Codex transcript shows edits to the PR's files, or a commit/push in the repo). For a self-review (reviewer is the PR author), it also stops when the harness, model or effort is not on self-review-policy.json's list. - ends the review body with a footer from the same script: a visible line and a hidden <!-- nemo-rl-review: ... --> marker with kind, harness/version, model, effort, skill revision and reviewed commit. These come from env vars and the session transcript, not the model. - as an expert review, re-checks the author's self-review threads after its own findings are final. - has a REVISION number, bumped only in PRs that change the skill. Tested in fresh Claude Code (Opus allowed, default Sonnet rejected) and Codex (gpt-6-astra allowed, on system Python 3.9) sessions. Signed-off-by: Terry Kong <[email protected]>
A new "Check self-review" workflow posts a `Self-review` commit status: - No self-review: the author has not published a review whose body has review-pr-team's `kind=self` marker. - Not accepted: <reason>: the marker's harness, model or effort is not in skills/review-pr-team/self-review-policy.json, or its skill revision is more than max_revision_lag behind main. - Not resolved: N of M: a thread from the self-review has no reply or is not resolved. - Resolved (M threads). It also fails when a PR changes skills/review-pr-team/ without bumping REVISION by exactly one, so this PR bumps it to 2. The workflow reads the script and policy from the default branch only. It is warning-only (not a required check). The logic is pure functions in .github/scripts/check_self_review.py (stdlib) so GitLab can reuse it. Signed-off-by: Terry Kong <[email protected]>
|
/ok to test 2cc5a74 |
|
/review |
|
Every outcome of the I copied this PR's check script, policy and REVISION, unchanged, to my fork's test base ( The test reviews were posted through the API with a footer in the format 1. No self-review. The author has posted no review. (fork #47) 2. Review without the footer. The author posted a review with text, but not through 3–7. Not accepted. The footer is there, but the policy rejects it.
8. Not resolved. An accepted self-review left one inline comment that nobody has answered. (fork #54) 9. Resolved. Same as 8, but the thread got a reply and was resolved. (fork #55) GitHub fires no event when a thread is resolved, so the status changed only after the next PR edit (here, a description edit). A push, a new review or a review comment also refreshes it. 10. REVISION not bumped. The PR changes a file under Notes:
|
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
I found three correctness issues in the new check.
I inspected all five changed files and their directly affected paths. Three topic reviewers ran; one finished without a delivered report, so I inspected the client and test-integration paths myself. This was a source-only review. I did not run tests or lint, and live CI results were unavailable.
Generated by Codex
Review generated by codex. This was a full review. Request a full review with /review reset=true.
…e footer to the reviewed commit Fixes Autobot findings C1-C5 and C7 on #5347: - Shell commands that write a PR file (redirects, tee, cp/mv/install, sed -i, perl -i) now count as edits, as Edit/Write already did. - git commit/push is found by parsing the command, so quoted text such as printf 'git commit' and Codex patch bodies no longer match. - Paths and git directories are resolved against the tool's working directory, `cd` and `git -C`, and must be inside this repo. A matching file suffix in another checkout, or a sibling directory such as /repo-copy, no longer counts. - Claude tool calls whose result was an error are skipped. - `footer` now needs --head <reviewed SHA> and refuses to print if the PR head has moved since. - Docstring: Claude effort comes from CLAUDE_EFFORT, not the transcript. Signed-off-by: Terry Kong <[email protected]>
Read every page of review threads, so a self-review thread after the first 100 still counts. Put review events from fork PRs in their own concurrency group, so their read-only runs can't cancel a run that can post the status. Signed-off-by: Terry Kong <[email protected]>
|
/ok to test 17af32b |
Fixes Autobot C6 on #5347, using the "require gh" option. - SKILL.md and runtime/codex.md now say `gh` (logged in) is required. codex.md no longer describes a no-gh HTTP path. - review_identity.py exits with an install hint when `gh` is missing, instead of a traceback. Signed-off-by: Terry Kong <[email protected]>
A PR that changes skills/review-pr-team/ must set REVISION to the base's value plus one, read from the base commit as data. Stacked PRs and PRs into release branches no longer fail when their base differs from main. Main's REVISION still decides whether a self-review is too old. Signed-off-by: Terry Kong <[email protected]>
From the author's self-review on #5347: - C1: preflight also reads Claude Code subagent transcripts (<sid>/subagents/*.jsonl), so edits made by subagents count. - C3: the re-check of the author's self-review threads is now comment-reviewer's Wave 1 task 5, so reopened threads go through devil-advocate and comment-editor. It matches the script's "Review kind: expert" output. - C4: the CI check that reads the marker and enforces REVISION comes in the next PR; SKILL.md now says so in future tense. Signed-off-by: Terry Kong <[email protected]>
|
/ok to test 7febea0 |
…o babysit-5348 Signed-off-by: Terry Kong <[email protected]> # Conflicts: # skills/review-pr-team/SKILL.md
|
/ok to test 206ab8a |
|
/review |
Narrows the C6 fix on #5347. runtime/codex.md goes back to its 3b3c562 text, which keeps the no-gh HTTP transport for the rest of the workflow. SKILL.md Phase 0.1 and review_identity.py's error now say that only the identity preflight needs `gh`. Signed-off-by: Terry Kong <[email protected]>
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
LGTM for this follow-up. I verified that the three earlier findings are fixed in the current source:
- C1: The concurrency expression separates read-only fork review runs from writable PR-update runs. Same-repository updates and reviews still share a group.
- C2: The thread collector accumulates pages and follows the cursor until no next page exists. The regression test checks that an unanswered self-review thread after 100 unrelated threads produces a failure.
- C3: The revision check compares head with base plus one. The entry-point test covers main 5, base 2 and heads 2, 3 and 4, while checking that freshness still receives main's revision.
I compared the subsequent changes with the previously reviewed tree and traced their directly affected contracts. No unresolved prior findings or introduced regressions eligible above the historical moderate-impact ceiling remain. This was a follow-up, not a fresh whole-PR review.
Three topic reviewers ran. Two delivered reports; the pagination reviewer finished without a delivered report, so I inspected that topic myself. Validation was source-only. I did not run tests or lint, and live CI results were unavailable.
Generated by Codex
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
The self-review check now reads the last line that starts with nemo-rl-review: (backticks ignored) and takes the skill revision from review-pr-team=vN. The old <!-- nemo-rl-review: ... skill_rev=N --> form is no longer read. Lines with another prefix, such as doc examples, and mentions inside a sentence don't count. Signed-off-by: Terry Kong <[email protected]>
The footer is now a single code span, with no hidden HTML comment: `nemo-rl-review: kind=self harness=claude-code/2.1.330 model=claude-opus-5-5 effort=medium review-pr-team=v1 reviewed=3672697` Keys always come in this order: kind, harness, model, effort, review-pr-team (v + REVISION), and reviewed (7-char head). `--head` is still required, and the script still refuses if the head has moved. SKILL.md Phase 5, the Skill revision section, and the footer line in runtime/codex.md show the new line. REVISION stays 1. Signed-off-by: Terry Kong <[email protected]>
@terrykong, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
|
/ok to test 1060017 |
|
/ok to test 70d59f6 |
Signed-off-by: Terry Kong <[email protected]>
…5348 Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
|
/ok to test 23e9264 |
|
/review-approve |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
LGTM for this follow-up. I found no unresolved prior findings or introduced regressions eligible above the historical moderate-impact ceiling.
I rechecked the earlier fixes against the current source:
- Fork-event concurrency still separates read-only review runs from writable update runs.
- Thread collection still follows pagination and accumulates every page.
- Revision enforcement still compares head with base plus one, while freshness evaluation uses the default-branch revision.
I compared the subsequent footer migration and missing-footer handling with the previously reviewed tree, then traced the affected producer, policy and status-writing paths. This was not a fresh whole-PR review.
All three topic reviewers delivered reports. Validation was source-only. I did not run tests or lint, and live CI results were unavailable.
Generated by Codex
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
From the author's end-to-end self-reviews on #5347: - C8: heredoc bodies are dropped before lexing, and commands are lexed line by line, so a `#` comment or a stray quote hides only its own line. A quote that spans lines (multi-line `git commit -m`) still lexes. - C9: the PR's file list comes from the paged REST endpoint, so PRs with more than 100 files are fully covered. - C10: codex.md says the CI Self-review check comes in the next PR. - C17: paths and the repo root are resolved with realpath, so edits through a symlinked alias still match the PR's files. Signed-off-by: Terry Kong <[email protected]>
…5348 Signed-off-by: Terry Kong <[email protected]>
|
/ok to test 639239a |
|
/review-approve |
|
/review-approve |
|
/resolve-conflict |
Signed-off-by: Terry Kong <[email protected]> # Conflicts: # skills/review-pr-team/REVISION # skills/review-pr-team/SKILL.md
|
/ok to test 51e0db6 |
|
/review-approve |
…kind-advantages Brings in 8 commits, including the BaseModel environment configs (#5234), the BaseModel EvalConfig (#4909), the pipelined prefix writer (#5176) and the self-review status check (#5348). No conflicts. The two GRPO configs pick up main's new math verifier_type key next to this PR's masked_reward_policy comments. Main's ledger schema is still 8, so failure_kind stays in schema 9. The Gym pin is the same on both sides (9e2e5d0ad0). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>












What and why
Stacked on #5347. That PR makes
review-pr-teamsign its reviews with a hidden marker (harness, model, effort, skill revision, reviewed commit). This PR adds the CI check that reads it, so every PR shows whether its author has done a real self-review and dealt with every comment from it.flowchart LR E[PR pushed/edited, review or review comment] --> A{author's review with kind=self marker?} A -- no --> N[✗ No self-review] A -- yes --> P{marker allowed by policy and skill rev within 3 of main?} P -- no --> X[✗ Not accepted: reason] P -- yes --> T{every self-review thread replied to and resolved?} T -- no --> R[✗ Not resolved: N of M] T -- yes --> OK[✓ Resolved]Self-reviewcommit status, posted by.github/workflows/self-review-check.ymlusing.github/scripts/check_self_review.py(stdlib; pure functions so GitLab CI can reuse them). The description shows the state, e.g.Not resolved: 2 of 5 threads open or unanswered.skills/review-pr-team/self-review-policy.json, or its skill revision is more than 3 behindmain.skills/review-pr-team/fails unless it bumpsREVISIONby exactly one. This PR changes the skill (one line in its revision section), so it bumpsREVISIONto 2.Issues
None
Convergence / perf / functionality proof
N/A: CI only; no training code.
pull_requesttrigger: a new PR showedNo self-review; after an Opus self-review with one inline comment,Not resolved: 1 of 1; after a reply only, stillNot resolved: 1 of 1; after reply + resolve + an edit,Resolved (1 threads). A self-review markedclaude-sonnet-5-5showedNot accepted: model claude-sonnet-5-5 is not allowed. No run failed.Needs upstream changes
#5347 (this PR is stacked on it).
PR commands and CI
/ok to test <full-commit-sha>: start CI for that commit. Post again after each push./review: automated review comments. Addmode=strictfor a stricter review,reset=truefor a fresh full review./resolve-conflict: Autobot mergesmaininto this PR and resolves the conflicts.🤖 Generated with Claude Code