Skip to content

feat(check-managed-files): verify standards-sync PR content against standards main - #708

Merged
kyle-sexton merged 3 commits into
mainfrom
feat/managed-files-sync-verify
Oct 7, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
feat/managed-files-sync-verify

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: part of the standards-sync automation plan agreed with the Automation Lanes session; tracked in its ledger.

Summary

check-managed-files skipped every PR authored by melodic-standards-sync[bot] with the
standards-sync label, which anyone who can push to the branch can satisfy. This replaces the skip
with verification, so a sync PR passes only when its content equals what standards main says now.
claude-code-plugins will require this check, which lets its code-owner rule drop the synced paths.

Fix

  • Sync mode when the author is melodic-standards-sync[bot], head ref chore/standards-sync, and
    same-repo head. The label grants nothing. The Dependabot skip is unchanged.
  • Every commit: bot author login and noreply email, committer web-flow, verified, reason valid
    (identities from a real sync commit, ci-workflows#701).
  • Content checked against standards main HEAD resolved at check time (no downgrade to an older
    SHA): changed paths must be within dest-paths; only A/M; apply in a scratch worktree of head
    must leave no diff, ignored files included.
  • Fails closed on every API, parse, or git error. Failures name the main SHA and each offending
    path or commit, and say to re-run the sync.
  • New action README: the check is a trust boundary only when the caller pins it by SHA from a
    code-owned workflow file and grants pull-requests: read.

Verification

  • node --test .github/scripts/*.test.cjs: 284/284; biome, shellcheck, markdownlint clean.
  • Two fresh-context adversarial verifier passes; the second found no bypass. First-pass fixes:
    committer identity, downgrade, ignored files.
  • Residual (low, not fixed): compare uses git status (clean filters) rather than blob IDs; the head
    tree is graded, not the merge result (merging only combines standards-authored versions).

Related

  • ci-workflows#707 (sync jobs run in a caller environment).
  • Ships in the next single ci-workflows release; then claude-code-plugins adds a required job and
    Automation Lanes unowns the synced paths.

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits October 7, 2026 01:48
…tandards@SHA

A PR opened by melodic-standards-sync[bot] from chore/standards-sync in
the same repository no longer skips the guard. It is verified instead:
every commit is the sync App's and signature-verified, the head subject
names a standards SHA reachable from standards main, every changed path
is an added or modified managed destination, and sync-manifest apply at
that SHA onto the PR head leaves no byte or mode difference. Any other
PR keeps the hand-edit check; the Dependabot skip is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d committer identity

GitHub's signature verification vouches for the committer, not the author.
Every sync PR commit must now carry the sync App's login and noreply author
email, a web-flow committer, and a verified signature with reason valid.

Sync mode now checks out standards main and verifies against the SHA it
resolves to, instead of a SHA named in the head subject, so a sync PR cannot
roll managed files back to older content. If main moves mid-sync the check
fails closed and the next sync run updates the PR. The content comparison
also reports files apply creates that the head gitignores.

A README states the caller contract: pin the action by SHA from a
code-owned workflow, and grant pull-requests: read. The hand-edit error no
longer suggests a standards-sync label.

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

chatgpt-codex-connector Bot commented Oct 7, 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-07T06:07:30.112008Z 9cbc93f 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 7, 2026 •

Copy link
Copy Markdown

Code review in progress

  • Gather context (PR diff, CLAUDE.md/REVIEW.md, changed files)
  • Review action.yml changes
  • Review verify-sync.sh
  • Review sync-commits.cjs
  • Review run.sh changes
  • Review tests (check-managed-files-sync.test.cjs, check-managed-files-skip.test.cjs)
  • Review README
  • Adversarial validation of candidate findings
  • Post inline comments / summary

View job run

@claude

claude Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Security review in progress

  • Gather context (diff, changed files, repo rules)
  • Understand request (CI security review via /review:security-review)
  • Review action.yml for trust-boundary / permission issues
  • Review verify-sync.sh for injection / git-worktree safety
  • Review sync-commits.cjs for identity-check bypasses
  • Review run.sh changes
  • Check instruction-surface deletions against protected classes
  • Adversarially validate candidate findings
  • Post final findings

View job run

@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: 9cbc93fa86

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

Sync mode lists the PR's commits through the API, which needs
pull-requests: read on the caller job.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton merged commit 02fc2df into main Oct 7, 2026
27 of 29 checks passed
@kyle-sexton
kyle-sexton deleted the feat/managed-files-sync-verify branch October 7, 2026 06:11
kyle-sexton added a commit to melodic-software/standards that referenced this pull request Oct 8, 2026
…iles callers (#738)

No related issue: urgent fix for every sync PR failing
pr-check-managed-files with a 403; tracked from dotfiles#1070.

## Summary

From ci-workflows v0.39.0, `check-managed-files` lists the pull
request's commits (to skip PRs whose every commit is Dependabot's) and
needs `pull-requests: read`, as its `action.yml` states. Both caller
templates granted only `contents: read`, so every sync PR fails with
`GET /repos/.../pulls/N/commits - 403 Resource not accessible by
integration` (dotfiles run 37637251894).

## Fix

- `components/managed-files-guard/managed-files-guard.yml` (hosted) and
`managed-files-guard-fleet.yml`: add `pull-requests: read` beside
`contents: read` in the workflow-level `permissions` block.
- `managed-files-guard.test.sh`: the whole-grant assertion now expects
`contents=read,pull-requests=read`.
- `README.md`: the failure-behavior and verification sections name both
permissions.

The diff touches only permission lines in the two YAML files, so it
merges cleanly with #735 (pin bump on the same files).

## Verification

- `bash components/managed-files-guard/managed-files-guard.test.sh`: 167
PASS, 0 FAIL (includes per-target materialization and actionlint on the
synced output).
- `actionlint` on both caller files: clean.
- `markdownlint-cli2` on the README and the pre-commit hooks (typos,
editorconfig, gitleaks, shellcheck): clean.
- No other `check-managed-files` caller in this repo: a repo-wide grep
finds only these two templates plus manifest/docs references.

## Related

- melodic-software/dotfiles#1070: the failing sync PR.
- melodic-software/ci-workflows#708: added the commits listing and the
same `pull-requests: read` grant to its own `pr-require-checks.yml`
caller.
- #735: concurrent pin bump on the same two files.

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

https://claude.ai/code/session_01T7GukBojtE99rLCPY7Cw3R

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.

1 participant