From 872af624f8a56e3aca26481989e2699de4ee237a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 20:06:42 +0000 Subject: [PATCH] fix(proofs): give Agda a writable data directory; run each lane alone (WO 1.4) The first Guix lane run (job 130080389181, new pin 8edb9da) built the toolchain in 22 minutes, then failed in the Agda lane: .../agda-2.7.0.1/share/.../lib/prim/_build: createDirectory: permission denied The Guix agda 2.7.0.1 package ships without the interfaces of Agda's own primitive modules, and its store path is read-only, so Agda cannot check any module. It is the same error that breaks Guix's agda-stdlib 2.3. - check-proofs.sh: when Agda's data directory has no lib/prim/_build and cannot be written, the gate copies it to a temporary directory, makes the copy writable and points Agda at it with Agda_datadir, the variable Agda reads. Tested with Agda 2.7.0.1 from Guix as a non-root user, with a read-only data directory without _build: the old gate fails both modules with the CI error; the new gate passes both, and the planted postulate still fails it. A read-only copy given through Agda_datadir reproduces the CI error, which shows that Agda honours the variable. - The workflow runs the Rocq and Lean lanes even when the Agda lane fails, so each lane reports its own result. The failed run skipped both. The packaging defect belongs to Guix, the source; this is the in-repo workaround until its agda package ships the interfaces. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0136P7ZnDRsCLfZcFcEzvPcM --- .github/workflows/agda-proof-policy.yml | 4 ++++ scripts/check-proofs.sh | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/.github/workflows/agda-proof-policy.yml b/.github/workflows/agda-proof-policy.yml index c363ffb..069e2f1 100644 --- a/.github/workflows/agda-proof-policy.yml +++ b/.github/workflows/agda-proof-policy.yml @@ -63,6 +63,7 @@ jobs: echo "$G/bin" >> "$GITHUB_PATH" - name: Pinned toolchain from build/channels.scm and build/manifest.scm + id: toolchain run: | set -euo pipefail guix time-machine -C build/channels.scm -- describe @@ -72,18 +73,21 @@ jobs: lean --version | tee /dev/stderr | grep -qF "version ${LEAN_VERSION}"' - name: Agda lane (gate, then planted controls) + if: ${{ !cancelled() && steps.toolchain.outcome == 'success' }} run: | guix time-machine -C build/channels.scm -- shell -m build/manifest.scm -- sh -euc ' bash scripts/check-proofs.sh agda bash tests/proofs/gate_controls_test.sh agda' - name: Rocq lane (gate, then planted controls) + if: ${{ !cancelled() && steps.toolchain.outcome == 'success' }} run: | guix time-machine -C build/channels.scm -- shell -m build/manifest.scm -- sh -euc ' bash scripts/check-proofs.sh coq bash tests/proofs/gate_controls_test.sh coq' - name: Lean lane (gate, then planted controls) + if: ${{ !cancelled() && steps.toolchain.outcome == 'success' }} run: | guix time-machine -C build/channels.scm -- shell -m build/manifest.scm -- sh -euc ' bash scripts/check-proofs.sh lean4 diff --git a/scripts/check-proofs.sh b/scripts/check-proofs.sh index 0107cdb..f8b4314 100755 --- a/scripts/check-proofs.sh +++ b/scripts/check-proofs.sh @@ -197,6 +197,25 @@ if ! command -v "$CMD" >/dev/null 2>&1; then exit 1 fi "$CMD" --version 2>/dev/null | head -1 || true + +# --- Agda: a data directory it can write --------------------------------------- +# Agda keeps the interfaces of its own primitive modules (Agda.Primitive and the +# Agda.Builtin modules) in /lib/prim/_build. A packaged Agda whose +# store path is read-only and ships without them (Guix agda 2.7.0.1, found +# 2026-11-10: "lib/prim/_build: createDirectory: permission denied") cannot +# check any module. Then the gate gives Agda a writable copy of its data +# directory through Agda_datadir, the variable Agda reads for it. The copy holds +# Agda's own library unchanged; only the interfaces are written there. +if [ "$PROVER" = agda ] && [ -z "${Agda_datadir:-}" ]; then + agda_data="$(agda --print-agda-data-dir 2>/dev/null || true)" + if [ -n "$agda_data" ] && [ ! -d "$agda_data/lib/prim/_build" ] && [ ! -w "$agda_data/lib/prim" ]; then + Agda_datadir="$(mktemp -d)" + cp -r "$agda_data/." "$Agda_datadir/" + chmod -R u+w "$Agda_datadir" + export Agda_datadir + echo "Agda data directory is read-only without interfaces; using a writable copy" + fi +fi echo # --- a repo with proofs but no MANIFEST is itself a failure -------------------