Skip to content

fix(proofs): DOM-1/DOM-2 corrected, checked in CI with pinned Agda, graded PWG-3 from receipts - #127

Merged
hyperpolymath merged 5 commits into
mainfrom
claude/zen-brahmagupta-opqqle
Nov 10, 2026
Merged

hyperpolymath merged 5 commits into
mainfrom
claude/zen-brahmagupta-opqqle

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

The 2026-11-09 proof audit and its skeptic re-check found several problems in this repository's two Agda theory results, DOM-1 (Burrow.Trust) and DOM-2 (Burrow.Ledger), and in the tooling around them:

  • One "theorem" was the identity function.
  • Two functions could never be called, because Agda could not infer their implicit arguments at a call site.
  • The wrapper script failed on any module in a subdirectory.
  • No CI job checked any proof, and the proof recipes printed SKIP and exited 0 when a prover was missing.
  • The dangerous-pattern scan failed on main because it matched header comments.
  • Nothing pinned the Agda version or the standard library, so no grade could be derived.

This PR fixes all six.

Changes

  • Proof fixes.
    • epi-is-not-factive was λ f → f : ¬X → ¬X. It is now ¬ (∀ {A} → Epi A → A), proved from the legacy countermodel, so DOM-1's claim that a warrant is not factive is finally stated.
    • revalidate drops an implicit argument it never used and no caller could infer.
    • promote takes its stored record explicitly, because a projection cannot be inverted.
  • scripts/agda-safe-check.sh. It reads the module name and checks from the include root, so hierarchical modules work. It refuses a module whose name does not match its path. The test gains a hierarchical case and a mismatch case.
  • Justfile.
    • proof-check-{idris2,lean4,agda,coq} exit 1 with "NOT RUN" when the prover is missing.
    • proof-scan-dangerous now calls scripts/proof-scan-dangerous.sh, which strips comments per language before matching.
  • CI. proof-safety.yml gains an agda job, using only the already-locked actions/checkout. It installs the pinned toolchain from digest-checked archives (scripts/ci/setup-agda.sh, ported from echidna), type-checks both modules through the wrapper, and writes a receipt for each.
  • Receipts and grades.
  • Docs.
    • docs/status/PROOF-STATUS.adoc and CLAUDE.md restate grades as PROOF-POLICY §8 PWG. The census, derived from the receipts, is PWG-3 2/2 by obligation.
    • The proof dates are corrected to 2026-11-03 (feat(proofs): introduce fail-closed cross-kernel reconciliation receipts #119).
    • DOM-2 is recorded as a specification that Ledger::read_all does not yet meet; that obligation belongs to Rust verification.
    • Rust verification is named as Creusot with Pearlite, and Verus (§1.2).

RSR Quality Checklist

Required

  • Tests pass:
    • tests/agda-safe-check.sh passes.
    • scripts/ci/test-agda-cone-receipt.sh passes.
    • Both Agda modules exit 0 under --safe --without-K --cubical-compatible.
  • Lint: shellcheck is clean on all new and changed scripts. The workflow parses.
  • No banned functions: this PR removes a vacuous theorem and adds no escape hatch.
  • SPDX headers on new files.
  • No secrets.

As Applicable

  • Documentation updated.

Testing

All checks below were run locally with Agda 2.7.0.1 and agda-stdlib 2.1 (archive SHA-256 72ca3ea2…).

  • Type-checking. Burrow.Trust and Burrow.Ledger exit 0 under the policy flags, both directly and through the fixed wrapper.
  • Call sites. A probe module that applies revalidate legacy-epi and promote legacy-stored type-checks. Before this change, both failed with "Unsolved metas".
  • Receipts. Both were written at 22f6f723 with no uncommitted change under verification/proofs/agda/. The import cones are 34 and 35 modules, which matches the skeptic's independent count. Both scans are clean; the only postulates are Agda.Primitive's universe-level primitives.
  • Escape-hatch scan. It passes on the tree. On planted Agda, Lean and Coq files it flags exactly the real escape hatches and ignores the commented ones, including nested comments.
  • Not run here. The new CI agda job's first run is on this PR.

Generated by Claude Code

…rapper, no silent skips

Follow-up to the 2026-11-09 proof audit of DOM-1/DOM-2 and its skeptic
re-check.

- Burrow.Trust: epi-is-not-factive was `λ f → f : ¬X → ¬X`, the identity,
  so DOM-1's claim that a warrant is not factive had no declaration
  stating it. It is now `¬ (∀ {A} → Epi A → A)`, proved from the legacy
  countermodel. revalidate drops an implicit argument it never used and
  no caller could infer.
- Burrow.Ledger: promote takes its stored record explicitly. A
  projection cannot be inverted, so the implicit argument was never
  inferable at a call site.
- scripts/agda-safe-check.sh used to cd into the file's own directory,
  so every hierarchical module failed (Burrow/Burrow/Trust.agda). It
  now reads the module name and checks from the include root, and it
  refuses a module whose name does not match its path. The test gains
  a hierarchical case and a mismatch case.
- The Justfile proof-check-{idris2,lean4,agda,coq} recipes now exit 1
  with "NOT RUN" when the prover is missing, instead of printing SKIP
  and exiting 0 (PROOF-POLICY §2.1).
- proof-scan-dangerous now runs scripts/proof-scan-dangerous.sh, which
  removes comments per language before matching. The old grep failed on
  main with eight header-comment false positives, which drowned any real
  hit. It now passes on the tree and flags every planted escape hatch in
  the Agda, Lean and Coq controls.
- docs/status/PROOF-STATUS.adoc and CLAUDE.md:
  - Restate grades as PROOF-POLICY §8 PWG. DOM-1/DOM-2 are ungraded
    until a receipt lands here.
  - Correct the proof dates to 2026-11-03 (#119).
  - Record DOM-2 as a specification the Rust read path does not yet meet.
  - Name Creusot with Pearlite, and Verus, for first-party Rust.

Checked locally with Agda 2.7.0.1 and agda-stdlib 2.1 under --safe
--without-K --cubical-compatible: Burrow.Trust and Burrow.Ledger exit 0,
the wrapper checks both, and a probe module that applies revalidate and
promote type-checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WS4mfQeC3N1DWjcCQJaQqw
…e receipts

The audit found that no workflow type-checked any file under
verification/proofs/, so DOM-1 and DOM-2 had no CI receipt, and that
nothing pinned the Agda version or the standard library (PROOF-POLICY
§2.1, §8.2).

- verification/proofs/agda/burrow.agda-lib pins the include root and the
  dependency on standard-library-2.1.
- scripts/ci/setup-agda.sh, ported from echidna, installs Agda 2.7.0.1
  and agda-stdlib 2.1 from digest-checked upstream archives, and fails
  closed.
- scripts/ci/agda-cone-receipt.sh and test-agda-cone-receipt.sh, ported
  from echidna, write the §8.2/§8.4 receipt: toolchain digests, flags,
  the import cone with a SHA-256 per file, and a comment-aware postulate
  scan. The test checks the scan on a fixture.
- proof-safety.yml gains an `agda` job. It type-checks both modules
  through the fixed wrapper and records a receipt for each, using only
  the already-locked actions/checkout.

Local run with the same pins: Burrow.Trust has a cone of 34 modules,
Burrow.Ledger 35, both scans are clean, and Agda.Primitive's level
primitives are the only kernel postulates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WS4mfQeC3N1DWjcCQJaQqw
…OM-1 and DOM-2

docs/reports/2026-11-09-agda-cone-receipts.jsonl holds one JCS receipt
per theorem module. Both were written by scripts/ci/agda-cone-receipt.sh
at 22f6f72, with no uncommitted change under verification/proofs/agda/.
They record the pinned Agda 2.7.0.1 and agda-stdlib 2.1, the policy
flags, import cones of 34 and 35 modules, and clean postulate scans. The
census in PROOF-STATUS and the CLAUDE.md status line now read PWG-3 2/2,
derived from those receipts. Neither module has a Rocq or Lean leg yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WS4mfQeC3N1DWjcCQJaQqw
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e6aa2086-a035-457b-9277-b8976d7298c3
Commits

Reviewing files that changed from the base of the PR and between 7a5ab74 and 828bbb1.

Files selected for processing: 14

  • .github/workflows/proof-safety.yml
  • CLAUDE.md
  • Justfile
  • docs/reports/2026-11-09-agda-cone-receipts.jsonl
  • docs/status/PROOF-STATUS.adoc
  • scripts/agda-safe-check.sh
  • scripts/ci/agda-cone-receipt.sh
  • scripts/ci/setup-agda.sh
  • scripts/ci/test-agda-cone-receipt.sh
  • scripts/proof-scan-dangerous.sh
  • tests/agda-safe-check.sh
  • verification/proofs/agda/Burrow/Ledger.agda
  • verification/proofs/agda/Burrow/Trust.agda
  • verification/proofs/agda/burrow.agda-lib
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…'s W0 gate reads

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WS4mfQeC3N1DWjcCQJaQqw
The new agda-proofs job failed with "Library 'standard-library-2.1' not
found". burrow.agda-lib depends on the stdlib, and Agda resolves that
through --library-file or ~/.config/agda/libraries. It reads no
AGDA_LIBRARIES_FILE variable. The receipt script already passed
--library-file; the safe-check wrapper did not. It now does, with
--no-default-libraries, whenever AGDA_LIBRARIES_FILE is set, and fails
closed when that file is missing.

Reproduced the CI failure locally with a clean HOME (rc 42). After the
fix, Burrow.Trust and Burrow.Ledger check under pinned Agda 2.7.0.1 and
stdlib 2.1, with and without the -i include. The cone receipt still
reports 34 modules, clean. tests/agda-safe-check.sh gains a positive
argv check and a missing-file negative control, and now unsets the
toolchain variables so a CI job environment cannot leak into it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WS4mfQeC3N1DWjcCQJaQqw
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 9, 2026 15:40
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-09T15:40:22.615439Z
We couldn’t complete this review. Comment @codex review to try again.
828bbb1 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@hyperpolymath
hyperpolymath enabled auto-merge (squash) November 9, 2026 22:56
@hyperpolymath
hyperpolymath merged commit 5063985 into main Nov 10, 2026
39 of 40 checks passed
@hyperpolymath
hyperpolymath deleted the claude/zen-brahmagupta-opqqle branch November 10, 2026 01:49
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