Skip to content

ci(pr-pipeline): run the runner-policy gate from the standards checkout - #18715

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
ci/runner-policy-from-standards
Nov 24, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
ci/runner-policy-from-standards

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Summary

The ci-status gate job (lint-repo) runs the runner-policy engine from a run-time checkout of melodic-software/standards instead of the synced .github/standards/runner-policy/ copy. This is the second reader move of the standards sync track (Brief Q2: synced CI-only files are read from a run-time standards checkout; readers move first, copies are deleted last), after #18645.

Fix

  • .github/workflows/pr-require-checks.yml, lint-repo: a new Check out the run's standards commit step (melodic-software/ci-workflows/.github/actions/download-standards@main, id standards, gated on run_workflows like the other runner-policy steps). The install step runs npm ci --prefix "$STANDARDS_DIR/components/runner-policy" and the policy step runs node "$STANDARDS_DIR/components/runner-policy/runner-policy.mjs" --root ., with STANDARDS_DIR set from steps.standards.outputs.path on those two steps only.
  • The npm cache key drops .github/standards/runner-policy/package-lock.json. hashFiles reads only the workspace, so the standards lockfile cannot be in the key; the engine pins yaml 2.9.1 and ajv 8.20.0, the same as scripts/ci-deps, whose lockfile stays in the key. No setup-node cache option names a file under the standards checkout.
  • docs/conventions/source-control.yaml runner_policy_paths: drops the copy's policy.json; babysit routes a runner-label finding to docs/ci-runner-routing.md, which now names components/runner-policy/policy.json in standards. That paragraph also stops claiming ci-workflows reusables are SHA-pinned: every call is @main, which the engine admits for ci-workflows (runner-policy.mjs reusableWorkflowContract).

Not changed: the .github/standards/runner-policy/ copy, its Dependabot entry and CODEOWNERS lines (the deletion PR removes them), and every other step of the workflow.

Verification

  • The standards engine at melodic-software/standards main and its policy.json are byte-identical to the copy (diff of both files).
  • node <standards>/components/runner-policy/runner-policy.mjs --root . --repository-visibility public after npm ci --prefix <standards>/components/runner-policy: Runner policy passed.
  • actionlint and zizmor --offline on pr-require-checks.yml: no findings.
  • Passed locally: check-docs-only-gate, merge-group-scope, ci-ordered-skips, check-affected-gates, check-comment-hygiene, workflow-self-paths, check-lane-coverage, run-hygiene-gate test suites; check-workflow-template-size, check-read-caller-keys, check-artifact-retention with --check; check-changelog-fragments.sh --check-required origin/main (no fragment-mode plugin changed).

Related

Closes #18713

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 23, 2026 23:34
The lint-repo job checks out the run's melodic-software/standards commit
with download-standards and installs and runs
components/runner-policy from it instead of the synced
.github/standards/runner-policy copy. The npm cache key drops the copy's
lockfile: hashFiles reads only the workspace, and the engine's pins match
scripts/ci-deps'. runner_policy_paths and docs/ci-runner-routing.md
point at the standards component. The copy stays until the deletion PR.

Closes #18713

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 24, 2026 04:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 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-24T04:39:01.950281Z da2254f 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
Contributor

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

Code review: no findings

The lint-repo job in .github/workflows/pr-require-checks.yml now gets the runner-policy engine from a run-time checkout of melodic-software/standards, through download-standards@main. It no longer uses the synced copy at .github/standards/runner-policy/. The checkout step only runs when the workflows filter group is set, the same condition as the other runner-policy steps. STANDARDS_DIR is set only on the install and enforce steps. The npm cache key drops the copy's lockfile. runner_policy_paths stops listing the copy's policy.json, and docs/ci-runner-routing.md now points to the standards components/runner-policy/policy.json.

