Skip to content

Commit ad69ddf

Browse files
proofs: scope vacuous Agda CNO fields, fix archived PROOF-STATUS paths, pin stdlib, make OND-3 writer Z3 check real (#198)
## Summary This PR acts on the absolute-zero items in the ephapax v2 survey's cross-repo action list, plus one Z3 finding. 1. **Agda CNO fields (comments and docs only, no definitions changed).** In `proofs/agda/CNO.agda`, `terminates` holds by definition: `eval` is total over a finite list, so `(eval p s , refl)` inhabits it for every program. `energy-dissipated _ _ _ = zero`, so `thermodynamically-reversible` holds for every program by `refl`. The notes beside the definitions and on `IsCNO` now say what these fields establish and what they do not. They also record that `IsCNO` never uses the non-trivial `reversible` predicate, and that `cno-identity` is the only field that constrains a program. PROOF-STATUS gains a new section, "Scope of the Agda CNO fields". 2. **Archived paths in PROOF-STATUS.** `proofs/coq` and `proofs/verify-all-provers.sh` no longer exist. Rows and sections now point at `archive/proofs/{coq,lean4,isabelle,mizar}` and `archive/proofs/verify-all-provers.six-prover.sh`. The Coq, Lean 4, Isabelle/HOL and Mizar headings change from "VERIFIED (this environment)" to "ARCHIVED (historical receipt)", and claims that they are CI-gated now read as past tense. A pre-existing unescaped `|` in the Z3 table row (`sat|unsat`) split the canonical table: `scripts/check-adoc-tables.sh` failed on `main` and now passes. 3. **Reproducible stdlib.** The new `scripts/provision-agda-stdlib.sh` clones agda-stdlib `v1.7.3`. It fails unless the tag resolves to the pinned commit `0817da6877aa045932221134913d8511caa78d97`. It then renames the manifest to `standard-library` and writes `$AGDA_DIR/{libraries,defaults}`. The CI `agda` job now runs this script in place of its inline steps. The script is also the `just provision-agda-stdlib` recipe and is named in `verify-active-provers.sh`. 4. **The OND-3 dir 2 Z3 check was vacuous.** The block asserted `(not (and (= 0 0) (= 1 1)))`, which is unsat for any program. It now models `writer_op` per `OND.v`: memory as an array, `inj`, `writer_step = store m 0 7`, time 1, with the `O_all` observable computed from them. That check returns `unsat`. A control with a leaking writer returns `sat`, and a `writer_not_null` witness returns `sat`. If `writer_step` is mutated to leak, the main verdict flips to `sat`. ## Checks run (actual output) - `z3 proofs/z3/ond/OND_checks.smt2` (Z3 4.8.12): `sat unsat sat sat sat`, exit 0. - `bash proofs/z3/verify.sh`: `Z3-CHECK OK` (5 verdicts match). - Agda 2.6.3 with the stdlib provisioned by the new script in a scratch `AGDA_DIR`: - `--safe --without-K`: CNO, OND, EchoBridgeScaffold and EchoBridgeCNO each exit 0. - `--safe --without-K --cubical-compatible`: all four exit 0. - `bash proofs/tests/gate-selftest.sh`: `GATE-SELFTEST OK: 27/27`. - `bash scripts/check-proof-patterns.sh`: OK. - `bash scripts/check-adoc-tables.sh PROOF-STATUS.adoc`: OK. - Idris 2: not run. ## Not done (follow-ups) - The OND-3 dir 1 and OND-5 Z3 blocks still write the observables down directly rather than computing them. This is recorded in PROOF-STATUS. - Many other docs (README, EXPLAINME, ROADMAP, AUDIT, `docs/*`, `docs/wiki/*`) still cite `proofs/coq` and `verify-all-provers.sh`. This PR fixes PROOF-STATUS only. - CI does not yet gate `--cubical-compatible`. - The `License:` line in the `CNO.agda` header comment was left untouched (licence edits are owner-only). ## Follow-up commit 37c792a: archived-path sweep in the other docs This commit picks up the "many other docs" follow-up above. It changes documentation only: no proof file, script or workflow. Docs that state current facts now cite `archive/proofs/{coq,lean4,isabelle,mizar}/…` and `archive/proofs/verify-all-provers.six-prover.sh` in place of the removed `proofs/…` paths. Where a doc claimed those provers are built, verified or CI-gated now, it says "archived" or uses the past tense, worded the way PROOF-STATUS is. The active gate is named as `proofs/verify-active-provers.sh` (Agda + Z3 bounded + Idris 2 ABI). CI is described as the `agda`, `z3` and `idris` jobs in `proofs.yml`. Files changed (18): - `README.adoc`, `EXPLAINME.adoc`, `ROADMAP.adoc`: layout rows, evidence pointers, the "What genuinely verifies" receipts (now labelled as 2026-07-07 receipts) and the CI row. - `docs/proof-debt.adoc`: ledger file pointers now go to `archive/proofs/`, and the status banner has an archive note. - `docs/COOKBOOK.adoc`, `ECHIDNA.adoc`: archive notice added; input paths moved. - `docs/JUSTFILE-COOKBOOK.adoc`: `build-all` now matches the Justfile (Agda + Idris). `build-coq`, `build-lean` and `verify-coq` are marked historical because the Justfile no longer has them. The `clean-coq`/`clean-lean` paths now match the Justfile. - `docs/OND-PILLAR-STRUCTURE.adoc`, `docs/OND-ROADMAP.adoc`, `docs/ECOSYSTEM-CONNECTIONS.adoc`, `docs/MACHINE_VERIFICATION.adoc`, `docs/VERIFICATION_RESULTS.adoc`: status text and commands. - `docs/wiki/{Architecture,Verification,Proof-Systems,Home,Roadmap,Audit-Trail}.md`. References left on purpose: - **Dated records, kept as written:** `CHANGELOG.adoc`, the resolved items in `AUDIT.adoc`, `docs/archive/*`, `docs/PROOF-INSIGHTS.adoc` (session note, 2026-02-05), `docs/PROOF-COMPLETION-PLAN.adoc` (historical plan), `docs/proof-debt-triage.adoc` (self-described historical triage), `docs/PROOF-CLASSIFICATION.adoc` (pre-completion classification) and the historical sample output in the two cookbooks. - **`docs/OND-PILLAR-STRUCTURE.adoc` layout tables:** these are the original design sketch, and several of their paths exist in neither `proofs/` nor `archive/proofs/`. The status banner now says this rather than rewriting the tables. - **`docs/CLAUDE.adoc`:** its `proofs/coq` references describe the separate GitLab repository. - **Paths that are created rather than moved:** `docs/COOKBOOK.adoc` "Adding a New Language" (`proofs/coq/mylang/…`), and the ECHIDNA plan's output paths (`proofs/coq-completed/`, `proofs/lean4/CNO_translated.lean`). - **Old names kept with their replacement:** where a sentence names the old path, it is in the form "`proofs/verify-all-provers.sh` (now archived as `archive/proofs/verify-all-provers.six-prover.sh`)". Checks (actual output): - Every path written in the added lines exists (`test -e`). The only old paths left in added lines are the "old name → new name" phrasings. - `bash scripts/check-adoc-tables.sh` on the 12 touched `.adoc` files: 11 OK. `EXPLAINME.adoc:134: unterminated table block` also fails on the base commit: the file ends in `|===abc def ghi …`. That line is not touched here. - `asciidoctor -w` on the 12 touched `.adoc` files: the same 6 warnings/errors before and after the change (identical once line numbers are normalised). They are the EXPLAINME table above, two "table missing leading separator" errors in README, and the missing `pygments.rb` gem. - No Markdown link checker exists in the repo, so none was run. Found but not changed (outside a docs-only sweep): - `verification/run-local-verification.sh` and `verification/setup-and-verify.sh` still run `coqc`, `lake` and `isabelle` against `proofs/coq`, `proofs/lean4` and `proofs/isabelle`. - Several docs still cite `proofs/z3/cno_properties.smt2`. That file was not moved to the archive; it no longer exists (`proofs/z3/verify.sh` notes it was dropped on 2026-09-23). --- _Generated by [Claude Code](https://claude.ai/code/session_01J4QvDjUNwStGwcKTtAQ3NY)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01J4QvDjUNwStGwcKTtAQ3NY --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent ffcfed1 commit ad69ddf

23 files changed

Lines changed: 429 additions & 216 deletions

‎.github/workflows/proofs.yml‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ on:
2020
- 'proofs/**'
2121
- 'src/**'
2222
- 'scripts/check-proof-patterns.sh'
23+
- 'scripts/provision-agda-stdlib.sh'
2324
- 'tests/check-proof-patterns.sh'
2425
- '.machine_readable/contractiles/trust/trust.k9.ncl'
2526
- 'absolute-zero-abi.ipkg'
@@ -56,16 +57,11 @@ jobs:
5657
# version-matched stdlib from git instead (validated locally).
5758
run: sudo apt-get update && sudo apt-get install -y agda
5859
- name: Fetch + register agda-stdlib v1.7.3 (matches Agda 2.6.3)
59-
run: |
60-
git clone -q --depth 1 --branch v1.7.3 \
61-
https://github.com/agda/agda-stdlib.git "$HOME/agda-stdlib"
62-
# The upstream manifest is named `standard-library-1.7.3`; the repo's
63-
# absolute-zero.agda-lib depends on `standard-library`, so align it.
64-
sed -i 's/^name: .*/name: standard-library/' \
65-
"$HOME/agda-stdlib/standard-library.agda-lib"
66-
mkdir -p "$HOME/.agda"
67-
echo "$HOME/agda-stdlib/standard-library.agda-lib" > "$HOME/.agda/libraries"
68-
echo "standard-library" > "$HOME/.agda/defaults"
60+
# Same script for CI and local runs: clones tag v1.7.3, fails unless it
61+
# resolves to the pinned commit, renames the manifest to
62+
# `standard-library` (what absolute-zero.agda-lib depends on), and writes
63+
# ~/.agda/libraries + ~/.agda/defaults.
64+
run: bash scripts/provision-agda-stdlib.sh
6965
- name: Type-check CNO + OND + EchoBridge (4 modules, PROOF-POLICY 2.1 + strict flags)
7066
working-directory: proofs/agda
7167
# The canonical invocation (standards PROOF-POLICY 2.1) is

‎ECHIDNA.adoc‎

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ This document describes integrating the **hyperpolymath ECHIDNA neurosymbolic th
1515

1616
**Status**: ✅ **TRUSTED** - Production-ready with comprehensive trust framework
1717

18+
[IMPORTANT]
19+
.Archive notice (2026-10-10)
20+
====
21+
This plan was written around the Coq and Lean 4 trees, which were archived on
22+
2026-10-10 under `archive/proofs/` (with Isabelle/HOL and Mizar) and are no
23+
longer built or gated. Input paths below point at `archive/proofs/…`. The active
24+
stack is Agda (`proofs/agda/`) + Z3 bounded checks (`proofs/z3/`) + the Idris 2
25+
ABI, run by `proofs/verify-active-provers.sh`; see `PROOF-STATUS.adoc`.
26+
====
27+
1828
---
1929

2030
== Trust Assessment
@@ -95,7 +105,7 @@ This document describes integrating the **hyperpolymath ECHIDNA neurosymbolic th
95105

96106
== Architecture Integration
97107

98-
=== Current Absolute Zero Stack
108+
=== Absolute Zero Stack (as of writing; historical since 2026-10-10)
99109

100110
```
101111
┌─────────────────────────────────────────┐
@@ -229,7 +239,7 @@ pack install idris2-echidna
229239

230240
# Test validator
231241
pack exec idris2-echidna -- validate \
232-
--proof ~/Documents/hyperpolymath-repos/absolute-zero/proofs/coq/common/CNO.v \
242+
--proof ~/Documents/hyperpolymath-repos/absolute-zero/archive/proofs/coq/common/CNO.v \
233243
--prover Coq
234244
```
235245

@@ -248,17 +258,17 @@ cd ~/Documents/hyperpolymath-repos/absolute-zero
248258
mkdir -p tools/echidna/cno-corpus
249259

250260
# Coq proofs (Phase 1-4 complete)
251-
find proofs/coq -name "*.v" -exec cat {} \; > tools/echidna/cno-corpus/coq_proofs.v
261+
find archive/proofs/coq -name "*.v" -exec cat {} \; > tools/echidna/cno-corpus/coq_proofs.v
252262

253263
# Lean 4 proofs
254-
find proofs/lean4 -name "*.lean" -exec cat {} \; > tools/echidna/cno-corpus/lean_proofs.lean
264+
find archive/proofs/lean4 -name "*.lean" -exec cat {} \; > tools/echidna/cno-corpus/lean_proofs.lean
255265

256266
# Z3 SMT specifications
257267
cp proofs/z3/cno_properties.smt2 tools/echidna/cno-corpus/
258268

259269
# Count theorems
260-
echo "Coq theorems:" $(grep -c "Theorem\|Lemma" proofs/coq/common/CNO.v)
261-
echo "Lean theorems:" $(grep -c "theorem\|lemma" proofs/lean4/CNO.lean)
270+
echo "Coq theorems:" $(grep -c "Theorem\|Lemma" archive/proofs/coq/common/CNO.v)
271+
echo "Lean theorems:" $(grep -c "theorem\|lemma" archive/proofs/lean4/CNO.lean)
262272
echo "Z3 assertions:" $(grep -c "assert.*theorem" proofs/z3/cno_properties.smt2)
263273
```
264274

@@ -340,7 +350,7 @@ echidna-repl:
340350
echidna-complete:
341351
@echo "Attempting to complete 21 Admitted proofs..."
342352
cd tools/echidna/neurosym && ./target/release/echidna complete \
343-
--proof-dir ../../proofs/coq \
353+
--proof-dir ../../archive/proofs/coq \
344354
--output-dir ../../proofs/coq-completed \
345355
--prover Coq \
346356
--max-tactics 50
@@ -359,7 +369,7 @@ Target: 21 Admitted → 0
359369
cd ~/Documents/hyperpolymath-repos/absolute-zero
360370

361371
# List all Admitted proofs
362-
grep -rn "Admitted" proofs/coq/ | tee admitted_list.txt
372+
grep -rn "Admitted" archive/proofs/coq/ | tee admitted_list.txt
363373

364374
# Use ECHIDNA to suggest completions
365375
just echidna-start
@@ -371,15 +381,15 @@ cat proofs/coq-completed/*.v
371381
# Manually verify and integrate
372382
for file in proofs/coq-completed/*.v; do
373383
echo "Reviewing: $file"
374-
diff proofs/coq/$(basename $file) $file
384+
diff archive/proofs/coq/$(basename $file) $file
375385
# If valid, replace
376386
done
377387
```
378388

379389
**Example ECHIDNA session:**
380390

381391
```coq
382-
echidna> load proofs/coq/physics/StatMech.v
392+
echidna> load archive/proofs/coq/physics/StatMech.v
383393
echidna> focus bennett_logical_implies_thermodynamic
384394
echidna> suggest
385395

@@ -418,7 +428,7 @@ cd ~/Documents/hyperpolymath-repos/absolute-zero
418428
just echidna-start
419429

420430
# Multi-prover verification
421-
for thm in $(grep "Theorem\|Lemma" proofs/coq/common/CNO.v | awk '{print $2}'); do
431+
for thm in $(grep "Theorem\|Lemma" archive/proofs/coq/common/CNO.v | awk '{print $2}'); do
422432
echo "Verifying $thm..."
423433

424434
# Translate to multiple formats
@@ -508,7 +518,7 @@ echidna_neurosym:
508518
# Verify all proofs with multi-prover consensus
509519
- cd ../../..
510520
- ./tools/echidna/neurosym/target/release/echidna verify-all \
511-
--proof-dir proofs/coq \
521+
--proof-dir archive/proofs/coq \
512522
--provers "Coq,Lean4,Z3" \
513523
--consensus 2 \
514524
--output echidna-report.json
@@ -574,7 +584,7 @@ chmod +x .git/hooks/pre-commit
574584
# Interactive REPL session
575585
just echidna-repl
576586

577-
echidna> load proofs/coq/physics/StatMech.v
587+
echidna> load archive/proofs/coq/physics/StatMech.v
578588
echidna> focus cno_logically_reversible
579589
echidna> suggest
580590
echidna> apply suggestion 1
@@ -604,14 +614,14 @@ cat verification_report.json | jq '.consensus'
604614
```bash
605615
# Translate Coq proof to Lean 4
606616
./tools/echidna/neurosym/target/release/echidna translate \
607-
--input proofs/coq/common/CNO.v \
617+
--input archive/proofs/coq/common/CNO.v \
608618
--from Coq \
609619
--to Lean4 \
610620
--output proofs/lean4/CNO_translated.lean
611621

612622
# Verify translation is equivalent
613623
./tools/echidna/neurosym/target/release/echidna diff \
614-
--proof1 proofs/coq/common/CNO.v \
624+
--proof1 archive/proofs/coq/common/CNO.v \
615625
--proof2 proofs/lean4/CNO_translated.lean
616626
```
617627

‎Justfile‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ default:
2121
build-all: build-agda build-idris
2222
@echo "✓ All builds complete"
2323

24+
# Register the pinned Agda standard library (v1.7.3) — same script CI runs.
25+
# Writes $AGDA_DIR/libraries and defaults (AGDA_DIR defaults to ~/.agda).
26+
provision-agda-stdlib:
27+
bash scripts/provision-agda-stdlib.sh
28+
2429
# Build Agda proofs (CNO + OND + EchoBridge, 4 modules, --safe --without-K)
2530
build-agda:
2631
@echo "Building Agda proofs..."

0 commit comments

Comments
 (0)