Skip to content

feat(standards-sync): add inert reusable config-sync workflow (Track B) - #50

Merged
kyle-sexton merged 6 commits into
mainfrom
track-b-standards-sync
Jun 29, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
track-b-standards-sync

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Summary

The first-party sync engine for standards Track B (config & file distribution) — see the companion PR melodic-software/standards#53 for the program docs, manifest, and decisions. Reads a distribution manifest from standards, copies each included file to its per-layout destination in each target repo, and opens a PR per target (never pushes to a default branch). Upstream is authoritative; synced files are read-only-by-convention downstream.

Inert by design — safe to merge before activation

  • dry-run defaults true: the plan job logs the full per-target plan from the manifest alone (no target checkout, no token), so it is useful and harmless before auth exists.
  • The writing sync job is gated (if: !inputs.dry-run) behind a GitHub App token that is not provisioned yet (a separate gated step via github-iac, per-account).
  • A missing per-layout destination is skipped, not an error (supports layout-specific files like the root extend-stubs).

Security posture

  • All actions SHA-pinned per D5 (checkout, create-github-app-token, create-pull-request); persist-credentials: false; the App token is scoped per-owner (owner + repositories); inputs passed via env, never inlined into run.
  • Please confirm it's clean against this repo's actionlint + zizmor lanes — actionlint is clean locally; zizmor I could not run locally.

