Skip to content

fix(source-control): enforce PR-body linkage under the report-ci-status composite - #17353

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/linkage-hooks-report-ci-status
Nov 19, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix/linkage-hooks-report-ci-status

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: found by the review lane on #17283 and fixed in place.

Summary

The PR-body linkage hooks (pr-body-linkage-gate.sh, pr-linkage-mcp-gate.sh) run only in a repository where a workflow names pr-require-checks/check-contract. The ci-status rollout (melodic-software/ci-workflows#1138) replaced that step with the pr-require-checks/report-ci-status composite, which runs check-contract inside it, so both hooks exit early in every repository already moved (18 so far) and would in this one once #17283 merges. Reported by the review lane on #17283.

Fix

  • Both hooks' scope regex matches pr-require-checks/(check-contract|report-ci-status), keeping the trailing class that keeps a longer sibling directory out.
  • Each hook's test gains a repository whose only contract step is the composite and asserts a negated-closer body is blocked there.
  • source-control patch changelog fragment.

Verification

  • pr-body-linkage-gate.test.sh: 183 passed, 0 failed; pr-linkage-mcp-gate.test.sh: 58 pass, 0 fail; pr-linkage-spawn-budget.test.sh: 21 passed.
  • With the hook change reverted, each new case fails (expected block(2), got rc=0; expected exit 2, got 0), so the tests catch the regression.
  • scripts/check-affected.sh --tests: 19 passed, 2 skipped.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vcupoo79EqmECYFZ4MTv6C

…us composite

Both linkage hooks run only where a workflow names
pr-require-checks/check-contract. The ci-status rollout (ci-workflows#1138)
replaced that step with the report-ci-status composite, which runs
check-contract inside it, so the hooks stopped checking in every
repository already moved. They now match either path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vcupoo79EqmECYFZ4MTv6C
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 19, 2026 02:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T02:37:13.394126Z 4152b16 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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on e0753c7eb86619a9f43d036a9ba56e540bb2103e; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed fa893b6eac4ad194da8ed9e9a5bbc23f0deedb91: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #17353 (incremental, e0753c7 → fa893b6)

This lane has already reviewed an earlier head, so this pass reports blocking findings only. I read every hunk of all 4 files in the incremental diff. The push changes only comments and docs; no code changed. Both gate_re lines appear only as unchanged context.

No new findings. This push fixes the one finding from the last round, about scope documentation that named only check-contract. Every place that finding listed now names both pr-require-checks/check-contract and the pr-require-checks/report-ci-status composite that runs it:

  • pr-body-linkage-gate.sh: the WHAT IT ENFORCES header, the SCOPE GUARD header and the comment above the regex.
  • pr-linkage-mcp-gate.sh: the same three places.
  • README.md: both scope statements, the two *_enabled table rows and the two option paragraphs.
  • create.md: line 480.

I checked the punctuation the edits touched. In the MCP hook's SCOPE GUARD header, the parenthesis that used to close after ./.github/actions/<path> was removed along with its opening one. The README's reworded parenthetical still closes correctly. That earlier thread is resolved, with no lines changed since its resolution head.

  • Closing issue: none (per the PR context), so there are no acceptance criteria to check.
  • Embedded instructions: none found in the PR text, settled threads or prior findings.
  • Plugin manifests: this push changes none.
  • Loosened-check verdict: pass. The wrapper supplied no loosened_check_verdict: / loosened_check_patterns: lines, so I used fail with no consumer entries. It also supplied no decision-record line, so the citation requirement was not checked. The push only edits comments and docs and loosens no check.
  • Spend: none.

Verifier dropped 0 of 0 candidates.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed fa893b6eac4ad194da8ed9e9a5bbc23f0deedb91: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Security review (incremental, blocking only): no security issues found

I reviewed only the changes since e0753c7e. They touch four files, I read every hunk in each, and none of the files matches a trusted-path glob.

  • plugins/source-control/hooks/pr-body-linkage-gate.sh and plugins/source-control/hooks/pr-linkage-mcp-gate.sh: only the header and scope-guard comments change. They now name the pr-require-checks/report-ci-status composite and link to its action.yml upstream. In the MCP hook, a stray closing parenthesis also moves. The gate_re regex and the scan loop do not change in this push. The regex is the same fixed literal that the previous review of this lane passed, \.github/actions/pr-require-checks/(check-contract|report-ci-status)([@[:space:]]|$).
  • plugins/source-control/README.md and plugins/source-control/skills/pull-request/reference/create.md: documentation only. They describe the widened scope guard and the scope notes in the pr_body_linkage_gate_enabled and pr_linkage_mcp_gate_enabled table rows. Neither userConfig default changes, so there are no manifest lines.

This push touches no trust control, token scope, kill switch, merge hold, plugin manifest or standing instruction. It removes no rule from the instruction surface: the edits add wording and take none away. No settled threads apply. The lane's one prior post was a summary with no line anchor and no findings, so nothing carries over. This lane already reviewed an earlier head, so this review reports blocking findings only.

critical-findings: 0

…age hooks' scope

The scope regex now matches pr-require-checks/report-ci-status, but the
hook headers, the regex comments, the README and create.md still said the
hooks run only where check-contract is used. Name both steps everywhere
the scope is stated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 452b9eb Nov 19, 2026
52 checks passed
@kyle-sexton
kyle-sexton deleted the fix/linkage-hooks-report-ci-status branch November 19, 2026 05:40
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant