Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions docs/PROOF-STATUS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,25 @@ receipt-time audit, not an enforced property: `+idris2-abi-ci.yml+` greps
and `+prim__crash+`, and checks neither `+postulate+` nor
`+verification/proofs/idris2/+`. *Limit:* `+EchidnaABI.CapnSchemas+` was
outside the package and failed to build; hyperpolymath/echidna#472 fixes it and
gates it. Nine other `+.idr+` files at the `+src/abi/+` root are outside the
package: `+BojForeign+`, `+OverlayForeign+`, `+TentaclesForeign+`,
`+TypeLLForeign+`, `+Types+`, `+Layout+` and `+Foreign+` (shadow copies of
packaged modules), `+CoprocessorForeign+` (an orphan whose module name does not
match its path) and `+NeSyAssistTesting+` (does not parse, and states an
empirical claim rather than a provable one). They carry no row until the owner
decides their fate (open question A5). *Audit 2026-11-09 of
gates it. `+Coprocessor.Foreign+` (formerly the orphan `+CoprocessorForeign.idr+`,
whose module name did not match its path) now sits at its module path and is
listed in the package, so the ABI job type-checks it. Receipt for the moved
module (eleven kinds):
https://github.com/hyperpolymath/echidna/actions/runs/43942011801/job/133561724581[Type-check Idris2 ABI definitions],
success, a pull-request run on head `+dc36ee97291a2614a91b5d6971a075ab9ad15d79+`.
Its `+CoprocessorKind+` then lacked five kinds that the Rust enum
(`+src/rust/coprocessor/types.rs+`) declares: `+PariGp+`, `+Maxima+`,
`+Singular+`, `+Gap+`, `+Macaulay2+`. They are now added with tags 11 to 15, in
the Rust declaration order, in commit
`+ff1eef251b834f44fc73ccd8d008de9451d4eca6+`. Receipt for the extended module
(sixteen kinds):
https://github.com/hyperpolymath/echidna/actions/runs/43947887496/job/133582267468[Type-check Idris2 ABI definitions],
success, a pull-request run on head `+ff1eef2+`. One other `+.idr+` file at the `+src/abi/+` root
is outside the package: `+NeSyAssistTesting+` (does not parse, and states an
empirical claim rather than a provable one). It carries no row. Owner ruling on
A5: move it to `+tests/+` as a non-proof fixture. The seven shadow copies of packaged modules
(`+BojForeign+`, `+OverlayForeign+`, `+TentaclesForeign+`, `+TypeLLForeign+`,
`+Types+`, `+Layout+`, `+Foreign+`) are deleted. *Audit 2026-11-09 of
`+verification/proofs/idris2/+`:* several modules prove less than their names say:
`+TrustLevelSoundness+` holds by definition of a local function that
disagrees with Rust; `+DispatchCorrectness+` never mentions
Expand Down
2 changes: 1 addition & 1 deletion docs/handover/L1-CAPNPROTO-PROMPT.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ wire-drift engine. See open-question #2 resolution below.
* `+src/abi/CapnSchemas.idr+` — formal proofs that schema round-trip
preserves meaning
* Zero `+believe_me+` (per estate rule); constructive proofs only
* Coordinate with `+src/abi/Types.idr+` / `+src/abi/Foreign.idr+`
* Coordinate with `+src/abi/EchidnaABI/Types.idr+` / `+src/abi/EchidnaABI/Foreign.idr+`

==== Zig FFI bridge

Expand Down
2 changes: 1 addition & 1 deletion ffi/zig/src/boj.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// running in a BoJ server instance.
//
// Architecture:
// Idris2 ABI (BojForeign.idr) --> Zig FFI (boj.zig) --> C-ABI exports --> zig adapter (port 7700)
// Idris2 ABI (Boj/Foreign.idr) --> Zig FFI (boj.zig) --> C-ABI exports --> zig adapter (port 7700)
//
// The BoJ server itself lives at hyperpolymath/boj-server with its own ABI+FFI.
// This module is the ECHIDNA-side client bridge.
Expand Down
4 changes: 2 additions & 2 deletions ffi/zig/src/main.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ECHIDNA FFI Implementation
//
// This module implements the C-compatible FFI declared in src/abi/Foreign.idr
// This module implements the C-compatible FFI declared in src/abi/EchidnaABI/Foreign.idr
// All types and layouts must match the Idris2 ABI definitions.
//
// SPDX-License-Identifier: MPL-2.0
Expand Down Expand Up @@ -30,7 +30,7 @@ fn clearError() void {
}

