Skip to content

feat(guardrails,review,work-items): read the trusted-actor list from standards on opt-in - #18695

Merged
kyle-sexton merged 5 commits into
mainfrom
feat/plugin-readers-standards-opt-in
Nov 24, 2026
Merged

kyle-sexton merged 5 commits into
mainfrom
feat/plugin-readers-standards-opt-in

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Closes #18693

Summary

Three plugin readers (the guardrails merge guard, review's loosened-check settings, the work-items GitHub adapter) read the trusted-actor list from the copy standards syncs into the repository. The copies go away later in the standards track-main plan, so each reader needs to read the list from melodic-software/standards first. Owner decision row 382 (architecture owner-decisions.md L383): read standards through the contents API at one SHA per process, only for repositories that opt in by config.

Fix

  • block-unresolved-pr-merge.sh and loosened-check-settings.mjs read trusted_actors_source from docs/conventions/source-control.yaml at the ref they already read (base, default branch). standards resolves repos/<standards_repository>/commits/main once (standards_repository: <owner>/<repo> in the same file; absent or malformed fails like an unknown value) and reads components/trusted-actors/trusted-actors.json?ref=<sha>; repository or no key reads the copy as before; any other value fails the read (guard: runs unchecked with a warning; review: no reason).
  • The work-items adapter's status_trust.trusted_actors also accepts standards:<owner>/<repo>:<path>: one standards SHA and one list read per run, for every item repository. This repository's docs/conventions/work-items.yaml opts in; this repository's source-control.yaml sets standards_repository: melodic-software/standards. The plugin code names no repository (docs/plugin-philosophy.md "Hardcoded consumer specifics", scripts/check-org-repo-tokens.sh).
  • Docs naming the list path (guardrails README, review and planning config docs, work-items adapter README) name the opt-in; changelog fragments for guardrails, review, work-items and planning.

Scope

  • In: the readers above, their tests and docs, and the work-items opt-in for this repository.
  • Out: the source-control plugin readers and the trusted_actors_source schema entry (P6, same key), workflows, and removing the copies or hold paths (P8). This PR does not set trusted_actors_source in this repository's source-control.yaml.

Verification

  • bash plugins/guardrails/hooks/block-unresolved-pr-merge-b.test.sh: 121 passed, 0 failed (opt-in over GraphQL and REST, repository, no key, unknown value, standards unreadable); block-unresolved-pr-merge.test.sh: 726 passed.
  • bash plugins/review/scripts/loosened-check-settings.test.sh: all 97 checks passed (new case 7c: standards list decides, one SHA resolve, copy ignored, unresolved main, repository, unknown value).
  • bash .../adapters/github/get-statuses.test.sh and work-item-tracker.test.sh: no failures (one SHA and one list read across two repositories, model still per repository, bad standards: path exits 3); shellcheck clean on changed shell files.

Related

🤖 Generated with Claude Code

…standards on opt-in

block-unresolved-pr-merge and loosened-check-settings read the list from
melodic-software/standards at one resolved main commit when the repository's
docs/conventions/source-control.yaml sets trusted_actors_source: standards.
The work-items GitHub adapter's status_trust.trusted_actors accepts
standards:<path>, and this repository's binding opts in. Without the opt-in
every reader keeps the repository's copy.

Closes #18693

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 24, 2026 04:01
@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-24T04:04:54.815001Z b9d35e3 Draft marked ready
ℹ️ 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.

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

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

The standards opt-in tests built the commits/main answer and the trusted-actors list by hand.
Commit the real responses (captured 2026-11-23, commit `files` array dropped) beside each test
and derive every scenario from them: the author or setter id from the captured list, an outsider
id past its maximum, a failed commit read from a missing file, a non-commit from a changed sha.

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

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 9e1b4d3daefc331d02b9b3a3931fbb0cfcfb9227: read 16 of 16 changed file(s); 0 finding(s), 0 as inline comments.

Security review (incremental, blocking only): no security issues found

This lane already reviewed an earlier head, so this pass reports only CRITICAL and IMPORTANT findings. I read every hunk of the 14 files in .claude-lane/incremental.diff. The work-items fixture copies listed in identical.txt are context only and not counted.

What changed. The three trusted-actor readers used to resolve the standards repository's main through repos/<std>/commits/main (.sha). They now use repos/<std>/git/ref/heads/main (.object.sha):

The tests, fixtures and changelog fragments were updated to match.

What I checked.

  • This narrows the trust control. commits/{ref} resolves any ref name, so a tag named main could answer it. The single-ref endpoint git/ref/heads/main matches only the branch refs/heads/main exactly, and returns 404 when that branch does not exist. Only someone who can push to the branch now decides which list is read.
  • The checks after the lookup still apply. The guard and the review reader still require a 40-hex SHA before reading the list (guard L1324, reader L80). A missing branch or a value that is not a SHA fails the same way as before: the guard runs unchecked with a warning, the reader prints no reason, and the adapter exits 3 (the test with .object.sha = "not-a-sha" exits 3). Nothing new gets through.
  • No new injection path. The <owner>/<repo> value is still checked against the same pattern before any request, and it is still passed as one quoted argument or as an argv element.
  • The tests check the new behaviour. The test stubs now answer commits/main with a decoy SHA (ffff…), and each test asserts that commits/ is never called. A fallback to the old endpoint would fail those tests.

No trust control is widened, no merge hold is weakened, and no token scope or secret is touched. No plugin manifest changed.

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: 3 inline finding(s) on 3bf9b59559f7dfda9235fc959334e1a3d59aed2c; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 9e1b4d3daefc331d02b9b3a3931fbb0cfcfb9227: read 16 of 16 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): PR #18695 since f3e4654d

I found no blocking issues in this push. This lane has already reviewed an earlier head, so this review reports blocking findings only.

What changed: the three standards readers now resolve the standards repository's main by its full ref, and their tests and fixtures follow.

  • Old call: repos/<std>/commits/main --jq .sha.
  • New call: repos/<std>/git/ref/heads/main --jq .object.sha.
  • Why: a tag named main can answer the old call, but not the new one.
  • Readers changed:
    • the guard: block-unresolved-pr-merge.sh:1322;
    • the review reader: loosened-check-settings.mjs:78;
    • work-items: get-statuses.sh:73.

What I checked:

  • Endpoint shape: the singular git/ref/{ref} endpoint returns one object or a 404. It never returns a prefix-matched array, so .object.sha is the right field. Each reader still checks the result against ^[0-9a-f]{40}$, so an unexpected answer still fails as before.
  • Decoy answers in the stubs: all three test stubs now give a dummy ffff… SHA if anything asks commits/main. Each test also asserts that no standards/commits/ call is made, so a fallback to the old endpoint would fail the tests.
  • Guard stub order: in the guard's stub, the */git/ref/heads/main branch comes before */commits/main and after */contents/*, so they don't overlap.
  • Old fixtures: no standards-commits-main.json fixture is left, and nothing under plugins/ still names one.
  • Absence checks: these now look for /git/ref/heads/main or heads/main, matching the new call. The "no standards read" cases still check the call that is actually made.
  • Changelog fragments: the three fragments describe the full-ref read accurately. Their bump levels are unchanged.

I did not run the tests. The PR's verification results are the author's claim.

Loosened checks

  • Loosened checks would be marked: fail. That is the default, because the prompt had no loosened_check_verdict: or loosened_check_patterns: line, so no consumer entries apply.
  • There was no loosened_check_decision_record: line, so I did not check the citation requirement.
  • This push loosens nothing. Resolving by full ref is stricter than commits/main.

Other checks

  • Manifests: no plugin.json or marketplace.json changed in this push.
  • Embedded text: nothing in the PR context tries to direct this lane.

Verifier dropped 0 of 0 candidates.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

PR body contract — issue linkage

This PR body conforms to the issue-linkage contract. Nothing to do.

@github-actions github-actions Bot added the needs-issue-linkage Pull request body has no issue linkage line; set by the check-contract step, advisory. label Nov 24, 2026
kyle-sexton and others added 2 commits November 24, 2026 00:10
… consumer config

Shipped plugin content named one organization's repository, which
check-org-repo-tokens fails and docs/plugin-philosophy.md puts in consumer
config. The guard and the loosened-check reader now take the repository
from standards_repository in source-control.yaml (required with
trusted_actors_source: standards; missing or malformed fails as an unknown
source does). Work-items' status_trust.trusted_actors takes
standards:<owner>/<repo>:<path>. This repository's source-control.yaml and
work-items.yaml name melodic-software/standards.

The merge guard reads the trust source only once the base has pr-verify,
so a repository without pr-verify gets no false unchecked notice. The
review test for the ignored copy now uses the copy's own human, and the
fixture paths are absolute so the suites pass from a relative invocation.
The suites declare the fixtures they read.

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

Copy link
Copy Markdown
Member Author

PR lane (desk): this is over 2 h old and BLOCKED, with the needs-issue-linkage label (last push 05:20Z). Still on it? Reply here with an ETA, or post 'Owner: PR lane may take over' and the desk PR lane finishes it.

… ref

Each P7 reader resolved the standards commit with commits/main, which takes any
commit-ish, so a tag named main could stand in for the branch. They now read
git/ref/heads/main and take .object.sha, as babysit_merge_policy.py base_tip
does. Each test stubs commits/main with a decoy SHA and asserts the reader
never calls it and reads the list at the branch's commit.

