Skip to content

proof(agda): real E9 composition soundness in the gated meta-checker; relabel the two corpus files - #471

Merged
hyperpolymath merged 9 commits into
mainfrom
claude/new-session-th4e9w-e9-composition
Nov 9, 2026
Merged

hyperpolymath merged 9 commits into
mainfrom
claude/new-session-th4e9w-e9-composition

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

The 2026-11-09 proof audit found that E9 ("proof composition soundness") is evidenced by two files that don't prove it:

  • proofs/agda/ProofComposition.agda proves that list append is associative.
  • proofs/agda/SoundnessPreservation.agda's compose-sound takes a Conflicts hypothesis and never uses it. It reduces to a ≡ true → b ≡ true → a ∧ b ≡ true.

PROOF-STATUS R6 nevertheless called this evidence "good, merely misfiled". The owner asked for the proof to be strengthened directly. Companion to #470, which does the same for ParallelSoundness.

Changes

  • New meta-checker/src/Echidna/Composition.agda. Theory over an arbitrary logic: formulae, models and satisfaction are module parameters, not postulates.
    • cut: composition preserves semantic soundness, using both premises.
    • weaken-left / weaken-right: adding axioms on either side preserves entailment.
    • explosion: inconsistent axioms entail every formula. So soundness preservation is vacuous unless there is a conflict check, which is exactly what the old file skipped.
    • compose-realised: with a sound conflict detector (no reported conflict implies the joined axioms have a model), every composite is realised. Some model satisfies all its axioms and its goal.
    • detector-must-flag: a sound detector cannot miss an inconsistent composition.
    • Literals: a concrete logic in which pos 0 and neg 0 clash, together with a genuine cut example.
    • Scope: no ECHIDNA Rust code composes proofs today, so the module states the obligation a future composer must meet and claims no implementation.
  • MetaChecker.agda imports the module, which puts it inside the agda-meta-checker closure: pinned Agda 2.7.0.1, canonical flags, fresh-interface check.
  • docs/PROOF-NEEDS.adoc E9 now cites the new module.
  • docs/PROOF-STATUS.adoc R6 is corrected and marked proven (Agda leg, pending the first CI receipt). Rocq/Lean rechecks are recorded as not started.
  • proofs/agda/ProofComposition.agda and SoundnessPreservation.agda stay where they are, as PROOF-POLICY §3 fixtures, with headers that say what they actually prove.

RSR Quality Checklist

Required

  • Tests pass: the files type-check (see Testing).
  • No banned functions: zero postulate, and --safe holds.
  • SPDX headers are present.
  • No secrets.

As Applicable

  • Documentation updated: PROOF-NEEDS, PROOF-STATUS and the corpus file headers.

Testing

  • agda --safe --without-K --cubical-compatible on Composition.agda, on the full MetaChecker.agda closure, and on the two corpus files: exit 0 each.
    • These local runs use Agda 2.6.3 + stdlib 1.7.3. The pinned 2.7.0.1 + stdlib 2.1 run is the agda-meta-checker job's, because this environment can't install the pinned toolchain.
    • The new module imports only Data.Bool, Data.Nat, Data.List, Data.Product, Data.Empty, Relation.Nullary and Relation.Binary.PropositionalEquality, which have the same names in both stdlib versions.
  • Mutation check: replacing SoundDetector with a trivial property makes compose-realised fail to type-check, so the detector's soundness is load-bearing.

Generated by Claude Code

cargo audit fails on rmcp 3.5.0 (crates/echidna-mcp) with
RUSTSEC-2026-0457 (fixed >=3.7.0), RUSTSEC-2026-0461 (>=3.6.0) and
RUSTSEC-2026-0462 (>=3.9.0), published after main last passed the
Dependency audit check. `cargo update -p rmcp` moves rmcp and
rmcp-macros to 3.9.0, inside the existing "3" requirement; no other
entry changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
`cargo fmt --check` fails on main (2ab7574) in five places in
src/rust/proof_search.rs, so rust-ci 'Cargo check + clippy + fmt' is
red on every PR. Formatting only; no code change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
Hypatia's code_safety/zig_ptr_cast and zig_align_cast now flag the nine
`@ptrCast(@aligncast(raw))` lines in src/zig_ffi/chapel_bridge.zig and
src/zig_ffi/runtime_owner.zig as high, and the governance Hypatia
baseline gate is red on main (2ab7574) as a result.

Each of those lines recovers a callback's own `*@this()` from the
type-erased `*anyopaque` it was registered with (runtime_owner.Work
.context, or a std.mem.Allocator vtable's ptr), so the cast restores the
original type and alignment. Fixed at source with a reasoned inline
`hypatia: allow` per rule on each line, as the scanner documents,
rather than a baseline entry. No code change: comments only.

Checked by simulating ScannerSuppression.inline_allowed?/4 and
directive_re at hypatia 82396d81 (the CI pin): 18 unsuppressed
findings on main, 0 with this change. The scanner itself could not be
built here (hex.pm is unreachable).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
… relabel the two corpus files

The proof audit found E9 ("proof composition soundness") evidenced by
two corpus files that do not prove it: ProofComposition.agda proves
list-append associativity, and SoundnessPreservation.agda's compose-sound
discharges a Bool flag with `∧` while ignoring its Conflicts hypothesis.
PROOF-STATUS R6 called that evidence "good, merely misfiled".

New meta-checker/src/Echidna/Composition.agda, theory over an arbitrary
logic (formulae, models and satisfaction are module parameters, not
postulates): cut (composition preserves semantic soundness, using both
premises), weakening, explosion (inconsistent axioms entail everything,
so soundness preservation is vacuous without a conflict check),
compose-realised (a sound conflict detector makes every composite
realised), detector-must-flag, and a concrete literal logic where pos 0
and neg 0 clash and entail an unrelated goal. It is imported by
MetaChecker.agda, so agda-meta-checker (pinned Agda 2.7.0.1, canonical
flags) gates it. No Rust code composes proofs; none is claimed.

PROOF-NEEDS E9 now cites the new module; PROOF-STATUS R6 is corrected.
The two corpus files keep their place as §3 fixtures with headers that
say what they actually prove.

Checked locally with agda --safe --without-K --cubical-compatible on
Agda 2.6.3 + stdlib 1.7.3: Composition and the full MetaChecker closure
exit 0. The pinned 2.7.0.1 run is CI's. Mutation check: replacing
SoundDetector with a trivial property makes compose-realised fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
@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 22 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: 0aa7a505-98c4-4b5e-913a-b7a0d55b3881
Commits

Reviewing files that changed from the base of the PR and between 3c06ac3 and 9f1eec1.

Files selected for processing: 7

  • docs/PROOF-NEEDS.adoc
  • docs/PROOF-STATUS.adoc
  • meta-checker/src/Echidna/Composition.agda
  • meta-checker/src/Echidna/MetaChecker.agda
  • proofs/agda/ProofComposition.agda
  • proofs/agda/SoundnessPreservation.agda
  • scripts/ci/check-agda.sh
  • 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

Copy link
Copy Markdown
Owner Author

Dependency audit is red on fa92ee0, but this PR's diff isn't the cause. Three RustSec advisories against rmcp 3.5.0 were published after main last passed. The fix is #465, which also fixes the rustfmt and Hypatia checks that are red on main. I've merged it into this branch (50d22e0).

panic-attack assail and Deposit findings for gitbot-fleet are red on main and on recent PRs as well, and no fix for either exists yet.

Type-check Agda proofs passes on fa92ee0. That is the agda-meta-checker job on pinned Agda 2.7.0.1 + stdlib 2.1, so the new Echidna.Composition module now has its pinned-toolchain receipt.


Generated by Claude Code

hyperpolymath pushed a commit that referenced this pull request Nov 9, 2026
The owner chose #477's reading of PROOF-POLICY §1 for the split. Generic
theory (Receipt; E9 composition in #471) stays in Agda. Echidna-specific
statements are verified on the Rust with Creusot/Pearlite and Verus,
not restated in Idris 2. Each meta-checker module retires once its Rust
contracts carry a receipt.

R1 now points at #477's trust kernel as the first Creusot target. R10
has no Rust target (there is no clamp_trust), so it retires with its
module. The Lean re-homing note distinguishes Rust behaviour
(Creusot/Verus) from API/ABI properties (Idris 2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015jzCHZx4Rt65NDaGLDrjLp
@hyperpolymath
hyperpolymath marked this pull request as ready for review November 9, 2026 15:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

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 ✅ Completed 2026-11-09T21:37:11.711790Z 9f1eec1 New commits
🔒 Security Review ❌ Failed 2026-11-09T21:32:10.508921Z
We couldn’t complete this review. Comment @codex security review to try again.
9f1eec1 New commits
ℹ️ 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50d22e0ed8

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/PROOF-STATUS.adoc Resolved
Comment thread docs/PROOF-STATUS.adoc Resolved
Review on #471 (Codex):

- Composition.agda: for an arbitrary Set-valued Conflicts relation the old
  detector-must-flag gave only ¬¬ Conflicts, not a reportable witness.
  It is renamed detector-cannot-miss and kept, and a new
  detector-must-flag takes a decision procedure (Dec) and returns the
  Conflicts witness itself. MetaChecker, PROOF-NEEDS E9 and R6 say so.
- scripts/ci/check-agda.sh: the agda-meta-checker job now prints a
  source-bound receipt (toolchain, flags, library descriptors, SHA-256 of
  every source), so a CI run can stand as the receipt PROOF-POLICY §8 needs.
- PROOF-STATUS R6: argued, not proven, until that job's receipt on main
  exists. The local check used Agda 2.6.3, not the pin.
- PROOF-STATUS R4: records that MetaChecker.agda now imports Composition
  (ten modules). The nine receipted modules are unchanged, so the row stands
  for them; the new entrypoint digest awaits the same CI receipt.
- The "Not obligations" note no longer describes R6 as a corpus placement
  defect; R6 cites the meta-checker module and the corpus files disclaim E9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 9, 2026
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 9, 2026
@hyperpolymath
hyperpolymath enabled auto-merge (squash) November 9, 2026 21:32
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f1eec111f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/ci/check-agda.sh

# Source-bound receipt (PROOF-POLICY §8): toolchain, flags and the SHA-256 of
# every first-party source and library descriptor this run checked.
echo "receipt: $version; commit ${GITHUB_SHA:-$(git -C "$repo_root" rev-parse HEAD)}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Record the commit that was actually checked

On pull_request runs, the workflow checks out github.event.pull_request.head.sha, while GitHub defines GITHUB_SHA for this event as the pull request's merge-branch commit. Because GITHUB_SHA is set, the fallback never runs and the new receipt attributes the checked source hashes to a different commit. Use the checked-out HEAD (or pass the checkout ref explicitly) so archived PR receipts have accurate provenance.

Useful? React with 👍 / 👎.

Comment thread docs/PROOF-NEEDS.adoc
|Soundness preservation, axiom conflict detection |Agda
|E9 Proof composition soundness |`+meta-checker/src/Echidna/Composition.agda+`
|Cut preserves semantic soundness; explosion shows a conflict check is
load-bearing; a sound detector realises every composite, and a sound

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retain the no-conflict premise in the E9 summary

The new theorem does not show that a sound detector realises every composite: compose-realised additionally requires ¬ Conflicts Γ₁ Γ₂. For a composite the detector flags—especially the inconsistent example introduced in this module—that premise is unavailable and no common model can exist. Describe this as realising every unflagged composite so the authoritative proof narrative matches the theorem.

Useful? React with 👍 / 👎.

Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 9, 2026
Repository owner deleted a comment from coderabbitai Bot Nov 9, 2026
@hyperpolymath
hyperpolymath merged commit a3043d0 into main Nov 9, 2026
79 of 82 checks passed
@hyperpolymath
hyperpolymath deleted the claude/new-session-th4e9w-e9-composition branch November 9, 2026 21:54
hyperpolymath added a commit that referenced this pull request Nov 9, 2026
…ROOF-POLICY §1.2/§8 (#482)

## Summary

The 2026-11-09 proof audit found `docs/PROOF-STATUS.adoc` out of date in
two ways. Some rows don't match the CI receipts, and the ledger predates
the PROOF-POLICY changes of 2026-11-04 (§8, Proof Witness Grades) and
2026-11-07 (§1.2: Creusot, Pearlite and Verus as the default Rust
toolset). This PR brings it into line. It only changes documentation:
proof sources and CI are untouched.

## Changes

- **R2, Idris 2 ABI and verification:** `argued` → `proven`.
- Cites the green `Idris2 (verification)` and `Type-check Idris2 ABI
definitions` runs on `a2a8643`, whose `verification/` and `src/abi/`
trees are byte-identical to `main` `2ab7574` (checked with `git diff`).
- Names the nine files at the `src/abi/` root that sit outside the
package.
  - Points to #472 for `CapnSchemas`.
- **R3, Lean:**
- The 2026-05-18 note "all five fail to compile" is stale. `Lean 4
(verification)` builds all five on the pinned 4.13.0, and `#print
axioms` shows no `sorryAx`. The Lean leg is now `proven`.
- **Still open, as an owner call:** where these proofs belong. They
state properties of ECHIDNA's own types, so §1 assigns them to Idris 2
(or Creusot/Verus). No §4 exception record exists beside them, so either
write those records or move the proofs.
- **R1, Rust:** now maps to Creusot with Pearlite, and Verus (§1.2). It
records that `crates/echidna-core-creusot` is a parallel model rather
than the shipped code, and that Verus work has not started.
- **R12, SPARK (new):** the four GPR projects had no row at all. The row
is `open`:
  - no CI job runs `gnatprove`;
- `Axiom_C_Bridge` (`SPARK_Mode => Off`) is recorded as an `ASSUMED`
boundary.
- **Grades:** the old "Mathesis Grade N" wording is replaced by the §8
`PWG-` labels.
  - Engineering rows carry no PWG (§8.1).
  - Only R11, the receipt/warrant theory theorem, is at `PWG-3`.
- Nothing is higher, because no Rocq or Lean recheck has been attempted
(R5).
- **`CLAUDE.md`:** the proof-policy pointer now names Pearlite and
Verus. The file itself requires this pointer to move whenever the
mapping changes.

This PR touches different rows from #471, which
corrects R6, so the two should merge cleanly in either order.

## RSR Quality Checklist

### Required

- [x] Documentation only; no code, proofs or CI changed.
- [x] No secrets.

### As Applicable

- [x] Documentation updated.

## Testing

Every receipt cited is a live GitHub Actions job URL. Tree identity was
checked with `git diff --quiet origin/main a2a8643 -- verification
src/abi`. The SPARK facts come from `find . -name '*.gpr'`, `grep
gnatprove` over the `Justfile` and workflows, and the `SPARK_Mode =>
Off` lines at `src/ada/spark/axiom_c_bridge.ads:23` and `.adb:16`.

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

---------

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.

3 participants