Skip to content

rsr-template-repo Base ruleset repaired; 5-8 error-severity alerts remain (threshold semantics undetermined), and copilot_code_review may be a fifth unsatisfiable rule type #1008

Description

@hyperpolymath

rsr-template-repo Base ruleset repaired — and what still blocks, measured

Closes the #16 workstream. Ruleset 23218684 on hyperpolymath/rsr-template-repo
has been repaired per the owner's ruling. This issue records what was written,
what it fixed, what it did not fix, and one new finding.

What was written — two writes, guard satisfied rather than bypassed

The owner's earlier ruling was "apply the planner output", but the sanctioned
planner refuses on this ruleset:

scripts/plan-ruleset-constraint-repair.rb:31:in 'plan':
  Missing pull-request protection (ArgumentError)

Ruleset 23218684 had no pull_request rule, and the planner requires one. The
owner chose to satisfy that precondition legitimately rather than hand-craft a PUT
around it:

# Write Effect
1 Add a pull_request rule, using the parameters from the committed config/rulesets/base.json verbatim Planner precondition satisfied; live ruleset moves toward the committed template
2 Run the sanctioned planner (rc=0), then hand-trim code_scanning thresholds code_quality + code_coverage stripped; thresholds lowered

Nothing routed around the guard. The planner validated the real post-write-1
live state, re-fetched from the API — it was not handed a locally-constructed
fiction.

Before → after:

BEFORE  deletion, required_signatures, code_scanning,
        code_quality, code_coverage, copilot_code_review

AFTER   deletion, required_signatures, code_scanning,
        copilot_code_review, pull_request

code_scanning thresholds, all three tools retained per the standing ruling
("keep all three tools, trim thresholds"):

CodeQL    alerts_threshold: all → errors   security_alerts_threshold: all → high_or_higher
Hypatia   alerts_threshold: all → errors   security_alerts_threshold: all → high_or_higher
Scorecard alerts_threshold: all → errors   security_alerts_threshold: all → high_or_higher

⚠ Correction to a figure I published earlier

I previously said the trim would clear "10 of 17 alerts, leaving 1 error + 4 high".
Measured, that was wrong. The repo has 17 open alerts; by the severity field
that alerts_threshold actually keys on, they split 9 warning / 8 error. So
the trim cleared 9, and 8 remain blocking — not 5.

What still blocks, and why that is correct

All four open PRs are still BLOCKED. The causes are now fully measured, and they
are not the ruleset defect:

#193 and #192 — unsigned heads. Both head commits are
verified: false, reason: unsigned, and required_signatures is active. This
block is independent of content and would survive any change. Both PRs are also
fully superseded (every file byte-identical to main), so they are for closing,
not fixing.

#197 and #194 — real security findings. Both heads are verified: true/valid
and both have zero unresolved review threads, so required_signatures and
required_review_thread_resolution are satisfied. What remains is the
8 error-severity code-scanning alerts:

Alert Tool Security severity Rule
148 Scorecard high TokenPermissionsID
66 Scorecard high CodeReviewID
65 Scorecard high MaintainedID
6 Scorecard high BranchProtectionID
64 Scorecard medium SASTID
63 Scorecard medium FuzzingID
67 Scorecard low CIIBestPracticesID
147 Hypatia — hypatia/root_hygiene/missing

These are real findings and the gate is working. Per the standing instruction,
they are reported for triage — the trim was not widened further, and
code_scanning was not deleted to force green. A gate that blocks on genuine
findings is doing its job; the previous all threshold was the defect, because
9 warnings held the repo shut.

🆕 New finding — copilot_code_review may be a fifth unsatisfiable rule type

scripts/plan-ruleset-constraint-repair.rb:8 lists four retired types:

RETIRED = %w[update required_deployments code_quality code_coverage]

copilot_code_review is not among them, and it survived the repair. But
across the last 100 pull requests in this repository, Copilot has reviewed
zero of them:

coderabbitai              34
hyperpolymath             12
github-advanced-security   6
github-actions             2
Copilot                    0   ← never, in 100 PRs

I have not established whether copilot_code_review actually blocks merge or
merely auto-requests a review. That distinction decides whether this is a fifth
unsatisfiable gate of the code_quality / code_coverage class or harmless
noise, and it should be settled before the estate-wide pass — the census found
this rule type on other repos too.

Deliberately not guessing: code_scanning's 8 error alerts are already a
sufficient explanation for #197/#194 being blocked, so Copilot's contribution
is currently undetermined, not ruled out.

Reproduction

gh api repos/hyperpolymath/rsr-template-repo/rulesets/23218684 > live.json
ruby scripts/plan-ruleset-constraint-repair.rb live.json      # rc=0 after write 1
gh api "repos/hyperpolymath/rsr-template-repo/code-scanning/alerts?state=open&per_page=100" \
  --paginate --jq '.[]|select(.rule.severity=="error")|[.number,.tool.name,.rule.id]|@tsv'

Acceptance criteria

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ji1bq3TypfycfUPAR7hSxR

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions