Skip to content

fix(security): name the files that hold a publish-workflow matcher and account for every subject - #4563

Merged
devantler merged 4 commits into
mainfrom
claude/pin-guard-named-files-4558
Oct 6, 2026
Merged

devantler merged 4 commits into
mainfrom
claude/pin-guard-named-files-4558

Conversation

@devantler

Copy link
Copy Markdown
Contributor

🤖 Generated by the Agentic Engineer

Why

The check that keeps signing rules for the shared publish workflows pinned to a fixed revision could report success without having examined one of them. A rule written in an unusual but equivalent way was skipped, and only a minimum count stood in the way, which the other rules satisfied.

What

The check now names every place a rule is expected and fails when one is missing, extra or somewhere unexpected. Every other signing rule in the repository must be shown to belong to a different project, so a rule the check cannot place is refused instead of skipped.

Fixes #4558

⚠️ Merge order: land #4556 first; this builds on it and shows its changes until it merges.

devantler and others added 3 commits October 6, 2026 07:37
…he two-family matcher

A manifest matcher that accepts the canonical publisher beside the legacy one is
one subject holding one group. The pin guard refused it (two identities in one
subject) and the signing-revision report stopped finding its consumer, so no
canonical approval could pass CI.

The pin guard now reads that form with its own strict parse: the exact prefix,
the legacy family first, the canonical family second, each once. The legacy ref
keeps the existing allow-list; the canonical ref must be one concrete commit.
Every other arrangement is refused, as is a subject naming only the canonical
family. The report selects the two-family subject and keeps the legacy family
as its anchor.

No matcher changes: the canonical approvals record is still empty.

Part of #4502

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ations

Two ways the pin guard accepted a matcher wider than it reported, found by the
independent review of this change and present before it:

- An alternation over refs with no group around it was split on the bar and
  each half judged alone, although the second half is anchored to nothing.
- The subject pattern selects a line and matches anywhere on it, and only the
  text after the single @ was judged, so a value whose identity was not the
  shared workflow could be selected by a comment and pass on its ref.

A single-family subject must now be exactly the anchored legacy identity, a
ref and the closing anchor, and several refs must be grouped.

Part of #4502

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d account for every subject

The pin guard's floor was a count, so a matcher rewritten in a spelling its
patterns do not select went unjudged while the others made the number up.
The floor is now the list of files that hold a matcher, and every other
subject must be proved to name a different repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: b7a53cbe-6958-4bc4-a00a-59f8de21ef22
📥 Commits

Reviewing files that changed from the base of the PR and between c0dab00 and 8643433.

