Repository navigation
feat(skills): review-pr-team records who reviewed, stops same-session reviews - #5347
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]>
|
/ok to test 3672697 |
|
/review-approve |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
Changes requested for the same-session guard and footer integration. The guard can miss shell-written changes and attribute unrelated work to this PR. The footer can also report a commit that was not reviewed.
I inspected all six changed files with three delegated reviewers and traced the affected runtime, workflow and test paths. This was a static review. I did not run tests or lint, or independently verify the test results reported in the PR description.
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]>
|
/ok to test 3b3c562 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
C6 is still unresolved: mandatory preflight requires gh, although the Codex runtime supports authenticated HTTP without it.
I verified the concrete fixes for C1–C4 against the current guard and regression assertions. C5 is fixed by the reviewed-head check and updated invocation. The effort-provenance docstring fixes C7.
This was a follow-up to review 6002591423. I compared the subsequent changes with the previous reviewed tree and traced their affected paths, rather than starting a fresh full review. Two delegated reports reached me; I covered the Git/Codex topic directly after the third inspection completed without a substantive report. This was static inspection. I did not run tests or lint, or verify CI results.
Generated by Codex
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
terrykong
left a comment
There was a problem hiding this comment.
Self-review of my own PR. It makes review-pr-team record who ran a review (harness, model, effort, skill revision, reviewed commit) in a footer and hidden marker, and stops a review run from the same session that wrote the PR, or a self-review on a model or effort not on the allow-list.
Inline comments, all from this PR:
- (C1) Preflight misses edits made by Claude Code subagents, which are logged in
<session-id>/subagents/. - (C3) Re-checking the author's self-review threads happens after the editor pass, so those findings skip devil-advocate and comment-editor. Move it into
comment-reviewer's Wave 1 task. - (C4) Three sentences say a CI check reads the marker and enforces
REVISIONbumps, but that check is in the next PR.
Two more were found at this commit and are already fixed in 3b3c562, so they are not posted: git -C <dir> commit was missed, and the docstring said Claude Code effort comes from the transcript.
Still open from the PR's own test plan before merge: one full /review-pr-team run in each harness on a test PR, read by the check in the next PR.
Lint passed on the PR's files (ruff, ruff-format, whitespace). pyrefly could not run locally because of a missing submodule checkout, so it was not checked.
Self-review: Claude Code 2.1.330 · claude-opus-5-5 · effort medium · review-pr-team rev 1 · reviewed 3672697
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]>
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 d2516c0 |
terrykong
left a comment
There was a problem hiding this comment.
The five comments cover four correctness issues and one preflight regression-test gap, rechecked at the current head.
Validation: the current 32 tests pass; adding the proposed preflight test gives 37 passing cases. Making preflight always succeed after the metadata lookup leaves all 32 existing tests passing, while three of the proposed cases fail. The proposed session-root fix passed 10 root-lookup cases. These were CPU-only checks. Full local pre-commit remains unavailable because the project lockfile is Linux-only.
Self-review: Codex 0.167.2 · gpt-6-astra · effort high · review-pr-team rev 1 · reviewed d2516c0
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]>
|
/ok to test 7977749 |
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 d253172 |
…oter MUST From the author's second self-review on #5347: - C1: Codex function_call records (exec_command/shell) are decoded. Their cmd and workdir go through the same shell check, and patch text in their arguments counts as an edit. - C4: session logs are looked up under CLAUDE_CONFIG_DIR and CODEX_HOME when they are set and not empty. - C6: when no session log is found, preflight still exits 0 but prints a WARNING instead of OK. SKILL.md Phase 0.1 says what to do. - C7: preflight exit codes are tested end to end through main(). SKILL.md Phase 5 and runtime/codex.md now say the footer line is a MUST. They also check the pending review's last line before publishing. Signed-off-by: Terry Kong <[email protected]>
|
/ok to test 7620ace |
|
/review-approve |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
C6 is addressed by making gh an explicit prerequisite for the identity script, with missing-executable handling and a regression assertion. This changes the supported setup rather than adding an HTTP fallback.
I compared the subsequent changes with the previous reviewed tree, covering session discovery, Codex function-call decoding and the footer/workflow integration. The reviewed-head check is still in place, and the associated assertions still reject missing or stale reviewed SHAs. No eligible findings remain under the follow-up scope and impact filter.
I assigned three non-overlapping topics to delegated reviewers. One substantive report reached me; I inspected the other two topics directly after they completed without delivered reports. This was static inspection. I did not run tests or lint, verify CI, or exercise either harness.
Generated by Codex
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
Signed-off-by: Terry Kong <[email protected]>
|
/ok to test 6899391 |
Replaced by a newer auto-merge request
Auto-merge was disabled for another pull request in the stack
|
/review-approve |
terrykong
left a comment
There was a problem hiding this comment.
Self-review of #5347 at 6899391, by a team of 6 agents (rl-expert, bug-finder, test-agent, design-reviewer, comment-reviewer, devil-advocate) plus comment-editor.
Earlier rounds: 14 of the 16 closed threads still hold at this head. The two that don't are raised again here: (C10) the CI-check wording that self-review C4 fixed, and (C12) the round-2 C7 test that was deleted.
- (C8)
_shell_actionsmisses commits and writes after a#or an apostrophe. - (C9) only the first 100 PR files are checked for edits.
- (C10)
runtime/codex.mdsays the CI check exists today. - (C11) the PR description describes the old footer.
- (C12) the unit tests were deleted.
nemo-rl-review: kind=self harness=claude-code/2.1.330 model=claude-opus-5-5 effort=medium review-pr-team=v1 reviewed=6899391
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
C6 is addressed by making logged-in gh an explicit prerequisite for preflight, with installation instructions when the executable is missing. This changes the supported setup rather than adding an HTTP fallback.
I compared the changes since review 6003348627 with its reviewed tree and collected three delegated reviews covering identity/preflight, session evidence, and footer/workflow integration. I checked their conclusions against the current source. The footer still requires the full reviewed SHA and rejects a changed live head before printing. No eligible findings remain under the follow-up scope and impact filter.
This was static inspection. The previous regression-test file is absent at this head, so its historical results do not establish current coverage. I did not run tests or lint, verify CI, or exercise either harness.
Generated by Codex
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
terrykong
left a comment
There was a problem hiding this comment.
Self-review of #5347 at 6899391. The checked identity-format and policy paths work. Eight additional findings are inline: seven ways the same-session check can miss authoring or assign it to the wrong repository, plus a read-only search that causes a false stop. The PR-description mismatch is already covered by the Claude Code review's C11.
Seven delegated Codex agents ran five specialist roles, an independent two-pass adversarial review, and a separate comment-editor pass. CPU probes reproduced the findings. The two suggested patches passed 42 checks together; pinned Ruff lint, import sorting, and formatting passed. Full pre-commit could not run on macOS because the project lockfile supports Linux only. No GPU checks apply.
nemo-rl-review: kind=self harness=codex/0.171.0 model=gpt-6.1-sol effort=medium review-pr-team=v1 reviewed=6899391
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]>
|
/ok to test bf652c0 |
|
/review-approve |
1 similar comment
|
/review-approve |
|
/review-approve |
Auto-merge was disabled for another pull request in the stack
What and why
We want every PR to carry a self-review from the repo's
review-pr-teamskill, run locally by the author in Claude Code or Codex. A CI check (next PR in this stack) will read it. For that check to mean anything, the review has to say how it was made. This PR makes the skill:flowchart LR A[/review-pr-team N/] --> B{preflight} B -- this session wrote the PR's code --> S1[STOP: use a fresh session] B -- self-review with a model not allowed --> S2[STOP: rerun with an allowed model] B -- ok --> C[review as usual] --> D[body ends with the one-line identity footer]scripts/review_identity.py preflight): stops if the session's own transcript shows it edited the PR's files or committed in the repo (a review from the session that wrote the code is biased). For a self-review (reviewer = PR author), also stops if the harness, model or effort isn't allowed. Allowed today (self-review-policy.json): Claude Code withclaude-opus-5-5,claude-fable-5-2orclaude-fable-5-1; Codex withgpt-6-astraorgpt-6.1-sol; effort medium or higher.scripts/review_identity.py footer --pr N --head <reviewed SHA>): one line in a code span, with no hidden marker:nemo-rl-review: kind=… harness=… model=… effort=… review-pr-team=v<N> reviewed=<7-char SHA>. Harness and version come from env vars, the model from the harness's session transcript, and effort fromCLAUDE_EFFORT(Claude Code) or the transcript (Codex), never from the model's own claim.comment-reviewertask 5 in Wave 1, and reopen brushed-off ones; reopened threads go through devil-advocate and comment-editor like any other finding.REVISION: an integer bumped only in PRs that change the skill. Local copies keep their number, so the check can tell an old copy from a tweaked one.The footer line can be typed by hand; it is there to catch accidents (wrong model, old skill copy, a review from the CI bot), not someone faking it.
Issues
None
Convergence / perf / functionality proof
N/A: skill and tooling only; no training code.
tests/unit/test_review_identity.pywas dropped from this PR.review_identity.pyis checked by the real-session runs below.preflight --pr 5345stopped and named the 5 edited files. A fresh Claude Code session on Opus was detected asclaude-code 2.1.330 · claude-opus-5-5 · mediumand allowed; a fresh one with no model chosen ran Sonnet and was rejected. A fresh Codex session was detected ascodex 0.167.2 · gpt-6-astra · highand allowed, running on its system Python 3.9./review-pr-teamrun in each harness on a test PR, read by the check in the next PR.Needs upstream changes
None
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