An Idris2-defined ABI with pure Zig FFI and API implementations for estate service protocols. The current shared library dispatches synchronous calls to caller-supplied REST and MCP callbacks through C-compatible declarations.
|
Important
|
Status: experimental callback registry implemented. The Zig shared library supports registration, calls, unregistration and destruction, with explicit refusals for unsupported tags and invalid state. Hosted checks compare 1,024 runtime cases with a fresh Idris2 oracle and exercise lifetime/reentrancy contracts. Built-in HTTP/MCP clients and complete source-to-boundary refinement remain open. See Layers and plan for the distinction between current and planned work. |
This adapter connects two parts of the estate; connector-pool integration is still planned:
-
the protocol taxonomy from
boj-server(Boj.Protocol): nine wire protocols (MCP, LSP, DAP, BSP, NeSy, Agentic, Fleet, gRPC, REST) with an Idris2-proven tag encoding (mirrored in Zig and seam-tested inboj-server; here both the Idris2 model and Zig runtime classifier exist); -
the HTTP connector pool from
developer-ecosystem/zig-api(connector.zig,uapi_connector_*), the only one of those protocols with a working client today.
In boj-server the taxonomy is a column of the cartridge catalogue: it records
which protocols a cartridge exposes, and nothing routes a call by it. This
adapter makes it a dispatch table.
The design rule: every protocol the ABI names either works or refuses. The
current registry supports caller-supplied REST/MCP handlers; other known tags
refuse. See the installed uaa_registry.h for operation-specific status values.
A successful callback does not establish remote delivery.
| Layer | Content | Source |
|---|---|---|
Idris2 ABI ( |
Protocol tag set and round-trip proofs; open endpoint registry; proof that
dispatch is total and an unimplemented protocol maps to |
|
Zig runtime ( |
Implemented: synchronous borrowed callback registry for REST/MCP; other tags refuse. Planned: integrate the REST connector and add MCP HTTP/stdio clients. |
|
Foreign declarations ( |
Implemented C-compatible declarations for the Zig runtime. Full mechanical generation and correspondence with Idris2 remain proof obligations. |
Idris2 ABI contracts; Zig implementation |
Once the adapter is published, developer-ecosystem/zig-api and boj-server
take it as a pinned dependency instead of carrying their own copies, and
UNIFIED-ZIG-API-STACK.adoc points here. Its first new consumer is svalinn
(the stapeln edge gateway), which reaches vordr over MCP through it.
Proof obligations follow the estate proof policy
(standards/3-practice/PROOF-POLICY.adoc): Idris2 for the ABI, Kani for the
unsafe and FFI seams of Rust callers.
Proof scope: see the proof ledger. Idris2 model proofs, exhaustive native checks and Atoma’s closed scalar source interpretation are distinct evidence. The scalar classifier is checked over all 256 byte tags against the Idris2 decoder; compiler refinement, pointer provenance and the stateful callback boundary remain open. Consumers must serialize access, retain borrowed callback/context lifetimes and destroy each live handle exactly once.
-
The repository map: generated; what every directory is for.
-
ROADMAP: milestones and next actions.
-
unified-api-adapter_chora.deed: the repo deed. It says what this repository is and is not, and where it sits in the estate.
Code, configuration and scripts are Mozilla Public License 2.0
(MPL-2.0); prose documentation is CC-BY-SA-4.0. Both texts live in
LICENSES/, and per-file SPDX-License-Identifier headers are authoritative.
The GitHub-detected licence is MPL-2.0 (the root LICENSE). Long-term
attribution uses Quantum-Safe Provenance — see
the Quantum-Safe Provenance exhibit.