Skip to content

fix(pr-pipeline): fail closed when the standards trusted-actor list is unavailable - #18845

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/trusted-actors-fail-closed
Nov 24, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/trusted-actors-fail-closed

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #18841

Summary

Once standards stops syncing trusted-actors (standards#1127, F1), each repository's .github/standards/trusted-actors/trusted-actors.json becomes a frozen copy. A reader that falls back to it when the standards list is unavailable could keep a revoked actor trusted until F2 deletes the copy. This makes every lane reader fail closed instead: it errors, or trusts no one, and never reads the copy. Readers move before the sync stops (R5), so this lands before #1127.

Fix

  • .github/scripts/lib/trusted-actors.mjs trustedListPath(env, given): reads the standards checkout (STANDARDS_DIR), else given, a path the workflow passes under that checkout. With neither it throws. No caller defaults to the copy any more: trustedActorsPath(), SAME_TREE_LIST and the .base defaults are gone from clear-escalations, enable-auto-merge, release-eval-hold, address-feedback, dispatch, feedback-dispatch, fix-ci-context, gate-source and refine-event-dispatch.
  • resolve-config/read-status.mjs loadTrustedActors: reads STANDARDS_DIR, else TRUSTED_ACTORS_PATH, and never the BASE_PATH copy.
  • resolve-config/resolve-config.mjs standardsFiles: with no standards checkout, loads no trusted-actor list, so no field setter is trusted. The vocabulary keeps its base fallback because it grants no trust.
  • check-born-triaged, check-trusted-trigger and select-trusted-text: drop the trusted-actors-path input, whose default was the .base copy. Every caller already passes standards-path.
  • pr-require-checks.yml ci-status trusted_list: no $BASE_CONFIG copy fallback, so the hold and merge-group steps fail closed without the standards checkout. The ci-status/standards opt-out note now says so.
  • pr-verify/probe/replay.mjs, a local probe harness and not a gate, keeps its same-tree list when no STANDARDS_DIR is set.

Not changed, on purpose:

  • The source-control plugin's readers (babysit-prs, check-ready-holds.sh, the guardrails merge guard, the review loosened-check reader) read whichever list trusted_actors_source configures. They do not fall back on failure, and with standards set, as this repository sets it, a failed read already errors.

Verification

  • Full .github node suite (node --test --test-concurrency=4 '.github/**/*.test.mjs'): 10,555 pass, 0 fail.
  • New cases that fail on origin/main and pass here:
    • trusted-actors.test.mjs: trustedListPath throws with no STANDARDS_DIR and no given path. read-status never reads the BASE_PATH copy. gate-source trusts no one without standards even when its same-tree copy lists a person.
    • write-status.test.mjs: with no standards checkout, a status writer over the base's copy reads no list.
    • ci-hold-lifted-by, ci-hold-merge-group, ci-hold-cost-decision and ci-review-lanes: with STANDARDS_DIR empty and a valid copy in the hold config, each step now fails closed or keeps the hold. On origin/main each lifted or cleared the hold from the copy.
    • ci-lanes-pr-hold: the same no-standards case.
  • After moving the fixtures to a standards stub, every shell harness passes: ci-hold-lifted-by 82, ci-hold-merge-group 91, ci-hold-cost-decision 211, ci-review-lanes 351, ci-lanes-pr-hold 359. ci-rerun-ci-status, ci-hold-human-gated and write-runner-never-rules are unchanged and pass.
  • Fixtures: test files that build a base checkout now also pass STANDARDS_DIR (the shared standardsCheckout() fixture, which now also carries the vocabulary). clear-escalations resolves the list path inside trustedIds, so with no standards checkout it still logs "no stop clears on a trusted move" and does not fail the run.
  • Review venue: the code and security CI lanes are healthy (review-venue.sh), so no local AI review ran.
  • Left out: plugin, Python and other shell suites outside .github and scripts/ci-*, because this change touches none of their code.

Related

  • standards#1127, review thread PRRT_kwDOTBL9Bc67dTlI.
  • pr-pipeline-sandbox#437: the sandbox-owned readers. The synced lane files reach the sandbox through a full resync after this merges.
  • azure-iac#188: the token broker drops its caller-copy fallback.

🤖 Generated with Claude Code

…s unavailable

Once standards stops syncing trusted-actors (standards#1127, F1), each
repository's .github/standards/trusted-actors copy freezes, and a reader
that falls back to it could keep a revoked actor trusted. Every lane
reader now reads the standards checkout, or a path the workflow passes
under it, and fails closed without one:

- trustedListPath throws with neither; no caller defaults to the .base
  copy, the same-tree copy or trustedActorsPath any more.
- read-status loadTrustedActors no longer reads the BASE_PATH copy.
- resolve-config without a standards checkout loads no trusted-actor
  list (the vocabulary keeps its fallback: it is not trust-bearing).
- check-born-triaged, check-trusted-trigger and select-trusted-text drop
  the trusted-actors-path input, whose default was the .base copy.
- ci-status's trusted_list no longer reads the hold config's copy.

The hold harnesses and node tests read a standards stub, and each gains
a case that fails on the old fallback: no standards checkout beside a
valid copy now fails closed.

Closes #18841

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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-24T17:34:03.732108Z 5546ea0 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.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: incremental since 5546ea0

No security issues found. This was a blocking-only review, since this lane already reviewed an earlier head.

I read every hunk of all 3 files in the incremental diff.

  • .github/workflows/pr-require-checks.yml (agent-identity check, L6895–6906; trusted path, ci-status hold step). The change splits one combined if into two checks, and each still fails closed with exit 1:
    • Reading merge.agent-identity. The first check reads it from $BASE_CONFIG with yq -er and fails if the read fails.
    • Reading the trusted-actor list. The second check reads it through list=$(trusted_list) and runs the jq -er single-entry lookup on that list.
    • A failure is no longer hidden. Before, trusted_list was called inside "$(…)", so its exit status was lost. Now a failure to produce the list ends the step itself, which is a slight tightening.
    • The ID check is unchanged. The $want != $LANES_APP_ID comparison that follows still runs.
    • The new error text is safe. It now interpolates $identity, but that value comes from the base or default-branch config, which pull request authors can't control. So no untrusted text reaches the ::error:: workflow command.
    • The other edit is wording only. The second hunk (L6965) changes only an error message.
  • .github/actions/resolve-config/models.test.mjs. This adds a test only. It checks that with STANDARDS_DIR empty, a Work-status setter on the base's trusted-actor copy is not trusted: the result is applies: false with not-applicable. That matches the fail-closed narrowing reviewed at the earlier head.
  • scripts/ci-lanes-pr-hold.test.sh. The test harness's expected error strings now match the two split messages. No gate changes.

No trust control is widened, no token scope changes, and no new path lets untrusted text in. The changed hold step still fails closed in every branch I read.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 2 inline finding(s) on 5546ea05ef6909b6f6f7706fcadaf934f46eaadc; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread scripts/ci-lanes-pr-hold.test.sh Resolved
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: incremental since 5546ea05, blocking findings only

This lane already reviewed an earlier head, so it reported blocking findings only. I read every hunk of the 3 files in the incremental diff: models.test.mjs, pr-require-checks.yml and ci-lanes-pr-hold.test.sh. I also read the code those lines call. I used only Read and Grep and ran nothing.

Both earlier findings are fixed by this push:

  • resolve-config half of the Fail closed when the standards trusted-actor list is unavailable #18841 criterion now has a test. The new test is at models.test.mjs:1029-1035.
    • It runs main with STANDARDS_DIR: "". routeEnv still writes the trusted-actor copy, which lists LISTED, under BASE_PATH, and the test checks that.
    • A Work status of agent-ready set by LISTED must then resolve as untrusted (applies=false, not-applicable).
    • Whether resolve-issue applies depends only on its labels: [agent-ready] predicate (pr-pipeline.yaml:503).
    • So restoring the base-copy read at resolve-config.mjs:98 would trust the setter, set applies=true, and fail this test. The test can fail, so it is not vacuous.
  • The agent-identity error no longer blames the hold config for a standards-checkout failure. The check at pr-require-checks.yml:6897-6907 is now two checks:
    • An unreadable merge.agent-identity names the hold config.
    • A missing trusted_list (which returns 1 with no STANDARDS_DIR), or an id that does not resolve, names the standards checkout's trusted-actor list.
    • The merge-group verify-authors error at L6965 was reworded the same way.
    • The harness now checks each case against the full message (NO_IDENTITY / NO_IDENTITY_ID). $identity is set at ci-lanes-pr-hold.test.sh:102 before it is expanded, and expect matches the quoted text literally.
    • Each case lands on the error it asserts:
      • Empty or missing base config: identity error.
      • No actors file, or empty STUB_STANDARDS: list error.
      • Config with no identity: identity error.

Other notes:

  • The closing issue's criteria that this push touches are now met and covered by tests. "The .github node suite and ci-hold shell harnesses pass" is claimed by the author but unverified: I had no shell.
  • Spend: none. The change adds no runs, turns or schedules.
  • The PR context and the prior-findings file contained no embedded instructions.
  • Loosened checks: the prompt had no loosened_check_verdict: or loosened_check_patterns: line, so I used fail with no consumer entries. It had no loosened_check_decision_record: line either, so the citation requirement was not checked. Loosened checks would be marked: fail (default; no resolver); patterns: 0. This push loosens no check: it makes the failure messages more exact and adds a test.

Verifier dropped 0 of 0 candidates.

@melodic-automation-lanes melodic-automation-lanes Bot added the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 24, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

The pr-unblock lane stopped address-feedback on this pull request: the pull request changes .github/workflows/, which the lane token cannot push, so the lane does not address its review threads. The lane labels it needs-session for a session builder, who makes the change this lane cannot, and the run ends in a failing pr-unblock/address-feedback status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=18845 -f activity=address-feedback

…be read

ci-status's lanes-hold step blamed the hold config for any failure to read
merge.agent-identity's trusted-actor id, though the id now comes only from
the standards checkout. Split the check so each source gets its own error,
and fix the verify-authors message the same way. The hold harness asserts
both full messages.

Add a resolve-config test that, with no standards checkout, a Work status
set by a human the base's synced copy lists is not trusted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@melodic-automation-lanes melodic-automation-lanes Bot removed the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 24, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit c7cbf1b Nov 24, 2026
140 of 145 checks passed
@kyle-sexton
kyle-sexton deleted the fix/trusted-actors-fail-closed branch November 24, 2026 19:18
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 0, survived 1, timeout 0, no coverage 0, invalid 0, not run 6.
Covered-code score 0%; mutation score 0%.

File Killed Survived Timeout No coverage Invalid Not run
.github/actions/resolve-config/read-status.mjs 0 0 0 0 0 2
.github/actions/resolve-config/resolve-config.mjs 0 0 0 0 0 1
.github/scripts/lib/trusted-actors.mjs 0 0 0 0 0 2
.github/scripts/pr-merge/clear-escalations.mjs 0 0 0 0 0 1
.github/scripts/pr-verify/probe/replay.mjs 0 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
.github/scripts/pr-verify/probe/replay.mjs:765 UOI productive input-gap

The run's summary has the full report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fail closed when the standards trusted-actor list is unavailable

1 participant