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
@@ -117,5 +117,14 @@
],
"prefix": "ה"
}
],
"smikhut": [
{
"position": 2,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הָ֣עֵדָ֔ה",
"absolute_consonants": "העדה"
}
]
}
+37
View File
@@ -172,5 +172,42 @@
],
"shoresh": "ישר"
}
],
"smikhut": [
{
"position": 2,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הָ֣עֵדָ֔ה",
"absolute_consonants": "העדה"
},
{
"position": 7,
"construct": "וּכְב֣וֹד",
"construct_consonants": "וכבוד",
"absolute": "יְהוָ֗ה",
"absolute_consonants": "יהוה"
},
{
"position": 10,
"construct": "בְּאֹ֣הֶל",
"construct_consonants": "באהל",
"absolute": "מוֹעֵ֔ד",
"absolute_consonants": "מועד"
},
{
"position": 13,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "בְּנֵ֖י",
"absolute_consonants": "בני"
},
{
"position": 14,
"construct": "בְּנֵ֖י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵֽל",
"absolute_consonants": "ישראל"
}
]
}
+9
View File
@@ -206,5 +206,14 @@
],
"prefix": "ב"
}
],
"smikhut": [
{
"position": 15,
"construct": "בְּכֹל֙",
"construct_consonants": "בכל",
"absolute": "הָֽאֹת֔וֹת",
"absolute_consonants": "האתות"
}
]
}
+23
View File
@@ -333,5 +333,28 @@
],
"shoresh": "ליל"
}
],
"smikhut": [
{
"position": 10,
"construct": "בְּקֶ֖רֶב",
"construct_consonants": "בקרב",
"absolute": "הָעָ֣ם",
"absolute_consonants": "העם"
},
{
"position": 22,
"construct": "וּבְעַמֻּ֣ד",
"construct_consonants": "ובעמד",
"absolute": "עָנָ֗ן",
"absolute_consonants": "ענן"
},
{
"position": 28,
"construct": "וּבְעַמּ֥וּד",
"construct_consonants": "ובעמוד",
"absolute": "אֵ֖שׁ",
"absolute_consonants": "אש"
}
]
}
+9
View File
@@ -91,5 +91,14 @@
"prefix": "ל",
"shoresh": "אמר"
}
],
"smikhut": [
{
"position": 4,
"construct": "כֹּ֣חַ",
"construct_consonants": "כח",
"absolute": "אֲדֹנָ֑י",
"absolute_consonants": "אדני"
}
]
}
+23
View File
@@ -218,5 +218,28 @@
],
"shoresh": "רבע"
}
],
"smikhut": [
{
"position": 2,
"construct": "אֶ֤רֶךְ",
"construct_consonants": "ארך",
"absolute": "אַפַּ֨יִם֙",
"absolute_consonants": "אפים"
},
{
"position": 4,
"construct": "וְרַב",
"construct_consonants": "ורב",
"absolute": "חֶ֔סֶד",
"absolute_consonants": "חסד"
},
{
"position": 13,
"construct": "עֲוֺ֤ן",
"construct_consonants": "עון",
"absolute": "אָבוֹת֙",
"absolute_consonants": "אבות"
}
]
}
+16
View File
@@ -161,5 +161,21 @@
],
"shoresh": "הנה"
}
],
"smikhut": [
{
"position": 3,
"construct": "לַעֲוֺ֛ן",
"construct_consonants": "לעון",
"absolute": "הָעָ֥ם",
"absolute_consonants": "העם"
},
{
"position": 6,
"construct": "כְּגֹ֣דֶל",
"construct_consonants": "כגדל",
"absolute": "חַסְדֶּ֑ךָ",
"absolute_consonants": "חסדך"
}
]
}
+30
View File
@@ -231,5 +231,35 @@
],
"shoresh": "מת"
}
],
"smikhut": [
{
"position": 6,
"construct": "כֹּ֖ל",
"construct_consonants": "כל",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 7,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֑ל",
"absolute_consonants": "ישראל"
},
{
"position": 11,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הָעֵדָ֗ה",
"absolute_consonants": "העדה"
},
{
"position": 15,
"construct": "בְּאֶ֣רֶץ",
"construct_consonants": "בארץ",
"absolute": "מִצְרַ֔יִם",
"absolute_consonants": "מצרים"
}
]
}
+16
View File
@@ -97,5 +97,21 @@
"prefix": "ה",
"shoresh": "ארץ"
}
],
"smikhut": [
{
"position": 5,
"construct": "כְבוֹד",
"construct_consonants": "כבוד",
"absolute": "יְהוָ֖ה",
"absolute_consonants": "יהוה"
},
{
"position": 8,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הָאָֽרֶץ",
"absolute_consonants": "הארץ"
}
]
}
+9
View File
@@ -216,5 +216,14 @@
],
"prefix": "ב"
}
],
"smikhut": [
{
"position": 2,
"construct": "כָל",
"construct_consonants": "כל",
"absolute": "הָאֲנָשִׁ֗ים",
"absolute_consonants": "האנשים"
}
]
}
+9
View File
@@ -116,5 +116,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 8,
"construct": "וְכָל",
"construct_consonants": "וכל",
"absolute": "מְנַאֲצַ֖י",
"absolute_consonants": "מנאצי"
}
]
}
+16
View File
@@ -141,5 +141,21 @@
],
"shoresh": "סוף"
}
],
"smikhut": [
{
"position": 10,
"construct": "דֶּ֥רֶךְ",
"construct_consonants": "דרך",
"absolute": "יַם",
"absolute_consonants": "ים"
},
{
"position": 11,
"construct": "יַם",
"construct_consonants": "ים",
"absolute": "סֽוּף",
"absolute_consonants": "סוף"
}
]
}
+16
View File
@@ -193,5 +193,21 @@
],
"shoresh": "שמע"
}
],
"smikhut": [
{
"position": 11,
"construct": "תְּלֻנּ֞וֹת",
"construct_consonants": "תלנות",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 12,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֗ל",
"absolute_consonants": "ישראל"
}
]
}
+9
View File
@@ -149,5 +149,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 5,
"construct": "נְאֻם",
"construct_consonants": "נאם",
"absolute": "יְהוָ֔ה",
"absolute_consonants": "יהוה"
}
]
}
+23
View File
@@ -166,5 +166,28 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 5,
"construct": "וְכָל",
"construct_consonants": "וכל",
"absolute": "פְּקֻדֵיכֶם֙",
"absolute_consonants": "פקדיכם"
},
{
"position": 7,
"construct": "לְכָל",
"construct_consonants": "לכל",
"absolute": "מִסְפַּרְכֶ֔ם",
"absolute_consonants": "מספרכם"
},
{
"position": 9,
"construct": "מִבֶּ֛ן",
"construct_consonants": "מבן",
"absolute": "עֶשְׂרִ֥ים",
"absolute_consonants": "עשרים"
}
]
}
+16
View File
@@ -207,5 +207,21 @@
],
"shoresh": "נון"
}
],
"smikhut": [
{
"position": 16,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "יְפֻנֶּ֔ה",
"absolute_consonants": "יפנה"
},
{
"position": 19,
"construct": "בִּן",
"construct_consonants": "בן",
"absolute": "נֽוּן",
"absolute_consonants": "נון"
}
]
}
+9
View File
@@ -219,5 +219,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "בְּמִסְפַּ֨ר",
"construct_consonants": "במספר",
"absolute": "הַיָּמִ֜ים",
"absolute_consonants": "הימים"
}
]
}
+9
View File
@@ -202,5 +202,14 @@
],
"shoresh": "מתו"
}
],
"smikhut": [
{
"position": 8,
"construct": "לְכָל",
"construct_consonants": "לכל",
"absolute": "הָעֵדָ֤ה",
"absolute_consonants": "העדה"
}
]
}
+18
View File
@@ -185,5 +185,23 @@
"prefix": "ה",
"shoresh": "ארץ"
}
],
"ketiv_qere": [
{
"word_position": 9,
"ketiv": "וילונו",
"ketiv_consonants": "וילונו",
"qere": "וַיַּלִּ֤ינוּ",
"qere_consonants": "וילינו"
}
],
"smikhut": [
{
"position": 12,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הָ֣עֵדָ֔ה",
"absolute_consonants": "העדה"
}
]
}
+16
View File
@@ -109,5 +109,21 @@
],
"shoresh": "יהו"
}
],
"smikhut": [
{
"position": 4,
"construct": "דִבַּת",
"construct_consonants": "דבת",
"absolute": "הָאָ֖רֶץ",
"absolute_consonants": "הארץ"
},
{
"position": 8,
"construct": "לִפְנֵ֥י",
"construct_consonants": "לפני",
"absolute": "יְהוָֽה",
"absolute_consonants": "יהוה"
}
]
}
+16
View File
@@ -156,5 +156,21 @@
"prefix": "ה",
"shoresh": "ארץ"
}
],
"smikhut": [
{
"position": 2,
"construct": "בִּן",
"construct_consonants": "בן",
"absolute": "נ֔וּן",
"absolute_consonants": "נון"
},
{
"position": 5,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "יְפֻנֶּ֑ה",
"absolute_consonants": "יפנה"
}
]
}
+16
View File
@@ -136,5 +136,21 @@
],
"shoresh": "מאד"
}
],
"smikhut": [
{
"position": 7,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "בְּנֵ֖י",
"absolute_consonants": "בני"
},
{
"position": 8,
"construct": "בְּנֵ֖י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֑ל",
"absolute_consonants": "ישראל"
}
]
}
+9
View File
@@ -176,5 +176,14 @@
],
"shoresh": "חטא"
}
],
"smikhut": [
{
"position": 5,
"construct": "רֹאשׁ",
"construct_consonants": "ראש",
"absolute": "הָהָ֖ר",
"absolute_consonants": "ההר"
}
]
}
+9
View File
@@ -132,5 +132,14 @@
],
"shoresh": "צלח"
}
],
"smikhut": [
{
"position": 8,
"construct": "פִּ֣י",
"construct_consonants": "פי",
"absolute": "יְהוָ֑ה",
"absolute_consonants": "יהוה"
}
]
}
+9
View File
@@ -113,5 +113,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 9,
"construct": "לִפְנֵ֖י",
"construct_consonants": "לפני",
"absolute": "אֹיְבֵיכֶֽם",
"absolute_consonants": "איביכם"
}
]
}
+30
View File
@@ -148,5 +148,35 @@
"prefix": "ה",
"shoresh": "מחנ"
}
],
"smikhut": [
{
"position": 4,
"construct": "רֹ֣אשׁ",
"construct_consonants": "ראש",
"absolute": "הָהָ֑ר",
"absolute_consonants": "ההר"
},
{
"position": 6,
"construct": "וַאֲר֤וֹן",
"construct_consonants": "וארון",
"absolute": "בְּרִית",
"absolute_consonants": "ברית"
},
{
"position": 7,
"construct": "בְּרִית",
"construct_consonants": "ברית",
"absolute": "יְהוָה֙",
"absolute_consonants": "יהוה"
},
{
"position": 12,
"construct": "מִקֶּ֥רֶב",
"construct_consonants": "מקרב",
"absolute": "הַֽמַּחֲנֶֽה",
"absolute_consonants": "המחנה"
}
]
}
+37
View File
@@ -123,5 +123,42 @@
],
"shoresh": "ישר"
}
],
"smikhut": [
{
"position": 6,
"construct": "לִפְנֵ֕י",
"construct_consonants": "לפני",
"absolute": "כָּל",
"absolute_consonants": "כל"
},
{
"position": 7,
"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": "ישראל"
}
]
}
+16
View File
@@ -130,5 +130,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 2,
"construct": "בִּן",
"construct_consonants": "בן",
"absolute": "נ֗וּן",
"absolute_consonants": "נון"
},
{
"position": 5,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "יְפֻנֶּ֔ה",
"absolute_consonants": "יפנה"
}
]
}
+23
View File
@@ -190,5 +190,28 @@
],
"shoresh": "מאד"
}
],
"smikhut": [
{
"position": 3,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "עֲדַ֥ת",
"absolute_consonants": "עדת"
},
{
"position": 4,
"construct": "עֲדַ֥ת",
"construct_consonants": "עדת",
"absolute": "בְּנֵֽי",
"absolute_consonants": "בני"
},
{
"position": 5,
"construct": "בְּנֵֽי",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֖ל",
"absolute_consonants": "ישראל"
}
]
}
+9
View File
@@ -212,5 +212,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 9,
"construct": "עַ֣ם",
"construct_consonants": "עם",
"absolute": "הָאָ֔רֶץ",
"absolute_consonants": "הארץ"
}
]
}