⛔ Files ignored due to path filters (1)
  • scripts/shared-publish-workflow-matchers.tsv is excluded by !**/*.tsv
📒 Files selected for processing (5)
  • .github/workflows/ci.yaml
  • scripts/guard-shared-publish-workflow-pin.sh
  • scripts/report-publish-workflow-signing-revisions.sh
  • scripts/tests/test-publish-workflow-signing-revisions.sh
  • scripts/tests/test-shared-publish-workflow-pin-guard.sh

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: 🧪 Validate Manifests
🔇 Additional comments (13)
scripts/report-publish-workflow-signing-revisions.sh (1)

41-51: LGTM!

scripts/tests/test-publish-workflow-signing-revisions.sh (1)

1973-2025: LGTM!

Also applies to: 2027-2050, 2052-2068, 2070-2083, 2085-2098, 2104-2104

scripts/guard-shared-publish-workflow-pin.sh (6)

55-130: LGTM!


222-388: LGTM!


390-467: LGTM!


469-564: LGTM!


721-779: LGTM!


680-700: 🩺 Stability & Availability

The proposed repository-wide false-positive concern is unsupported for the reviewed tree. The guard encounters no nested, double-quoted, block-scalar, or test-fixture subject keys of the cited kinds. Its current unselected keys are parseable GitHub workflow identity constraints for other repositories, which prove_other_identity accepts. A future unrelated YAML key could require a guard change, but that possibility does not establish a current defect.

.github/workflows/ci.yaml (1)

811-811: LGTM!

scripts/tests/test-shared-publish-workflow-pin-guard.sh (4)

45-86: LGTM!


183-326: LGTM!


381-381: LGTM!


532-748: LGTM!


📝 Walkthrough

Walkthrough

The guard now enforces per-file matcher counts and validates selected and unselected subject keys. It supports the specified legacy-then-canonical publisher subject form, with distinct ref rules for each family. The signing-revision report discovers combined subjects when the legacy publisher path is present. New tests cover matcher inventory, subject parsing, ref validation, and report discovery. The CI path filter now includes the matcher inventory file.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 86434

This change makes the publish-workflow signing check stricter. The check now reads its matchers from a named list of files and fails on any matcher it cannot account for. No problems were found that should block merging. If a future YAML file uses a subject: key for something other than a signing identity, the guard may reject it and need adjusting.


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 4 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive Issue #4558 requires an expected-file inventory, matcher validation for each listed file, failure for missing or unaccounted matchers, and tests that preserve real-repository success. The change summa… Provide reviewable evidence of the inventory entries and their correspondence to the repository, plus evidence that the real repository passes using that inventory.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: listing expected matcher files and accounting for every subject.
Description check ✅ Passed The description explains the matcher-check gap and the changes made to ensure every rule is examined or refused.
Out of Scope Changes check ✅ Passed The guard and its tests address matcher coverage for shared publish workflows. The CI path filter tracks the matcher inventory. The signing-revision report and its tests handle the same workflow subje…
Full details: Linked Issues check

Explanation

Issue #4558 requires an expected-file inventory, matcher validation for each listed file, failure for missing or unaccounted matchers, and tests that preserve real-repository success. The change summary reports the inventory checks and synthetic tests. However, scripts/shared-publish-workflow-matchers.tsv is excluded by !**/*.tsv, so its entries cannot be checked against the repository. The available evidence also does not establish that the real repository passes with that inventory.

Full details: Docstring Coverage

Explanation

Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 4 files. (1 skipped: 1 unsupported.)

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…d-files-4558

# Conflicts:
#	scripts/guard-shared-publish-workflow-pin.sh

@devantler devantler left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Generated by the Agentic Engineer

Self-review (fallback — CodeRabbit, Codex and Cursor Bugbot unavailable)

Reviewed commit: fadae75445d0ad15dc46c9a004ca88815ac94176

  • CodeRabbit: rate limited. Its last review in this account at 08:58Z states that none of the two included reviews per hour remain; the next is available at about 09:58Z and is owed to two other pull requests whose content changed.
  • Codex: unavailable, usage limit since 2026-10-06T04:40:17Z.
  • Cursor Bugbot: unavailable, usage limit since 2026-10-06T04:42:02Z.

This head is the previous head 8643433250a8bbe6e311fb4f5139cf6a25549c6a plus one merge of main. CodeRabbit reviewed that previous head in full and reported no findings, and nothing this pull request contributes has changed since:

  • The branch was stacked on the final head of #4556. #4556 was squash-merged at 09:35Z, so merging main conflicted in the pin check only, and the conflict was resolved to this branch's side, which already contained everything #4556 merged.
  • Compared line by line, the change this pull request makes against its old base and the change it makes against main now are identical.
  • Against main it touches exactly the four intended files: the pin check, its list of files that hold a matcher, its test and one CI filter line.
  • The pin check's suite passes on this head (101 assertions) and the check passes on the real tree (7 subjects).

Verdict: no P0/P1 findings

@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

Evaluation at fadae75445d0ad15dc46c9a004ca88815ac94176

Tried as an operator on this head, on the real tree:

  • The check passes untouched: 7 subjects, all pinned.
  • Removing one file from the list of files that must hold a matcher: refused, naming the file.
  • Rewriting one matcher in a spelling that means the same identity but that the text scan does not select (the gap The publish-workflow pin check never judges a matcher its text scan does not select #4558 describes): refused. Before this change the same edit left the check reporting that everything was pinned.

Both edits were reverted. CI is green at this head, the review round at this head is clean, and no review thread is open. Promoting and queueing.

@devantler
devantler marked this pull request as ready for review October 6, 2026 10:12
@devantler
devantler added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit 0f0ba71 Oct 6, 2026
33 checks passed
@devantler
devantler deleted the claude/pin-guard-named-files-4558 branch October 6, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

The publish-workflow pin check never judges a matcher its text scan does not select

1 participant