Skip to content

Commit b7c780f

Browse files
arena-ai-coding-agent[bot]hyperpolymatharena-agent
authored
fix: resolve repository issues, port Lean FilesystemCNO, and unify Coq tags (#174)
## Summary Comprehensive remediation of repository issues, estate governance alignments, formal verification debt, and downstream system connections. ### Key Remediations 1. **Issue #171 (Coq Axiom Tags & Census):** - Unified tag grammar across all declarations in Coq: `(* AXIOM: [METAL-BOUNDARY] ... *)` and `(* AXIOM: [CLASS-A] ... *)`. - Created `proofs/coq/check-axiom-tags.sh` (bash/awk) with `--control` mode to gate Coq axiom tags in CI. - Created `proofs/coq/census-assumptions.sh` generating the machine-checked 182-theorem census (109 closed under global context, 73 axiom-dependent). - Deleted two dead/unsound declarations (`prob_nonneg` and `prob_normalized`) from `proofs/coq/common/StatMechBasis.v` (zero theorems depended on either). - Updated `PROOF-STATUS.adoc` to cite the census and tag grammar. 2. **Issue #170 (Scorecard Alerts):** - Fixed alerts 510 and 509 by scoping `packages: write` and `security-events: write` exclusively to the jobs requiring them in `.github/workflows/publish-container.yml` and `.github/workflows/hypatia-scan.yml`. - Workflows now run with least-privilege `permissions: contents: read` at the workflow level. 3. **Issue #167 (Lean FilesystemCNO Port):** - Ported the Coq concrete filesystem model to Lean 4 in `proofs/lean4/FilesystemCNO.lean`. - Discharged all 21 former axioms (`mkdir`, `rmdir`, `create`, `unlink`, `readFile`, `writeFile`, `stat`, `chmod`, `chown`, `rename`, `snapshot`, `restore`, `mkdir_rmdir_inverse`, `create_unlink_inverse`, `read_write_identity`, `chmod_identity`, `rename_identity`, `rename_inverse`, `snapshot_restore_identity`, `mkdir_not_identity`, `mkdir_idempotent`) to concrete executable definitions and proved theorems. - `unconditional_mkdir_rmdir_inverse_is_false` remains a proved theorem with 0 axioms. - Updated `proofs/lean4/AxiomAudit.lean` §D to verify that all `FilesystemCNO` theorems depend on zero axioms. - Updated `PROOF-STATUS.adoc` and `docs/proof-debt.adoc`. 4. **Issue #166 (Asciidoctor Pipe Rendering Defect & y_not_cno Stale Row):** - Escaped `\|0⟩` ket notation inside table cells in `docs/proof-debt.adoc`. - Created `scripts/check-adoc-tables.sh` (bash/awk PSV parser) with mutant validation. - Corrected triage citation and line reference for `Axiom y_not_cno` in `proofs/coq/lambda/LambdaCNO.v`. 5. **Issue #162 (EchoBridgeCNO.agda):** - Corrected naming to `EchoBridgeCNO.agda` across `README.adoc`, `EXPLAINME.adoc`, and `proofs/agda/README.adoc`. 6. **Issue #161 (Proofs Gate Orchestration):** - Removed the narrow `paths:` filter on push to main in `.github/workflows/proofs.yml`. - Added `SKIP_ISABELLE` and `SKIP_MIZAR` flags in `proofs/verify-all-provers.sh`. - Updated `proofs/tests/gate-selftest.sh` with test cases for skip flags and tag checker. 7. **Hygiene & Governance Issues (#75, #76, #77, #78, #79, #80, #81):** - #75: Verified removal of dead `build-rescript` recipe from `Justfile`. - #76: Synchronized `.machine_readable/contractiles/Justfile` with root `Justfile`. - #77: Pruned deleted file references from `.hypatia-ignore`. - #78: Removed orphaned `.machine_readable/svc/` directory and folded ADR-001 note into `.machine_readable/self-validating/README.adoc`. - #79: Consolidated `docs/MAINTAINERS.adoc` to link canonically to root `MAINTAINERS.adoc`. - #80: Added `scripts/wiki-sync.sh`, `just wiki-sync` recipe, and `.github/workflows/wiki-sync.yml` workflow (tested and synced). - #81: Verified and re-affirmed `Bustfile.a2ml` runner status (`enabled = false`). 8. **Wider Estate Connections:** - Added `docs/ECOSYSTEM-CONNECTIONS.adoc` detailing connections to JanusKey, Echo Types, Typell, Robodog Defensive Systems Lab, and Robot Vacuum Cleaner. - Updated `.machine_readable/descriptiles/ECOSYSTEM.a2ml` and `README.adoc`. Co-authored-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
1 parent 3e959cb commit b7c780f

31 files changed

Lines changed: 1119 additions & 462 deletions

‎.github/workflows/hypatia-scan.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
permissions:
25-
actions: read
2625
contents: read
27-
pull-requests: write
28-
security-events: write
2926

3027
jobs:
3128
hypatia:
29+
permissions:
30+
actions: read
31+
contents: read
32+
pull-requests: write
33+
security-events: write
3234
uses: hyperpolymath/standards/.github/workflows/hypatia-scan-reusable.yml@bd0df9ead7faf0cdfe0e13e7966d91e28d0101d4
3335
secrets: inherit

‎.github/workflows/proofs.yml‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@ name: Proofs
2323
on:
2424
push:
2525
branches: [main, master]
26-
paths:
27-
- 'proofs/**'
28-
- 'absolute-zero-abi.ipkg'
29-
- '.github/workflows/proofs.yml'
3026
pull_request:
3127
paths:
3228
- 'proofs/**'
3329
- 'absolute-zero-abi.ipkg'
3430
- '.github/workflows/proofs.yml'
31+
- 'Justfile'
32+
- '*.agda-lib'
33+
- 'lakefile*'
3534

3635
permissions:
3736
contents: read
@@ -61,6 +60,15 @@ jobs:
6160
run: |
6261
bash check-assumptions.sh
6362
bash check-assumptions.sh --control
63+
- name: Axiom tag grammar gate + control (issue #171)
64+
working-directory: proofs/coq
65+
run: |
66+
bash check-axiom-tags.sh
67+
bash check-axiom-tags.sh --control
68+
- name: Axiom dependency census (issue #171)
69+
working-directory: proofs/coq
70+
run: |
71+
bash census-assumptions.sh
6472
6573
agda:
6674
name: Agda — CNO + OND

‎.github/workflows/publish-container.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111

1212
permissions:
1313
contents: read
14-
packages: write
1514

1615
jobs:
1716
publish:

‎.github/workflows/wiki-sync.yml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
name: Wiki Sync
3+
4+
on:
5+
push:
6+
branches: [main, master]
7+
paths:
8+
- 'docs/wiki/**'
9+
- 'scripts/wiki-sync.sh'
10+
- '.github/workflows/wiki-sync.yml'
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: write
15+
16+
concurrency:
17+
group: wiki-sync
18+
cancel-in-progress: true
19+
20+
jobs:
21+
sync:
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 10
24+
steps:
25+
- uses: actions/checkout@v7.0.1
26+
- name: Sync docs/wiki to GitHub Wiki
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
run: bash scripts/wiki-sync.sh

‎.hypatia-ignore‎

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,7 @@
11
# SPDX-License-Identifier: MPL-2.0
22
#
33
# Estate-policy exemptions for the absolute-zero language-demonstration
4-
# repo. This repo intentionally ships example files in many banned and
5-
# allowed languages — it is the canonical "what NOT to use, here is what
6-
# you'd get" exemplar. Each entry below is a language-demo file under
7-
# `examples/` or a one-off interpreter implementation, not load-bearing
8-
# code.
4+
# repo. This repo intentionally ships example files in many languages —
5+
# it is the canonical cross-language nop-semantics study.
96
#
10-
# After standards#180 (file_pattern glob support in in_baseline()) merges,
11-
# this whole file collapses to a single `examples/**` file_pattern entry
12-
# in .hypatia-baseline.json. Tracked in the standards repo as a follow-up.
13-
14-
# ReScript demonstration files (banned 2026-04-30 — kept as historical
15-
# examples until the .res→.affine migration ships).
16-
cicd_rules/banned_language_file:src/AuditTrail.res
17-
cicd_rules/banned_language_file:interpreters/rescript/malbolgeInterpreter.res
18-
cicd_rules/banned_language_file:examples/SafeDOMExample.res
19-
20-
# Banned-language example files used to demonstrate the cross-language
21-
# nop-semantics study. None are imported into the toolchain build.
22-
cicd_rules/banned_language_file:examples/go/nop.go
23-
cicd_rules/banned_language_file:examples/java/Nop.java
24-
cicd_rules/banned_language_file:examples/java/BalancedOps.java
25-
cicd_rules/banned_language_file:examples/kotlin/Nop.kt
26-
cicd_rules/banned_language_file:examples/kotlin/BalancedOps.kt
27-
cicd_rules/banned_language_file:examples/swift/Nop.swift
7+
# Stale ReScript and removed example paths were pruned per issue #77.

‎.machine_readable/contractiles/Justfile‎

Lines changed: 66 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,53 @@ default:
1414
# Build Commands
1515
# ============================================================================
1616

17-
# Build everything
18-
build-all: build-affinescript build-coq build-lean build-agda build-isabelle build-typescript
17+
# Build everything (all six prover backends + the Idris ABI)
18+
build-all: build-coq build-lean build-agda build-isabelle build-mizar build-idris
1919
@echo "✓ All builds complete"
2020

2121
# Build AffineScript interpreters
2222
build-affinescript:
2323
@echo "Building AffineScript interpreters..."
2424
cd interpreters/affinescript && npx affinescript build
2525

26-
# Build Coq proofs
26+
# Build Coq proofs — all 14 theories (CNO + OND pillars) via coq_makefile
2727
build-coq:
28-
@echo "Building Coq proofs..."
28+
@echo "Building Coq proofs (14 theories, both pillars)..."
2929
@if command -v coqc >/dev/null 2>&1; then \
30-
cd proofs/coq/common && coqc CNO.v && \
31-
cd ../physics && coqc -R ../common CNO StatMech.v && \
32-
coqc -R ../common CNO LandauerDerivation.v && \
33-
cd ../quantum && coqc -R ../common CNO QuantumMechanicsExact.v && \
34-
cd ../malbolge && coqc -R ../common CNO MalbolgeCore.v && \
35-
echo "✓ Coq proofs compiled"; \
30+
cd proofs/coq && coq_makefile -f _CoqProject -o Makefile.all >/dev/null && \
31+
make -f Makefile.all -j"$(nproc)" && \
32+
echo "✓ Coq proofs compiled (CNO + OND)"; \
3633
else \
3734
echo "⚠ coqc not found, skipping Coq build"; \
3835
fi
3936

40-
# Build Lean 4 proofs
37+
# Build Lean 4 proofs (CNO libs + OND; needs Mathlib cache)
4138
build-lean:
4239
@echo "Building Lean 4 proofs..."
4340
cd proofs/lean4 && lake build
4441

45-
# Build Agda proofs
42+
# Build Agda proofs (CNO + OND + EchoBridge, 4 modules, --safe --without-K)
4643
build-agda:
4744
@echo "Building Agda proofs..."
48-
cd proofs/agda && agda CNO.agda
45+
cd proofs/agda && agda --safe --without-K CNO.agda && agda --safe --without-K OND.agda && agda --safe --without-K EchoBridgeScaffold.agda && agda --safe --without-K EchoBridgeCNO.agda
4946

50-
# Build Isabelle/HOL proofs
47+
# Build Isabelle/HOL proofs (CNO + OND session)
5148
build-isabelle:
5249
@echo "Building Isabelle/HOL proofs..."
53-
isabelle build -D proofs/isabelle
50+
isabelle build -d proofs/isabelle AbsoluteZero-CNO
51+
52+
# Build Mizar article (needs MIZFILES + proofs/mizar/dict/cno.voc)
53+
build-mizar:
54+
@echo "Building Mizar CNO article..."
55+
@if command -v verifier >/dev/null 2>&1; then \
56+
cd proofs/mizar && accom CNO && verifier CNO && \
57+
{ test -s CNO.err && { echo "✗ Mizar errors (CNO.err)"; exit 1; } || echo "✓ Mizar verified"; }; \
58+
else echo "⚠ mizar verifier not found, skipping"; fi
59+
60+
# Build the Idris 2 ABI package
61+
build-idris:
62+
@echo "Building Idris 2 ABI..."
63+
idris2 --build absolute-zero-abi.ipkg
5464

5565
# Build TypeScript
5666
build-typescript:
@@ -62,28 +72,41 @@ build-typescript:
6272
# Verification Commands
6373
# ============================================================================
6474

65-
# Verify all proofs
66-
verify-all: verify-coq verify-z3 verify-lean verify-agda verify-isabelle
75+
# Verify BOTH pillars across ALL six provers + the Idris ABI (canonical gate).
76+
# Single source of truth; prints ALL-PROVERS-GREEN on success.
77+
verify:
78+
@proofs/verify-all-provers.sh
79+
80+
# Verify all proofs (per-prover targets; `just verify` is the canonical one-shot)
81+
verify-all: verify-coq verify-z3 verify-lean verify-agda verify-isabelle verify-mizar verify-idris verify-gate-selftest
6782
@echo "✓ All verifications complete"
6883

69-
# Verify Coq proofs
84+
# Verify Coq proofs: build, then the Print Assumptions gate and its control
7085
verify-coq: build-coq
71-
@echo "✓ Coq proofs verified"
72-
73-
# Verify Z3 SMT properties
86+
bash proofs/coq/check-assumptions.sh
87+
bash proofs/coq/check-assumptions.sh --control
88+
bash proofs/coq/check-axiom-tags.sh
89+
bash proofs/coq/check-axiom-tags.sh --control
90+
bash proofs/coq/census-assumptions.sh
91+
@echo "✓ Coq proofs verified (17 named theorems closed, tags verified, census generated)"
92+
93+
# Verify Z3 SMT properties: every (check-sat) verdict must match its `; expect` annotation (no skip-as-pass)
7494
verify-z3:
7595
@echo "Verifying Z3 SMT properties..."
76-
@if command -v z3 >/dev/null 2>&1; then \
77-
z3 proofs/z3/cno_properties.smt2 && echo "✓ Z3 verification complete"; \
78-
else \
79-
echo "⚠ z3 not found, skipping Z3 verification"; \
80-
fi
96+
@command -v z3 >/dev/null 2>&1 || { echo "✗ z3 not found (required, not skipped)"; exit 1; }
97+
bash proofs/z3/verify.sh
98+
@echo "✓ Z3 verification complete"
8199

82100
# Verify Lean 4 proofs
83101
verify-lean:
84102
@echo "Verifying Lean 4 proofs..."
85103
cd proofs/lean4 && lake build
86104

105+
# Verify the Mathlib-free Lean core + axiom audit (what the CI `lean` job runs; no Mathlib needed)
106+
verify-lean-core:
107+
@echo "Verifying Lean 4 core (6 modules + AxiomAudit.lean)..."
108+
bash proofs/lean4/check-core.sh
109+
87110
# Verify Agda proofs
88111
verify-agda: build-agda
89112
@echo "✓ Agda proofs verified"
@@ -92,6 +115,18 @@ verify-agda: build-agda
92115
verify-isabelle: build-isabelle
93116
@echo "✓ Isabelle/HOL proofs verified"
94117

118+
# Verify the Mizar CNO article
119+
verify-mizar: build-mizar
120+
@echo "✓ Mizar proofs verified"
121+
122+
# Self-test the prover gate: stubbed toolchains + z3 mutants must turn it red
123+
verify-gate-selftest:
124+
bash proofs/tests/gate-selftest.sh
125+
126+
# Verify the Idris 2 ABI package
127+
verify-idris: build-idris
128+
@echo "✓ Idris ABI verified"
129+
95130
# ============================================================================
96131
# Testing Commands
97132
# ============================================================================
@@ -155,6 +190,11 @@ view-docs:
155190
@echo "Documentation files:"
156191
@ls -lh docs/
157192

193+
# Sync docs/wiki to GitHub Wiki repository (issue #80)
194+
wiki-sync:
195+
@echo "Syncing docs/wiki to GitHub wiki..."
196+
bash scripts/wiki-sync.sh
197+
158198
# ============================================================================
159199
# Cleanup
160200
# ============================================================================

‎.machine_readable/descriptiles/ECOSYSTEM.a2ml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ projects = [
3636
{ name = "echidnabot", relationship = "potential-consumer", notes = "GitHub bot; could automate CNO checks in PRs" },
3737
{ name = "valence-shell", relationship = "integration-target", notes = "Filesystem ops library proven in FilesystemCNO.v" },
3838
{ name = "rsr-template-repo", relationship = "infrastructure", notes = "Repository standards template" },
39+
{ name = "januskey", relationship = "downstream-consumer", notes = "Reversible file operations CLI formally verified by FilesystemCNO" },
40+
{ name = "echo-types", relationship = "bridge-target", notes = "EchoBridgeCNO.agda connects CNO zero-loss boundary with proof-relevant fibers" },
41+
{ name = "typell", relationship = "theory-consumer", notes = "Category-theoretic query verification via CNOCategory" },
42+
{ name = "robodog-defensive-systems-lab", relationship = "application-domain", notes = "Reversible defensive maneuvers (CNO) and side-channel non-disclosure (OND)" },
43+
{ name = "robot-vacuum-cleaner", relationship = "application-domain", notes = "Transactional SLAM map rollback (CNO) and privacy telemetry boundaries (OND)" },
3944
]
4045

4146
[what-this-is]

‎.machine_readable/self-validating/README.adoc‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
K9 contractiles are self-validating components that combine configuration, validation, and deployment logic in a single file format. They implement the RSR principle of "self-describing artifacts" by embedding contracts and orchestration directly in the component.
1010

11+
== Architectural Decision Note
12+
13+
Per **ADR-001 (2026-04-18)**, self-validating K9 components live here (`self-validating/`) rather than under
14+
`contractiles/` so the contractile directory remains a pure six-verb set
15+
(intend, trust, must, bust, adjust, dust). Formerly housed in `.machine_readable/svc/` prior to the
16+
self-validating rename.
17+
1118
== The Three Security Levels
1219

1320
K9 components declare their trust requirements using "The Leash" security model:

‎.machine_readable/svc/README.adoc‎

Lines changed: 0 additions & 18 deletions
This file was deleted.

‎EXPLAINME.adoc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ This is a standard result. The practical consequence is that the verified CNOs i
8585

8686
| Coq CNO/OND formalisation
8787
| `proofs/coq/`
88-
| link:https://github.com/hyperpolymath/echo-types[echo-types] (EchoCNOBridge)
88+
| link:https://github.com/hyperpolymath/echo-types[echo-types] (EchoBridgeCNO)
8989

9090
| Multi-prover pattern
9191
| Six provers + Idris ABI

0 commit comments

Comments
 (0)