Skip to content

ci: split the PR convention lockstep into a PR copy check and a pin audit - #741

Merged
kyle-sexton merged 6 commits into
mainfrom
feat/split-pr-convention-lockstep
Oct 9, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
feat/split-pr-convention-lockstep

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

No related issue: follow-on to #740, part of moving the STANDARDS_SYNC_APP_* secrets into the main-only standards-sync environment; no standards issue tracks it.

Summary

The verify-pr-convention-lockstep job ran on every pull request and minted a
standards-sync App token to read five private gate callers for the caller-pin
scan. Those secrets are moving to the standards-sync environment, whose
branch policy admits only main, so a pull-request job can no longer mint the
token. This splits the lockstep check (ADR-0008) in two: the copy check, which
reads only public repositories, stays on pull requests; the pin scan moves to a
main-only audit workflow.

Based on #740 (fix/stop-reading-repo-sync-secrets), which is still open; merge
#740 first, and this diff then shrinks to its own two commits.

Fix

  • pr-require-checks.yml: verify-pr-convention-lockstep becomes
    check-pr-convention-copies. It keeps the gawk step, the hermetic tests and
    the copy check, reads the public repositories with github.token, and no
    longer references STANDARDS_SYNC_APP_*. ci-status needs: and results
    use the new id. The note about mirroring the App secrets into Dependabot
    secrets is dropped: the PR job no longer reads them, and Dependabot never
    triggers the push or schedule events the new workflow runs on.
  • New maintenance-audit-pr-convention-pins.yml: runs on every push to main,
    weekly at 29 7 * * 3, and on dispatch. The audit job declares
    environment: { name: standards-sync, deployment: false } (the fix(workflows): stop reading repo-level sync App secrets #740 shape),
    mints the read-only contents App token behind the HAS_APP_CREDENTIAL guard,
    runs the pin scan, and fails on drift. It opens no issue, per the CI posture
    (AGENTS.md, README); the scheduled-run failure notification is the signal.
  • lockstep-drift.mjs takes one mode, copies or pins. npm scripts
    lint:pr-convention-copies and audit:pr-convention-pins replace
    lint:pr-convention-lockstep. The pin mode fails up front when neither
    LOCKSTEP_GITHUB_TOKEN nor GITHUB_TOKEN is set, so it can never pass on the
    public callers alone. New hermetic tests cover mode parsing, the token
    requirement, and the CLI exit codes for a missing mode and a tokenless pin
    scan.
  • vocabulary.json: maintenance function audit-pr-convention-pins.
  • ADR-0008 gains a "Revisited 2026-10-08" section; the component README, the
    README CI posture section describe the split.

Verification

  • npm run test:pr-convention-lockstep: 85 tests, 85 pass (3 new).
  • npm run test:pr-convention-policy: pass.
  • npm run lint:pr-convention-copies with no token set: "every copy matches
    policy.json", exit 0.
  • npm run audit:pr-convention-pins with no token set: fails with
    "fetch-error: the pin scan reads private gate callers and needs
    LOCKSTEP_GITHUB_TOKEN or GITHUB_TOKEN; neither is set", exit 1. The live pin
    scan with a token was not run locally; the first main run of the new
    workflow exercises it.
  • npm run test:github-actions-conventions: 14 pass; npm run lint:github-actions-conventions: 0 findings.
  • actionlint and zizmor --offline on both workflows: no findings.
  • npm run lint:concurrency-policy and npm run lint:runner-policy: pass.
  • code-review-rules.sh file: AGENTS.md carries the section.
  • biome, markdownlint, typos, editorconfig and gitleaks through the lefthook
    pre-commit hooks: pass.

Related

  • Refs fix(workflows): stop reading repo-level sync App secrets #740 (moves the two audit jobs into the standards-sync environment;
    this branch is based on it).
  • The STANDARDS_SYNC_APP_* repository-secret retirement plan owned by the
    Automation Lanes session: this removes the last pull-request reader of those
    secrets.
  • melodic-software/github-iac .github/governance-verify/expected-contract-only-gates.json
    maps the standards lane pr-convention-lockstep to verify-pr-convention-lockstep
    under jobRenames; it needs check-pr-convention-copies in step with this
    merge, or the daily governance verification reports the job missing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T7GukBojtE99rLCPY7Cw3R

kyle-sexton and others added 5 commits October 8, 2026 19:42
The two scheduled audits read private repositories through the
standards-sync App token. Run their jobs in the main-only standards-sync
environment (deployment: false), whose secrets carry the App key, so the
repository-level STANDARDS_SYNC_APP_* secrets can be deleted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T7GukBojtE99rLCPY7Cw3R
…udit

The STANDARDS_SYNC_APP_* secrets move to the main-only standards-sync
environment, which a pull-request job cannot enter, and the caller-pin
scan needs that App token to read five private gate callers.

- pr-require-checks.yml: verify-pr-convention-lockstep becomes
  check-pr-convention-copies. It keeps gawk, the hermetic tests and the
  copy check, reads only public repositories with the workflow token,
  and no longer references the App secrets. ci-status waits on the new id.
- maintenance-audit-pr-convention-pins.yml runs the pin scan in the
  standards-sync environment on a push to main touching the component,
  weekly (Wednesday 07:29 UTC) and on dispatch, and fails on drift.
- lockstep-drift.mjs takes a mode, copies or pins; npm scripts
  lint:pr-convention-copies and audit:pr-convention-pins replace
  lint:pr-convention-lockstep. A tokenless pin scan fails up front.
- vocabulary.json gains maintenance function audit-pr-convention-pins.
- ADR-0008 records the split; the component README and CI posture
  describe it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T7GukBojtE99rLCPY7Cw3R
A weekly scheduled failure is easy to miss, so the pin audit also keeps
one issue, found by its fixed title "PR convention pin drift": opened
when drift appears and none is open, rewritten by each failing run, and
closed by the first clean run. A run that could not scan (no token, a
crash without findings) leaves the issue alone.

The issue work runs in a separate report job holding only issues: write,
so that permission never shares a job with the App token. README's CI
posture and AGENTS.md's review rule, which said no workflow here
maintains an issue, now name this one exception.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T7GukBojtE99rLCPY7Cw3R
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 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-09T01:44:53.461702Z 8f13bcb 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.

@claude

claude Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 33s —— View job


Security Review (/review:security-review)

  • Gather context (diff, workflow files, instruction-surface check)
  • Check skip gate
  • Review changed files for security issues (logic, trust boundaries, token handling, Actions data-flow)
  • Check for instruction-surface deletions in AGENTS.md/README/ADR changes
  • Adversarially verify any candidate findings
  • Post final findings

No security issues found.

Reviewed all 9 changed files (git diff origin/main...HEAD) against the criteria in /review:security-review:

  • Token/credential handling — maintenance-audit-pr-convention-pins.yml mints a read-only contents App token, guarded behind HAS_APP_CREDENTIAL (a boolean, never the credential itself), inside the standards-sync environment whose branch policy admits only main. This correctly removes the previous arrangement where a pull-request-triggered job could mint that same token.
  • Trust-boundary improvement — pr-require-checks.yml (check-pr-convention-copies) drops the App-token mint entirely and uses only the ephemeral github.token scoped to contents: read, which is appropriate since it now only reads public repositories. This reduces secret exposure on PR-triggered runs (including fork/Dependabot PRs), it doesn't add any.
  • Tokenless fallback is a hard failure, not a silent pass — requirePinScanToken in lockstep-drift.mjs throws before any network call when neither LOCKSTEP_GITHUB_TOKEN nor GITHUB_TOKEN is set, so the pin scan can't pass having only checked a subset of callers. Covered by hermetic tests including CLI exit-code assertions.
  • New workflow triggers — push (path-filtered to the component), schedule, and workflow_dispatch, all gated by the standards-sync environment's branch policy; no pull_request_target/workflow_run on untrusted input, no injectable workflow inputs, no expression-injection surface in run: blocks.
  • Instruction-surface check — the README.md "CI posture" change (L114-119) only adds the new workflow to the list of audits that fail-on-drift-without-opening-an-issue; it doesn't narrow or remove the "no workflow opens/maintains an issue" rule, so this isn't an instruction-surface deletion. No AGENTS.md, rules file, hook, or skill body is touched in this diff. (Note: docs/conventions/instruction-exception-register/README.md is not present in this checkout, so the protected-class list itself was not consulted — recognition here was by consequence, per the skill's fallback.)
  • GitHub Actions pin/hardening concerns (permissions, trigger safety, pin integrity) are zizmor's advisory lane per the skill's scope and are not re-reported here; the PR description notes zizmor --offline passed on both workflows.

@claude

claude Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 3m 56s —— View job


Code review complete

  • Gather context (PR diff, changed files)
  • Review workflow changes (pr-require-checks.yml, maintenance-audit-pr-convention-pins.yml)
  • Review lockstep-drift.mjs + tests
  • Review docs/vocabulary/package.json changes
  • Post findings

Scope: reviewed the full diff (git diff origin/main...HEAD) across all 9 changed files against this repo's CLAUDE.md/AGENTS.md/REVIEW.md conventions, with particular attention to the lockstep-drift.mjs mode split (runCopyCheck/runPinScan), the new maintenance-audit-pr-convention-pins.yml workflow, and the ci-status needs:/results wiring in pr-require-checks.yml.

No high-signal findings. This is a clean mechanical split:

  • runLiveCheck() is correctly decomposed into runCopyCheck() (public sources, workflow token) and runPinScan(env) (private callers, App token, with requirePinScanToken failing closed before any network call — so a tokenless run can never silently pass on the public subset).
  • pr-require-checks.yml's check-pr-convention-copies rename is propagated consistently to ci-status's needs: list and results string (lines 1071, 1116); no orphaned references to the old verify-pr-convention-lockstep id or lockstep-token step id remain in workflows or scripts.
  • The new maintenance-audit-pr-convention-pins.yml matches the established standards-sync environment / HAS_APP_CREDENTIAL guard shape used by maintenance-audit-code-review-rules.yml and maintenance-audit-link-check-excludes.yml (guarded mint step, explicit "missing credential" error step, no silent skip).
  • New hermetic tests (parseMode, requirePinScanToken, and the two spawnSync CLI exit-code tests) exercise exactly the new seams; the tokenless-pin-scan CLI test strips env down to PATH so it can't accidentally pass via an ambient GITHUB_TOKEN.
  • Docs (README.md, component README.md, ADR-0008) and vocabulary.json are all updated in lockstep with the code/workflow rename — no stale verify-pr-convention-lockstep or lint:pr-convention-lockstep references outside the one historical "on the PR head 145870d..." example in the component README, which correctly describes a past run and should stay as-is.

Not independently verified (author-claimed in the PR body, not re-run by this review): the live pin scan against real tokens, actionlint/zizmor results, and the exact "private vs. public" count for the fleet's gate callers. The test suite and lint commands listed in the Verification section were not re-executed in this review environment.

One non-blocking observation, left out of the findings list per the high-signal bar (no concrete failure scenario, just a documentation-completeness question): components/github-actions-conventions/README.md's "Renaming a workflow, job or action" section describes rename-map.json as the record of approved renames, but this PR's verify-pr-convention-lockstep → check-pr-convention-copies rename adds no entry there. Given lint:github-actions-conventions reportedly passes with 0 findings, the new id apparently needs no map entry to satisfy the analyzer (the map seems to exist for cases where the new name would otherwise fail convention, not as a changelog of every rename) — worth a quick confirmation with whoever owns that component, but not something I'd block on.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

claude-security-review has reviewed this pull request through 523b115; a later push is reviewed from there.

@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: 8f13bcbf4f

ℹ️ 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".

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

claude-review has reviewed this pull request through 523b115; a later push is reviewed from there.

A path filter missed this repository's own caller pins, which the scan
reads; dropping it removes the list to keep in sync. The component
README's Rollout section now says which half gates pull requests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T7GukBojtE99rLCPY7Cw3R
@claude

claude Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 38s —— View job


Reviewing PR #741 (incremental)

  • Gather context (incremental diff, custom instructions)
  • Invoke /review:code-review scoped to the incremental diff
  • Post findings as inline comments / summary

Code review complete (incremental)

Scope: per the custom instructions, this pass reviews only what changed between 8f13bcb and 523b115 (.claude-lane/incremental.diff), i.e. the two commits that respond to the earlier Codex review comments:

  • .github/workflows/maintenance-audit-pr-convention-pins.yml
  • components/pr-convention-policy/README.md

Everything else in the PR was already reviewed at 8f13bcb and is unchanged since.

No high-signal findings. Both changes are targeted, correct fixes for the two Codex comments on the prior commit:

  • P2 (push trigger couldn't see local caller-pin changes) — maintenance-audit-pr-convention-pins.yml drops the paths: filter entirely, so the push: branches: [main] trigger now fires on every push to main, including a repin inside pr-require-checks.yml itself. The updated header comment (lines 10-13) accurately describes the new behavior ("no path filter has to track which files those are"), and no stale reference to the removed filter remains elsewhere in the file.
  • P1 (Rollout section didn't describe the new gate) — components/pr-convention-policy/README.md#L213-L220 adds a paragraph that correctly distinguishes the split: copy comparisons still gate pull requests (check-pr-convention-copies), pin comparisons moved off the pull-request path into the main-only, non-blocking maintenance-audit-pr-convention-pins.yml, which fails its own run on drift but gates no merge. It explains why no fresh baseline/observation period is needed — both halves run the comparison code the already-documented live run (PR head 145870d, Actions run 37465415796) exercised — and names the first main run as the evidence for the new standards-sync environment specifically, consistent with the admission-evidence / enforcement-rollout sections this component's AGENTS.md citation points to.

Checked for knock-on inconsistencies in these two files (stale filter references, mismatched job/workflow names between the comment and the on: block, contradictions with the pre-existing Rollout prose) — found none.

Not independently verified: whether check-pr-convention-copies and maintenance-audit-pr-convention-pins.yml's actual trigger behavior matches GitHub's runtime semantics (not re-run in this environment) — taken on the YAML read, which is unambiguous here.
· branch feat/split-pr-convention-lockstep

@claude

claude Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 35s —— View job


Security Review (/review:security-review) — incremental

  • Gather context (.claude-lane/incremental.diff, scoped to the two changed files)
  • Check skip gate
  • Review changed hunks for security issues (logic, trust boundaries, token handling, Actions data-flow)
  • Check for instruction-surface deletions
  • Adversarially verify any candidate findings
  • Post final findings

Scope: incremental review since 8f13bcb, limited to the two files the diff touches:

  • .github/workflows/maintenance-audit-pr-convention-pins.yml — drops the paths: filter on the push: branches: [main] trigger (Codex's P2 comment) so the pin audit now runs on every push to main, not just pushes touching components/pr-convention-policy/**, package.json, or the workflow file itself. Only the comment and trigger shape changed; the environment: { name: standards-sync, deployment: false } block, the HAS_APP_CREDENTIAL guard, the read-only token mint, and the job's permissions are all untouched since 8f13bcb.
  • components/pr-convention-policy/README.md — adds a paragraph to the Rollout section (Codex's P1 comment) reconciling it with the split gate. Prose only.

No security issues found.

  • The trigger-filter removal widens when the audit runs (now unconditionally on every main push) but does not change what it's authorized to do: same environment gate, same guarded App-token mint, same read-only contents scope. It can't be used to mint the token from an unintended context — standards-sync's branch policy still admits only main, and the workflow still has no pull_request_target/workflow_run surface. This is a trigger-configuration change (frequency/cost, not a new privilege boundary), which falls in zizmor's advisory lane per this skill's scope rather than this lane's logic/trust-boundary reasoning.
  • The README addition is documentation reconciling the rollout narrative with the already-shipped split; it doesn't touch, narrow, or remove any enforced rule, so the instruction-surface-deletion check doesn't apply here.

Everything else in this PR (the other 7 changed files) was already reviewed at 8f13bcb and is unchanged since.

@kyle-sexton
kyle-sexton merged commit d18882a into main Oct 9, 2026
39 checks passed
@kyle-sexton
kyle-sexton deleted the feat/split-pr-convention-lockstep branch October 9, 2026 01:56
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