Closing issue #18713, "Done when" items:

  • Checkout step gated on run_workflows: met (pr-require-checks.yml#L1942).
  • npm ci and node run from the standards path, and no job step reads .github/standards/runner-policy/: met (L1946-L1968). The only other workflow that names the copy is pr-check-managed-files-hosted.yml, which is not the lint-repo job.
  • Cache key no longer hashes the copy's lockfile, and no setup-node cache option names a standards file: met (L1941).
  • runner_policy_paths drops the copy, and ci-runner-routing.md names the standards policy.json: met. The schema (source-control.schema.json#L224) has no minimum item count, so one entry is valid.
  • actionlint and the engine pass: claimed by the author, not checked. This lane has no shell.

Other checks:

  • The new doc says every ci-workflows reusable workflow is called at @main. A search of .github/workflows found no ci-workflows/.github/workflows/... call pinned to anything else, so that holds.
  • Dropping the lockfile from the cache key only lowers the chance of a cache hit. npm ci still installs from the standards lockfile.

Not applicable:

  • No plugin manifest changed, so there are no manifest lines.
  • The PR text contains no embedded instructions to the review.
  • The wrapper sent no loosened-check lines, so this review used the default fail verdict with no consumer entries and did not check the decision-record citation. Nothing in the change loosens a check, so Loosened checks would be marked: does not apply.
  • No prior findings and no settled threads. This is the first review, so it was not limited to blocking findings.

Spend: none. The added step is one download in a job that already runs.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: PR #18715, run the runner-policy gate from the standards checkout

No security issues found.

What I checked

  • .github/workflows/pr-require-checks.yml (lint-repo, a trusted path). I read the whole change and the job around it. The job runs on pull_request, merge_group, schedule and workflow_dispatch only (L8-L75). Its permissions: block is contents: read plus checks: read (L1264-L1266). Checkout uses persist-credentials: false, and the new steps get no secret and no token input.
    • The new download-standards@main step (L1942-L1945) comes from the owner's own ci-workflows repository.
    • The runner-policy engine and its npm ci now come from melodic-software/standards instead of the in-tree .github/standards/runner-policy/ copy (L1946-L1968).
    • STANDARDS_DIR comes from a step output and is quoted in run:. It is not built from the github context, so there is no expression-injection path.
    • The checkout happens after head code has already run in this job (for example scripts/ai-slop-report.sh at L1923). Head code could therefore still tamper with it. That widens nothing: on the base, the engine was read from the pull request's own head tree, which the author could edit directly. The gate is not easier to bypass than before, and the job holds no credential to leak.
    • Runner policy is a hygiene gate. It is none of the listed trust controls: not the trusted-trigger check, the lane token, the kill switch or a ci-status merge hold. No trust control is widened.
    • The unpinned @main action reference is zizmor's advisory lane, so I do not report it here.
  • docs/ci-runner-routing.md. Prose only. It stops claiming SHA pins and points at the standards policy.json. It removes no instruction rule.
  • docs/conventions/source-control.yaml (a trusted path). It drops .github/standards/runner-policy/policy.json from runner_policy_paths, which only changes where babysit routes a runner-label finding. It grants nothing and widens no hold.

PR context: it contains no embedded instructions aimed at the lane.

Spend: one extra standards download and npm ci per lint-repo run that has run_workflows set. This is runner time on the existing hosted ubuntu-24.04 runner, not a new charge.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

The unattended merge path is about to ask GitHub to enqueue this pull request at head da2254ff0a437ced534b83697c3c6e0b2996493a. GitHub can still refuse it after accepting the request.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 5086ade Nov 24, 2026
146 of 147 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the ci/runner-policy-from-standards branch November 24, 2026 07:03
kyle-sexton added a commit that referenced this pull request Nov 24, 2026
…le list comments

After merging main, lint-repo had two `id: standards` steps: this PR's
run-SHA checkout and the runner-policy one from #18715. Keep the run-SHA
step; the runner-policy install and policy steps read the same
`steps.standards.outputs.path`.

Update the ci-status comments that still said the job reads no resolver
output and that the trusted-actor list comes from the base commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
kyle-sexton added a commit to melodic-software/pr-pipeline-sandbox that referenced this pull request Nov 24, 2026
No linked issue: resync from ccp fbaa789

## Summary

Brings every `scripts/lanes/check-sync.sh` SYNCED path to
claude-code-plugins main at `fbaa789fc3d4dd4c13b94d46841a11926b928733`,
from `ac4f20988f97481085e38d05d563ccc00a2bc888`, the source of #406. The
source carries the D2 pull requests
(melodic-software/claude-code-plugins#18649,
melodic-software/claude-code-plugins#18715,
melodic-software/claude-code-plugins#18719,
melodic-software/claude-code-plugins#18712,
melodic-software/claude-code-plugins#18695,
melodic-software/claude-code-plugins#18697), which repoint the lane
files to read trusted-actors, vocabulary, runner-policy and the
Dependabot policy from a standards-main checkout instead of the synced
`.github/standards/` copies.

This one is large: 821 files (816 byte copies, 5 sandbox-own files),
against #406's 46. Expect both review lanes to report
`failure-class=partial`.

Upstream also switched its ci-workflows references from SHA pins (#406:
141 on v0.78.0) to `@main` throughout the synced workflows; the copy
carries that change as is.

## Fix

- SYNCED, byte copy from `fbaa789f` with the ADAPTED, LEFT_OUT and
PINNED paths excluded: 91 added, 15 deleted, 707 modified, 3 renamed
(`babysit_risk*.py` to `diff_risk*.py`). Deleted upstream: the local
actions `scan-upload`, `setup-pinned-node` and `upload-lane-transcript`,
`.github/scripts/pr-review-main/split-diff.py` and
`plugins/discovery/scripts/check-hook-registration.test.sh`.
- The copy drops the stale repin literal
`[".github/workflows/maintenance-repin-ci-workflows.yml", "gate"]` from
`.github/scripts/pr-merge/merge-holds.mjs` (line 492 on main).
- ADAPTED and PINNED: no edit. `.github/standards/` is untouched; phase
F removes it.

Sandbox-own edits, each mirroring claude-code-plugins at `fbaa789f`:

1. `.github/workflows/pr-require-checks.yml`: the merge-queue Set up
Node step uses
`melodic-software/ci-workflows/.github/actions/setup-pinned-node@main`,
and `/.github/actions/setup-pinned-node/` leaves its sparse checkout, as
claude-code-plugins' own `pr-require-checks.yml` does. The local action
it used is gone upstream, so without this every merge-queue run fails.
2. `scripts/lanes/check-sync.sh`: four paths join SYNCED under the
existing "Modules the synced scripts and tests import from outside those
folders" rule, since copied code now reads them:
- `.github/scripts/pr-dispatch-feedback/rerun-ci-status.sh`, which
`pr-dispatch-feedback.yml` runs.
- `.github/scripts/intake-triage/size-split.mjs` and `issue-spec.mjs`,
imported by `admit.mjs`, `work-resolve-issue/check-blockers.mjs`,
`write-issue.mjs` and `pr-verify/resolve-pr.mjs`.
- `.github/lane-registry.json`, read when `lib/lane-registry.mjs` loads
(imported by `pr-merge/refire-refused.mjs`).
3. `docs/conventions/source-control.yaml`: adds `trusted_actors_source:
standards` and `standards_repository: melodic-software/standards`, as
claude-code-plugins' file sets them.
4. Lint config for the copied files, taken from claude-code-plugins' own
configs: `.shellcheckrc` with its `shell=bash`, `external-sources=true`
and `source-path=SCRIPTDIR` lines (shellcheck follows sourced files,
which clears the SC2034 and SC2154 warnings on the copied
`check-hook-registration.sh`, `fetch-docs.sh` and
`provision-prerequisites.test.sh`), and `_typos.toml` with its `abd`
identifier, which `.github/scripts/lib/gate-expression.test.mjs` uses.
No check is disabled.

## Verification

- `scripts/lanes/check-sync.sh fbaa789fc3d4dd4c13b94d46841a11926b928733
--repo <claude-code-plugins clone>` exits 1 with only the four PINNED
lines, as in #406:

  ```text
check-sync: .github/standards/dependabot-policy/policy.json differs from
add8219a557d432d9f4dbd1cac98b0e8a2114b10 (100644
0763ab8, want 100644
a3fa7c3)
check-sync: .github/standards/runner-policy/package-lock.json differs
from 4ac70b2c402920d9c42b9a9f00e86c14d7f785ea (100644
d84d4e7, want 100644
53bb20a)
check-sync: .github/standards/runner-policy/policy.json differs from
9329c4cd64765267e43aef0ceef58c40961cd676 (100644
0eec702, want 100644
b8c22e8)
check-sync: .github/standards/runner-policy/runner-policy.mjs differs
from c277271481af37c9761bcf802a3bc692540bb53a (100755
4d632ca, want 100755
105e36d)
  ```

- Local paths the workflows name (`.base/...`, `./.github/...`): none
newly missing. Three were already missing on main and stay so:
`.base/.github/verify-legacy-fails.json` in `pr-dispatch-feedback.yml`,
`pr-merge.yml` and `pr-unblock-dispatch.yml`, and `.base/lib/cdn-pins`,
read behind an `[ -f ]` guard.
- Relative imports and `new URL(..., import.meta.url)` targets in every
non-test `.github/**/*.mjs`: all resolve but two, both read guarded or
already on main (`scripts/upstream-drift-vendored-report.sh` inside a
try/catch, `docs/upstream/` in `resolve-pr.mjs`).
- `actionlint` over the 9 changed workflows: no findings.
- `node --test --test-concurrency=4` over the 90 changed
`.github/scripts/**/*.test.mjs`: 2795 tests, 2709 pass, 84 fail. The
failures read workflows, scripts or packages this repository does not
carry or install here (`ajv`, `yaml`, `scripts/selection-audit.sh`,
`scripts/affected-tests.sh`, `scripts/plan-test-lanes.sh`,
`security-outside-actor/flag.mjs`, `pr-review-comment-relay.yml`,
`intake-triage.yml` and others), plus two that test this repository's
own `pr-require-checks.yml` concurrency groups. Not compared against
main, since most of these files are new. `merge-holds.test.mjs` alone:
77 of 78 pass; the one failure imports
`security-outside-actor/flag.mjs`. No workflow here runs `node --test`.
- Pre-commit and pre-push hooks pass, none skipped. Added lines scanned
for machine paths and secrets: none.

Not verified: no lane run has exercised this head here.

## Related

- Previous resyncs: #406, #403 and #402.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

Run the ci-status runner-policy gate from the standards checkout

1 participant