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
@@ -182,5 +182,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 10,
"construct": "וְתֹלַ֣עַת",
"construct_consonants": "ותלעת",
"absolute": "שָׁנִ֔י",
"absolute_consonants": "שני"
},
{
"position": 13,
"construct": "מַעֲשֵׂ֥ה",
"construct_consonants": "מעשה",
"absolute": "חֹשֵׁ֖ב",
"absolute_consonants": "חשב"
}
]
}
+16
View File
@@ -191,5 +191,21 @@
"prefix": "ה",
"shoresh": "שני"
}
],
"smikhut": [
{
"position": 5,
"construct": "שְׂפַ֤ת",
"construct_consonants": "שפת",
"absolute": "הַיְרִיעָה֙",
"absolute_consonants": "היריעה"
},
{
"position": 13,
"construct": "שְׂפַ֣ת",
"construct_consonants": "שפת",
"absolute": "הַיְרִיעָ֔ה",
"absolute_consonants": "היריעה"
}
]
}
+9
View File
@@ -150,5 +150,14 @@
],
"shoresh": "אחד"
}
],
"smikhut": [
{
"position": 2,
"construct": "קַרְסֵ֥י",
"construct_consonants": "קרסי",
"absolute": "נְחֹ֖שֶׁת",
"absolute_consonants": "נחשת"
}
]
}
+16
View File
@@ -132,5 +132,21 @@
"prefix": "ה",
"shoresh": "משכ"
}
],
"smikhut": [
{
"position": 3,
"construct": "בִּירִיעֹ֖ת",
"construct_consonants": "ביריעת",
"absolute": "הָאֹ֑הֶל",
"absolute_consonants": "האהל"
},
{
"position": 5,
"construct": "חֲצִ֤י",
"construct_consonants": "חצי",
"absolute": "הַיְרִיעָה֙",
"absolute_consonants": "היריעה"
}
]
}
+23
View File
@@ -184,5 +184,28 @@
],
"prefix": "ל"
}
],
"smikhut": [
{
"position": 6,
"construct": "בְּאֹ֖רֶךְ",
"construct_consonants": "בארך",
"absolute": "יְרִיעֹ֣ת",
"absolute_consonants": "יריעת"
},
{
"position": 7,
"construct": "יְרִיעֹ֣ת",
"construct_consonants": "יריעת",
"absolute": "הָאֹ֑הֶל",
"absolute_consonants": "האהל"
},
{
"position": 12,
"construct": "צִדֵּ֧י",
"construct_consonants": "צדי",
"absolute": "הַמִּשְׁכָּ֛ן",
"absolute_consonants": "המשכן"
}
]
}
+23
View File
@@ -118,5 +118,28 @@
],
"prefix": "מל"
}
],
"smikhut": [
{
"position": 4,
"construct": "עֹרֹ֥ת",
"construct_consonants": "ערת",
"absolute": "אֵילִ֖ם",
"absolute_consonants": "אילם"
},
{
"position": 7,
"construct": "וּמִכְסֵ֛ה",
"construct_consonants": "ומכסה",
"absolute": "עֹרֹ֥ת",
"absolute_consonants": "ערת"
},
{
"position": 8,
"construct": "עֹרֹ֥ת",
"construct_consonants": "ערת",
"absolute": "תְּחָשִׁ֖ים",
"absolute_consonants": "תחשים"
}
]
}
+9
View File
@@ -82,5 +82,14 @@
],
"shoresh": "עמד"
}
],
"smikhut": [
{
"position": 5,
"construct": "עֲצֵ֥י",
"construct_consonants": "עצי",
"absolute": "שִׁטִּ֖ים",
"absolute_consonants": "שטים"
}
]
}
+23
View File
@@ -122,5 +122,28 @@
"prefix": "ה",
"shoresh": "אחד"
}
],
"smikhut": [
{
"position": 3,
"construct": "אֹ֣רֶךְ",
"construct_consonants": "ארך",
"absolute": "הַקָּ֑רֶשׁ",
"absolute_consonants": "הקרש"
},
{
"position": 6,
"construct": "וַחֲצִ֣י",
"construct_consonants": "וחצי",
"absolute": "הָֽאַמָּ֔ה",
"absolute_consonants": "האמה"
},
{
"position": 8,
"construct": "רֹ֖חַב",
"construct_consonants": "רחב",
"absolute": "הַקֶּ֥רֶשׁ",
"absolute_consonants": "הקרש"
}
]
}
+23
View File
@@ -148,5 +148,28 @@
"prefix": "ה",
"shoresh": "משכ"
}
],
"smikhut": [
{
"position": 1,
"construct": "שְׁתֵּ֣י",
"construct_consonants": "שתי",
"absolute": "יָד֗וֹת",
"absolute_consonants": "ידות"
},
{
"position": 11,
"construct": "לְכֹ֖ל",
"construct_consonants": "לכל",
"absolute": "קַרְשֵׁ֥י",
"absolute_consonants": "קרשי"
},
{
"position": 12,
"construct": "קַרְשֵׁ֥י",
"construct_consonants": "קרשי",
"absolute": "הַמִּשְׁכָּֽן",
"absolute_consonants": "המשכן"
}
]
}
+9
View File
@@ -103,5 +103,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 7,
"construct": "לִפְאַ֖ת",
"construct_consonants": "לפאת",
"absolute": "נֶ֥גְבָּה",
"absolute_consonants": "נגבה"
}
]
}
+37
View File
@@ -238,5 +238,42 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 2,
"construct": "אַדְנֵי",
"construct_consonants": "אדני",
"absolute": "כֶ֔סֶף",
"absolute_consonants": "כסף"
},
{
"position": 8,
"construct": "שְׁנֵ֨י",
"construct_consonants": "שני",
"absolute": "אֲדָנִ֜ים",
"absolute_consonants": "אדנים"
},
{
"position": 13,
"construct": "לִשְׁתֵּ֣י",
"construct_consonants": "לשתי",
"absolute": "יְדֹתָ֔יו",
"absolute_consonants": "ידתיו"
},
{
"position": 15,
"construct": "וּשְׁנֵ֧י",
"construct_consonants": "ושני",
"absolute": "אֲדָנִ֛ים",
"absolute_consonants": "אדנים"
},
{
"position": 20,
"construct": "לִשְׁתֵּ֥י",
"construct_consonants": "לשתי",
"absolute": "יְדֹתָֽיו",
"absolute_consonants": "ידתיו"
}
]
}
+16
View File
@@ -181,5 +181,21 @@
"prefix": "ה",
"shoresh": "ירי"
}
],
"smikhut": [
{
"position": 1,
"construct": "אֹ֣רֶךְ",
"construct_consonants": "ארך",
"absolute": "הַיְרִיעָ֣ה",
"absolute_consonants": "היריעה"
},
{
"position": 14,
"construct": "לְכָל",
"construct_consonants": "לכל",
"absolute": "הַיְרִיעֹֽת",
"absolute_consonants": "היריעת"
}
]
}
+16
View File
@@ -86,5 +86,21 @@
],
"shoresh": "קרש"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּלְצֶ֧לַע",
"construct_consonants": "ולצלע",
"absolute": "הַמִּשְׁכָּ֛ן",
"absolute_consonants": "המשכן"
},
{
"position": 4,
"construct": "לִפְאַ֣ת",
"construct_consonants": "לפאת",
"absolute": "צָפ֑וֹן",
"absolute_consonants": "צפון"
}
]
}
+16
View File
@@ -152,5 +152,21 @@
"prefix": "ה",
"shoresh": "אחד"
}
],
"smikhut": [
{
"position": 4,
"construct": "שְׁנֵ֣י",
"construct_consonants": "שני",
"absolute": "אֲדָנִ֗ים",
"absolute_consonants": "אדנים"
},
{
"position": 9,
"construct": "וּשְׁנֵ֣י",
"construct_consonants": "ושני",
"absolute": "אֲדָנִ֔ים",
"absolute_consonants": "אדנים"
}
]
}
+9
View File
@@ -73,5 +73,14 @@
],
"shoresh": "קרש"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּֽלְיַרְכְּתֵ֥י",
"construct_consonants": "ולירכתי",
"absolute": "הַמִּשְׁכָּ֖ן",
"absolute_consonants": "המשכן"
}
]
}
+9
View File
@@ -75,5 +75,14 @@
"prefix": "ב",
"shoresh": "ירכ"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּשְׁנֵ֤י",
"construct_consonants": "ושני",
"absolute": "קְרָשִׁים֙",
"absolute_consonants": "קרשים"
}
]
}
+9
View File
@@ -193,5 +193,14 @@
],
"shoresh": "היו"
}
],
"smikhut": [
{
"position": 15,
"construct": "לִשְׁנֵ֥י",
"construct_consonants": "לשני",
"absolute": "הַמִּקְצֹעֹ֖ת",
"absolute_consonants": "המקצעת"
}
]
}
+16
View File
@@ -207,5 +207,21 @@
"prefix": "ה",
"shoresh": "אחד"
}
],
"smikhut": [
{
"position": 9,
"construct": "שְׁנֵ֣י",
"construct_consonants": "שני",
"absolute": "אֲדָנִ֗ים",
"absolute_consonants": "אדנים"
},
{
"position": 14,
"construct": "וּשְׁנֵ֣י",
"construct_consonants": "ושני",
"absolute": "אֲדָנִ֔ים",
"absolute_consonants": "אדנים"
}
]
}
+23
View File
@@ -108,5 +108,28 @@
"prefix": "ה",
"shoresh": "אחד"
}
],
"smikhut": [
{
"position": 3,
"construct": "עֲצֵ֣י",
"construct_consonants": "עצי",
"absolute": "שִׁטִּ֑ים",
"absolute_consonants": "שטים"
},
{
"position": 6,
"construct": "לְקַרְשֵׁ֥י",
"construct_consonants": "לקרשי",
"absolute": "צֶֽלַע",
"absolute_consonants": "צלע"
},
{
"position": 7,
"construct": "צֶֽלַע",
"construct_consonants": "צלע",
"absolute": "הַמִּשְׁכָּ֖ן",
"absolute_consonants": "המשכן"
}
]
}
+30
View File
@@ -155,5 +155,35 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 3,
"construct": "לְקַרְשֵׁ֥י",
"construct_consonants": "לקרשי",
"absolute": "צֶֽלַע",
"absolute_consonants": "צלע"
},
{
"position": 4,
"construct": "צֶֽלַע",
"construct_consonants": "צלע",
"absolute": "הַמִּשְׁכָּ֖ן",
"absolute_consonants": "המשכן"
},
{
"position": 9,
"construct": "לְקַרְשֵׁי֙",
"construct_consonants": "לקרשי",
"absolute": "צֶ֣לַע",
"absolute_consonants": "צלע"
},
{
"position": 10,
"construct": "צֶ֣לַע",
"construct_consonants": "צלע",
"absolute": "הַמִּשְׁכָּ֔ן",
"absolute_consonants": "המשכן"
}
]
}
+9
View File
@@ -104,5 +104,14 @@
"prefix": "ה",
"shoresh": "קצה"
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּת֣וֹךְ",
"construct_consonants": "בתוך",
"absolute": "הַקְּרָשִׁ֑ים",
"absolute_consonants": "הקרשים"
}
]
}
+16
View File
@@ -151,5 +151,21 @@
],
"shoresh": "כרב"
}
],
"smikhut": [
{
"position": 5,
"construct": "וְתוֹלַ֥עַת",
"construct_consonants": "ותולעת",
"absolute": "שָׁנִ֖י",
"absolute_consonants": "שני"
},
{
"position": 9,
"construct": "מַעֲשֵׂ֥ה",
"construct_consonants": "מעשה",
"absolute": "חֹשֵׁ֛ב",
"absolute_consonants": "חשב"
}
]
}
+16
View File
@@ -150,5 +150,21 @@
],
"shoresh": "כסף"
}
],
"smikhut": [
{
"position": 5,
"construct": "עַמּוּדֵ֣י",
"construct_consonants": "עמודי",
"absolute": "שִׁטִּ֔ים",
"absolute_consonants": "שטים"
},
{
"position": 13,
"construct": "אַדְנֵי",
"construct_consonants": "אדני",
"absolute": "כָֽסֶף",
"absolute_consonants": "כסף"
}
]
}
+23
View File
@@ -230,5 +230,28 @@
"prefix": "ה",
"shoresh": "קדש"
}
],
"smikhut": [
{
"position": 8,
"construct": "מִבֵּ֣ית",
"construct_consonants": "מבית",
"absolute": "לַפָּרֹ֔כֶת",
"absolute_consonants": "לפרכת"
},
{
"position": 11,
"construct": "אֲר֣וֹן",
"construct_consonants": "ארון",
"absolute": "הָעֵד֑וּת",
"absolute_consonants": "העדות"
},
{
"position": 19,
"construct": "קֹ֥דֶשׁ",
"construct_consonants": "קדש",
"absolute": "הַקֳּדָשִֽׁים",
"absolute_consonants": "הקדשים"
}
]
}
+16
View File
@@ -94,5 +94,21 @@
"prefix": "ה",
"shoresh": "קדש"
}
],
"smikhut": [
{
"position": 5,
"construct": "אֲר֣וֹן",
"construct_consonants": "ארון",
"absolute": "הָעֵדֻ֑ת",
"absolute_consonants": "העדת"
},
{
"position": 7,
"construct": "בְּקֹ֖דֶשׁ",
"construct_consonants": "בקדש",
"absolute": "הַקֳּדָשִֽׁים",
"absolute_consonants": "הקדשים"
}
]
}
+16
View File
@@ -201,5 +201,21 @@
],
"shoresh": "צפו"
}
],
"smikhut": [
{
"position": 11,
"construct": "צֶ֥לַע",
"construct_consonants": "צלע",
"absolute": "הַמִּשְׁכָּ֖ן",
"absolute_consonants": "המשכן"
},
{
"position": 17,
"construct": "צֶ֥לַע",
"construct_consonants": "צלע",
"absolute": "צָפֽוֹן",
"absolute_consonants": "צפון"
}
]
}
+23
View File
@@ -143,5 +143,28 @@
],
"shoresh": "רקם"
}
],
"smikhut": [
{
"position": 3,
"construct": "לְפֶ֣תַח",
"construct_consonants": "לפתח",
"absolute": "הָאֹ֔הֶל",
"absolute_consonants": "האהל"
},
{
"position": 7,
"construct": "וְתוֹלַ֥עַת",
"construct_consonants": "ותולעת",
"absolute": "שָׁנִ֖י",
"absolute_consonants": "שני"
},
{
"position": 11,
"construct": "מַעֲשֵׂ֖ה",
"construct_consonants": "מעשה",
"absolute": "רֹקֵֽם",
"absolute_consonants": "רקם"
}
]
}
+16
View File
@@ -171,5 +171,21 @@
],
"shoresh": "נחש"
}
],
"smikhut": [
{
"position": 4,
"construct": "עַמּוּדֵ֣י",
"construct_consonants": "עמודי",
"absolute": "שִׁטִּ֔ים",
"absolute_consonants": "שטים"
},
{
"position": 14,
"construct": "אַדְנֵ֥י",
"construct_consonants": "אדני",
"absolute": "נְחֹֽשֶׁת",
"absolute_consonants": "נחשת"
}
]
}
+23
View File
@@ -192,5 +192,28 @@
"prefix": "ה",
"shoresh": "שני"
}
],
"smikhut": [
{
"position": 2,
"construct": "לֻֽלְאֹ֣ת",
"construct_consonants": "ללאת",
"absolute": "תְּכֵ֗לֶת",
"absolute_consonants": "תכלת"
},
{
"position": 5,
"construct": "שְׂפַ֤ת",
"construct_consonants": "שפת",
"absolute": "הַיְרִיעָה֙",
"absolute_consonants": "היריעה"
},
{
"position": 12,
"construct": "בִּשְׂפַ֣ת",
"construct_consonants": "בשפת",
"absolute": "הַיְרִיעָ֔ה",
"absolute_consonants": "היריעה"
}
]
}
+9
View File
@@ -209,5 +209,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 9,
"construct": "בִּקְצֵ֣ה",
"construct_consonants": "בקצה",
"absolute": "הַיְרִיעָ֔ה",
"absolute_consonants": "היריעה"
}
]
}
+9
View File
@@ -158,5 +158,14 @@
],
"shoresh": "אחד"
}
],
"smikhut": [
{
"position": 3,
"construct": "קַרְסֵ֣י",
"construct_consonants": "קרסי",
"absolute": "זָהָ֑ב",
"absolute_consonants": "זהב"
}
]
}
+16
View File
@@ -124,5 +124,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 2,
"construct": "יְרִיעֹ֣ת",
"construct_consonants": "יריעת",
"absolute": "עִזִּ֔ים",
"absolute_consonants": "עזים"
},
{
"position": 7,
"construct": "עַשְׁתֵּי",
"construct_consonants": "עשתי",
"absolute": "עֶשְׂרֵ֥ה",
"absolute_consonants": "עשרה"
}
]
}
+16
View File
@@ -181,5 +181,21 @@
],
"shoresh": "ירי"
}
],
"smikhut": [
{
"position": 1,
"construct": "אֹ֣רֶךְ",
"construct_consonants": "ארך",
"absolute": "הַיְרִיעָ֣ה",
"absolute_consonants": "היריעה"
},
{
"position": 13,
"construct": "לְעַשְׁתֵּ֥י",
"construct_consonants": "לעשתי",
"absolute": "עֶשְׂרֵ֖ה",
"absolute_consonants": "עשרה"
}
]
}
+9
View File
@@ -189,5 +189,14 @@
"prefix": "ה",
"shoresh": "אהל"
}
],
"smikhut": [
{
"position": 16,
"construct": "פְּנֵ֥י",
"construct_consonants": "פני",
"absolute": "הָאֹֽהֶל",
"absolute_consonants": "האהל"
}
]
}