Skip to content

feat(review): check closing-issue criteria and path-scoped rules in the CI code-review lane - #7825

Merged
kyle-sexton merged 5 commits into
mainfrom
fix/code-review-closing-issue-criteria
Oct 17, 2026
Merged

kyle-sexton merged 5 commits into
mainfrom
fix/code-review-closing-issue-criteria

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Closes #7815

Summary

The CI code-review lane read only CLAUDE.md, REVIEW.md and 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-review reads the closing issues from the lane's PR context file: the path on the prompt's PR CONTEXT: line, else .claude-lane/pr-context.md, one ## Closing issue section 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.
  • It reads the 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 as REVIEW.md.
  • Both ingests carry the untrusted-content contract inline: an embedded imperative is reported in the summary comment and widens nothing.
  • A new eval case (flags-unmet-closing-issue-criterion) checks that an unmet criterion is flagged. The review changelog fragment is a minor bump.

Verification

  • scripts/check-affected.sh --tests from the worktree: 7 passed, 2 skipped (no shell, no Python) over 3 changed files.
  • skill-quality check-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-jsonschema against the evals.json schema: ok. check-evals-quality.sh: PASS. Its warnings are the three on existing case 1, and none on the new case.
  • Left out: an output re-measure with /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

  • Depends on melodic-software/ci-workflows#765, which writes the PR context file. Until the lane uses it, the file is absent and the lane reports closing issues as unread. The lane's current default claude-args (.github/workflows/pr-review.yml:149 on main, :136 at the v0.44.1 pin) grants only Bash(gh pr diff:*), so this PR does not rely on a gh issue view grant.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43

…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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T21:46:37.976718Z c276ec1 Draft marked ready
ℹ️ 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.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed fe221f176bb56f7ff1c479a135c34589cb1c8e3f: 0 finding(s), 0 as inline comments.

No security findings in the incremental change (fe221f1 vs 109d7f5).

The change moves the pr-context.md fixture text out of a heredoc in scaffold.sh and into fixtures/pr-context.md. scaffold.sh now copies it with cp "$(dirname "${BASH_SOURCE[0]}")/fixtures/pr-context.md" .claude-lane/pr-context.md.

  • Content: The fixture is static, synthetic eval data. It holds no secrets or machine-specific paths. Its header frames the text as untrusted data. The Closes #20 reference points at the fictional acme/storefront repo.
  • Copy path: The source path is built only from the script's own location, with a fixed filename. No user, PR or environment input reaches it. The destination is a fixed relative path under the eval scratch directory.
  • Instruction surface: The diff deletes no standing instruction, rule, hook or allowlist. It is eval-data restructuring only.
  • Tests: I did not run the scaffold or the eval.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed fe221f176bb56f7ff1c479a135c34589cb1c8e3f: 0 finding(s), 0 as inline comments.

No findings. I reviewed the incremental diff since 109d7f5, which is limited to scaffold.sh and fixtures/pr-context.md in the code-review-closing-criterion-unmet eval case.

  • Fixture content: The new fixtures/pr-context.md matches the removed heredoc line for line. That covers the untrusted-data banner, the PR and issue text, both acceptance criteria and the two comments, so the case's behavior is unchanged.
  • Path resolution: The new cp "$(dirname "${BASH_SOURCE[0]}")/fixtures/pr-context.md" .claude-lane/pr-context.md in scaffold.sh uses the same BASH_SOURCE idiom as many other eval scaffolds in the repo. Examples are plugins/harness-ops/evals/in-broken-lane-no-count/scaffold.sh and plugins/code-tidying/evals/probe-explicit-target/scaffold.sh, which also read a case-local fixture/ directory. .claude-lane/ is created by the mkdir -p just above the cp, and set -euo pipefail makes a missing fixture fail the scaffold instead of silently dropping the file.
  • Fixture checker: scripts/check-orphaned-fixtures.sh only scans **/evals/fixtures/. The new evals/<case>/fixtures/ directory is outside that scope, so I found nothing there that would flag it as an orphan.
  • Unverified: I did not run the eval or the scaffold.

@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: 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".

kyle-sexton and others added 4 commits October 17, 2026 17:53
…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
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 17, 2026
kyle-sexton added a commit to melodic-software/ci-workflows that referenced this pull request Oct 17, 2026
…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]>
Merged via the queue into main with commit 54571e9 Oct 17, 2026
29 checks passed
@kyle-sexton
kyle-sexton deleted the fix/code-review-closing-issue-criteria branch October 17, 2026 22:52
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.

fix(review): CI review lanes passed 9 lane PRs that fresh-context reviews all failed

1 participant