Skip to content

proofs: the Agda gate suppresses no warning - #37

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/new-session-ywdrth-agda-werror
Nov 17, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
claude/new-session-ywdrth-agda-werror

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

scripts/check-agda.sh ran with -W error -W noUnsupportedIndexedMatch. On 2026-11-09 the order _≤_ and the injectivity lemmas were restated, so the core no longer raises UnsupportedIndexedMatch under --cubical-compatible. PROOF-STATUS.adoc already records this. The suppression therefore hid nothing in the current core, but it would let a new indexed match pass without a warning. This PR removes it, so -W error now covers every warning. The owner chose this on 2026-11-09: fix the lemmas at source, and make the gate fail on any warning.

Changes

  • scripts/check-agda.sh: removed -W noUnsupportedIndexedMatch and updated the comment above flags=(...).
  • tests/check_agda_warning_gate_test.sh and tests/warning/IndexedMatch.agda (new): a negative control. The fixture's one clause needs suc to be injective. The test reads the gate's flags from scripts/check-agda.sh, the same way proofs.yml does. It checks two things:
    • Control: without -W error, the fixture checks.
    • Case: with the gate's flags, Agda stops on the fixture and names the injectivity reason.
  • .github/workflows/proofs.yml: runs the new test next to the other gate tests.
  • docs/status/PROOF-STATUS.adoc and PROOF-NEEDS.adoc: describe the new invocation. Receipts already in verification/receipts/ keep the invocation they ran with, so they are unchanged.
  • CHANGELOG.adoc: new entry.

RSR Quality Checklist

Required

  • Tests pass (see Testing)
  • No banned language patterns
  • No banned functions
  • SPDX license headers present on all new files
  • No secrets, credentials, or .env files included

As Applicable

  • Documentation updated (PROOF-STATUS, PROOF-NEEDS)
  • CHANGELOG updated

Testing

Run locally on Agda 2.6.3, the version Ubuntu ships. CI asserts 2.6.4.3, so the CI run is the receipt.

  • With the suppression removed, bash scripts/check-agda.sh printed PASS: core proofs, unit tests and all 9 expected rejections.
  • tests/check_agda_warning_gate_test.sh passes against the new flags. Against the old flags (git stash of the script) it fails with the gate's flags accepted an indexed match, so the test does detect the suppression.
  • tests/scan_postulates_test.sh, tests/check_agda_find_failure_test.sh and tests/check_agda_trusted_base_test.sh pass.
  • scripts/check-root-shape.sh passes. scripts/gen-repo-map.sh leaves the repository map unchanged.

Agda 2.6.3 does not print the warning's name when the warning is an error. The test therefore matches the reason Agda prints, injectivity of the data constructor suc, rather than the name.


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Agda checks now fail on any warning, including UnsupportedIndexedMatch.
  • Tests
    • Added a warning-gate check that verifies Agda’s flags reject a fixture that triggers the indexed-match warning.
    • Added the check to the proofs workflow.
  • Documentation
    • Updated proof requirements and status notes to reflect the warning policy and its behavior.

scripts/check-agda.sh passed -W error -W noUnsupportedIndexedMatch. Since
2026-11-09 the order and the injectivity lemmas are stated so the core
raises no UnsupportedIndexedMatch under --cubical-compatible, so the
suppression hid nothing; it only let a new indexed match pass unseen.
Drop it, so -W error covers every warning (owner decision: restate at
source and fail on any warning).

tests/check_agda_warning_gate_test.sh reads the gate's flags as proofs.yml
does and checks tests/warning/IndexedMatch.agda, whose one clause needs
injectivity of suc. The fixture checks without -W error; the gate's flags
refuse it. Against the old flags the test fails. proofs.yml runs it.

PROOF-STATUS and PROOF-NEEDS describe the new invocation. Receipts already
recorded keep the invocation they ran with.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t

Copy link
Copy Markdown
Owner Author

