Skip to content

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

Done

Description

@kyle-sexton

Context

Standards track-main plan, phase D2, piece P7 (guardrails, review and work-items plugin readers). Three plugin scripts that run on user machines and in lanes read the trusted-actor list from the copy standards syncs into the repository they act on (.github/standards/trusted-actors/trusted-actors.json):

  • plugins/guardrails/hooks/block-unresolved-pr-merge.sh (_bupm_verify, the pr-verify scope read at the base),
  • plugins/review/scripts/loosened-check-settings.mjs (trustedHumans, git show of the default branch),
  • plugins/work-items/tools/work-item-tracker/adapters/github/get-statuses.sh (trust_context), configured by config.github.status_trust.trusted_actors (docs/conventions/work-items.yaml, validated in common.sh).

Once the copies are deleted (P8), each would read nothing. Basis: the Brief's acceptance Q2 (CI-only and gating synced files are read from standards main, gating files change expand-then-contract: readers move first, copies are deleted last).

Owner decision

Row 382 of architecture docs/owner-decisions.md (line 383), 2026-11-24T02:50Z: "Where plugin skill scripts read the trusted-actors list". Options were (a, recommended) read melodic-software/standards through the contents API at a SHA resolved once per process, only for repositories that opt in by config; (b) keep reading the repository copy; (c) ship a copy in the plugin. Owner, verbatim: "/session-flow:go-with-recommendations". Decision: (a), with the opt-in.

This change widens no trust: without the opt-in every reader behaves as today, and the list it reads with the opt-in is the source the copies are synced from. Every new setting is read from the same protected ref as the copy (base branch, default branch, the work-items binding).

Amendment: the standards repository is consumer config

Shipped plugin content may not name one organization's repository: docs/plugin-philosophy.md "Hardcoded consumer specifics" ("no runtime dependence on ... one organization's repository names"; such a value "belongs in the consumer's own config layers"), and check-org-repo-tokens fails a plugin file that does. So the repository row 382 names (melodic-software/standards) is set by each consumer, not written into the guardrails, review and work-items readers. The owner's decision (a) is unchanged: this repository's config names melodic-software/standards.

Opt-in key

  • Guardrails and review: trusted_actors_source: standards in docs/conventions/source-control.yaml at the ref the reader already uses (base branch, default branch), with standards_repository: <owner>/<repo> in the same file naming the repository to read. repository or no trusted_actors_source reads the copy; any other value, or standards without a valid standards_repository, fails the read. trusted_actors_source is the key the source-control piece (P6, merged) reads, so one key opts a repository in for every plugin; standards_repository is new here.
  • Source-control config surface: this PR adds the standards_repository entry to plugins/source-control/schemas/source-control.schema.json and reference/config-resolution.md, a source-control changelog fragment, and standards_repository: melodic-software/standards to this repository's docs/conventions/source-control.yaml. It adds no trusted_actors_source to this repository's source-control.yaml.
  • Work-items: its existing opt-in, config.github.status_trust.trusted_actors, also accepts standards:<owner>/<repo>:<path> (d2-scope P7 row: "a non-repo-relative source"; the repository is part of the value because the work-items binding has no source-control.yaml). This repository's docs/conventions/work-items.yaml moves to standards:melodic-software/standards:components/trusted-actors/trusted-actors.json (same list content).

Standards read, every reader: repos/<standards>/git/ref/heads/main -> .object.sha once per process (the full branch ref, so a tag named main cannot stand in for the branch, as babysit_merge_policy.py base_tip reads a branch), then contents/<path>?ref=<sha>. Guardrails and review read components/trusted-actors/trusted-actors.json; work-items reads the path in its value.

Acceptance criteria

  • block-unresolved-pr-merge.sh reads docs/conventions/source-control.yaml at the base beside pr-pipeline.yaml (GraphQL and REST routes); with trusted_actors_source: standards and a valid standards_repository it judges pr-verify's lane-or-owner scope with that repository's list at one resolved commit; with repository or no key it reads the copy and makes no standards call; any other value, standards without a valid standards_repository, or a failed standards read, runs the merge unchecked with a warning.
  • loosened-check-settings.mjs reads trusted_actors_source and standards_repository from the default branch's source-control.yaml; standards with a valid standards_repository reads that repository's list at one resolved commit and names <standards_repository>@<sha> in loosened_check_spec; repository or no key reads the copy as before; any other value, standards without a valid standards_repository, or a failed standards read, prints no reason.
  • get-statuses with trusted_actors: standards:<owner>/<repo>:<path> resolves that repository's main once per run, reads the list once at that commit for every item repository, and still reads the model from each item repository; a repo-relative path behaves as before; a standards: value without a valid <owner>/<repo>: part, or whose path has .. or a leading /, exits 3; standards main unread exits with the mapped gh code.
  • Every reader resolves the standards commit through git/ref/heads/main, never commits/main.
  • docs/conventions/work-items.yaml sets trusted_actors: standards:melodic-software/standards:components/trusted-actors/trusted-actors.json; docs/conventions/source-control.yaml sets standards_repository: melodic-software/standards.
  • Tests cover each case above: block-unresolved-pr-merge-b.test.sh, block-unresolved-pr-merge.test.sh, loosened-check-settings.test.sh, get-statuses.test.sh and work-item-tracker.test.sh pass.
  • The docs that state the list path name the opt-in: guardrails README, review reference/config.md, work-items GitHub adapter README, planning context/problem-framing.md and reference/config.md, source-control reference/config-resolution.md and schema (standards_repository); changelog fragments for guardrails, review, work-items, planning and source-control.

Out of scope

  • The source-control babysit readers (P6, merged), workflows (P4/P5), removing the copies or any hold path (P8). P6 reads trusted_actors_source but still names melodic-software/standards and resolves commits/main in babysit_merge_policy.py (STANDARDS_REPO, _standards_file); moving it to standards_repository and git/ref/heads/main is follow-up work for P6's owner.

Activity

  1. added
    session-owned
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    session-owned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions