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

+9
View File
@@ -154,5 +154,14 @@
],
"shoresh": "מעל"
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֔ל",
"absolute_consonants": "ישראל"
}
]
}
+16
View File
@@ -190,5 +190,21 @@
],
"shoresh": "תפש"
}
],
"smikhut": [
{
"position": 4,
"construct": "שִׁכְבַת",
"construct_consonants": "שכבת",
"absolute": "זֶרַע֒",
"absolute_consonants": "זרע"
},
{
"position": 7,
"construct": "מֵעֵינֵ֣י",
"construct_consonants": "מעיני",
"absolute": "אִישָׁ֔הּ",
"absolute_consonants": "אישה"
}
]
}
+16
View File
@@ -214,5 +214,21 @@
],
"shoresh": "טמא"
}
],
"smikhut": [
{
"position": 3,
"construct": "רֽוּחַ",
"construct_consonants": "רוח",
"absolute": "קִנְאָ֛ה",
"absolute_consonants": "קנאה"
},
{
"position": 13,
"construct": "רֽוּחַ",
"construct_consonants": "רוח",
"absolute": "קִנְאָה֙",
"absolute_consonants": "קנאה"
}
]
}
+30
View File
@@ -323,5 +323,35 @@
],
"shoresh": "עון"
}
],
"smikhut": [
{
"position": 11,
"construct": "עֲשִׂירִ֥ת",
"construct_consonants": "עשירת",
"absolute": "הָאֵיפָ֖ה",
"absolute_consonants": "האיפה"
},
{
"position": 13,
"construct": "קֶ֣מַח",
"construct_consonants": "קמח",
"absolute": "שְׂעֹרִ֑ים",
"absolute_consonants": "שערים"
},
{
"position": 24,
"construct": "מִנְחַ֤ת",
"construct_consonants": "מנחת",
"absolute": "קְנָאֹת֙",
"absolute_consonants": "קנאת"
},
{
"position": 27,
"construct": "מִנְחַ֥ת",
"construct_consonants": "מנחת",
"absolute": "זִכָּר֖וֹן",
"absolute_consonants": "זכרון"
}
]
}
+9
View File
@@ -74,5 +74,14 @@
],
"shoresh": "יהו"
}
],
"smikhut": [
{
"position": 5,
"construct": "לִפְנֵ֥י",
"construct_consonants": "לפני",
"absolute": "יְהוָֽה",
"absolute_consonants": "יהוה"
}
]
}
+16
View File
@@ -194,5 +194,21 @@
"prefix": "ה",
"shoresh": "מים"
}
],
"smikhut": [
{
"position": 5,
"construct": "בִּכְלִי",
"construct_consonants": "בכלי",
"absolute": "חָ֑רֶשׂ",
"absolute_consonants": "חרש"
},
{
"position": 11,
"construct": "בְּקַרְקַ֣ע",
"construct_consonants": "בקרקע",
"absolute": "הַמִּשְׁכָּ֔ן",
"absolute_consonants": "המשכן"
}
]
}
+44
View File
@@ -284,5 +284,49 @@
"prefix": "ה",
"shoresh": "ארר"
}
],
"smikhut": [
{
"position": 5,
"construct": "לִפְנֵ֣י",
"construct_consonants": "לפני",
"absolute": "יְהוָה֒",
"absolute_consonants": "יהוה"
},
{
"position": 9,
"construct": "רֹ֣אשׁ",
"construct_consonants": "ראש",
"absolute": "הָֽאִשָּׁ֔ה",
"absolute_consonants": "האשה"
},
{
"position": 15,
"construct": "מִנְחַ֣ת",
"construct_consonants": "מנחת",
"absolute": "הַזִּכָּר֔וֹן",
"absolute_consonants": "הזכרון"
},
{
"position": 17,
"construct": "מִנְחַ֥ת",
"construct_consonants": "מנחת",
"absolute": "קְנָאֹ֖ת",
"absolute_consonants": "קנאת"
},
{
"position": 20,
"construct": "וּבְיַ֤ד",
"construct_consonants": "וביד",
"absolute": "הַכֹּהֵן֙",
"absolute_consonants": "הכהן"
},
{
"position": 23,
"construct": "מֵ֥י",
"construct_consonants": "מי",
"absolute": "הַמָּרִ֖ים",
"absolute_consonants": "המרים"
}
]
}
+9
View File
@@ -242,5 +242,14 @@
],
"prefix": "ה"
}
],
"smikhut": [
{
"position": 19,
"construct": "מִמֵּ֛י",
"construct_consonants": "ממי",
"absolute": "הַמָּרִ֥ים",
"absolute_consonants": "המרים"
}
]
}
+23
View File
@@ -156,5 +156,28 @@
"prefix": "ל",
"shoresh": "נפש"
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֔ל",
"absolute_consonants": "ישראל"
},
{
"position": 8,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "צָר֖וּעַ",
"absolute_consonants": "צרוע"
},
{
"position": 10,
"construct": "וְכָל",
"construct_consonants": "וכל",
"absolute": "זָ֑ב",
"absolute_consonants": "זב"
}
]
}
+16
View File
@@ -273,5 +273,21 @@
],
"shoresh": "צבה"
}
],
"smikhut": [
{
"position": 5,
"construct": "בִּשְׁבֻעַ֣ת",
"construct_consonants": "בשבעת",
"absolute": "הָאָלָה֒",
"absolute_consonants": "האלה"
},
{
"position": 15,
"construct": "בְּת֣וֹךְ",
"construct_consonants": "בתוך",
"absolute": "עַמֵּ֑ךְ",
"absolute_consonants": "עמך"
}
]
}
+9
View File
@@ -115,5 +115,14 @@
"prefix": "ה",
"shoresh": "מר"
}
],
"smikhut": [
{
"position": 9,
"construct": "מֵ֥י",
"construct_consonants": "מי",
"absolute": "הַמָּרִֽים",
"absolute_consonants": "המרים"
}
]
}
+9
View File
@@ -141,5 +141,14 @@
"prefix": "ל",
"shoresh": "מר"
}
],
"smikhut": [
{
"position": 5,
"construct": "מֵ֥י",
"construct_consonants": "מי",
"absolute": "הַמָּרִ֖ים",
"absolute_consonants": "המרים"
}
]
}
+23
View File
@@ -184,5 +184,28 @@
"prefix": "ה",
"shoresh": "מזב"
}
],
"smikhut": [
{
"position": 3,
"construct": "מִיַּ֣ד",
"construct_consonants": "מיד",
"absolute": "הָֽאִשָּׁ֔ה",
"absolute_consonants": "האשה"
},
{
"position": 6,
"construct": "מִנְחַ֣ת",
"construct_consonants": "מנחת",
"absolute": "הַקְּנָאֹ֑ת",
"absolute_consonants": "הקנאת"
},
{
"position": 11,
"construct": "לִפְנֵ֣י",
"construct_consonants": "לפני",
"absolute": "יְהוָ֔ה",
"absolute_consonants": "יהוה"
}
]
}
+9
View File
@@ -264,5 +264,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 22,
"construct": "בְּקֶ֥רֶב",
"construct_consonants": "בקרב",
"absolute": "עַמָּֽהּ",
"absolute_consonants": "עמה"
}
]
}
+9
View File
@@ -102,5 +102,14 @@
"prefix": "ו",
"shoresh": "טמא"
}
],
"smikhut": [
{
"position": 2,
"construct": "תּוֹרַ֖ת",
"construct_consonants": "תורת",
"absolute": "הַקְּנָאֹ֑ת",
"absolute_consonants": "הקנאת"
}
]
}
+23
View File
@@ -241,5 +241,28 @@
],
"prefix": "ה"
}
],
"smikhut": [
{
"position": 6,
"construct": "ר֥וּחַ",
"construct_consonants": "רוח",
"absolute": "קִנְאָ֖ה",
"absolute_consonants": "קנאה"
},
{
"position": 14,
"construct": "לִפְנֵ֣י",
"construct_consonants": "לפני",
"absolute": "יְהוָ֔ה",
"absolute_consonants": "יהוה"
},
{
"position": 20,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הַתּוֹרָ֖ה",
"absolute_consonants": "התורה"
}
]
}
+16
View File
@@ -200,5 +200,21 @@
],
"shoresh": "ישר"
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֔ל",
"absolute_consonants": "ישראל"
},
{
"position": 17,
"construct": "בְּנֵ֥י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵֽל",
"absolute_consonants": "ישראל"
}
]
}
+23
View File
@@ -204,5 +204,28 @@
],
"prefix": "ה"
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵל֒",
"absolute_consonants": "ישראל"
},
{
"position": 10,
"construct": "מִכָּל",
"construct_consonants": "מכל",
"absolute": "חַטֹּ֣את",
"absolute_consonants": "חטאת"
},
{
"position": 11,
"construct": "חַטֹּ֣את",
"construct_consonants": "חטאת",
"absolute": "הָֽאָדָ֔ם",
"absolute_consonants": "האדם"
}
]
}
+16
View File
@@ -203,5 +203,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 12,
"construct": "מִלְּבַ֗ד",
"construct_consonants": "מלבד",
"absolute": "אֵ֚יל",
"absolute_consonants": "איל"
},
{
"position": 13,
"construct": "אֵ֚יל",
"construct_consonants": "איל",
"absolute": "הַכִּפֻּרִ֔ים",
"absolute_consonants": "הכפרים"
}
]
}
+30
View File
@@ -119,5 +119,35 @@
],
"shoresh": "היה"
}
],
"smikhut": [
{
"position": 1,
"construct": "וְכָל",
"construct_consonants": "וכל",
"absolute": "תְּרוּמָ֞ה",
"absolute_consonants": "תרומה"
},
{
"position": 3,
"construct": "לְכָל",
"construct_consonants": "לכל",
"absolute": "קָדְשֵׁ֧י",
"absolute_consonants": "קדשי"
},
{
"position": 4,
"construct": "קָדְשֵׁ֧י",
"construct_consonants": "קדשי",
"absolute": "בְנֵי",
"absolute_consonants": "בני"
},
{
"position": 5,
"construct": "בְנֵי",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֛ל",
"absolute_consonants": "ישראל"
}
]
}