Skip to content

compliance-audit: detect stale required-check names in rulesets #92

@don-petry

Description

@don-petry

Problem

#89 added check_centralized_workflow_stubs which detects downstream repos whose Tier 1 workflow files are not v1 stubs. It does not detect downstream repos whose required-status-check rulesets still pin pre-centralization names like claude, AgentShield, etc.

Both petry-projects/markets and petry-projects/bmad-bgreat-suite had this drift today and the audit didn't catch it — it only surfaced when their PRs deadlocked at merge time.

Proposed check

Add check_centralized_check_names() to scripts/compliance-audit.sh:

For each repo, fetch the active required-status-checks rules (via gh api repos/<repo>/rules/branches/main and gh api repos/<repo>/branches/main/protection) and look for any stale name from this map:

declare -A STALE_CHECK_RENAMES=(
  ["claude"]="claude-code / claude"
  ["AgentShield"]="agent-shield / AgentShield"
  ["Detect ecosystems"]="dependency-audit / Detect ecosystems"
)

If the ruleset (or classic branch protection) contains a key from the LHS, emit a finding telling the agent which name to rename to. Should also flag when the list contains claude-code / claude itself (because that check is structurally broken — see workaround A below).

Related

The check should also flag when claude-code / claude appears as a required check, because that's incompatible with workflow-modifying PRs and should be removed per Workaround A documented in those issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions