Skip to content

ArghDA M4 follow-on: Idris2 .ipkg-declared roots#41

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

ArghDA M4 follow-on: Idris2 .ipkg-declared roots#41
hyperpolymath merged 1 commit into
mainfrom
claude/arghda-roadmap-planning-p5mu93

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

First of the refinement follow-ons. Also the live confirmation that the code-scanning fix (codeql.yml, merged in #40) works — this PR should pass the Code Scanning gate and be auto-mergeable without a manual bootstrap.

What

Idris2 discover_roots now unions two conventions:

  1. .ipkg main = <Module> — the package's executable entry, resolved to its .idr file (honouring an optional quoted sourcedir; -- comments stripped; first existing candidate base wins). The entry needn't be literally Main.idr — e.g. main = App finds App.idr.
  2. Any Main.idr — the bare-tree fallback (unchanged).

ipkg_main_roots() parses the .ipkg key = value fields (only main and sourcedir/source-dir consulted) and resolves each main module against candidate source roots.

Verified (ran, not inferred)

  • cargo test127 passing, 0 failed (+1 integration: main = App discovered + its cone wired; +2 unit: sourcedir/comment resolution; no-resolvable-main → empty).
  • clippy -D warnings, fmt, SPDX clean.
  • Dogfooded: reason --backend idris2 over an .ipkg fixture → crt_roots: ['App'], App + Helper wired.

Status

M4 now ~95% (remaining: totality-hole ?name + per-def partial lint). Next follow-ons: M6 (lake-env + #print axioms audit), M3 (workspace-fed verdicts + staleness).


Generated by Claude Code

`discover_roots` for Idris2 now unions two conventions:
1. `.ipkg` `main = <Module>` — the package's executable entry, resolved to
   its `.idr` file (honouring an optional quoted `sourcedir`; `--` comments
   stripped; first existing candidate base wins). The entry needn't be
   literally `Main.idr` — e.g. `main = App` finds `App.idr`.
2. Any `Main.idr` — the bare-tree fallback (unchanged).

`ipkg_main_roots()` parses the `.ipkg` key=value fields (only `main` and
`sourcedir`/`source-dir` are consulted) and resolves each `main` module
against candidate source roots.

## Verified (ran, not inferred)

- `cargo test` → 127 passing, 0 failed (+1 integration: ipkg `main = App`
  discovered + its cone wired; +2 unit: sourcedir/comment resolution, and
  a no-resolvable-main → empty).
- clippy -D warnings, fmt, SPDX clean.
- Dogfooded: `reason --backend idris2` over an ipkg fixture → crt_roots
  ['App'], App + Helper wired.
- STATE.a2ml: M4 now 95% (remaining: totality-hole `?name` + per-def
  `partial` lint).

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 10:17
@hyperpolymath
hyperpolymath merged commit 4f4a9f5 into main Jul 1, 2026
3 checks passed
@hyperpolymath
hyperpolymath deleted the claude/arghda-roadmap-planning-p5mu93 branch July 1, 2026 10:17
hyperpolymath added a commit that referenced this pull request Jul 1, 2026
)

## What

The Flying-Logic reasoning graph can now source **real prover verdicts
from a four-state workspace's `proven/` state** without re-running any
tool, and demote a **stale-proven** node back to `unknown`. Honest by
construction — a verdict only ever comes from a recorded promotion, and
staleness always dominates a stale `Proven`.

This is the last of the three refinement follow-ons (M4 `.ipkg` roots
#41, M6 axiom audit #42, M3 workspace verdicts).

## How

- **`reason::workspace_verdicts(dag, proven, stale) -> (verdicts,
stale)`** — a pure mapping (no I/O, unit-testable): a node whose file
basename is in the workspace's `proven/` set → `Proven`; if that same
file is stale (content/closure hash changed since promotion) it is added
to the returned stale set, so the existing demote-only fold lowers it to
`Unknown`. Matched by file basename (documented collision caveat).
Re-exported from `lib.rs`.
- **`arghda reason <path> --workspace <ws>`** — reads the proven +
stale-proven basename sets off the workspace (`Workspace::list(Proven)`
/ `Workspace::stale_proven`) and feeds them into `workspace_verdicts`.
`--check` stays authoritative: a fresh typecheck overrides the workspace
verdict and clears staleness for that node.
- **Honest evidence strings** — `"prover: proven"` for a fresh
promotion; `"prover: proven; stale: closure hash changed"` for a demoted
stale one.

## Verification (actually run)

- `cargo fmt --check` — clean
- `cargo clippy --all-targets -- -D warnings` — clean
- `cargo test` — **130 pass** (+1 reason unit: proven lights the cone,
stale demotes)
- `bash scripts/check-spdx.sh .` — OK

**Dogfooded end-to-end** on a real workspace + Agda source tree:

- Scenario A (fresh proven leaf): `Good` → `effective: proven`
(`"prover: proven"`); un-proven root `All` → `unknown`.
- Scenario B (proven file edited on disk → stale): `Good` demoted to
`unknown` with `"prover: proven; stale: closure hash changed"`.

## Scope

Additive only. `M3` base was already 100%; this refinement wires the
reasoning graph to the triage workspace's ground truth. No change to the
`reason/0.1` JSON contract keys.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT7

---
_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