fix(governance-paths): recognize trusted-bots.yml and main.json as governance-sensitive - #1881
Conversation
Refs #1875 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SRbLo6AZEM8C8PxnEHChdc
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1881 +/- ##
=======================================
Coverage 99.56% 99.56%
=======================================
Files 168 168
Lines 27975 27975
Branches 3390 3390
=======================================
Hits 27852 27852
Misses 123 123 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Escalation: per-task screening hard flag (check 4)
What was tried: the implementation was written and locally verified (pytest on the target test file: 14/14 passed; full repo suite: 8738/8738 passed; local-preflight: 47/47 gates passed; manual CLI check confirmed What the screening found: checks 2, 3, 5 (N/A -- no dependency manifest touched), 6, 7, 8 all cleared. Check 4 (hook/script changes) hard-flagged this diff, because both changed files live under Why this is escalated rather than fixed and committed: Current state: the diff is written and verified in the working tree, but not committed or pushed to this branch. Releasing the Requesting: confirmation to proceed with committing and pushing this diff as-is (task scope matches the Branch Plan/ACM in issue #1875 and Generated by Claude Code |
Refs #1875 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Step 8 adversarial review on PR #1881 found CODEOWNERS documents the commit_author_email_pattern/committer_email_pattern rules in main.json as the same risk class as trusted-bots.yml (issue #1858 second trust anchor); owner approved widening this PR scope to cover it. Refs #1875 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ssifier-trusted-bots-dknenw
Confirm near-miss extension/case variants of trusted-bots.yml and main.json stay no-match (documented exact-string scope, not a live bypass -- neither the real gate nor CODEOWNERS covers them either), and confirm main.json does not collide with the .github/ prefix used by workflow/hook-script classification. Refs #1875 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Merge two same-pattern tests into one, drop a redundant no-match assertion the positive assertion already implies, and shorten a comment that restated CODEOWNERS almost verbatim into a pointer. Refs #1875 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
Add
.github/trusted-bots.ymland.github/rulesets/main.jsonto_GOVERNANCE_FILENAMESingitapex_check_canonical_governance_paths.pyso both are correctly classified as governance-sensitive files.Facts
_GOVERNANCE_FILENAMES(as of originalorigin/main, lines 64-78) did not include.github/trusted-bots.yml.classify()only matchesgovernancevianormalized in _GOVERNANCE_FILENAMES, so.github/trusted-bots.ymldid not match any prefix rule either and fell through tono-match..github/trusted-bots.ymlwas added by PR feat(ci): exempt trusted bots from the independent-review-pending gate #1859 (issue feat(ci): exempt trusted bots from independent-review-pending's human-verdict requirement #1858): an identity-based bypass allowlist for the independent-review-pending merge gate.test_gitapex_check_canonical_governance_paths.py(same directory) had no case for trusted-bots.yml; 13 existing tests confirmed..github/CODEOWNERSdocuments.github/rulesets/main.json'scommit_author_email_pattern/committer_email_patternrules as "the same class of risk" astrusted-bots.yml(issue feat(ci): exempt trusted bots from independent-review-pending's human-verdict requirement #1858's second trust anchor), yet this classifier leftmain.jsonuncovered (no-match) too. Repository owner approved widening this PR to cover it as well.Assumptions
None (implementation follows issue #1875's own Acceptance Criteria Map, amended per the Step 8 finding above with owner approval -- see issue #1875's own "Scope amendment" section).
Risk / blast radius
Low. Adds two entries to the
_GOVERNANCE_FILENAMEStuple plus regression tests; no other classification list or branch (_WORKFLOW_PREFIXES/_HOOK_SCRIPT_PREFIXES/_DEPENDENCY_MANIFEST_FILENAMES, etc.) is touched. This classifier is a deterministic pre-filter only; both.github/trusted-bots.ymland.github/rulesets/main.jsonalready carry a CODEOWNERS entry requiring @tvna's review, so this gap was not itself an exploitable vulnerability before this fix -- only a completeness gap in one defense-in-depth layer.Rollback
Revert these commits to restore
_GOVERNANCE_FILENAMESto its prior state. No other protection (CODEOWNERS, etc.) is touched, so it remains in place after a revert.Verification
Acceptance Criteria Map (carried over from issue #1875, amended per its own "Scope amendment" section; a draft, independently re-check each row against this PR's own diff rather than trusting it as-is):
.github/trusted-bots.ymlasgovernance.github/trusted-bots.ymlas one entry in the_GOVERNANCE_FILENAMEStuple_GOVERNANCE_FILENAMESpytestpasses in full36563c94. Manual CLI check confirmsgovernance: .github/trusted-bots.yml.github/rulesets/main.jsonasgovernance(Scope amendment).github/rulesets/main.jsonas one entry in the_GOVERNANCE_FILENAMEStuple_GOVERNANCE_FILENAMESpytestpasses in full1ebd9207. Manual CLI check confirmsgovernance: .github/rulesets/main.json, and confirms no collision with.github/scripts/(hook-script) classificationChecklist
skills/*/SKILL.md, adocs/superpowers/specs/*.mddesign doc, a security-relevant skill, or a deterministic checker script (skills/*/scripts/*.py,evals/scripts/*.py,.github/scripts/*.py), a## Skill audit evidencesection discloses the required verdicts/waivers (see.github/scripts/gitapex_gate_skill_audit_disclosure.py)evals/*/split.md, that entry discloses a Transfer check line (see.github/scripts/gitapex_gate_transfer_check_disclosure.py)skills/*/SKILL.md's Stop-boundary bullets or named dispatch branches,evals/<skill>/tasks/*.yamlgained at least as many new fixtures (see.github/scripts/gitapex_gate_skill_branch_fixture_coverage.py)Skill audit evidence
checker-script-adversarial-review: RAN -- an independent adversarial review (Step 8,review-personadispatch) checked path-normalization edge cases, interaction with_HOOK_SCRIPT_PREFIXES, near-miss path evasion, and rationale accuracy against the real consuming gate and CODEOWNERS forskills/executing-a-branch-plan/scripts/gitapex_check_canonical_governance_paths.py. It found one real completeness gap (the.github/rulesets/main.jsonfinding described above), which this PR now also addresses. A separate behavior-preserving refactor/simplify pass (branch-plan-taskdispatch) found the added lines already consistent with the file's existing conventions and made no changes.defeat-test-disclosure: RAN -- added tests confirming an extension/case near-miss variant of either new entry is NOT swept in as a false governance match, per the review's own finding above, and confirming.github/rulesets/main.jsonis not accidentally absorbed by the.github/scripts/-prefixed hook-script or.github/workflows/-prefixed workflow branches.Independent review verdict
Outer layer: GitHub Copilot review was requested (
request_copilot_review) shortly after the inner-layer fan-out below started. The repository owner directed this session to proceed without awaiting Copilot's response, so this layer is disclosed as requested-but-not-awaited, not as a clean pass. No confirmation that Anthropic's "Claude Code Review" GitHub App is installed on this repository.Inner layer (
reviewing-an-artifact, low effort, against commit1ebd9207's diff -- trusted-bots.yml plus main.json additions and their tests):_GOVERNANCE_FILENAMES's prior contents or length; no caller behavior changes unexpectedly.638982f0-- merged two same-pattern tests into one, dropped a redundantnot inassertion the positive assertion already implied, shortened a comment that restated CODEOWNERS almost verbatim.638982f0-- a new comment block's line-wrap width (80-89 chars) deviated from this file's own ~75-78 char convention; resolved as part of the same merge that shortened the comment..github/rulesets/main.json's existingrequired_approving_review_count: 0setting is a pre-existing repository configuration choice this PR does not touch or introduce.638982f0): target test file 16/16 passed, full repo suite and local-preflight (47 gates) green; the merged/shortened diff was read again directly and confirmed to still satisfy every finding above with no new issue introduced.638982f0.Merge gate: independent review
This PR is also subject to the
independent-review-pendingrequiredstatus check (see
.github/workflows/independent-review-pending.yml/.github/scripts/gitapex_gate_independent_review_pending.py). It stayspending/failing until a
## Independent review verdictsection namingthis PR's current head commit is recorded in this body --
drafting-a-pr-to-merge's own Step 8 records it once its independentreview completes. There is nothing for you to do here now: do not
pre-fill this section yourself, and do not remove this note.
Related Issue
Closes #1875
Execution log
PlanApproved{run_id: 2026-09-06-governance-classifier-trusted-bots}StageDeviated{run_id: 2026-09-06-governance-classifier-trusted-bots, task_id: A, reason: "screening-a-low-trust-contribution check 4 (hook/script path modification) hard-flagged this task's own diff -- both changed files (gitapex_check_canonical_governance_paths.py, test_gitapex_check_canonical_governance_paths.py) live under skills/*/scripts/**, an unconditional-escalation category per that skill's own rules regardless of how benign the change reads. Content is purely additive and non-weakening (adds one _GOVERNANCE_FILENAMES entry + one regression test; strengthens rather than weakens the classifier), but executing-a-branch-plan Step 6/7 requires escalation on any screening flag with no retry.", action: escalate}TaskCompleted{run_id: 2026-09-06-governance-classifier-trusted-bots, task_id: A, commit_sha: 36563c947fec282d96cb51980c5c506b7d7cd381}branch-plan-task): reviewed both files' new lines against sibling conventions (comment style, test assertion pairing, placement, naming); found no genuine simplification; made no edits. Full suite + local-preflight re-confirmed green.review-persona): CONFIRMED one completeness-gap finding --.github/rulesets/main.jsonshares the same CODEOWNERS-documented risk class astrusted-bots.yml(issue feat(ci): exempt trusted bots from independent-review-pending's human-verdict requirement #1858's second trust anchor) but was left uncovered by this classifier. No other defect found (path-normalization,_HOOK_SCRIPT_PREFIXESinteraction, and rationale-accuracy checks all cleared)..github/rulesets/main.json(issue fix(governance-paths): recognize .github/trusted-bots.yml as governance-sensitive #1875's own "Scope amendment" section records this).TaskCompleted{run_id: 2026-09-06-governance-classifier-trusted-bots, task_id: A2, commit_sha: 1ebd9207}: added.github/rulesets/main.jsonto_GOVERNANCE_FILENAMESplus regression test. Commit-message provenance scan clean.origin/maindrift check (issue Local pre-push mirror gap, root-caused: session-start.sh never installs the pre-push shim (consolidates #1336/#1361/#1362) #1387) ran before pushing1ebd9207: branch was 4 commits behindorigin/main(unrelatedreview-persona.mdcall-site fix, PR fix(review-persona): add merge-retrospective Step 4b to Sanctioned call sites #1880); merged cleanly (no conflict); re-ran the target test file before pushing.skill-audit-disclosurecheck flagged this PR's own## Skill audit evidencesection for two gaps: thechecker-script-adversarial-reviewline's verdict token was not on its own recognized shape (a trailing period defeated the disclosure-line parser), and a requireddefeat-test-disclosureline was missing entirely. Fixed by adding two defeat tests (commit6bd861b0) and rewriting this section in the parser's exact recognized shape.TaskCompleted{run_id: 2026-09-06-governance-classifier-trusted-bots, task_id: A3, commit_sha: 6bd861b0}: added the two defeat tests above.origin/maindrift check re-run before pushing: 0 commits behind. Target test file, full repo suite, and local-preflight all pass.reviewing-an-artifact, low effort) ran against commit1ebd9207's diff via a 5-axis fan-out (review-personadispatch per axis). CONFIRMED 3 reuse/simplification findings and 1 convention finding (see Independent review verdict section above); 0 correctness/blast-radius/security findings.TaskCompleted{run_id: 2026-09-06-governance-classifier-trusted-bots, task_id: A4, commit_sha: 638982f0}: fixed all 4 CONFIRMED findings (merged two tests, dropped a redundant assertion, shortened two comments).origin/maindrift check re-run before pushing: 0 commits behind. Target test file (16/16), full repo suite, and local-preflight (47 gates) all pass. Outer-layer Copilot review requested; repository owner directed proceeding without awaiting its response.Note: the task's first commit attempt carried a
Claude-Sessiontrailer, whichgitapex_check_task_commit_provenance.pyhard-flagged (CONTRIBUTING.md's PR-body trailer exception does not extend to commit messages). Amended locally to drop that trailer before pushing; every pushed commit scans clean.The
ruleset-scanCI failure on an earlier head (b20c9bc) was confirmed by the repository owner to be an unrelated infrastructure issue (anastral-sh/setup-uvmanifest fetch failure), not caused by this PR's diff.