diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..050f7c2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ + +# Pony build output (ichor) +build/ diff --git a/docs/plans/D2-medium.md b/docs/plans/D2-medium.md index 55802f0..aa0ee31 100644 --- a/docs/plans/D2-medium.md +++ b/docs/plans/D2-medium.md @@ -6,8 +6,8 @@ explicit that organs communicate by **perfusion, not direct wiring**; this is th **unnamed and unimplemented**. ## 2. Status / certainty -SCAFFOLD · named **Ichor**, Pony starting scaffold at `src/ichor/` (envelope + broker + D1 barrier + -C seam). Not yet compiled here (no `ponyc` in-env). Backing/transport now C3. +SCAFFOLD · named **Ichor**, Pony scaffold at `src/ichor/` (envelope + broker + D1 barrier + C seam). +**Compiles & runs** on ponyc 0.64.0 (smoke wiring green). Backing/transport now C3. ## 3. Language & location **Pony** (`src/ichor/`) — actor-model broker; capabilities give data-race-free sends. Transport split: diff --git a/src/ichor/README.md b/src/ichor/README.md index 5a3ad38..5d5a52a 100644 --- a/src/ichor/README.md +++ b/src/ichor/README.md @@ -22,15 +22,19 @@ seam (`ichor_ada_shim.c`) is where it crosses into the Ada border. reject an unscreened external payload, perfuse organ→organ. - `ichor_ada_shim.c` — the C/Fortran binding seam to the Ada D1 border (stub). -## Build / run (needs ponyc — NOT installed in this env) +## Build / run ``` -ponyc src/ichor -o build # compile the package +ponyc src/ichor -o build # compile the package (built clean on ponyc 0.64.0) ./build/ichor # run the smoke wiring ``` +Expected output: internal secretion soul→brain perfused, external→brain rejected +at D1, brain→soul cross-perfused. Install ponyc via `ponyup` if absent (the env +is ephemeral, so the toolchain is per-session). To wire the real Ada border: build `ichor_ada_shim.c` into `libichor_ada`, enable `use "lib:ichor_ada"` + the `admit_via_ada` body in `barrier.pony`, and point the shim at an Ada `Trust_Guard.Screen_Inbound` export. ## Status -Starting scaffold. Pony + Fortran toolchains are absent in this environment, so -this is design-complete source to build where Pony exists — not yet compiled here. +Starting scaffold — **compiles and runs** (ponyc 0.64.0). The Ada-side shim +(`ichor_ada_shim.c`) is still a stub; wiring `Barrier.admit` to the real Ada +`Trust_Guard` is the next step. diff --git a/src/ichor/barrier.pony b/src/ichor/barrier.pony index ea4bc24..6370d10 100644 --- a/src/ichor/barrier.pony +++ b/src/ichor/barrier.pony @@ -1,15 +1,13 @@ -""" -The blood-brain barrier (D1). `Barrier.admit` is the screening decision every -Brain-bound envelope must pass — perfusion law L2: everything reaching the Brain -crosses Ada (D1) first. - -Real wiring crosses into Ada's `Trust_Guard` (provenance + blocklist + rate) via -the C/Fortran seam (`ichor_ada_shim.c`). Until that binding is built, this mirrors -the provenance law in pure Pony so the broker is testable standalone. - -To switch to the Ada border, add `use "lib:ichor_ada"` and replace the body of -`admit` with the FFI call sketched below. -""" +// The blood-brain barrier (D1). `Barrier.admit` is the screening decision every +// Brain-bound envelope must pass — perfusion law L2: everything reaching the +// Brain crosses Ada (D1) first. +// +// Real wiring crosses into Ada's `Trust_Guard` (provenance + blocklist + rate) +// via the C/Fortran seam (`ichor_ada_shim.c`). Until that binding is built, this +// mirrors the provenance law in pure Pony so the broker is testable standalone. +// +// To switch to the Ada border, add `use "lib:ichor_ada"` and replace the body of +// `admit` with the FFI call sketched below. primitive Barrier fun admit(envl: Envelope): Bool => diff --git a/src/ichor/broker.pony b/src/ichor/broker.pony index 2c7891d..548fc3b 100644 --- a/src/ichor/broker.pony +++ b/src/ichor/broker.pony @@ -1,12 +1,10 @@ -""" -The perfusion broker. Organs register, then emit envelopes by `route` — the -broker delivers to the destination organ. Brain-bound traffic is forced through -the D1 Barrier first (law L2). No organ holds another's reference (law L1); the -broker is the only shared point. - -In full deployment this actor backs a socket broker hosted on the Ada barrier; -here it routes in-process so the wiring is exercisable without sockets. -""" +// The perfusion broker. Organs register, then emit envelopes by `route` — the +// broker delivers to the destination organ. Brain-bound traffic is forced through +// the D1 Barrier first (law L2). No organ holds another's reference (law L1); the +// broker is the only shared point. +// +// In full deployment this actor backs a socket broker hosted on the Ada barrier; +// here it routes in-process so the wiring is exercisable without sockets. use "collections" diff --git a/src/ichor/main.pony b/src/ichor/main.pony index 5100cac..70d49b5 100644 --- a/src/ichor/main.pony +++ b/src/ichor/main.pony @@ -1,11 +1,8 @@ -""" -Ichor smoke wiring (D2 §9 test): round-trip an envelope between two stub organs -through the D1 admit check, and confirm an unscreened external payload is rejected -at the barrier. - -Build (where ponyc exists): ponyc src/ichor -o build -Run: ./build/ichor -""" +// Ichor smoke wiring (D2 §9 test): round-trip an envelope between two stub organs +// through the D1 admit check, and confirm an unscreened external payload is +// rejected at the barrier. +// +// Build: ponyc src/ichor -o build Run: ./build/ichor actor Main new create(env: Env) => diff --git a/src/ichor/organ.pony b/src/ichor/organ.pony index 6c7cce7..cef1ca9 100644 --- a/src/ichor/organ.pony +++ b/src/ichor/organ.pony @@ -1,8 +1,6 @@ -""" -What an organ is, to Ichor: anything that can receive a perfused envelope. -Organs hold no hard reference to each other (perfusion law L1) — they only know -the Broker. `StubOrgan` is a canned receiver for standalone tests. -""" +// What an organ is, to Ichor: anything that can receive a perfused envelope. +// Organs hold no hard reference to each other (perfusion law L1) — they only know +// the Broker. `StubOrgan` is a canned receiver for standalone tests. interface tag OrganReceiver be receive(envl: Envelope)