Skip to content

Run the Agda and Lean legs isolated: digest-pinned images, Lean leg and M-2 bridge under lake (PN-7) - #53

Open
hyperpolymath wants to merge 6 commits into
mainfrom
claude/pwg1-isolated-legs
Open

hyperpolymath wants to merge 6 commits into
mainfrom
claude/pwg1-isolated-legs

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

PROOF-POLICY §8.2 counts a leg toward PWG-1 only if its checker ran in a container image pinned by digest that the receipt names (owner ruling 2026-11-16), and names lean under lake as the qualifying Lean run (owner ruling 2026-11-17). Today only the Rocq job meets this, which is why no row here can be PWG-1. This change makes the Agda and Lean jobs meet it. The owner chose per-job digest pins (2026-11-18).

No grade changes in this PR. Grades move only with a receipt. After this merges and main's run passes, a follow-up in #52 records that run with all three images.

Changes

  • Agda job: container: debian:trixie-slim@sha256:a29215f6…49f11f (the digest januskey's Agda job uses, with the same agda-bin=2.6.4.3-1+b2). The run summary names the image.
  • Lean leg under lake:
    • verification/proofs/lean4/lakefile.toml: a package with no dependencies and one library, root ResourceAlgebra. lake-manifest.json is committed as a pinned input (§8.5.1), in the repository's canonical JSON form; lake accepts it and does not rewrite it.
    • scripts/check-lean-leg.sh (new): copies the package to a temporary directory, runs lake build, and fails if the build fails, if any report says depends on axioms, if the axiom-free reports for ResourceAlgebra.lean differ in number from its #print axioms commands, or if the build rewrote the manifest.
    • tests/check_lean_leg_test.sh (new): five planted failures through a stub LAKE.
  • M-2 bridge under lake: verification/bridges/tropical-types/lakefile.toml and its manifest; scripts/check-lean-bridge.sh builds the three modules with lake build in its work directory. The tropical-types pin and its fetch-and-verify are unchanged, and there is no lake require on that repository. Only reports attributed to TropicalBridge.lean count toward the bridge's census. Its test now has six planted failures.
  • Lean job: runs in ubuntu:24.04@sha256:73b99939…d6a8, installs the sha256-checked Lean 4.35.0 archive to /opt/lean, asserts the lean and lake versions, keeps scripts/check-proofs.sh lean4 as an extra compile gate, and takes the axiom census and the receipt summary from the lake build.
  • .gitignore: .lake/.
  • docs/status/PROOF-STATUS.adoc: three sentences that this change made false. The census, tables and grades are untouched, to stay clear of Proof receipt from the shared generator, at 15fa113; gate it in CI (31 rows PWG-2ii) #52. CHANGELOG.adoc entry.

What changes for a receipt

  • Lean invocation: lake build in a copy of verification/proofs/lean4 made by scripts/check-lean-leg.sh; for the bridge, lake build in the work directory scripts/check-lean-bridge.sh makes.
  • The Lean input set gains both lakefile.toml files, both lake-manifest.json files and scripts/check-lean-leg.sh.

Testing

Run locally with Lean 4.35.0 and Lake 5.0.0:

  • scripts/check-lean-leg.sh: PASS: Lean leg under lake; 84 of 84 printed theorems depend on no axiom.
  • scripts/check-lean-bridge.sh: PASS: M-2 bridge to hyperpolymath/tropical-types@f2e465c…; 6 of 6 printed theorems depend on no axiom.
  • tests/check_lean_leg_test.sh: 5 of 5 planted failures refused for the stated reason. tests/check_lean_bridge_test.sh: 6 of 6.
  • scripts/check-proofs.sh lean4 (unchanged script): passes; no .lake/ left in the tree.
  • tests/workflows/ci_gate_test.sh and the lock and pinning tests pass. check-ijson-jcs.sh --enforce: 14 of 14 canonical. check-adoc-renders.sh: 163 files render clean.
  • actionlint: only the two SC2016 notices that are on main already.

Not tested here: the containers. There is no container runtime in the authoring environment, so this PR's own CI run is the first test of the two job containers. Known risks: agda-bin=2.6.4.3-1+b2 being installable on that exact Debian digest (januskey uses the same pairing); checkout inside the Ubuntu container (git is installed before it); tee /dev/stderr in the receipt step.

One behaviour is stricter than before: the bridge check now fails on depends on axioms anywhere in the build output, including the imported TropicalSessionTypes.lean. It passes at the current pin.

RSR Quality Checklist

Required

  • Tests pass (see Testing; containers untested until CI)
  • No banned language patterns
  • No banned functions
  • SPDX license headers present on all new source files
  • No secrets, credentials, or .env files included

As Applicable

  • Documentation updated
  • CHANGELOG updated

Generated by Claude Code

PROOF-POLICY §8.2 counts a proof leg toward PWG-1 only if its checker ran
isolated, in an image pinned by digest, with the receipt naming the image.
The Agda job ran in debian:trixie-slim with no digest. Pin it, print the
image reference in the receipt step summary, and update the DEVIATION note.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013CuBToxr5h9catptGiTsFX
PROOF-POLICY §8.2 names `lean` under `lake` as the qualifying Lean run and
asks for a committed lake-manifest.json as a pinned input. Add a
dependency-free Lake package for ResourceAlgebra.lean, the canonical
(I-JSON/JCS) manifest lake writes, and scripts/check-lean-leg.sh, which
builds a copy under lake and takes the axiom census from that build. The
test plants each failure through a stub lake and checks the reason.
The workflow is wired in the following commit.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013CuBToxr5h9catptGiTsFX
… image

The lean-leg job now runs in ubuntu:24.04 pinned by digest, installs the
sha256-checked Lean 4.35.0 archive, asserts lean and lake versions, takes
the axiom census and receipt from scripts/check-lean-leg.sh (lake build),
and runs the new leg test beside the bridge test. The receipts name the
image, the lake invocation and every input file.

scripts/check-lean-bridge.sh builds ResourceAlgebra, the pinned
TropicalSessionTypes and TropicalBridge as a dependency-free Lake package
(committed lakefile.toml and lake-manifest.json) in a work directory. The
tropical-types pin and its fetch-and-verify are unchanged; all failure
conditions are kept, and a rewritten manifest now fails. Only reports
attributed to TropicalBridge.lean count towards the bridge census. The
bridge test plants each failure through a stub lake.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013CuBToxr5h9catptGiTsFX
…r lake

Change only the statements the CI change makes false (how the Lean leg and
the M-2 bridge are invoked, the Agda image) and add a changelog entry. No
grade, census or receipt changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013CuBToxr5h9catptGiTsFX
The Lean legs build in a temporary copy, but a local `lake build` in a
package directory would leave .lake/; keep it out of commits.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013CuBToxr5h9catptGiTsFX

hyperpolymath commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner Author

State at 04:35 UTC: CI/gate is green on d3e4651 ("all 16 required checks passed"). The only red checks left are the two Hypatia jobs, which are not among the required ones.

The prover jobs this PR changes all passed in their containers (Agda in the digest-pinned Debian image, the Lean leg and the M-2 bridge under lake in the digest-pinned Ubuntu image, Rocq, Proofs verdict).

API quota (resolved by one re-run). gate-pr / CI gate, Proven 3-outcome test & bench suite, Squabble CI chains & required-context gate and analyze (actions, none) failed when the repository's GitHub Actions installation ran out of API quota (API rate limit exceeded for installation; Squabble's release not found is the same lookup, refused). It happened twice tonight, around 01:18–01:34 and from 02:36 UTC, each time when several commits landed on PR branches within a few minutes. I re-ran the failed jobs once at 03:51 UTC, twenty seconds apart, with the repository quiet, and they passed.

