Skip to content

fix(ci): run idris2 --check from the proof's own directory (Idris2 Proof gate is red on main) - #47

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

hyperpolymath merged 1 commit into
mainfrom
claude/fix-idris2-proof-workdir

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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:

- 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.ai/code/session_015w8C1xaGwiDcHHjfuxHBd6


Generated by Claude Code

The Idris2 Proof gate added in #46 went red on main: Idris2 derives the
expected module name from the path it is given, so checking
`a-sounder-constitution/formal/Constitution.idr` from the repo root made it
expect a module named `a-sounder-constitution.formal.Constitution` (impossible —
hyphens aren't legal in module names), not `module Constitution`:

    Error: Module name Constitution does not match file name
    "a-sounder-constitution/formal/Constitution.idr"

The build/install steps were fine; only the check invocation was wrong. Run it
with `working-directory: a-sounder-constitution/formal` and `idris2 --check
Constitution.idr`, matching how it is verified locally.

Reproduced and fixed locally with Idris2 0.7.0: full path -> exit 1 (same
error); from the formal/ dir -> exit 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:26
@hyperpolymath
hyperpolymath merged commit ace1713 into main Jun 27, 2026
27 checks passed
@hyperpolymath
hyperpolymath deleted the claude/fix-idris2-proof-workdir branch June 27, 2026 19:26
@sonarqubecloud

Copy link
Copy Markdown

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