Files
bikoret/vav_pipeline/lib/vav_pipeline.ex
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

93 lines
2.6 KiB
Elixir

defmodule VavPipeline do
@moduledoc """
The Bereishit processing cycle.
Each step chains to the next via |> (vav-consecutive).
CRITICAL: The pipeline does not begin with a processing step.
It begins with RECEPTION. The ShemaContext is built first —
the system hears before it speaks. Then every processing step
operates WITHIN the received context, never modifying it.
Na'aseh v'nishma — but the order of execution is:
nishma (hear/receive context), THEN na'aseh (process within it).
"""
alias VavPipeline.{Shema, Cloud, Manna, BereishitCycle, Chatzotzrot}
@type scope :: %{
book: String.t(),
chapter: pos_integer(),
verse: pos_integer()
}
@type input :: %{
source: String.t(),
verse_scope: scope(),
content: String.t()
}
@type cycle_result ::
{:ok, map()}
| {:rejected, String.t()}
| {:unresolved, map()}
| {:transition, atom()}
| {:waiting, atom()}
| {:halted, atom(), String.t()}
@doc """
Process input through the Bereishit cycle.
1. Build ShemaContext (nishma — hear first)
2. Check cloud — if moving, signal breaking camp
3. Check manna — if absent, wait
4. Process through cycle stages (na'aseh — within what was received)
"""
@spec process(input()) :: cycle_result()
def process(input) do
# === NISHMA: Hear first ===
case Shema.receive_context(input.verse_scope) do
{:error, reason} ->
{:halted, :context_failed, reason}
{:ok, context} ->
# === Check cloud before anything else ===
case context.cloud_state do
:moving ->
Chatzotzrot.signal(:breaking_camp)
{:transition, :cloud_lifted}
{:major_transition, signal, _params} ->
{:transition, signal}
:cloud_not_visible ->
{:waiting, :cloud_not_visible}
:camped ->
# === Check manna ===
case context.daily_provision do
:no_provision ->
{:waiting, :no_provision}
_provision ->
# === NA'ASEH: Now process, within what was received ===
BereishitCycle.execute(input, context)
end
end
end
end
@doc """
Verify the pipeline is operational.
Checks L1 integrity, cloud state, and manna provision.
"""
@spec verify() :: :ok | {:error, String.t()}
def verify do
with :ok <- VavPipeline.L1Reader.verify_integrity(),
{:ok, _} <- Cloud.check(),
{:ok, _} <- Manna.check() do
:ok
end
end
end