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
@@ -145,5 +145,21 @@
],
"shoresh": "יצח"
}
],
"smikhut": [
{
"position": 3,
"construct": "וְכָל",
"construct_consonants": "וכל",
"absolute": "אֲשֶׁר",
"absolute_consonants": "אשר"
},
{
"position": 11,
"construct": "לֵאלֹהֵ֖י",
"construct_consonants": "לאלהי",
"absolute": "אָבִ֥יו",
"absolute_consonants": "אביו"
}
]
}
+16
View File
@@ -121,5 +121,21 @@
"prefix": "ה",
"shoresh": "כנע"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּבְנֵ֣י",
"construct_consonants": "ובני",
"absolute": "שִׁמְע֗וֹן",
"absolute_consonants": "שמעון"
},
{
"position": 9,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "הַֽכְּנַעֲנִֽית",
"absolute_consonants": "הכנענית"
}
]
}
+9
View File
@@ -62,5 +62,14 @@
"prefix": "ו",
"shoresh": "מרר"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּבְנֵ֖י",
"construct_consonants": "ובני",
"absolute": "לֵוִ֑י",
"absolute_consonants": "לוי"
}
]
}
+23
View File
@@ -200,5 +200,28 @@
"prefix": "ו",
"shoresh": "חמו"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּבְנֵ֣י",
"construct_consonants": "ובני",
"absolute": "יְהוּדָ֗ה",
"absolute_consonants": "יהודה"
},
{
"position": 11,
"construct": "בְּאֶ֣רֶץ",
"construct_consonants": "בארץ",
"absolute": "כְּנַ֔עַן",
"absolute_consonants": "כנען"
},
{
"position": 14,
"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
@@ -63,5 +63,14 @@
"prefix": "ו",
"shoresh": "יחל"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּבְנֵ֖י",
"construct_consonants": "ובני",
"absolute": "זְבוּלֻ֑ן",
"absolute_consonants": "זבולן"
}
]
}
+23
View File
@@ -190,5 +190,28 @@
"prefix": "ו",
"shoresh": "שלש"
}
],
"smikhut": [
{
"position": 2,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "לֵאָ֗ה",
"absolute_consonants": "לאה"
},
{
"position": 12,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "נֶ֧פֶשׁ",
"absolute_consonants": "נפש"
},
{
"position": 13,
"construct": "נֶ֧פֶשׁ",
"construct_consonants": "נפש",
"absolute": "בָּנָ֛יו",
"absolute_consonants": "בניו"
}
]
}
+9
View File
@@ -110,5 +110,14 @@
"prefix": "ו",
"shoresh": "ארא"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּבְנֵ֣י",
"construct_consonants": "ובני",
"absolute": "גָ֔ד",
"absolute_consonants": "גד"
}
]
}
+16
View File
@@ -143,5 +143,21 @@
"prefix": "ו",
"shoresh": "מלכ"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּבְנֵ֣י",
"construct_consonants": "ובני",
"absolute": "אָשֵׁ֗ר",
"absolute_consonants": "אשר"
},
{
"position": 9,
"construct": "וּבְנֵ֣י",
"construct_consonants": "ובני",
"absolute": "בְרִיעָ֔ה",
"absolute_consonants": "בריעה"
}
]
}
+9
View File
@@ -165,5 +165,14 @@
],
"shoresh": "נפש"
}
],
"smikhut": [
{
"position": 2,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "זִלְפָּ֔ה",
"absolute_consonants": "זלפה"
}
]
}
+16
View File
@@ -73,5 +73,21 @@
"prefix": "ו",
"shoresh": "בני"
}
],
"smikhut": [
{
"position": 1,
"construct": "בְּנֵ֤י",
"construct_consonants": "בני",
"absolute": "רָחֵל֙",
"absolute_consonants": "רחל"
},
{
"position": 3,
"construct": "אֵ֣שֶׁת",
"construct_consonants": "אשת",
"absolute": "יַֽעֲקֹ֔ב",
"absolute_consonants": "יעקב"
}
]
}
+9
View File
@@ -120,5 +120,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 4,
"construct": "בְּמַרְאֹ֣ת",
"construct_consonants": "במראת",
"absolute": "הַלַּ֔יְלָה",
"absolute_consonants": "הלילה"
}
]
}
+23
View File
@@ -187,5 +187,28 @@
],
"shoresh": "אפר"
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּאֶ֣רֶץ",
"construct_consonants": "בארץ",
"absolute": "מִצְרַיִם֒",
"absolute_consonants": "מצרים"
},
{
"position": 9,
"construct": "בַּת",
"construct_consonants": "בת",
"absolute": "פּ֥וֹטִי",
"absolute_consonants": "פוטי"
},
{
"position": 12,
"construct": "כֹּהֵ֣ן",
"construct_consonants": "כהן",
"absolute": "אֹ֑ן",
"absolute_consonants": "אן"
}
]
}
+9
View File
@@ -145,5 +145,14 @@
"prefix": "ו",
"shoresh": "ארד"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּבְנֵ֣י",
"construct_consonants": "ובני",
"absolute": "בִנְיָמִ֗ן",
"absolute_consonants": "בנימן"
}
]
}
+16
View File
@@ -112,5 +112,21 @@
],
"shoresh": "עשר"
}
],
"smikhut": [
{
"position": 2,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "רָחֵ֔ל",
"absolute_consonants": "רחל"
},
{
"position": 7,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "נֶ֖פֶשׁ",
"absolute_consonants": "נפש"
}
]
}
+9
View File
@@ -37,5 +37,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": "נפתלי"
}
]
}
+16
View File
@@ -162,5 +162,21 @@
],
"shoresh": "שבע"
}
],
"smikhut": [
{
"position": 2,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "בִלְהָ֔ה",
"absolute_consonants": "בלהה"
},
{
"position": 13,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "נֶ֥פֶשׁ",
"absolute_consonants": "נפש"
}
]
}
+37
View File
@@ -168,5 +168,42 @@
"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": "בני"
},
{
"position": 10,
"construct": "בְנֵי",
"construct_consonants": "בני",
"absolute": "יַעֲקֹ֑ב",
"absolute_consonants": "יעקב"
},
{
"position": 12,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "נֶ֖פֶשׁ",
"absolute_consonants": "נפש"
}
]
}
+23
View File
@@ -166,5 +166,28 @@
],
"shoresh": "שבע"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּבְנֵ֥י",
"construct_consonants": "ובני",
"absolute": "יוֹסֵ֛ף",
"absolute_consonants": "יוסף"
},
{
"position": 9,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הַנֶּ֧פֶשׁ",
"absolute_consonants": "הנפש"
},
{
"position": 11,
"construct": "לְבֵֽית",
"construct_consonants": "לבית",
"absolute": "יַעֲקֹ֛ב",
"absolute_consonants": "יעקב"
}
]
}
+9
View File
@@ -132,5 +132,14 @@
],
"shoresh": "גשן"
}
],
"smikhut": [
{
"position": 11,
"construct": "אַ֥רְצָה",
"construct_consonants": "ארצה",
"absolute": "גֹּֽשֶׁן",
"absolute_consonants": "גשן"
}
]
}
+9
View File
@@ -156,5 +156,14 @@
],
"shoresh": "שם"
}
],
"smikhut": [
{
"position": 4,
"construct": "אֱלֹהֵ֣י",
"construct_consonants": "אלהי",
"absolute": "אָבִ֑יךָ",
"absolute_consonants": "אביך"
}
]
}
+23
View File
@@ -218,5 +218,28 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 6,
"construct": "בֵּ֣ית",
"construct_consonants": "בית",
"absolute": "אָבִ֔יו",
"absolute_consonants": "אביו"
},
{
"position": 14,
"construct": "וּבֵית",
"construct_consonants": "ובית",
"absolute": "אָבִ֛י",
"absolute_consonants": "אבי"
},
{
"position": 17,
"construct": "בְּאֶֽרֶץ",
"construct_consonants": "בארץ",
"absolute": "כְּנַ֖עַן",
"absolute_consonants": "כנען"
}
]
}
+16
View File
@@ -145,5 +145,21 @@
],
"shoresh": "ביא"
}
],
"smikhut": [
{
"position": 5,
"construct": "אַנְשֵׁ֥י",
"construct_consonants": "אנשי",
"absolute": "מִקְנֶ֖ה",
"absolute_consonants": "מקנה"
},
{
"position": 10,
"construct": "וְכָל",
"construct_consonants": "וכל",
"absolute": "אֲשֶׁ֥ר",
"absolute_consonants": "אשר"
}
]
}
+37
View File
@@ -237,5 +237,42 @@
],
"shoresh": "צאן"
}
],
"smikhut": [
{
"position": 2,
"construct": "אַנְשֵׁ֨י",
"construct_consonants": "אנשי",
"absolute": "מִקְנֶ֜ה",
"absolute_consonants": "מקנה"
},
{
"position": 13,
"construct": "בַּעֲב֗וּר",
"construct_consonants": "בעבור",
"absolute": "תֵּשְׁבוּ֙",
"absolute_consonants": "תשבו"
},
{
"position": 15,
"construct": "בְּאֶ֣רֶץ",
"construct_consonants": "בארץ",
"absolute": "גֹּ֔שֶׁן",
"absolute_consonants": "גשן"
},
{
"position": 18,
"construct": "תוֹעֲבַ֥ת",
"construct_consonants": "תועבת",
"absolute": "מִצְרַ֖יִם",
"absolute_consonants": "מצרים"
},
{
"position": 20,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "רֹ֥עֵה",
"absolute_consonants": "רעה"
}
]
}
+9
View File
@@ -216,5 +216,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 6,
"construct": "בְנֵֽי",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֜ל",
"absolute_consonants": "ישראל"
}
]
}
+16
View File
@@ -162,5 +162,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 8,
"construct": "בְּאֶ֣רֶץ",
"construct_consonants": "בארץ",
"absolute": "כְּנַ֔עַן",
"absolute_consonants": "כנען"
},
{
"position": 13,
"construct": "וְכָל",
"construct_consonants": "וכל",
"absolute": "זַרְע֥וֹ",
"absolute_consonants": "זרעו"
}
]
}
+23
View File
@@ -130,5 +130,28 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 2,
"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
@@ -126,5 +126,28 @@
],
"shoresh": "ראו"
}
],
"smikhut": [
{
"position": 2,
"construct": "שְׁמ֧וֹת",
"construct_consonants": "שמות",
"absolute": "בְּנֵֽי",
"absolute_consonants": "בני"
},
{
"position": 3,
"construct": "בְּנֵֽי",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֛ל",
"absolute_consonants": "ישראל"
},
{
"position": 9,
"construct": "בְּכֹ֥ר",
"construct_consonants": "בכר",
"absolute": "יַעֲקֹ֖ב",
"absolute_consonants": "יעקב"
}
]
}
+9
View File
@@ -75,5 +75,14 @@
"prefix": "ו",
"shoresh": "כרמ"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּבְנֵ֖י",
"construct_consonants": "ובני",
"absolute": "רְאוּבֵ֑ן",
"absolute_consonants": "ראובן"
}
]
}