Files
bikoret/talmudic_engine/test/mitzvot_test.pl
T
Scott KarpandClaude Sonnet 4.6 80ec364da6 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>
2026-02-26 14:02:34 -05:00

121 lines
2.8 KiB
Prolog

%% mitzvot_test.pl — Tests for the specification layer.
:- use_module(library(plunit)).
:- use_module('../src/specification/mitzvot').
:- use_module('../src/specification/torah_text').
:- use_module('../src/specification/root_meanings').
:- use_module('../src/specification/relationships').
:- begin_tests(mitzvot).
%% The specification has mitzvot
test(mitzvot_exist) :-
total_encoded(Count),
Count > 0.
%% The three categories exist
test(positive_mitzvot_exist) :-
mitzvah(_, positive, _, _).
test(prohibition_mitzvot_exist) :-
mitzvah(_, prohibition, _, _).
test(belief_mitzvot_exist) :-
mitzvah(_, belief, _, _).
%% The first mitzvah is know_hashem
test(first_mitzvah) :-
mitzvah(1, belief, know_hashem, always).
%% Shabbat mitzvot exist
test(shabbat_rest) :-
mitzvah(154, positive, rest_on_shabbat, when(seventh_day)).
test(shabbat_no_work) :-
mitzvah(155, prohibition, not_work_on_shabbat, when(seventh_day)).
%% The three halt conditions have their mitzvot
test(no_other_gods) :-
mitzvah(2, prohibition, no_other_gods, always).
test(no_murder) :-
mitzvah(289, prohibition, not_murder, always).
test(no_adultery) :-
mitzvah(330, prohibition, not_commit_adultery, always).
%% Source references exist
test(mitzvah_sources_exist) :-
mitzvah_source(1, ref(shemot, 20, 2)).
test(shabbat_source) :-
mitzvah_source(154, ref(shemot, 20, 8)).
:- end_tests(mitzvot).
:- begin_tests(torah_text).
%% Bereishit 1:1 exists
test(bereishit_1_1) :-
verse(bereishit, 1, 1, Roots, _),
member(bet_resh_aleph, Roots).
%% Shema exists
test(shema) :-
verse(devarim, 6, 4, Roots, _),
member(shin_mem_ayin, Roots).
%% Verses mentioning a root can be found
test(verses_with_bara, [nondet]) :-
verses_mentioning_root(bet_resh_aleph, Verses),
Verses \= [].
:- end_tests(torah_text).
:- begin_tests(root_meanings).
%% Root meanings exist
test(bara_meaning) :-
root_meaning(bet_resh_aleph, qal, 'create').
%% Multiple binyanim for a root
test(kadash_binyanim) :-
findall(B, root_meaning(qof_dalet_shin, B, _), Binyanim),
length(Binyanim, Count),
Count >= 4.
%% Semantic domains
test(bara_domain) :-
root_domain(bet_resh_aleph, creation).
test(kadash_domain) :-
root_domain(qof_dalet_shin, holiness).
%% Gematria
test(bara_gematria) :-
root_gematria(bet_resh_aleph, 203).
test(kadash_gematria) :-
root_gematria(qof_dalet_shin, 404).
:- end_tests(root_meanings).
:- begin_tests(relationships).
%% Tensions exist
test(justice_mercy_tension) :-
mitzvah_conflicts_with(179, 295, _).
%% Complementary mitzvot
test(complementary) :-
complementary_mitzvot(1, 3).
%% Root consonant sharing
test(consonant_sharing) :-
root_shares_consonants(bet_resh_aleph, bet_resh_kaf, [1, 2]).
:- end_tests(relationships).