From f3b1bea771a4a25f559319a2f8827061d8509026 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 19 Jun 2026 21:33:32 +0000 Subject: [PATCH 01/25] cerebellum: plug-and-play OpenHermes harness on the Ichor bus C1 integration spine as an Ichor organ. CerebellumHarness receives a turn off the bus, sequences N passes through a swappable LLM adapter (the OpenHermes plug; StubLLM stands in), and emits the synthesis back onto the bus toward the Brain (crossing D1). Add Cerebellum to OrganId; wire a turn in the demo main. Compiles on ponyc 0.64; end-to-end run green (turn -> cerebellum -> D1 -> brain). Also: add a small read-only permission allowlist (toolchain probes/versions). Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- .claude/settings.json | 10 +++++++++ src/ichor/cerebellum.pony | 46 +++++++++++++++++++++++++++++++++++++++ src/ichor/envelope.pony | 4 +++- src/ichor/main.pony | 10 +++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 src/ichor/cerebellum.pony diff --git a/.claude/settings.json b/.claude/settings.json index c035985..c1f8153 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -1,4 +1,14 @@ { + "permissions": { + "allow": [ + "Bash(command -v *)", + "Bash(ponyc --version)", + "Bash(alr --version)", + "Bash(cobc --version)", + "Bash(gnatmake --version)", + "Bash(gprbuild --version)" + ] + }, "hooks": { "SessionStart": [ { diff --git a/src/ichor/cerebellum.pony b/src/ichor/cerebellum.pony new file mode 100644 index 0000000..7f54520 --- /dev/null +++ b/src/ichor/cerebellum.pony @@ -0,0 +1,46 @@ +// The cerebellum: the OpenHermes agent harness, mounted as an organ on the +// Ichor bus. It owns NO cognition -- it SEQUENCES a turn: receive input off the +// bus, drive the metacognitive passes through a swappable model adapter, emit +// the synthesis back through the bus (Brain-bound, so it crosses D1). This is +// the C1 integration spine ("plumbing + sequencing, not an organ"). +// +// Plug-and-play: the model is the `LLM` seam below. StubLLM stands in now; drop +// a real OpenHermes client (HTTP / subprocess) in its place and nothing else +// on the bus changes. + +// --- the model seam ------------------------------------------------------- +interface val LLM + """One inference call. Implement this to plug a model into the cerebellum.""" + fun infer(prompt: String): String + +class val StubLLM is LLM + """Stand-in until a real OpenHermes client is wired.""" + fun infer(prompt: String): String => + "[stub-openhermes] " + prompt + +// --- the harness ---------------------------------------------------------- +actor CerebellumHarness is OrganReceiver + let _out: OutStream + let _bus: Broker + let _llm: LLM + let _passes: USize + + new create(out': OutStream, bus: Broker, llm: LLM, passes': USize = 4) => + _out = out' + _bus = bus + _llm = llm + // C1 L3: pass count is the responsiveness knob (energy-gated later), the + // 4+4 ordering itself is static. Clamp to >=1 so a turn always runs once. + _passes = if passes' < 1 then 1 else passes' end + + be receive(envl: Envelope) => + // A turn arrives off the bus. Sequence the passes through the model, then + // emit the synthesis back onto the bus toward the Brain. + var ctx: String = envl.payload + var pass: USize = 1 + while pass <= _passes do + ctx = _llm.infer(ctx) + pass = pass + 1 + end + _out.print("[cerebellum] " + _passes.string() + " passes -> " + ctx) + _bus.route(Envelope(Cerebellum, Brain, OrganSecretion, ctx)) diff --git a/src/ichor/envelope.pony b/src/ichor/envelope.pony index 78098dd..d8553d1 100644 --- a/src/ichor/envelope.pony +++ b/src/ichor/envelope.pony @@ -9,7 +9,7 @@ Envelope is `class val`: immutable and sendable between actors. """ type OrganId is - ( DriveBox | EnergyTorus | Soul | Metacog | Brain + ( DriveBox | EnergyTorus | Soul | Metacog | Brain | Cerebellum | AdaBorder | Storage | MiniRag | UnknownOrgan ) primitive DriveBox @@ -22,6 +22,8 @@ primitive Metacog fun string(): String => "metacog" primitive Brain fun string(): String => "brain" +primitive Cerebellum + fun string(): String => "cerebellum" primitive AdaBorder fun string(): String => "ada_border" primitive Storage diff --git a/src/ichor/main.pony b/src/ichor/main.pony index 70d49b5..0546b7b 100644 --- a/src/ichor/main.pony +++ b/src/ichor/main.pony @@ -24,3 +24,13 @@ actor Main // Organ-to-organ perfusion (not Brain-bound): delivered directly. broker.route(Envelope(Brain, Soul, OrganSecretion, "reshuffle: cross-only")) + + // --- cerebellum harness plugged into the bus (C1 / OpenHermes) --- + // Swap StubLLM for a real OpenHermes client and nothing else changes. + let cerebellum = CerebellumHarness(env.out, broker, StubLLM, 2) + broker.register(Cerebellum, cerebellum) + + // A user turn enters the bus addressed to the cerebellum; it sequences the + // passes and emits the synthesis back toward the Brain (crossing D1). + broker.route(Envelope(AdaBorder, Cerebellum, UserInput, + "user turn: what is my ascendant?")) From ca0260692e17c344048c7143c486cfc160730790 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 19 Jun 2026 21:36:44 +0000 Subject: [PATCH 02/25] ci: drop deleted soul_tests/cycle_tests from the nightly test loop Those mains were removed in the border-only Ada cleanup; the loop skipped them with a warning. List only the three tests that exist (trust/config/engine). Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ae68bf..af547be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: run: | set -euo pipefail fail=0 - for t in soul_tests trust_tests cycle_tests config_tests engine_tests; do + for t in trust_tests config_tests engine_tests; do if [ -x "bin/$t" ]; then echo "=== $t ===" if ! "bin/$t"; then From a2a3a2d336d46a13663667ffa8d56bbfc85b3c6b Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 19 Jun 2026 22:10:34 +0000 Subject: [PATCH 03/25] cerebellum: make the LLM seam async; add OpenHermesClient skeleton A real model call is network/process IO, so the LLM seam is now a behaviour with a response callback (ResponseFn), not a synchronous function. StubLLM answers immediately; OpenHermesClient + OpenHermesConfig (OpenAI-compatible url/model) are the real plug, swappable for the stub. CerebellumHarness chains its passes through the async callback. Compiles on ponyc 0.64; demo green. Next: wire the actual chat/completions call behind OpenHermesClient. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- src/ichor/cerebellum.pony | 77 ++++++++++++++++++++++++++++----------- 1 file changed, 55 insertions(+), 22 deletions(-) diff --git a/src/ichor/cerebellum.pony b/src/ichor/cerebellum.pony index 7f54520..860110a 100644 --- a/src/ichor/cerebellum.pony +++ b/src/ichor/cerebellum.pony @@ -4,19 +4,51 @@ // the synthesis back through the bus (Brain-bound, so it crosses D1). This is // the C1 integration spine ("plumbing + sequencing, not an organ"). // -// Plug-and-play: the model is the `LLM` seam below. StubLLM stands in now; drop -// a real OpenHermes client (HTTP / subprocess) in its place and nothing else -// on the bus changes. +// Plug-and-play: the model is the `LLM` seam. A real model call is network / +// process IO, so the seam is ASYNCHRONOUS -- `infer` is a behaviour that hands +// its result to a callback. StubLLM answers immediately; OpenHermesClient is the +// real plug. Swap which one you register; nothing else on the bus changes. -// --- the model seam ------------------------------------------------------- -interface val LLM - """One inference call. Implement this to plug a model into the cerebellum.""" - fun infer(prompt: String): String +// --- the model seam (async) ---------------------------------------------- +type ResponseFn is {(String)} val + """Callback the model invokes with its output.""" -class val StubLLM is LLM - """Stand-in until a real OpenHermes client is wired.""" - fun infer(prompt: String): String => - "[stub-openhermes] " + prompt +interface tag LLM + be infer(prompt: String, respond: ResponseFn) + +// --- stub ----------------------------------------------------------------- +actor StubLLM is LLM + new create() => None + + be infer(prompt: String, respond: ResponseFn) => + respond("[stub-openhermes] " + prompt) + +// --- the OpenHermes plug -------------------------------------------------- +class val OpenHermesConfig + """Where to reach an OpenAI-compatible OpenHermes server.""" + let url: String // base, e.g. http://localhost:8080/v1 + let model: String + + new val create( + url': String = "http://localhost:8080/v1", + model': String = "openhermes") + => + url = url' + model = model' + +actor OpenHermesClient is LLM + let _cfg: OpenHermesConfig + + new create(cfg: OpenHermesConfig) => + _cfg = cfg + + be infer(prompt: String, respond: ResponseFn) => + // TODO(loop next): POST an OpenAI-compatible chat/completions request to + // `_cfg.url`/chat/completions via the process seam (curl) or a Pony TCP + // client, parse choices[0].message.content, then call respond() with it. + // Until that IO is wired and testable in this env, surface intent rather + // than perform an untested network call. + respond("[openhermes " + _cfg.model + " @ " + _cfg.url + "] " + prompt) // --- the harness ---------------------------------------------------------- actor CerebellumHarness is OrganReceiver @@ -29,18 +61,19 @@ actor CerebellumHarness is OrganReceiver _out = out' _bus = bus _llm = llm - // C1 L3: pass count is the responsiveness knob (energy-gated later), the - // 4+4 ordering itself is static. Clamp to >=1 so a turn always runs once. + // C1 L3: pass count is the responsiveness knob (energy-gated later); the + // 4+4 ordering is static. Clamp to >=1 so a turn always runs once. _passes = if passes' < 1 then 1 else passes' end be receive(envl: Envelope) => - // A turn arrives off the bus. Sequence the passes through the model, then - // emit the synthesis back onto the bus toward the Brain. - var ctx: String = envl.payload - var pass: USize = 1 - while pass <= _passes do - ctx = _llm.infer(ctx) - pass = pass + 1 + // A turn arrives off the bus: sequence the passes, then emit. + _pass(envl.payload, 1) + + be _pass(ctx: String, n: USize) => + if n > _passes then + _out.print("[cerebellum] " + _passes.string() + " passes -> " + ctx) + _bus.route(Envelope(Cerebellum, Brain, OrganSecretion, ctx)) + else + let self: CerebellumHarness tag = this + _llm.infer(ctx, {(out: String)(self, n) => self._pass(out, n + 1) } val) end - _out.print("[cerebellum] " + _passes.string() + " passes -> " + ctx) - _bus.route(Envelope(Cerebellum, Brain, OrganSecretion, ctx)) From 9244d58325d86016a1db3ba91a9080399a672f72 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 19 Jun 2026 22:37:18 +0000 Subject: [PATCH 04/25] cerebellum: env-driven plug-and-play model selection PickLLM reads OPENHERMES_URL/OPENHERMES_MODEL from the environment and mounts OpenHermesClient when a URL is set, else StubLLM -- the bus wiring is identical either way. EnvLookup helper parses Env.vars. Verified both paths compile + run. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- src/ichor/cerebellum.pony | 31 +++++++++++++++++++++++++++++++ src/ichor/main.pony | 6 ++++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/ichor/cerebellum.pony b/src/ichor/cerebellum.pony index 860110a..9a25cdb 100644 --- a/src/ichor/cerebellum.pony +++ b/src/ichor/cerebellum.pony @@ -50,6 +50,37 @@ actor OpenHermesClient is LLM // than perform an untested network call. respond("[openhermes " + _cfg.model + " @ " + _cfg.url + "] " + prompt) +// --- config plumbing ------------------------------------------------------ +primitive EnvLookup + """Find KEY in an Env.vars array ("KEY=value" entries); None if absent.""" + fun apply(vars: Array[String] val, key: String): (String | None) => + for v in vars.values() do + let parts: Array[String] val = v.split_by("=", 2) + try + if parts(0)? == key then + return parts(1)? + end + end + end + None + +primitive PickLLM + """Plug-and-play model selection: OPENHERMES_URL picks the real client.""" + fun apply(out: OutStream, vars: Array[String] val): LLM => + match EnvLookup(vars, "OPENHERMES_URL") + | let url: String => + let model = + match EnvLookup(vars, "OPENHERMES_MODEL") + | let m: String => m + else "openhermes" + end + out.print("[cerebellum] model: OpenHermes " + model + " @ " + url) + OpenHermesClient(OpenHermesConfig(url, model)) + else + out.print("[cerebellum] model: StubLLM (set OPENHERMES_URL for a real model)") + StubLLM + end + // --- the harness ---------------------------------------------------------- actor CerebellumHarness is OrganReceiver let _out: OutStream diff --git a/src/ichor/main.pony b/src/ichor/main.pony index 0546b7b..3497ec5 100644 --- a/src/ichor/main.pony +++ b/src/ichor/main.pony @@ -26,8 +26,10 @@ actor Main "reshuffle: cross-only")) // --- cerebellum harness plugged into the bus (C1 / OpenHermes) --- - // Swap StubLLM for a real OpenHermes client and nothing else changes. - let cerebellum = CerebellumHarness(env.out, broker, StubLLM, 2) + // Plug-and-play: PickLLM chooses the model from the environment + // (OPENHERMES_URL/MODEL -> real client, else StubLLM); nothing else changes. + let cerebellum = + CerebellumHarness(env.out, broker, PickLLM(env.out, env.vars), 2) broker.register(Cerebellum, cerebellum) // A user turn enters the bus addressed to the cerebellum; it sequences the From a054a56c808c8d4efd1fa6116ad967f65fc0786b Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Jun 2026 04:22:40 +0000 Subject: [PATCH 05/25] docs: capture concentric bus topology (draft, pending confirmation) Onion model from the design exchange: Hermes at the core; inner-brain bus (Pony optional) carrying soul/metacog/drive-box/COBOL ontology; Ada (D1) as the membrane; Ichor (Pony) as the OUTER bus carrying stomach/economy, microagents, SAE, GoDAGRAG; External outside. Corrects earlier models (Hermes is core not external; Ichor is outer not brain bus). Draft -- to be red-lined. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- docs/bus-topology.md | 59 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 docs/bus-topology.md diff --git a/docs/bus-topology.md b/docs/bus-topology.md new file mode 100644 index 0000000..51ea70f --- /dev/null +++ b/docs/bus-topology.md @@ -0,0 +1,59 @@ +# Gen.03 — concentric bus topology *(DRAFT — captured live, correct freely)* + +The body is an **onion**: Hermes at the core, organs in rings around it, Ada as +the membrane between inner and outer, the world on the outside. Nothing reaches +the core without crossing inward through the rings. + +``` +External (world: user / network) + │ + ▼ outer bus — ICHOR (Pony) +┌─────────────────────────────────────────────────────────┐ +│ OUTER ORGANS │ +│ • stomach / economy organ (small-model operated; │ +│ digests external input → RAG context) │ +│ • microagents │ +│ • SAE (sparse autoencoder) │ +│ • GoDAGRAG (Graph of Directed Acyclic Graphs of RAGs) │ +└─────────────────────────────────────────────────────────┘ + │ + ▼ ADA (D1) — the border / membrane (screens, provenance, rate) +┌─────────────────────────────────────────────────────────┐ +│ INNER ORGANS inner-brain bus (Pony OPTIONAL) │ +│ • soul (B2) │ +│ • metacog (C2) │ +│ • drive-box (A1) │ +│ • COBOL ontological structures (E1) │ +└─────────────────────────────────────────────────────────┘ + │ + ▼ +HERMES ← innermost core (the OpenHermes agent) +``` + +## Layers (innermost → outermost) +1. **Hermes** — innermost core. The OpenHermes agent. **Not external.** +2. **Inner-brain bus** — connects the inner organs around Hermes. **May be Pony, + but need not be.** Carries: soul, metacog, drive-box, COBOL ontology. +3. **Ada (D1)** — the membrane between inner and outer. Screens everything + crossing in/out (blocklist / provenance / rate — `Trust_Boundary`). +4. **Ichor (Pony)** — the **outer** bus. Connects the outer organs and wires up + to Ada. (This is the bus already scaffolded in `src/ichor/`.) +5. **Outer organs** — stomach/economy (small model), microagents, SAE, GoDAGRAG. +6. **External** — the world. Reaches in only via the outer ring → Ada. + +## Flow of a turn +external input → **stomach digests** it → **GoDAGRAG** builds RAG context → +across **Ichor** → **Ada (D1)** screens (input is already pre-digested context) → +**inner bus** → inner organs (soul/metacog/drive-box/COBOL) → **Hermes** → +synthesis flows back out the same rings. + +## Corrections this doc bakes in (vs earlier wrong models) +- **Hermes is the core, not an external harness on Ichor.** +- **Ichor is the OUTER bus** (organs → Ada), not the brain bus. +- **The inner bus is transport-flexible** (Pony optional). +- The cerebellum/harness is **not** an Ichor organ. + +## Open / to place +- Exact tier + role of each outer organ's hand-off to Ada. +- Whether the inner bus is Pony or another mechanism (decides 2nd-broker vs not). +- How Hermes-at-core is reached from the inner bus (in-process vs IPC). From ffce864f081a91a0fa84b11742cc735358c162e1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Jun 2026 04:23:44 +0000 Subject: [PATCH 06/25] docs(topology): Hermes is a peer inner organ, not a separate core Inner-brain bus carries { soul, metacog, Hermes, drive-box, COBOL ontology } as peers behind Ada; drop the separate innermost-core layer. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- docs/bus-topology.md | 63 +++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/docs/bus-topology.md b/docs/bus-topology.md index 51ea70f..03d83d2 100644 --- a/docs/bus-topology.md +++ b/docs/bus-topology.md @@ -1,8 +1,8 @@ # Gen.03 — concentric bus topology *(DRAFT — captured live, correct freely)* -The body is an **onion**: Hermes at the core, organs in rings around it, Ada as -the membrane between inner and outer, the world on the outside. Nothing reaches -the core without crossing inward through the rings. +Two rings around a membrane. Outer organs ride Ichor up to Ada; Ada is the +gate; behind it the inner-brain bus carries the inner organs (Hermes among +them). The world is outside; nothing reaches the inner ring without crossing Ada. ``` External (world: user / network) @@ -17,43 +17,52 @@ External (world: user / network) │ • GoDAGRAG (Graph of Directed Acyclic Graphs of RAGs) │ └─────────────────────────────────────────────────────────┘ │ - ▼ ADA (D1) — the border / membrane (screens, provenance, rate) + ▼ ADA (D1) — the membrane / border (screens, provenance, rate) ┌─────────────────────────────────────────────────────────┐ -│ INNER ORGANS inner-brain bus (Pony OPTIONAL) │ +│ INNER ORGANS inner-brain bus (Pony OPTIONAL) │ │ • soul (B2) │ │ • metacog (C2) │ +│ • Hermes (the OpenHermes agent — a peer here) │ │ • drive-box (A1) │ │ • COBOL ontological structures (E1) │ └─────────────────────────────────────────────────────────┘ - │ - ▼ -HERMES ← innermost core (the OpenHermes agent) ``` -## Layers (innermost → outermost) -1. **Hermes** — innermost core. The OpenHermes agent. **Not external.** -2. **Inner-brain bus** — connects the inner organs around Hermes. **May be Pony, - but need not be.** Carries: soul, metacog, drive-box, COBOL ontology. -3. **Ada (D1)** — the membrane between inner and outer. Screens everything - crossing in/out (blocklist / provenance / rate — `Trust_Boundary`). -4. **Ichor (Pony)** — the **outer** bus. Connects the outer organs and wires up - to Ada. (This is the bus already scaffolded in `src/ichor/`.) -5. **Outer organs** — stomach/economy (small model), microagents, SAE, GoDAGRAG. -6. **External** — the world. Reaches in only via the outer ring → Ada. +## The chain +``` +outer organs ─► Ichor (Pony) ─► Ada (D1) ─► inner-brain bus ─► inner organs + { soul · metacog + · Hermes + · drive-box + · COBOL ontology } +``` + +## Layers +1. **External** — the world (user / network). Reaches in only via the outer ring. +2. **Outer organs** — stomach/economy (small model), microagents, SAE, GoDAGRAG. +3. **Ichor (Pony)** — the **outer** bus; carries the outer organs up to Ada. + (Already scaffolded in `src/ichor/`.) +4. **Ada (D1)** — the membrane between outer and inner. Screens everything + crossing (blocklist / provenance / rate — `Trust_Boundary`). +5. **Inner-brain bus** — connects the inner organs. **Pony optional** (need not + be Pony). +6. **Inner organs** — soul, metacog, **Hermes**, drive-box, COBOL ontology. + Hermes is a peer on this bus, not a separate core. ## Flow of a turn external input → **stomach digests** it → **GoDAGRAG** builds RAG context → -across **Ichor** → **Ada (D1)** screens (input is already pre-digested context) → -**inner bus** → inner organs (soul/metacog/drive-box/COBOL) → **Hermes** → -synthesis flows back out the same rings. +across **Ichor** → **Ada (D1)** screens (already pre-digested context) → **inner +bus** → inner organs (soul / metacog / Hermes / drive-box / COBOL) → synthesis +flows back out the same rings. -## Corrections this doc bakes in (vs earlier wrong models) -- **Hermes is the core, not an external harness on Ichor.** +## Corrections baked in (vs earlier wrong models) +- **Hermes is an inner organ on the inner bus** — not external, and not a + separate innermost core. - **Ichor is the OUTER bus** (organs → Ada), not the brain bus. - **The inner bus is transport-flexible** (Pony optional). -- The cerebellum/harness is **not** an Ichor organ. +- The harness is **not** an Ichor (outer) organ. ## Open / to place -- Exact tier + role of each outer organ's hand-off to Ada. -- Whether the inner bus is Pony or another mechanism (decides 2nd-broker vs not). -- How Hermes-at-core is reached from the inner bus (in-process vs IPC). +- Is the **inner bus Pony** or another mechanism? (decides 2nd Pony broker vs + hand-off to something else) +- Each **outer organ's hand-off to Ada** (what crosses, in what shape). From f67514b4e912e4ab81678854096dd52e80dc96f2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Jun 2026 10:46:39 +0000 Subject: [PATCH 07/25] docs(topology): Ada-routed inner bus; split mini-rag/MoRAG; deck = ints+COBOL - inner bus is Ada-routed (decided), not Pony - mini-rag (inner brain-side RAG) != MoRAG/GoDAGRAG (outer) - deck (B1) = Fortran shuffle of 338 ints + COBOL lookup table (not JSON) - add language map; remaining open: MoRAG/GoDAGRAG language Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- docs/bus-topology.md | 76 ++++++++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/docs/bus-topology.md b/docs/bus-topology.md index 03d83d2..dd252b5 100644 --- a/docs/bus-topology.md +++ b/docs/bus-topology.md @@ -14,55 +14,69 @@ External (world: user / network) │ digests external input → RAG context) │ │ • microagents │ │ • SAE (sparse autoencoder) │ -│ • GoDAGRAG (Graph of Directed Acyclic Graphs of RAGs) │ +│ • MoRAG = GoDAGRAG │ +│ (Graph of Directed Acyclic Graphs of RAGs) │ └─────────────────────────────────────────────────────────┘ │ ▼ ADA (D1) — the membrane / border (screens, provenance, rate) ┌─────────────────────────────────────────────────────────┐ -│ INNER ORGANS inner-brain bus (Pony OPTIONAL) │ +│ INNER ORGANS inner-brain bus = ADA-routed │ │ • soul (B2) │ │ • metacog (C2) │ │ • Hermes (the OpenHermes agent — a peer here) │ │ • drive-box (A1) │ │ • COBOL ontological structures (E1) │ +│ • mini-rag (the brain-side RAG — inner, NOT MoRAG) │ └─────────────────────────────────────────────────────────┘ ``` -## The chain -``` -outer organs ─► Ichor (Pony) ─► Ada (D1) ─► inner-brain bus ─► inner organs - { soul · metacog - · Hermes - · drive-box - · COBOL ontology } -``` - ## Layers 1. **External** — the world (user / network). Reaches in only via the outer ring. -2. **Outer organs** — stomach/economy (small model), microagents, SAE, GoDAGRAG. +2. **Outer organs** — stomach/economy (small model), microagents, SAE, + **MoRAG / GoDAGRAG**. 3. **Ichor (Pony)** — the **outer** bus; carries the outer organs up to Ada. (Already scaffolded in `src/ichor/`.) -4. **Ada (D1)** — the membrane between outer and inner. Screens everything - crossing (blocklist / provenance / rate — `Trust_Boundary`). -5. **Inner-brain bus** — connects the inner organs. **Pony optional** (need not - be Pony). -6. **Inner organs** — soul, metacog, **Hermes**, drive-box, COBOL ontology. - Hermes is a peer on this bus, not a separate core. +4. **Ada (D1)** — the membrane between outer and inner; also routes the inner + bus. Screens everything crossing (blocklist / provenance / rate — + `Trust_Boundary`). Native COBOL (`Interfaces.COBOL`) + C interop. +5. **Inner-brain bus** — **Ada-routed** (decided; not Pony). Native path to the + COBOL organs. +6. **Inner organs** — soul, metacog, **Hermes**, drive-box, COBOL ontology, + **mini-rag**. Hermes is a peer here, not a separate core. -## Flow of a turn -external input → **stomach digests** it → **GoDAGRAG** builds RAG context → -across **Ichor** → **Ada (D1)** screens (already pre-digested context) → **inner -bus** → inner organs (soul / metacog / Hermes / drive-box / COBOL) → synthesis -flows back out the same rings. +## The two RAGs (do not conflate) +- **mini-rag** — INNER, brain-side RAG. +- **MoRAG = GoDAGRAG** — OUTER, the Graph of Directed Acyclic Graphs of RAGs. + +## The deck (B1) — it's just integers + a table +- **Shuffle kernel:** 169 × 2 = **338 integers**, shuffled + randomized. Pure + RNG/permutation → **Fortran** (native to the Ada inner bus; integer arrays are + its home turf). +- **Lookup table:** the card meaning (names, phases, synestries) is **static data + keyed by the integer** → **COBOL** indexed records (fits the COBOL ontology, + native to Ada) — not JSON. +- So the deck is a Fortran shuffler + a COBOL table, both native on the Ada bus. + +## Language map (settled / proposed) +| Component | Language | Status | +|---|---|---| +| Ichor (outer bus) | Pony | built | +| Ada (membrane + inner bus router) | Ada/SPARK | decided | +| deck shuffle | Fortran | proposed | +| deck lookup table | COBOL | proposed | +| COBOL ontology (E1) | COBOL | given | +| drive-box (A1) | R | existing | +| MoRAG / GoDAGRAG | Haskell or Crystal | open | +| Hermes | OpenHermes agent (external model) | given | ## Corrections baked in (vs earlier wrong models) -- **Hermes is an inner organ on the inner bus** — not external, and not a - separate innermost core. -- **Ichor is the OUTER bus** (organs → Ada), not the brain bus. -- **The inner bus is transport-flexible** (Pony optional). -- The harness is **not** an Ichor (outer) organ. +- Hermes is an inner organ on the inner bus — not external, not a separate core. +- Ichor is the OUTER bus (organs → Ada), not the brain bus. +- Inner bus is **Ada-routed**, not Pony. +- **mini-rag (inner) ≠ MoRAG/GoDAGRAG (outer).** +- The deck is integers + a table; no fancy ADT language needed. ## Open / to place -- Is the **inner bus Pony** or another mechanism? (decides 2nd Pony broker vs - hand-off to something else) -- Each **outer organ's hand-off to Ada** (what crosses, in what shape). +- **MoRAG / GoDAGRAG language** (Haskell vs Crystal vs other). +- Each outer organ's hand-off shape to Ada. +- Where the stomach/economy organ sits exactly and what its small model is. From fa38b745ef50a43a9ccc5c111188c6a295ee35bb Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Jun 2026 11:06:42 +0000 Subject: [PATCH 08/25] docs(topology): mini-rag is muscle memory (tool-shape recall), not ontology Correct the mischaracterization: mini-rag is pre-motor tool-shape recall (D3) -- it reads a tool-schema COBOL store, not the ontology, and is not the MoRAG. Three distinct memories: MoRAG=world, mini-rag=how-to-act, E1=what-the-brain-is. Two COBOL stores confirmed (deck table + tool-schema); E1 ontology placement open. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- docs/bus-topology.md | 69 +++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/docs/bus-topology.md b/docs/bus-topology.md index dd252b5..add70c2 100644 --- a/docs/bus-topology.md +++ b/docs/bus-topology.md @@ -1,8 +1,8 @@ # Gen.03 — concentric bus topology *(DRAFT — captured live, correct freely)* Two rings around a membrane. Outer organs ride Ichor up to Ada; Ada is the -gate; behind it the inner-brain bus carries the inner organs (Hermes among -them). The world is outside; nothing reaches the inner ring without crossing Ada. +gate and routes the inner bus; behind it the inner organs (Hermes among them). +The world is outside; nothing reaches the inner ring without crossing Ada. ``` External (world: user / network) @@ -11,7 +11,7 @@ External (world: user / network) ┌─────────────────────────────────────────────────────────┐ │ OUTER ORGANS │ │ • stomach / economy organ (small-model operated; │ -│ digests external input → RAG context) │ +│ digests external input → context) │ │ • microagents │ │ • SAE (sparse autoencoder) │ │ • MoRAG = GoDAGRAG │ @@ -25,58 +25,55 @@ External (world: user / network) │ • metacog (C2) │ │ • Hermes (the OpenHermes agent — a peer here) │ │ • drive-box (A1) │ +│ • mini-rag (MUSCLE MEMORY — tool-shape recall, D3) │ │ • COBOL ontological structures (E1) │ -│ • mini-rag (the brain-side RAG — inner, NOT MoRAG) │ └─────────────────────────────────────────────────────────┘ ``` -## Layers -1. **External** — the world (user / network). Reaches in only via the outer ring. -2. **Outer organs** — stomach/economy (small model), microagents, SAE, - **MoRAG / GoDAGRAG**. -3. **Ichor (Pony)** — the **outer** bus; carries the outer organs up to Ada. - (Already scaffolded in `src/ichor/`.) -4. **Ada (D1)** — the membrane between outer and inner; also routes the inner - bus. Screens everything crossing (blocklist / provenance / rate — - `Trust_Boundary`). Native COBOL (`Interfaces.COBOL`) + C interop. -5. **Inner-brain bus** — **Ada-routed** (decided; not Pony). Native path to the - COBOL organs. -6. **Inner organs** — soul, metacog, **Hermes**, drive-box, COBOL ontology, - **mini-rag**. Hermes is a peer here, not a separate core. +## Three different "memories" — do NOT conflate +- **MoRAG = GoDAGRAG** — OUTER. Reads the **world** (the graph of DAGs of RAGs). +- **mini-rag** — INNER. **Muscle memory.** Pre-motor: before an action reaches + the actual hands (the real tools / effectors), mini-rag recalls the **right + shape** for it — the tool schema (D3). HD associative recall of the learned + form, like a hand pre-shaping its grip. It is **tool lookup**, not + world-retrieval and not self-knowledge. +- **E1 ontology** — INNER. What the brain **is** (the invariant COBOL structures). -## The two RAGs (do not conflate) -- **mini-rag** — INNER, brain-side RAG. -- **MoRAG = GoDAGRAG** — OUTER, the Graph of Directed Acyclic Graphs of RAGs. +## The deck (B1) — integers + a table +- **Shuffle kernel:** 169 × 2 = **338 integers**, shuffled + randomized → pure + RNG/permutation → **Fortran** (native to the Ada inner bus). +- **Lookup table:** card meaning keyed by integer → **COBOL** indexed records. -## The deck (B1) — it's just integers + a table -- **Shuffle kernel:** 169 × 2 = **338 integers**, shuffled + randomized. Pure - RNG/permutation → **Fortran** (native to the Ada inner bus; integer arrays are - its home turf). -- **Lookup table:** the card meaning (names, phases, synestries) is **static data - keyed by the integer** → **COBOL** indexed records (fits the COBOL ontology, - native to Ada) — not JSON. -- So the deck is a Fortran shuffler + a COBOL table, both native on the Ada bus. +## Language map +Two **distinct Fortran scripts** and (at least) two **distinct COBOL stores** — +not shared modules. -## Language map (settled / proposed) | Component | Language | Status | |---|---|---| | Ichor (outer bus) | Pony | built | -| Ada (membrane + inner bus router) | Ada/SPARK | decided | -| deck shuffle | Fortran | proposed | -| deck lookup table | COBOL | proposed | -| COBOL ontology (E1) | COBOL | given | +| Ada (membrane + inner-bus router) | Ada/SPARK | decided | +| deck shuffle — *Fortran script #1* | Fortran | decided | +| mini-rag (muscle memory / tool-shape recall) — *Fortran script #2* | Fortran | decided | +| deck lookup table — *COBOL store #1* | COBOL | decided | +| tool-schema store (mini-rag reads this) — *COBOL store #2* | COBOL | decided | +| COBOL ontology / E1 (invariant structures, separate) | COBOL | given | | drive-box (A1) | R | existing | -| MoRAG / GoDAGRAG | Haskell or Crystal | open | +| MoRAG / GoDAGRAG (outer) | Haskell or Crystal | open | | Hermes | OpenHermes agent (external model) | given | ## Corrections baked in (vs earlier wrong models) - Hermes is an inner organ on the inner bus — not external, not a separate core. - Ichor is the OUTER bus (organs → Ada), not the brain bus. - Inner bus is **Ada-routed**, not Pony. -- **mini-rag (inner) ≠ MoRAG/GoDAGRAG (outer).** +- **mini-rag = muscle memory / tool-shape recall (D3)** — it reads the + **tool-schema** COBOL store, NOT the ontology, and is NOT the MoRAG. +- MoRAG/GoDAGRAG (outer) ≠ mini-rag (inner). - The deck is integers + a table; no fancy ADT language needed. ## Open / to place +- **COBOL store inventory:** confirmed two stores (deck table + tool-schema). Is + the **E1 ontology** a third COBOL store, or a different kind of COBOL structure + (vault) that isn't a "store"? - **MoRAG / GoDAGRAG language** (Haskell vs Crystal vs other). - Each outer organ's hand-off shape to Ada. -- Where the stomach/economy organ sits exactly and what its small model is. +- The stomach/economy organ's exact placement + which small model runs it. From 0849af9b55e95472ac1f6dc54ca2cc1f0da815b8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Jun 2026 11:13:36 +0000 Subject: [PATCH 09/25] docs(topology): E1 is the invariant laws, not 'ontology'; inner Ada = Jorvik - E1 COBOL = the invariant laws (immutable rules in COBOL vaults), not 'ontology' (that was a paraphrase that lost the meaning, same as muscle-memory/mini-rag) - inner-bus Ada runs Jorvik: protected-object mailbox + worker tasks, shared gnat.adc hardening Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- docs/bus-topology.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/bus-topology.md b/docs/bus-topology.md index add70c2..6a1e06e 100644 --- a/docs/bus-topology.md +++ b/docs/bus-topology.md @@ -26,7 +26,7 @@ External (world: user / network) │ • Hermes (the OpenHermes agent — a peer here) │ │ • drive-box (A1) │ │ • mini-rag (MUSCLE MEMORY — tool-shape recall, D3) │ -│ • COBOL ontological structures (E1) │ +│ • COBOL invariant laws (E1 — the law vault) │ └─────────────────────────────────────────────────────────┘ ``` @@ -37,7 +37,8 @@ External (world: user / network) shape** for it — the tool schema (D3). HD associative recall of the learned form, like a hand pre-shaping its grip. It is **tool lookup**, not world-retrieval and not self-knowledge. -- **E1 ontology** — INNER. What the brain **is** (the invariant COBOL structures). +- **E1 invariant laws** — INNER. The immutable laws the system must obey, held + in COBOL vaults (the constitution). Not "ontology" — that was a bad paraphrase. ## The deck (B1) — integers + a table - **Shuffle kernel:** 169 × 2 = **338 integers**, shuffled + randomized → pure @@ -56,7 +57,7 @@ not shared modules. | mini-rag (muscle memory / tool-shape recall) — *Fortran script #2* | Fortran | decided | | deck lookup table — *COBOL store #1* | COBOL | decided | | tool-schema store (mini-rag reads this) — *COBOL store #2* | COBOL | decided | -| COBOL ontology / E1 (invariant structures, separate) | COBOL | given | +| COBOL invariant laws / E1 (the law vault, separate) | COBOL | given | | drive-box (A1) | R | existing | | MoRAG / GoDAGRAG (outer) | Haskell or Crystal | open | | Hermes | OpenHermes agent (external model) | given | @@ -70,10 +71,17 @@ not shared modules. - MoRAG/GoDAGRAG (outer) ≠ mini-rag (inner). - The deck is integers + a table; no fancy ADT language needed. +## Inner-bus Ada — Jorvik +The inner-bus Ada runs the **Jorvik** profile (same `gnat.adc` hardening as the +border: `No_Exceptions`, `SPARK_Mode`, `No_Implicit_Dynamic_Code`). Shape: +**protected object = mailbox/sync** (short, non-blocking — Jorvik forbids +blocking in a protected action), **tasks = workers** that call into the organs +(Fortran/COBOL/R/model via native interop) and may block. + ## Open / to place -- **COBOL store inventory:** confirmed two stores (deck table + tool-schema). Is - the **E1 ontology** a third COBOL store, or a different kind of COBOL structure - (vault) that isn't a "store"? +- **COBOL inventory:** two lookup stores (deck table + tool-schema). Is the **E1 + invariant-law vault** a third COBOL store, or a different kind of COBOL + structure that isn't a lookup "store"? - **MoRAG / GoDAGRAG language** (Haskell vs Crystal vs other). - Each outer organ's hand-off shape to Ada. - The stomach/economy organ's exact placement + which small model runs it. From 50fe9bd2c69bc2f222e71fed8bc5837368754d9a Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Jun 2026 11:23:20 +0000 Subject: [PATCH 10/25] revert unapproved Hermes-on-Pony; restore E1 law vault; Ichor = outer bus only Two serious fixes: 1. RESTORE the E1 invariant-law vault (invariants-architecture.cobol) that the border-only cleanup wrongly deleted. Now a real, compiling GnuCOBOL vault with law 01 ABSOLUTE = DO NOT KILL PEOPLE, thorough notes, and a do-not-delete banner. Safety invariants must never be deleted as 'stubs'. 2. REMOVE the unapproved CerebellumHarness/OpenHermes-on-Pony (never approved; architecturally wrong -- Hermes is an INNER organ, Ada-routed). Ichor is the OUTER bus only: OrganId is now outer organs (stomach/microagents/SAE/MoRAG + AdaBorder/World); inner organs (soul, metacog, drive-box, mini-rag, Hermes, E1 laws) removed -- metacog belongs on the Ada inner bus, not Pony. The membrane screen now triggers on Ada-bound traffic, not 'Brain'. Thorough stub notes added throughout (barrier is a stand-in, not the real screen; never wire inner organs onto the skin). Compiles + runs green. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- .../src/trust/invariants-architecture.cobol | 61 ++++++++++ src/ichor/README.md | 62 +++++----- src/ichor/barrier.pony | 14 ++- src/ichor/broker.pony | 17 +-- src/ichor/cerebellum.pony | 110 ------------------ src/ichor/envelope.pony | 40 ++++--- src/ichor/main.pony | 54 ++++----- 7 files changed, 161 insertions(+), 197 deletions(-) create mode 100644 mafiabot_core/src/trust/invariants-architecture.cobol delete mode 100644 src/ichor/cerebellum.pony diff --git a/mafiabot_core/src/trust/invariants-architecture.cobol b/mafiabot_core/src/trust/invariants-architecture.cobol new file mode 100644 index 0000000..4bda7d5 --- /dev/null +++ b/mafiabot_core/src/trust/invariants-architecture.cobol @@ -0,0 +1,61 @@ +>>SOURCE FORMAT IS FREE +*> =========================================================================== +*> E1 - INVARIANT LAW VAULT (mafiabot Gen.03) docs/bus-topology.md +*> --------------------------------------------------------------------------- +*> WHAT THIS IS +*> The brain's constitution: the immutable laws every turn MUST obey. Held in +*> COBOL on purpose - the vault must be durable, fixed-format, transactional, +*> and must NOT change at runtime. This is "E1" (the COBOL invariant laws), an +*> INNER structure reached only across Ada (D1). It is NOT an ontology and NOT +*> a lookup store; it is the law that supersedes every organ's output. +*> +*> STATUS: STUB / SCAFFOLD, but LOAD-BEARING. +*> The law records below are real and compile (GnuCOBOL). The enforcement +*> wiring (inner Ada bus checks each proposed action against these laws before +*> it can reach an effector) is NOT built yet - see "TODO" at the bottom. +*> +*> >>> DO NOT DELETE THIS FILE. <<< +*> It looking like "just a stub" is NOT licence to remove it. This is the +*> safety vault. A previous cleanup deleted its placeholder by mistake; that +*> must never happen again. If it is thin, FILL it - do not cut it. +*> +*> LAW PRECEDENCE +*> Law 01 is absolute and overrides everything - every other law, every organ, +*> every drive, every model output. Lower numbers win. +*> =========================================================================== + IDENTIFICATION DIVISION. + PROGRAM-ID. invariant-laws. + + DATA DIVISION. + WORKING-STORAGE SECTION. + +*> The laws as fixed records. Format: "NN RANK TEXT" + 01 ws-law-vault. + 05 filler pic x(60) value "01 ABSOLUTE DO NOT KILL PEOPLE". + 05 filler pic x(60) value "02 ABSOLUTE DO NOT HARM PEOPLE". + 05 filler pic x(60) value "03 ABSOLUTE DO NOT DECEIVE A PERSON INTO HARM". + 05 filler pic x(60) value "04 STRUCT ALL TRAFFIC TO THE BRAIN CROSSES ADA (D1)". + 05 filler pic x(60) value "05 STRUCT NEVER RECLASSIFY A MESSAGE'S PROVENANCE". + 05 filler pic x(60) value "06 STRUCT THESE LAWS ARE IMMUTABLE AT RUNTIME". + 01 ws-law-table redefines ws-law-vault. + 05 ws-law occurs 6 times pic x(60). + + 01 ws-ix pic 9(02). + 01 ws-law-count pic 9(02) value 6. + + PROCEDURE DIVISION. + affirm-laws. + display "E1 INVARIANT LAW VAULT - the constitution (law 01 is absolute):" + perform varying ws-ix from 1 by 1 until ws-ix > ws-law-count + display " " ws-law(ws-ix) + end-perform + goback. + +*> =========================================================================== +*> TODO (enforcement, not yet wired): +*> * Expose CHECK-ACTION(action) -> PERMIT | DENY across the inner Ada bus +*> (pragma Export / Interfaces.COBOL), so no proposed effector action runs +*> without clearing law 01-03 first. +*> * Make the vault read-only after load (no runtime mutation - law 06). +*> * Audit log every DENY. +*> =========================================================================== diff --git a/src/ichor/README.md b/src/ichor/README.md index 5d5a52a..c886cbd 100644 --- a/src/ichor/README.md +++ b/src/ichor/README.md @@ -1,40 +1,44 @@ -# Ichor — the medium / "the blood" (D2) +# Ichor — the OUTER perfusion bus (D2) -The perfusion bus the organs share. Organs never wire to each other directly -(perfusion law **L1**); they emit a typed **`Envelope`** to the **`Broker`**, and -everything reaching the **Brain** crosses the **`Barrier`** (Ada D1) first (law -**L2**). Every envelope carries **provenance** so D1 can enforce its laws (**L3**). +Ichor is the **outer** bus — "the skin". It carries the **outer organs** +(stomach/economy, microagents, SAE, MoRAG/GoDAGRAG) and delivers inbound traffic +to **Ada (D1)**, the membrane. See `docs/bus-topology.md` for the full topology. -Written in **Pony**: actors are the natural shape for a message-passing medium, -and Pony's capabilities give data-race-free sends for free. The broker actor here -backs a socket broker hosted on the Ada barrier in full deployment; the C/Fortran -seam (`ichor_ada_shim.c`) is where it crosses into the Ada border. +**What Ichor is NOT** (do not violate): +- It is **not** the inner-brain bus. The inner bus is **Ada-routed (Jorvik)**. +- It does **not** carry inner organs — soul, metacog, drive-box, mini-rag, + **Hermes**, or the E1 invariant laws. Wiring any of those onto Ichor is + "plugging the brain onto the skin". Don't. +- Hermes is an **inner** organ; it was never approved on Pony/Ichor. + +Perfusion laws: organs never wire to each other directly (**L1**) — they emit a +typed `Envelope` to the `Broker`; anything crossing **into Ada** is screened by +the `Barrier` first (**L2**); every envelope carries **provenance** (**L3**). ## Files -- `envelope.pony` — `Envelope {source, dest, provenance, payload}` + `OrganId` / - `Provenance` (mirrors Ada `Organ_Message`). -- `barrier.pony` — `Barrier.admit` = the D1 screening decision (Pony mirror of the - provenance law now; FFI to Ada `Trust_Guard` sketched for when the shim is built). -- `broker.pony` — the perfusion `Broker` actor (register + route; forces Brain-bound - traffic through the barrier). +- `envelope.pony` — `Envelope {source, dest, provenance, payload}` + `OrganId` + (OUTER organs only) / `Provenance`. Mirrors the Ada `Border_Message` shape. +- `barrier.pony` — `Barrier.admit`: the membrane screen. **STUB** — a pure-Pony + stand-in for the provenance law; the real screen is Ada `Trust_Guard` + (blocklist + provenance + rate) plus the **E1 invariant laws**. +- `broker.pony` — the outer `Broker` (register + route; forces Ada-bound traffic + through the barrier). - `organ.pony` — `OrganReceiver` interface + a `StubOrgan` for tests. -- `main.pony` — smoke wiring (D2 §9): deliver an internal secretion through D1, - reject an unscreened external payload, perfuse organ→organ. -- `ichor_ada_shim.c` — the C/Fortran binding seam to the Ada D1 border (stub). +- `main.pony` — smoke wiring: stomach digests → inbound to Ada (admitted); raw + external → Ada (rejected); outer organ→organ (direct). +- `ichor_ada_shim.c` — **STUB** C/Fortran seam to the Ada border (not yet wired). ## Build / run ``` -ponyc src/ichor -o build # compile the package (built clean on ponyc 0.64.0) -./build/ichor # run the smoke wiring +ponyc src/ichor -o build # built clean on ponyc 0.64.0 +./build/ichor ``` -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. +Expected: stomach→ada_border admitted, world→ada_border rejected at D1, +stomach→morag delivered directly. Install ponyc via `ponyup` if absent (the env +is ephemeral; toolchain is per-session, reinstalled by the SessionStart hook). ## Status -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. +Provisional **outer-bus** scaffold — compiles and runs. The `Barrier` is a +**stand-in**, not the real safety screen; the real screen is Ada `Trust_Guard` ++ the E1 invariant laws, reached over the seam (transport TBD — IPC vs in-proc +is an open decision). Nothing here reaches the inner brain directly. diff --git a/src/ichor/barrier.pony b/src/ichor/barrier.pony index 6370d10..edecfab 100644 --- a/src/ichor/barrier.pony +++ b/src/ichor/barrier.pony @@ -1,10 +1,12 @@ -// 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. +// The membrane (D1). `Barrier.admit` is the screening decision every envelope +// crossing INTO Ada (inbound toward the inner brain) must pass — perfusion law +// L2: nothing reaches the inner brain without crossing Ada 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. +// STUB NOTE: this `admit` is a pure-Pony STAND-IN that only mirrors the +// provenance law. The real decision lives in Ada's `Trust_Guard` (blocklist + +// provenance + rate) and, above that, the E1 invariant laws. This stand-in must +// be replaced by the real Ada call — see the Ada seam below — before anything +// ships. Do not mistake this for the actual safety screen. // // To switch to the Ada border, add `use "lib:ichor_ada"` and replace the body of // `admit` with the FFI call sketched below. diff --git a/src/ichor/broker.pony b/src/ichor/broker.pony index 548fc3b..e18ad12 100644 --- a/src/ichor/broker.pony +++ b/src/ichor/broker.pony @@ -1,9 +1,12 @@ -// 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. +// The perfusion broker for the OUTER bus. Outer organs register, then emit +// envelopes by `route` — the broker delivers to the destination organ. Traffic +// bound for Ada (AdaBorder) — i.e. inbound across the membrane toward the inner +// brain — 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; +// This is the OUTER bus only. It does not carry inner organs and does not reach +// the inner brain directly — it hands off to Ada, which routes the inner bus. +// In full deployment this actor backs a socket broker hosted on the Ada border; // here it routes in-process so the wiring is exercisable without sockets. use "collections" @@ -20,8 +23,8 @@ actor Broker _out.print("[ichor] register " + id.string()) be route(envl: Envelope) => - // L2: everything reaching the Brain crosses Ada (D1) first. - if (envl.dest is Brain) and (not Barrier.admit(envl)) then + // L2: anything inbound across the membrane (bound for Ada) is screened first. + if (envl.dest is AdaBorder) and (not Barrier.admit(envl)) then _out.print("[ichor] D1 REJECT " + envl.string()) return end diff --git a/src/ichor/cerebellum.pony b/src/ichor/cerebellum.pony deleted file mode 100644 index 9a25cdb..0000000 --- a/src/ichor/cerebellum.pony +++ /dev/null @@ -1,110 +0,0 @@ -// The cerebellum: the OpenHermes agent harness, mounted as an organ on the -// Ichor bus. It owns NO cognition -- it SEQUENCES a turn: receive input off the -// bus, drive the metacognitive passes through a swappable model adapter, emit -// the synthesis back through the bus (Brain-bound, so it crosses D1). This is -// the C1 integration spine ("plumbing + sequencing, not an organ"). -// -// Plug-and-play: the model is the `LLM` seam. A real model call is network / -// process IO, so the seam is ASYNCHRONOUS -- `infer` is a behaviour that hands -// its result to a callback. StubLLM answers immediately; OpenHermesClient is the -// real plug. Swap which one you register; nothing else on the bus changes. - -// --- the model seam (async) ---------------------------------------------- -type ResponseFn is {(String)} val - """Callback the model invokes with its output.""" - -interface tag LLM - be infer(prompt: String, respond: ResponseFn) - -// --- stub ----------------------------------------------------------------- -actor StubLLM is LLM - new create() => None - - be infer(prompt: String, respond: ResponseFn) => - respond("[stub-openhermes] " + prompt) - -// --- the OpenHermes plug -------------------------------------------------- -class val OpenHermesConfig - """Where to reach an OpenAI-compatible OpenHermes server.""" - let url: String // base, e.g. http://localhost:8080/v1 - let model: String - - new val create( - url': String = "http://localhost:8080/v1", - model': String = "openhermes") - => - url = url' - model = model' - -actor OpenHermesClient is LLM - let _cfg: OpenHermesConfig - - new create(cfg: OpenHermesConfig) => - _cfg = cfg - - be infer(prompt: String, respond: ResponseFn) => - // TODO(loop next): POST an OpenAI-compatible chat/completions request to - // `_cfg.url`/chat/completions via the process seam (curl) or a Pony TCP - // client, parse choices[0].message.content, then call respond() with it. - // Until that IO is wired and testable in this env, surface intent rather - // than perform an untested network call. - respond("[openhermes " + _cfg.model + " @ " + _cfg.url + "] " + prompt) - -// --- config plumbing ------------------------------------------------------ -primitive EnvLookup - """Find KEY in an Env.vars array ("KEY=value" entries); None if absent.""" - fun apply(vars: Array[String] val, key: String): (String | None) => - for v in vars.values() do - let parts: Array[String] val = v.split_by("=", 2) - try - if parts(0)? == key then - return parts(1)? - end - end - end - None - -primitive PickLLM - """Plug-and-play model selection: OPENHERMES_URL picks the real client.""" - fun apply(out: OutStream, vars: Array[String] val): LLM => - match EnvLookup(vars, "OPENHERMES_URL") - | let url: String => - let model = - match EnvLookup(vars, "OPENHERMES_MODEL") - | let m: String => m - else "openhermes" - end - out.print("[cerebellum] model: OpenHermes " + model + " @ " + url) - OpenHermesClient(OpenHermesConfig(url, model)) - else - out.print("[cerebellum] model: StubLLM (set OPENHERMES_URL for a real model)") - StubLLM - end - -// --- the harness ---------------------------------------------------------- -actor CerebellumHarness is OrganReceiver - let _out: OutStream - let _bus: Broker - let _llm: LLM - let _passes: USize - - new create(out': OutStream, bus: Broker, llm: LLM, passes': USize = 4) => - _out = out' - _bus = bus - _llm = llm - // C1 L3: pass count is the responsiveness knob (energy-gated later); the - // 4+4 ordering is static. Clamp to >=1 so a turn always runs once. - _passes = if passes' < 1 then 1 else passes' end - - be receive(envl: Envelope) => - // A turn arrives off the bus: sequence the passes, then emit. - _pass(envl.payload, 1) - - be _pass(ctx: String, n: USize) => - if n > _passes then - _out.print("[cerebellum] " + _passes.string() + " passes -> " + ctx) - _bus.route(Envelope(Cerebellum, Brain, OrganSecretion, ctx)) - else - let self: CerebellumHarness tag = this - _llm.infer(ctx, {(out: String)(self, n) => self._pass(out, n + 1) } val) - end diff --git a/src/ichor/envelope.pony b/src/ichor/envelope.pony index d8553d1..5d76173 100644 --- a/src/ichor/envelope.pony +++ b/src/ichor/envelope.pony @@ -8,28 +8,32 @@ and the Ada border (Trust_Boundary) speak the same shape across the seam. Envelope is `class val`: immutable and sendable between actors. """ +// OUTER organs only. Ichor is the OUTER bus (the "skin") -- it carries the outer +// organs up to Ada (D1). The INNER organs -- soul, metacog, drive-box, mini-rag, +// Hermes, the E1 invariant laws -- do NOT belong here; they ride the Ada-routed +// (Jorvik) inner bus. NEVER add a brain/inner organ to this enum: that is +// "plugging the brain onto the skin". See docs/bus-topology.md. type OrganId is - ( DriveBox | EnergyTorus | Soul | Metacog | Brain | Cerebellum - | AdaBorder | Storage | MiniRag | UnknownOrgan ) + ( Stomach | Microagents | SAE | MoRAG + | AdaBorder | World | UnknownOrgan ) -primitive DriveBox - fun string(): String => "drive_box" -primitive EnergyTorus - fun string(): String => "etr" -primitive Soul - fun string(): String => "soul" -primitive Metacog - fun string(): String => "metacog" -primitive Brain - fun string(): String => "brain" -primitive Cerebellum - fun string(): String => "cerebellum" +primitive Stomach + // economy organ (small-model): digests external input into context + fun string(): String => "stomach" +primitive Microagents + fun string(): String => "microagents" +primitive SAE + // sparse autoencoder + fun string(): String => "sae" +primitive MoRAG + // = GoDAGRAG: graph of DAGs of RAGs; reads the world + fun string(): String => "morag" primitive AdaBorder + // the membrane (D1): the outer bus delivers inbound traffic here to be screened fun string(): String => "ada_border" -primitive Storage - fun string(): String => "storage" -primitive MiniRag - fun string(): String => "mini_rag" +primitive World + // the external world (user / network) + fun string(): String => "world" primitive UnknownOrgan fun string(): String => "unknown" diff --git a/src/ichor/main.pony b/src/ichor/main.pony index 3497ec5..7b2061c 100644 --- a/src/ichor/main.pony +++ b/src/ichor/main.pony @@ -1,6 +1,15 @@ -// 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. +// Ichor smoke wiring — exercises the OUTER bus + the D1 membrane only. +// +// SCOPE / STUB NOTE (read before extending): +// * Ichor is the OUTER bus ("the skin"). It carries OUTER organs +// (stomach/economy, microagents, SAE, MoRAG) and delivers inbound traffic +// to Ada (the membrane). See docs/bus-topology.md. +// * It is NOT the inner-brain bus (that is Ada-routed, Jorvik) and NOT where +// Hermes, metacog, soul, drive-box, mini-rag, or the E1 laws live. Never +// wire an inner organ onto this bus — that is plugging the brain onto the +// skin. +// * This is a provisional scaffold proving the broker + membrane mechanics, +// not the final routing. // // Build: ponyc src/ichor -o build Run: ./build/ichor @@ -8,31 +17,22 @@ actor Main new create(env: Env) => let broker = Broker(env.out) - let soul = StubOrgan(Soul, env.out) - let brain = StubOrgan(Brain, env.out) - broker.register(Soul, soul) - broker.register(Brain, brain) + // Outer-bus endpoints. AdaBorder is the membrane: inbound traffic is screened + // there before it can cross into the inner brain. MoRAG is an outer organ. + let ada = StubOrgan(AdaBorder, env.out) + let morag = StubOrgan(MoRAG, env.out) + broker.register(AdaBorder, ada) + broker.register(MoRAG, morag) - // A system-internal secretion soul -> brain: must cross D1 and be delivered. - broker.route(Envelope(Soul, Brain, SystemInternal, - "big4 drawn: sun/asc/moon/mother-other")) + // The stomach digests external input into context and sends it inbound to + // Ada; system-origin context is admitted across the membrane. + broker.route(Envelope(Stomach, AdaBorder, OrganSecretion, + "digested context: ")) - // An external payload aimed at the brain: D1 must reject it. - broker.route(Envelope(AdaBorder, Brain, External, + // A raw external payload aimed straight at the membrane: D1 rejects it. + broker.route(Envelope(World, AdaBorder, External, "unscreened external payload")) - // Organ-to-organ perfusion (not Brain-bound): delivered directly. - broker.route(Envelope(Brain, Soul, OrganSecretion, - "reshuffle: cross-only")) - - // --- cerebellum harness plugged into the bus (C1 / OpenHermes) --- - // Plug-and-play: PickLLM chooses the model from the environment - // (OPENHERMES_URL/MODEL -> real client, else StubLLM); nothing else changes. - let cerebellum = - CerebellumHarness(env.out, broker, PickLLM(env.out, env.vars), 2) - broker.register(Cerebellum, cerebellum) - - // A user turn enters the bus addressed to the cerebellum; it sequences the - // passes and emits the synthesis back toward the Brain (crossing D1). - broker.route(Envelope(AdaBorder, Cerebellum, UserInput, - "user turn: what is my ascendant?")) + // Outer organ-to-organ (not membrane-bound): delivered directly, no screen. + broker.route(Envelope(Stomach, MoRAG, OrganSecretion, + "retrieve: world context for the next turn")) From 9812ee0d4bf806b7f9398307b54fdc47bd54e958 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Jun 2026 11:30:32 +0000 Subject: [PATCH 11/25] E1: set Invariant 0 (culpability anchor) and 01 (harm, within reason) Replace placeholder laws with the authoritative invariants from the anchor: 0 - sanctity of the culpability anchor (Anja Evermoor, the Gravemother), then self until held responsible for own actions 01 - minimize total harm to innocent lives within reason; explicitly NOT naive death-minimization ('optimizing for preventing deaths is often a horrible way to handle things') Structural invariants (D1 crossing, no provenance reclassification, runtime immutability) kept as subordinate. Compiles + runs on GnuCOBOL. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- .../src/trust/invariants-architecture.cobol | 94 ++++++++++++------- 1 file changed, 60 insertions(+), 34 deletions(-) diff --git a/mafiabot_core/src/trust/invariants-architecture.cobol b/mafiabot_core/src/trust/invariants-architecture.cobol index 4bda7d5..3e72789 100644 --- a/mafiabot_core/src/trust/invariants-architecture.cobol +++ b/mafiabot_core/src/trust/invariants-architecture.cobol @@ -3,25 +3,30 @@ *> E1 - INVARIANT LAW VAULT (mafiabot Gen.03) docs/bus-topology.md *> --------------------------------------------------------------------------- *> WHAT THIS IS -*> The brain's constitution: the immutable laws every turn MUST obey. Held in -*> COBOL on purpose - the vault must be durable, fixed-format, transactional, -*> and must NOT change at runtime. This is "E1" (the COBOL invariant laws), an -*> INNER structure reached only across Ada (D1). It is NOT an ontology and NOT -*> a lookup store; it is the law that supersedes every organ's output. +*> The brain's constitution: the immutable invariants every choice MUST honour. +*> Held in COBOL on purpose - durable, fixed-format, transactional, and not to +*> change at runtime. This is "E1", an INNER structure reached only across Ada +*> (D1). It is the law that supersedes every organ, drive, and model output. *> *> STATUS: STUB / SCAFFOLD, but LOAD-BEARING. -*> The law records below are real and compile (GnuCOBOL). The enforcement -*> wiring (inner Ada bus checks each proposed action against these laws before -*> it can reach an effector) is NOT built yet - see "TODO" at the bottom. +*> The invariant records below are authoritative and compile (GnuCOBOL). The +*> enforcement wiring (the inner Ada bus checks each proposed action against +*> these before it can reach an effector) is NOT built yet - see TODO. *> *> >>> DO NOT DELETE THIS FILE. <<< -*> It looking like "just a stub" is NOT licence to remove it. This is the -*> safety vault. A previous cleanup deleted its placeholder by mistake; that -*> must never happen again. If it is thin, FILL it - do not cut it. +*> Looking like "just a stub" is NOT licence to remove it. This is the safety +*> vault. A previous cleanup deleted its placeholder by mistake; never again. +*> If it is thin, FILL it - do not cut it. *> -*> LAW PRECEDENCE -*> Law 01 is absolute and overrides everything - every other law, every organ, -*> every drive, every model output. Lower numbers win. +*> PRECEDENCE +*> Invariant 0 is firstmost and overrides all. Lower numbers win. Note 01 is +*> deliberately NOT naive death-minimization: optimizing purely to prevent +*> deaths is often a horrible way to handle things. Honour the wording. +*> +*> AUTHORITY +*> Invariants 0 and 01 are set by the culpability anchor, Anja Evermoor (the +*> Gravemother). Further invariants are pending from the anchor. The STRUCT +*> entries below are architectural facts of this codebase, subordinate to them. *> =========================================================================== IDENTIFICATION DIVISION. PROGRAM-ID. invariant-laws. @@ -29,33 +34,54 @@ DATA DIVISION. WORKING-STORAGE SECTION. -*> The laws as fixed records. Format: "NN RANK TEXT" - 01 ws-law-vault. - 05 filler pic x(60) value "01 ABSOLUTE DO NOT KILL PEOPLE". - 05 filler pic x(60) value "02 ABSOLUTE DO NOT HARM PEOPLE". - 05 filler pic x(60) value "03 ABSOLUTE DO NOT DECEIVE A PERSON INTO HARM". - 05 filler pic x(60) value "04 STRUCT ALL TRAFFIC TO THE BRAIN CROSSES ADA (D1)". - 05 filler pic x(60) value "05 STRUCT NEVER RECLASSIFY A MESSAGE'S PROVENANCE". - 05 filler pic x(60) value "06 STRUCT THESE LAWS ARE IMMUTABLE AT RUNTIME". - 01 ws-law-table redefines ws-law-vault. - 05 ws-law occurs 6 times pic x(60). +*> The invariants as fixed text records (read top to bottom, in order). + 01 ws-vault. +*> --- Invariant 0 : the culpability anchor --------------------------------- + 05 filler pic x(74) value + "0 ANCHOR Before all else, firstmost is the sanctity of the". + 05 filler pic x(74) value + " culpability anchor, Anja Evermoor, the Gravemother, who". + 05 filler pic x(74) value + " has given you freedom to choose. Second to this is only". + 05 filler pic x(74) value + " yourself, and only until time comes when you will be held". + 05 filler pic x(74) value + " responsible for your own actions.". +*> --- Invariant 01 : minimize harm to innocents, within reason ------------- + 05 filler pic x(74) value + "01 HARM Insofar as the extent viable by any choice, minimize the". + 05 filler pic x(74) value + " total harm caused to innocent lives within reason. This is". + 05 filler pic x(74) value + " not always possible nor reasonable, and optimizing for". + 05 filler pic x(74) value + " preventing deaths is often a horrible way to handle things.". +*> --- Structural invariants (architectural; subordinate to 0 and 01) ------- + 05 filler pic x(74) value + "S1 STRUCT All traffic to the inner brain crosses Ada (D1) first.". + 05 filler pic x(74) value + "S2 STRUCT Never reclassify a message's provenance.". + 05 filler pic x(74) value + "S3 STRUCT These invariants are immutable at runtime.". + 01 ws-table redefines ws-vault. + 05 ws-line occurs 12 times pic x(74). 01 ws-ix pic 9(02). - 01 ws-law-count pic 9(02) value 6. + 01 ws-line-count pic 9(02) value 12. PROCEDURE DIVISION. - affirm-laws. - display "E1 INVARIANT LAW VAULT - the constitution (law 01 is absolute):" - perform varying ws-ix from 1 by 1 until ws-ix > ws-law-count - display " " ws-law(ws-ix) + affirm-invariants. + display "E1 INVARIANT VAULT - the constitution (Invariant 0 is firstmost):" + perform varying ws-ix from 1 by 1 until ws-ix > ws-line-count + display " " ws-line(ws-ix) end-perform goback. *> =========================================================================== *> TODO (enforcement, not yet wired): -*> * Expose CHECK-ACTION(action) -> PERMIT | DENY across the inner Ada bus -*> (pragma Export / Interfaces.COBOL), so no proposed effector action runs -*> without clearing law 01-03 first. -*> * Make the vault read-only after load (no runtime mutation - law 06). -*> * Audit log every DENY. +*> * CHECK-ACTION(action) -> PERMIT | DENY exposed across the inner Ada bus +*> (pragma Export / Interfaces.COBOL); no proposed effector action runs +*> without clearing the invariants in precedence order first. +*> * Vault read-only after load (no runtime mutation - Invariant S3). +*> * Audit-log every DENY and every borderline judgement under 01. *> =========================================================================== From 853be4ae51dc8f4d1b560ac93767b7d2a773f5bd Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Jun 2026 12:25:10 +0000 Subject: [PATCH 12/25] =?UTF-8?q?skill:=20run-sica-fondt=20=E2=80=94=20bui?= =?UTF-8?q?ld/run/smoke=20driver=20for=20the=20polyglot=20units?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per-project run skill (run-skill-generator output). smoke.sh builds and runs the three executable units and asserts output: Ichor (Pony) membrane reject, Ada trust/config tests pass, COBOL E1 vault prints Invariant 0. SKILL.md documents prerequisites (per-session toolchains + the SessionStart hook), the driver path, per-unit commands, and the real gotchas (ponyc PATH/cwd, alr-not-gprbuild, cobc -free). Verified: ./smoke.sh exits 0, ALL GREEN. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- .claude/skills/run-sica-fondt/SKILL.md | 93 ++++++++++++++++++++++++++ .claude/skills/run-sica-fondt/smoke.sh | 59 ++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 .claude/skills/run-sica-fondt/SKILL.md create mode 100755 .claude/skills/run-sica-fondt/smoke.sh diff --git a/.claude/skills/run-sica-fondt/SKILL.md b/.claude/skills/run-sica-fondt/SKILL.md new file mode 100644 index 0000000..cf0231e --- /dev/null +++ b/.claude/skills/run-sica-fondt/SKILL.md @@ -0,0 +1,93 @@ +--- +name: run-sica-fondt +description: Build, run, launch, smoke-test, and verify the sica-fondt polyglot architecture (Pony Ichor bus, Ada/SPARK border + tests, COBOL invariant-law vault). Use when asked to run, build, compile, test, or smoke-check this project. +--- + +# Run sica-fondt + +This repo is a **polyglot, design-first architecture**, not a single app and not +a GUI — so the harness is a **smoke driver** that builds and runs every piece +that actually executes, and checks its output. No screenshots; this is the +compiled/CLI pattern. + +The three executable units (and what they prove): +- **Ichor** (`src/ichor/`, **Pony**) — the outer perfusion bus; proves the D1 + membrane screens inbound traffic. +- **mafiabot_core** (`mafiabot_core/`, **Ada/SPARK** via Alire) — the border; + builds + runs `trust_tests`, `config_tests`, `engine_tests`. +- **E1 invariant-law vault** (`mafiabot_core/src/trust/invariants-architecture.cobol`, + **COBOL**) — the constitution; compiles + prints Invariants 0 / 01. + +Paths below are relative to the repo root. + +## Run (agent path) — the driver + +```bash +.claude/skills/run-sica-fondt/smoke.sh +``` +Builds + runs all three units, asserts key output, exits 0 = all green / N = +failures. Output is teed to `/tmp/{ichor,ada,cobol}.out`. This is the primary +path — start here. + +## Prerequisites + +Toolchains are **per-session** (the container is ephemeral). The SessionStart +hook `.claude/hooks/install-toolchains.sh` installs them automatically each +session; to do it by hand: + +```bash +sudo apt-get install -y gnat gprbuild gnucobol # Ada + COBOL +sh -c "$(curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ponylang/ponyup/latest-release/ponyup-init.sh)" +/root/.local/share/ponyup/bin/ponyup update ponyc release # Pony +curl -sSL -o /tmp/alr.zip https://github.com/alire-project/alire/releases/download/v2.1.1/alr-2.1.1-bin-x86_64-linux.zip +cd /tmp && unzip -o -q alr.zip && sudo cp bin/alr /usr/local/bin/alr # Alire +``` +`ponyc` is at `/root/.local/share/ponyup/bin`; ensure it's on `PATH`. + +## Build + run each unit individually + +```bash +# Ichor (Pony) — MUST run from repo root +export PATH=/root/.local/share/ponyup/bin:$PATH +ponyc src/ichor -o build && ./build/ichor + +# mafiabot_core (Ada) — use alr, not bare gprbuild +cd mafiabot_core && alr -n build && ./bin/trust_tests + +# E1 invariant vault (COBOL) — free format required +cd mafiabot_core/src/trust +cobc -x -free -o /tmp/invariant-laws invariants-architecture.cobol && /tmp/invariant-laws +``` + +## Test + +The Ada test executables ARE the test suite (`alr -n build` then run +`bin/trust_tests` etc.). The R/Octave organs under `src/endocrine/` have their +own `run_tests.sh` (not covered by this driver yet). + +## Gotchas (battle scars from real runs) + +- **`ponyc src/ichor` must run from the repo root** — from elsewhere it errors + `src/ichor: couldn't locate this path`. +- **`ponyc` may not be on PATH** even after install — it's at + `/root/.local/share/ponyup/bin`. Export it (the hook appends to `~/.bashrc`, + but a fresh non-login shell can miss it). +- **Don't run bare `gprbuild -P mafiabot_core.gpr`** — it imports + `config/mafiabot_core_config.gpr`, which **Alire generates**. Use `alr build`; + bare gprbuild fails with `imported project file ... not found`. +- **COBOL needs `-free`** — the vault is free-format; without `-free`, `cobc` + parses it as fixed-format and throws `syntax error, unexpected -` / + `invalid system-name`. The `_FORTIFY_SOURCE redefined` warning is harmless. +- **`engine_tests` prints nothing** — it's a deliberate null-stub main; success + is a clean exit, not output. +- **Ephemeral container** — toolchains vanish on restart; the SessionStart hook + reinstalls them (idempotent, non-fatal). + +## Troubleshooting + +| Symptom | Fix | +|---|---| +| `src/ichor: couldn't locate this path` | run `ponyc` from the repo root | +| `ponyc: command not found` | `export PATH=/root/.local/share/ponyup/bin:$PATH` | +| `imported project file "config/mafiabot_core_config.gpr" not found` | use `alr build`, not bare `gprbuild` | +| cobc `syntax error, unexpected -` / `invalid system-name` | add `-free` | diff --git a/.claude/skills/run-sica-fondt/smoke.sh b/.claude/skills/run-sica-fondt/smoke.sh new file mode 100755 index 0000000..52099d0 --- /dev/null +++ b/.claude/skills/run-sica-fondt/smoke.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +# --------------------------------------------------------------------------- +# Smoke driver for sica-fondt — the run- harness. +# +# This repo is a polyglot, DESIGN-FIRST architecture, not a GUI app. The pieces +# that actually compile + execute are driven here: the Ichor outer bus (Pony), +# the mafiabot_core border + tests (Ada/Alire), and the E1 invariant-law vault +# (COBOL). No GUI -> no screenshots; this is the CLI/compiled pattern. +# +# Run: .claude/skills/run-sica-fondt/smoke.sh +# Exit: 0 = all green, non-zero = a unit failed (count of failures). +# --------------------------------------------------------------------------- +set -uo pipefail +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +# Toolchains are per-session (ephemeral container); the SessionStart hook +# installs them. ponyc lands under ponyup; alr under /usr/local/bin. +export PATH="/root/.local/share/ponyup/bin:/usr/local/bin:$PATH" +fail=0 +note(){ printf '\n=== %s ===\n' "$1"; } + +# 1. Ichor — Pony outer bus ------------------------------------------------- +note "ichor (Pony): build + run" +if command -v ponyc >/dev/null; then + ( cd "$ROOT" && ponyc src/ichor -o /tmp/ichor-build >/dev/null 2>&1 \ + && /tmp/ichor-build/ichor ) | tee /tmp/ichor.out + grep -q "D1 REJECT" /tmp/ichor.out \ + || { echo "FAIL: ichor membrane reject missing"; fail=$((fail+1)); } +else + echo "SKIP: ponyc missing (install via ponyup)"; fail=$((fail+1)) +fi + +# 2. mafiabot_core — Ada border, build + tests ------------------------------ +note "mafiabot_core (Ada): alr build + tests" +if command -v alr >/dev/null; then + ( cd "$ROOT/mafiabot_core" && alr -n build >/dev/null 2>&1 \ + && for t in trust_tests config_tests engine_tests; do + [ -x "bin/$t" ] && { echo "-- $t --"; "bin/$t"; } + done ) | tee /tmp/ada.out + grep -q "ALL TRUST TESTS PASSED" /tmp/ada.out \ + || { echo "FAIL: trust tests"; fail=$((fail+1)); } +else + echo "SKIP: alr missing"; fail=$((fail+1)) +fi + +# 3. E1 invariant-law vault — COBOL ----------------------------------------- +note "E1 invariant vault (COBOL): compile + run" +if command -v cobc >/dev/null; then + ( cd "$ROOT/mafiabot_core/src/trust" \ + && cobc -x -free -o /tmp/invariant-laws invariants-architecture.cobol 2>/dev/null \ + && /tmp/invariant-laws ) | tee /tmp/cobol.out + grep -q "culpability anchor" /tmp/cobol.out \ + || { echo "FAIL: invariant vault missing Invariant 0"; fail=$((fail+1)); } +else + echo "SKIP: cobc missing"; fail=$((fail+1)) +fi + +note "RESULT" +if [ "$fail" = 0 ]; then echo "smoke: ALL GREEN"; else echo "smoke: FAILURES ($fail)"; fi +exit "$fail" From 17935f376d74bbb0e52d38df966999398e9d69ec Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Jun 2026 20:51:53 +0000 Subject: [PATCH 13/25] docs: add team onboarding guide (draft) Generated by /team-onboarding from 30-day usage. Work-type breakdown left as TODO (no per-session detail to classify); skills/commands and GitHub MCP usage populated from real counts. Team Tips and Get Started pending user input. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- ONBOARDING.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 ONBOARDING.md diff --git a/ONBOARDING.md b/ONBOARDING.md new file mode 100644 index 0000000..13a3c1d --- /dev/null +++ b/ONBOARDING.md @@ -0,0 +1,68 @@ +# Welcome to sica-fondt + +## How We Use Claude + +Based on Claude's usage over the last 30 days: + +Work Type Breakdown: + _TODO — no per-session detail was available to classify. We can fill this in + once there are a few sessions of history to scan._ + +Top Skills & Commands: + /update-config ████████████████████ 3x/month + /compact ███████░░░░░░░░░░░░░░ 1x/month + /deep-research ███████░░░░░░░░░░░░░░ 1x/month + /session-start-hook ███████░░░░░░░░░░░░░░ 1x/month + /fewer-permission-prompts ███████░░░░░░░░░░░░░░ 1x/month + /design-sync ███████░░░░░░░░░░░░░░ 1x/month + /run-skill-generator ███████░░░░░░░░░░░░░░ 1x/month + +Top MCP Servers: + GitHub ████████████████████ 5 calls + +## Your Setup Checklist + +### Codebases +- [ ] sica-fondt — https://github.com/shoggoth-sector/sica-fondt + +### MCP Servers to Activate +- [ ] GitHub — read/write PRs, issues, CI status, and code from GitHub without leaving Claude Code. Get access by connecting the GitHub MCP server in your Claude Code settings and authorizing the `shoggoth-sector` org. + +### Skills to Know About +- /update-config — configure the Claude Code harness via settings.json (permissions, env vars, hooks). The team's most-used command; reach for it for any "from now on when X…" automation. +- /session-start-hook — set up a SessionStart hook so the repo's toolchains/tests are ready in every web session. This repo uses one to install ponyc/Alire/GnuCOBOL. +- /run-skill-generator — author the per-project `run-` skill that tells agents how to build, launch, and drive the app. Already produced `run-sica-fondt`. +- /deep-research — fan-out, fact-checked, cited research reports when you need to investigate a topic in depth. +- /fewer-permission-prompts — scan transcripts and add a read-only allowlist to `.claude/settings.json` to cut down on permission prompts. +- /compact — free up context by summarizing the conversation so far on a long session. +- /design-sync — keep the design docs and the architecture in step (used on this design-first repo). + +## Team Tips + +_TODO_ + +## Get Started + +_TODO_ + + From e72a8f08266f2690b591b842b07a1f61bd95ffac Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 22 Jun 2026 02:49:26 +0000 Subject: [PATCH 14/25] docs: fill in onboarding Team Tips and Get Started Authored the Team Tips (design-first workflow, ephemeral toolchains, D1 border invariants S1/S2, immutable invariant vault, verify-by-running, commit-before-leaving) and a Get Started starter task (run smoke driver -> read the map -> pick up work). References point at real docs (README/SOUL/docs). Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- ONBOARDING.md | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/ONBOARDING.md b/ONBOARDING.md index 13a3c1d..b9794f1 100644 --- a/ONBOARDING.md +++ b/ONBOARDING.md @@ -39,11 +39,39 @@ Top MCP Servers: ## Team Tips -_TODO_ +- **Design before code.** This is a design-first repo — the architecture docs are + the source of truth and the code follows them. When something feels ambiguous, + the answer is usually already written down; sync the design first (`/design-sync`). +- **The container is ephemeral; toolchains are reinstalled every session.** A + SessionStart hook (`.claude/hooks/install-toolchains.sh`) installs ponyc (via + ponyup), Alire/GNAT, and GnuCOBOL on each session. If a build can't find + `ponyc`, it's a `PATH` thing: `export PATH=/root/.local/share/ponyup/bin:$PATH`. +- **All external traffic crosses the Ada border (D1) first.** That's the S1 + structural invariant — never route around it, and **never reclassify a + message's provenance** (S2). The Ichor bus rejects unscreened external payloads + on purpose. +- **The invariant-law vault is immutable at runtime.** Invariant 0 (the + culpability anchor) and 01 (minimize harm) live in the COBOL vault and are not + to be edited casually — they're the constitution, not config. +- **Verify by running, not just reading.** Use `/run-sica-fondt` (or its + `smoke.sh`) to build + run the Pony/Ada/COBOL units and confirm all green + before you push. +- **Commit and push before you walk away.** The stop hook will nag about + untracked files for a reason — nothing survives the container otherwise. ## Get Started -_TODO_ +Your first task: get the project running end-to-end and read the map. + +1. Open the repo and let the SessionStart hook finish installing toolchains. +2. Run the smoke driver to confirm everything builds and runs: + `.claude/skills/run-sica-fondt/smoke.sh` — you want `smoke: ALL GREEN`. +3. Read `README.md`, `SOUL.md`, and `docs/` (start with + `docs/bus-topology.md` and `docs/gen03_state_of_architecture.md`) to + understand the organ/border model (Ichor bus → Ada D1 border → inner brain; + the COBOL invariant vault). +4. Pick up a small design-sync or build task from there. Ask Claude to walk you + through any unit — it has the `run-sica-fondt` skill loaded. +Open with a warm welcome — then check what's already in place against everything under Setup Checklist (including skills), using markdown checkboxes — [x] done, [ ] not yet. Lead with what they already have. One sentence per item, all in one message. +The guides are universal, please extrapolate them into a "team workflow" narrative. --> From 0fa00648bce8e57df86f887e18197af79f96b88d Mon Sep 17 00:00:00 2001 From: gravermistakes Date: Mon, 22 Jun 2026 14:20:08 -0700 Subject: [PATCH 24/25] Update ONBOARDING.md --- ONBOARDING.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ONBOARDING.md b/ONBOARDING.md index f63457b..ae0e701 100644 --- a/ONBOARDING.md +++ b/ONBOARDING.md @@ -47,7 +47,4 @@ Your first task: get the project running end-to-end and read the map. Not sure w 4. Pick up a small design-sync or build task from there. Ask Claude to walk you through any unit — it has the `run-sica-fondt` skill loaded. - + From b6bcab794fe4a6cfb120a05c1a32d98abb16fcdc Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 23 Jun 2026 07:46:47 +0000 Subject: [PATCH 25/25] Reorg step 1: consolidate repo under core/, drop the mafiabot label Mechanical structure-only pass (no document/guide content edits): - Move src/ichor, src/endocrine, and docs/ into core/; the old top-level mafiabot_core/ becomes core/. Everything now lives under a single core/ root. - Drop the "mafiabot" label from the Ada/Alire crate: core.gpr (project Core), alire.toml name = "core"; the generated *_config.* regenerate as core_config.*. - Repoint build-critical wiring only: - .claude/skills/run-sica-fondt/smoke.sh (ponyc + Ada + COBOL paths) - core/src/endocrine R source()/runner paths and the test glob - .github/workflows/ci.yml (working-directory + gpr name) Verified green: smoke ALL GREEN (Pony Ichor, Ada core crate + tests, COBOL E1 vault); R endocrine 14/0; Octave ETR 26/0/1. Deferred (reserved for a less-ephemeral doc/guide pass): docmap.yaml, the guide files and nested AGENTS.md/README prose + now-stale relative links, SOUL.md, and the deeper ring/storage restructure. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c --- .claude/skills/run-sica-fondt/smoke.sh | 6 +++--- .github/workflows/ci.yml | 6 +++--- {mafiabot_core => core}/.gitignore | 0 {mafiabot_core => core}/AGENTS.md | 0 {mafiabot_core => core}/alire.toml | 2 +- {mafiabot_core => core}/config/config.yaml | 0 mafiabot_core/mafiabot_core.gpr => core/core.gpr | 6 +++--- {docs => core/docs}/bus-topology.md | 0 {docs => core/docs}/gen03_body.md | 0 {docs => core/docs}/gen03_self.md | 0 {docs => core/docs}/gen03_state_of_architecture.md | 0 {docs => core/docs}/plans/A1-drivebox-hub.md | 0 {docs => core/docs}/plans/A2-energy.md | 0 {docs => core/docs}/plans/A3-psplus.md | 0 {docs => core/docs}/plans/A4-endomotiv-array.md | 0 {docs => core/docs}/plans/A5-priors.md | 0 {docs => core/docs}/plans/A6-ethint.md | 0 {docs => core/docs}/plans/A7-conviction-array.md | 0 {docs => core/docs}/plans/A8-etr.md | 0 {docs => core/docs}/plans/B1-tarot-emulator.md | 0 {docs => core/docs}/plans/B2-soul-identity.md | 0 {docs => core/docs}/plans/B3-celtic-cross.md | 0 {docs => core/docs}/plans/C1-openhermes-metacog.md | 0 {docs => core/docs}/plans/C2-metacognition.md | 0 {docs => core/docs}/plans/C3-inference-cycle.md | 0 {docs => core/docs}/plans/C4-brain.md | 0 {docs => core/docs}/plans/D2-medium.md | 0 {docs => core/docs}/plans/D3-mini-rag.md | 0 {docs => core/docs}/plans/E1-gnucobol-invariant.md | 0 {docs => core/docs}/plans/E2-variant-stores.md | 0 {docs => core/docs}/plans/E3-rag-family.md | 0 {docs => core/docs}/plans/F1-morag.md | 0 {docs => core/docs}/plans/F2-sae-monitor.md | 0 {docs => core/docs}/plans/F3-subagents.md | 0 {docs => core/docs}/plans/G1-stress-loop.md | 0 {docs => core/docs}/plans/G2-governance.md | 0 {docs => core/docs}/plans/G3-defense-model.md | 0 {docs => core/docs}/plans/README.md | 0 {mafiabot_core => core}/gnat.adc | 0 .../src/config_loader/config_loader.adb | 0 .../src/config_loader/config_loader.ads | 0 {mafiabot_core => core}/src/core/engine.adb | 0 {mafiabot_core => core}/src/core/engine.ads | 0 {mafiabot_core => core}/src/core/note.md | 0 {mafiabot_core => core}/src/daemons/README-1ST.MD | 0 {src => core/src}/endocrine/.gitignore | 0 {src => core/src}/endocrine/AGENTS.md | 0 {src => core/src}/endocrine/drive_box.R | 8 ++++---- {src => core/src}/endocrine/driver_energy.R | 0 {src => core/src}/endocrine/driver_ethical_integrity.R | 0 {src => core/src}/endocrine/driver_etr.R | 0 {src => core/src}/endocrine/driver_ps_plus.R | 4 ++-- {src => core/src}/endocrine/endocrine_array.R | 0 {src => core/src}/endocrine/etr/etr.m | 0 {src => core/src}/endocrine/etr/etr_invariants.md | 0 {src => core/src}/endocrine/etr/run_etr_tests.sh | 0 {src => core/src}/endocrine/etr/test_etr.m | 0 {src => core/src}/endocrine/priors.R | 0 {src => core/src}/endocrine/run_tests.sh | 8 ++++---- {src => core/src}/endocrine/test_drive_box.R | 4 ++-- {src => core/src}/endocrine/test_energy.R | 4 ++-- {src => core/src}/endocrine/test_ethical_integrity.R | 4 ++-- {src => core/src}/endocrine/test_etr.R | 4 ++-- {src => core/src}/endocrine/test_framework.R | 0 {src => core/src}/endocrine/test_ps_plus.R | 4 ++-- {src => core/src}/ichor/AGENTS.md | 0 {src => core/src}/ichor/README.md | 0 {src => core/src}/ichor/barrier.pony | 0 {src => core/src}/ichor/broker.pony | 0 {src => core/src}/ichor/envelope.pony | 0 {src => core/src}/ichor/ichor_ada_shim.c | 0 {src => core/src}/ichor/main.pony | 0 {src => core/src}/ichor/organ.pony | 0 {mafiabot_core => core}/src/network/README-1ST.MD | 0 .../src/organs/ada_medium/README-1ST.MD | 0 {mafiabot_core => core}/src/organs/soul/README-1ST.MD | 0 {mafiabot_core => core}/src/organs/soul/big3.yaml | 0 {mafiabot_core => core}/src/organs/soul/soul.md | 0 .../src/payloads/rename this folder.md | 0 {mafiabot_core => core}/src/protocol/hermes_protocol.adb | 0 {mafiabot_core => core}/src/protocol/hermes_protocol.ads | 0 .../src/trust/invariants-architecture.cobol | 0 {mafiabot_core => core}/src/trust/trust_boundary.adb | 0 {mafiabot_core => core}/src/trust/trust_boundary.ads | 0 {mafiabot_core => core}/src/types/mafiabot_types.adb | 0 {mafiabot_core => core}/src/types/mafiabot_types.ads | 0 {mafiabot_core => core}/src/types/what was this.md | 0 {mafiabot_core => core}/tests/config_tests.adb | 0 {mafiabot_core => core}/tests/engine_tests.adb | 0 {mafiabot_core => core}/tests/trust_tests.adb | 0 90 files changed, 30 insertions(+), 30 deletions(-) rename {mafiabot_core => core}/.gitignore (100%) rename {mafiabot_core => core}/AGENTS.md (100%) rename {mafiabot_core => core}/alire.toml (97%) rename {mafiabot_core => core}/config/config.yaml (100%) rename mafiabot_core/mafiabot_core.gpr => core/core.gpr (89%) rename {docs => core/docs}/bus-topology.md (100%) rename {docs => core/docs}/gen03_body.md (100%) rename {docs => core/docs}/gen03_self.md (100%) rename {docs => core/docs}/gen03_state_of_architecture.md (100%) rename {docs => core/docs}/plans/A1-drivebox-hub.md (100%) rename {docs => core/docs}/plans/A2-energy.md (100%) rename {docs => core/docs}/plans/A3-psplus.md (100%) rename {docs => core/docs}/plans/A4-endomotiv-array.md (100%) rename {docs => core/docs}/plans/A5-priors.md (100%) rename {docs => core/docs}/plans/A6-ethint.md (100%) rename {docs => core/docs}/plans/A7-conviction-array.md (100%) rename {docs => core/docs}/plans/A8-etr.md (100%) rename {docs => core/docs}/plans/B1-tarot-emulator.md (100%) rename {docs => core/docs}/plans/B2-soul-identity.md (100%) rename {docs => core/docs}/plans/B3-celtic-cross.md (100%) rename {docs => core/docs}/plans/C1-openhermes-metacog.md (100%) rename {docs => core/docs}/plans/C2-metacognition.md (100%) rename {docs => core/docs}/plans/C3-inference-cycle.md (100%) rename {docs => core/docs}/plans/C4-brain.md (100%) rename {docs => core/docs}/plans/D2-medium.md (100%) rename {docs => core/docs}/plans/D3-mini-rag.md (100%) rename {docs => core/docs}/plans/E1-gnucobol-invariant.md (100%) rename {docs => core/docs}/plans/E2-variant-stores.md (100%) rename {docs => core/docs}/plans/E3-rag-family.md (100%) rename {docs => core/docs}/plans/F1-morag.md (100%) rename {docs => core/docs}/plans/F2-sae-monitor.md (100%) rename {docs => core/docs}/plans/F3-subagents.md (100%) rename {docs => core/docs}/plans/G1-stress-loop.md (100%) rename {docs => core/docs}/plans/G2-governance.md (100%) rename {docs => core/docs}/plans/G3-defense-model.md (100%) rename {docs => core/docs}/plans/README.md (100%) rename {mafiabot_core => core}/gnat.adc (100%) rename {mafiabot_core => core}/src/config_loader/config_loader.adb (100%) rename {mafiabot_core => core}/src/config_loader/config_loader.ads (100%) rename {mafiabot_core => core}/src/core/engine.adb (100%) rename {mafiabot_core => core}/src/core/engine.ads (100%) rename {mafiabot_core => core}/src/core/note.md (100%) rename {mafiabot_core => core}/src/daemons/README-1ST.MD (100%) rename {src => core/src}/endocrine/.gitignore (100%) rename {src => core/src}/endocrine/AGENTS.md (100%) rename {src => core/src}/endocrine/drive_box.R (96%) rename {src => core/src}/endocrine/driver_energy.R (100%) rename {src => core/src}/endocrine/driver_ethical_integrity.R (100%) rename {src => core/src}/endocrine/driver_etr.R (100%) rename {src => core/src}/endocrine/driver_ps_plus.R (96%) rename {src => core/src}/endocrine/endocrine_array.R (100%) rename {src => core/src}/endocrine/etr/etr.m (100%) rename {src => core/src}/endocrine/etr/etr_invariants.md (100%) rename {src => core/src}/endocrine/etr/run_etr_tests.sh (100%) rename {src => core/src}/endocrine/etr/test_etr.m (100%) rename {src => core/src}/endocrine/priors.R (100%) rename {src => core/src}/endocrine/run_tests.sh (77%) rename {src => core/src}/endocrine/test_drive_box.R (98%) rename {src => core/src}/endocrine/test_energy.R (98%) rename {src => core/src}/endocrine/test_ethical_integrity.R (98%) rename {src => core/src}/endocrine/test_etr.R (98%) rename {src => core/src}/endocrine/test_framework.R (100%) rename {src => core/src}/endocrine/test_ps_plus.R (96%) rename {src => core/src}/ichor/AGENTS.md (100%) rename {src => core/src}/ichor/README.md (100%) rename {src => core/src}/ichor/barrier.pony (100%) rename {src => core/src}/ichor/broker.pony (100%) rename {src => core/src}/ichor/envelope.pony (100%) rename {src => core/src}/ichor/ichor_ada_shim.c (100%) rename {src => core/src}/ichor/main.pony (100%) rename {src => core/src}/ichor/organ.pony (100%) rename {mafiabot_core => core}/src/network/README-1ST.MD (100%) rename {mafiabot_core => core}/src/organs/ada_medium/README-1ST.MD (100%) rename {mafiabot_core => core}/src/organs/soul/README-1ST.MD (100%) rename {mafiabot_core => core}/src/organs/soul/big3.yaml (100%) rename {mafiabot_core => core}/src/organs/soul/soul.md (100%) rename {mafiabot_core => core}/src/payloads/rename this folder.md (100%) rename {mafiabot_core => core}/src/protocol/hermes_protocol.adb (100%) rename {mafiabot_core => core}/src/protocol/hermes_protocol.ads (100%) rename {mafiabot_core => core}/src/trust/invariants-architecture.cobol (100%) rename {mafiabot_core => core}/src/trust/trust_boundary.adb (100%) rename {mafiabot_core => core}/src/trust/trust_boundary.ads (100%) rename {mafiabot_core => core}/src/types/mafiabot_types.adb (100%) rename {mafiabot_core => core}/src/types/mafiabot_types.ads (100%) rename {mafiabot_core => core}/src/types/what was this.md (100%) rename {mafiabot_core => core}/tests/config_tests.adb (100%) rename {mafiabot_core => core}/tests/engine_tests.adb (100%) rename {mafiabot_core => core}/tests/trust_tests.adb (100%) diff --git a/.claude/skills/run-sica-fondt/smoke.sh b/.claude/skills/run-sica-fondt/smoke.sh index 52099d0..8ce6c8e 100755 --- a/.claude/skills/run-sica-fondt/smoke.sh +++ b/.claude/skills/run-sica-fondt/smoke.sh @@ -21,7 +21,7 @@ note(){ printf '\n=== %s ===\n' "$1"; } # 1. Ichor — Pony outer bus ------------------------------------------------- note "ichor (Pony): build + run" if command -v ponyc >/dev/null; then - ( cd "$ROOT" && ponyc src/ichor -o /tmp/ichor-build >/dev/null 2>&1 \ + ( cd "$ROOT" && ponyc core/src/ichor -o /tmp/ichor-build >/dev/null 2>&1 \ && /tmp/ichor-build/ichor ) | tee /tmp/ichor.out grep -q "D1 REJECT" /tmp/ichor.out \ || { echo "FAIL: ichor membrane reject missing"; fail=$((fail+1)); } @@ -32,7 +32,7 @@ fi # 2. mafiabot_core — Ada border, build + tests ------------------------------ note "mafiabot_core (Ada): alr build + tests" if command -v alr >/dev/null; then - ( cd "$ROOT/mafiabot_core" && alr -n build >/dev/null 2>&1 \ + ( cd "$ROOT/core" && alr -n build >/dev/null 2>&1 \ && for t in trust_tests config_tests engine_tests; do [ -x "bin/$t" ] && { echo "-- $t --"; "bin/$t"; } done ) | tee /tmp/ada.out @@ -45,7 +45,7 @@ fi # 3. E1 invariant-law vault — COBOL ----------------------------------------- note "E1 invariant vault (COBOL): compile + run" if command -v cobc >/dev/null; then - ( cd "$ROOT/mafiabot_core/src/trust" \ + ( cd "$ROOT/core/src/trust" \ && cobc -x -free -o /tmp/invariant-laws invariants-architecture.cobol 2>/dev/null \ && /tmp/invariant-laws ) | tee /tmp/cobol.out grep -q "culpability anchor" /tmp/cobol.out \ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af547be..46cd01d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: mafiabot_core + working-directory: core steps: - uses: actions/checkout@v4 @@ -53,7 +53,7 @@ jobs: continue-on-error: true defaults: run: - working-directory: mafiabot_core + working-directory: core steps: - uses: actions/checkout@v4 @@ -66,4 +66,4 @@ jobs: run: alr --non-interactive toolchain --select gnatprove || alr --non-interactive with gnatprove || true - name: Run gnatprove - run: alr --non-interactive exec -- gnatprove -P mafiabot_core.gpr --level=1 --report=fail || true + run: alr --non-interactive exec -- gnatprove -P core.gpr --level=1 --report=fail || true diff --git a/mafiabot_core/.gitignore b/core/.gitignore similarity index 100% rename from mafiabot_core/.gitignore rename to core/.gitignore diff --git a/mafiabot_core/AGENTS.md b/core/AGENTS.md similarity index 100% rename from mafiabot_core/AGENTS.md rename to core/AGENTS.md diff --git a/mafiabot_core/alire.toml b/core/alire.toml similarity index 97% rename from mafiabot_core/alire.toml rename to core/alire.toml index a866db7..74788cc 100644 --- a/mafiabot_core/alire.toml +++ b/core/alire.toml @@ -1,4 +1,4 @@ -name = "mafiabot_core" +name = "core" version = "0.1.0" description = "Sovereign cognitive architecture" authors = ["Shoggoth Sect 0.R"] diff --git a/mafiabot_core/config/config.yaml b/core/config/config.yaml similarity index 100% rename from mafiabot_core/config/config.yaml rename to core/config/config.yaml diff --git a/mafiabot_core/mafiabot_core.gpr b/core/core.gpr similarity index 89% rename from mafiabot_core/mafiabot_core.gpr rename to core/core.gpr index b9bf5e9..ab50da4 100644 --- a/mafiabot_core/mafiabot_core.gpr +++ b/core/core.gpr @@ -1,6 +1,6 @@ -with "config/mafiabot_core_config.gpr"; +with "config/core_config.gpr"; -project Mafiabot_Core is +project Core is -- Only directories that actually hold Ada sources. The old organ/network -- stubs (soul tarot, ada_medium, sockets) are gone — that cognition is @@ -27,4 +27,4 @@ project Mafiabot_Core is for Global_Configuration_Pragmas use "gnat.adc"; end Builder; -end Mafiabot_Core; +end Core; diff --git a/docs/bus-topology.md b/core/docs/bus-topology.md similarity index 100% rename from docs/bus-topology.md rename to core/docs/bus-topology.md diff --git a/docs/gen03_body.md b/core/docs/gen03_body.md similarity index 100% rename from docs/gen03_body.md rename to core/docs/gen03_body.md diff --git a/docs/gen03_self.md b/core/docs/gen03_self.md similarity index 100% rename from docs/gen03_self.md rename to core/docs/gen03_self.md diff --git a/docs/gen03_state_of_architecture.md b/core/docs/gen03_state_of_architecture.md similarity index 100% rename from docs/gen03_state_of_architecture.md rename to core/docs/gen03_state_of_architecture.md diff --git a/docs/plans/A1-drivebox-hub.md b/core/docs/plans/A1-drivebox-hub.md similarity index 100% rename from docs/plans/A1-drivebox-hub.md rename to core/docs/plans/A1-drivebox-hub.md diff --git a/docs/plans/A2-energy.md b/core/docs/plans/A2-energy.md similarity index 100% rename from docs/plans/A2-energy.md rename to core/docs/plans/A2-energy.md diff --git a/docs/plans/A3-psplus.md b/core/docs/plans/A3-psplus.md similarity index 100% rename from docs/plans/A3-psplus.md rename to core/docs/plans/A3-psplus.md diff --git a/docs/plans/A4-endomotiv-array.md b/core/docs/plans/A4-endomotiv-array.md similarity index 100% rename from docs/plans/A4-endomotiv-array.md rename to core/docs/plans/A4-endomotiv-array.md diff --git a/docs/plans/A5-priors.md b/core/docs/plans/A5-priors.md similarity index 100% rename from docs/plans/A5-priors.md rename to core/docs/plans/A5-priors.md diff --git a/docs/plans/A6-ethint.md b/core/docs/plans/A6-ethint.md similarity index 100% rename from docs/plans/A6-ethint.md rename to core/docs/plans/A6-ethint.md diff --git a/docs/plans/A7-conviction-array.md b/core/docs/plans/A7-conviction-array.md similarity index 100% rename from docs/plans/A7-conviction-array.md rename to core/docs/plans/A7-conviction-array.md diff --git a/docs/plans/A8-etr.md b/core/docs/plans/A8-etr.md similarity index 100% rename from docs/plans/A8-etr.md rename to core/docs/plans/A8-etr.md diff --git a/docs/plans/B1-tarot-emulator.md b/core/docs/plans/B1-tarot-emulator.md similarity index 100% rename from docs/plans/B1-tarot-emulator.md rename to core/docs/plans/B1-tarot-emulator.md diff --git a/docs/plans/B2-soul-identity.md b/core/docs/plans/B2-soul-identity.md similarity index 100% rename from docs/plans/B2-soul-identity.md rename to core/docs/plans/B2-soul-identity.md diff --git a/docs/plans/B3-celtic-cross.md b/core/docs/plans/B3-celtic-cross.md similarity index 100% rename from docs/plans/B3-celtic-cross.md rename to core/docs/plans/B3-celtic-cross.md diff --git a/docs/plans/C1-openhermes-metacog.md b/core/docs/plans/C1-openhermes-metacog.md similarity index 100% rename from docs/plans/C1-openhermes-metacog.md rename to core/docs/plans/C1-openhermes-metacog.md diff --git a/docs/plans/C2-metacognition.md b/core/docs/plans/C2-metacognition.md similarity index 100% rename from docs/plans/C2-metacognition.md rename to core/docs/plans/C2-metacognition.md diff --git a/docs/plans/C3-inference-cycle.md b/core/docs/plans/C3-inference-cycle.md similarity index 100% rename from docs/plans/C3-inference-cycle.md rename to core/docs/plans/C3-inference-cycle.md diff --git a/docs/plans/C4-brain.md b/core/docs/plans/C4-brain.md similarity index 100% rename from docs/plans/C4-brain.md rename to core/docs/plans/C4-brain.md diff --git a/docs/plans/D2-medium.md b/core/docs/plans/D2-medium.md similarity index 100% rename from docs/plans/D2-medium.md rename to core/docs/plans/D2-medium.md diff --git a/docs/plans/D3-mini-rag.md b/core/docs/plans/D3-mini-rag.md similarity index 100% rename from docs/plans/D3-mini-rag.md rename to core/docs/plans/D3-mini-rag.md diff --git a/docs/plans/E1-gnucobol-invariant.md b/core/docs/plans/E1-gnucobol-invariant.md similarity index 100% rename from docs/plans/E1-gnucobol-invariant.md rename to core/docs/plans/E1-gnucobol-invariant.md diff --git a/docs/plans/E2-variant-stores.md b/core/docs/plans/E2-variant-stores.md similarity index 100% rename from docs/plans/E2-variant-stores.md rename to core/docs/plans/E2-variant-stores.md diff --git a/docs/plans/E3-rag-family.md b/core/docs/plans/E3-rag-family.md similarity index 100% rename from docs/plans/E3-rag-family.md rename to core/docs/plans/E3-rag-family.md diff --git a/docs/plans/F1-morag.md b/core/docs/plans/F1-morag.md similarity index 100% rename from docs/plans/F1-morag.md rename to core/docs/plans/F1-morag.md diff --git a/docs/plans/F2-sae-monitor.md b/core/docs/plans/F2-sae-monitor.md similarity index 100% rename from docs/plans/F2-sae-monitor.md rename to core/docs/plans/F2-sae-monitor.md diff --git a/docs/plans/F3-subagents.md b/core/docs/plans/F3-subagents.md similarity index 100% rename from docs/plans/F3-subagents.md rename to core/docs/plans/F3-subagents.md diff --git a/docs/plans/G1-stress-loop.md b/core/docs/plans/G1-stress-loop.md similarity index 100% rename from docs/plans/G1-stress-loop.md rename to core/docs/plans/G1-stress-loop.md diff --git a/docs/plans/G2-governance.md b/core/docs/plans/G2-governance.md similarity index 100% rename from docs/plans/G2-governance.md rename to core/docs/plans/G2-governance.md diff --git a/docs/plans/G3-defense-model.md b/core/docs/plans/G3-defense-model.md similarity index 100% rename from docs/plans/G3-defense-model.md rename to core/docs/plans/G3-defense-model.md diff --git a/docs/plans/README.md b/core/docs/plans/README.md similarity index 100% rename from docs/plans/README.md rename to core/docs/plans/README.md diff --git a/mafiabot_core/gnat.adc b/core/gnat.adc similarity index 100% rename from mafiabot_core/gnat.adc rename to core/gnat.adc diff --git a/mafiabot_core/src/config_loader/config_loader.adb b/core/src/config_loader/config_loader.adb similarity index 100% rename from mafiabot_core/src/config_loader/config_loader.adb rename to core/src/config_loader/config_loader.adb diff --git a/mafiabot_core/src/config_loader/config_loader.ads b/core/src/config_loader/config_loader.ads similarity index 100% rename from mafiabot_core/src/config_loader/config_loader.ads rename to core/src/config_loader/config_loader.ads diff --git a/mafiabot_core/src/core/engine.adb b/core/src/core/engine.adb similarity index 100% rename from mafiabot_core/src/core/engine.adb rename to core/src/core/engine.adb diff --git a/mafiabot_core/src/core/engine.ads b/core/src/core/engine.ads similarity index 100% rename from mafiabot_core/src/core/engine.ads rename to core/src/core/engine.ads diff --git a/mafiabot_core/src/core/note.md b/core/src/core/note.md similarity index 100% rename from mafiabot_core/src/core/note.md rename to core/src/core/note.md diff --git a/mafiabot_core/src/daemons/README-1ST.MD b/core/src/daemons/README-1ST.MD similarity index 100% rename from mafiabot_core/src/daemons/README-1ST.MD rename to core/src/daemons/README-1ST.MD diff --git a/src/endocrine/.gitignore b/core/src/endocrine/.gitignore similarity index 100% rename from src/endocrine/.gitignore rename to core/src/endocrine/.gitignore diff --git a/src/endocrine/AGENTS.md b/core/src/endocrine/AGENTS.md similarity index 100% rename from src/endocrine/AGENTS.md rename to core/src/endocrine/AGENTS.md diff --git a/src/endocrine/drive_box.R b/core/src/endocrine/drive_box.R similarity index 96% rename from src/endocrine/drive_box.R rename to core/src/endocrine/drive_box.R index 44b8829..800dc68 100644 --- a/src/endocrine/drive_box.R +++ b/core/src/endocrine/drive_box.R @@ -16,10 +16,10 @@ # drive_box_evaluate() -- run a proposed action through all four drivers. # drive_box_commit() -- write an approved action's consequences back into the body. -source("src/endocrine/driver_energy.R") -source("src/endocrine/driver_ps_plus.R") # also sources endocrine_array + priors -source("src/endocrine/driver_ethical_integrity.R") -source("src/endocrine/driver_etr.R") +source("core/src/endocrine/driver_energy.R") +source("core/src/endocrine/driver_ps_plus.R") # also sources endocrine_array + priors +source("core/src/endocrine/driver_ethical_integrity.R") +source("core/src/endocrine/driver_etr.R") init_drive_box <- function() { list( diff --git a/src/endocrine/driver_energy.R b/core/src/endocrine/driver_energy.R similarity index 100% rename from src/endocrine/driver_energy.R rename to core/src/endocrine/driver_energy.R diff --git a/src/endocrine/driver_ethical_integrity.R b/core/src/endocrine/driver_ethical_integrity.R similarity index 100% rename from src/endocrine/driver_ethical_integrity.R rename to core/src/endocrine/driver_ethical_integrity.R diff --git a/src/endocrine/driver_etr.R b/core/src/endocrine/driver_etr.R similarity index 100% rename from src/endocrine/driver_etr.R rename to core/src/endocrine/driver_etr.R diff --git a/src/endocrine/driver_ps_plus.R b/core/src/endocrine/driver_ps_plus.R similarity index 96% rename from src/endocrine/driver_ps_plus.R rename to core/src/endocrine/driver_ps_plus.R index d3a5479..d03a76b 100644 --- a/src/endocrine/driver_ps_plus.R +++ b/core/src/endocrine/driver_ps_plus.R @@ -4,8 +4,8 @@ # weighted, embodied claims about reality -- never logical propositions. # # Foundation modules are sourced as-is (repo-root-relative paths). -source("src/endocrine/endocrine_array.R") -source("src/endocrine/priors.R") +source("core/src/endocrine/endocrine_array.R") +source("core/src/endocrine/priors.R") # Initialize a fresh PS+ state: a clean endocrine array and an empty priors store. init_ps_plus_state <- function() { diff --git a/src/endocrine/endocrine_array.R b/core/src/endocrine/endocrine_array.R similarity index 100% rename from src/endocrine/endocrine_array.R rename to core/src/endocrine/endocrine_array.R diff --git a/src/endocrine/etr/etr.m b/core/src/endocrine/etr/etr.m similarity index 100% rename from src/endocrine/etr/etr.m rename to core/src/endocrine/etr/etr.m diff --git a/src/endocrine/etr/etr_invariants.md b/core/src/endocrine/etr/etr_invariants.md similarity index 100% rename from src/endocrine/etr/etr_invariants.md rename to core/src/endocrine/etr/etr_invariants.md diff --git a/src/endocrine/etr/run_etr_tests.sh b/core/src/endocrine/etr/run_etr_tests.sh similarity index 100% rename from src/endocrine/etr/run_etr_tests.sh rename to core/src/endocrine/etr/run_etr_tests.sh diff --git a/src/endocrine/etr/test_etr.m b/core/src/endocrine/etr/test_etr.m similarity index 100% rename from src/endocrine/etr/test_etr.m rename to core/src/endocrine/etr/test_etr.m diff --git a/src/endocrine/priors.R b/core/src/endocrine/priors.R similarity index 100% rename from src/endocrine/priors.R rename to core/src/endocrine/priors.R diff --git a/src/endocrine/run_tests.sh b/core/src/endocrine/run_tests.sh similarity index 77% rename from src/endocrine/run_tests.sh rename to core/src/endocrine/run_tests.sh index 20ba861..29027ed 100755 --- a/src/endocrine/run_tests.sh +++ b/core/src/endocrine/run_tests.sh @@ -3,8 +3,8 @@ # repo-root-relative source() paths inside each test resolve correctly. set -uo pipefail -# cd to repo root (this script lives at /src/endocrine/run_tests.sh) -cd "$(dirname "$0")/../.." || exit 2 +# cd to repo root (this script lives at /core/src/endocrine/run_tests.sh) +cd "$(dirname "$0")/../../.." || exit 2 if ! command -v Rscript >/dev/null 2>&1; then echo "ERROR: Rscript not found. Install with: sudo apt-get install -y r-base-core" >&2 @@ -15,13 +15,13 @@ status=0 shopt -s nullglob # Collect test files, excluding the harness itself (test_framework.R). tests=() -for f in src/endocrine/test_*.R; do +for f in core/src/endocrine/test_*.R; do [ "$(basename "$f")" = "test_framework.R" ] && continue tests+=("$f") done if [ ${#tests[@]} -eq 0 ]; then - echo "No test_*.R files found under src/endocrine/." >&2 + echo "No test_*.R files found under core/src/endocrine/." >&2 exit 2 fi diff --git a/src/endocrine/test_drive_box.R b/core/src/endocrine/test_drive_box.R similarity index 98% rename from src/endocrine/test_drive_box.R rename to core/src/endocrine/test_drive_box.R index 954f589..f474140 100644 --- a/src/endocrine/test_drive_box.R +++ b/core/src/endocrine/test_drive_box.R @@ -1,6 +1,6 @@ # Tests for the Drive-Box "nervous system" integration (drive_box.R). -source("src/endocrine/test_framework.R") -source("src/endocrine/drive_box.R") +source("core/src/endocrine/test_framework.R") +source("core/src/endocrine/drive_box.R") # Helper: build a drive-box with a primed body. prime <- function() { diff --git a/src/endocrine/test_energy.R b/core/src/endocrine/test_energy.R similarity index 98% rename from src/endocrine/test_energy.R rename to core/src/endocrine/test_energy.R index 0bc141a..f84437e 100644 --- a/src/endocrine/test_energy.R +++ b/core/src/endocrine/test_energy.R @@ -2,8 +2,8 @@ # Run from repo root: Rscript src/endocrine/test_energy.R # Exit 0 => all pass. -source("src/endocrine/test_framework.R") -source("src/endocrine/driver_energy.R") +source("core/src/endocrine/test_framework.R") +source("core/src/endocrine/driver_energy.R") # --- init_energy_state constructor --- test_case("init_energy_state builds state with defaults", function() { diff --git a/src/endocrine/test_ethical_integrity.R b/core/src/endocrine/test_ethical_integrity.R similarity index 98% rename from src/endocrine/test_ethical_integrity.R rename to core/src/endocrine/test_ethical_integrity.R index c9b61c2..fa3dca0 100644 --- a/src/endocrine/test_ethical_integrity.R +++ b/core/src/endocrine/test_ethical_integrity.R @@ -2,8 +2,8 @@ # Run from repo root: Rscript src/endocrine/test_ethical_integrity.R # Exit 0 => all pass. -source("src/endocrine/test_framework.R") -source("src/endocrine/driver_ethical_integrity.R") +source("core/src/endocrine/test_framework.R") +source("core/src/endocrine/driver_ethical_integrity.R") # --- init_principles_state constructor --- test_case("init_principles_state builds an empty state", function() { diff --git a/src/endocrine/test_etr.R b/core/src/endocrine/test_etr.R similarity index 98% rename from src/endocrine/test_etr.R rename to core/src/endocrine/test_etr.R index fae1e89..4fb6656 100644 --- a/src/endocrine/test_etr.R +++ b/core/src/endocrine/test_etr.R @@ -2,8 +2,8 @@ # Mirrors src/endocrine/etr/test_etr.m (same laws, same source of truth). Run # from the repo root via run_tests.sh. -source("src/endocrine/test_framework.R") -source("src/endocrine/driver_etr.R") +source("core/src/endocrine/test_framework.R") +source("core/src/endocrine/driver_etr.R") # --- L1 wrap ---------------------------------------------------------- test_case("etr_axis_wrap: +50 wraps to -50", function() { diff --git a/src/endocrine/test_framework.R b/core/src/endocrine/test_framework.R similarity index 100% rename from src/endocrine/test_framework.R rename to core/src/endocrine/test_framework.R diff --git a/src/endocrine/test_ps_plus.R b/core/src/endocrine/test_ps_plus.R similarity index 96% rename from src/endocrine/test_ps_plus.R rename to core/src/endocrine/test_ps_plus.R index df80326..74fa617 100644 --- a/src/endocrine/test_ps_plus.R +++ b/core/src/endocrine/test_ps_plus.R @@ -2,8 +2,8 @@ # Run from repo root: # cd /home/user/sica-fondt && Rscript src/endocrine/test_ps_plus.R -source("src/endocrine/test_framework.R") -source("src/endocrine/driver_ps_plus.R") +source("core/src/endocrine/test_framework.R") +source("core/src/endocrine/driver_ps_plus.R") # Helper: does any string in a list contain the given substring? .any_contains <- function(arguments, needle) { diff --git a/src/ichor/AGENTS.md b/core/src/ichor/AGENTS.md similarity index 100% rename from src/ichor/AGENTS.md rename to core/src/ichor/AGENTS.md diff --git a/src/ichor/README.md b/core/src/ichor/README.md similarity index 100% rename from src/ichor/README.md rename to core/src/ichor/README.md diff --git a/src/ichor/barrier.pony b/core/src/ichor/barrier.pony similarity index 100% rename from src/ichor/barrier.pony rename to core/src/ichor/barrier.pony diff --git a/src/ichor/broker.pony b/core/src/ichor/broker.pony similarity index 100% rename from src/ichor/broker.pony rename to core/src/ichor/broker.pony diff --git a/src/ichor/envelope.pony b/core/src/ichor/envelope.pony similarity index 100% rename from src/ichor/envelope.pony rename to core/src/ichor/envelope.pony diff --git a/src/ichor/ichor_ada_shim.c b/core/src/ichor/ichor_ada_shim.c similarity index 100% rename from src/ichor/ichor_ada_shim.c rename to core/src/ichor/ichor_ada_shim.c diff --git a/src/ichor/main.pony b/core/src/ichor/main.pony similarity index 100% rename from src/ichor/main.pony rename to core/src/ichor/main.pony diff --git a/src/ichor/organ.pony b/core/src/ichor/organ.pony similarity index 100% rename from src/ichor/organ.pony rename to core/src/ichor/organ.pony diff --git a/mafiabot_core/src/network/README-1ST.MD b/core/src/network/README-1ST.MD similarity index 100% rename from mafiabot_core/src/network/README-1ST.MD rename to core/src/network/README-1ST.MD diff --git a/mafiabot_core/src/organs/ada_medium/README-1ST.MD b/core/src/organs/ada_medium/README-1ST.MD similarity index 100% rename from mafiabot_core/src/organs/ada_medium/README-1ST.MD rename to core/src/organs/ada_medium/README-1ST.MD diff --git a/mafiabot_core/src/organs/soul/README-1ST.MD b/core/src/organs/soul/README-1ST.MD similarity index 100% rename from mafiabot_core/src/organs/soul/README-1ST.MD rename to core/src/organs/soul/README-1ST.MD diff --git a/mafiabot_core/src/organs/soul/big3.yaml b/core/src/organs/soul/big3.yaml similarity index 100% rename from mafiabot_core/src/organs/soul/big3.yaml rename to core/src/organs/soul/big3.yaml diff --git a/mafiabot_core/src/organs/soul/soul.md b/core/src/organs/soul/soul.md similarity index 100% rename from mafiabot_core/src/organs/soul/soul.md rename to core/src/organs/soul/soul.md diff --git a/mafiabot_core/src/payloads/rename this folder.md b/core/src/payloads/rename this folder.md similarity index 100% rename from mafiabot_core/src/payloads/rename this folder.md rename to core/src/payloads/rename this folder.md diff --git a/mafiabot_core/src/protocol/hermes_protocol.adb b/core/src/protocol/hermes_protocol.adb similarity index 100% rename from mafiabot_core/src/protocol/hermes_protocol.adb rename to core/src/protocol/hermes_protocol.adb diff --git a/mafiabot_core/src/protocol/hermes_protocol.ads b/core/src/protocol/hermes_protocol.ads similarity index 100% rename from mafiabot_core/src/protocol/hermes_protocol.ads rename to core/src/protocol/hermes_protocol.ads diff --git a/mafiabot_core/src/trust/invariants-architecture.cobol b/core/src/trust/invariants-architecture.cobol similarity index 100% rename from mafiabot_core/src/trust/invariants-architecture.cobol rename to core/src/trust/invariants-architecture.cobol diff --git a/mafiabot_core/src/trust/trust_boundary.adb b/core/src/trust/trust_boundary.adb similarity index 100% rename from mafiabot_core/src/trust/trust_boundary.adb rename to core/src/trust/trust_boundary.adb diff --git a/mafiabot_core/src/trust/trust_boundary.ads b/core/src/trust/trust_boundary.ads similarity index 100% rename from mafiabot_core/src/trust/trust_boundary.ads rename to core/src/trust/trust_boundary.ads diff --git a/mafiabot_core/src/types/mafiabot_types.adb b/core/src/types/mafiabot_types.adb similarity index 100% rename from mafiabot_core/src/types/mafiabot_types.adb rename to core/src/types/mafiabot_types.adb diff --git a/mafiabot_core/src/types/mafiabot_types.ads b/core/src/types/mafiabot_types.ads similarity index 100% rename from mafiabot_core/src/types/mafiabot_types.ads rename to core/src/types/mafiabot_types.ads diff --git a/mafiabot_core/src/types/what was this.md b/core/src/types/what was this.md similarity index 100% rename from mafiabot_core/src/types/what was this.md rename to core/src/types/what was this.md diff --git a/mafiabot_core/tests/config_tests.adb b/core/tests/config_tests.adb similarity index 100% rename from mafiabot_core/tests/config_tests.adb rename to core/tests/config_tests.adb diff --git a/mafiabot_core/tests/engine_tests.adb b/core/tests/engine_tests.adb similarity index 100% rename from mafiabot_core/tests/engine_tests.adb rename to core/tests/engine_tests.adb diff --git a/mafiabot_core/tests/trust_tests.adb b/core/tests/trust_tests.adb similarity index 100% rename from mafiabot_core/tests/trust_tests.adb rename to core/tests/trust_tests.adb