docs(ichor): fix named outer-only bus and Ada bridge status

This commit is contained in:
2026-11-01 18:49:50 -08:00
parent ec459c3ccc
commit 376275061c
+20 -26
View File
@@ -1,45 +1,39 @@
# D2 — The medium / "the blood" *(DESIGN-FIRST)* # D2 — Ichor: OUTER perfusion medium (Pony scaffold)
## 1. Component ## 1. Component
The perfusion bus the organs share — what circulates between Brain and periphery. The architecture is **Ichor is the outer perfusion bus** of the computational body: the circulatory medium linking **outer** organs (stomach/economy, MoRAG, SAE-related interfaces, microagents, external/world ingress) and the **Ada/SPARK D1 border**. The Brain and inner organs belong to the **inner Ada-routed Jorvik bus**, not to Ichor. Do not connect the Brain directly to the skin.
explicit that organs communicate by **perfusion, not direct wiring**; this is that medium. Currently
**unnamed and unimplemented**.
## 2. Status / certainty ## 2. Status / certainty
SCAFFOLD · named **Ichor**, Pony scaffold at `src/ichor/` (envelope + broker + D1 barrier + C seam). **Named and scaffolded**, not a completed cross-language circulation system. Pony actor Broker, immutable Envelope and Barrier stand-in exist under `core/src/ichor/`; an earlier ponyc 0.64.0 smoke run was reported green. This documentation edit does **not** rerun that test. The Ada bridge still has not replaced the Pony-local stand-in and out-of-process transport is unresolved.
**Compiles & runs** on ponyc 0.64.0 (smoke wiring green). Backing/transport now C3.
## 3. Language & location ## 3. Language & location
**Pony** (`src/ichor/`) — actor-model broker; capabilities give data-race-free sends. Transport split: Pony `core/src/ichor/`: `envelope.pony`, `broker.pony`, `barrier.pony`, `main.pony`, `ichor_ada_shim.c`; see `core/docs/bus-topology.md`. The C shim is not proof that real Ada `Trust_Guard` is wired.
Pony actors = the broker (hosted on the D1 barrier) + **C/Fortran** for the Ada-side binding
(`ichor_ada_shim.c`). Cross-language organs (R/Octave/Ada/Guile) connect to the broker.
## 4. Does / does-not ## 4. Does / does-not
- **Does:** carry organ secretions/injections between organs, always *through* Ada (D1) before reaching the Brain. - **Does:** deliver immutable envelopes between registered outer receivers; preserve source, destination, provenance and payload; send traffic destined for the `AdaBorder` receiver through a gate abstraction.
- **Does-not:** police (D1), enrich (organs), or hold state (storage E*). It is transport, not gate. - **Does not:** host the Brain, DriveBox/ETR inner workings, SOUL, Tarot or Jorvik; replace Ada's security decisions; originate cognitive content; act as durable memory.
- **Observed scaffold behavior:** the current Broker routes some outer-to-outer traffic directly; traffic destined to AdaBorder passes the Pony stand-in `Barrier.admit`. That stand-in is **not** real Ada enforcement. Avoid claiming every outer-to-outer message has already crossed the Ada border.
## 5. Interface contract (proposed) ## 5. Interface contract
- A typed envelope `{ from_organ, to, payload, provenance }` every organ emits/consumes. Current `Envelope` is an immutable `class val` with fields `source: OrganId`, `dest: OrganId`, `provenance: Provenance`, `payload: String`. `OrganId` enumerates outer endpoints (including `AdaBorder`, `Stomach`, `Microagents`, `SAE`, `MoRAG`, `World`). Provenance is independent from content classification.
- All cross-language organs (R Drive-Box, Octave ETR, Ada border, Guile mini-rag) speak this one shape →
this is what makes the polyglot body interoperate without bespoke per-pair wiring. **Proposed (not implemented):** Ayurvedic-inspired **humoral computational physiology**. The five elements / Vāta-Pitta-Kapha may become regulatory constructs; persistent local humoral state and discrete secretions have been discussed, but there is **no approved runtime state schema, law or envelope extension**. Do not silently add `humor`, `bile` or concentrations to the implemented envelope.
## 6. Dependencies & stubs ## 6. Dependencies & stubs
Everything rides it; nothing it depends on. *Stub today:* in-process function calls + canned envelopes Outer organs and Ada D1. The Pony→Ada production bridge and multi-process connections need design and tests. R/Octave DriveBox physiology interfaces should cross the appropriate inner/outer boundary, not become Pony `OrganId` enumeration members.
(which is exactly how the per-organ specs stub their I/O now — the medium formalizes those stubs).
## 7. Invariants / laws ## 7. Invariants / laws
- **L1 (C5):** perfusion, not direct wiring — no organ holds a hard reference to another's internals. - **L1:** perfusion between outer organs, without hard references to each other's internals.
- **L2 (C5):** everything reaching the Brain crosses **Ada (D1)** first. - **L2:** all content entering the Brain crosses the **actual** Ada D1 border first; a stand-in does not count.
- **L3 (C1):** envelope carries provenance (so D1 can enforce its provenance laws). - **L3:** the origin and authority of every envelope stay attributable; no reclassification by payload.
- **L4:** Ichor is strictly **OUTER**. Jorvik remains the inner Ada-routed bus.
- **L5:** experimental humoral state must not create an unguarded side-channel into the inner body or silently replace durable storage.
## 8. Build steps ## 8. Build steps
1. **Name it** + choose transport. 2. Define the envelope. 3. Replace the per-organ in-process stubs with Preserve the outer topology and current envelope; test Pony↔real Ada trust semantics before relying on gate guarantees. Then settle transport for non-Pony outer organs. Separately design humors/biles and their relationship to metabolic state; do not couple this unapproved idea into the DriveBox rewrite.
real medium calls, one edge of the DAG at a time (start R↔Octave for the Drive-Box, A8/A1).
## 9. Tests ## 9. Tests
Round-trip an envelope between two stub organs; assert it passes through a D1 `admit` check; provenance preserved. Pony smoke routing, provenance retention, rejection by real Ada `Trust_Guard`, cross-process routing, and no bypass into Jorvik/Brain. Historical smoke tests do not cover the unimplemented seam.
## 10. Open items ## 10. Open items
- ~~The name~~ (**Ichor**). ~~Transport choice~~ (**Pony broker + C/Fortran Ada seam**). Ada FFI integration, socket/process layer, reliable perfusion/idle timing, future humoral representation, concentrations/clearance, physiology↔DriveBox interfaces. The medium is **not unnamed**; its scope is **outer-only**.
- Build `ichor_ada_shim.c` into `libichor_ada` + wire `Barrier.admit` to Ada `Trust_Guard` (needs ponyc).
- Socket layer for out-of-process organs (in-process routing works today). Whether RDE drives idle-perfusion (C1).