mirror of
https://github.com/SHOGGOTH-SECTOR/sica-fondt.git
synced 2026-09-30 01:15:10 +00:00
ada: cut to a border-only gate; delete the wrong organ/cognition modeling
Ada is the D1 border, not the body. Removed everything that pretended otherwise
and completed the real gate so it builds, links, and passes its tests.
Deleted (wrong/defunct/superseded):
- ada_medium.adb (defunct medium, header commented 'WRONG'; replaced by Ichor)
- sockets.{ads,adb} (empty package with an illegal body)
- bbb-bludbrenburier.ads ('this is filler'); invariants-architecture.cobol ('idk cobol')
- tests/soul_tests.adb, tests/cycle_tests.adb (exercise a Soul.Tarot/State/Ada_Medium
subsystem that does not exist -- the old 56-card/Big-3 design, superseded)
mafiabot_types -> border-only: organs aren't Ada (organs are R/Octave/Pony/Guile),
so drop Organ_Id; drop Cycle_Step (cognition) and the fixed-point Drive/Ratio/
Cost/Axis numerics (drive/affect math lives in the organs, in floats). Keep the
source/trust tag (Provenance_Tag), Operation_Status, and a bounded payload --
content is pre-digested into RAG context upstream, so the gate scans a bounded
buffer for prompt-injection rather than streaming raw input.
trust_boundary: Organ_Message -> Border_Message {Provenance, Payload} (Ada does
not route by organ -- that's Ichor); add the D1 body (blocklist scan, provenance,
rate limit, Trust_Guard) -- the unit Ichor's barrier FFI targets.
Add mafiabot_types.adb. Fix mafiabot_core.gpr (drop phantom dirs + nonexistent
mafiabot.adb main). alire.toml: drop unused gnat_sockets/spark_lemmas.
Builds clean on GNAT 13.3/Alire; trust + config tests pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hmgREHNsxYCuim33yUF2c
This commit is contained in:
@@ -1,96 +0,0 @@
|
||||
pragma SPARK_Mode (Off); -- test harness uses Ada.Text_IO
|
||||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
with Soul.Tarot;
|
||||
with Soul.State;
|
||||
with Ada_Medium;
|
||||
with Mafiabot_Types; use Mafiabot_Types;
|
||||
|
||||
procedure Cycle_Tests is
|
||||
Fails : Natural := 0;
|
||||
|
||||
procedure Check (Name : String; Cond : Boolean) is
|
||||
begin
|
||||
if Cond then
|
||||
Put_Line ("PASS " & Name);
|
||||
else
|
||||
Put_Line ("FAIL " & Name);
|
||||
Fails := Fails + 1;
|
||||
end if;
|
||||
end Check;
|
||||
|
||||
B3 : constant Soul.Tarot.Big_Three :=
|
||||
(Sun => (Kind => Soul.Tarot.Major, Major_Value => Soul.Tarot.The_Sun),
|
||||
Moon => (Kind => Soul.Tarot.Major, Major_Value => Soul.Tarot.The_Moon),
|
||||
Ascendant => (Kind => Soul.Tarot.Major,
|
||||
Major_Value => Soul.Tarot.SD_Singularity));
|
||||
|
||||
St : Operation_Status;
|
||||
begin
|
||||
Soul.State.Soul_State.Initialize_Big_Three (B3, St);
|
||||
Check ("identity init ok", St = OK);
|
||||
|
||||
declare
|
||||
R : Operation_Status;
|
||||
begin
|
||||
Soul.State.Soul_State.Initialize_Big_Three (B3, R);
|
||||
Check ("double init rejected", R = Error_Already_Init);
|
||||
end;
|
||||
|
||||
-- Session A: full cycle forms and holds the cross.
|
||||
declare
|
||||
Key : constant Bounded_Text :=
|
||||
Soul.State.Make_Session_Key ("alice", "telegram", "srv1");
|
||||
Out1 : Bounded_Text;
|
||||
Ref : Soul.State.Session_Ref;
|
||||
R : Operation_Status;
|
||||
begin
|
||||
Ada_Medium.Run_Inference_Cycle (Key, Make_Text ("hello"), Out1, R);
|
||||
Check ("session A cycle ok", R = OK);
|
||||
Check ("session A output non-empty", Out1.Length > 0);
|
||||
|
||||
Soul.State.Soul_State.Open_Session (Key, Ref, R);
|
||||
Check ("session A reopen ok", R = OK and then Ref in Soul.State.Valid_Session);
|
||||
Check ("session A cross formed",
|
||||
Soul.State.Soul_State.Is_Spread_Formed (Ref));
|
||||
Check ("session A output count = 1",
|
||||
Soul.State.Soul_State.Output_Count (Ref) = 1);
|
||||
end;
|
||||
|
||||
-- Session A again: cross is HELD (already formed), counter advances.
|
||||
declare
|
||||
Key : constant Bounded_Text :=
|
||||
Soul.State.Make_Session_Key ("alice", "telegram", "srv1");
|
||||
Out2 : Bounded_Text;
|
||||
Ref : Soul.State.Session_Ref;
|
||||
R : Operation_Status;
|
||||
begin
|
||||
Ada_Medium.Run_Inference_Cycle (Key, Make_Text ("again"), Out2, R);
|
||||
Check ("session A second cycle ok", R = OK);
|
||||
Soul.State.Soul_State.Open_Session (Key, Ref, R);
|
||||
Check ("session A output count = 2",
|
||||
Soul.State.Soul_State.Output_Count (Ref) = 2);
|
||||
end;
|
||||
|
||||
-- Session B: a different (uid, channel, server) is fully independent.
|
||||
declare
|
||||
Key : constant Bounded_Text :=
|
||||
Soul.State.Make_Session_Key ("bob", "discord", "srv2");
|
||||
Out3 : Bounded_Text;
|
||||
Ref : Soul.State.Session_Ref;
|
||||
R : Operation_Status;
|
||||
begin
|
||||
Ada_Medium.Run_Inference_Cycle (Key, Make_Text ("hi"), Out3, R);
|
||||
Check ("session B cycle ok", R = OK);
|
||||
Soul.State.Soul_State.Open_Session (Key, Ref, R);
|
||||
Check ("session B output count = 1",
|
||||
Soul.State.Soul_State.Output_Count (Ref) = 1);
|
||||
end;
|
||||
|
||||
Check ("two live sessions", Soul.State.Soul_State.Session_Count = 2);
|
||||
|
||||
if Fails = 0 then
|
||||
Put_Line ("ALL CYCLE TESTS PASSED");
|
||||
else
|
||||
Put_Line ("CYCLE FAILURES:" & Natural'Image (Fails));
|
||||
end if;
|
||||
end Cycle_Tests;
|
||||
@@ -1,70 +0,0 @@
|
||||
pragma SPARK_Mode (Off); -- test harness uses Ada.Text_IO
|
||||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
with Soul.Tarot;
|
||||
with Soul.Celtic_Cross;
|
||||
with Mafiabot_Types; use Mafiabot_Types;
|
||||
|
||||
use type Soul.Tarot.Slot_State;
|
||||
|
||||
procedure Soul_Tests is
|
||||
Fails : Natural := 0;
|
||||
|
||||
procedure Check (Name : String; Cond : Boolean) is
|
||||
begin
|
||||
if Cond then
|
||||
Put_Line ("PASS " & Name);
|
||||
else
|
||||
Put_Line ("FAIL " & Name);
|
||||
Fails := Fails + 1;
|
||||
end if;
|
||||
end Check;
|
||||
|
||||
B3 : constant Soul.Tarot.Big_Three :=
|
||||
(Sun => (Kind => Soul.Tarot.Major, Major_Value => Soul.Tarot.The_Sun),
|
||||
Moon => (Kind => Soul.Tarot.Major, Major_Value => Soul.Tarot.The_Moon),
|
||||
Ascendant => (Kind => Soul.Tarot.Major,
|
||||
Major_Value => Soul.Tarot.SD_Singularity));
|
||||
|
||||
D : Soul.Tarot.Deck := Soul.Tarot.Full_Deck;
|
||||
St : Operation_Status;
|
||||
begin
|
||||
Check ("full deck = 56", Soul.Tarot.Present_Count (D) = 56);
|
||||
Check ("big-3 distinct", Soul.Tarot.Big_Three_Distinct (B3));
|
||||
|
||||
Soul.Tarot.Remove_Big_Three (D, B3, St);
|
||||
Check ("remove big-3 ok", St = OK);
|
||||
Check ("pool = 53", Soul.Tarot.Present_Count (D) = 53);
|
||||
|
||||
-- The cross accretes layer by layer (2 + 2 + 2 + stave of 4).
|
||||
declare
|
||||
Sp : Soul.Celtic_Cross.CC_Spread := Soul.Celtic_Cross.Empty_Spread;
|
||||
L1, L2, L3, Lv : Operation_Status;
|
||||
begin
|
||||
Check ("empty spread has no Present slot",
|
||||
Sp (Soul.Celtic_Cross.Present).State = Soul.Tarot.Absent);
|
||||
|
||||
Soul.Celtic_Cross.Draw_Layer (D, Sp, Soul.Celtic_Cross.Layer_1, L1);
|
||||
Check ("layer 1 ok", L1 = OK);
|
||||
Check ("pool = 51 after layer 1", Soul.Tarot.Present_Count (D) = 51);
|
||||
Check ("Present filled",
|
||||
Sp (Soul.Celtic_Cross.Present).State = Soul.Tarot.Present);
|
||||
Check ("Challenge filled",
|
||||
Sp (Soul.Celtic_Cross.Challenge).State = Soul.Tarot.Present);
|
||||
Check ("Outcome still empty",
|
||||
Sp (Soul.Celtic_Cross.Outcome).State = Soul.Tarot.Absent);
|
||||
|
||||
Soul.Celtic_Cross.Draw_Layer (D, Sp, Soul.Celtic_Cross.Layer_2, L2);
|
||||
Soul.Celtic_Cross.Draw_Layer (D, Sp, Soul.Celtic_Cross.Layer_3, L3);
|
||||
Soul.Celtic_Cross.Draw_Layer (D, Sp, Soul.Celtic_Cross.Stave, Lv);
|
||||
Check ("layers 2/3/stave ok", L2 = OK and then L3 = OK and then Lv = OK);
|
||||
Check ("pool = 43 after full cross", Soul.Tarot.Present_Count (D) = 43);
|
||||
Check ("Outcome filled after stave",
|
||||
Sp (Soul.Celtic_Cross.Outcome).State = Soul.Tarot.Present);
|
||||
end;
|
||||
|
||||
if Fails = 0 then
|
||||
Put_Line ("ALL SOUL TESTS PASSED");
|
||||
else
|
||||
Put_Line ("SOUL FAILURES:" & Natural'Image (Fails));
|
||||
end if;
|
||||
end Soul_Tests;
|
||||
@@ -37,11 +37,9 @@ begin
|
||||
|
||||
-- System-internal messages always pass Check_Message (proven invariant).
|
||||
declare
|
||||
M : constant Trust_Boundary.Organ_Message :=
|
||||
(Source => Ada_Medium,
|
||||
Destination => Soul_Organ,
|
||||
Provenance => System_Internal,
|
||||
Payload => Make_Text ("execute"));
|
||||
M : constant Trust_Boundary.Border_Message :=
|
||||
(Provenance => System_Internal,
|
||||
Payload => Make_Text ("execute"));
|
||||
R : Operation_Status;
|
||||
begin
|
||||
Trust_Boundary.Check_Message (M, R);
|
||||
|
||||
Reference in New Issue
Block a user