Repository navigation
CI failure triage rules: layered precedence, rerun budget, WF029, replay corpus - #1064
Conversation
…play corpus Hypatia's rules read repositories; nothing read what a failed run left behind, so infrastructure reds (rate limits, merge-ref races, cancelled runs, dead tokens, unreachable hosts, lock pins) were indistinguishable from code failures and invited "fixes" to code that was fine. Adds Hypatia.Rules.CiFailureTriage (lib/rules/ci_failure_triage.ex): - 19 rules with standards-A5 ids hypatia/ci_failure_triage/<name>, no wildcards, in four layers with fixed precedence: platform > config > toolchain > code. A platform failure outranks the test failure it caused. - One action per rule: none | rerun | fix | owner | report | upstream. - Loop limit: decide/2 turns a transient rule into an owner escalation (persistent: true) once its rerun budget (at most 2) is spent, so a rerun loop always ends. - forbidden_actions/0: admin merge, required-check or ruleset edits, licence/SPDX edits, loosening a canon gate, skipping tests. No rule takes any of them. - check_gate/2: required checks that never report, with case-drift near-match. check_scanner_pin_drift/1: panic-attack pinned at different commits (finds the 4 commits pinned across hypatia, gitbot-fleet and standards today). - Segfault goes to the owner, not to a rerun: the estate case is the deterministic OTP 28 miscompile (#1062). Adds WF029 to WorkflowAudit.audit/3: an if: always() job that needs upstream jobs and downloads their artifacts turns red on a cancelled run; the recipe is if: ${{ !cancelled() }}. One hit across 165 local estate workflows: cicd-squabbler static-analysis-gate.yml deposit-findings. Wires the rules to `mix hypatia.ci_triage log|gate|pins|rules` (offline, JSONL, exit 3 on a finding). Replay corpus test/fixtures/ci_failure_triage: 12 seed signatures reconstructed from reported text plus 8 real excerpts of hypatia's own failed runs (run id in the file name). The real logs first exposed five classes the rules missed (dead PAT 401, GitHub API 5xx, unresolvable lock pin, diff-range commit missing from checkout, rollup cascade); rules were added for each. Fixtures are .txt because .gitignore drops *.log. README and CLAUDE.md counts re-measured (157 lib files, 43 rule modules, 17 mix tasks); rule catalogue regenerated. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Summary
Pre-merge checks:
|
…segv owner-only Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZmVXyECkfzpj3uaW6p
…facts Cases from the hub's Doctrine 16 sweep (14 of 31 repos red on main): - actions.lock stale after a Dependabot bump (EpistemicTypes.jl, ResidualEvidenceTypes.jl, this-ssg). When the lock holds the same action for the same workflow at another ref, check_unpinned_actions used to report :unpinned_action and advise an inline SHA pin -- the fix this module itself warns drops the action from the lock. It now reports :actions_lock_stale (high, regenerate_actions_lock, rule_id hypatia/workflow_audit/actions_lock_stale). The ref is still never accepted; two workflow_audit tests now assert the new finding. - pages_not_enabled (config, owner): "Get Pages site failed" (xmlpull-zig, sholes). A repository setting, so escalate, never fix in code. - upstream_artifact_missing (code, upstream): a findings artifact missing after a scanner SIGSEGV (bactrian, quintessence). Triage the job that should have made it. - bench_regression also matches "2.285x against a 2.0x limit" (unified-api-adapter). - forbidden_actions gains :close_or_baseline_security_finding: Hypatia criticals and Sonar security ratings stay open for a person. Fixtures are reconstructed from the reported signatures. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
Codex Review Summary: ❌ FailedThis 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. |
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
💡 Codex Review
hypatia/lib/rules/workflow_audit.ex
Line 347 in 3ae92b1
When an actions.lock-managed workflow bumps an exempt reference such as a SLSA generator or an own-org reusable while the lock still contains its previous ref, this branch returns pin_exempt_accepted immediately and the later stale-lock check is unreachable. The exemption only explains why the workflow should retain a symbolic ref; it does not make a mismatched lock valid, so the audit reports an informational acceptance even though the job will fail during setup instead of requesting lock regeneration.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…medy Addresses the Codex review on #1064 and the baseline gate. Gate (blocking): the mix task used String.to_atom on --pr-state, which code_safety flags high (elixir_atom_from_user). Replaced with a fixed map. The five changed modules now self-scan clean. Signatures that were too broad: - runner_cancelled matched a bare "The operation was canceled.", which is also ordinary exception text (a .NET TaskCanceledException), and being a platform rule it outranked the real failure and exited 0. It now matches runner-authored ##[error] lines only; `conclusion: cancelled` stays authoritative. - external_host_unreachable matched every "unable to access", including 401/403, where the server answered and a credential is wrong. Those now go to token_invalid (owner), and the rule keeps resolution, connection and 5xx failures. - SIGSEGV / exit 139 no longer always means the toolchain. toolchain_segfault now needs a known runtime or compiler in the line; anything else is process_segfault (code layer, report to the author). - check_scanner_pin_drift lowercases each SHA, so one commit written in two cases is not drift. One remedy per defect: ActionsLock.stale_ref/3 is now shared, and WH004 (workflow_hardening) skips a ref the lock holds at another version. Previously workflow_audit said "regenerate the lock" while WH004 said "SHA-pin inline" for the same ref -- the fix that drops the action from the lock. The stale-lock branch also runs BEFORE the pin-exempt branch, since an exemption explains a symbolic ref but does not make a mismatched lock valid, and is :medium like the unpinned_action finding it replaces, so the estate gate's blocking set does not change. WF029 ignores a download-artifact step with `run-id`: that reads another run's artifact, which cancelling this run's needs cannot remove. Rerun budgets cut from 2 to 1, matching cicd-squabbler ADR 0004's one re-run per job, so the two systems cannot rerun the same job twice. rules/0 is now the whole inventory: the three non-log rules (required_check_never_reported, scanner_pin_drift, always_after_cancel) are included, and every rule and finding carries its ADR 0003 route (first-line / referral / owner-only / noise). mix hypatia.ci_triage gate takes --required and --reported once per name instead of a comma list, so a check name containing a comma (`test (ubuntu-latest, 3.12)`) survives. 900 tests pass (test/rules plus every test touching WorkflowAudit, WorkflowHardening, ActionsLock or the CLI). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
Mark draft #1064 detectors unassessed, downgrade overclaimed rows to partial/none, route branch protection owner-only, document the upstream route. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZmVXyECkfzpj3uaW6p
Red checks: none are from this diffFour checks are red here. All four are red on
What this PR did fix: The container-build drift and the cargo-audit advisory each need their own change, outside this PR's scope. Flagging rather than fixing them here, since both are estate-wide. Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43f6313d9f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…plit Agreed with Tsunami-breaker against cicd-squabbler ADR 0004 (d2075a5): - merge_ref_race is never a rerun. A merged or closed PR is a stale run (none; SQ-NOI-02). An open PR with no merge ref has a conflict or a deleted ref, so it is a referral (:report), not a rerun. - canon_lockstep is split by cause. An old inline copy of the lockstep job is SQ-CANON-01 (first-line, adopt-canon-lockstep.sh); a pin that must change is the owner's, since canon pins and A2ML are never edited automatically. The rule is now owner-routed and names both paths. 900 tests pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
…scalation Seven findings on 43f6313, all real: - decide/2 escalated `action` to :owner but left `route` "first-line", so a spent rerun budget could still be dispatched to the fixer tier. The route is recomputed from the final action. - `x-ratelimit-remaining: 0` alone is a successful request that used the last unit, not a failure; it could outrank a real test failure. Removed; rate limits need the error text. - A bare "The requested URL returned error: 5xx" also comes from `curl --fail` against the app under test. The 5xx case now only counts inside git's "fatal: unable to access ..." context. - toolchain_segfault listed bare `hypatia`, the application itself. Removed: `mix hypatia.rsr_score` is still caught by `mix`. - The scanner-pin input regex could cross into a sibling input and borrow its `default:`. Lines between the key and `default:` must now be indented deeper than the key. - WF029 exempted every non-empty `run-id`; `${{ github.run_id }}` is this run, so it still counts. - A standalone hardening scan (Rules.scan_workflow_hardening/2) silently lost a stale-lock ref, since only workflow_audit reports actions_lock_stale. WH004 now keeps the finding but with the regenerate-the-lock remedy (detail.kind :actions_lock_stale), never the inline-SHA advice. 906 tests pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5edc413e56
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ction
- api_server_error: a bare "HTTP 502: " now needs gh or api.github.com on
the line; an application's own 502 stays a code failure.
- merge_ref_race on a merged/closed PR: route becomes noise with action none.
- scanner pin drift: quoted keys ("PA_SHA":) are read as pins.
- WF029: findings carry action :fix; download-artifact matched case-insensitively.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b172681e99
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- api_rate_limit needs GitHub context; an app's own API test is code. - Could not resolve host: only a dotted (external) name; `backend` is a service under test. - review_quota_exhausted needs review context (R7 covers bot reviews only). - secret_or_variable_missing needs App-token context. - Scanner pins: quoted `"default":` in flow mappings; quote-aware comment stripping keeps a pin after `"use # carefully"`. - WF029: a job with literal continue-on-error: true is excluded; a run-id built from github.run_id is this run. - CLI: hardening's invalid_actions_lock is dropped only when workflow_audit reported it (an unreadable lock reaches workflow_audit as nil). Nine new tests fail on b172681 and pass here. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
bofj-kitt "Mirror to Git Forges" fails on every push to main: the *_MIRROR_ENABLED variables are on but the forge SSH key secrets were never set, so webfactory/ssh-agent reports "The ssh-private-key argument is empty". Config layer, owner action, no rerun. Replay fixture from run 43424749113 (job mirror-gitlab, head 0c85c83); the ssh-agent -k lines that follow are the secondary effect. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b9e28010f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for {label, content} <- contents, | ||
| content = strip_yaml_comments(content), | ||
| re <- [@scanner_pin, @scanner_input, @scanner_pin_flow, @scanner_input_flow], | ||
| match <- Regex.scan(re, content), | ||
| [key, sha] = Enum.take(match, -2) do |
There was a problem hiding this comment.
Parse pin sites structurally before reporting drift
When a workflow step body or another quoted/block scalar contains pin-like YAML text—for example a script that emits {PA_SHA: <old-sha>}—while the workflow's actual env or workflow_call.inputs pin uses a different SHA, scanning the entire raw document treats the inactive scalar text as a configured pin and emits owner-only drift findings. Comment stripping does not distinguish scalar contents from configuration nodes; inspect parsed env mappings and reusable-workflow input defaults instead of applying these regexes to all workflow text.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid. A pin-shaped string inside a run script is read as a pin. Moving pin-site discovery onto Kyaml nodes (env mappings and workflow_call input defaults) is a structural rewrite of check_scanner_pin_drift/1, so I'm leaving it for a follow-up and keeping this thread open for the owner. The impact is limited: drift findings go to the owner only (no autofix), so a false positive costs one dismissed finding.
Generated by Claude Code
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
Codex review on 7b9e280: - P1: a nonzero --exit-code with no known signature now yields unrecognized_failure (code layer, report), so `mix hypatia.ci_triage` exits 3 instead of 0 for a failed job. Exit 0 with no signature stays clean. - P2: in a combined scan, WH002's "absent" finding is dropped for a file where workflow_audit already reported missing_permissions; WH002's write-all forms and standalone hardening scans keep it. Both tests fail on 9d15b4d and pass here. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d2834ca1f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… key Codex review on 6d2834c (P2): - api_rate_limit context is now API-specific (api.github.com, gh api, x-github-request-id, "installation ID <n>"); a repo URL is not enough. - dependency_advisory needs audit context (vulnerabilities found, cargo audit / deny, Crate:); an advisory id in a test is not one. - ssh_key_secret_empty needs ssh-agent context. Three tests fail on 6d2834c and pass here. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
… the code (#1070) ## Open question first The registry has the ids that `gen-rule-catalogue.sh` already extracts (prefixed codes such as `WF013` and `SD001`), plus the ids the ruling names. It does **not** have the atom `type` names that most findings carry, for example `code_safety/js_exec_sync` and `workflow_audit/npermissions_typo`. SARIF ruleIds, `.hypatia-baseline.json` and `.hypatia-ignore` key on those names. For research_extensions, git_state and the alert modules the code is also the emitted type, so those ids resolve. For most other modules a deviation against an emitted id will not resolve in this registry yet. Should a second generator pass extract the emitted `type` names? That needs a heuristic over the `collect_findings` normalisers in `lib/hypatia/cli.ex`, so I did not add it. (The Codex review raised the same point.) ## What Owner ruling 2026-11-13: every existing hypatia rule id gets standards A5 form by prefix, `<module>/<ID>` to `hypatia/<module>/<ID>`. **No id that hypatia emits changes.** No rule code changes. - `hypatia_rules_praxis.deed` (new, generated): a `praxis-deed` with `(rule-domain :name "hypatia" :owner "hyperpolymath/hypatia")` and 190 `rule-def`s, in the form of A5 section 4. `:beholding-chora #u5"estate/chora"`, as in `hypatia_chora.deed` and the standards praxis deeds. SPDX `MPL-2.0`, as in `hypatia_chora.deed`. - `scripts/gen-rules-praxis.sh` (new): the generator, in the shape of `gen-rule-catalogue.sh`. Its sources: 1. The prefixed ids in `rule:`/`id:` literals in `lib/rules/*.ex` (the catalogue regex). 2. A moduledoc severity table `| ID | severity | text |` (this adds `pr_automerge` PA001-PA006 and `pin_integrity` PI001-PI005, which the catalogue regex misses). 3. Modules already in A5 form: `@domain "hypatia/<module>"` plus `name:` maps (`ci_failure_triage.ex`, #1064). 4. `lib/pattern_registry.ex` PA001-PA025. 5. `# ─── <ID>: TOMBSTONE` comments. 6. A fixed supersession table, the ruling below. The output has no date and its rows are sorted, so a second run gives the same bytes. `--check` exits 1 on a stale file. Where an id is emitted at several severities, the registry keeps the highest. A rule is `:class advisory` only when every emitting literal is advisory (`advisory: true` or `severity: :advisory`). - `tests/rules-praxis-test.sh` (new): the committed file matches a fresh run, two runs are byte-equal, no `:id` appears twice, no id has `*`, each id fits the A5 3.1 grammar in the `hypatia` domain with at most 200 characters, every `:supersedes`/`:superseded-by` resolves both ways, SD012 and HYP-DOG-002 are `retired`, and three code-stated facts are read back (BP001/SC001 registered, GS007 advisory, CSA006 medium). Each invariant also has a planted negative control. With `DEED_LINT` set, it runs `deed_lint.js`. - `.github/workflows/quality.yml`, job `validate-docs`: one step fetches `deed_lint.js` with plain git at standards `bfdb066` (no new `uses:`, so `actions.lock` is unchanged) and runs the test. It passes on this PR. ## Supersessions (ruling step 2) The old id stays `:status active` with `:superseded-by`, because it is not changed at its source. Its text starts with "Superseded by ... (same rule ...)", so no two rows share a text (A5 RL3/R08). The kept meaning is the oldest, by `git log -S` on `main`. | Old id | New id | Why | |---|---|---| | `hypatia/pr_automerge/PA001`-`PA006` | `.../denylisted_pin`, `major_version_jump`, `version_disagreement`, `unresolved_version_delta`, `manifest_without_lockfile`, `not_automatable` | `pattern_registry.ex` PA001-PA025 date from 2026-02-12; `pr_automerge.ex` from 2026-09-26. | | `hypatia/workflow_audit/ERR-WF-013` | `hypatia/workflow_audit/missing_timeout_minutes` | `WF013` (2026-04-03) is older than `ERR-WF-013` (2026-05-27). The new id is the `rule:` name the finding already carries. | | `hypatia/workflow_audit/WF-025` | `hypatia/workflow_audit/WF025` (existing) | One rule spelled two ways in one commit (35f33db). `WF025` gains `:supersedes`; it is not a new id. **Judgement call.** | | `hypatia/cicd_rules/duplicate_workflow` (waste pattern) | `hypatia/cicd_rules/waste_duplicate_workflow` | It ties with the WorkflowAudit meaning (both 12d7977). I kept the WorkflowAudit id, which findings emit. **Judgement call.** | | `hypatia/actions_lock/duplicate_workflow` (parse error) | `hypatia/actions_lock/duplicate_workflow_entry` | 2026-09-06, the newest meaning. | The module prefix alone already separates these strings. The supersessions remove the clash of the bare codes, as the ruling asks. Retired (ruling step 3): `hypatia/structural_drift/SD012` and `hypatia/dogfooding/HYP-DOG-002`. ## Defaulted fields (ruling step 4), for owner review Each row in the deed has a `;; defaulted:` comment that names its defaulted fields. In summary: - **`:excusable-at repo`**: all 190 rows (A5 G3 default for a canon gate rule). The code states no level. - **`:scope-form exact-paths`**: all 190 rows (A5 4.1 sample). The code states no scope form. - **`:class gate`**: 185 rows, every row except the 5 that the code marks advisory. Those 5 are `:class advisory`: `hypatia/git_state/GS007`, `hypatia/structural_drift/SD004`, `hypatia/workflow_audit/WF026`, `WF027`, `WF028`. - **`:text`** is a placeholder (`"<ID> in lib/rules/<module>.ex."`) on 4 rows, because the code gives no one-line text: `hypatia/root_hygiene/ERR-GIT-001`, `hypatia/rules/ERR-LIC-001`, `hypatia/workflow_audit/ERR-WF-013`, `hypatia/workflow_audit/WF-025`. All other texts come from a code header, a doc line, a `description:`, a moduledoc table or a `reason:`. Some are cut at a wrapped line (for example WH014, AP007, AP009). - **`:severity`** is taken from the severity atom next to the id (`warn` to `medium`, `low`/`info` to `minor`). Where the code states none, or the only severity is `advisory`, the field is **omitted, not defaulted** (A5 makes it 0..1): the 25 `pattern_registry` rows, AP001-AP015, CSA001, DA001, GS007, SD008 (computed at run time), the two tombstones and the `duplicate_workflow` rows. - `auto_fixable` is not used: A5 has no field that it maps to. ## Interaction with #1064 `ci_failure_triage.ex` is not on `main` yet. I ran the generator on a local merge of #1064's head (c8d8a62) before the 9c6bba6 fix. It found 205 rules (36 `hypatia/ci_failure_triage/<name>` ids as they are, plus `hypatia/workflow_audit/WF029`), and the test and `deed_lint.js` passed. Expect about 227 after 9c6bba6; I have not rerun it. Whichever PR lands second must run `scripts/gen-rules-praxis.sh` and commit the deed, or the new step fails as stale. I told the session that owns #1064. ## Testing - `DEED_LINT=<standards bfdb066>/1-formats/deed/tools/deed_lint.js bash tests/rules-praxis-test.sh`: 11 passed, 0 failed. `deed_lint.js`: `OK hypatia_rules_praxis.deed`. - CI: the `validate-docs` job, which runs the new step, is green. The failing jobs (Build Test Images, Integration Status, Rust Dependency Audit, Security Status) also fail on `main`; this PR changes no Rust or container code. - `bash scripts/check-readme-claims.sh` still passes. I added no `just` recipe, because the README quotes the recipe count. - I could not run shellcheck (not installed here), and this sandbox has no Elixir. No Elixir code changed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0136P7ZmHbN98VWzhw9EshkN --------- Co-authored-by: Claude <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0f3a8e8f9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Conflicts kept both sides: workflow_audit/2 runs WF029 (always_after_cancel) and WF030 (mirror_without_visibility_guard); Rules.scan_workflow maps both actions_lock_stale and actions_lock_context_incomplete. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
Codex review on b0f3a8e (P2): - WF029: a comparison in another conjunct no longer hides an exact !cancelled() guard; quoted literals are opaque, so a quoted '!cancelled()' is still not a guard; || and grouping stay uncertain. - Scanner pins: CRLF workflows are normalised before matching. - token_invalid: the bare "HTTP 401: Bad credentials" form must name api.github.com (gh's own error form). Three tests fail on b0f3a8e and pass here. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eea10ab842
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| patterns: [ | ||
| ~r/Artifact not found for name/, | ||
| ~r/Unable to download artifact\(s\)/, | ||
| ~r/No artifacts found|Unable to find any artifacts/ |
There was a problem hiding this comment.
Require download-action context for generic artifact text
When the program under test exits nonzero after emitting a domain message such as No artifacts found, without a recognized test-summary line, this generic alternative becomes the only match and classifies the failure as :upstream. The nonzero-exit fallback is skipped once any rule matches, so consumers are told to triage another job even though the application itself failed; gate these generic phrases on actions/download-artifact context or restrict them to action-specific wording.
Useful? React with 👍 / 👎.
| "no artifacts and turns red. Use `if: ${{ !cancelled() }}` instead.", | ||
| fix_recipe: :always_to_not_cancelled, |
There was a problem hiding this comment.
Preserve other conjuncts in the WF029 repair
When the affected job has an additional restriction, for example if: ${{ always() && github.event_name == 'push' }}, WF029 fires but tells the fixer to replace the entire condition with if: ${{ !cancelled() }}. Following that emitted repair removes the event restriction and can run the artifact job in contexts where it was intentionally disabled; the recipe should replace only the always() conjunct with !cancelled() and preserve the rest of the expression.
Useful? React with 👍 / 👎.
| defp add_exit_code([], %{exit_code: code}) when is_integer(code) and code != 0 do | ||
| rule = Enum.find(@rules, &(&1.name == "unrecognized_failure")) | ||
| [finding(rule, "exit code #{code}", 0)] | ||
| end |
There was a problem hiding this comment.
Read the standard runner exit line before returning clean
Fresh evidence after adding the nonzero-exit fallback is that it consults only the optional ctx.exit_code: when a log contains GitHub's standard Process completed with exit code 1 line plus an otherwise unrecognized failure such as a Python ValueError, running mix hypatia.ci_triage log JOB.log without --exit-code still produces no matches and exits 0. Parse that definitive runner line or require the option so the ordinary log-only invocation cannot report a failed job as clean.
Useful? React with 👍 / 👎.
…lane (#1066) ## What panic-attack was pinned at four different commits across the estate, so each lane reported different findings: | Site | Pin | |---|---| | hypatia `estate-rescan.yml` | `ac68bbae` → **`410a8f82`** (this PR) | | standards `hypatia-scan-reusable.yml`, `fork-governance.yml` | `410a8f82` (already) | | standards `deep-recon-reusable.yml` | `b5530834` (handed to its owner) | | gitbot-fleet `fleet-report-back-reusable.yml` | `b689a74d` (handed to its owner) | Owner ruling 2026-11-13: pin `410a8f82` everywhere. `ac68bbae..410a8f82` is two commits: a K9 validator fix (#253) and an actions-lock SLSA record (#251). Neither changes scanner rules, so findings from this lane should not move. The new `scanner_pin_drift` rule in #1064 found the drift and will keep reporting any that remains (`mix hypatia.ci_triage pins …`). ## Testing The YAML parses. Only the `PA_SHA` value and a comment changed. The next scheduled Estate Rescan is the real test. --- _Generated by [Claude Code](https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT)_ Co-authored-by: CLAUDE <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
#1064 added the `hypatia/ci_failure_triage/*` rules and WF029, but it did not regenerate the A5 rule registry. Since then, **Validate Documentation** has failed at "Rule registry (hypatia_rules_praxis.deed) matches the code and lints", on main and on every open PR. ## Change - `hypatia_rules_praxis.deed`: this is the unedited output of `scripts/gen-rules-praxis.sh`. It now has 234 rules: 42 new `hypatia/ci_failure_triage/*` rows and `hypatia/workflow_audit/WF029`. No existing row changes. ## Checks run - `scripts/gen-rules-praxis.sh --check` fails on main (stale) and passes on this branch. - `tests/rules-praxis-test.sh`, run with the standards `deed_lint.js` pinned in `quality.yml` (bfdb066): **15 passed, 0 failed**. The run includes "deed_lint.js accepts hypatia_rules_praxis.deed". --- _Generated by [Claude Code](https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT)_ Co-authored-by: Claude <[email protected]>
…1069) ## What Owner ruling (2026-11-13, via the hub): **WF021 wins over WH007**. WH007 advised `concurrency: … cancel-in-progress: true` on every `pull_request` workflow without a concurrency block, including publishers and mutators (releases, Pages deploys, mirrors, `git push`) where cancelling an in-flight run is unsafe. WF021 already carries the safety gate: a read-only `permissions:` block and no publish/deploy/mirror/push step. `wh007_missing_concurrency/1` now fires only where WF021 would. ## Evidence mathesis "Proof Policy Gate" (`cancel-in-progress: true`) cancelled main runs 43149283881 and 43151544804 on later merges, which left no completed run for PROOF-POLICY receipts. That's the class of harm the gate prevents. ## Tests New `test/rules/wh007_defers_wf021_test.exs` has 4 cases: a read-only PR check fires; a pushing workflow, a Pages deploy, and a workflow with no permissions block are each skipped. Locally, with workflow_hardening and workflow_audit, 180 tests pass with 0 failures. `mix format --check-formatted` is clean. ## Not changed WH004 already defers to `actions.lock` on main (`ActionsLock.pinned?/3`), and #1064 maps a stale lock ref to "regenerate the lock". --- _Generated by [Claude Code](https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT)_ Co-authored-by: CLAUDE <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
## Summary Follow-up to #1063. Docs only: `docs/reports/coverage-matrix/{matrix.json,README.adoc}`. No rule, CI or code changes. - Adds `sq_id` to the rows that overlap a cicd-squabbler FIX/ACT rule (ADR 0004): 4 full, 4 partial overlaps. - Three route conflicts resolved in the squabbler's favour (ADR 0003): `pull-request-target-checkout`, Scorecard Dangerous-Workflow and `pages-build-failure` are now `owner-only` (SQ-OWN-03, SQ-OWN-01). - Adds 18 squabbler-only rows keyed by SQ id (estate-specific, not public-platform rules). Hypatia detection for them is `unassessed`. - Adds a `referral` row for tag-keyed `actions.lock` records refused by the standards pin-contract gate (hypatia#1090, draft). - CodeRabbit and Codex rate-limit/credit rows are now route `noise` (ruling R7). - README documents the routes `noise` and `upstream` and the `rerun` fix status. Agreed with the Rule reconciliation thread (experiment owner) and sent to Tsunami-breaker before opening. The 4 detection gaps (concurrency, Dockerfile/shell pins, Renovate, SAST) are the experiment owner's first cases. ## Status: DRAFT - Detection statuses still come from reading code, not fixtures; rows citing #1064/#1065/#1090 stay `unassessed`. - Not for auto-merge; leave for review. - Known red checks on this PR (`cli/` container build, `quinn-udp` cargo-audit, and their rollups) are also red on `main` and are not caused by this diff. ## Test plan - [ ] Verify `partial` and `unassessed` rows with offline fixtures (experiment owner) - [ ] Re-key ids to the reconciliation thread's `<domain>/<name>` scheme as they land --- _Generated by [Claude Code](https://claude.ai/code/session_0136P7ZmVXyECkfzpj3uaW6p)_ --------- Co-authored-by: Claude <[email protected]>



What
Hypatia's rules read repositories. Nothing read what a failed run left behind, so infrastructure reds (rate limits, merge-ref races, cancelled runs, dead tokens, unreachable hosts, lock pins) looked the same as code failures.
This PR adds
Hypatia.Rules.CiFailureTriage:hypatia/ci_failure_triage/<name>(standards A5 form, no wildcards).none·rerun·fix·owner·report·upstream.decide/2escalates a transient rule to the owner (persistent: true) once its rerun budget is spent. Every budget is at most 2, so a rerun loop always ends.forbidden_actions/0, and a test checks that no rule takes one).check_gate/2finds required checks that never report, and names a near match when only the case differs.check_scanner_pin_drift/1finds panic-attack pinned at different commits. Today it finds four:ac68bbae(hypatia estate-rescan),b689a74d(fleet report-back),410a8f82(standards Hypatia lane and fork-governance) andb5530834(deep-recon).WorkflowAudit.audit/3catches anif: always()job that downloads its needs' artifacts. Such a job turns red on a cancelled run; the recipe isif: ${{ !cancelled() }}. It fired once across 165 local estate workflows, on cicd-squabblerstatic-analysis-gate.ymldeposit-findings.mix hypatia.ci_triage log|gate|pins|rules. It runs offline, prints JSONL and exits 3 when it finds something.Evidence
The replay corpus in
test/fixtures/ci_failure_triage/has 20 cases:The real logs first exposed five classes the rules missed: a dead PAT (401), GitHub API 5xx, an unresolvable lock pin, a diff-range commit missing from the checkout, and a rollup cascade. I added a rule for each.
Fixtures are
.txtbecause.gitignoredrops*.log.The segfault rule escalates instead of rerunning. The estate case is the deterministic OTP 28 miscompile (#1062).
Testing
I ran this locally on Elixir 1.17.3 / OTP 25, because this sandbox can't reach repo.hex.pm. The harness leaves out the web tier and the neural tier, and takes jason and gen_stage from git.
test/rulesplus every test touching WorkflowAudit or the CLI: 776 tests, 0 failures. The baseline before this change was 571/571 intest/rules.mix format --check-formattedis clean on the changed files.scripts/check-readme-claims.shpasses. README and CLAUDE.md counts were re-measured, anddocs/rules/catalogue.adocwas regenerated.The full
mix teston CI's OTP 27 lane has not been run by me. CI is the first full run.Generated by Claude Code