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
@@ -177,5 +177,28 @@
],
"shoresh": "רב"
}
],
"smikhut": [
{
"position": 4,
"construct": "דֶּ֣רֶךְ",
"construct_consonants": "דרך",
"absolute": "יַם",
"absolute_consonants": "ים"
},
{
"position": 5,
"construct": "יַם",
"construct_consonants": "ים",
"absolute": "ס֔וּף",
"absolute_consonants": "סוף"
},
{
"position": 13,
"construct": "הַר",
"construct_consonants": "הר",
"absolute": "שֵׂעִ֖יר",
"absolute_consonants": "שעיר"
}
]
}
+16
View File
@@ -226,5 +226,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 5,
"construct": "וּבְנֵ֧י",
"construct_consonants": "ובני",
"absolute": "עֵשָׂ֣ו",
"absolute_consonants": "עשו"
},
{
"position": 15,
"construct": "לְאֶ֨רֶץ֙",
"construct_consonants": "לארץ",
"absolute": "יְרֻשָּׁת֔וֹ",
"absolute_consonants": "ירשתו"
}
]
}
+16
View File
@@ -122,5 +122,21 @@
],
"shoresh": "זרד"
}
],
"smikhut": [
{
"position": 6,
"construct": "נַ֣חַל",
"construct_consonants": "נחל",
"absolute": "זָ֑רֶד",
"absolute_consonants": "זרד"
},
{
"position": 10,
"construct": "נַ֥חַל",
"construct_consonants": "נחל",
"absolute": "זָֽרֶד",
"absolute_consonants": "זרד"
}
]
}
+30
View File
@@ -284,5 +284,35 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 10,
"construct": "נַ֣חַל",
"construct_consonants": "נחל",
"absolute": "זֶ֔רֶד",
"absolute_consonants": "זרד"
},
{
"position": 17,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הַדּ֜וֹר",
"absolute_consonants": "הדור"
},
{
"position": 19,
"construct": "אַנְשֵׁ֤י",
"construct_consonants": "אנשי",
"absolute": "הַמִּלְחָמָה֙",
"absolute_consonants": "המלחמה"
},
{
"position": 21,
"construct": "מִקֶּ֣רֶב",
"construct_consonants": "מקרב",
"absolute": "הַֽמַּחֲנֶ֔ה",
"absolute_consonants": "המחנה"
}
]
}
+16
View File
@@ -113,5 +113,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 2,
"construct": "יַד",
"construct_consonants": "יד",
"absolute": "יְהוָה֙",
"absolute_consonants": "יהוה"
},
{
"position": 7,
"construct": "מִקֶּ֣רֶב",
"construct_consonants": "מקרב",
"absolute": "הַֽמַּחֲנֶ֑ה",
"absolute_consonants": "המחנה"
}
]
}
+23
View File
@@ -105,5 +105,28 @@
"prefix": "ה",
"shoresh": "עם"
}
],
"smikhut": [
{
"position": 4,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "אַנְשֵׁ֧י",
"absolute_consonants": "אנשי"
},
{
"position": 5,
"construct": "אַנְשֵׁ֧י",
"construct_consonants": "אנשי",
"absolute": "הַמִּלְחָמָ֛ה",
"absolute_consonants": "המלחמה"
},
{
"position": 8,
"construct": "מִקֶּ֥רֶב",
"construct_consonants": "מקרב",
"absolute": "הָעָֽם",
"absolute_consonants": "העם"
}
]
}
+9
View File
@@ -87,5 +87,14 @@
],
"shoresh": "ער"
}
],
"smikhut": [
{
"position": 5,
"construct": "גְּב֥וּל",
"construct_consonants": "גבול",
"absolute": "מוֹאָ֖ב",
"absolute_consonants": "מואב"
}
]
}
+30
View File
@@ -233,5 +233,35 @@
],
"shoresh": "ירש"
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "עַמּ֔וֹן",
"absolute_consonants": "עמון"
},
{
"position": 13,
"construct": "מֵאֶ֨רֶץ",
"construct_consonants": "מארץ",
"absolute": "בְּנֵי",
"absolute_consonants": "בני"
},
{
"position": 14,
"construct": "בְּנֵי",
"construct_consonants": "בני",
"absolute": "עַמּ֤וֹן",
"absolute_consonants": "עמון"
},
{
"position": 19,
"construct": "לִבְנֵי",
"construct_consonants": "לבני",
"absolute": "ל֖וֹט",
"absolute_consonants": "לוט"
}
]
}
+9
View File
@@ -145,5 +145,14 @@
],
"shoresh": "זמז"
}
],
"smikhut": [
{
"position": 1,
"construct": "אֶֽרֶץ",
"construct_consonants": "ארץ",
"absolute": "רְפָאִ֥ים",
"absolute_consonants": "רפאים"
}
]
}
+9
View File
@@ -193,5 +193,14 @@
],
"prefix": "ה"
}
],
"smikhut": [
{
"position": 3,
"construct": "לִבְנֵ֣י",
"construct_consonants": "לבני",
"absolute": "עֵשָׂ֔ו",
"absolute_consonants": "עשו"
}
]
}
+16
View File
@@ -230,5 +230,21 @@
],
"shoresh": "מלח"
}
],
"smikhut": [
{
"position": 5,
"construct": "נַ֣חַל",
"construct_consonants": "נחל",
"absolute": "אַרְנֹן֒",
"absolute_consonants": "ארנן"
},
{
"position": 12,
"construct": "מֶֽלֶךְ",
"construct_consonants": "מלך",
"absolute": "חֶשְׁבּ֧וֹן",
"absolute_consonants": "חשבון"
}
]
}
+16
View File
@@ -200,5 +200,21 @@
],
"prefix": "מ"
}
],
"smikhut": [
{
"position": 8,
"construct": "פְּנֵי֙",
"construct_consonants": "פני",
"absolute": "הָֽעַמִּ֔ים",
"absolute_consonants": "העמים"
},
{
"position": 11,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הַשָּׁמָ֑יִם",
"absolute_consonants": "השמים"
}
]
}
+23
View File
@@ -126,5 +126,28 @@
"prefix": "ל",
"shoresh": "אמר"
}
],
"smikhut": [
{
"position": 3,
"construct": "מִמִּדְבַּ֣ר",
"construct_consonants": "ממדבר",
"absolute": "קְדֵמ֔וֹת",
"absolute_consonants": "קדמות"
},
{
"position": 7,
"construct": "מֶ֣לֶךְ",
"construct_consonants": "מלך",
"absolute": "חֶשְׁבּ֑וֹן",
"absolute_consonants": "חשבון"
},
{
"position": 9,
"construct": "דִּבְרֵ֥י",
"construct_consonants": "דברי",
"absolute": "שָׁל֖וֹם",
"absolute_consonants": "שלום"
}
]
}
+9
View File
@@ -243,5 +243,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 4,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "עֵשָׂ֗ו",
"absolute_consonants": "עשו"
}
]
}
+9
View File
@@ -97,5 +97,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "רַב",
"construct_consonants": "רב",
"absolute": "לָכֶ֕ם",
"absolute_consonants": "לכם"
}
]
}
+9
View File
@@ -224,5 +224,14 @@
],
"prefix": "ה"
}
],
"smikhut": [
{
"position": 4,
"construct": "מֶ֣לֶךְ",
"construct_consonants": "מלך",
"absolute": "חֶשְׁבּ֔וֹן",
"absolute_consonants": "חשבון"
}
]
}
+9
View File
@@ -91,5 +91,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 5,
"construct": "וְכָל",
"construct_consonants": "וכל",
"absolute": "עַמּ֛וֹ",
"absolute_consonants": "עמו"
}
]
}
+18
View File
@@ -116,5 +116,23 @@
"meteg_siluq"
]
}
],
"ketiv_qere": [
{
"word_position": 8,
"ketiv": "בנו",
"ketiv_consonants": "בנו",
"qere": "בָּנָ֖יו",
"qere_consonants": "בניו"
}
],
"smikhut": [
{
"position": 10,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "עַמּֽוֹ",
"absolute_consonants": "עמו"
}
]
}
+16
View File
@@ -175,5 +175,21 @@
],
"shoresh": "שרי"
}
],
"smikhut": [
{
"position": 3,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "עָרָיו֙",
"absolute_consonants": "עריו"
},
{
"position": 9,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "עִ֣יר",
"absolute_consonants": "עיר"
}
]
}
+9
View File
@@ -93,5 +93,14 @@
],
"shoresh": "לכד"
}
],
"smikhut": [
{
"position": 5,
"construct": "וּשְׁלַ֥ל",
"construct_consonants": "ושלל",
"absolute": "הֶעָרִ֖ים",
"absolute_consonants": "הערים"
}
]
}
+16
View File
@@ -250,5 +250,21 @@
],
"prefix": "ל"
}
],
"smikhut": [
{
"position": 4,
"construct": "שְׂפַת",
"construct_consonants": "שפת",
"absolute": "נַ֨חַל",
"absolute_consonants": "נחל"
},
{
"position": 5,
"construct": "נַ֨חַל",
"construct_consonants": "נחל",
"absolute": "אַרְנֹ֜ן",
"absolute_consonants": "ארנן"
}
]
}
+44
View File
@@ -193,5 +193,49 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 3,
"construct": "אֶ֥רֶץ",
"construct_consonants": "ארץ",
"absolute": "בְּנֵי",
"absolute_consonants": "בני"
},
{
"position": 4,
"construct": "בְּנֵי",
"construct_consonants": "בני",
"absolute": "עַמּ֖וֹן",
"absolute_consonants": "עמון"
},
{
"position": 8,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "יַ֞ד",
"absolute_consonants": "יד"
},
{
"position": 9,
"construct": "יַ֞ד",
"construct_consonants": "יד",
"absolute": "נַ֤חַל",
"absolute_consonants": "נחל"
},
{
"position": 10,
"construct": "נַ֤חַל",
"construct_consonants": "נחל",
"absolute": "יַבֹּק֙",
"absolute_consonants": "יבק"
},
{
"position": 12,
"construct": "וְעָרֵ֣י",
"construct_consonants": "וערי",
"absolute": "הָהָ֔ר",
"absolute_consonants": "ההר"
}
]
}
+16
View File
@@ -184,5 +184,21 @@
],
"shoresh": "מאד"
}
],
"smikhut": [
{
"position": 7,
"construct": "בִּגְבוּל֙",
"construct_consonants": "בגבול",
"absolute": "אֲחֵיכֶ֣ם",
"absolute_consonants": "אחיכם"
},
{
"position": 9,
"construct": "בְּנֵי",
"construct_consonants": "בני",
"absolute": "עֵשָׂ֔ו",
"absolute_consonants": "עשו"
}
]
}
+23
View File
@@ -202,5 +202,28 @@
],
"shoresh": "שעי"
}
],
"smikhut": [
{
"position": 10,
"construct": "מִדְרַ֣ךְ",
"construct_consonants": "מדרך",
"absolute": "כַּף",
"absolute_consonants": "כף"
},
{
"position": 11,
"construct": "כַּף",
"construct_consonants": "כף",
"absolute": "רָ֑גֶל",
"absolute_consonants": "רגל"
},
{
"position": 18,
"construct": "הַ֥ר",
"construct_consonants": "הר",
"absolute": "שֵׂעִֽיר",
"absolute_consonants": "שעיר"
}
]
}
+16
View File
@@ -240,5 +240,21 @@
],
"shoresh": "דבר"
}
],
"smikhut": [
{
"position": 5,
"construct": "בְּכֹל֙",
"construct_consonants": "בכל",
"absolute": "מַעֲשֵׂ֣ה",
"absolute_consonants": "מעשה"
},
{
"position": 6,
"construct": "מַעֲשֵׂ֣ה",
"construct_consonants": "מעשה",
"absolute": "יָדֶ֔ךָ",
"absolute_consonants": "ידך"
}
]
}
+30
View File
@@ -204,5 +204,35 @@
],
"shoresh": "מוא"
}
],
"smikhut": [
{
"position": 4,
"construct": "בְנֵי",
"construct_consonants": "בני",
"absolute": "עֵשָׂ֗ו",
"absolute_consonants": "עשו"
},
{
"position": 8,
"construct": "מִדֶּ֨רֶךְ֙",
"construct_consonants": "מדרך",
"absolute": "הָֽעֲרָבָ֔ה",
"absolute_consonants": "הערבה"
},
{
"position": 15,
"construct": "דֶּ֖רֶךְ",
"construct_consonants": "דרך",
"absolute": "מִדְבַּ֥ר",
"absolute_consonants": "מדבר"
},
{
"position": 16,
"construct": "מִדְבַּ֥ר",
"construct_consonants": "מדבר",
"absolute": "מוֹאָֽב",
"absolute_consonants": "מואב"
}
]
}
+9
View File
@@ -254,5 +254,14 @@
],
"shoresh": "ירש"
}
],
"smikhut": [
{
"position": 19,
"construct": "לִבְנֵי",
"construct_consonants": "לבני",
"absolute": "ל֔וֹט",
"absolute_consonants": "לוט"
}
]
}