diff --git a/.github/workflows/dogfood-proofs-ci.yml b/.github/workflows/dogfood-proofs-ci.yml index 2b3057b9..2b52e380 100644 --- a/.github/workflows/dogfood-proofs-ci.yml +++ b/.github/workflows/dogfood-proofs-ci.yml @@ -235,6 +235,13 @@ jobs: echo "::error file=$f::module lacks %default total" missing=$((missing + 1)) fi + # 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 + echo "::error file=$f::module declares a partial or covering definition or default" + missing=$((missing + 1)) + fi done [ "$missing" -eq 0 ] diff --git a/.github/workflows/idris2-abi-ci.yml b/.github/workflows/idris2-abi-ci.yml index a2ef75e5..0b1ecbd3 100644 --- a/.github/workflows/idris2-abi-ci.yml +++ b/.github/workflows/idris2-abi-ci.yml @@ -134,6 +134,20 @@ jobs: exit 1 fi + - name: No partial or covering escape in the ABI + # %default total is only a default: a `partial` or `covering` annotation, or + # a module-wide `%default partial|covering`, turns the totality check off for + # 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; }) + if [ -n "$hits" ]; then + printf '%s\n' "$hits" + echo "::error::src/abi/ declares a partial or covering definition or default" + exit 1 + fi + echo "no partial or covering escape under src/abi/" + - name: Count modules and report if: steps.detect.outputs.relevant == 'true' run: | diff --git a/scripts/ci/check-agda.sh b/scripts/ci/check-agda.sh index af1be781..9abff35d 100644 --- a/scripts/ci/check-agda.sh +++ b/scripts/ci/check-agda.sh @@ -38,7 +38,10 @@ echo "$total source modules, $((total - missing)) with fresh interfaces" # Source-bound receipt (PROOF-POLICY ยง8): toolchain, flags and the SHA-256 of # every first-party source and library descriptor this run checked. -echo "receipt: $version; commit $(git -C "$repo_root" rev-parse HEAD)" +# Its own line: inside echo's arguments a failed rev-parse escapes set -e +# and the receipt would name an empty commit. +commit=$(git -C "$repo_root" rev-parse HEAD) +echo "receipt: $version; commit $commit" echo "receipt: flags --safe --without-K --cubical-compatible; library file $AGDA_LIBRARIES_FILE" while IFS= read -r lib; do if [[ -n "$lib" ]]; then