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

+37
View File
@@ -268,5 +268,42 @@
],
"shoresh": "יהו"
}
],
"smikhut": [
{
"position": 4,
"construct": "וְכֹ֣ל",
"construct_consonants": "וכל",
"absolute": "אִ֣ישׁ",
"absolute_consonants": "איש"
},
{
"position": 6,
"construct": "חֲכַם",
"construct_consonants": "חכם",
"absolute": "לֵ֗ב",
"absolute_consonants": "לב"
},
{
"position": 17,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "מְלֶ֖אכֶת",
"absolute_consonants": "מלאכת"
},
{
"position": 18,
"construct": "מְלֶ֖אכֶת",
"construct_consonants": "מלאכת",
"absolute": "עֲבֹדַ֣ת",
"absolute_consonants": "עבדת"
},
{
"position": 19,
"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
@@ -208,5 +208,14 @@
],
"shoresh": "אחת"
}
],
"smikhut": [
{
"position": 9,
"construct": "בִּקְצֵ֣ה",
"construct_consonants": "בקצה",
"absolute": "הַיְרִיעָ֔ה",
"absolute_consonants": "היריעה"
}
]
}
+9
View File
@@ -160,5 +160,14 @@
],
"shoresh": "אחד"
}
],
"smikhut": [
{
"position": 3,
"construct": "קַרְסֵ֣י",
"construct_consonants": "קרסי",
"absolute": "זָהָ֑ב",
"absolute_consonants": "זהב"
}
]
}
+16
View File
@@ -126,5 +126,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 2,
"construct": "יְרִיעֹ֣ת",
"construct_consonants": "יריעת",
"absolute": "עִזִּ֔ים",
"absolute_consonants": "עזים"
},
{
"position": 7,
"construct": "עַשְׁתֵּֽי",
"construct_consonants": "עשתי",
"absolute": "עֶשְׂרֵ֥ה",
"absolute_consonants": "עשרה"
}
]
}
+23
View File
@@ -178,5 +178,28 @@
],
"shoresh": "ירי"
}
],
"smikhut": [
{
"position": 1,
"construct": "אֹ֜רֶךְ",
"construct_consonants": "ארך",
"absolute": "הַיְרִיעָ֣ה",
"absolute_consonants": "היריעה"
},
{
"position": 8,
"construct": "רֹ֖חַב",
"construct_consonants": "רחב",
"absolute": "הַיְרִיעָ֣ה",
"absolute_consonants": "היריעה"
},
{
"position": 13,
"construct": "לְעַשְׁתֵּ֥י",
"construct_consonants": "לעשתי",
"absolute": "עֶשְׂרֵ֖ה",
"absolute_consonants": "עשרה"
}
]
}
+16
View File
@@ -186,5 +186,21 @@
"prefix": "ה",
"shoresh": "שני"
}
],
"smikhut": [
{
"position": 5,
"construct": "שְׂפַ֣ת",
"construct_consonants": "שפת",
"absolute": "הַיְרִיעָ֔ה",
"absolute_consonants": "היריעה"
},
{
"position": 13,
"construct": "שְׂפַ֣ת",
"construct_consonants": "שפת",
"absolute": "הַיְרִיעָ֔ה",
"absolute_consonants": "היריעה"
}
]
}
+9
View File
@@ -106,5 +106,14 @@
],
"shoresh": "אחד"
}
],
"smikhut": [
{
"position": 2,
"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": "תחשים"
}
]
}
+16
View File
@@ -268,5 +268,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 8,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "אִ֣ישׁ",
"absolute_consonants": "איש"
},
{
"position": 10,
"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
@@ -150,5 +150,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
@@ -104,5 +104,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
@@ -97,5 +97,21 @@
],
"shoresh": "קרש"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּלְצֶ֧לַע",
"construct_consonants": "ולצלע",
"absolute": "הַמִּשְׁכָּ֛ן",
"absolute_consonants": "המשכן"
},
{
"position": 4,
"construct": "לִפְאַ֣ת",
"construct_consonants": "לפאת",
"absolute": "צָפ֑וֹן",
"absolute_consonants": "צפון"
}
]
}
+16
View File
@@ -151,5 +151,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
@@ -180,5 +180,14 @@
"prefix": "ה",
"shoresh": "מקצ"
}
],
"smikhut": [
{
"position": 15,
"construct": "לִשְׁנֵ֖י",
"construct_consonants": "לשני",
"absolute": "הַמִּקְצֹעֹֽת",
"absolute_consonants": "המקצעת"
}
]
}
+37
View File
@@ -249,5 +249,42 @@
"prefix": "ב",
"shoresh": "בקר"
}
],
"smikhut": [
{
"position": 2,
"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": 12,
"construct": "עֲבֹדַ֥ת",
"construct_consonants": "עבדת",
"absolute": "הַקֹּ֖דֶשׁ",
"absolute_consonants": "הקדש"
}
]
}
+16
View File
@@ -172,5 +172,21 @@
"prefix": "ה",
"shoresh": "אחד"
}
],
"smikhut": [
{
"position": 9,
"construct": "שְׁנֵ֤י",
"construct_consonants": "שני",
"absolute": "אֲדָנִים֙",
"absolute_consonants": "אדנים"
},
{
"position": 11,
"construct": "שְׁנֵ֣י",
"construct_consonants": "שני",
"absolute": "אֲדָנִ֔ים",
"absolute_consonants": "אדנים"
}
]
}
+30
View File
@@ -108,5 +108,35 @@
"prefix": "ה",
"shoresh": "אחת"
}
],
"smikhut": [
{
"position": 2,
"construct": "בְּרִיחֵ֖י",
"construct_consonants": "בריחי",
"absolute": "עֲצֵ֣י",
"absolute_consonants": "עצי"
},
{
"position": 3,
"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
@@ -144,5 +144,28 @@
"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": "המשכן"
}
]
}
+9
View File
@@ -126,5 +126,14 @@
"prefix": "ה",
"shoresh": "קצה"
}
],
"smikhut": [
{
"position": 6,
"construct": "בְּת֣וֹךְ",
"construct_consonants": "בתוך",
"absolute": "הַקְּרָשִׁ֔ים",
"absolute_consonants": "הקרשים"
}
]
}
+16
View File
@@ -161,5 +161,21 @@
],
"shoresh": "כרב"
}
],
"smikhut": [
{
"position": 6,
"construct": "וְתוֹלַ֥עַת",
"construct_consonants": "ותולעת",
"absolute": "שָׁנִ֖י",
"absolute_consonants": "שני"
},
{
"position": 10,
"construct": "מַעֲשֵׂ֥ה",
"construct_consonants": "מעשה",
"absolute": "חֹשֵׁ֛ב",
"absolute_consonants": "חשב"
}
]
}
+16
View File
@@ -156,5 +156,21 @@
],
"shoresh": "כסף"
}
],
"smikhut": [
{
"position": 4,
"construct": "עַמּוּדֵ֣י",
"construct_consonants": "עמודי",
"absolute": "שִׁטִּ֔ים",
"absolute_consonants": "שטים"
},
{
"position": 13,
"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": "רקם"
}
]
}
+23
View File
@@ -156,5 +156,28 @@
],
"shoresh": "עש"
}
],
"smikhut": [
{
"position": 2,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הַ֣חֲכָמִ֔ים",
"absolute_consonants": "החכמים"
},
{
"position": 6,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "מְלֶ֣אכֶת",
"absolute_consonants": "מלאכת"
},
{
"position": 7,
"construct": "מְלֶ֣אכֶת",
"construct_consonants": "מלאכת",
"absolute": "הַקֹּ֑דֶשׁ",
"absolute_consonants": "הקדש"
}
]
}
+9
View File
@@ -172,5 +172,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 8,
"construct": "מִדֵּ֤י",
"construct_consonants": "מדי",
"absolute": "הָֽעֲבֹדָה֙",
"absolute_consonants": "העבדה"
}
]
}
+9
View File
@@ -198,5 +198,14 @@
"prefix": "מ",
"shoresh": "ביא"
}
],
"smikhut": [
{
"position": 13,
"construct": "לִתְרוּמַ֣ת",
"construct_consonants": "לתרומת",
"absolute": "הַקֹּ֑דֶשׁ",
"absolute_consonants": "הקדש"
}
]
}
+9
View File
@@ -94,5 +94,14 @@
"prefix": "ו",
"shoresh": "ותר"
}
],
"smikhut": [
{
"position": 4,
"construct": "לְכָל",
"construct_consonants": "לכל",
"absolute": "הַמְּלָאכָ֖ה",
"absolute_consonants": "המלאכה"
}
]
}
+30
View File
@@ -235,5 +235,35 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 2,
"construct": "כָל",
"construct_consonants": "כל",
"absolute": "חֲכַם",
"absolute_consonants": "חכם"
},
{
"position": 3,
"construct": "חֲכַם",
"construct_consonants": "חכם",
"absolute": "לֵ֜ב",
"absolute_consonants": "לב"
},
{
"position": 15,
"construct": "וְתוֹלַ֣עַת",
"construct_consonants": "ותולעת",
"absolute": "שָׁנִ֔י",
"absolute_consonants": "שני"
},
{
"position": 18,
"construct": "מַעֲשֵׂ֥ה",
"construct_consonants": "מעשה",
"absolute": "חֹשֵׁ֖ב",
"absolute_consonants": "חשב"
}
]
}
+16
View File
@@ -182,5 +182,21 @@
"prefix": "ה",
"shoresh": "ירי"
}
],
"smikhut": [
{
"position": 1,
"construct": "אֹ֜רֶךְ",
"construct_consonants": "ארך",
"absolute": "הַיְרִיעָ֣ה",
"absolute_consonants": "היריעה"
},
{
"position": 14,
"construct": "לְכָל",
"construct_consonants": "לכל",
"absolute": "הַיְרִיעֹֽת",
"absolute_consonants": "היריעת"
}
]
}