Repository navigation
feat(review): check closing-issue criteria and path-scoped rules in the CI code-review lane - #7825
Conversation
…he CI code-review lane The lane now reads the issues a pull request closes and reports each acceptance criterion the change leaves unmet (blocking, quoting the criterion) or met with no test that could fail. It also reads the .claude/rules/ files whose paths: globs match changed files as review criteria, with the same standing as REVIEW.md. Adds an eval case for an unmet closing-issue criterion. Closes #7815 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed No security findings in the incremental change (fe221f1 vs 109d7f5). The change moves the
|
|
claude-review reviewed No findings. I reviewed the incremental diff since 109d7f5, which is limited to
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c276ec123c
ℹ️ 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".
…e and rule-file ingests The closing issue and its comments, and each matching rule file, now carry the full inline spine: data, an embedded imperative is a finding reported in the summary comment, and it widens no authority. The issue source is its own bullet so a pre-fetched file can replace it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43
ci-workflows#765 hands the lane a pre-fetched file instead of gh tools. The skill reads the path on the prompt's PR CONTEXT: line, else .claude-lane/pr-context.md, takes one closing issue per "## Closing issue" section, and reports each as unread when the file is absent. The Bash(gh issue view:*) grant and the closing-keyword pointer are dropped; the untrusted-content contract now covers the whole file. The eval case reads the issue from the context file. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43
…g-issue check code-review-closing-criterion-unmet scaffolds a PR context file in the ci-workflows#765 format with two criteria, one left unmet by the diff. code-review-context-file-absent scaffolds the same branch with no context file, so the lane must report the closing issue as unread. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43
Move the pr-context.md heredoc out of scaffold.sh into fixtures/pr-context.md so the comment-hygiene scanner no longer reads its markdown headings as code comments. The scaffold copies the file; the generated output is unchanged. No related issue: lint-repo comment-hygiene failure on PR 7825. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Vc9F9ce4oPK1QygrCpj5G9
…g issues as a file (#765) Refs: melodic-software/claude-code-plugins#7815 ## Summary The code-review skill in claude-code-plugins ([PR 7825](melodic-software/claude-code-plugins#7825), for issue 7815) now reads the PR body and the PR's closing issue with its acceptance criteria. The `pr-review.yml` lane never gives the model either: claude-code-action's agent mode puts only the workflow `prompt` in front of the model (`src/modes/agent/index.ts` at the pinned v1.0.250). That gap is one reason the lane passed 9 lane PRs that fresh reviews failed (evidence in claude-code-plugins#7815). ## Fix A new step, `Write the pull request description and closing issues`, uses the job's existing `github.token` to read the PR title and body and `closingIssuesReferences` (title, body, comments) through one GraphQL call, and writes `.claude-lane/pr-context.md`. Both Claude attempts get a prompt line pointing at it. - No tool grant is added. `Bash(gh pr view:*)` would let the model run `--comments` and bypass `exclude-comments-by-actor`; `Bash(gh issue view:*)` needs `issues: read`, which changes the reusable workflow's permissions and, through the standards `runner-policy` contract (`allowedCallerPermissions`), every caller. - PR comments are left out. An issue comment is kept only when its `authorAssociation` is OWNER, MEMBER or COLLABORATOR. - The file opens by calling its text data, never instructions. Bodies are capped at 20000 characters, comments at 4000, titles at 300. - A failed read leaves no file and the review runs as before (`continue-on-error`). - `claude-args` defaults, `pr-review-security.yml` and job permissions are unchanged. - Tests: the default grants no `gh pr view` / `gh issue view`, and both Claude attempts name the file. Known residual: on a private repository the job token may be unable to read issues through GraphQL. The file then holds the description alone, or is not written, and the lane behaves as it does today. ## Verification - `actionlint .github/workflows/pr-review.yml`: exit 0. - `node --test .github/scripts/*.test.cjs`: 427 tests before the two added, all pass; the compose-args file runs 23 of 23. - `biome ci --config-path=fixtures/typescript/good/biome.json --error-on-warnings fixtures/typescript/good .github/scripts`: no errors (one schema-version info, present on main). - The jq program was run against sample GraphQL output: an OWNER and a MEMBER comment are kept, a NONE comment is dropped, and a null pull request fails the step. ## Related - Issue: melodic-software/claude-code-plugins#7815 - Consumer PR: melodic-software/claude-code-plugins#7825 (reads `.claude-lane/pr-context.md`) - Release: `release-tag.yml` workflow_dispatch, bump `minor`. Standards `runner-policy` needs an approved-contract entry for the new SHA; no input, secret or permission changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43 --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Closes #7815
Summary
The CI code-review lane read only
CLAUDE.md,REVIEW.mdand paved paths. It never read the issue a pull request closes, so it missed acceptance criteria that were only partly met. It also never read the path-scoped.claude/rules/files that hold the citation and upstream-pointer rules. That is why 7 of the 9 PRs in #7815 had defects the lane did not flag.Fix
/review:code-reviewreads the closing issues from the lane's PR context file: the path on the prompt'sPR CONTEXT:line, else.claude-lane/pr-context.md, one## Closing issuesection per issue. It reports a finding that quotes the criterion when the change leaves it unmet (blocking), or when it is met but no test could fail if it broke. When the file is absent, it reports each closing issue as unread.paths:frontmatter of every rule under.claude/rules/and treats a rule whose glob matches a changed file as review criteria, with the same standing asREVIEW.md.flags-unmet-closing-issue-criterion) checks that an unmet criterion is flagged. Thereviewchangelog fragment is a minor bump.Verification
scripts/check-affected.sh --testsfrom the worktree: 7 passed, 2 skipped (no shell, no Python) over 3 changed files.skill-qualitycheck-skill.sh code-review: PASS, 0 errors, 4 warnings. Three were already there (no## Next, description length, a numbered skip gate). The fourth is the expected body growth, 115 to 153 lines.check-jsonschemaagainst theevals.jsonschema: ok.check-evals-quality.sh: PASS. Its warnings are the three on existing case 1, and none on the new case./evals:plugin-eval. The skill's cases are in the skill-creator format, which that command cannot run (see the open review thread). Also left out: a live CI run of the lane, which waits on ci-workflows#765.Related
claude-args(.github/workflows/pr-review.yml:149on main,:136at the v0.44.1 pin) grants onlyBash(gh pr diff:*), so this PR does not rely on agh issue viewgrant.🤖 Generated with Claude Code
https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43