//==============================================================================
// Core Types (must match src/abi/Types.idr)
// Core Types (must match src/abi/EchidnaABI/Types.idr)
//==============================================================================

/// Result codes (must match Idris2 Result type)
Expand Down
2 changes: 1 addition & 1 deletion ffi/zig/src/tentacles.zig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// streaming events to external consumers (PanLL, CLI, etc.).
//
// Architecture:
// Idris2 ABI (TentaclesForeign.idr) --> Zig FFI (tentacles.zig) --> C-ABI --> zig adapter
// Idris2 ABI (Tentacles/Foreign.idr) --> Zig FFI (tentacles.zig) --> C-ABI --> zig adapter
//
// Each agent maintains:
// - Status (idle/busy/error/disabled)
Expand Down
2 changes: 1 addition & 1 deletion ffi/zig/src/typell.zig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// type inference, refinement types, and type-level evaluation.
//
// Architecture:
// Idris2 ABI (TypeLLForeign.idr) --> Zig FFI (typell.zig) --> C-ABI exports --> zig adapter (port 7800)
// Idris2 ABI (TypeLL/Foreign.idr) --> Zig FFI (typell.zig) --> C-ABI exports --> zig adapter (port 7800)

const std = @import("std");
const builtin = @import("builtin");
Expand Down
2 changes: 1 addition & 1 deletion generated/abi/echidna_boj.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Provides cartridge management and service discovery for the BoJ runtime.
*
* Source: ffi/zig/src/boj.zig
* ABI: src/abi/BojForeign.idr
* ABI: src/abi/Boj/Foreign.idr
*
* DO NOT EDIT — regenerate from the Zig FFI source.
*/
Expand Down
2 changes: 1 addition & 1 deletion generated/abi/echidna_overlay.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Covers Tor, IPFS, and Ethereum overlay network integrations.
*
* Source: ffi/zig/src/overlay.zig
* ABI: src/abi/OverlayForeign.idr
* ABI: src/abi/Overlay/Foreign.idr
*
* DO NOT EDIT — regenerate from the Zig FFI source.
*/
Expand Down
2 changes: 1 addition & 1 deletion generated/abi/echidna_tentacles.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Provides compiler agent management, task dispatch, OODA tracking, and events.
*
* Source: ffi/zig/src/tentacles.zig
* ABI: src/abi/TentaclesForeign.idr
* ABI: src/abi/Tentacles/Foreign.idr
*
* DO NOT EDIT — regenerate from the Zig FFI source.
*/
Expand Down
2 changes: 1 addition & 1 deletion generated/abi/echidna_typell.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Provides type checking, inference, refinement, and type-level computation.
*
* Source: ffi/zig/src/typell.zig
* ABI: src/abi/TypeLLForeign.idr
* ABI: src/abi/TypeLL/Foreign.idr
*
* DO NOT EDIT — regenerate from the Zig FFI source.
*/
Expand Down
2 changes: 1 addition & 1 deletion issues/echidna-04-ffi-abi-bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Write the specification for a C-ABI boundary through which a metaheuristics engi

## Context

- `src/abi/` holds the Idris2 ABI (`echidnaabi.ipkg`, `EchidnaABI/`, `Types.idr`, `Layout.idr`, and per-subsystem `*Foreign.idr` modules such as `CoprocessorForeign.idr`, `OverlayForeign.idr`, `TentaclesForeign.idr`).
- `src/abi/` holds the Idris2 ABI (`echidnaabi.ipkg`, `EchidnaABI/`, and per-subsystem `<Subsystem>/Foreign.idr` modules such as `Overlay/Foreign.idr` and `Tentacles/Foreign.idr`).
- `ffi/zig/` (`build.zig`, `src/main.zig`, `src/boj.zig`, `src/capnp_bridge.zig`, `src/provers/`) and `src/zig_ffi/` (`chapel_bridge.zig`, `chapel_ffi_exports.h`) are the existing Zig bridges.
- `CLAUDE.md` states that Idris2 ABI modules must have zero `believe_me`, zero postulates and zero admits, enforced by `idris2-abi-ci.yml`. The specification must satisfy the same gate.
- The Rust side has an existing `src/rust/ffi/` module. Reuse its conventions for pointer ownership and error codes.
Expand Down
10 changes: 5 additions & 5 deletions scripts/gates/w0.selftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,10 @@ expect "a claims.json whose root is an array fails 13" FAIL 13-lean-build-record
# ----------------------------------------------- check 7: Idris/Agda hygiene

new_repo
mkdir -p "$R/.github/workflows" "$R/src/abi/EchidnaABI" "$R/meta-checker/src/Echidna" "$R/scripts/ci"
mkdir -p "$R/.github/workflows" "$R/src/abi/EchidnaABI" "$R/src/abi/Coprocessor" "$R/meta-checker/src/Echidna" "$R/scripts/ci"
printf '# for pattern in postulate; do grep\nrun: echo\n' > "$R/.github/workflows/idris2-abi-ci.yml"
printf 'package x\nmodules = EchidnaABI.CapnSchemas, CoprocessorForeign\n' > "$R/src/abi/echidnaabi.ipkg"
touch "$R/src/abi/EchidnaABI/CapnSchemas.idr" "$R/src/abi/CoprocessorForeign.idr"
printf 'package x\nmodules = EchidnaABI.CapnSchemas, Coprocessor.Foreign\n' > "$R/src/abi/echidnaabi.ipkg"
touch "$R/src/abi/EchidnaABI/CapnSchemas.idr" "$R/src/abi/Coprocessor/Foreign.idr"
printf 'module Echidna.MetaChecker where\n{- import Echidna.AxiomTrackerCompleteness -}\n' > "$R/meta-checker/src/Echidna/MetaChecker.agda"
printf 'run: bash scripts/ci/check-agda.sh\n' > "$R/.github/workflows/agda-meta-checker.yml"
printf 'agda --safe src/Echidna/MetaChecker.agda\n' > "$R/scripts/ci/check-agda.sh"
Expand All @@ -393,11 +393,11 @@ expect "a postulate grep inside a comment fails 07a" FAIL 07a-idris-postulate-gr
expect "the one-line modules layout passes 07b" PASS 07b-ipkg-coverage
expect "an import inside a block comment fails 07c" FAIL 07c-meta-checker-completeness
printf 'run: |\n for pattern in believe_me postulate; do grep -rn "$pattern" src/abi; done\n' > "$R/.github/workflows/idris2-abi-ci.yml"
printf 'package x\nmodules = Main\n , EchidnaABI.CapnSchemas\ndepends = base\n , CoprocessorForeign\n' > "$R/src/abi/echidnaabi.ipkg"
printf 'package x\nmodules = Main\n , EchidnaABI.CapnSchemas\ndepends = base\n , Coprocessor.Foreign\n' > "$R/src/abi/echidnaabi.ipkg"
printf 'module Echidna.MetaChecker where\nopen import Echidna.AxiomTrackerCompleteness public\n' > "$R/meta-checker/src/Echidna/MetaChecker.agda"
gate 7
expect "a real postulate grep passes 07a" PASS 07a-idris-postulate-grep
expect "a module listed under depends does not count for 07b" FAIL 07b-ipkg-coverage "CoprocessorForeign"
expect "a module listed under depends does not count for 07b" FAIL 07b-ipkg-coverage "Coprocessor.Foreign"
expect "a real import checked through check-agda.sh passes 07c" PASS 07c-meta-checker-completeness

# Inline `#` comments: a mention after code on the line does not count.
Expand Down
4 changes: 2 additions & 2 deletions scripts/gates/w0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,13 @@ check_7() {
fail "07b-ipkg-coverage" "$ipkg is missing"
else
mods=$(ipkg_modules "$ipkg")
for rel in EchidnaABI/CapnSchemas.idr CoprocessorForeign.idr; do
for rel in EchidnaABI/CapnSchemas.idr Coprocessor/Foreign.idr; do
[ -f "src/abi/$rel" ] || continue
mod=$(sed 's/\.idr$//; s#/#.#g' <<<"$rel")
grep -qxF "$mod" <<<"$mods" || missing+=("$mod")
done
if [ ${#missing[@]} -eq 0 ]; then
pass "07b-ipkg-coverage" "CapnSchemas and CoprocessorForeign are in $ipkg or deleted"
pass "07b-ipkg-coverage" "CapnSchemas and Coprocessor.Foreign are in $ipkg or deleted"
else
fail "07b-ipkg-coverage" "present but not in $ipkg: ${missing[*]}"
fi
Expand Down
Loading
Loading