|
4 | 4 | :toc: preamble |
5 | 5 | :icons: font |
6 | 6 |
|
7 | | -This file provides code-level evidence and implementation details for the SNIF (Safe Native Implemented Functions) architecture. |
| 7 | +This file provides code-level evidence and implementation details for the SNIF (Safer Native Implemented Functions) architecture. |
8 | 8 |
|
9 | 9 | == Claim-to-implementation map |
10 | 10 |
|
|
28 | 28 | How this is implemented:: |
29 | 29 | The `Justfile` build recipes enforce `-OReleaseSafe` for all `priv/*.wasm` artifacts, ensuring that bounds checks are preserved in the binary. |
30 | 30 |
|
31 | | -== Relationship to Groove/Cleave |
| 31 | +== Scope ceiling: a safer NIF, and nothing past it |
32 | 32 |
|
33 | | -SNIFs provide the **Physical Cleave Surface**. While the **Groove Protocol** defines "how services talk" (communication), the SNIF architecture defines **"how they touch"** (integration). By sandboxing native code in WASM, we ensure that the "join" between high-performance logic and the safe host environment is mathematically isolated and safe to "split." |
| 33 | +SNIF deliberately stops at *NIF-parity + crash-isolation*. The goal is to **adapt and |
| 34 | +perfect something that already exists** — the BEAM NIF — for the people who already use |
| 35 | +NIFs: a safer, like-for-like drop-in for native compute/buffer functions (see the README |
| 36 | +`Scope` section), *not* a new interface paradigm. Capabilities that go **beyond** what a |
| 37 | +NIF offers — graduated/tunable integration, capability negotiation, transaction-gating, |
| 38 | +permissions that depend on an integration "mode" — are **out of SNIF scope by design**. If |
| 39 | +an idea is good but takes us past the NIF goal, it belongs to the *cleave* and *groove* |
| 40 | +layers below, and is considered there, not bolted onto SNIF. |
34 | 41 |
|
35 | | -== Repository Future: The Universal Pattern Hub |
| 42 | +== Relationship to Groove and the Cleave |
36 | 43 |
|
37 | | -Per the v0.5 reposystem roadmap, this repository is transitioning from an Elixir-only research project into the **Universal Pattern Hub** for all Safe Native Interfaces across the estate (Rust/SPARK, Zig, and Ada). |
| 44 | +Three distinct layers; SNIF is the most conservative of them: |
| 45 | + |
| 46 | +* **SNIF — _perfecting an existing interface._** A SNIF **realizes a residue-clean cleave |
| 47 | + _instance_ at one boundary** (BEAM host ↔ native guest): a guest trap becomes |
| 48 | + `{:error, reason}`, the BEAM survives, and the error residue carries no recoverable guest |
| 49 | + value (the `SnifVerdict` deniability proofs). It is *an* instance of a cleave, **not "the |
| 50 | + cleave"** — the earlier phrasing "SNIFs provide the Physical Cleave Surface" overstated |
| 51 | + this and is corrected here. |
| 52 | +* **Cleave — _the new implementation of graduated integration._** A transmutable surface |
| 53 | + you can dial from near-raw FFI-ABI, through the SNIF sandbox (the safe *middle detent*), |
| 54 | + to a tight Groove-defined internal-api; closeable to a standalone secure surface. SNIF |
| 55 | + sits at the middle; the rest of the dial (transaction-gating, mode-indexed permissions, |
| 56 | + the well-founded "staircase" teardown) is **cleave scope, not SNIF scope**. |
| 57 | +* **Groove — _something new, to move beyond current interface design._** The protocol for |
| 58 | + *how services talk*: capability discovery + typed capability negotiation, soft (pub/sub) |
| 59 | + ↔ hard (in-process) integration modes. SNIF merely *consumes* Groove as a communication |
| 60 | + counterpart, and only at the v0.2 roadmap level — snifs ships no Groove code today. |
| 61 | + |
| 62 | +== Multi-language guests (still within the safer-NIF goal) |
| 63 | + |
| 64 | +The safer-NIF pattern is realizable across guest languages — Zig today, Rust→wasm32 wired, |
| 65 | +Ada/SPARK and estate wasm-native languages (typed-wasm/ephapax/affinescript) prospective. |
| 66 | +This is *breadth of guest language within the NIF goal*, **not** an expansion of SNIF's |
| 67 | +purpose. SNIF is not a "universal interface hub"; that "beyond current interface design" |
| 68 | +ambition lives in groove/cleave, not here. |
38 | 69 |
|
39 | 70 | == Evidence Index |
40 | 71 |
|
41 | 72 | [cols="2,3", options="header"] |
42 | 73 | |=== |
43 | 74 | | Path | Proves |
44 | | -| `zig/src/safe_nif.zig` | Implementation of trapped failure modes. |
45 | | -| `demo/test/snif_test.exs` | Integration tests verifying BEAM survival. |
46 | | -| `manifest.scm` | Guix environment for reproducible WASM builds. |
| 75 | +| `zig/src/safe_nif.zig` | Implementation of trapped failure modes (8 exports, ABI-modelled). |
| 76 | +| `demo/test/snif_demo_test.exs` | Integration tests verifying BEAM survival across every crash mode. |
| 77 | +| `verification/proofs/agda/SnifIsolation.agda` | SEC-1 operational crash-isolation, proven-modulo-explicit-TCB. |
| 78 | +| `verification/proofs/agda/SnifVerdict.agda` | Residue-clean (deniability) + non-forgery at the boundary. |
| 79 | +| `verification/tools/abi_conformance.py` | Model↔binary ABI drift gate (interface-level). |
47 | 80 | |=== |
0 commit comments