Skip to content

fix(pr-convention-policy): detect a composite called through a $/ local reference - #1004

Merged
kyle-sexton merged 1 commit into
mainfrom
fix/pin-audit-local-composite-reference
Nov 14, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
fix/pin-audit-local-composite-reference

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: the pins audit has failed on every push to main since 2026-11-12

Summary

The "Maintenance Audit PR Convention Pins" workflow fails on every push to main with
drift: caller ci-workflows: no pr-contract composite step and no pr-issue-linkage caller
(for example run 43551903176).

ci-workflows' gate calls its own composite through GitHub's self-repository syntax,
uses: $/.github/actions/pr-require-checks/check-contract
(pr-require-checks.yml, step "Check the pull-request contract").
That switch from ./ to $/ landed on 2026-11-08 in
ci-workflows#1027, so the failures
probably began with the first audit run after it, before the 2026-11-12 example.
detectArtifactPin found ci-workflows' local composite only through COMPOSITE_LOCAL_PATTERN,
which accepted a ./ prefix and nothing else. The scan therefore found no artifact and reported
kind: "none".

GitHub documents $/ as "the self repository reference": it resolves to the same repository at
the running commit and takes no @{ref} suffix
(workflow syntax, jobs.<job_id>.steps[*].uses;
changelog, 2026-07-30).
The scan reads ci-workflows at main, the commit its own main runs, so the existing
sha: "main", local: true resolution applies unchanged.

Fix

  • components/pr-convention-policy/lockstep-drift.mjs: COMPOSITE_LOCAL_PATTERN accepts
    [.$]/ where it accepted only \./. It still requires a live uses: entry with no # earlier
    on the line. Two comments now name both forms.
  • components/pr-convention-policy/lockstep-drift.test.mjs: a $/ reference is detected as the
    local composite at main, and a commented-out $/ line still detects nothing.

Nothing else in the component assumes ./: runPinScan reads a local artifact from the
consumer's own tree whatever the prefix. The README and threat model do not describe the prefix.

Verification

  • node --test components/pr-convention-policy/lockstep-drift.test.mjs: 95 of 95 pass, exit 0.
  • An offline dry run against ci-workflows origin/main passed the real workflow files to
    resolveConsumerArtifact. It resolved
    {"kind":"composite","sha":"main","directory":".github/actions/pr-require-checks/check-contract","local":true}.
    checkFleet then reported no drift for ci-workflows against that tree's run.sh and
    action.yml. Only one live composite or linkage call exists in ci-workflows' workflows
    (pr-require-checks.yml:763), so no legacy pr-contract call can win the scan.
  • The real pin scan needs LOCKSTEP_GITHUB_TOKEN or GITHUB_TOKEN to read private callers.
    Without one it exits 1 with fetch-error: the pin scan reads private gate callers and needs LOCKSTEP_GITHUB_TOKEN or GITHUB_TOKEN; neither is set. The fleet-wide result therefore comes
    from the workflow's run on main after merge.

Related

🤖 Generated with Claude Code

…al reference

ci-workflows' gate now calls its own check-contract composite as
`uses: $/.github/actions/pr-require-checks/check-contract`, GitHub's
self-repository syntax. The local-reference pattern matched only `./`, so the
pins audit found no artifact for ci-workflows and failed on every push to main.
Accept `$/` as well as `./`, keeping the anchor on a live `uses:` entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 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-14T04:17:45.823530Z 4ac491c PR opened
ℹ️ 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-security-review reviewed 4ac491c2197ee84d221c92b2cd5ea438d45dc3dd: 0 finding(s), 0 as inline comments.

No security findings in this pull request.

Scope reviewed: components/pr-convention-policy/lockstep-drift.mjs and its test file, from the full diff.

What changed: the COMPOSITE_LOCAL_PATTERN regex now accepts a $/ self-repository reference as well as ./. A $/ reference resolves to the repository's own tree at main, the same as ./ does today.

Checks:

  • Regex: [.$] is a character class, so $ is a literal with no ReDoS or anchoring change. The directory group still comes from the fixed COMPOSITE_DIRECTORIES allowlist, so no consumer-controlled text enters a path.
  • Fetch: the local branch in runPinScan builds its URL from CONSUMER_REPOSITORIES and the allowlisted directory, with ref set to "main". A consumer workflow cannot steer the fetch to another repository, ref or path.
  • Commented-out calls: USES_PREFIX excludes # before uses:, and the new test asserts that a commented $/ line is not a call site.
  • Trust controls: none touched. The diff changes no trusted-actor list, token scope, kill switch, merge hold or manifest. It adds no workflow, secret handling or injection surface.
  • Drift gate: the scan is advisory drift detection. At worst a $/ reference makes a consumer's call resolve to its own main, the same trust level the existing ./ form already had.

manifest: not hit.
critical-findings: 0

@github-actions

Copy link
Copy Markdown

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

No findings. I read the full diff (2 files) and the PR context, and checked the surrounding code in lockstep-drift.mjs (USES_PREFIX, COMPOSITE_DIRECTORY_GROUP, the local-pattern branch in detectArtifactPin, and its use in runPinScan). I did not run the tests, so the author's "95 of 95 pass" and the offline dry run against ci-workflows are author-claimed and unverified by me.

  • The change is correct. [.$]/ inside a regex character class matches a literal . or $, so ./ and $/ are both accepted. The uses: anchor and the no-#-earlier-on-the-line rule still apply, so commented-out lines are still ignored.
  • The downstream path needs no change. runPinScan reads the local artifact from the consumer's own tree whenever found.local is set, whatever the prefix. Nothing else in the component assumes ./.
  • The tests cover the new behaviour. There is a positive case for a $/ reference and a negative case for a commented-out $/ line.
  • No closing issue. The PR states No related issue: <reason>, which satisfies the pr-body-contract.md opener, so there are no acceptance criteria to check.
  • No other review inputs applied. The diff touches no plugin manifests. No settled-threads, prior-findings or paved-path files were supplied, so there were no manifest lines, settled points or prior findings to report.
  • No subagents were used. The change was small enough to review directly.

Verifier dropped 0 of 0 candidates.

@kyle-sexton
kyle-sexton merged commit 97a6d79 into main Nov 14, 2026
22 checks passed
@kyle-sexton
kyle-sexton deleted the fix/pin-audit-local-composite-reference branch November 14, 2026 04:21
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.

1 participant