Skip to content

fix(pr-convention-policy): recognize callers on the report-ci-status composite - #1066

Merged
kyle-sexton merged 1 commit into
mainfrom
fix/1065-report-ci-status-pin
Nov 18, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
fix/1065-report-ci-status-pin

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #1065

Summary

The caller-pin audit (maintenance-audit-pr-convention-pins.yml) found each consumer's contract gate only by a direct uses: .../pr-require-checks/check-contract@<sha> call site. Callers on the report-ci-status composite (ci-workflows#1139, v0.76.0) run check-contract through $/ at the commit they pin, so the scan reported them as running no contract artifact. That covers songwriting#75 and codex-plugins#208, both merged today, ci-workflows' own $/.github/actions/pr-require-checks/report-ci-status call, and the rest of the ci-workflows#1138 rollout. The next push to main or the Wednesday run would have gone red.

Fix

  • components/pr-convention-policy/lockstep-drift.mjs: detectArtifactPin matches either composite directory, check-contract or report-ci-status (new export REPORT_DIRECTORY), in both the pinned form and the local .//$/ form. Both resolve to kind: "composite" at the same SHA, so the existing check reads check-contract at that commit, which is the one that gates.
  • lockstep-drift.test.mjs: cases for a pinned report-ci-status caller, a $/ one, and a commented-out $/ one.
  • Lines (git diff --numstat): 2 removed, 28 added.

Verification

  • node --test components/pr-convention-policy/lockstep-drift.test.mjs: 96 passed, 0 failed (about 6.5 minutes locally, most of it the hook behavior probes).
  • Not run locally: npm run audit:pr-convention-pins, which needs the standards-sync App token that only a main run mints. The first push to main after merge runs it.

Related

  • ci-workflows#1138 (design and rollout). This repository's own migration follows in a separate PR, with the matching commit-convention.test.sh change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vcupoo79EqmECYFZ4MTv6C

…composite

report-ci-status runs check-contract through $/ at the commit a caller
pins, so a caller on it gates with check-contract at that SHA. The pin
scan matched only a direct check-contract call site and reported every
migrated caller (songwriting, codex-plugins, ci-workflows' own $/ call) as
running no contract artifact. detectArtifactPin now accepts either
composite, pinned or local, and checks check-contract at that commit.

Closes #1065

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 18, 2026 20:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 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-18T20:38:54.678185Z 3a7eb23 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

Copy link
Copy Markdown

claude-review reviewed 3a7eb2393f556db242ab631821fda748b3ccf8ac: 1 finding(s), 0 as inline comments.

Review summary

The code change is correct. COMPOSITE_DIRECTORY_PATTERN now accepts either check-contract or report-ci-status, in both the pinned form and the local ./ or $/ form. Both forms resolve to kind: "composite" at the same SHA. The uses: anchor still ignores commented-out lines, and the new tests cover a pinned caller, a $/ caller and a commented-out $/ line. I read the diff and the surrounding code. I did not run the test suite; the PR's "96 passed" is author-claimed and unverified.

Finding (cross-file, no changed line can carry it)

The closing issue's second fix item is not in this PR, but the PR says Closes #1065. Issue #1065's Fix section says: "commit-convention.test.sh: accept either pin (check-contract or report-ci-status) and fetch check-contract/action.yml at that SHA." The PR defers this, saying this repository's migration "follows in a separate PR, with the matching commit-convention.test.sh change".

components/commit-convention/commit-convention.test.sh:89 still only matches check-contract@<40-hex>. This is not broken today, because .github/workflows/pr-require-checks.yml:1092 still pins check-contract@24067add…. It will break the moment the migration lands without the test change.

To fix it, either include the test change here, or change Closes #1065 to Refs: #1065 so the issue stays open until the second item ships. Either way, no test in the repository fails if the commit-convention.test.sh item is forgotten.

Other notes

  • The checkFleet message at components/pr-convention-policy/lockstep-drift.mjs:1103 still reads "no check-contract composite step and no pr-issue-linkage caller". It is slightly stale now that report-ci-status also counts, but it is not worth blocking.
  • The PR body follows the contract: it has a Closes line and the four sections.
  • Loosened check: no loosened-check inputs were supplied, so the verdict defaults to fail with no consumer entries. The diff loosens nothing.

Verifier dropped 0 of 1 candidates.

@github-actions

Copy link
Copy Markdown

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

Security review: PR #1066 (head 3a7eb23)

No security findings.

The diff changes two files: components/pr-convention-policy/lockstep-drift.mjs and its test. The change lets the lockstep-drift pin detector also recognize uses: of the report-ci-status composite, not only check-contract.

  • Regex construction: COMPOSITE_DIRECTORY_PATTERN is built only from two hard-coded repo-path constants, with . escaped. No external or PR-controlled input reaches the RegExp, so there is no ReDoS or injection surface.
  • Same trust boundary: the @<40-hex>|main pin group and the (?=[\s"']|$) lookahead are unchanged. Fetches in the same file build their URLs from the existing COMPOSITE_DIRECTORY constant, not from the new directory. The detector still only picks which check-contract commit to compare against.
  • Comment handling: USES_PREFIX still excludes commented-out lines, and the new test covers that case.
  • Trust controls: none are touched. The diff does not change trusted-actor lists, token scopes, the kill switch, merge holds, Actions workflows, plugin manifests, or instruction files.

manifest lines: none apply.

critical-findings: 0

@kyle-sexton
kyle-sexton merged commit e4e8966 into main Nov 18, 2026
24 checks passed
@kyle-sexton
kyle-sexton deleted the fix/1065-report-ci-status-pin branch November 18, 2026 20:58
kyle-sexton added a commit that referenced this pull request Nov 18, 2026
No related issue: a rollout step of melodic-software/ci-workflows#1138,
which stays open until every repository has migrated.

## Summary

Rollout of
[ci-workflows#1138](melodic-software/ci-workflows#1138):
the `ci-status` job now runs the shared `report-ci-status` composite
([ci-workflows#1139](melodic-software/ci-workflows#1139),
v0.76.0) instead of its own `check-contract` and `aggregate-results`
steps. `CI Status` stays the job's name and the single required check.
Worked examples copied:
[songwriting#75](melodic-software/songwriting#75)
and
[codex-plugins#208](melodic-software/codex-plugins#208).
Merge after
[#1066](#1066), which
teaches the fleet pin audit the same pin.

## Fix

- `ci-status` steps: one `report-ci-status` step, then a "Fail on the
contract or draft policy" step that fails on any outcome other than
`success`, so an empty or renamed output fails closed. The composite
step keeps the name `Aggregate lane results`, as `step-name` did before.
- Behavior kept:
  - `draft: allow`: the workflow is not draft-gated.
  - `exempt-authors: 'dependabot[bot]'`.
- `treat-skipped-as` at the composite's default `fail`, the value set
before.
- The job's `if: !cancelled()`, `needs`, permissions, runner and
`timeout-minutes: 8` are unchanged.
- Concurrency: unchanged; a push already falls back to `github.run_id`.
- Comments describe what the composite fixes (`yield-to-full-run:
'true'`, `carry-forward-wait-seconds: '0'`, [action.yml
L128-L129](https://github.com/melodic-software/ci-workflows/blob/ebd0e3bed99ae1365fcb4ef47ce97cfa745fcf2f/.github/actions/pr-require-checks/report-ci-status/action.yml#L128-L129))
instead of inputs the file no longer sets.
- `components/commit-convention/commit-convention.test.sh` read the
`check-contract@<sha>` pin from this workflow to fetch the `types`
default, and would have failed `Check PR Convention Copies` with no such
pin. It now accepts the `report-ci-status@<sha>` pin too: that composite
runs `check-contract` through `$/` at its own commit, so the test still
fetches `check-contract/action.yml` at that SHA.
- Lines (`git diff --numstat`): workflow 31 removed, 35 added;
`commit-convention.test.sh` 3 removed, 5 added.

## Verification

- `actionlint .github/workflows/pr-require-checks.yml`: no findings.
- The test's new `sed` on this branch's workflow prints
`ebd0e3bed99ae1365fcb4ef47ce97cfa745fcf2f`; `bash -n` on the test
passes. The full test runs in this PR's `Check PR Convention Copies`
lane.

## Related

- Design and rollout:
[ci-workflows#1138](melodic-software/ci-workflows#1138).
Pin audit:
[#1065](#1065) /
[#1066](#1066).
- Revert: revert this PR; the old steps come back unchanged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Vcupoo79EqmECYFZ4MTv6C

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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(pr-convention-policy): recognize callers on the report-ci-status composite

1 participant