Skip to content

ArghDA → Flying Logic for provers/solvers: M0 (toolchain provisioning + doctor)#31

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/arghda-roadmap-planning-p5mu93
Jul 1, 2026
Merged

ArghDA → Flying Logic for provers/solvers: M0 (toolchain provisioning + doctor)#31
hyperpolymath merged 2 commits into
mainfrom
claude/arghda-roadmap-planning-p5mu93

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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.

Justfileprovision / 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


Generated by Claude Code

claude added 2 commits July 1, 2026 02:01
check-spdx.sh set the prose SPDX variable to MPL-2.0, which contradicted the
repo's own machine-readable declaration (licensing-policy.toml: prose =
CC-BY-SA-4.0) and the checker's own failure label. Every prose file already
carries CC-BY-SA-4.0, so the checker was failing `just license-check` on a
pristine tree. Point the variable at the declared policy and exclude the
canonical LICENSES/ REUSE texts (mirrored in licensing-policy.toml).

No licence header on any file is changed — this only corrects the enforcer to
accept the headers that are already present and declared.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT7
…doctor

Adds scripts/provision-provers.sh: an idempotent, version-pinned installer for
the prover/solver backends ArghDA drives, modelled on echo-types'
provision-agda.sh and widened to the full set. Tractable tier (installed by
default): agda 2.6.3 + stdlib v2.3 + the agda/cubical library, zig 0.15.2,
idris2 v0.7.0 (chez bootstrap), lean4 v4.13.0 (elan), and the SMT solvers z3 +
cvc5 1.2.0. Heavy tier behind --heavy (coq via opam, isabelle) and --mizar.

Honesty contract: a backend is only ever reported OK when its own --version
returned 0 in the run; anything else is MISSING/FAILED with the command tried.
Third-party sources are fetched as curl tarballs rather than `git clone`,
because this environment's proxy 403s git-relay access to non-scoped repos
(and tarballs are more portable anyway).

Justfile gains `provision` / `provision-heavy` / `doctor` recipes (the interim
doctor shells the script's --verify-only table until the `arghda doctor`
subcommand lands). STATE.a2ml records M0 and the Flying-Logic multi-prover
epic (M1–M11).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT7
@hyperpolymath
hyperpolymath marked this pull request as ready for review July 1, 2026 02:57
@hyperpolymath
hyperpolymath merged commit f3ff6f9 into main Jul 1, 2026
2 checks passed
@hyperpolymath
hyperpolymath deleted the claude/arghda-roadmap-planning-p5mu93 branch July 1, 2026 02:57
hyperpolymath added a commit that referenced this pull request Jul 1, 2026
## What & why

The keystone of the "Flying Logic for provers/solvers" epic. Every
Agda-baked seam now lives behind an object-safe `Backend` trait, so the
four-state workspace, DAG builder, content-hash invalidation and the
cycle-safe reachability walk become backend-neutral. Agda is the first
(v0.1 reference) impl; adding Idris2 / Lean4 / Z3 / CVC5 / Coq /
Isabelle / Mizar is now *an impl*, not a rewrite.

Follow-on from M0 (toolchain provisioning, merged as #31). #31 being
merged, this is a fresh PR on the same working branch.

## This is a pure refactor — the test suite is the oracle

Behaviour is unchanged, ground-truthed by running the tools (not
inferred):

- **`cargo test`** — the 64 pre-existing tests (50 lib + 14 integration)
all stay green; +2 new Agda-backend tests = **66 passing, 0 failed**.
- **`cargo clippy --all-targets --all-features -- -D warnings`** —
clean.
- **`cargo fmt --check`** — clean.
- **`scripts/check-spdx.sh .`** — `SPDX licence invariant: OK`.
- **Dogfood** — `arghda dag tests/fixtures/wellformed` emits
byte-compatible JSON (`version: "0.1"`, same nodes/edges); `arghda check
…/All.agda` ran a **real** Agda typecheck → `proven-eligible` (agda is
present from #31's provisioning).

## Changes

**New `src/prover/`:**
- `Backend` trait — `name` / `kind` / `extensions` / `safe_mode` /
`check_file` + the import-graph trio (`module_name_of` /
`module_to_path` / `direct_imports`) + `discover_roots` + `lint_rules`.
- `BackendKind { Assistant, Solver }` — the two interaction models
(typecheck-a-file vs SMT query).
- `Verdict { Proven, Refuted, Unknown, Admitted, Postulated, Error,
Unavailable }` — the common verdict both models map into. **Only
`Proven` is green; `Admitted`/`Postulated` are amber.**
- `Outcome` — superset of the old `AgdaOutcome` (raw process facts +
`kind` + `verdict`).

**Refactor:**
- `src/agda.rs` → `src/prover/agda.rs`. `Agda` is the first impl: owns
the `agda` shell-out, delegates parsing to `graph::` free fns and the
lint pack to `lint::`. Verdict is **exit-code-only** (0 → `Proven`,
ran-nonzero → `Error`, absent → `Unavailable`) — arghda never claims a
result Agda did not return; `Admitted`/`Postulated` stay lint-derived,
never manufactured from a green exit.
- `graph::build` and `dag::build` take `&dyn Backend` and use the
backend's extension filter + import parsing. **The cycle-safe
reachability walk and its `transitive_imports_terminates_on_a_cycle`
regression are untouched** — cycle safety is inherited free by every
backend.
- `main.rs` `scan`/`check`/`dag`/`resolve_roots_and_rules` route through
the backend; the `check` JSON key `agda` → `backend` (now carries `kind`
+ `verdict`).
- `STATE.a2ml` records M1 = 100%; `.gitignore` ignores `*.agdai`.

## Honesty note (owner directive + AGENTIC.a2ml)

The `Backend` module is the boundary where "never report a verdict the
tool did not emit" is enforced: `check_file` derives its verdict from
the actual exit code and degrades to `Unavailable` when the binary is
absent.

## Next (trait now stable → parallelisable)

M3 reasoning-graph (`src/reason`), M4 Idris2, M5 SMT (Z3/CVC5), M2
Cubical-Agda.

---
_Generated by [Claude
Code](https://claude.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT7)_

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants