Skip to content

ArghDA M4: Idris2 backend + --backend selector — genuinely multi-backend#34

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

ArghDA M4: Idris2 backend + --backend selector — genuinely multi-backend#34
hyperpolymath merged 1 commit into
mainfrom
claude/arghda-roadmap-planning-p5mu93

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What & why

The second backend, on the M1 trait — arghda now drives two provers, chosen at the CLI with --backend agda|idris2. Idris2 is a core estate language (it owns ABIs — the Idris2-ABI / Zig-FFI pattern), so it's first-class, not merely a prover.

Changes

  • src/prover/idris2.rsIdris2 impl: idris2 --check --source-dir <root> <file> (the -i include-root analog, ground-truthed against Idris2 0.7.0), exit-code-only verdict (0→Proven, ran-nonzero→Error, absent→Unavailable). Dotted module names reuse graph::module_name_of; .idr module_to_path; an Idris2 import parser (import [public] Mod [as Alias], top-level — no open); Main.idr root discovery.
  • src/lint/idris2.rsIdris2EscapeHatch flags believe_me/assert_total/assert_smaller/idris_crash + %default partial. Deliberately named escape-hatch so it reuses the reasoning-graph's amber cap — a believe_me is treated identically across Agda and Idris2.
  • src/main.rs — new --backend agda|idris2 on scan/check/dag/reason via backend_for(); unknown backend errors cleanly. (Wire first — the backend is reachable, not just present.) CLI about now reflects multi-backend.

Verified (ran, not inferred)

  • cargo test93 passing, 0 failed (70 lib + 23 integration; +9 Idris2 unit: backend identity, .idr path mapping, import parser incl. public/alias, check_file honesty, escape-hatch rule; +3 Idris2 integration). The graph/dag/reason tests are hermetic — text parsing only, no binary needed, so CI is unaffected by whether idris2 is installed.
  • cargo clippy -D warnings clean · cargo fmt --check clean · check-spdx.sh OK.
  • Dogfooded with real idris2 0.7.0 on PATH:
    • arghda check --backend idris2 …/Main.idr → real typecheck → proven-eligible
    • arghda reason --backend idris2 --check → live typechecks each node → Main cone proven+wired, Orphan proven-but-wired=false (the honest wired-vs-sound distinction working)
    • --backend lean4Error: unknown backend lean4 (known: agda, idris2)

Honest scope

M4 = ~90%. The documented follow-on 10%: .ipkg-declared roots (currently Main.idr discovery) and totality-hole (?name) + per-def partial lint. build/ idris2 output is gitignored.

Next

M5 SMT solvers (Z3/CVC5) — the first Solver-kind backend, exercising the other half of the taxonomy · M2 Cubical-Agda.


Generated by Claude Code

The second backend, on the M1 trait. arghda now drives two provers, chosen
at the CLI with `--backend agda|idris2`.

Idris2 is a core estate language (it owns ABIs — the Idris2-ABI / Zig-FFI
pattern), so it's a first-class backend, not merely a prover.

- `src/prover/idris2.rs` — `Idris2` impl: `idris2 --check --source-dir <root>
  <file>` (the `-i` analog, ground-truthed against Idris2 0.7.0), exit-code
  -only verdict (0→Proven, ran-nonzero→Error, absent→Unavailable). Dotted
  module names reuse `graph::module_name_of`; `.idr` `module_to_path`; an
  Idris2 import parser (`import [public] Mod [as Alias]`, top-level — no
  `open`); `Main.idr` root discovery.
- `src/lint/idris2.rs` — `Idris2EscapeHatch` flags `believe_me`/
  `assert_total`/`assert_smaller`/`idris_crash` + `%default partial`. Named
  `escape-hatch` on purpose so it reuses the reasoning-graph's amber cap —
  a `believe_me` is treated identically across backends.
- `src/main.rs` — new `--backend agda|idris2` on scan/check/dag/reason via
  `backend_for()`; unknown backend errors cleanly. (Wire first — the backend
  is reachable, not just present.)
- CLI `about` now reflects multi-backend (Agda, Idris2).
- Tests: +9 unit (backend identity, `.idr` path mapping, import parser incl.
  public/alias, check_file honesty; escape-hatch rule) +3 integration (the
  graph/dag/reason path is hermetic — text parsing, no binary needed). Suite
  93 green; clippy -D warnings, fmt, SPDX clean.
- Dogfooded with REAL idris2 on PATH: `check --backend idris2` →
  proven-eligible; `reason --backend idris2 --check` → live typechecks, Main
  cone proven+wired, Orphan proven-but-unwired (the honest wired-vs-sound
  distinction).
- STATE.a2ml records M4 = 90% (.ipkg roots + totality-hole lint are the
  documented follow-on 10%).

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 08:38
@hyperpolymath
hyperpolymath merged commit 315464b into main Jul 1, 2026
2 checks passed
@hyperpolymath
hyperpolymath deleted the claude/arghda-roadmap-planning-p5mu93 branch July 1, 2026 08:38
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