Repository navigation
feat(source-control): read the trusted list from standards for opted-in repos - #18697
kyle-sexton wants to merge 5 commits into
Conversation
…in repos A repository whose docs/conventions/source-control.yaml sets `trusted_actors_source: standards` has the babysit merge gate, the pr-verify evidence reader, the skip-unchanged key and the ready hold check read the trusted-actors list and the Dependabot policy from melodic-software/standards at one commit per process, through the contents API. Unset or `repository` reads the .github/standards copies as before; any other value reads neither, so the lane adopts nothing and the hold check leaves the label holding. This repository opts in. Owner decision row 382 (architecture docs/owner-decisions.md), D2-F1 (a) with the opt-in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The standards readers named the publishing organization's standards repository in shipped code, which check-org-repo-tokens refuses and the plugin philosophy forbids for a runtime fetch. A new `standards_repository` key in docs/conventions/source-control.yaml names it; `trusted_actors_source: standards` without a valid owner/repo pair fails closed like an unknown value. This repository sets it to melodic-software/standards. Also lowers four stale allow-list counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
claude-security-review reviewed Security review: f5198b5 (blocking only)I read every hunk of all 21 files in Earlier finding. The tag-named-
Trust controls. The trusted-actor list and the Dependabot policy feed merge holds, so I checked whether the config-named
No CRITICAL or IMPORTANT security issues found. critical-findings: 0 |
|
claude-review reviewed Code review (blocking only): head
|
|
The pr-verify verifier failed head What it wrote (34 lines)This pull request leaves the merge queue, and ci-status holds it out while it carries |
|
PR lane (desk): this is over 2 h old with pr-verify-failed and 3 open review threads (last push 05:16Z). Still on it? Reply here with an ETA, or post 'Owner: PR lane may take over' and the desk PR lane finishes it. |
…sed in merge.md - Every standards commit read resolves `git/ref/heads/main` (merge policy through `base_tip`, the ready hold check, the merge.md snippet), so a tag named main cannot stand in for the branch. - The merge.md snippet parses `source-control.yaml` with the shared reader and holds on a failed read, a rejected or non-scalar value and an unknown source, as config-resolution.md says. - Tests: the full-ref read, and a failed standards read, a repository source and an unknown source for each reader (trusted list, Dependabot policy, verify evidence, skip key, ready hold check). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Still on it (hub session, cross-repo-dup-track-main). The three threads are resolved and the pr-verify findings are fixed at 0c91209; waiting on pr-verify's re-judge, then merging. ETA within the hour. |
Main landed #18732 (part 1 of this spec, split off as #18698), a parallel standards reader with the standards repository fixed in code. Keep this branch's reader, which names the repository in config, and drop main's trusted_actors_source, _standards_file and _list_text with their test class. The test cases main's class had that this branch lacked (a mixed-case value, an empty value, a block list and a quoted key) move into this branch's subtests; the quoted key exposed a fallback to the repository copy, now refused as a non-scalar value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The pr-unblock lane stopped
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 gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=18697 -f activity=resolve-conflicts |
| def test_a_failed_read_of_the_choice_or_of_standards_raises(self) -> None: | ||
| opted_in = "trusted_actors_source: standards\n" | ||
| trusted = self.standards_at(policy.STANDARDS_TRUSTED_ACTORS_PATH) | ||
| dependabot_policy = self.standards_at(policy.STANDARDS_DEPENDABOT_POLICY_PATH) | ||
| for endpoint, answer, readers in ( | ||
| (self.repo_at(TEAM_YAML), 502, ("list", "policy")), | ||
| (self.MAIN, 502, ("list", "policy")), | ||
| (self.MAIN, {"sha": "main"}, ("list", "policy")), | ||
| (trusted, 502, ("list",)), | ||
| (dependabot_policy, 502, ("policy",)), | ||
| ): | ||
| for reader in readers: | ||
| with self.subTest(endpoint=endpoint, answer=answer, reader=reader): | ||
| self.reset() | ||
| self.fake(opted_in) | ||
| self.gh.rest[endpoint] = answer | ||
| with self.assertRaises(policy.PolicyReadError): | ||
| if reader == "list": | ||
| policy.trusted_listing(REPO, SHA) | ||
| else: | ||
| policy._dependabot_policy("owner", "repo", SHA) | ||
| if reader == "list": | ||
| self.assertEqual(policy.trusted_actors(REPO, SHA), ((), ())) | ||
| self.assertEqual(self.list_reads()[:2], [0, 0]) |
There was a problem hiding this comment.
Fail a change that loosens a check (a test deleted). The merge of main deletes TrustedActorsSource.test_a_failed_read_of_the_choice_or_of_standards_raises. Its first row, (self.repo_at(TEAM_YAML), 502, ("list", "policy")), checked that a failed read of the team YAML raises for both trusted_listing and _dependabot_policy, and that neither copy is read.
The new tests never cover this case:
test_an_opted_in_repository_adopts_from_the_standards_list,test_the_standards_commit_is_main_by_its_full_ref,test_an_unset_or_repository_source_reads_the_copyandDependabotEligibility.test_an_opted_in_repository_reads_the_standards_policyalways give the team YAML a file or the default 404.- No test in the suite sets
contents/docs/conventions/source-control.yamlto a 5xx. test_babysit_verify_evidence.py,test_babysit_merge_skip.pyandcheck-ready-holds.test.shhave no failed team-YAML read either.
Before and after: the suite used to fail on a change that made team_yaml_at return None on any failed status. It now passes on that change. Such a change is one step away from the new probe=False 404 branch in babysit_merge_policy.py. With it, a 502 on the YAML of an opted-in repository would silently read the .github/standards/ copy. That breaks the closing issue's "reads neither" rule.
Reason given: none. The spec (#18696) does not name this deletion. The PR body has no ## Loosened checks section; its Summary says the merge kept the replaced class's "extra test cases", and this case is not among them.
Fix: restore the case. In the opt-in test (or a new subtest), set gh.rest[f"repos/{REPO}/contents/{TEAM_YAML}?ref=trunk"] = 502, then assert:
trusted_actorsreturns((), ());- the Dependabot eligibility check is not eligible;
- neither the copy nor the standards endpoints were called.
Or name the deletion and say why in the spec or a ## Loosened checks section.
claude-lane: claude-review
Closes #18696
Closes #18699
Closes #18700
Closes #18701
Closes #18702
Closes #18703
Summary
Reader move for the source-control plugin's scripts on user machines and in the babysit (pr-merge) lane, ahead of deleting the synced
.github/standards/copies. A repository whosedocs/conventions/source-control.yamlsetstrusted_actors_source: standardshas the trusted-actors list and the Dependabot policy read through the contents API from the repository itsstandards_repositorykey names (owner/repo; absent or malformed fails closed like an unknown source), at one commit per process. A repository without the key reads its copies exactly as today. This repository opts in withstandards_repository: melodic-software/standards; the plugin code names no repository (docs/plugin-philosophy.md "Hardcoded consumer specifics", enforced byscripts/check-org-repo-tokens.sh).Basis: owner decision row 382 in
docs/owner-decisions.md(architecture#220), option (a) "read melodic-software/standards through the contents API at a SHA resolved once per process, only for repositories that opt in by config"; owner, verbatim: "/session-flow:go-with-recommendations".Intake split #18696 into #18698 to #18703. #18732 landed part 1 (#18698) on main with the standards repository fixed in code; this PR's merge of main replaces that reader (
trusted_actors_source,_standards_file,_list_textand its test class) with the config-named one, keeping its extra test cases. Parts 2 to 6 are delivered here and close on merge.Fix
babysit_merge_policy.py:opts_in_to_standards(the key through the shared YAML reader; an unknown or non-scalar value, a quoted key included, raises),team_yaml_at,reads_standards(cached per repo and ref),standards_sha(the standards repository'smainby its full ref,git/ref/heads/main, once per process),standards_file(once per path per process), andsynced_file.trusted_listingand_dependabot_policyread throughsynced_file, so lane adoption, the issue-status setters and the Dependabot review-only check follow the opt-in. A failed read adopts nothing, as an unreadable list does today.babysit_verify_evidence.py_read_trusted_list: the same choice at the branch tip; a failed read isverify:unreadable.babysit_merge_skip.py: the skip key gains a digest of the standards list when the.baseclone's team YAML opts in (unreadotherwise); a failed read skips nothing.check-ready-holds.sh: reads the key from the default branch, and when it isstandards, the list at the commit standardsmainnames; an unreadable source leaves the label holding.trusted_actors_sourceandstandards_repositoryinsource-control.schema.jsonandreference/config-resolution.md;merge.mdandready-for-review.mdsay where the list is read;docs/conventions/source-control.yamlopts in.Hold
The babysit scripts are hold-floor paths, but this repository sets
merge.diff-check.path-holdsfalse, so the path hold applies only to Dependabot PRs (owner decision Q21).CI Statusshould not hold this PR for an approval.Verification
python3 -m unittestper file at the merge head:test_babysit_merge_policy(623),test_babysit_verify_evidence(486),test_babysit_merge_skip(24): all OK. Earlier heads: the spec-trust suites (own_agent,triage_verdict,split_child,drift,incident,recurring) OK.test_babysit_issue_status(1 failure) andtest_babysit_merge_unattended(11 failures) fail on origin/main code on this machine too; this branch adds no failure to either.check-ready-holds.test.sh: 89 pass.repositoryread the copy and never standards; an unknown, mixed-case, empty, list or quoted-key value and a failed standards read adopt nothing or hold; two repositories in one process share one standards commit and one list read; the skip key changes with the standards list.scripts/run-ruff.sh check,scripts/check-org-repo-tokens.sh,shellcheck,shfmt -i 2,scripts/sync-hold-floor.py --check,scripts/check-convention-yaml.shandscripts/check-changelog-fragments.sh --checkpass.Related
diff_risk.py,CARRY_REFUSES) are separate PRs.trusted_actors_source: standardsandstandards_repositorybefore its copies go.🤖 Generated with Claude Code