Repository navigation
feat(ci_failure_triage): report Hypatia pinned at different commits - #1103
Conversation
Minted repos pin Hypatia in five places that must move together (scan HYPATIA_SHA, verdict grid --hypatia-ref x2, dogfood-gate's oracle checkout, hypatia-rule-order.json scanner.commit). A stale pin lacks the #1062 segfault fix (Apodeixis.jl#25), and the template itself splits the oracle (51539ab) from the rest (6693f9a). check_hypatia_pin_drift/1 reports every site when more than one commit is pinned; owner decides, never auto-fixed. `mix hypatia.ci_triage pins` runs it alongside the panic-attack check and accepts the policy JSON. Verified on rsr-template-repo d183b32: 5 sites reported, exit 3. 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 59 minutes. View limit details
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. |
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2bf98bb62c
ℹ️ 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".
…s and apostrophes Raised by Codex on #1103 (all three would hide or invent drift): - A checkout pin is read from the parsed workflow, not a line-counting regex, so a blank line or many sibling `with:` inputs cannot hide it. - Each occurrence is its own site, with its line: two jobs passing the same old `--hypatia-ref` are two findings, not one after Enum.uniq. - An apostrophe inside a plain value (`name: Don't ...`) no longer opens a quoted scalar in strip_yaml_comments, so a later `# --hypatia-ref` comment is stripped, not read as a live pin. This is the shared stripper, so the panic-attack check gains the same fix. 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: bbfc48e448
ℹ️ 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".
Raised by Codex on #1103 (second round), all from scanning raw text: - `'Don''t # x'`: a doubled quote ended the scalar early and the rest was stripped as a comment, hiding a live pin. - A folded `run: >` carries `--hypatia-ref` and its SHA on two lines. - `HYPATIA_SHA: *alias` resolves to the anchored commit. - A lowercase `hypatia_sha` does not set the scanner; the name is case-sensitive. Pins are now read from Hypatia.Kyaml's tree: HYPATIA_SHA map entries (aliases resolved, case-sensitive) and `--hypatia-ref` in any string scalar, with block-scalar lines from `segments`. Raw-text matching stays only as a fallback for YAML that does not parse. The shared comment stripper also keeps `''` inside a single-quoted scalar, so the panic-attack check no longer loses a flow pin after one. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
|
"Integration Status" is red only on superseded heads ( 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: aed404c2a8
ℹ️ 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".
Raised by Codex on #1103 (third round): - HYPATIA_SHA counts only inside an `env:` mapping, not as a `with:` action input or any other key of that name. - `--hypatia-ref` counts only inside a `run:` script, with shell comments removed: a step `name:`, a description, or a `# previously --hypatia-ref <sha>` line sets nothing. - The policy's scanner.repository matches case-insensitively, as the checkout path already did. - strip_yaml_comments: after `:` or `-` a quote opens a scalar only past YAML's separating space (`scheme:'v` is plain text); a flow `[`, `{` or `,` still opens one directly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
|
Scope note for reviewers. 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: 332bca5659
ℹ️ 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".
…e text fallback Raised by Codex on #1103 (fourth round): - `env: *shared` sets the environment from the anchored mapping; an alias under `env:` is now followed (only there, so the anchor is never counted twice), reported at the alias's line. - YAML outside the parser's subset falls back to text; the fallback now also reads a `repository: hyperpolymath/hypatia` checkout with a sibling `ref:` (same indentation, either order, blank lines allowed). Stated limits, replied on the threads: a flag that only appears inside quoted shell data (`echo "… --hypatia-ref …"`), and YAML tags before a quoted scalar in the text fallback. 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: 7a478eb3c4
ℹ️ 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".
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f63995ed2f
ℹ️ 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".
| end | ||
|
|
||
| defp run_pins(label, "run", value) do | ||
| case Hypatia.Kyaml.deref(value) do |
There was a problem hiding this comment.
Preserve each aliased run site
Fresh evidence beyond the fixed repeated-direct-run case is two steps that both use run: *cmd, where cmd anchors a command containing a stale --hypatia-ref: dereferencing here gives both matches the anchor scalar's location, making their site maps identical so the later Enum.uniq/1 collapses them and reports the anchor line instead of either active step. Preserve the alias location for each invocation so every effective pin site is reported.
Useful? React with 👍 / 👎.
| {"HYPATIA_SHA", @hypatia_env}, | ||
| {"HYPATIA_SHA", @hypatia_env_flow}, |
There was a problem hiding this comment.
Preserve semantic scope in the text fallback
Fresh evidence beyond the fixed parsed with: case is an otherwise valid workflow that triggers the fallback, such as one containing a multiline quoted scalar, plus with: {HYPATIA_SHA: <old-sha>} on an action. This fallback applies the environment regex to the entire document, so that unrelated action input is counted as a live scanner pin and causes false drift against a real newer pin; the fallback needs to retain the same env-mapping scope as the parsed path.
Useful? React with 👍 / 👎.
| is_binary(repo) and String.downcase(repo) == "hyperpolymath/hypatia", | ||
| ref = Hypatia.Workflow.input(step, "ref"), | ||
| is_binary(ref) and Regex.match?(~r/\A[0-9a-fA-F]{40}\z/, ref) do | ||
| %{file: label, key: "checkout ref", sha: String.downcase(ref), line: step.line} |
There was a problem hiding this comment.
Report the checkout ref's source line
For every ordinary multiline checkout step, step.line is the line containing - uses: actions/checkout@…, not the later ref: input that holds the reported SHA. Consequently the finding directs the owner to the wrong line; retrieve the ref input node's location rather than using the enclosing step location.
Useful? React with 👍 / 👎.
## What This PR follows up #1103 (`hypatia_pin_drift`) and #1105 (WF033). It fixes the 8 Codex findings that were still open when those PRs merged. **Pins (`lib/rules/ci_failure_triage.ex`)** - `--hypatia-ref` reaches its argument only across blanks or a backslash-newline. A bare line break in a literal script ends the command. - The SHA must end the argument, so `<sha>-backup` is not a pin. - Comments in `run:` scripts are now blanked by shell quoting rules, not YAML rules, so `--label "foo # bar" --hypatia-ref …` is still read. This uses the new `Hypatia.Workflow.shell_mask/2`, which keeps byte offsets. - Because offsets are kept, a match in a folded `run: >` maps to its own source line. - The text fallback (YAML the parser cannot read) counts a `repository:`/`ref:` pair only under the `with:` of a step that `uses: actions/checkout@…`. **WF033 (`lib/rules/workflow_audit.ex`)** - A bare success test in an `&&` list that ends the script fails the step. `bash -e -c 'false && echo ok'` returns 1. - `'success' == needs.x.result` counts as a guard, the same as the other order. - `exit` inside quotes or a shell comment is not a failure path. `exit "$code"` still is. ## Why Each of these produced a false drift (exit 3), a missed drift, a wrong line, or a false or missed WF033. ## Evidence - Tests: 8 new tests, one per finding, and each fails on `origin/main`. Stashing `lib` gives `206 tests, 8 failures`, and with the fix there are 0. Guard tests were also added: a `&&` list followed by another command, and `exit "$CODE"`. - `mix test test/rules test/soundness_test.exs` gives `954 tests, 0 failures`. - `mix format --check-formatted` passes on the changed files. - `gen-rules-praxis.sh --check`, `check-readme-claims.sh` and `tests/rules-praxis-test.sh` all pass. ## Not done - The `&&` rule looks only at a test that starts its line and is the script's last command. A test in the middle of a longer `&&` chain is not traced. - Shell masking does not model `$'…'`, heredocs or command substitution. --- _Generated by [Claude Code](https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT)_ --------- Co-authored-by: Claude <[email protected]>



Minted repos keep segfaulting (exit 139) in the RSR oracle and the Hypatia scan because they pin an old Hypatia (
be98f74), from before the #1062 crash fix. This was confirmed by MMT/Autoformalisation on Apodeixis.jl#25: syncing the pins from the template fixed it. The pin sits in five places that must move together, and the template itself splits them. This adds a static check, in the same shape as the existing panic-attackscanner_pin_drift.What
check_hypatia_pin_drift/1reads these Hypatia pin sites:HYPATIA_SHA:env (block or flow form)--hypatia-ref <sha>repository: hyperpolymath/hypatiawith a siblingref:, in either orderhypatia-rule-order.jsonscanner.commit(only whenscanner.repositoryishyperpolymath/hypatia)hypatia_pin_driftrule is report-only: routed to the owner, never auto-fixed. YAML comments are stripped, so a kept "old pin" comment is not a second pin.${{ … }}values are not pins.mix hypatia.ci_triage pinsruns it alongside the panic-attack check and accepts the policy JSON.Proof
On rsr-template-repo main
d183b32,mix hypatia.ci_triage pins .github/workflows/*.yml .machine_readable/policies/hypatia-rule-order.jsonexits 3 and reports all five sites: dogfood-gate's oracle at51539ab, and the scan, both verdict-grid flags and the policy at6693f9a. On main it reports nothing for the same files.Tests
7 new tests:
ref:beforerepository:is still readHYPATIA_SHAis not a pinAll fail on main.
mix test test/rules: 887 tests, 0 failures.gen-rules-praxis.sh --check(deed regenerated, 438 rules),check-readme-claims.shandrules-praxis-test.sh(22/22) are clean, and the self-scan reports no findings.Not in scope
check-workflow-edges.shcoveringdogfood-gate.yml) belongs to rsr-template-repo.Generated by Claude Code