Not in this PR (gated)

  • The caller workflow in standards (added at activation, pinned to this workflow's @SHA).
  • GitHub App creation + secrets via github-iac.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GbDWhcUtduCejgi7mcbMfy

First-party engine for standards Track B (config & file distribution):
reads a distribution manifest, copies each included file to its per-layout
destination in each target repo, and opens a PR per target (never pushes
to a default branch). Upstream is authoritative; synced files are
read-only-by-convention downstream.

INERT until activated: dry-run defaults true (the plan job logs the full
per-target plan from the manifest alone -- no target checkout, no token),
and the writing sync job is gated behind a GitHub App token that does not
exist yet (provisioned via github-iac, per-account, as a separate gated
step). SHA-pinned actions (checkout, create-github-app-token,
create-pull-request) per D5; persist-credentials:false; inputs passed via
env, not inlined into run. Validate against this repo's actionlint +
zizmor lanes before merge.

See melodic-software/standards docs/dedup-program/config-distribution-plan.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GbDWhcUtduCejgi7mcbMfy
@claude

claude Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

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


PR Review: feat(standards-sync): add inert reusable config-sync workflow (Track B)

  • Gather context
  • Read the workflow file
  • Check security posture (SHA pins, secret handling, trigger safety)
  • Check logic and correctness
  • Post findings

Overall

Solid design. The two-phase plan → sync split, dry-run: true default, persist-credentials: false on both checkouts, env-var-only shell interpolation, scoped App token, and fail-fast: false on the matrix are all correct. The CLAUDE.md SHA-pin requirement is met for all three actions. Three findings below — one worth fixing before activation, two informational.


Findings

1. required: true secrets conflict with dry-run inertness — Medium

standards-sync.yml L34–41

secrets:
  app-id:
    required: true
  app-private-key:
    required: true

Both secrets are required: true, but they are only consumed in the sync job, which is gated behind if: ${{ !inputs.dry-run }}. In dry-run mode (the default, and the only mode available before the App is provisioned), these secrets are never read. Yet GitHub enforces required: true at the call-site declaration level — callers must include the secrets keys even when running dry-run only. This means any caller workflow will need to wire secrets: { app-id: ..., app-private-key: ... } immediately, before the App exists, just to invoke dry-run: true.

Consider dropping to required: false and adding a sync job guard that validates the secrets are non-empty before attempting to mint the App token:

- name: Validate App credentials present
  if: ${{ !inputs.dry-run }}
  run: |
    if [ -z "${{ secrets.app-id }}" ] || [ -z "${{ secrets.app-private-key }}" ]; then
      echo "::error::app-id and app-private-key must be provided when dry-run is false"
      exit 1
    fi

Fix this →


2. Manifest $src/$dest values are not path-sanitized — Low

standards-sync.yml L128–149

mkdir -p ".target/$(dirname "$dest")"
cp ".standards-src/$src" ".target/$dest"

$src and $dest are read from the manifest YAML and used directly as file paths. A manifest entry containing ../../outside/workspace would write (or read) outside the intended .standards-src/ and .target/ subtrees. The manifest comes from melodic-software/standards — a trusted first-party repo — so this is a low-impact finding in current practice. But it's a latent risk if the standards repo is ever compromised or if this workflow is generalised.

Inexpensive mitigation: assert both values start without a leading / or .. component before using them:

[[ "$src" =~ ^(\.\.|/) ]] && { echo "::error::unsafe src path: $src"; exit 1; }
[[ "$dest" =~ ^(\.\.|/) ]] && { echo "::error::unsafe dest path: $dest"; exit 1; }

3. actions/create-github-app-token SHA version comment — Informational

standards-sync.yml L105

uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0

I can't verify this SHA corresponds to v3.2.0 without network access. If the comment is wrong, Dependabot will still track the SHA correctly for the pin itself, but it may emit an inaccurate version comment when it bumps the SHA. Worth a manual cross-check against the action's release page before merge (or trust that CI's Dependabot config covers it going forward).


4. plan job has no explicit permissions block — Informational

standards-sync.yml L46–90

sync explicitly redeclares permissions: contents: read; plan relies on inheriting the workflow-level block. Functionally identical, but inconsistent. If sync's job-level block is there as belt-and-suspenders hardening (in case the workflow-level grant is widened later), the same rationale applies to plan. Not a bug — just a style note.


5. zizmor not yet validated — Informational

The PR description requests this; the repo's zizmor lane is advisory-only (fail-on-findings: false default) so it won't block merge. Still worth checking the annotations before activation — in particular zizmor's template-injection check on commit-message: "... (${{ inputs.standards-ref }})" (L157) in a with: block. That context is generally safe (not a shell run:), but confirming no annotation is cleaner.


Minor observations

  • Branch name (chore/standards-sync, L156): if a standards-ref–keyed sync and a default-ref sync ever run concurrently against the same target, they'd race on this branch. Including ${{ inputs.standards-ref }} in the branch name (e.g. chore/standards-sync/${{ inputs.standards-ref }}) would avoid that.
  • PR title (L161): "chore: sync standards configs" with no ref in the title makes PRs in busy repos harder to distinguish at a glance.

Summary

The security fundamentals are sound and align with CLAUDE.md requirements. Finding 1 (secrets required: true vs dry-run inertness) is worth resolving before the caller workflow is wired, since it forces premature secret wiring. Finding 2 (path traversal) is low-risk given the trusted manifest source but cheap to close. Everything else is informational/style.

@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: 6e85e902d2

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

Comment thread .github/workflows/standards-sync.yml Resolved
…ard)

- secrets app-id/app-private-key -> required: false, with a "Require App
  credentials" guard at the start of the sync job. Lets a caller invoke the
  inert dry-run (the default) without wiring secrets before the App exists;
  real runs still fail fast if credentials are missing.
- sanitize manifest src/dest before copy: reject absolute paths and any `..`
  component so a (first-party) manifest entry can never escape the standards
  or target trees. Defense-in-depth.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GbDWhcUtduCejgi7mcbMfy
@claude

claude Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

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


  • Read the updated workflow file
  • Verify previous findings were addressed (optional secrets, path guard)
  • Check for any new issues in the latest commit
  • Post updated review

Follow-up Review: fix(standards-sync): address PR #50 review

The latest commit (55e42d8) addresses both actionable findings from the prior review. Here is a clean re-assessment of the full file at the current HEAD.


Fixes Verified

Finding 1 (Secrets required: true vs dry-run) — Resolved

standards-sync.yml L34–43

Both secrets are now required: false with an explanatory comment. The sync job opens with a "Require App credentials" guard step that reads the secrets via env: (not shell interpolation) and fails fast with ::error:: before the token mint — correct on both counts.

Finding 2 (Path traversal in $src/$dest) — Resolved

standards-sync.yml L159–163

if [[ "$src" = /* || "$src" == *..* || "$dest" = /* || "$dest" == *..* ]]; then
  echo "::error::unsafe path in manifest entry '$tool' (src=$src dest=$dest)"; exit 1
fi

Blocks absolute paths and any .. substring. One small note: *..* will also reject benign names like foo..bar — it's a non-path-component-aware check. That's conservative (rejects more than needed) which is the right direction for security, not a correctness problem. If the manifest ever has dotdot-containing tool names for legitimate reasons a tighter regex =~ (^|/)\.\\.(/|$) would distinguish them, but that is a very low practical concern given the first-party manifest source.


Remaining Informational Items (unchanged from prior review)

These were never blockers; listing them here for completeness.

SHA version comment — L118: create-github-app-token@bcd2ba49...# v3.2.0 — worth a manual cross-check that the SHA and comment agree before merge.

plan job has no explicit permissions: block — L49–93: it inherits the workflow-level contents: read; sync redeclares it at job level. Functionally identical, just asymmetric style.

zizmor annotations — not yet validated per the PR description; in particular commit-message: "... (${{ inputs.standards-ref }})" at L175 is in a with: block (not a run: step) so it's not a shell injection vector, but confirming no annotation emerges from zizmor is cleaner.

Branch name / PR title — L174 chore/standards-sync (static) could race if two syncs run concurrently against the same target with different standards-ref values; including ${{ inputs.standards-ref }} in the branch name would prevent that. Similarly the PR title at L176 omits the ref.


Summary

Both medium and low findings from the prior review are correctly addressed. The credential guard is properly placed and uses env: for secret expansion; the path sanitization is appropriately conservative. The remaining items are all informational and none block activation. The PR is in good shape.

@kyle-sexton

Copy link
Copy Markdown
Member Author

Thanks — addressed in 55e42d8:

  • required: true secrets vs dry-run inertness (medium) → fixed: both secrets are now required: false, with a "Require App credentials" guard at the top of the sync job that fails fast when they're missing on a real run. A caller can now invoke the default dry-run without wiring secrets before the App exists.
  • Unsanitized $src/$dest (low) → added a guard rejecting absolute paths and any .. component before the copy, so a (first-party) manifest entry can't escape the standards/target trees.
  • app-token SHA ↔ v3.2.0 (info) → verified: bcd2ba49218906704ab6c1aa796996da409d3eb1 is exactly the commit tagged v3.2.0 (and it's the same pin already used elsewhere in this repo). Comment is accurate.

…title

Polish from the PR #50 re-review (all were informational):
- add `permissions: contents: read` to the plan job (explicit least-privilege,
  symmetric with the sync job).
- add a workflow `concurrency` group (queue, no cancel) so two runs never race
  on the same per-target sync branch.
- include the standards-ref in the PR title (the commit message already had it).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GbDWhcUtduCejgi7mcbMfy
@claude

claude Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

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


  • Gather context
  • Read the updated workflow file at HEAD
  • Verify which informational items were addressed in latest commit
  • Post updated review

Follow-up Review: fix(standards-sync): explicit plan-job perms, concurrency, ref in PR title

The latest commit (188213f) addresses all three remaining informational items from the prior re-review. Here is a clean assessment of the full file at current HEAD.


Fixes Verified

plan job explicit permissions — Resolved

standards-sync.yml L58–59

    permissions:
      contents: read

Now symmetric with the sync job — both jobs declare contents: read explicitly at job level rather than relying on workflow-level inheritance. Belt-and-suspenders hardening, correctly applied.

Workflow-level concurrency group — Resolved

standards-sync.yml L50–52

concurrency:
  group: standards-sync
  cancel-in-progress: false

Serializes all workflow runs so two invocations never race on the same per-target sync branch. cancel-in-progress: false (queue, not cancel) is the right choice for a sync — a half-applied run should finish. This resolves the branch-name race concern at the workflow level.

One nuance worth being aware of: the group name standards-sync is a static string. If this reusable workflow is ever called from multiple callers simultaneously (e.g., multiple standards branches), they would all serialize into a single global queue rather than per-caller queues. That's safe and appropriate for the current single-caller design — just something to revisit if the call topology expands.

PR title includes standards-ref — Resolved

standards-sync.yml L184

title: "chore: sync standards configs (${{ inputs.standards-ref }})"

Now matches the commit message. PRs in busy repos are easily distinguished at a glance.


Remaining Items (all informational, none block activation)

Static branch name — L182: branch: chore/standards-sync is still static. The workflow-level concurrency group prevents concurrent runs, so there's no race condition in the current design. If two different standards-ref values are ever synced in sequence, the second run would update the same branch/PR opened by the first — which may or may not be the intended behavior. For the current single-caller use case this is fine.

zizmor not yet validated — noted in the PR description. The ${{ inputs.standards-ref }} expansions at L183 and L184 are inside with: blocks (not run: steps), so they are not shell injection vectors. The CI's zizmor lane is advisory-only, so this won't block merge.

peter-evans/create-pull-request SHA comment — L178: v8.1.1 comment not yet cross-checked (the author manually verified create-github-app-token's SHA/comment in the prior exchange; same check is worth applying here before first activation).


Summary

All medium and low findings from earlier rounds are resolved. The latest commit closes out the three informational items that were still open after 55e42d8: explicit plan-job permissions, a serializing concurrency group, and the ref in the PR title. The security fundamentals — SHA pins on all three actions, persist-credentials: false on both checkouts, env:-only secret expansion, scoped App token, credential guard before the token mint, path sanitization — remain intact. The workflow is clean and ready for merge ahead of activation.

@kyle-sexton

Copy link
Copy Markdown
Member Author

Both prior findings confirmed resolved. Addressed the informational items too in 188213f:

  • explicit permissions: contents: read on the plan job (symmetry + least-privilege);
  • workflow concurrency group (queue, no-cancel) so two runs can't race the per-target sync branch;
  • standards-ref added to the PR title (commit message already had it).

Left as-is by design: the *..* guard is intentionally conservative; the app-token SHA is verified to match v3.2.0; zizmor passes in CI.

@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: 188213fa5e

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

Comment thread .github/workflows/standards-sync.yml Resolved
@claude

claude Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

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


  • Gather context and read current workflow file
  • Assess Codex finding: plan/sync SHA divergence on movable refs
  • Check merge-of-main diff for any new issues
  • Post review findings

Follow-up Review: merge-to-main sync + Codex finding assessment

The latest commit (fd4d7f9) is a straight merge of main into the branch — no workflow changes. The file content is identical to 188213f, which was fully reviewed. This assessment covers the one new Codex finding raised since the last round.


Codex Finding: Plan/sync manifest divergence on movable standards-ref — Valid, Medium

standards-sync.yml L63–68 (plan checkout) vs. L133–139 (sync checkout)

Both the plan job and every sync matrix leg independently resolve inputs.standards-ref against the live standards repo. When standards-ref is the default main (a movable ref), a push to standards/main between the two jobs produces a TOCTOU split:

  • The matrix was built from the old manifest (old target list, old layouts).
  • The sync legs copy from the new manifest and source tree.

Concrete failure modes:

standards/main change between jobs Effect
New target added Matrix silently omits it — no sync this run.
Target removed Sync leg runs against a target no longer in the manifest; yq returns empty tools, nothing is copied, but a pointless PR may open.
File renamed/moved cp .standards-src/<old-src> fails with a non-zero exit.
Layout destination changed Files land in the destination from the new manifest, but the plan log records the old destination — audit trail is wrong.

The last case (wrong audit trail) is particularly harmful because the plan step's primary value is as a dry-run/audit record.

Fix: Capture the commit SHA the plan job actually checked out and propagate it as a job output for the sync legs to pin against.

  plan:
    outputs:
      matrix: ${{ steps.build.outputs.matrix }}
      standards-sha: ${{ steps.build.outputs.standards-sha }}   # ← add
    steps:
      - name: Check out standards
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          repository: melodic-software/standards
          ref: ${{ inputs.standards-ref }}
          persist-credentials: false

      - name: Build target matrix from manifest
        id: build
        env:
          MANIFEST: ${{ inputs.manifest }}
        run: |
          set -euo pipefail
          matrix="$(yq -o=json -I=0 '...' "$MANIFEST")"
          echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
          echo "standards-sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"   # ← add

Then in the sync job, replace ref: ${{ inputs.standards-ref }} with:

      - name: Check out standards (sources)
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          repository: melodic-software/standards
          ref: ${{ needs.plan.outputs.standards-sha }}    # ← pinned SHA
          path: .standards-src
          persist-credentials: false

This guarantees both jobs operate on the same commit, makes the audit log accurate, and is safe because the plan job already validated the manifest is well-formed before emitting the matrix.

Fix this →


Remaining Informational Items (unchanged)

peter-evans/create-pull-request SHA/comment — L178: 5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 — worth a manual cross-check that the SHA matches the v8.1.1 tag before first activation (the create-github-app-token SHA was verified in a prior round; this one has not been).

zizmor — still advisory-only per CI config; ${{ inputs.standards-ref }} expansions at L183–184 are in with: blocks, not run: steps, so no shell injection vector. No blocker.

Static branch name — chore/standards-sync at L182 is safe given the workflow-level concurrency group. If the SHA-pinning fix above is applied, the branch name could optionally include the SHA suffix for traceability (not required).


Summary

The merge commit introduces no new workflow content. The Codex TOCTOU finding is valid: when standards-ref = main (the default), the plan and sync jobs can observe different manifest snapshots if standards/main advances between them. The fix is low-cost (one git rev-parse HEAD output, one ref: change) and worth applying before activation — primarily because it preserves the accuracy of the plan step as an audit record. Everything else from prior rounds remains resolved.

kyle-sexton and others added 2 commits June 29, 2026 09:52
…(Codex P2)

With a movable standards-ref (e.g. main), the plan job built the matrix from
one checkout while each sync leg re-checked-out the ref again; if main advanced
between, the matrix/layout could be applied to a different tree. The plan job
now resolves and outputs the exact SHA, and the sync job checks out + records
that SHA, so the logged plan and the PR contents always match.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GbDWhcUtduCejgi7mcbMfy
…tware/ci-workflows into track-b-standards-sync
@claude

claude Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

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


  • Gather context
  • Read current workflow file at HEAD (dd0f854)
  • Verify Codex P2 fix: plan/sync SHA pinning
  • Check for any new issues in latest commits
  • Post updated review

Follow-up Review: fix(standards-sync): pin resolved standards SHA across plan and sync (Codex P2)

The latest commit (6646ff3) addresses the last open medium finding: the plan/sync TOCTOU on movable standards-ref values. Here is a full re-assessment at the current HEAD (dd0f854).


Fix Verified

Codex P2 — Plan/sync manifest divergence on movable standards-ref — Resolved

standards-sync.yml L71–76 (resolve step) · L60–62 (plan outputs) · L145 (sync checkout ref)

A dedicated Resolve standards commit step runs immediately after the plan job's checkout:

- name: Resolve standards commit
  id: resolve
  run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"

That SHA is exposed as plan.outputs.sha and consumed in two places in the sync job:

  • ref: ${{ needs.plan.outputs.sha }} on the standards checkout — every sync leg copies from the exact tree the plan was built against.
  • commit-message: "chore: sync standards configs (${{ needs.plan.outputs.sha }})" — the written history records which manifest snapshot was applied.

The approach is correct: the SHA is captured on the same runner, same working tree, immediately after checkout — no window for a race. The fix also addresses the audit-log accuracy concern raised in the prior round (the plan log and the sync files now always describe the same manifest snapshot).


New Observation — PR title lost the standards-ref suffix — Minor

standards-sync.yml L192

title: "chore: sync standards configs"

The (${{ inputs.standards-ref }}) suffix that was added in 188213f (confirmed resolved in the previous review round) is absent in the current file. This appears to have been dropped when the SHA-pinning commit was written. The ref is present in the PR body (L194–196), and the commit message now carries the resolved SHA — so the information isn't lost, just not surfaced in the PR list view. Worth restoring:

title: "chore: sync standards configs (${{ inputs.standards-ref }})"

Not a blocker, but it was a deliberate improvement from the prior round and the regression is likely accidental.

Fix this →


Remaining Informational Items (unchanged from prior rounds)

peter-evans/create-pull-request SHA/comment — L186: 5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 — worth a manual cross-check that the SHA and comment agree before first activation (the create-github-app-token SHA was verified in a prior round; this one has not been).

zizmor — still advisory-only; ${{ inputs.standards-ref }} and ${{ needs.plan.outputs.sha }} expansions at L191–196 are in with: / YAML scalar blocks, not run: steps, so no shell injection vector.

Static branch name — L190 chore/standards-sync is safe given the workflow-level concurrency group. With the SHA now in the commit message, successive runs on the same branch will produce commits that are clearly stamped with their source snapshot.


Summary

The Codex P2 TOCTOU finding is correctly resolved: a Resolve standards commit step pins the exact SHA immediately after the plan checkout, propagates it as a job output, and the sync legs checkout that SHA rather than re-resolving the movable ref. All prior medium and low findings remain resolved. The only new observation is a likely accidental regression in the PR title — the standards-ref suffix dropped in this commit — which is minor and easy to restore. With that addressed, the workflow is clean for merge ahead of activation.

@kyle-sexton

Copy link
Copy Markdown
Member Author

Both Codex (P2) threads on this PR are addressed in code:

Thread Fix
Don't require app secrets for dry runs 55e42d8 — secrets required: false + guard in sync job
Reuse the planned standards commit latest — plan resolves+outputs the SHA; sync checks out and records that SHA

All checks green. The repo's thread-resolution rule blocks merge until these are marked resolved; I'm not permitted to self-resolve reviewer threads.

@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: dd0f8540b8

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

Comment thread .github/workflows/standards-sync.yml Resolved
@kyle-sexton
kyle-sexton merged commit 69b9c60 into main Jun 29, 2026
1 check passed
@kyle-sexton
kyle-sexton deleted the track-b-standards-sync branch June 29, 2026 15:02
kyle-sexton added a commit that referenced this pull request Jul 7, 2026
## Summary

Track B activation groundwork for the config-distribution engine
(follows #50):

- **`targets` input** — comma-separated exact-match allowlist of
manifest repos (empty = all). This is the pilot / staged-rollout
control: the first real sync runs against a single target without
touching the manifest. Exact membership via yq set subtraction — no
substring matching (`github-iac` alone matches nothing and fails the
run). Spaces are stripped so `a, b` and `a,b` filter alike; a filter
matching no target is a hard error (typo protection).
- **Plan log iterates the built matrix** instead of the raw manifest, so
the logged plan is exactly the target set the sync job will run, filter
included.
- **App token narrowed** — `permission-contents: write` +
`permission-pull-requests: write` on the mint step, so the token carries
only what the sync needs even if the installation ever has wider grants.
Resolves the zizmor `github-app` finding (local zizmor v1.26.1 now clean
on this file).
- Header status note updated: the App secrets now exist on `standards`,
and the SHA-pinned caller lands next.

## Verification

Filter expression exercised locally with yq v4.53.3 against the live
`standards` manifest: empty filter → all 4 targets; exact repo → 1;
substring → 0 (errors); spaced pair → 2. actionlint + zizmor clean
locally.

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

https://claude.ai/code/session_01GbDWhcUtduCejgi7mcbMfy

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes cross-repo sync scope and GitHub App token permissions;
mistakes in the targets filter are guarded by hard errors, but a
misconfigured allowlist could still limit or block intended rollouts.
> 
> **Overview**
> Adds a **`targets`** `workflow_call` input so callers can run a
**staged rollout** against a comma-separated, exact-match allowlist of
manifest repos (empty = all). The plan job normalizes the filter, builds
the matrix with yq set subtraction (no substring matches), and **fails
the run** on junk filters or unknown repo names so typos cannot silently
skip one repo while others sync.
> 
> The **distribution plan log** now walks the **built matrix** instead
of every manifest target, so dry-run output matches what the sync job
will execute when filtered.
> 
> On real syncs, **`actions/create-github-app-token`** now sets
**`permission-contents: write`** and **`permission-pull-requests:
write`** so minted tokens only carry branch/PR permissions even if the
App installation is broader. Header comments are updated to reflect
activation gating via caller + secrets rather than a draft “not active”
note.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
ad6a93e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[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.

1 participant