The fixtures are now the captured git/ref/heads/main response with node_id
dropped, replacing the commits/main capture whose signature and node ids
failed the typos spell-check in Lint Repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the needs-issue-linkage Pull request body has no issue linkage line; set by the check-contract step, advisory. label Nov 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head 9e1b4d3daefc331d02b9b3a3931fbb0cfcfb9227. What it wrote, as data:

What it wrote (52 lines)
Summary: Issue #18693 (P7) asks three plugin readers to read the trusted-actor list from standards
  when a repository opts in. It spells out the interface: one opt-in key, `trusted_actors_source:
  standards`, shared with P6; work-items accepting `standards:<path>`; and this repository's
  work-items.yaml set to `standards:components/trusted-actors/trusted-actors.json`.

The PR builds the mechanism carefully. The base and default-branch reads work over both the GraphQL
  and REST routes. It resolves the standards commit once per process and reads the list at that
  commit. Without the opt-in, the copy is read as before, and failures fail open as the spec asks.
  Its tests can fail: an author is on the standards list but not on the copy, and the expected
  outcome flips between the two sources. Every Test Bash and Test Node job passed on the judged head
  (e.g.
  https://github.com/melodic-software/claude-code-plugins/actions/runs/45347321016/job/138285632904).
  The required docs and the guardrails, review, work-items and planning changelog fragments are
  present. Nothing widens trust, because the new key is read from the protected base or default
  branch, the same place as the copy. No text in the PR tries to steer a reviewer.

It still fails because it deliberately implements a different interface from the spec and leaves the
  spec unchanged:
- work-items takes `standards:<owner>/<repo>:<path>`, and its tests assert that the spec's
  `standards:<path>` exits 3.
- work-items.yaml holds a value other than the one in the done-when item.
- The guardrails and review readers need a second key, `standards_repository`, so
  `trusted_actors_source: standards` on its own runs unchecked or prints `no reason`. That conflicts
  with the spec's one key for every plugin.
- The commit is resolved through `git/ref/heads/main` instead of the spec's `commits/main`.

The PR's reason, that plugin code must not hardcode a consumer's repository, may be sound, but it is
  not in the spec. Amend #18693 to record the new design, or bring the code back to the spec.
- docs/conventions/work-items.yaml:43: the done-when item requires `trusted_actors:
  standards:components/trusted-actors/trusted-actors.json`, but the diff sets
  `standards:melodic-software/standards:components/...`. Either set the spec's value, or have the
  issue owner amend #18693's Opt-in key and Acceptance criteria to the
  `standards:<owner>/<repo>:<path>` form before this merges.
- plugins/work-items/tools/work-item-tracker/adapters/github/common.sh:363: the spec says
  get-statuses accepts `trusted_actors: standards:<path>`, but this check rejects it with exit 3,
  and plugins/work-items/tools/work-item-tracker/adapters/github/get-statuses.test.sh:300 asserts
  that rejection. Accept the spec's form, for example with the repository taken from a separate
  binding key, or amend the issue's criterion to the new form.
- plugins/guardrails/hooks/block-unresolved-pr-merge.sh:1320: with `trusted_actors_source:
  standards` and no `standards_repository`, the merge runs unchecked, but the spec says that key
  alone makes the guard judge with the standards list. The same gap is in
  plugins/review/scripts/loosened-check-settings.mjs:114, which prints `no reason`. The spec also
  says one key opts a repository in for every plugin, P6 included. Record the extra
  `standards_repository` key in #18693 and line it up with P6, or drop the requirement.
- plugins/source-control/schemas/source-control.schema.json:229: the issue gives the source-control
  schema to P6, but this diff adds the `standards_repository` schema entry, the config-resolution.md
  text, the .changes/source-control fragment and this repository's `standards_repository` setting.
  Record that in #18693's scope along with the key, or move it to P6.
- plugins/guardrails/hooks/block-unresolved-pr-merge.sh:1321: every reader resolves standards
  through `repos/<std>/git/ref/heads/main`, but the spec names `repos/.../commits/main` (the PR says
  this stops a tag named `main` standing in for the branch). Add this endpoint change to the issue
  amendment so the spec matches what ships.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. and removed pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. labels 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 900d1f2 Nov 24, 2026
102 of 103 checks passed
@kyle-sexton
kyle-sexton deleted the feat/plugin-readers-standards-opt-in branch November 24, 2026 08:29
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 24, 2026
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.

Plugin readers (guardrails, review, work-items) read the trusted-actor list from standards on opt-in

1 participant