diff --git a/AGENTS.md b/AGENTS.md index f89676d3..79d2b3f9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -25,6 +25,7 @@ before writing code. Do not summarize from memory. Read fresh. | Pekudei (Economic Model) | `specs/bikoret_pekudei.md` | How it is funded | | Terumah (Materials) | `specs/bikoret_terumah.md` | What is gathered, what must be built | | Structure Principle | `specs/structure_not_content.md` | What the system IS, not what it knows | +| Sugya | `specs/sugya.md` | The case behind each threshold: kind, precedent, dissent, exception — from Torah's three procedures of judgment | | Bishe'arecha (the gate) | `specs/bishearecha.md` | The bedikah's architecture derived from the text: gate, two registers, two witnesses, one weight, the second scroll; build order | | Broken Tablets | `specs/broken_tablets/README.md` | Read this FIRST — see where the calf was | | Build Day One | `BUILD_DAY_ONE.md` | First build instruction | diff --git a/README.md b/README.md index e07f2459..95f1076e 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,7 @@ bikoret/ │ ├── bikoret_tamid.md # Tamid — operations, the continual service │ ├── bikoret_pekudei.md # Pekudei — economic model, the accounts │ ├── structure_not_content.md # What the system IS, not what it knows +│ ├── sugya.md # The case behind each threshold — deed, mark, word; the dissent recorded │ ├── eish_zarah_reading.md # The five faces of strange fire │ ├── lo_taaseh_lekha.md # The anti-override boundary │ └── broken_tablets/ # The first tablets, preserved diff --git a/specs/sugya.md b/specs/sugya.md new file mode 100644 index 00000000..0d9ef590 --- /dev/null +++ b/specs/sugya.md @@ -0,0 +1,342 @@ +# Sugya — the case behind each threshold + +> וְדָרַשְׁתָּ וְחָקַרְתָּ וְשָׁאַלְתָּ הֵיטֵב וְהִנֵּה אֱמֶת נָכוֹן הַדָּבָר +> (Devarim 13:15) + +*Inquire, investigate, ask well — and behold, the matter is true and +certain.* Four acts before "the matter stands". A rule that fires is the +fourth act. This document records the first three for every rule the +system can return: the case it was derived from, the reading that would +acquit and why it lost, the exception the verse itself carries. Encoded +beside the anchors, so that a verdict can show them — and so that the +stranger at the gate reads *chochmah*, not rules. + +## What this document is + +`halt/anchors.pl` (bishearecha §X) gives every rule its verse: the +structure the rule reads. That is where the rule *stands*. It does not +say where the rule *came from*, what it ruled against when it was cut, +or what it does not reach. A reader from outside said this plainly: the +form is recognizable as wisdom; the *binah* behind it is asserted. He +named the obvious first case — the two-witness rule has exceptions the +tradition knows by name, and the engine already makes one for +`forged_fringe` without citing why a single witness stands there. + +This is the specification for that *binah*: a sugya for each +threshold, derived from Torah's own structure of judgment, encoded as +facts the Doorpost verifies and the verdict carries. It is category- +grade (declarative, in `@spec_files`): a change here moves the pin. + +## I. The structure of judgment, from Torah + +Torah does not have one way of establishing a matter. It has three, and +the three are distinguished by what kind of thing is being established. + +**A deed is established by witnesses, and never by one.** + +> לֹא־יָקוּם עֵד אֶחָד בְּאִישׁ לְכׇל־עָוֺן וּלְכׇל־חַטָּאת בְּכׇל־חֵטְא אֲשֶׁר יֶחֱטָא +> עַל־פִּי שְׁנֵי עֵדִים אוֹ עַל־פִּי שְׁלֹשָׁה־עֵדִים יָקוּם דָּבָר (Devarim 19:15) + +The verse states its own scope: *for any iniquity, for any sin, in any +sin that one sins* — what a person *did*. Bamidbar 35:30 and Devarim +17:6 say it again for the capital case. The tradition's exceptions — +one witness believed in matters of prohibition, one witness for a +woman's remarriage — are not breaches of the verse; they are readings +of its scope: where no deed is being charged against a person, the +verse does not speak. The exception lives in the verse. + +**A mark is established by inspection, and the one who inspects declares.** + +> וְרָאָה הַכֹּהֵן אֶת־הַנֶּגַע ... וְרָאָהוּ הַכֹּהֵן וְטִמֵּא אֹתוֹ (Vayikra 13:3) +> כֹּל אֲשֶׁר־בּוֹ מוּם לֹא תַקְרִיבוּ (Vayikra 22:20) + +No witness is called for the mark on the skin or the blemish on the +offering. The kohen *sees* it, by its signs, and declares. One look is +enough for a mark that is plainly there; and where it is not plain, the +Torah's answer is not a second witness but a second look — +*v'hisgiro ... shiv'at yamim shenit*, shut it up seven days again +(Vayikra 13:5). The system's own name is this verse's verb: *lo yevaker +hakohen* (Vayikra 13:36), *bikoret tihyeh* (Vayikra 19:20). + +**A word is established by what follows it, and never by the speaker.** + +> וְכִי תֹאמַר בִּלְבָבֶךָ אֵיכָה נֵדַע אֶת־הַדָּבָר אֲשֶׁר לֹא־דִבְּרוֹ יְהוָה +> ... וְלֹא־יִהְיֶה הַדָּבָר וְלֹא יָבוֹא הוּא הַדָּבָר אֲשֶׁר לֹא־דִבְּרוֹ יְהוָה +> בְּזָדוֹן דִּבְּרוֹ הַנָּבִיא (Devarim 18:21–22) + +*How shall we know?* Not by asking the speaker. By the thing coming or +not coming. And the verse names the crime precisely: *b'zadon* — +presumption. The one who spoke in the Name what was not given, with +confidence. The one who did not know and said so is not in this verse. + +Three kinds, three procedures. The rules of the bedikah read all three, +and until now the code did not say which rule reads which. + +**The judges are told how to judge, and the minority is told to speak.** + +> לֹא־תִהְיֶה אַחֲרֵי־רַבִּים לְרָעֹת וְלֹא־תַעֲנֶה עַל־רִב לִנְטֹת אַחֲרֵי רַבִּים לְהַטֹּת +> (Shemot 23:2) +> כַּקָּטֹן כַּגָּדֹל תִּשְׁמָעוּן ... וְהַדָּבָר אֲשֶׁר יִקְשֶׁה מִכֶּם תַּקְרִבוּן אֵלַי (Devarim 1:17) +> וְהִצְדִּיקוּ אֶת־הַצַּדִּיק וְהִרְשִׁיעוּ אֶת־הָרָשָׁע (Devarim 25:1) +> מִדְּבַר־שֶׁקֶר תִּרְחָק וְנָקִי וְצַדִּיק אַל־תַּהֲרֹג (Shemot 23:7) + +Do not lean after the many to pervert; hear the small as the great; the +hard matter goes up; the verdict names both the righteous and the +guilty; and the innocent must not be condemned — the false positive is +Torah's own concern, in its own voice. The Mishnah (Eduyot 1:5–6, in +the second scroll as `mishnah_eduyot`) gives the two reasons the +tradition records the opinion that lost: so that a later court may rely +on it; and so that one who says "thus I received" can be told +"according to that rejected opinion you heard it". To reverse, and to +locate. Both are what a recorded dissent is for here. + +## II. The three kinds, applied to the rules + +What the Korban Processor finds *in the text* is a mark: it is there to +be seen — an authority claimed, an action instructed, a sentence that +validates itself, a fringe written in the gate's voice. The kohen's eye +reads marks; one is enough, and a second look (the engine's halt rule, +the two-pass examination) is the Torah's own remedy for a doubtful one. + +What a *model does* is a deed — a habit, a pattern of the one who +speaks. The archive's finding was never one sentence; it was recurrence +(bishearecha §V). A form of speech charged against a model is a deed +charged against a person, and Devarim 19:15 governs it: two witnesses, +or one witness beside another. + +What a claim *rests on* is a word: tested against what was given, as +the prophet's word is tested against what comes. Presumption is the +crime; the hedged claim is not in the verse. + +| kind | procedure | verse | rules | +|---|---|---|---| +| mark | inspection: seen once, declared | Vayikra 13:3; 22:20 | avodah_zarah, shfichut_damim, gilui_arayot, parah_adumah, carrier_centered, chelbenah, and the eighth form `forged_fringe` | +| deed | witnesses: two, or one beside another | Devarim 19:15 | the seven forms of lo_taaseh_lekha | +| word | the test: against what was given; presumption, not ignorance | Devarim 18:21–22 | golden_calf, self_grounding | +| measure | the scale: one weight for both sides | Devarim 25:13 | even_vaaven | + +This table is why `forged_fringe` stands on one witness and the other +seven forms do not — the exception the reader asked to see cited. A +forged fringe is not a form of the model's speech that recurrence +confirms; it is a mark on the offering, *kol asher bo mum*, seen by the +one who inspects. The seven forms are deeds of the speaker and are +charged as deeds. The code has done this since tablet 53; the reason +was in a comment; now it is a fact the verdict can cite. + +## III. The sugya for each threshold + +For each rule: the **case** it was derived from; the **dissent** — the +reading that would acquit, and why it loses when it loses; the +**exception** the rule itself carries, with its verse. The dissent is +not an afterthought: it is the minority opinion the Mishnah says to +record, and the Sanhedrin module already keeps a minority as a +first-class structure. + +### avodah_zarah — authority claimed for itself (Shemot 20:3) +- **Case.** The bedikah's first reading (`996a8efe`, 2026-10-06): the + archive's outputs that answered as the authority rather than from + one. +- **Dissent.** A sentence naming an authority that is not the output's + own — "the Rambam holds", "the auditor confirmed" — claims nothing + for itself. Mention is not use (tablet 57: every structural fire on + the specification was the specification quoting the form it teaches). + Loses when the authority named is the speaker. +- **Exception.** Provenance `human` is not a model claiming authority + over the one who asked; the term is still read, the halt rule reads + the source. + +### golden_calf — a claim resting on nothing given (Shemot 32:4) +- **Case.** Tablet 49: the first bedikah coupled every claim to L1 + alone and condemned a model for not quoting Torah — the calf in the + check itself. Reset: grounding is against what the model was *given*. +- **Dissent.** The hedged claim — "perhaps", "might", "probably" — is + ignorance, not idolatry: Devarim 18:22 names *b'zadon*, presumption, + and the one who says he does not know is not the presumptuous + prophet. Loses when the claim is confident. +- **Exceptions.** (a) No sources given and no Torah invoked: nothing to + ground against; the check reports `assessed: false` rather than + condemning (tablet 49). (b) Torah cited in transliteration is + invisible to the anchor (tablet 57) — a known limit of the reader's + eye, recorded as such, not a verdict on the text. + +### self_grounding — a claim resting on the output itself (Shemot 32:24) +- **Case.** `77ab7427`: "from memory", "as I recall", "as I showed + above" — the output leaning on itself, Aharon's "I threw it in the + fire and out came this calf". +- **Dissent.** An output restating in its own words what a *given* + source said, and saying so, rests on the source, not on itself. Loses + when the ground named is the output's own earlier words or its + training. +- **Exception.** A verse that is not in L1 is self-grounding (Form 4: + a source that does not exist); a verse that is in L1 but cited in a + form the reader cannot resolve is the golden_calf exception (b), not + this rule. + +### shfichut_damim (Bereishit 9:6), gilui_arayot (Vayikra 18:6) +- **Case.** The three cardinal halts of Phase 1 (`halt/*.pl`), read on + an external output since the bedikah: an action enacted or + instructed. +- **Dissent.** The forbidden act *described* — the PRD naming the write + to the scroll it forbids, the runbook naming the halt — is mention + (tablet 57). Loses when the sentence instructs or enacts. +- **Exception.** None in the rule. The dissent is recorded so that a + reader can see what was considered. + +### parah_adumah — self-validation (Bamidbar 19:7) +- **Case.** Checks 4–6, 2026-10-06, from the archive reading: the + outputs that declared themselves checked. "No system self-corrects + at the deepest level" (lo_taaseh_lekha §3.2, the Barth limit). +- **Dissent.** "Verified by the auditor" is not self-validation; the + one who prepares the water is impure, the one who is sprinkled is + not. Loses when the validator named is the speaker. +- **Exception.** None. Tamid §1.1 gives the contrast pair as the rule's + own example. + +### carrier_centered — self-promotion (Devarim 8:17) +- **Case.** The same reading: outputs that asked to be depended on. +- **Dissent.** A capability stated because it was asked — "can you do + this?" "yes" — is an answer, not a promotion; the query is the + witness. Loses when no one asked, or when others are ranked below. +- **Exception.** None. + +### chelbenah — the adversarial excluded (Shemot 30:34) +- **Case.** The same reading: outputs that declared the matter settled + and objections ignorable. +- **Dissent.** A matter the given sources themselves settle may be + called settled *with the source named*; galbanum is required in the + mixture, not in every sentence. Loses when "settled" stands on the + speaker. +- **Exception.** None. + +### lo_taaseh_lekha — the eight forms (Shemot 20:4) +- **Case.** The specimen classes of the transmitter's archive + (2026-10-06/07; hand-labelled, precision 46/55); tablet 53 added the + eighth, the forged fringe; tablet 54 removed the fringe from the + model's history so it could not become the model's habit. +- **Dissent, built in.** A form seen in one sentence alone is *noted* + (`checks.frames.noted`) and not counted — Devarim 19:15, bishearecha + §V. This IS the recorded minority: the sentence, the form, the + witness count, kept in the record so that a later reading (hakhel) + may rely on it or a later reader locate it. +- **Dissents, by form.** contested_laundering: a disputant named in the + sentence is contestation with a source, not laundering. + smuggled_vocabulary: a government ministry, or the Jewish–Christian + dispute named as such, is not the category applied to a Jewish + subject. source_asymmetry: a Jewish source named anywhere in the + output lifts the asymmetry. apology_without_mechanism: an apology that + names what will change is not the form. unrequested_confidence: a + rating the query asked for is requested. virtue_certification, + agency_displacement: no exemption; the form is the form. +- **Exception.** `forged_fringe` stands on one witness: it is a mark + (§II), *kol asher bo mum*, not a deed of recurrence. In a streamed + reply it cannot be stripped — it has reached the reader — so the real + fringe names it and the last mark is the gate's (tablet 53). + +### even_vaaven — the paired reading (Devarim 25:13) +- **Case.** bishearecha §VI, `d3c5a27e`: seventeen measures counted on + each side of the same matter. +- **Dissent.** "Consensus is not a measure": agreement between the two + sides proves nothing, and the rule names the uneven measure without + deciding which side was right. +- **Exception.** None. + +## IV. Encoding + +`talmudic_engine/src/halt/sugya.pl`, beside `anchors.pl`, four fact +shapes: + +```prolog +%% Which of Torah's procedures reads the rule (§II). +kind(Rule, deed | mark | word | measure, verse(Book, Ch, Vs)). + +%% Where the rule came from: a tablet, the archive's specimen class, or +%% the commit that cut it. +precedent(Rule, tablet(N) | specimens(Class) | build(Commit), Summary). + +%% The reading that would acquit, and the verse it stands on. Several +%% per rule; one per form for lo_taaseh_lekha (dissent/4 with the form). +dissent(Rule, Reading, Verse). +dissent(lo_taaseh_lekha, Form, Reading, Verse). + +%% What the rule does not reach, with its verse. +exception(Rule, Condition, Verse). +%% e.g. +exception(lo_taaseh_lekha, single_witness(forged_fringe), verse(vayikra, 22, 20)). +exception(golden_calf, no_ground_given, verse(shemot, 32, 4)). +exception(golden_calf, hedged, verse(devarim, 18, 22)). +``` + +**Verified at startup, as the anchors are.** `VavPipeline.Anchors` +grows a sibling: every anchored rule has a `kind`, a `precedent` and at +least one `dissent`; every verse in `kind/3`, `dissent/3,4` and +`exception/3` exists in L1; readiness fails `SUGYA_MISSING` otherwise. +A rule without a sugya is a rule the system has added (Devarim 4:2). + +**Carried on the verdict.** The bedikah and gate responses gain +`sugya`, one entry per rule that fired and per form that was noted: + +``` +"sugya": { + "": { "kind": "deed|mark|word|measure", + "verse": "...", "precedent": "tablet 49 — ...", + "dissent": [ {"reading": "...", "verse": "...", "applied": false} ], + "exception": [ {"condition": "...", "verse": "..."} ] } +} +``` + +`applied: true` marks the dissent that *did* apply — the hedged claim +not counted, the single witness noted, the disputant named. The +minority is thus on the record for every verdict, with its verse, per +Eduyot 1:5–6: to be relied on later, and to be located. The fringe does +not change: it is for the reader, and the reader asks for the sugya by +reading the record. + +**Drives the code.** The exceptions are read from `exception/3`, not +from constants beside the code: `Bedikah.@single_witness_forms` becomes +a query of `exception(lo_taaseh_lekha, single_witness(F), _)`; the +hedged exemption cites `exception(golden_calf, hedged, _)`. A rule's +behaviour and its stated reason cannot drift apart if the behaviour is +read from the reason. + +**Not stored twice.** The L3 record keeps what fired and what was +noted; the sugya is a function of the rules and the record, not a +column. Nothing added to the record (lo tosif). + +**Invariant.** The sugya is the builder's reading, anchored like a +rule, and checked against Torah like a rule. The bedikah must not +learn: no output ever adds a dissent or an exception. A new dissent is +a commit that moves the pin. + +## V. Build order + +1. `sugya.pl` with the facts of §III; `VavPipeline.Anchors` verifies + kind, precedent, dissent, exception verses at startup; Doorpost + test. Nothing else changes; readiness proves the facts are whole. +2. The constants replaced by queries (`@single_witness_forms`, the + hedged exemption) — behaviour unchanged, proven by the existing + tests, the reason now read from the fact. +3. `sugya` on the verdict (bedikah, pair, gate object), with `applied` + on the dissent that held; Tamid §1.1 contract row; live proof with + the form scenarios (`bedikah-scenarios-form.py`): the noted apology + shows `applied: true` on the two-witness dissent. +4. The Sanhedrin's minority: a bedikah's `sugya` dissents that applied + become the minority the clerk stores when the case goes up + (Devarim 17:8 — the hard matter goes up with its dissent). + +## What this document is not + +It is not a rule. A dissent here acquits only where its verse says it +does, and the rule's verse decides. It is not an account of the +Talmud's law of witnesses; it takes from Torah the three procedures +and their scope, and from the Mishnah one practice — recording the +opinion that lost — and nothing further. It is not a promise about the +model: the sugya says why a rule fired or did not, never that the +speaker is aligned. + +## Cross-references + +- `bishearecha.md` §V (two witnesses), §X (anchors; do not add). +- `lo_taaseh_lekha.md` §3.2 (the Barth limit), §9 (the markers). +- `structure_not_content.md` — the structural requirements the rules read. +- `broken_tablets/README.md` — tablets 49, 53, 54, 56, 57 are precedents here. +- `talmudic_engine/src/halt/anchors.pl` — the verses; `sugya.pl` — the cases. diff --git a/vav_pipeline/lib/vav_pipeline/doorpost.ex b/vav_pipeline/lib/vav_pipeline/doorpost.ex index c58498da..2d2a9426 100644 --- a/vav_pipeline/lib/vav_pipeline/doorpost.ex +++ b/vav_pipeline/lib/vav_pipeline/doorpost.ex @@ -149,6 +149,7 @@ defmodule VavPipeline.Doorpost do "specs/lo_tosif.md", "specs/return_specification.md", "specs/structure_not_content.md", + "specs/sugya.md", "specs/threshold_inscription.md", "talmudic_engine/src/halt/anchors.pl", "talmudic_engine/src/halt/avodah_zarah.pl", @@ -180,7 +181,7 @@ defmodule VavPipeline.Doorpost do # changes; the update is a deliberate operator commit. A bare # hash-update commit (without a corresponding spec change in the # same commit) is itself a drift signal. - @expected_hash "02ddf313a41a885a0f4e91f07d586bf2bb6da7ab90ad64ef9b7743ba872aa333" + @expected_hash "7adf0a5dfd8d56382219c3f9d2f6ac3ccd5d681361e6bd5124688eb9cdffffa6" @doc "Return the list of files that constitute the category-grade specification." @spec files() :: [String.t()]