Hypatia (not this PR's; cause unknown). The scanner dies with Segmentation fault (core dumped) … hypatia-cli.sh scan . --exit-zero, exit 139, printing nothing. My earlier explanations here (quota, then content, then load) were each wrong or incomplete. What I can show:

  • It is intermittent, and not tied to this branch. The workflow's run list shows the same crash on three other branches (claude/pensive-meitner-jsyshu, claude/intelligent-johnson-i64bfk, claude/sweet-edison-yp088x). On one of them the same commit (c4747d6) crashed on attempts 1 and 2 and passed on attempt 3. Here it has crashed on every attempt so far, including the 03:52 UTC re-run with the repository quiet and quota available.
  • It does not crash locally. The same scanner commit (d73f76b), built on OTP 28.3.3 and Elixir 1.19.4, scans this branch's tree, Proof receipt from the shared generator, at 15fa113; gate it in CI (31 rows PWG-2ii) #52's tree, main and Proof receipt at 15fa113 (merge of #45); 31 rows PWG-2ii, M-2 ungraded #50's tree cleanly, in nine environment variants and sixteen repeats. I also rebuilt what CI checks out, the merge commit of d3e4651 into 9862866 with every remote branch fetched, and that scans cleanly too.
  • The restored cache is byte-identical (17,247,368 bytes) in passing and crashing runs, as are the runner image and the OTP build.

A core dump or an erl_crash.dump from one crashing job would settle it; that needs a change to the Hypatia workflow or the scanner, neither of which belongs in this PR.


Generated by Claude Code

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 18, 2026 01:44
Repository owner deleted a comment from coderabbitai Bot Nov 18, 2026
Repository owner deleted a comment from coderabbitai Bot Nov 18, 2026
@sonarqubecloud

Copy link
Copy Markdown

Repository owner deleted a comment from coderabbitai Bot Nov 18, 2026
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.

3 participants