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

+23
View File
@@ -108,5 +108,28 @@
"prefix": "ל",
"shoresh": "יהו"
}
],
"smikhut": [
{
"position": 4,
"construct": "חֲצִ֣י",
"construct_consonants": "חצי",
"absolute": "הַהִ֑ין",
"absolute_consonants": "ההין"
},
{
"position": 6,
"construct": "אִשֵּׁ֥ה",
"construct_consonants": "אשה",
"absolute": "רֵֽיחַ",
"absolute_consonants": "ריח"
},
{
"position": 7,
"construct": "רֵֽיחַ",
"construct_consonants": "ריח",
"absolute": "נִיחֹ֖חַ",
"absolute_consonants": "ניחח"
}
]
}
+23
View File
@@ -122,5 +122,28 @@
"prefix": "ל",
"shoresh": "יהו"
}
],
"smikhut": [
{
"position": 1,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הָאֶזְרָ֥ח",
"absolute_consonants": "האזרח"
},
{
"position": 8,
"construct": "אִשֵּׁ֥ה",
"construct_consonants": "אשה",
"absolute": "רֵֽיחַ",
"absolute_consonants": "ריח"
},
{
"position": 9,
"construct": "רֵֽיחַ",
"construct_consonants": "ריח",
"absolute": "נִיחֹ֖חַ",
"absolute_consonants": "ניחח"
}
]
}
+16
View File
@@ -192,5 +192,21 @@
],
"shoresh": "עשה"
}
],
"smikhut": [
{
"position": 10,
"construct": "אִשֵּׁ֥ה",
"construct_consonants": "אשה",
"absolute": "רֵֽיחַ",
"absolute_consonants": "ריח"
},
{
"position": 11,
"construct": "רֵֽיחַ",
"construct_consonants": "ריח",
"absolute": "נִיחֹ֖חַ",
"absolute_consonants": "ניחח"
}
]
}
+16
View File
@@ -163,5 +163,21 @@
],
"shoresh": "יהו"
}
],
"smikhut": [
{
"position": 7,
"construct": "חֻקַּ֤ת",
"construct_consonants": "חקת",
"absolute": "עוֹלָם֙",
"absolute_consonants": "עולם"
},
{
"position": 13,
"construct": "לִפְנֵ֥י",
"construct_consonants": "לפני",
"absolute": "יְהוָֽה",
"absolute_consonants": "יהוה"
}
]
}
+9
View File
@@ -151,5 +151,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֔ל",
"absolute_consonants": "ישראל"
}
]
}
+9
View File
@@ -86,5 +86,14 @@
"prefix": "ל",
"shoresh": "יהו"
}
],
"smikhut": [
{
"position": 3,
"construct": "מִלֶּ֣חֶם",
"construct_consonants": "מלחם",
"absolute": "הָאָ֑רֶץ",
"absolute_consonants": "הארץ"
}
]
}
+16
View File
@@ -161,5 +161,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֔ל",
"absolute_consonants": "ישראל"
},
{
"position": 10,
"construct": "אֶ֨רֶץ֙",
"construct_consonants": "ארץ",
"absolute": "מוֹשְׁבֹ֣תֵיכֶ֔ם",
"absolute_consonants": "מושבתיכם"
}
]
}
+16
View File
@@ -114,5 +114,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "רֵאשִׁית֙",
"construct_consonants": "ראשית",
"absolute": "עֲרִסֹ֣תֵכֶ֔ם",
"absolute_consonants": "ערסתכם"
},
{
"position": 6,
"construct": "כִּתְרוּמַ֣ת",
"construct_consonants": "כתרומת",
"absolute": "גֹּ֔רֶן",
"absolute_consonants": "גרן"
}
]
}
+9
View File
@@ -74,5 +74,14 @@
],
"prefix": "ל"
}
],
"smikhut": [
{
"position": 1,
"construct": "מֵרֵאשִׁית֙",
"construct_consonants": "מראשית",
"absolute": "עֲרִסֹ֣תֵיכֶ֔ם",
"absolute_consonants": "ערסתיכם"
}
]
}
+9
View File
@@ -140,5 +140,14 @@
],
"shoresh": "משה"
}
],
"smikhut": [
{
"position": 6,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הַמִּצְוֺ֖ת",
"absolute_consonants": "המצות"
}
]
}
+16
View File
@@ -162,5 +162,21 @@
],
"prefix": "ל"
}
],
"smikhut": [
{
"position": 2,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "אֲשֶׁ֨ר",
"absolute_consonants": "אשר"
},
{
"position": 7,
"construct": "בְּיַד",
"construct_consonants": "ביד",
"absolute": "מֹשֶׁ֑ה",
"absolute_consonants": "משה"
}
]
}
+37
View File
@@ -276,5 +276,42 @@
"prefix": "ל",
"shoresh": "חטת"
}
],
"smikhut": [
{
"position": 3,
"construct": "מֵעֵינֵ֣י",
"construct_consonants": "מעיני",
"absolute": "הָעֵדָה֮",
"absolute_consonants": "העדה"
},
{
"position": 8,
"construct": "כָל",
"construct_consonants": "כל",
"absolute": "הָעֵדָ֡ה",
"absolute_consonants": "העדה"
},
{
"position": 11,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "בָּקָר֩",
"absolute_consonants": "בקר"
},
{
"position": 15,
"construct": "לְרֵ֤יחַ",
"construct_consonants": "לריח",
"absolute": "נִיחֹ֨חַ֙",
"absolute_consonants": "ניחח"
},
{
"position": 21,
"construct": "וּשְׂעִיר",
"construct_consonants": "ושעיר",
"absolute": "עִזִּ֥ים",
"absolute_consonants": "עזים"
}
]
}
+30
View File
@@ -250,5 +250,35 @@
"meteg_siluq"
]
}
],
"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": 20,
"construct": "לִפְנֵ֥י",
"construct_consonants": "לפני",
"absolute": "יְהוָ֖ה",
"absolute_consonants": "יהוה"
}
]
}
+30
View File
@@ -139,5 +139,35 @@
"prefix": "ב",
"shoresh": "שגג"
}
],
"smikhut": [
{
"position": 2,
"construct": "לְכָל",
"construct_consonants": "לכל",
"absolute": "עֲדַת֙",
"absolute_consonants": "עדת"
},
{
"position": 3,
"construct": "עֲדַת֙",
"construct_consonants": "עדת",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 4,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֔ל",
"absolute_consonants": "ישראל"
},
{
"position": 10,
"construct": "לְכָל",
"construct_consonants": "לכל",
"absolute": "הָעָ֖ם",
"absolute_consonants": "העם"
}
]
}
+9
View File
@@ -113,5 +113,14 @@
"prefix": "ל",
"shoresh": "חטא"
}
],
"smikhut": [
{
"position": 8,
"construct": "בַּת",
"construct_consonants": "בת",
"absolute": "שְׁנָתָ֖הּ",
"absolute_consonants": "שנתה"
}
]
}
+9
View File
@@ -152,5 +152,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 8,
"construct": "לִפְנֵ֣י",
"construct_consonants": "לפני",
"absolute": "יְהוָ֑ה",
"absolute_consonants": "יהוה"
}
]
}
+9
View File
@@ -143,5 +143,14 @@
"prefix": "ב",
"shoresh": "שגג"
}
],
"smikhut": [
{
"position": 2,
"construct": "בִּבְנֵ֣י",
"construct_consonants": "בבני",
"absolute": "יִשְׂרָאֵ֔ל",
"absolute_consonants": "ישראל"
}
]
}
+9
View File
@@ -234,5 +234,14 @@
"prefix": "ה",
"shoresh": "צאן"
}
],
"smikhut": [
{
"position": 14,
"construct": "רֵ֤יחַ",
"construct_consonants": "ריח",
"absolute": "נִיחֹ֨חַ֙",
"absolute_consonants": "ניחח"
}
]
}
+9
View File
@@ -200,5 +200,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 17,
"construct": "מִקֶּ֥רֶב",
"construct_consonants": "מקרב",
"absolute": "עַמָּֽהּ",
"absolute_consonants": "עמה"
}
]
}
+9
View File
@@ -141,5 +141,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 2,
"construct": "דְבַר",
"construct_consonants": "דבר",
"absolute": "יְהוָה֙",
"absolute_consonants": "יהוה"
}
]
}
+16
View File
@@ -121,5 +121,21 @@
"prefix": "ה",
"shoresh": "שבת"
}
],
"smikhut": [
{
"position": 2,
"construct": "בְנֵֽי",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֖ל",
"absolute_consonants": "ישראל"
},
{
"position": 9,
"construct": "בְּי֥וֹם",
"construct_consonants": "ביום",
"absolute": "הַשַּׁבָּֽת",
"absolute_consonants": "השבת"
}
]
}
+9
View File
@@ -144,5 +144,14 @@
"prefix": "ה",
"shoresh": "עדה"
}
],
"smikhut": [
{
"position": 12,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הָעֵדָֽה",
"absolute_consonants": "העדה"
}
]
}
+9
View File
@@ -162,5 +162,14 @@
"prefix": "ל",
"shoresh": "מחנ"
}
],
"smikhut": [
{
"position": 11,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הָ֣עֵדָ֔ה",
"absolute_consonants": "העדה"
}
]
}
+9
View File
@@ -179,5 +179,14 @@
],
"shoresh": "משה"
}
],
"smikhut": [
{
"position": 3,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הָעֵדָ֗ה",
"absolute_consonants": "העדה"
}
]
}
+30
View File
@@ -207,5 +207,35 @@
],
"shoresh": "תכל"
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּנֵ֤י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵל֙",
"absolute_consonants": "ישראל"
},
{
"position": 11,
"construct": "כַּנְפֵ֥י",
"construct_consonants": "כנפי",
"absolute": "בִגְדֵיהֶ֖ם",
"absolute_consonants": "בגדיהם"
},
{
"position": 16,
"construct": "צִיצִ֥ת",
"construct_consonants": "ציצת",
"absolute": "הַכָּנָ֖ף",
"absolute_consonants": "הכנף"
},
{
"position": 18,
"construct": "פְּתִ֥יל",
"construct_consonants": "פתיל",
"absolute": "תְּכֵֽלֶת",
"absolute_consonants": "תכלת"
}
]
}
+16
View File
@@ -237,5 +237,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 8,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "מִצְוֺ֣ת",
"absolute_consonants": "מצות"
},
{
"position": 9,
"construct": "מִצְוֺ֣ת",
"construct_consonants": "מצות",
"absolute": "יְהוָ֔ה",
"absolute_consonants": "יהוה"
}
]
}
+9
View File
@@ -100,5 +100,14 @@
],
"prefix": "ל"
}
],
"smikhut": [
{
"position": 5,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "מִצְוֺתָ֑י",
"absolute_consonants": "מצותי"
}
]
}
+9
View File
@@ -156,5 +156,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 7,
"construct": "מֵאֶ֣רֶץ",
"construct_consonants": "מארץ",
"absolute": "מִצְרַ֔יִם",
"absolute_consonants": "מצרים"
}
]
}
+9
View File
@@ -129,5 +129,14 @@
"prefix": "ה",
"shoresh": "הין"
}
],
"smikhut": [
{
"position": 6,
"construct": "שְׁנֵ֣י",
"construct_consonants": "שני",
"absolute": "עֶשְׂרֹנִ֑ים",
"absolute_consonants": "עשרנים"
}
]
}
+9
View File
@@ -97,5 +97,14 @@
"prefix": "ל",
"shoresh": "יהו"
}
],
"smikhut": [
{
"position": 6,
"construct": "רֵֽיחַ",
"construct_consonants": "ריח",
"absolute": "נִיחֹ֖חַ",
"absolute_consonants": "ניחח"
}
]
}
+9
View File
@@ -132,5 +132,14 @@
"prefix": "ל",
"shoresh": "יהו"
}
],
"smikhut": [
{
"position": 3,
"construct": "בֶן",
"construct_consonants": "בן",
"absolute": "בָּקָ֖ר",
"absolute_consonants": "בקר"
}
]
}
+16
View File
@@ -136,5 +136,21 @@
"prefix": "ה",
"shoresh": "הין"
}
],
"smikhut": [
{
"position": 3,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "הַבָּקָר֙",
"absolute_consonants": "הבקר"
},
{
"position": 11,
"construct": "חֲצִ֥י",
"construct_consonants": "חצי",
"absolute": "הַהִֽין",
"absolute_consonants": "ההין"
}
]
}