Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/proofs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
name: Core proofs and expected rejections
runs-on: ubuntu-latest
timeout-minutes: 15
container: debian:trixie-slim

Check warning on line 32 in .github/workflows/proofs.yml

View workflow job for this annotation

GitHub Actions / Hypatia neurosymbolic scan

[hypatia] workflow .github/workflows/proofs.yml:32 pins container `debian:trixie-slim` by tag — tag is mutable; pin by sha256 digest instead
steps:
- name: Install the pinned prover
run: |
Expand All @@ -46,6 +46,8 @@
run: bash tests/check_agda_find_failure_test.sh
- name: Gate stops on a postulate outside the prover's named trusted base
run: bash tests/check_agda_trusted_base_test.sh
- name: Gate refuses any Agda warning, UnsupportedIndexedMatch included
run: bash tests/check_agda_warning_gate_test.sh
- name: Core proofs and expected rejections
run: bash scripts/check-agda.sh
- name: Proof receipt
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@
* `tests/workflows/ci_gate_test.sh`: positive control, four negative cases,
`needs:` drift and a planted-runtime-code case.

== 2026-11-16 — The Agda gate suppresses no warning

* `scripts/check-agda.sh` drops `-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. With it gone, `-W error` covers every warning.
* `tests/check_agda_warning_gate_test.sh` with the fixture
`tests/warning/IndexedMatch.agda`: the fixture checks without `-W error`,
and the gate's own flags refuse it. Against the old flags the test fails.
`proofs.yml` runs it.
* `PROOF-STATUS.adoc` and `PROOF-NEEDS.adoc` describe the new invocation.
Receipts already recorded keep the invocation they ran with.

== 2026-11-11 — Proof receipt and grades at f211fc1

* `verification/receipts/resource-algebra-proofs_praxis.deed`: the proof
Expand Down
4 changes: 2 additions & 2 deletions docs/status/PROOF-NEEDS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ they were removed with those files on 2026-11-09.
| PN-1
| Every theorem in `PROOF-STATUS.adoc` checks in Agda under the canonical
invocation `--safe --without-K --cubical-compatible` (policy §2.1), with no
postulates, holes or libraries, under `-W error` (only
`UnsupportedIndexedMatch` is suppressed) and the estate strict flag set.
postulates, holes or libraries, under `-W error` (no warning suppressed)
and the estate strict flag set.
| `scripts/check-agda.sh`; CI `proofs.yml`

| PN-2
Expand Down
7 changes: 5 additions & 2 deletions docs/status/PROOF-STATUS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@ dependent type theories (§8.3).

* *Invocation.* `scripts/check-agda.sh` runs `agda --safe --without-K
--cubical-compatible --no-libraries --ignore-interfaces --double-check
-W error -W noUnsupportedIndexedMatch -i src`, and every module also
-W error -i src`, and every module also
declares `--exact-split --no-sized-types --no-guardedness` (the estate
strict flag set, from main #21) over `src/ResourceAlgebra/All.agda`, the unit tests
(`tests/unit/AllTests.agda`) and the nine expected rejections. A rejection
must fail at its invalid declaration with the message its `-- EXPECT:` line
names. A refusal with any other message fails the gate, and so does any
warning other than `UnsupportedIndexedMatch`.
warning, `UnsupportedIndexedMatch` included. Until 2026-11-16 the gate
suppressed that one warning; the core raised none, and
`tests/check_agda_warning_gate_test.sh` now shows the gate's flags refuse
an indexed match.
* *Import cone.* Only `src/ResourceAlgebra/`: no standard library and no
other library. There is no `postulate` (refused by `--safe`), no hole and no
`TERMINATING` or similar pragma.
Expand Down
6 changes: 4 additions & 2 deletions scripts/check-agda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ prover="${AGDA:-agda}"
"$prover" --version
# The canonical theory-proof invocation (standards PROOF-POLICY §2.1,
# 2026-11-01) is --safe --without-K --cubical-compatible. -W error makes any
# warning a failure, except UnsupportedIndexedMatch, which is suppressed.
# warning a failure, UnsupportedIndexedMatch included: the order and the
# injectivity lemmas are stated so the cone raises none, and
# tests/check_agda_warning_gate_test.sh shows these flags refuse one.
# --no-libraries keeps the import cone first-party (no standard library);
# --double-check re-checks every term with the core type checker.
flags=(--safe --without-K --cubical-compatible --no-libraries --ignore-interfaces --double-check -W error -W noUnsupportedIndexedMatch -i src)
flags=(--safe --without-K --cubical-compatible --no-libraries --ignore-interfaces --double-check -W error -i src)
# PROOF-POLICY §8.4.6: a comment-aware postulate scan of the import cone
# (src/), alongside --safe. scripts/scan-postulates.pl reads each file in
# source order (nested block comments, line comments, strings) and fails on
Expand Down
46 changes: 46 additions & 0 deletions tests/check_agda_warning_gate_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: MPL-2.0
# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell
# The Agda gate must fail on any warning, UnsupportedIndexedMatch included:
# the order and the injectivity lemmas were restated so the cone raises
# none, and nothing is suppressed. The test reads the flags from
# scripts/check-agda.sh, as proofs.yml does, and checks
# tests/warning/IndexedMatch.agda, whose one clause needs injectivity of
# suc. Agda 2.6.3 does not print the warning's name when it is an error, so
# the test matches the reason Agda gives, which every version prints.
# Control: without -W error the fixture checks, so the gate's refusal
# comes from the warning alone. Case: with the gate's flags Agda must stop,
# naming UnsupportedIndexedMatch.
set -uo pipefail
cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
export LC_ALL="${LC_ALL:-C.UTF-8}"
prover="${AGDA:-agda}"
command -v "$prover" >/dev/null || { echo "FAIL: no Agda on PATH" >&2; exit 1; }
line=$(sed -n 's/^flags=(\(.*\))$/\1/p' scripts/check-agda.sh)
[[ -n "$line" ]] || { echo "FAIL: no flags=(...) line in scripts/check-agda.sh" >&2; exit 1; }
read -r -a gate <<<"$line"
fixture=tests/warning/IndexedMatch.agda
fail=0

# Control: the gate's flags with every -W pair removed.
loose=()
for ((i = 0; i < ${#gate[@]}; i++)); do
if [[ "${gate[i]}" == -W ]]; then ((i++)); continue; fi
loose+=("${gate[i]}")
done
if out=$("$prover" "${loose[@]}" -i tests/warning "$fixture" 2>&1); then
echo "PASS: control: the fixture checks once warnings are not errors"
else
printf 'FAIL: control: the fixture does not check even without -W error\n%s\n' "$(tail -5 <<<"$out")" >&2; fail=1
fi

# Case: the gate's own flags.
out=$("$prover" "${gate[@]}" -i tests/warning "$fixture" 2>&1); rc=$?
if [[ $rc -eq 0 ]]; then
echo "FAIL: the gate's flags accepted an indexed match: UnsupportedIndexedMatch is not an error" >&2; fail=1
elif ! grep -q 'injectivity of the data constructor suc' <<<"$out"; then
printf 'FAIL: Agda stopped for another reason (exit %s)\n%s\n' "$rc" "$(tail -5 <<<"$out")" >&2; fail=1
else
echo "PASS: the gate's flags refuse an indexed match (exit $rc): UnsupportedIndexedMatch"
fi
exit "$fail"
17 changes: 17 additions & 0 deletions tests/warning/IndexedMatch.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{-# OPTIONS --safe --without-K --cubical-compatible #-}
-- SPDX-License-Identifier: MPL-2.0
-- SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell
--
-- Negative control for the Agda gate's warning policy. The clause below
-- matches refl on suc m ≡ suc n, which needs injectivity of suc. Under
-- --cubical-compatible Agda warns (UnsupportedIndexedMatch) that it will
-- not compute along transports. The module is otherwise valid: it checks
-- without -W error. tests/check_agda_warning_gate_test.sh requires the
-- gate's own flags to refuse it.
module IndexedMatch where

open import Agda.Builtin.Nat using (Nat; suc)
open import Agda.Builtin.Equality using (_≡_; refl)

suc-injective : ∀ {m n : Nat} → suc m ≡ suc n → m ≡ n
suc-injective refl = refl
Loading