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
@@ -152,5 +152,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 2,
"construct": "אֲר֖וֹן",
"construct_consonants": "ארון",
"absolute": "עֲצֵ֣י",
"absolute_consonants": "עצי"
},
{
"position": 3,
"construct": "עֲצֵ֣י",
"construct_consonants": "עצי",
"absolute": "שִׁטִּ֑ים",
"absolute_consonants": "שטים"
}
]
}
+9
View File
@@ -138,5 +138,14 @@
],
"shoresh": "סבי"
}
],
"smikhut": [
{
"position": 10,
"construct": "זֵ֥ר",
"construct_consonants": "זר",
"absolute": "זָהָ֖ב",
"absolute_consonants": "זהב"
}
]
}
+23
View File
@@ -211,5 +211,28 @@
"prefix": "ה",
"shoresh": "שני"
}
],
"smikhut": [
{
"position": 4,
"construct": "טַבְּעֹ֣ת",
"construct_consonants": "טבעת",
"absolute": "זָהָ֔ב",
"absolute_consonants": "זהב"
},
{
"position": 10,
"construct": "וּשְׁתֵּ֣י",
"construct_consonants": "ושתי",
"absolute": "טַבָּעֹ֗ת",
"absolute_consonants": "טבעת"
},
{
"position": 15,
"construct": "וּשְׁתֵּי֙",
"construct_consonants": "ושתי",
"absolute": "טַבָּעֹ֔ת",
"absolute_consonants": "טבעת"
}
]
}
+16
View File
@@ -83,5 +83,21 @@
],
"shoresh": "זהב"
}
],
"smikhut": [
{
"position": 2,
"construct": "בַדֵּ֖י",
"construct_consonants": "בדי",
"absolute": "עֲצֵ֣י",
"absolute_consonants": "עצי"
},
{
"position": 3,
"construct": "עֲצֵ֣י",
"construct_consonants": "עצי",
"absolute": "שִׁטִּ֑ים",
"absolute_consonants": "שטים"
}
]
}
+9
View File
@@ -125,5 +125,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 6,
"construct": "צַלְעֹ֣ת",
"construct_consonants": "צלעת",
"absolute": "הָאָרֹ֑ן",
"absolute_consonants": "הארן"
}
]
}
+9
View File
@@ -83,5 +83,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "בְּטַבְּעֹת֙",
"construct_consonants": "בטבעת",
"absolute": "הָאָרֹ֔ן",
"absolute_consonants": "הארן"
}
]
}
+9
View File
@@ -118,5 +118,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 2,
"construct": "כַפֹּ֖רֶת",
"construct_consonants": "כפרת",
"absolute": "זָהָ֣ב",
"absolute_consonants": "זהב"
}
]
}
+16
View File
@@ -117,5 +117,21 @@
"prefix": "ה",
"shoresh": "כפר"
}
],
"smikhut": [
{
"position": 8,
"construct": "מִשְּׁנֵ֖י",
"construct_consonants": "משני",
"absolute": "קְצ֥וֹת",
"absolute_consonants": "קצות"
},
{
"position": 9,
"construct": "קְצ֥וֹת",
"construct_consonants": "קצות",
"absolute": "הַכַּפֹּֽרֶת",
"absolute_consonants": "הכפרת"
}
]
}
+9
View File
@@ -186,5 +186,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 16,
"construct": "שְׁנֵ֥י",
"construct_consonants": "שני",
"absolute": "קְצוֹתָֽיו",
"absolute_consonants": "קצותיו"
}
]
}
+16
View File
@@ -167,5 +167,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֔ל",
"absolute_consonants": "ישראל"
},
{
"position": 9,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "אִישׁ֙",
"absolute_consonants": "איש"
}
]
}
+9
View File
@@ -198,5 +198,14 @@
"prefix": "ה",
"shoresh": "כרב"
}
],
"smikhut": [
{
"position": 17,
"construct": "פְּנֵ֥י",
"construct_consonants": "פני",
"absolute": "הַכְּרֻבִֽים",
"absolute_consonants": "הכרבים"
}
]
}
+30
View File
@@ -238,5 +238,35 @@
],
"shoresh": "ישר"
}
],
"smikhut": [
{
"position": 9,
"construct": "שְׁנֵ֣י",
"construct_consonants": "שני",
"absolute": "הַכְּרֻבִ֔ים",
"absolute_consonants": "הכרבים"
},
{
"position": 13,
"construct": "אֲרֹ֣ן",
"construct_consonants": "ארן",
"absolute": "הָעֵדֻ֑ת",
"absolute_consonants": "העדת"
},
{
"position": 16,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "אֲשֶׁ֧ר",
"absolute_consonants": "אשר"
},
{
"position": 21,
"construct": "בְּנֵ֥י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵֽל",
"absolute_consonants": "ישראל"
}
]
}
+9
View File
@@ -127,5 +127,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 3,
"construct": "עֲצֵ֣י",
"construct_consonants": "עצי",
"absolute": "שִׁטִּ֑ים",
"absolute_consonants": "שטים"
}
]
}
+9
View File
@@ -104,5 +104,14 @@
],
"shoresh": "סבי"
}
],
"smikhut": [
{
"position": 7,
"construct": "זֵ֥ר",
"construct_consonants": "זר",
"absolute": "זָהָ֖ב",
"absolute_consonants": "זהב"
}
]
}
+16
View File
@@ -114,5 +114,21 @@
],
"shoresh": "סבי"
}
],
"smikhut": [
{
"position": 3,
"construct": "מִסְגֶּ֛רֶת",
"construct_consonants": "מסגרת",
"absolute": "טֹ֖פַח",
"absolute_consonants": "טפח"
},
{
"position": 7,
"construct": "זֵר",
"construct_consonants": "זר",
"absolute": "זָהָ֛ב",
"absolute_consonants": "זהב"
}
]
}
+9
View File
@@ -157,5 +157,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 4,
"construct": "טַבְּעֹ֣ת",
"construct_consonants": "טבעת",
"absolute": "זָהָ֑ב",
"absolute_consonants": "זהב"
}
]
}
+9
View File
@@ -108,5 +108,14 @@
"prefix": "ה",
"shoresh": "שלח"
}
],
"smikhut": [
{
"position": 1,
"construct": "לְעֻמַּת֙",
"construct_consonants": "לעמת",
"absolute": "הַמִּסְגֶּ֔רֶת",
"absolute_consonants": "המסגרת"
}
]
}
+9
View File
@@ -132,5 +132,14 @@
"prefix": "ה",
"shoresh": "שלח"
}
],
"smikhut": [
{
"position": 4,
"construct": "עֲצֵ֣י",
"construct_consonants": "עצי",
"absolute": "שִׁטִּ֔ים",
"absolute_consonants": "שטים"
}
]
}
+9
View File
@@ -83,5 +83,14 @@
],
"shoresh": "תמי"
}
],
"smikhut": [
{
"position": 4,
"construct": "לֶ֥חֶם",
"construct_consonants": "לחם",
"absolute": "פָּנִ֖ים",
"absolute_consonants": "פנים"
}
]
}
+9
View File
@@ -157,5 +157,14 @@
],
"shoresh": "היו"
}
],
"smikhut": [
{
"position": 2,
"construct": "מְנֹרַ֖ת",
"construct_consonants": "מנרת",
"absolute": "זָהָ֣ב",
"absolute_consonants": "זהב"
}
]
}
+16
View File
@@ -163,5 +163,21 @@
"prefix": "ה",
"shoresh": "שני"
}
],
"smikhut": [
{
"position": 6,
"construct": "קְנֵ֣י",
"construct_consonants": "קני",
"absolute": "מְנֹרָ֗ה",
"absolute_consonants": "מנרה"
},
{
"position": 11,
"construct": "קְנֵ֣י",
"construct_consonants": "קני",
"absolute": "מְנֹרָ֔ה",
"absolute_consonants": "מנרה"
}
]
}
+9
View File
@@ -233,5 +233,14 @@
"prefix": "ה",
"shoresh": "מנר"
}
],
"smikhut": [
{
"position": 16,
"construct": "לְשֵׁ֣שֶׁת",
"construct_consonants": "לששת",
"absolute": "הַקָּנִ֔ים",
"absolute_consonants": "הקנים"
}
]
}
+30
View File
@@ -225,5 +225,35 @@
"prefix": "ה",
"shoresh": "מנר"
}
],
"smikhut": [
{
"position": 3,
"construct": "שְׁנֵ֨י",
"construct_consonants": "שני",
"absolute": "הַקָּנִ֜ים",
"absolute_consonants": "הקנים"
},
{
"position": 8,
"construct": "שְׁנֵ֤י",
"construct_consonants": "שני",
"absolute": "הַקָּנִים֙",
"absolute_consonants": "הקנים"
},
{
"position": 13,
"construct": "שְׁנֵ֥י",
"construct_consonants": "שני",
"absolute": "הַקָּנִ֖ים",
"absolute_consonants": "הקנים"
},
{
"position": 16,
"construct": "לְשֵׁ֨שֶׁת֙",
"construct_consonants": "לששת",
"absolute": "הַקָּנִ֔ים",
"absolute_consonants": "הקנים"
}
]
}
+9
View File
@@ -119,5 +119,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 10,
"construct": "עֵ֥בֶר",
"construct_consonants": "עבר",
"absolute": "פָּנֶֽיהָ",
"absolute_consonants": "פניה"
}
]
}
+9
View File
@@ -101,5 +101,14 @@
],
"prefix": "ה"
}
],
"smikhut": [
{
"position": 7,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הַכֵּלִ֖ים",
"absolute_consonants": "הכלים"
}
]
}
+9
View File
@@ -76,5 +76,14 @@
"prefix": "ו",
"shoresh": "עז"
}
],
"smikhut": [
{
"position": 3,
"construct": "וְתוֹלַ֥עַת",
"construct_consonants": "ותולעת",
"absolute": "שָׁנִ֖י",
"absolute_consonants": "שני"
}
]
}
+23
View File
@@ -85,5 +85,28 @@
],
"shoresh": "שט"
}
],
"smikhut": [
{
"position": 1,
"construct": "וְעֹרֹ֨ת",
"construct_consonants": "וערת",
"absolute": "אֵילִ֧ם",
"absolute_consonants": "אילם"
},
{
"position": 4,
"construct": "וְעֹרֹ֥ת",
"construct_consonants": "וערת",
"absolute": "תְּחָשִׁ֖ים",
"absolute_consonants": "תחשים"
},
{
"position": 6,
"construct": "וַעֲצֵ֥י",
"construct_consonants": "ועצי",
"absolute": "שִׁטִּֽים",
"absolute_consonants": "שטים"
}
]
}
+16
View File
@@ -87,5 +87,21 @@
"prefix": "ה",
"shoresh": "סמ"
}
],
"smikhut": [
{
"position": 4,
"construct": "לְשֶׁ֣מֶן",
"construct_consonants": "לשמן",
"absolute": "הַמִּשְׁחָ֔ה",
"absolute_consonants": "המשחה"
},
{
"position": 6,
"construct": "וְלִקְטֹ֖רֶת",
"construct_consonants": "ולקטרת",
"absolute": "הַסַּמִּֽים",
"absolute_consonants": "הסמים"
}
]
}
+16
View File
@@ -72,5 +72,21 @@
"prefix": "ול",
"shoresh": "חשן"
}
],
"smikhut": [
{
"position": 1,
"construct": "אַבְנֵי",
"construct_consonants": "אבני",
"absolute": "שֹׁ֕הַם",
"absolute_consonants": "שהם"
},
{
"position": 3,
"construct": "וְאַבְנֵ֖י",
"construct_consonants": "ואבני",
"absolute": "מִלֻּאִ֑ים",
"absolute_consonants": "מלאים"
}
]
}
+23
View File
@@ -154,5 +154,28 @@
],
"shoresh": "עשו"
}
],
"smikhut": [
{
"position": 7,
"construct": "תַּבְנִ֣ית",
"construct_consonants": "תבנית",
"absolute": "הַמִּשְׁכָּ֔ן",
"absolute_consonants": "המשכן"
},
{
"position": 10,
"construct": "תַּבְנִ֣ית",
"construct_consonants": "תבנית",
"absolute": "כָּל",
"absolute_consonants": "כל"
},
{
"position": 11,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "כֵּלָ֑יו",
"absolute_consonants": "כליו"
}
]
}