Repository navigation
fix(ci): close the partial/covering escape; a failed rev-parse fails the Agda receipt - #520
Conversation
…the Agda receipt The verif-idris gate (#509) checked only that each module declares `%default total`. A later `partial` or `covering` annotation, or a `%default partial|covering`, turns the totality check off again, and the package still builds. Idris 2 defaults to covering, under which `bad : Void; bad = bad` checks. The gate now rejects both forms. A new step in idris2-abi-ci.yml does the same for src/abi/. Both were tested against the current tree (pass) and against a module with a `covering` or `partial` line (error, exit 1). scripts/ci/check-agda.sh ran `git rev-parse HEAD` inside echo's arguments, where a failure escapes `set -e`. The receipt then named an empty commit and the script passed. The commit is now read on its own line. Requiring `%default total` in every src/abi/ module waits for #513, which moves the one module that lacks it out of src/abi/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
It belongs to the separate coprocessor-tags change and was swept in by mistake. Nothing on this branch calls it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
|
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. |
|
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 44 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd52c7b04d
ℹ️ 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".
| # A `partial` or `covering` annotation, or a later `%default partial` or | ||
| # `%default covering`, switches the check off again (Idris 2 defaults to | ||
| # covering, under which `bad : Void; bad = bad` checks). | ||
| if grep -nE '^[[:space:]]*(partial|covering)\b|^%default[[:space:]]+(partial|covering)\b' "$f"; then |
There was a problem hiding this comment.
Match indented
%default escape directives
When %default partial or %default covering is nested under an indented construct such as namespace N, the second regex alternative does not match because it requires %default at column zero. A module can therefore retain the required top-level %default total, add %default partial before a divergent definition, and still pass this gate; the identical regex in .github/workflows/idris2-abi-ci.yml has the same bypass. Allow leading whitespace before %default in both checks.
Useful? React with 👍 / 👎.
| # what follows and the package still builds. Runs on every event: cheap. | ||
| run: | | ||
| set -euo pipefail | ||
| hits=$({ grep -rnE '^[[:space:]]*(partial|covering)\b|^%default[[:space:]]+(partial|covering)\b' src/abi/ --include="*.idr" || true; }) |
There was a problem hiding this comment.
Ignore comments when scanning totality modifiers
Because this grep scans raw source, a valid Idris block comment containing a line whose prose begins with partial or covering is treated as a declaration and fails the job even though the compiler ignores it. The dogfood workflow's identical scan has the same false positive, so harmless documentation changes can block both checks; strip Idris comments before matching or use a syntax-aware check.
Useful? React with 👍 / 👎.



Summary
This follows up on #509 and #510, both already merged. An independent review of that batch raised two gaps, and this PR closes them.
Changes
dogfood-proofs-ci.yml(verif-idris gate from fix(proofs): NatLte declares %default total, and CI requires it of every module #509). The gate only checked that%default totalis present. A laterpartialorcoveringannotation, or a%default partial|covering, switches the totality check off again, and the package still builds. Idris 2 defaults to covering, and under coveringbad : Void; bad = badtype-checks. The gate now rejects both forms.idris2-abi-ci.yml. A new step applies the same ban tosrc/abi/. It runs on every event, because it is cheap.scripts/ci/check-agda.sh(from fix(ci): the Agda receipt names the commit that was actually checked #510).git rev-parse HEADran insideecho's arguments, where a failure escapesset -e. The receipt would then name an empty commit and the script would still pass. The commit is now read on its own line.Not in this PR: requiring
%default totalin everysrc/abi/module. That waits for #513, which moves the one module that lacks it (NeSyAssistTesting.idr) out ofsrc/abi/.RSR Quality Checklist
Required
unsafeblocks without// SAFETY:comments: not applicable..envfiles includedTesting
yqand run on the current tree, exit 0. On a scratch corpus whereB.idrhas acoveringline, it prints::error file=…B.idr::module declares a partial or covering definition or defaultand exits 1.src/abi/X.idrwith apartialline, it prints the error and exits 1.check-agda.sh:bash -npasses. The changed line was not exercised in this session: Agda is not installed here.Generated by Claude Code