Skip to content

ArghDA M2: Cubical-Agda backend — the flag-profile island - #36

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

ArghDA M2: Cubical-Agda backend — the flag-profile island#36
hyperpolymath merged 1 commit into
mainfrom
claude/arghda-roadmap-planning-p5mu93

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What & why

Cubical Agda (--cubical --safe, not --without-K) as a distinct backend, agda-cubical. That completes the Agda family and the fifth backend overall.

Design note: implemented as a separate AgdaCubical type rather than the plan's Agda::cubical() constructor. A distinct type expresses the island better — a --cubical --safe file and a --safe --without-K file cannot import each other; Agda enforces this at typecheck and arghda surfaces the resulting Error honestly rather than pretending the edge is sound — and it avoids churning ~19 Agda value-uses across the tree.

Changes

  • src/prover/agda.rsAgdaCubical shares invoke_agda() (now adds --cubical) and all graph methods with Agda; differs only in name, safe_mode (--cubical --safe), and lint pack.
  • src/lint/safe_pragma.rsSafePragma is now parameterised by required OPTIONS flags: standard() = [--safe, --without-K], cubical() = [--cubical, --safe]. A cubical file no longer trips a spurious "missing --without-K" (which would be wrong — cubical is incompatible with it), and a standard file is still flagged if it lacks either.
  • src/lint/mod.rsagda_cubical_rules() swaps in the cubical pragma; the rest of the pack is shared via a private agda_pack().
  • src/main.rs--backend agda-cubical wired; about/help updated.

Verified (ran, not inferred)

  • cargo test107 passing, 0 failed (79 lib + 28 integration; +3 safe_pragma unit covering the standard/cubical split, +1 cubical-identity unit, +3 cubical integration).
  • cargo clippy -D warnings clean · cargo fmt --check clean · check-spdx.sh OK.
  • Dogfooded real agda: check --backend agda-cubical on a --cubical --safe file → proven-eligible; the standard agda backend on the same file → rejected (missing-safe-pragma: missing --without-K). The island distinction demonstrated end-to-end.

Milestone status

Five backends live across both interaction models: agda, agda-cubical, idris2 (Assistant); z3, cvc5 (Solver). Next: finish M0 (arghda doctor), then M6 (Lean4) / M11 (studio JSON + Groove).


Generated by Claude Code

Cubical Agda (`--cubical --safe`, NOT `--without-K`) as a distinct backend,
`agda-cubical`. Implemented as a separate `AgdaCubical` type rather than the
plan's `Agda::cubical()` constructor — a distinct type expresses the island
better (a `--cubical --safe` file and a `--safe --without-K` file cannot
import each other; Agda enforces this at typecheck and arghda surfaces the
resulting Error honestly) and avoids churning ~19 `Agda` value-uses.

- `src/prover/agda.rs` — `AgdaCubical` shares `invoke_agda()` (which now adds
  `--cubical`) and all the graph methods with `Agda`; it differs only in
  name, `safe_mode` (`--cubical --safe`), and lint pack.
- `src/lint/safe_pragma.rs` — `SafePragma` is now parameterised by the
  required OPTIONS flags: `standard()` = `[--safe, --without-K]`, `cubical()`
  = `[--cubical, --safe]`. A cubical file no longer trips a spurious
  "missing --without-K" (which would be wrong — cubical is incompatible with
  it), and a standard file is still flagged if it lacks either.
- `src/lint/mod.rs` — `agda_cubical_rules()` swaps in the cubical pragma; the
  rest of the pack is shared via a private `agda_pack()`.
- `src/main.rs` — `--backend agda-cubical` wired; `about`/help updated.

## Verified (ran, not inferred)

- `cargo test` → 107 passing, 0 failed (79 lib + 28 integration; +3
  safe_pragma unit covering the standard/cubical profile split, +1
  cubical-identity unit, +3 cubical integration).
- clippy -D warnings, fmt, SPDX clean.
- Dogfooded REAL agda: `check --backend agda-cubical` on a `--cubical --safe`
  file → proven-eligible; the standard `agda` backend on the SAME file →
  rejected (`missing-safe-pragma: missing --without-K`). The island
  distinction is demonstrated end-to-end.
- STATE.a2ml records M2 = 100%. Five backends now live across both
  interaction models.

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