Skip to content

Commit f3ff6f9

Browse files
ArghDA → Flying Logic for provers/solvers: M0 (toolchain provisioning + doctor) (#31)
## Context First increment of the epic to evolve `arghda-core` from an Agda-only proof-workspace engine into a **"Flying Logic for provers/solvers"** — a multi-backend, status-propagating reasoning-graph workspace (Agda-first, then Idris2, Lean4, Coq/Rocq, Isabelle, Cubical-Agda, Mizar, plus SMT solvers Z3/CVC5). The full plan phases the work M0→M11; this PR is **M0: reproducible, honest toolchain provisioning** — the fix for the recurring "guess a URL / get one wrong / nothing installs" pain. Guiding invariant throughout the epic: **never embed a prover, and never report a verdict a real run didn't produce.** ## What's in this PR **`scripts/provision-provers.sh`** — idempotent, version-pinned installer for all backends. Tractable tier installed by default; heavy tier (Coq via opam, Isabelle) behind `--heavy`; Mizar behind `--mizar`. Honesty contract baked in: a backend is reported `OK` only when its own `--version` returned 0 in the run; everything else prints as `MISSING`/`FAILED` with the command tried. Third-party sources are fetched as **curl tarballs, not `git clone`** — the environment's proxy 403s git-relay access to non-scoped repos, and tarballs are more portable anyway. **`Justfile`** — `provision` / `provision-heavy` / `doctor` recipes (interim `doctor` shells the script's `--verify-only` table until the `arghda doctor` Rust subcommand lands). **`scripts/check-spdx.sh` + `licensing-policy.toml`** — ⚠️ *licence-adjacent, flagged for review.* Fixes a pre-existing checker bug: the prose SPDX variable was `MPL-2.0`, contradicting the repo's own declared policy (`prose = CC-BY-SA-4.0`, which every prose file already carries) and the checker's own failure label. This was failing `just license-check` on a pristine tree. **No licence header on any file was changed** — only the enforcer, so it now accepts the already-present, already-declared headers; the canonical `LICENSES/` texts are excluded. One-line revert if you'd prefer to handle it differently. **`STATE.a2ml`** — records M0 and the M1–M11 milestone ladder. ## Verified in-container (real `--version` output) | Backend | Result | |---|---| | Agda | ✅ 2.6.3 (+ stdlib v2.3 + cubical library + `--cubical` flag) | | Zig | ✅ 0.15.2 | | Z3 | ✅ 4.8.12 | | CVC5 | ✅ 1.2.0 | | Lean 4 | ✅ 4.13.0 | | Idris2 | building via chez bootstrap (ABI-language priority) | | Coq/Rocq, Isabelle, Mizar | scripted behind `--heavy`/`--mizar`; not installed this session | `just check` passes (fmt + clippy `-D warnings` + SPDX + build + **64 tests, 0 failed**). ## Next (not in this PR) M1 — the keystone: introduce a `Backend` trait spanning two kinds (proof-assistant `Assistant` typecheck→exit-code; `Solver` SMT-LIB2→sat/unsat/unknown) with a common `Verdict` enum, move `agda.rs` behind it as a pure refactor (the 64 tests are the oracle), then M3's Flying-Logic reasoning graph (And/Or juncts + demote-only status propagation). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- _Generated by [Claude Code](https://claude.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT7)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent fe0abcf commit f3ff6f9

5 files changed

Lines changed: 338 additions & 7 deletions

File tree

.machine_readable/6a2/STATE.a2ml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[metadata]
77
project = "arghda-core"
88
version = "0.1.0"
9-
last-updated = "2026-06-20"
9+
last-updated = "2026-07-01"
1010
status = "active" # active | paused | archived
1111

1212
[project-context]
@@ -33,17 +33,50 @@ milestones = [
3333
{ name = "Groove service manifest (/.well-known/groove) for PanLL discovery", completion = 0 },
3434
]
3535

36+
# "Flying Logic for provers/solvers" epic (v0.2+): generalise the Agda-only
37+
# engine into a multi-backend reasoning-graph workspace. Two backend kinds:
38+
# proof-assistants (typecheck a file -> exit code) and solvers (SMT-LIB2 ->
39+
# sat/unsat/unknown). Backends shell out to real binaries; a node is only
40+
# "proven" on a real exit-0 (never embed a prover). See the plan doc.
41+
[route-to-flying-logic]
42+
milestones = [
43+
{ name = "M0: provision-provers.sh (pinned, honest --version verification) + `just provision/doctor` recipes", completion = 80 },
44+
{ name = "M1: Backend trait (Assistant|Solver kinds; Outcome/Verdict); agda.rs -> prover/agda.rs; graph/dag take &dyn Backend (pure refactor, 50 tests stay green)", completion = 0 },
45+
{ name = "M2: Cubical-Agda variant (Agda::cubical(), --cubical --safe island)", completion = 0 },
46+
{ name = "M3: Flying-Logic reasoning graph (src/reason: And|Or juncts, demote-only cycle-safe Verdict propagation, additive studio JSON)", completion = 0 },
47+
{ name = "M4: Idris2 adapter (core/ABI language: .ipkg/--check/totality; escape-hatches)", completion = 0 },
48+
{ name = "M5: SMT solver backends (Z3, CVC5): SMT-LIB2 -> sat/unsat/unknown -> Verdict", completion = 0 },
49+
{ name = "M6: Lean4 adapter (lake build + #print axioms audit)", completion = 0 },
50+
{ name = "M7: Echidna dispatch seam (optional route to orchestrator :8090, same Outcome)", completion = 0 },
51+
{ name = "M8: Coq/Rocq adapter (--heavy provisioning; Section-aware postulate classifier)", completion = 0 },
52+
{ name = "M9: Isabelle adapter (--heavy; dogfood tropical-resource-typing .thy)", completion = 0 },
53+
{ name = "M10: Mizar adapter (detect-only first; highest uncertainty)", completion = 0 },
54+
{ name = "M11: studio JSON freeze (reason/0.1) + Groove manifest", completion = 0 },
55+
]
56+
# M0 provisioning verified in-container 2026-07-01: agda 2.6.3 (+stdlib v2.3
57+
# +cubical lib), zig 0.15.2, z3 4.8.12, cvc5 1.2.0, lean 4.13.0 all report
58+
# real --version. idris2 v0.7.0 builds via chez bootstrap. Coq/Isabelle/Mizar
59+
# are scripted (behind --heavy/--mizar) but not installed this session.
60+
# Remaining M0: `arghda doctor` Rust subcommand (interim: `just doctor` shells
61+
# the script's --verify-only table).
62+
3663
[blockers-and-issues]
3764
# No active blockers. v0.1 lint set + DAG schema (arghda-spec.adoc) are
3865
# complete. The SPDX licence invariant is applied and enforced
3966
# (scripts/check-spdx.sh; .machine_readable/licensing-policy.toml).
67+
# 2026-07-01: fixed a pre-existing checker bug — check-spdx.sh's prose variable
68+
# was set to MPL-2.0, contradicting the declared policy (prose = CC-BY-SA-4.0 in
69+
# licensing-policy.toml) and the checker's own failure label; it now matches
70+
# the declaration. NO licence header on any file changed; the LICENSES/ REUSE
71+
# dir is now excluded (canonical texts). This was blocking `just license-check`.
4072

4173
[critical-next-actions]
4274
actions = [
43-
"Template-applicability: rsr-profile.a2ml declares capabilities (landed); estate policy + gate model + reference checker landed in hyperpolymath/standards#391 + #392 (pure capability-gating). Follow-up: wire the standards rsr-profile check into CI.",
44-
"Transitive-import closure hashing landed (workspace [proven] include_root); follow-up: also expose it as a --include-root CLI flag on promote/stale.",
45-
"Serve /.well-known/groove for PanLL discovery (Groove protocol)",
46-
"Scaffold arghda-studio (AffineScript visual layer consuming the dag JSON)",
75+
"Flying-Logic epic M1: introduce the Backend trait (Assistant|Solver) and move agda.rs to prover/agda.rs as a PURE REFACTOR — the 50 existing tests are the oracle, they must stay green with no behaviour change. This is the keystone everything else rides on.",
76+
"Flying-Logic epic M3: src/reason reasoning graph (And|Or juncts + demote-only cycle-safe Verdict propagation) — independent of new backends, lands the headline capability early.",
77+
"Finish M0: add the `arghda doctor` Rust subcommand and repoint `just doctor` at it (interim shells provision-provers.sh --verify-only).",
78+
"Transitive-import closure hashing landed; follow-up: expose it as a --include-root CLI flag on promote/stale.",
79+
"Serve /.well-known/groove for PanLL discovery (Groove protocol) — folds into M11.",
4780
]
4881

4982
[maintenance-status]

.machine_readable/licensing-policy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ prose = "CC-BY-SA-4.0" # *.adoc, *.md narrative
2222
paths = [
2323
"Cargo.lock", # generated by cargo; enumerates third-party dependencies
2424
"LICENSE", # the MPL-2.0 licence text itself
25+
"LICENSES/", # canonical SPDX licence texts (REUSE dir: MPL-2.0 + CC-BY-SA-4.0)
2526
"target/", # cargo build output (gitignored)
2627
"tests/fixtures/", # Agda test-input data (some deliberately malformed)
2728
]

Justfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,22 @@ dag path:
5555
agda-check file:
5656
cargo run -- check "{{file}}"
5757

58+
# Provision the prover/solver toolchains ArghDA drives (tractable set:
59+
# agda+cubical, zig, idris2, lean4, z3, cvc5). Honest: a backend is reported
60+
# OK only if its own --version actually returned 0 in the run.
61+
provision:
62+
bash scripts/provision-provers.sh
63+
64+
# As `provision`, plus the heavy backends (Coq via opam, Isabelle ~4 GB).
65+
provision-heavy:
66+
bash scripts/provision-provers.sh --heavy
67+
68+
# Report which prover/solver backends are actually runnable, no installs.
69+
# (Interim: shells the provision script's --verify-only table until the
70+
# `arghda doctor` subcommand lands.)
71+
doctor:
72+
bash scripts/provision-provers.sh --verify-only
73+
5874
# RSR: the mandated machine-readable artefacts are present and well-formed.
5975
validate-rsr:
6076
@for f in STATE META ECOSYSTEM AGENTIC NEUROSYM PLAYBOOK; do \

scripts/check-spdx.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Licence invariant for arghda-core (enforced by `just check` + Rust CI).
66
#
77
# code / config / scripts / state -> SPDX-License-Identifier: MPL-2.0
8-
# prose documentation (*.adoc, *.md) -> SPDX-License-Identifier: MPL-2.0
8+
# prose documentation (*.adoc, *.md) -> SPDX-License-Identifier: CC-BY-SA-4.0
99
#
1010
# Files that are NOT ours, generated, or test-input data are EXCLUDED and must
1111
# never carry the repo's licence choices. The machine-readable declaration of
@@ -20,13 +20,14 @@ set -euo pipefail
2020
cd "$(git rev-parse --show-toplevel)"
2121

2222
MPL='SPDX-License-Identifier: MPL-2.0'
23-
CC='SPDX-License-Identifier: MPL-2.0'
23+
CC='SPDX-License-Identifier: CC-BY-SA-4.0'
2424
fail=0
2525

2626
# Not ours / generated / test-input data — see [excluded] in the policy file.
2727
excluded() {
2828
case "$1" in
2929
Cargo.lock | LICENSE) return 0 ;; # generated lockfile / the licence text itself
30+
LICENSES/*) return 0 ;; # canonical SPDX licence texts (REUSE dir)
3031
target/* | tests/fixtures/*) return 0 ;; # build output / Agda test-input data
3132
*) return 1 ;;
3233
esac

0 commit comments

Comments
 (0)