CI on 8152ee2: every check passes except Code Quality, which isn't caused by this PR.

  • Agda receipt (Agda 2.6.4.3): Core proofs and expected rejections printed PASS: the gate's flags refuse an indexed match (exit 42): UnsupportedIndexedMatch and PASS: core proofs, unit tests and all 9 expected rejections. So with no warning suppressed, the core still raises no warning on the CI prover, and the new test passes there.
  • Code Quality: the workflow ends in startup_failure with no jobs (run 43926797200). It fails the same way on main (f0818f2, 2026-11-14) and on other branches. This PR doesn't touch .github/workflows/quality.yml. No fix exists yet. A startup failure leaves no logs, so finding the cause means reading the workflow file, in a separate change.

Generated by Claude Code

hyperpolymath pushed a commit that referenced this pull request Nov 16, 2026
This reverts commit 9b48533.

#37 makes the same gate change and adds a
regression test (tests/check_agda_warning_gate_test.sh) that fails
against the old flags. One change belongs in one PR, so this branch
keeps only F-5's lemma move and leaves the gate to #37.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LiQzWJdcPfRU6YMDGRG8Xi
Repository owner deleted a comment from coderabbitai Bot Nov 16, 2026
@hyperpolymath
hyperpolymath marked this pull request as ready for review November 16, 2026 19:46
@hyperpolymath
hyperpolymath enabled auto-merge (squash) November 16, 2026 19:46
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T19:46:03.622905Z
We couldn’t complete this review. Comment @codex review to try again.
8152ee2 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Repository owner deleted a comment from coderabbitai Bot Nov 16, 2026
hyperpolymath added a commit that referenced this pull request Nov 17, 2026
…e exemption (#41)

## Summary

The live `Branch-Floor` ruleset (25434034) requires a status check named
exactly `CI/gate`, and no workflow reports it. That blocks #36 and #37.
This PR adds the job. It does not touch #36, #37 or #96.

## Changes

- `.github/workflows/proofs.yml`: new job `name: CI/gate`, with `needs:
[proofs, lean-leg, rocq-leg, coverage-exemption]` and `if: always()`.
- It runs `scripts/ci-gate.sh`, which fails on `failure`, `cancelled`,
`skipped`, an empty `needs`, or malformed input.
  - Permissions are `contents: read`.
- It lives in `proofs.yml` because `needs:` only reaches jobs in the
same workflow, and those are the repo's real correctness legs. No
reusable workflow for this exists in `standards` (checked: no `CI/gate`
there, only `required-contexts.yml` and the coverage uploader for Rust),
so none was reused.
- `.machine_readable/coverage-exemption.toml` +
`scripts/check-coverage-exemption.sh` + job `coverage-exemption`: the
repo declares `measurable-runtime-code = false`, and CI checks that
claim. It fails if runtime code appears under `src/`, outside a declared
shrink-only pending list (`src/interface`, the Idris2/Zig scaffold that
#40 removes).
- `tests/workflows/ci_gate_test.sh`: positive control,
failure/cancelled/skipped/empty/malformed cases, a check that `needs:`
lists every other job in `proofs.yml`, and a planted-runtime-code case.
- `CHANGELOG.adoc`.

## Testing

Run locally:

| Check | Result |
|---|---|
| `tests/workflows/ci_gate_test.sh` | pass (10 cases) |
| `check-lock-sync`, `check-required-contexts`, `check-root-shape`,
`check-no-placeholders`, `check-action-pinning.js` | pass |

Not run locally: shellcheck and asciidoctor are not installed in this
environment. The real proof is the `CI/gate` check run on this PR (see
the comment below once it reports).

## Known limitations / owner-only items

1. **Pinning.** The new `uses:` is `actions/checkout@v7.0.1`, the same
ref `proofs.yml` already uses and `actions.lock` already lists. A raw
SHA would desync `actions.lock`, and `gh actions-lock` is not available
here, so I did not hand-edit the lock. Re-pinning to a SHA is a
lock-tool run.
2. **Scope of the gate.** It aggregates the proof legs and the exemption
check. `quality.yml`, `estate-rules.yml` and the other PR workflows are
not aggregated, because `needs:` cannot cross workflow files. Say if you
want those folded in (reusable-workflow calls, or a check-run poller).
3. **The 80% `code_coverage` rule** is in the live ruleset, not in any
file here. An Agda repo uploads no Cobertura report, so the rule cannot
pass, and uploading a fabricated report would be a lie. The honest fix
is to remove the rule:
`gh api -X PUT repos/hyperpolymath/resource-algebra/rulesets/25434034`
with the current body minus `{"type":"code_coverage",…}`. The canonical
`standards` `branch-floor.json` has only `deletion` and
`non_fast_forward`, and the estate already retired `code_coverage` from
`Base` on 2026-10-02. Until then this PR's declared exemption is
evidence for the change, not a bypass.
4. The live ruleset has drifted from canon (it also carries linear
history, signatures, a PR rule and `CI/gate`), so
`.github/rulesets/branch-floor.json` no longer describes it.

---

---
_Generated by [Claude
Code](https://claude.ai/code/session_01J4QvDf74BGYFzth9JRdGby)_

Co-authored-by: Claude <noreply@anthropic.com>
CHANGELOG: keep both entries, newest first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y6FD63UrriRBHqmhhEca9t
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The Agda check no longer suppresses UnsupportedIndexedMatch. A fixture test checks the warning gate, and the proofs workflow runs that test. Proof-status documents and the changelog record the updated warning policy and test.

Changes: Agda warning gate

Layer / File(s) Summary
Gate behavior and fixture test
scripts/check-agda.sh, tests/warning/IndexedMatch.agda, tests/check_agda_warning_gate_test.sh
The Agda flags no longer suppress UnsupportedIndexedMatch. The fixture test verifies that the gate rejects the indexed match and that the fixture succeeds when the warning flags are removed.
Workflow and proof-status records
.github/workflows/proofs.yml, docs/status/PROOF-NEEDS.adoc, docs/status/PROOF-STATUS.adoc, CHANGELOG.adoc
The proofs workflow runs the warning-gate test. The proof-status documents and changelog describe the updated warning policy and test. The changelog notes that existing receipts retain their recorded invocation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

Suggested reviewers: claude

Merge Risk: Minimal · up to f2307

The Agda gate now treats every warning as a failure, and a new test confirms that an indexed match is rejected. No merge-blocking risk was found. The unrelated Code Quality workflow failure should be handled separately.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit db7ce18 into main Nov 17, 2026
51 of 54 checks passed
@hyperpolymath
hyperpolymath deleted the claude/new-session-ywdrth-agda-werror branch November 17, 2026 03:53
hyperpolymath pushed a commit that referenced this pull request Nov 17, 2026
CHANGELOG.adoc keeps both sides: the F-5 entry above main's CI/gate and
Agda-gate entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LiQzWJdcPfRU6YMDGRG8Xi
hyperpolymath added a commit that referenced this pull request Nov 17, 2026
## Why

F-5's ledger row cites `maps-disagree-at-positive` as the proof that the
two strict morphisms Loss → MaxPlus are distinct. That lemma lived in
`tests/unit/MorphismTest.agda`, outside the graded import cone
(`src/ResourceAlgebra/All.agda`).

The Agda receipt's inputs manifest covers only `src/`. So a change to
that lemma would not have invalidated F-5's receipt. I found this while
pinning this repository's claims in the mathesis registry, and it was
the only ledger-cited Agda name outside `src/`.

## What

- `maps-disagree-at-positive` moves, unchanged, into
`src/ResourceAlgebra/Morphism.agda`. The Rocq and Lean legs already
prove it under the same name.
- `docs/status/PROOF-STATUS.adoc` records the gap in the receipt at
`f211fc1`. The run did check the lemma, because the gate checks the unit
tests, but the manifest did not cover it. The receipt itself is left as
it is. Because this PR changes `src/`, the next receipt is due after
merge, and that receipt covers the lemma.
- `CHANGELOG.adoc` entry.

## Scope change

This PR first also removed `-W noUnsupportedIndexedMatch` from the Agda
gate. #37 makes the same change and adds a
regression test that fails against the old flags. So the last commit
reverts the gate change here and leaves it to #37. That way, one change
sits in one PR. The two PRs now touch different lines; both edit
`PROOF-STATUS.adoc` and `CHANGELOG.adoc`, in places that don't overlap.

## Testing

- With the old flags still in place, `bash scripts/check-agda.sh` passes
locally on Agda 2.6.3, the Ubuntu package. That covers the postulate
scan, the trusted-base check, the unit tests and all 9 expected
rejections.
- The previous head `7f095b4` passed `proofs.yml` on the pinned 2.6.4.3,
along with the Rocq and Lean legs. That head also carried the gate
change.
- asciidoctor `--failure-level=WARN` renders both changed `.adoc` files.

Related: hyperpolymath/mathesis#96 pins this repository's 27 proven
claims. F-5's record there gains the lemma's name once this PR merges
and a new receipt exists.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01LiQzWJdcPfRU6YMDGRG8Xi

---------

Co-authored-by: Claude <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request Nov 17, 2026
## Why

The receipt on main still described `f211fc1`. Two changes have reached
`src/` and the gate since then:
- #37 removed `-W noUnsupportedIndexedMatch` from the Agda gate.
- #36 moved F-5's `maps-disagree-at-positive` into `src/`.

PROOF-POLICY §8.4 says grades don't carry forward, so the merge commit
needs its own receipt.

## What

- `verification/receipts/resource-algebra-proofs_praxis.deed` now
describes `47de4a8`, the merge of #36, and `proofs.yml` [run
44015282682](https://github.com/hyperpolymath/resource-algebra/actions/runs/44015282682).
In that run all three legs passed, along with `CI/gate` and the
coverage-exemption check.
- Only the per-commit fields changed:
  - the source commit;
- the job URLs: Agda `133811607634`, Rocq `133811607685`, Lean
`133811607731`;
  - the Agda invocation, which no longer has the `-W` suppression;
- each leg's inputs digest and manifest, recomputed from git with
standards' `scripts/proof-inputs-sha256.sh`.
- The Agda manifest now covers F-5's lemma; the new Agda digest is
`2a8edcaf…0e2f4f8c4`. The Rocq and Lean inputs are byte-identical to the
receipt at `f211fc1`.
- `docs/status/PROOF-STATUS.adoc` cites the new run, jobs, commit and
Agda digest. The receipt at `f211fc1` is listed as superseded, with the
reason.
- `CHANGELOG.adoc` has an entry for this.

## Testing

- **Regenerator check:** before using it, I re-ran the regenerator on
`f211fc1` with that run's job URLs. It reproduced the old receipt
exactly, apart from the invocation string. So only the fields above are
rewritten.
- **Grades:** the standards reader (`deed_lint.js --proof-receipt-json`,
at the reader pin mathesis uses, `e5a39d7`) derives PWG-1 for 27 rows
and `ungraded` for the two `OPEN` rows (C-4b, M-2). `deed_lint.js`
reports `OK`.
- **Git checks:** `check-proof-receipt.sh --branch origin/main` reports
every PROOF-POLICY §8.5.3 check holding. The source commit is on main,
and every manifest entry holds at `47de4a8`.
- **Docs and repo tests:** asciidoctor `--failure-level=WARN` renders
both changed `.adoc` files. `tests/workflows/deed_clause_test.sh` and
`governance_policy_test.sh` pass.

Follow-up in hyperpolymath/mathesis: once this merges, the registry pins
move to this receipt, and F-5's record gains
`maps-disagree-at-positive`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01LiQzWJdcPfRU6YMDGRG8Xi)_

Co-authored-by: Claude <noreply@anthropic.com>
hyperpolymath pushed a commit that referenced this pull request Nov 17, 2026
main moved six commits ahead (#36, #37, #41, #43, #44, #47). The branch's
proofs.yml predated #43's rename of the aggregating job to `Proofs verdict`,
so the CI/gate publisher reported "never reported: proofs.yml:Proofs
verdict" on this PR's head.

Conflicts: CHANGELOG.adoc keeps both sides' entries, newest first;
PROOF-STATUS takes main's revdate. The port's changelog line said the
gate's `-W noUnsupportedIndexedMatch` was unchanged; #37 removed it, so the
line now says the gate suppresses no warning and names the abbreviated and
split-pragma refusals.

coverage-exemption.toml: drop `pending-removal = ["src/interface"]`, whose
comment says to delete it when this PR merges; this PR removes the tree.
The exemption still holds, and a planted src/interface/*.zig is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDjDR2MdRwZH9b4rKJn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants