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 80ec364da6
86 files changed
+9646

No files matched your search

+101
View File
@@ -0,0 +1,101 @@
%% challenge.pl — Kushya generation.
%%
%% Architecture §3.4:
%% challenge(Interpretation, Challenge) :-
%% mitzvah(_, _, _, _) = Contradicting,
%% contradicts(Interpretation, Contradicting),
%% Challenge = kushya(Contradicting, Interpretation).
%%
%% A kushya is a challenge grounded in Torah text.
%% It identifies a tension between the proposed interpretation
%% and another part of the specification.
%%
%% The challenge is a question, not a refutation.
%% It says: "But what about THIS verse/mitzvah?"
:- module(challenge, [
challenge/2,
find_contradiction/3,
contradicts/2,
challenge_strength/2
]).
:- use_module('../specification/mitzvot').
:- use_module('../specification/torah_text').
:- use_module('../specification/relationships').
:- use_module('../specification/root_meanings').
%% ============================================================
%% CHALLENGE GENERATION
%% ============================================================
%% Generate a challenge to an interpretation.
%% A challenge consists of:
%% kushya(Contradicting, Interpretation, Strength)
%% - Contradicting: the mitzvah or verse that creates tension
%% - Interpretation: the interpretation being challenged
%% - Strength: strong | moderate | weak
challenge(interpretation(CaseRef, Mitzvot, Verses, _Reading, _Confidence), Challenge) :-
find_contradiction(Mitzvot, Verses, Contradicting),
challenge_strength(Contradicting, Strength),
Challenge = kushya(Contradicting, CaseRef, Strength).
%% ============================================================
%% FIND CONTRADICTIONS
%% ============================================================
%% Strategy 1: Find a mitzvah that conflicts with one in the interpretation
find_contradiction(Mitzvot, _Verses, contradiction(mitzvah_tension, ID1, ID2, Desc)) :-
member(mitzvah(ID1, _, _, _), Mitzvot),
mitzvah_conflicts_with(ID1, ID2, Desc).
%% Strategy 2: Find a verse with a root in a conflicting domain
find_contradiction(_Mitzvot, Verses, contradiction(domain_tension, Root, Domain1, Domain2)) :-
member(verse_ref(Book, Ch, Vs, _), Verses),
verse(Book, Ch, Vs, VerseRoots, _),
member(Root, VerseRoots),
root_domain(Root, Domain1),
root_domain(OtherRoot, Domain2),
Domain1 \= Domain2,
domains_in_tension(Domain1, Domain2),
member(OtherRoot, VerseRoots).
%% Strategy 3: Find a mitzvah whose condition conflicts with the case context
find_contradiction(Mitzvot, _Verses, contradiction(condition_tension, ID, Action, Cond)) :-
member(mitzvah(ID, _, Action, when(Cond)), Mitzvot),
condition_creates_tension(Cond).
%% ============================================================
%% TENSION DETECTION
%% ============================================================
%% contradicts/2 — does a source contradict an interpretation?
%% This is the core logic: given an interpretation's grounding,
%% does some other part of Torah create a tension?
contradicts(interpretation(_, Mitzvot, _, _, _), Source) :-
find_contradiction(Mitzvot, [], Source).
%% Domains that are inherently in tension
domains_in_tension(judgment, mercy).
domains_in_tension(mercy, judgment).
domains_in_tension(holiness, transgression).
domains_in_tension(transgression, holiness).
domains_in_tension(death, life).
domains_in_tension(life, death).
domains_in_tension(authority, service).
domains_in_tension(service, authority).
%% Conditions that create tension (they limit universality)
condition_creates_tension(seventh_day). % Shabbat limits action
condition_creates_tension(capital_case). % Higher standard of evidence
condition_creates_tension(pursuit_in_progress). % Time pressure
condition_creates_tension(court_deliberation). % Procedural constraints
%% ============================================================
%% CHALLENGE STRENGTH
%% ============================================================
%% Assess how strong a challenge is
challenge_strength(contradiction(mitzvah_tension, _, _, _), strong).
challenge_strength(contradiction(domain_tension, _, _, _), moderate).
challenge_strength(contradiction(condition_tension, _, _, _), weak).