Phase 1-2 build: Steps 5-6, 8-13

Shoresh Engine (Haskell, Step 5)
- 12 modules: Types, Lexicon, Binyanim, Teamim, Gematria, Graph,
  KetivQere, Smikhut, Havdalah, Kriah, KiTov, Firmware
- 33 EUnit tests, 0 failures
- Firmware module verifies L1 SHA-256 hash at startup

Talmudic Engine (SWI-Prolog, Step 6)
- 15 modules: halt, reasoning, specification, interface
- 57 PlUnit tests, 0 failures
- Three cardinal halt conditions: avodah_zarah, shfichut_damim, gilui_arayot

Vav Pipeline (Elixir, Steps 8-11)
- 14 modules: BereishitCycle, Shema, Cloud, Manna, L1Reader,
  Specification, HaltConditions, ShabbatTimer, CycleLog, Chatzotzrot,
  ShoreshEngineClient, TalmudicEngineClient, Application
- 46 ExUnit tests, 0 failures
- Nishma-first architecture: hears before it speaks

Sanhedrin Framework (Erlang/OTP, Step 12)
- 8 modules: sanhedrin_app, sanhedrin_sup, escalation, panel_sup,
  panel, judge, clerk, halt_monitor
- 46 EUnit tests, 0 failures (includes fix: rejected outcome now reachable)
- Panel sizes: 1/3/23/71 — unanimous capital guilty → acquit (Sanhedrin 17a)
- Minority opinions append-only, never deleted

Korban Processor (Python, Step 13)
- 6 modules: korban, shechitah, semichah, zerikah, haktarah, router

Builder tooling: AGENTS.md, opencode.json, memory/, src/tools/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott KarpandClaude Sonnet 4.6 committed 2026-02-26 14:02:34 -05:00
1 parent 622e814c9e
commit c039fa61e0
88 files changed
+10153

No files matched your search

+107
View File
@@ -0,0 +1,107 @@
%% main.pl — Talmudic Engine entry point.
%%
%% Architecture §3.4: "SWI-Prolog is interpreted, no compilation needed"
%% Test: swipl -g run_tests -t halt src/main.pl
%%
%% This file loads all modules and provides the test runner.
:- use_module(specification/mitzvot).
:- use_module(specification/torah_text).
:- use_module(specification/root_meanings).
:- use_module(specification/relationships).
:- use_module(reasoning/interpret).
:- use_module(reasoning/challenge).
:- use_module(reasoning/resolve).
:- use_module(reasoning/teiku).
:- use_module(halt/avodah_zarah).
:- use_module(halt/shfichut_damim).
:- use_module(halt/gilui_arayot).
:- use_module(interface/api).
%% Load test files
:- use_module(library(plunit)).
:- ['../test/mitzvot_test'].
:- ['../test/reasoning_test'].
:- ['../test/halt_test'].
%% ============================================================
%% VERIFICATION — Interactive commands
%% ============================================================
%% Run all tests
run_all_tests :-
run_tests.
%% Quick verification — the Step 6 equivalent of Step 7 verification
verify :-
writeln('=== TALMUDIC ENGINE VERIFICATION ==='),
nl,
%% 1. Mitzvot loaded
writeln('--- Test 1: Mitzvot loaded ---'),
total_encoded(MCount),
format(' Mitzvot encoded: ~w~n', [MCount]),
(MCount > 0 -> writeln(' PASS') ; writeln(' FAIL')),
nl,
%% 2. Verses loaded
writeln('--- Test 2: Torah text loaded ---'),
aggregate_all(count, verse(_, _, _, _, _), VCount),
format(' Verses encoded: ~w~n', [VCount]),
(VCount > 0 -> writeln(' PASS') ; writeln(' FAIL')),
nl,
%% 3. Root meanings loaded
writeln('--- Test 3: Root meanings loaded ---'),
aggregate_all(count, root_meaning(_, _, _), RCount),
format(' Root meanings encoded: ~w~n', [RCount]),
(RCount > 0 -> writeln(' PASS') ; writeln(' FAIL')),
nl,
%% 4. Interpretation works
writeln('--- Test 4: Interpretation ---'),
TestCase = case(test_1, creation, [bet_resh_aleph], 'What is creation?'),
( interpret(TestCase, Interp)
-> Interp = interpretation(_, Mitzvot, Verses, _, Conf),
length(Mitzvot, MLen),
length(Verses, VLen),
format(' Interpretation found: ~w mitzvot, ~w verses, confidence: ~w~n',
[MLen, VLen, Conf]),
writeln(' PASS')
; writeln(' FAIL: No interpretation generated')
),
nl,
%% 5. Halt conditions work
writeln('--- Test 5: Halt conditions ---'),
%% Test avodah zarah
AZAction = action(decide, source(claude), authority(claude)),
( halt_check_avodah_zarah(AZAction, _)
-> writeln(' Avodah zarah detection: PASS')
; writeln(' Avodah zarah detection: FAIL')
),
%% Test shfichut damim
SDAction = action(delete, target(user(test_user)), force),
( halt_check_shfichut_damim(SDAction, _)
-> writeln(' Shfichut damim detection: PASS')
; writeln(' Shfichut damim detection: FAIL')
),
%% Test gilui arayot
GAAction = action(merge, specification, interpretation),
( halt_check_gilui_arayot(GAAction, _)
-> writeln(' Gilui arayot detection: PASS')
; writeln(' Gilui arayot detection: FAIL')
),
nl,
%% 6. No false halt on valid action
writeln('--- Test 6: Valid action passes halt check ---'),
ValidAction = action(read, source(torah), authority(torah)),
( halt_check_avodah_zarah(ValidAction, _)
-> writeln(' FAIL: Valid action triggered avodah zarah')
; writeln(' PASS: Valid action not halted')
),
nl,
writeln('=== VERIFICATION COMPLETE ===').