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
7 changes: 7 additions & 0 deletions .github/workflows/dogfood-proofs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

echo "::error file=$f::module declares a partial or covering definition or default"
missing=$((missing + 1))
fi
done
[ "$missing" -eq 0 ]

Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/idris2-abi-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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; })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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: |
Expand Down
5 changes: 4 additions & 1 deletion scripts/ci/check-agda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading