Skip to content

ci(a-sounder-constitution): gate the Idris2 proof with idris2 --check - #46

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/ci-idris2-proof-check
Jun 27, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
claude/ci-idris2-proof-check

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Wire idris2 --check into CI

Follow-up to #45. That PR fixed a proof that had been merged claiming to compile but didn't — because nothing ever ran Idris2 on it. This adds the missing gate so it can't happen again.

What it does

.github/workflows/idris2-proof.yml:

  1. installs Chez Scheme (the Idris2 backend) via apt,
  2. builds & installs Idris2 0.7.0 from the v0.7.0 source tarball (bootstrap), and
  3. runs idris2 --check a-sounder-constitution/formal/Constitution.idr.

Conventions followed

  • Path-filtered to a-sounder-constitution/formal/** + the workflow file, so it only runs when the proof actually changes — keeps Actions burn low (the reason there's no caching: the repo pins no actions/cache SHA, and I won't introduce an unverifiable pin; a source build only fires on rare proof edits).
  • Passes workflow-linter.yml: SPDX header on line 1, top-level permissions: contents: read, all uses: SHA-pinned (actions/checkout@de0fac2e…), concurrency guardrail with cancel-in-progress.
  • formal/README.adoc updated to note CI now enforces the check.

Verified locally (in the cloud session, where Idris2 0.7.0 is installed)

  • python3 -c 'yaml.safe_load(...)' → YAML valid
  • the three linter rules (SPDX / permissions / SHA-pin) → all pass
  • idris2 --check formal/Constitution.idr → exit 0, clean

The workflow's own build path (apt chezscheme → tarball → make bootstrap/install) is exactly the sequence used to verify #45, so it mirrors a known-good install. It will run for the first time on this PR (it touches formal/README.adoc, matching the path filter), so CI here is itself the end-to-end test.

Scope: one new workflow + one doc note. No code or simulator behaviour touched.

🤖 Generated with Claude Code

https://claude.ai/code/session_015w8C1xaGwiDcHHjfuxHBd6


Generated by Claude Code

Add .github/workflows/idris2-proof.yml: builds Idris2 0.7.0 (Chez Scheme
backend) and runs `idris2 --check a-sounder-constitution/formal/Constitution.idr`
on every change under `formal/`. The certificate shipped once without being
machine-checked and did not actually compile (#45); this gate stops the proof
from drifting out of sync with its claims again.

- Path-filtered to `formal/**` + the workflow file, so it only runs when the
  proof changes (keeps Actions burn low — no caching, builds from source).
- Passes the repo's workflow-linter rules: SPDX header, top-level
  `permissions: contents: read`, SHA-pinned actions, concurrency guardrail.
- formal/README.adoc: note that CI now enforces the check.

Verified locally: YAML parses, all linter rules pass, and
`idris2 --check Constitution.idr` exits 0 under Idris2 0.7.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015w8C1xaGwiDcHHjfuxHBd6
@hyperpolymath
hyperpolymath marked this pull request as ready for review June 27, 2026 19:06
@hyperpolymath
hyperpolymath merged commit 73207e3 into main Jun 27, 2026
26 of 27 checks passed
@hyperpolymath
hyperpolymath deleted the claude/ci-idris2-proof-check branch June 27, 2026 19:06
@sonarqubecloud

Copy link
Copy Markdown

hyperpolymath added a commit that referenced this pull request Jun 27, 2026
…oof gate is red on main) (#47)

## The gate from #46 is failing on `main`

The `Idris2 Proof` workflow added in #46 went **red** on `main` (run
#2). The build and install of Idris2 0.7.0 succeeded; the failure is the
check invocation:

```
Idris 2, version 0.7.0
1/1: Building a-sounder-constitution.formal.Constitution (a-sounder-constitution/formal/Constitution.idr)
Error: Module name Constitution does not match file name "a-sounder-constitution/formal/Constitution.idr"
```

### Why
Idris2 derives the **expected module name from the path you give it**.
Checking `a-sounder-constitution/formal/Constitution.idr` from the repo
root makes it expect `module a-sounder-constitution.formal.Constitution`
— which can't even be a legal module name (hyphens). The file declares
`module Constitution`, which is correct. I verified the proof locally by
running *from inside* `formal/` (`idris2 --check Constitution.idr`); the
workflow ran it from the repo root, so it only surfaced once CI actually
executed — and #46 merged before its first run finished.

### Fix
Run the check from the module's own directory:
```yaml
- name: Type-check the constitutional proof
  working-directory: a-sounder-constitution/formal
  run: |
    idris2 --check Constitution.idr
```

### Verified locally (Idris2 0.7.0)
- repo root + full path → **exit 1**, the exact CI error (reproduced)
- `working-directory: a-sounder-constitution/formal` + `idris2 --check
Constitution.idr` → **exit 0**, clean
- YAML valid; still passes the workflow-linter rules (SPDX /
`permissions` / SHA-pins)

This PR edits the workflow file, so it matches the path filter and the
gate runs on this PR — CI here is the end-to-end proof of the fix.
**Worth letting `idris2-check` go green before merging this time.**

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

https://claude.ai/code/session_015w8C1xaGwiDcHHjfuxHBd6

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

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