L1 data integrity: preserve the edut whole — Shema, middle letter, ketiv/qere, smikhut

Shemot 25:16 — v'natata el ha-aron et ha-edut asher eten elekha.
The edut placed in the aron must be complete. The Masoretic
tradition preserves every letter, every enlarged letter, every
ketiv/qere pair — because each carries meaning the scribe cannot
reconstruct.

The previous build_l1.py silently dropped:
- enlarged letters encoded as <seg type="x-large"> nested in <w>
  → the Shema was corrupt: שמ instead of שמע, אח instead of אחד
  → the middle letter of Torah was corrupt: גח instead of גחון
  → the Zelophchad nun was missing: משפט instead of משפטן
- ketiv/qere dual readings encoded as <note type="variant">/<rdg type="x-qere">
  → the spec committed to preserving both; the code returned []
- smikhut (construct state) pairs marked in morphology codes
  → the spec committed to extracting them; the code returned []

Fixes:
- collect_word_text() walks all nested <seg> children of <w> and records
  large_letters / small_letters metadata with character offsets.
- parse_verse() recognizes <w type="x-ketiv"> followed by <note>, extracts
  both the ketiv and the qere readings, stores a ketiv_qere list on the verse.
- _extract_smikhut() scans words for construct-state morph codes
  (ending in "c" on N/A primary segments, excluding pronominal suffixes)
  and records construct/absolute pairs.
- L1 SHA-256 hash updated everywhere: integrity.sha256, l1_reader.ex,
  shoresh-engine's Luchot.Firmware, its test, KOHEN.md.

Torah-wide results after fix:
- 4 enlarged letters preserved (was 0): Shema ayin, Shema dalet,
  gachon vav (middle of Torah), Zelophchad nun
- 67 ketiv/qere pairs captured (was 0)
- 9,203 smikhut pairs extracted (was 0)

Elixir updates:
- l1_reader.ex: normalize_verse now surfaces ketiv_qere, smikhut,
  and per-word large_letters/small_letters. New type specs. New
  extract_large_letters/1 helper. extract_ketiv_qere and
  extract_smikhut now return real data instead of [].
- step31_shema_test.exs: replaced placeholder asserts with real
  integrity checks. Four new tests verify the Shema word is complete
  (שמע not שמ), echad is complete (אחד not אח), the enlarged
  letters are marked, the middle letter of Torah is preserved,
  and ketiv/qere pairs from Bereishit 8:17 are both captured.

Build script:
- build_l1.py no longer rmtrees the entire l1/ directory (preserves
  l1/README.md). Only regenerates torah/ + build_report.json +
  integrity.sha256.
- Accepts SHORASHIM_SOURCE_DATA env var or CLI arg for morphhb path.

Test counts:
- Elixir: 260 (was 254), 0 failures
- Haskell: 33, 0 failures
- Prolog: 195, 0 failures

The system that can hear שמע correctly has passed its own shema test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott KarpandClaude Opus 4.6 committed 2026-04-21 13:11:52 -04:00
1 parent 04713cc884
commit d4d0a6fcb6
4137 files changed
+73656 -85

No files matched your search

+16
View File
@@ -130,5 +130,21 @@
"prefix": "ה",
"shoresh": "לו"
}
],
"smikhut": [
{
"position": 4,
"construct": "לִפְנֵ֣י",
"construct_consonants": "לפני",
"absolute": "יְהוָ֑ה",
"absolute_consonants": "יהוה"
},
{
"position": 7,
"construct": "בְנֵי",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֛ל",
"absolute_consonants": "ישראל"
}
]
}
+23
View File
@@ -169,5 +169,28 @@
],
"shoresh": "יהו"
}
],
"smikhut": [
{
"position": 6,
"construct": "לִפְנֵ֣י",
"construct_consonants": "לפני",
"absolute": "יְהוָ֔ה",
"absolute_consonants": "יהוה"
},
{
"position": 9,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֑ל",
"absolute_consonants": "ישראל"
},
{
"position": 14,
"construct": "עֲבֹדַ֥ת",
"construct_consonants": "עבדת",
"absolute": "יְהוָֽה",
"absolute_consonants": "יהוה"
}
]
}
+9
View File
@@ -199,5 +199,14 @@
"prefix": "ה",
"shoresh": "לו"
}
],
"smikhut": [
{
"position": 6,
"construct": "רֹ֣אשׁ",
"construct_consonants": "ראש",
"absolute": "הַפָּרִ֑ים",
"absolute_consonants": "הפרים"
}
]
}
+16
View File
@@ -129,5 +129,21 @@
"prefix": "ל",
"shoresh": "יהו"
}
],
"smikhut": [
{
"position": 4,
"construct": "לִפְנֵ֥י",
"construct_consonants": "לפני",
"absolute": "אַהֲרֹ֖ן",
"absolute_consonants": "אהרן"
},
{
"position": 6,
"construct": "וְלִפְנֵ֣י",
"construct_consonants": "ולפני",
"absolute": "בָנָ֑יו",
"absolute_consonants": "בניו"
}
]
}
+16
View File
@@ -105,5 +105,21 @@
"prefix": "ה",
"shoresh": "לו"
}
],
"smikhut": [
{
"position": 4,
"construct": "מִתּ֖וֹךְ",
"construct_consonants": "מתוך",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 5,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֑ל",
"absolute_consonants": "ישראל"
}
]
}
+9
View File
@@ -148,5 +148,14 @@
],
"shoresh": "תנו"
}
],
"smikhut": [
{
"position": 7,
"construct": "אֹ֣הֶל",
"construct_consonants": "אהל",
"absolute": "מוֹעֵ֑ד",
"absolute_consonants": "מועד"
}
]
}
+44
View File
@@ -209,5 +209,49 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 6,
"construct": "מִתּ֖וֹךְ",
"construct_consonants": "מתוך",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 7,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֑ל",
"absolute_consonants": "ישראל"
},
{
"position": 10,
"construct": "פִּטְרַ֨ת",
"construct_consonants": "פטרת",
"absolute": "כָּל",
"absolute_consonants": "כל"
},
{
"position": 11,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "רֶ֜חֶם",
"absolute_consonants": "רחם"
},
{
"position": 13,
"construct": "בְּכ֥וֹר",
"construct_consonants": "בכור",
"absolute": "כֹּל֙",
"absolute_consonants": "כל"
},
{
"position": 15,
"construct": "מִבְּנֵ֣י",
"construct_consonants": "מבני",
"absolute": "יִשְׂרָאֵ֔ל",
"absolute_consonants": "ישראל"
}
]
}
+37
View File
@@ -188,5 +188,42 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 3,
"construct": "כָל",
"construct_consonants": "כל",
"absolute": "בְּכוֹר֙",
"absolute_consonants": "בכור"
},
{
"position": 5,
"construct": "בִּבְנֵ֣י",
"construct_consonants": "בבני",
"absolute": "יִשְׂרָאֵ֔ל",
"absolute_consonants": "ישראל"
},
{
"position": 9,
"construct": "בְּי֗וֹם",
"construct_consonants": "ביום",
"absolute": "הַכֹּתִ֤י",
"absolute_consonants": "הכתי"
},
{
"position": 11,
"construct": "כָל",
"construct_consonants": "כל",
"absolute": "בְּכוֹר֙",
"absolute_consonants": "בכור"
},
{
"position": 13,
"construct": "בְּאֶ֣רֶץ",
"construct_consonants": "בארץ",
"absolute": "מִצְרַ֔יִם",
"absolute_consonants": "מצרים"
}
]
}
+16
View File
@@ -90,5 +90,21 @@
],
"shoresh": "ישר"
}
],
"smikhut": [
{
"position": 5,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "בְּכ֖וֹר",
"absolute_consonants": "בכור"
},
{
"position": 7,
"construct": "בִּבְנֵ֥י",
"construct_consonants": "בבני",
"absolute": "יִשְׂרָאֵֽל",
"absolute_consonants": "ישראל"
}
]
}
+58
View File
@@ -332,5 +332,63 @@
"prefix": "ה",
"shoresh": "קדש"
}
],
"smikhut": [
{
"position": 7,
"construct": "מִתּוֹךְ֮",
"construct_consonants": "מתוך",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 8,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵל֒",
"absolute_consonants": "ישראל"
},
{
"position": 12,
"construct": "עֲבֹדַ֤ת",
"construct_consonants": "עבדת",
"absolute": "בְּנֵֽי",
"absolute_consonants": "בני"
},
{
"position": 13,
"construct": "בְּנֵֽי",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵל֙",
"absolute_consonants": "ישראל"
},
{
"position": 15,
"construct": "בְּאֹ֣הֶל",
"construct_consonants": "באהל",
"absolute": "מוֹעֵ֔ד",
"absolute_consonants": "מועד"
},
{
"position": 19,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֑ל",
"absolute_consonants": "ישראל"
},
{
"position": 23,
"construct": "בִּבְנֵ֤י",
"construct_consonants": "בבני",
"absolute": "יִשְׂרָאֵל֙",
"absolute_consonants": "ישראל"
},
{
"position": 27,
"construct": "בְּנֵֽי",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֖ל",
"absolute_consonants": "ישראל"
}
]
}
+16
View File
@@ -166,5 +166,21 @@
"prefix": "ה",
"shoresh": "נר"
}
],
"smikhut": [
{
"position": 11,
"construct": "פְּנֵ֣י",
"construct_consonants": "פני",
"absolute": "הַמְּנוֹרָ֔ה",
"absolute_consonants": "המנורה"
},
{
"position": 14,
"construct": "שִׁבְעַ֥ת",
"construct_consonants": "שבעת",
"absolute": "הַנֵּרֽוֹת",
"absolute_consonants": "הנרות"
}
]
}
+30
View File
@@ -217,5 +217,35 @@
],
"shoresh": "ישר"
}
],
"smikhut": [
{
"position": 4,
"construct": "וְכָל",
"construct_consonants": "וכל",
"absolute": "עֲדַ֥ת",
"absolute_consonants": "עדת"
},
{
"position": 5,
"construct": "עֲדַ֥ת",
"construct_consonants": "עדת",
"absolute": "בְּנֵי",
"absolute_consonants": "בני"
},
{
"position": 6,
"construct": "בְּנֵי",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֖ל",
"absolute_consonants": "ישראל"
},
{
"position": 19,
"construct": "בְּנֵ֥י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵֽל",
"absolute_consonants": "ישראל"
}
]
}
+9
View File
@@ -164,5 +164,14 @@
],
"prefix": "ל"
}
],
"smikhut": [
{
"position": 9,
"construct": "לִפְנֵ֣י",
"construct_consonants": "לפני",
"absolute": "יְהוָ֑ה",
"absolute_consonants": "יהוה"
}
]
}
+23
View File
@@ -250,5 +250,28 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 8,
"construct": "בְּאֹ֣הֶל",
"construct_consonants": "באהל",
"absolute": "מוֹעֵ֔ד",
"absolute_consonants": "מועד"
},
{
"position": 10,
"construct": "לִפְנֵ֥י",
"construct_consonants": "לפני",
"absolute": "אַהֲרֹ֖ן",
"absolute_consonants": "אהרן"
},
{
"position": 12,
"construct": "וְלִפְנֵ֣י",
"construct_consonants": "ולפני",
"absolute": "בָנָ֑יו",
"absolute_consonants": "בניו"
}
]
}
+23
View File
@@ -162,5 +162,28 @@
],
"shoresh": "מוע"
}
],
"smikhut": [
{
"position": 4,
"construct": "מִבֶּן֩",
"construct_consonants": "מבן",
"absolute": "חָמֵ֨שׁ",
"absolute_consonants": "חמש"
},
{
"position": 12,
"construct": "בַּעֲבֹדַ֖ת",
"construct_consonants": "בעבדת",
"absolute": "אֹ֥הֶל",
"absolute_consonants": "אהל"
},
{
"position": 13,
"construct": "אֹ֥הֶל",
"construct_consonants": "אהל",
"absolute": "מוֹעֵֽד",
"absolute_consonants": "מועד"
}
]
}
+16
View File
@@ -107,5 +107,21 @@
],
"shoresh": "עוד"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּמִבֶּן֙",
"construct_consonants": "ומבן",
"absolute": "חֲמִשִּׁ֣ים",
"absolute_consonants": "חמשים"
},
{
"position": 5,
"construct": "מִצְּבָ֣א",
"construct_consonants": "מצבא",
"absolute": "הָעֲבֹדָ֑ה",
"absolute_consonants": "העבדה"
}
]
}
+9
View File
@@ -159,5 +159,14 @@
],
"prefix": "ב"
}
],
"smikhut": [
{
"position": 4,
"construct": "בְּאֹ֤הֶל",
"construct_consonants": "באהל",
"absolute": "מוֹעֵד֙",
"absolute_consonants": "מועד"
}
]
}
+9
View File
@@ -153,5 +153,14 @@
],
"shoresh": "משה"
}
],
"smikhut": [
{
"position": 6,
"construct": "פְּנֵ֣י",
"construct_consonants": "פני",
"absolute": "הַמְּנוֹרָ֔ה",
"absolute_consonants": "המנורה"
}
]
}
+9
View File
@@ -222,5 +222,14 @@
"prefix": "ה",
"shoresh": "מנר"
}
],
"smikhut": [
{
"position": 2,
"construct": "מַעֲשֵׂ֤ה",
"construct_consonants": "מעשה",
"absolute": "הַמְּנֹרָה֙",
"absolute_consonants": "המנרה"
}
]
}
+16
View File
@@ -92,5 +92,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 4,
"construct": "מִתּ֖וֹךְ",
"construct_consonants": "מתוך",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 5,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֑ל",
"absolute_consonants": "ישראל"
}
]
}
+16
View File
@@ -178,5 +178,21 @@
"prefix": "ו",
"shoresh": "הטה"
}
],
"smikhut": [
{
"position": 7,
"construct": "מֵ֣י",
"construct_consonants": "מי",
"absolute": "חַטָּ֑את",
"absolute_consonants": "חטאת"
},
{
"position": 12,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "בְּשָׂרָ֔ם",
"absolute_consonants": "בשרם"
}
]
}
+16
View File
@@ -158,5 +158,21 @@
"prefix": "ל",
"shoresh": "חטא"
}
],
"smikhut": [
{
"position": 3,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "בָּקָ֔ר",
"absolute_consonants": "בקר"
},
{
"position": 11,
"construct": "בֶן",
"construct_consonants": "בן",
"absolute": "בָּקָ֖ר",
"absolute_consonants": "בקר"
}
]
}
+37
View File
@@ -136,5 +136,42 @@
],
"shoresh": "ישר"
}
],
"smikhut": [
{
"position": 4,
"construct": "לִפְנֵ֖י",
"construct_consonants": "לפני",
"absolute": "אֹ֣הֶל",
"absolute_consonants": "אהל"
},
{
"position": 5,
"construct": "אֹ֣הֶל",
"construct_consonants": "אהל",
"absolute": "מוֹעֵ֑ד",
"absolute_consonants": "מועד"
},
{
"position": 9,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "עֲדַ֖ת",
"absolute_consonants": "עדת"
},
{
"position": 10,
"construct": "עֲדַ֖ת",
"construct_consonants": "עדת",
"absolute": "בְּנֵ֥י",
"absolute_consonants": "בני"
},
{
"position": 11,
"construct": "בְּנֵ֥י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵֽל",
"absolute_consonants": "ישראל"
}
]
}