@@ -22,14 +22,16 @@ file, checked from this directory.
2222| `QttSemiring.agda`
2323| The QTT quantity semiring `{0, 1, ω}`: 21 statements, the same as
2424 `formal/QttSemiring.v` (obligation P-4)
25- | Checks clean under the canonical flags on Agda 2.6.3. *Not yet checked on
26- the pinned Agda 2.7.0.1.* No Lean leg. No receipt. So still `ungraded`.
25+ | Checks clean under the canonical flags on the pinned Agda 2.7.0.1 (and on
26+ 2.6.3); imports into a `--safe --cubical` module. No Lean leg. No receipt.
27+ So still `ungraded`.
2728
2829| `BorrowProvenance.agda`
2930| *Experiment* (#553, ADR-028 option G): on a toy reference calculus, the
3031 checker's tracked loan set contains the provenance fibre for every program
3132 in the second-class cut D; exclusivity and rejection for D+R4
32- | Checks clean under the canonical flags on Agda 2.6.3. A toy model, not
33+ | Checks clean under the canonical flags on the pinned Agda 2.7.0.1 (and on
34+ 2.6.3); imports into a `--safe --cubical` module. A toy model, not
3335 `lib/borrow.ml`. No Rocq or Lean leg, no receipt: `ungraded`. Record:
3436 `BORROW-PROVENANCE-EXPERIMENT.adoc`.
3537|===
@@ -40,16 +42,73 @@ file, checked from this directory.
4042----
4143just -f formal/justfile check-agda # the gate
4244just -f formal/justfile check-agda-controls # five planted failures; each must fail the gate
45+ # usability from full --cubical; needs an agda/cubical checkout at v0.8:
46+ CUBICAL_DIR=/path/to/cubical just -f formal/justfile check-agda-cubical
47+ CUBICAL_DIR=/path/to/cubical just -f formal/justfile check-agda-cubical-controls
4348----
4449
4550The gate fails when `agda` is missing, when a module lacks the canonical
4651pragma, contains `postulate`, exits non-zero, or prints anything but
4752`Checking` lines (so a warning fails). Every `*.agda` under this directory is
4853checked; nothing is listed by hand.
4954
50- CI runs both recipes in the `agda-proofs` job of
51- `.github/workflows/coq-proof-gate.yml`, on Ubuntu 24.04's `agda-bin` package
52- (Agda 2.6.3).
55+ CI runs all four recipes in the `agda-proofs` job of
56+ `.github/workflows/coq-proof-gate.yml`, on the pinned toolchain below.
57+
58+ === Pinned toolchain
59+
60+ [cols="2,5",options="header"]
61+ |===
62+ | Component | Pin
63+
64+ | Agda
65+ | 2.7.0.1, the official static Linux binary
66+ `Agda-v2.7.0.1-linux.tar.xz` from the agda/agda `v2.7.0.1` release
67+ (tag object `f24f2aaf…`, commit `a6fc20c27ae953149b53a8997ba4a1c8b17d628a`).
68+ SHA-256 `975b515a14877ab6bce5bfc641e16c4a3ee52ca5d7f846577dee80aa2145db8a`;
69+ CI verifies it before unpacking. The binary's built-in data directory is
70+ the release builder's path, so `Agda_datadir` must point at the unpacked
71+ `data/`.
72+
73+ | agda/cubical
74+ | `v0.8`, commit `3291fc1d8cae1409cc54d4f9cca7366158b573d7` (library name
75+ `cubical-0.8`). Its README's compatibility table pairs v0.8 with Agda
76+ 2.6.4.1 and 2.7.0.1; v0.9 (the latest tag, `b150186d…`) and `master`
77+ require Agda 2.8.0, so v0.8 is the latest release usable with the pin.
78+ CI fetches it by commit SHA and asserts `HEAD`. Used only by the
79+ `--cubical` usability check; the theory sources import no library.
80+ |===
81+
82+ === Usability from `--cubical`
83+
84+ `formal/agda-cubical/CubicalCompat.agda` is a `--safe --cubical` module, in
85+ its own library (`affinescript-cubical-compat`, `depend: cubical-0.8`), that
86+ imports every module under this directory. It re-exports one or more theorems
87+ of each unchanged, then uses them as cubical paths through the library's
88+ `eqToPath` / `pathToEq`:
89+
90+ * `qplus-comm-path` — `QttSemiring.qplus-comm` as a `Path`;
91+ * `qplus-flip-path` — a `Path` between the *functions* `qplus` and its flip:
92+ function extensionality, which `--without-K` alone does not give;
93+ * `qplus-comm-roundtrip` — back to the inductive `_≡_`;
94+ * `K1-rejected-path` — `BorrowProvenance.K1-rejected-by-theorem` (the #554
95+ verdict from the rejection theorem) as a `Path`.
96+
97+ `check-agda-cubical` fails if any module under this directory is not imported
98+ by the fixture, so a new theory module must join it. Its controls show the
99+ check is load-bearing: a source whose pragma drops `--cubical-compatible`
100+ (keeping `--safe --without-K`) is refused by Agda with "Importing module
101+ QttSemiring not using the --cubical-compatible flag from a module which
102+ does", and a source with K available is refused for `--without-K` as well.
103+
104+ Decision: the sources stay at the canonical `--cubical-compatible`; nothing
105+ was ported to full `--cubical`. `--cubical-compatible` is what makes a module
106+ importable from cubical developments, so usability is proved by the import
107+ rather than bought by changing the lane. Porting would move the modules out
108+ of the PROOF-POLICY theory lane, add a library to their import cone, and cut
109+ the Rocq and Lean legs for any statement using a cubical primitive (see the
110+ comparison under "Extrapolation" below). A cubical client gets paths and
111+ funext over these theorems for free, as the fixture shows.
53112
54113== What is and is not established
55114
@@ -67,17 +126,37 @@ Established, by runs in this session (2026-12-01, container Ubuntu 24.04):
67126 definitions. A mutated table entry made the Agda check fail.
68127* The gate fails on each of five planted controls.
69128
129+ Established on the pinned Agda 2.7.0.1 (a later session, 2026-12-01, same
130+ container image; toolchain pinned as in the table above):
131+
132+ * Both modules, unchanged, check with exit 0 and *no* output other than
133+ `Checking` lines under `agda --safe --without-K --cubical-compatible`
134+ (`check-agda`). No repair was needed; no statement or proof text changed.
135+ Neither draws `UnsupportedIndexedMatch` on 2.7.0.1.
136+ * `check-agda-controls`: all five planted controls still fail the gate on
137+ 2.7.0.1; the `indexed` control fails for the intended reason (2.7.0.1
138+ prints `-W[no]UnsupportedIndexedMatch` and exits 0, and the gate rejects
139+ the output).
140+ * `check-agda-cubical`: `CubicalCompat.agda` checks against agda/cubical
141+ v0.8 with exit 0 and no diagnostic, loading both sources;
142+ `check-agda-cubical-controls`: all five controls fail it.
143+ * All four recipes were replayed from a fresh download and a fresh cubical
144+ fetch, exactly as the CI job runs them.
145+
70146Not established:
71147
72- * *The pinned Agda 2.7.0.1.* It could not be installed in the session. The
73- official release binary was downloaded (SHA-256
74- `975b515a14877ab6bce5bfc641e16c4a3ee52ca5d7f846577dee80aa2145db8a`, taken
75- from the download itself and not checked against an independent record),
76- but the session's permission policy refused to run it. A build from Hackage
77- failed because `cabal-install` 3.8.1 (Ubuntu) no longer verifies Hackage's
78- root keys; building around that check was refused too, correctly. So the
79- result above is a real check on a different Agda version, and it is *not*
80- receipt-grade.
148+ * *An independent record of the Agda binary's digest.* The SHA-256 above was
149+ computed from the download (twice, identical) and is pinned in CI from
150+ then on (trust on first use). It was not compared with a digest published
151+ by the Agda project: the release page and API were not reachable from the
152+ session. Anyone with access can confirm it against the release asset's
153+ `digest` field on GitHub. (An earlier session's attempt to build 2.7.0.1
154+ from Hackage failed on `cabal-install` 3.8.1's root-key check; this
155+ session used the release binary instead.)
156+ * *The nine `BorrowProvenance` mutations* were run on 2.6.3 only, not
157+ repeated on 2.7.0.1 (they are not scripted).
158+ * *CI on the pin.* The job was replayed locally; its first GitHub Actions
159+ run is on the PR that introduced it.
81160* *A Lean leg.* Lean 4.15.0 and 4.13.0 were downloaded and their SHA-256
82161 digests match the ones `docs/COMPLETION-PLAN.adoc` §5.0 records
83162 (`af71a256…`, `44ceeac7…`), but running them was refused in this session.
@@ -324,8 +403,10 @@ What drives the uncertainty, largest first:
324403. *The prelude.* No stdlib means ℕ and list lemmas are re-proved. `lia` is
325404 used only 4 times across the seven files, so this is bounded, but
326405 `QttDynamic`'s one `lia` closes 27 cases at once.
327- . *The pinned version.* Nothing here has run on Agda 2.7.0.1. Unification and
328- warning behaviour changed between 2.6.3 and 2.7; the files may need edits.
406+ . *The pinned version.* The two committed modules needed no edit on Agda
407+ 2.7.0.1. The probe files above were measured on 2.6.3 only; unification and
408+ warning behaviour changed between 2.6.3 and 2.7, so further files may still
409+ need edits.
329410. *The other two legs.* Each Agda source also needs its statement comparison
330411 with the Rocq leg and a new Lean leg (no Mathlib). The Lean leg was not
331412 measured at all.
@@ -404,9 +485,11 @@ and the cross-prover comparison.
404485| Measured (Agda 2.6.3): the committed module checks unchanged with its pragma
405486 replaced by `--safe --cubical`, because it uses only the inductive `_≡_`.
406487 `--cubical` does not remove F1: the direct indexed match draws the same
407- `UnsupportedIndexedMatch` warning under `--safe --cubical`. Not measured:
408- restating the laws over `Path`, which is what a cubical development would
409- actually use, and which needs the two equalities bridged.
488+ `UnsupportedIndexedMatch` warning under `--safe --cubical`. Measured on
489+ Agda 2.7.0.1 with agda/cubical v0.8: the bridge works without restating
490+ anything — `CubicalCompat.agda` turns the `_≡_` theorems into `Path`s with
491+ the library's `eqToPath`, including a funext path. Not measured: proofs
492+ written natively over `Path`.
410493
411494| Other legs
412495| Rocq and Lean state the same thing.
@@ -475,10 +558,11 @@ admission record and any shared grade signature are estate-level items.
475558
476559== Open decisions for the owner
477560
478- . How to provision the pinned Agda 2.7.0.1 for this repository's CI: the
479- mathesis route (Guix time-machine with its `build/channels.scm`), or the
480- checksum-pinned official release binary. Until then the CI job runs
481- Agda 2.6.3 and says so.
561+ . _Decided 2026-12-01:_ provisioning of the pinned Agda 2.7.0.1. The owner
562+ asked for 2.7.0.1 plus the latest compatible agda/cubical; CI now uses the
563+ checksum-pinned official release binary. The mathesis route (Guix
564+ time-machine with its `build/channels.scm`) remains the alternative if the
565+ estate wants one provisioning path for every lane.
482566. Whether `UnsupportedIndexedMatch` fails the gate (as here) or passes (as in
483567 mathesis's `check-proofs.sh`).
484568. Whether to port the remaining theory files as they stand, or first repair
0 commit comments