Repository navigation
Description
Context — the estate-wide "Actions-policy CI outage"
An onboarding stamp sets allowed_actions=selected + sha_pinning_required=true but never populates patterns_allowed (→ mode-1 startup_failure on 91 hyperpolymath repos). A second mode: sha_pinning_required=true with tag-pinned workflow files (mode-2).
Hypatia is the fleet detection owner: it already has estate-wide REST access (HYPATIA_SCAN_PAT) and half the detector — scripts/ci-health/detect.sh class B-ALLOWLIST already reads repos/<r>/actions/permissions (.allowed_actions) and .../selected-actions (.patterns_allowed), which is live mode-1 detection, and remediate.sh already PUTs the mode-1 fix keeping sha_pinning. Two gaps: mode-2 is not detected, and detection lives only in bash (bypasses the neurosymbolic baseline + dispatch).
Decision of record
Estate default = allowed_actions=all + sha_pinning_required=true. Where hypatia remediates, align to that target (co-set + GET-verify), consistent with gitbot-fleet.
Changes
-
scripts/ci-health/detect.sh— add classB-SHAPIN(mode-2). Read.sha_pinning_requiredfromactions/permissions; whentrue, scan.github/workflows/*.ymlforuses: owner/act@<non-40-hex>(reuse the tag-vs-SHA regex fromfixer/src/sha_pins.rs/lib/mix/tasks/hypatia.verify_action_shas.ex) → emit a HIGH finding "sha_pinning_required=true+ N tag-pinned uses → startup_failure". Today it reads.allowed_actions/.patterns_allowedonly, never.sha_pinning_required. -
NEW
lib/rules/actions_policy.ex— promote detection out of bash into the engine. RulesAP001(allowlist-blocks-reusables) +AP002(sha-pin-required-vs-tag-pins), modelled exactly onlib/rules/branch_protection.ex(same@github_api_base, "return [] cleanly withoutGITHUB_TOKEN" convention, severity→confidence map). Readrepos/{o}/{r}/actions/permissions+/selected-actions; correlateAP002with the existing file-levelWH004/check_unpinned_actionsso a repo whose live setting guarantees a startup_failure is escalated HIGH before it runs. Register inlib/rules/rules.exalias list + audit fan-out; addtest/rules/actions_policy_test.exs. Optionally addstandards/hypatia-rules/HYP-S008-actions-policy.a2mlsorule_loader.excarries routing/recipe. -
scripts/ci-health/remediate.sh— addB-SHAPINfile-side remediation. Open a signed PR converting@vN→ resolved 40-hex SHAs (reusescripts/fix-scripts/fix-pin-action-sha.sh), parallel to the existingD-BURNPR path. Keep theB-ALLOWLISTPUT. Route findings throughlib/fleet_dispatcher.ex(TriangleRouter → robot-repo-automaton/rhodibot/sustainabot via Kin Gate) instead of only upserting a tracking issue.
Draft artifact
# ci-health/detect.sh: add after B-ALLOWLIST
SP=$(gh api repos/$O/$R/actions/permissions --jq .sha_pinning_required)
if [ "$SP" = true ]; then
TAGS=$(grep -rhnE 'uses:\s+[^@]+@([^ ]{1,39}$|v[0-9]|main|master|stable)' .github/workflows/ || true)
if [ -n "$TAGS" ]; then
emit_finding HIGH B-SHAPIN "$R" "sha_pinning_required=true + tag/branch-pinned uses -> startup_failure" "$TAGS"
fi
fi# lib/rules/actions_policy.ex (modelled on branch_protection.ex)
defmodule Hypatia.Rules.ActionsPolicy do
@github_api_base "https://api.github.com"
def audit(owner, repo) do
with {:ok, perm} <- get("#{@github_api_base}/repos/#{owner}/#{repo}/actions/permissions"),
{:ok, sel} <- get(".../selected-actions") do
f1 = if perm["allowed_actions"] == "selected" and sel["patterns_allowed"] == [] and uses_external?(repo),
do: [finding("AP001", :high, "empty allowlist blocks external reusables")], else: []
f2 = if perm["sha_pinning_required"] and tag_pinned_uses(repo) != [],
do: [finding("AP002", :high, "sha_pinning_required vs tag-pinned uses", correlate: WH004)], else: []
f1 ++ f2
else _ -> [] end # returns [] cleanly without GITHUB_TOKEN, per convention
end
endAcceptance criteria
detect.shemitsB-SHAPINHIGH for asha_pinning=truerepo with a tag-pinneduses:; silent for a fully SHA-pinned repo.Hypatia.Rules.ActionsPolicy.audit/2returnsAP001for empty-selected-with-external,AP002for sha-pin-vs-tag,[]without a token; registered + covered byactions_policy_test.exs.AP002findings correlate to the file-levelWH004/check_unpinned_actionsfor the same repo.- A mode-2 finding flows through
fleet_dispatcherto a fixer (not just a tracking issue).
Open question
hypatia-scan-reusable.yml clones only hyperpolymath/hypatia, not standards/hypatia-rules, yet rule_loader.ex sources the *.a2ml catalogue (incl. HYP-S008) from standards — confirm the scanner actually loads it at runtime, else the a2ml rule is dormant.
Model tier
Opus for lib/rules/actions_policy.ex (neurosymbolic pipeline + correlation + baseline/dispatch integration); Sonnet for the detect.sh/remediate.sh bash classes.
Related
Consumes the source-of-truth in hyperpolymath/standards; findings dispatched to hyperpolymath/gitbot-fleet (robot-repo-automaton).
Activity
hyperpolymath commentedon Jul 11, 2026
Part of the estate-wide CI-resilience remediation set (Actions-policy
startup_failure, root-caused by the 2026-07-11 estate scan). One owner per responsibility:Decision of record: estate default =
allowed_actions=all+sha_pinning_required=true. The one-off sweep of the 91 broken hyperpolymath repos is intentionally deferred to gitbot-fleet#362 (self-healing behind the kill-switch), not a manual PUT.fix(ci): detect unreachable reusable workflow pins (#755)
hyperpolymath commentedon Sep 30, 2026
Consolidated into the roadmap tracker #886 during the 2026-09-30 issue sweep. The idea is kept there as a checklist item; reopen this issue when work starts.