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

+30
View File
@@ -227,5 +227,35 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "וּבְי֨וֹם",
"construct_consonants": "וביום",
"absolute": "שִׂמְחַתְכֶ֥ם",
"absolute_consonants": "שמחתכם"
},
{
"position": 4,
"construct": "וּבְרָאשֵׁ֣י",
"construct_consonants": "ובראשי",
"absolute": "חָדְשֵׁיכֶם֒",
"absolute_consonants": "חדשיכם"
},
{
"position": 11,
"construct": "זִבְחֵ֣י",
"construct_consonants": "זבחי",
"absolute": "שַׁלְמֵיכֶ֑ם",
"absolute_consonants": "שלמיכם"
},
{
"position": 16,
"construct": "לִפְנֵ֣י",
"construct_consonants": "לפני",
"absolute": "אֱלֹֽהֵיכֶ֔ם",
"absolute_consonants": "אלהיכם"
}
]
}
+9
View File
@@ -147,5 +147,14 @@
"prefix": "ה",
"shoresh": "עדת"
}
],
"smikhut": [
{
"position": 11,
"construct": "מִשְׁכַּ֥ן",
"construct_consonants": "משכן",
"absolute": "הָעֵדֻֽת",
"absolute_consonants": "העדת"
}
]
}
+23
View File
@@ -120,5 +120,28 @@
],
"shoresh": "פאר"
}
],
"smikhut": [
{
"position": 2,
"construct": "בְנֵֽי",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֛ל",
"absolute_consonants": "ישראל"
},
{
"position": 5,
"construct": "מִמִּדְבַּ֣ר",
"construct_consonants": "ממדבר",
"absolute": "סִינָ֑י",
"absolute_consonants": "סיני"
},
{
"position": 9,
"construct": "בְּמִדְבַּ֥ר",
"construct_consonants": "במדבר",
"absolute": "פָּארָֽן",
"absolute_consonants": "פארן"
}
]
}
+16
View File
@@ -80,5 +80,21 @@
],
"shoresh": "משה"
}
],
"smikhut": [
{
"position": 4,
"construct": "פִּ֥י",
"construct_consonants": "פי",
"absolute": "יְהוָ֖ה",
"absolute_consonants": "יהוה"
},
{
"position": 6,
"construct": "בְּיַד",
"construct_consonants": "ביד",
"absolute": "מֹשֶֽׁה",
"absolute_consonants": "משה"
}
]
}
+30
View File
@@ -134,5 +134,35 @@
],
"shoresh": "עמי"
}
],
"smikhut": [
{
"position": 2,
"construct": "דֶּ֣גֶל",
"construct_consonants": "דגל",
"absolute": "מַחֲנֵ֧ה",
"absolute_consonants": "מחנה"
},
{
"position": 3,
"construct": "מַחֲנֵ֧ה",
"construct_consonants": "מחנה",
"absolute": "בְנֵֽי",
"absolute_consonants": "בני"
},
{
"position": 4,
"construct": "בְנֵֽי",
"construct_consonants": "בני",
"absolute": "יְהוּדָ֛ה",
"absolute_consonants": "יהודה"
},
{
"position": 11,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "עַמִּינָדָֽב",
"absolute_consonants": "עמינדב"
}
]
}
+30
View File
@@ -91,5 +91,35 @@
],
"shoresh": "צוע"
}
],
"smikhut": [
{
"position": 2,
"construct": "צְבָ֔א",
"construct_consonants": "צבא",
"absolute": "מַטֵּ֖ה",
"absolute_consonants": "מטה"
},
{
"position": 3,
"construct": "מַטֵּ֖ה",
"construct_consonants": "מטה",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 4,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשָׂשכָ֑ר",
"absolute_consonants": "יששכר"
},
{
"position": 7,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "צוּעָֽר",
"absolute_consonants": "צוער"
}
]
}
+30
View File
@@ -91,5 +91,35 @@
],
"shoresh": "חלו"
}
],
"smikhut": [
{
"position": 2,
"construct": "צְבָ֔א",
"construct_consonants": "צבא",
"absolute": "מַטֵּ֖ה",
"absolute_consonants": "מטה"
},
{
"position": 3,
"construct": "מַטֵּ֖ה",
"construct_consonants": "מטה",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 4,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "זְבוּלֻ֑ן",
"absolute_consonants": "זבולן"
},
{
"position": 7,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "חֵלֽוֹן",
"absolute_consonants": "חלון"
}
]
}
+16
View File
@@ -109,5 +109,21 @@
"prefix": "ה",
"shoresh": "משכ"
}
],
"smikhut": [
{
"position": 4,
"construct": "בְנֵֽי",
"construct_consonants": "בני",
"absolute": "גֵרְשׁוֹן֙",
"absolute_consonants": "גרשון"
},
{
"position": 6,
"construct": "וּבְנֵ֣י",
"construct_consonants": "ובני",
"absolute": "מְרָרִ֔י",
"absolute_consonants": "מררי"
}
]
}
+23
View File
@@ -111,5 +111,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": "שדיאור"
}
]
}
+30
View File
@@ -103,5 +103,35 @@
],
"shoresh": "שדי"
}
],
"smikhut": [
{
"position": 2,
"construct": "צְבָ֔א",
"construct_consonants": "צבא",
"absolute": "מַטֵּ֖ה",
"absolute_consonants": "מטה"
},
{
"position": 3,
"construct": "מַטֵּ֖ה",
"construct_consonants": "מטה",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 4,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "שִׁמְע֑וֹן",
"absolute_consonants": "שמעון"
},
{
"position": 7,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "צוּרִֽי",
"absolute_consonants": "צורי"
}
]
}
+23
View File
@@ -172,5 +172,28 @@
"prefix": "ה",
"shoresh": "מחנ"
}
],
"smikhut": [
{
"position": 3,
"construct": "שְׁתֵּי֙",
"construct_consonants": "שתי",
"absolute": "חֲצֽוֹצְרֹ֣ת",
"absolute_consonants": "חצוצרת"
},
{
"position": 4,
"construct": "חֲצֽוֹצְרֹ֣ת",
"construct_consonants": "חצוצרת",
"absolute": "כֶּ֔סֶף",
"absolute_consonants": "כסף"
},
{
"position": 11,
"construct": "לְמִקְרָ֣א",
"construct_consonants": "למקרא",
"absolute": "הָֽעֵדָ֔ה",
"absolute_consonants": "העדה"
}
]
}
+30
View File
@@ -87,5 +87,35 @@
],
"shoresh": "דעו"
}
],
"smikhut": [
{
"position": 2,
"construct": "צְבָ֖א",
"construct_consonants": "צבא",
"absolute": "מַטֵּ֣ה",
"absolute_consonants": "מטה"
},
{
"position": 3,
"construct": "מַטֵּ֣ה",
"construct_consonants": "מטה",
"absolute": "בְנֵי",
"absolute_consonants": "בני"
},
{
"position": 4,
"construct": "בְנֵי",
"construct_consonants": "בני",
"absolute": "גָ֑ד",
"absolute_consonants": "גד"
},
{
"position": 7,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "דְּעוּאֵֽל",
"absolute_consonants": "דעואל"
}
]
}
+30
View File
@@ -122,5 +122,35 @@
],
"shoresh": "עמי"
}
],
"smikhut": [
{
"position": 2,
"construct": "דֶּ֛גֶל",
"construct_consonants": "דגל",
"absolute": "מַחֲנֵ֥ה",
"absolute_consonants": "מחנה"
},
{
"position": 3,
"construct": "מַחֲנֵ֥ה",
"construct_consonants": "מחנה",
"absolute": "בְנֵֽי",
"absolute_consonants": "בני"
},
{
"position": 4,
"construct": "בְנֵֽי",
"construct_consonants": "בני",
"absolute": "אֶפְרַ֖יִם",
"absolute_consonants": "אפרים"
},
{
"position": 10,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "עַמִּיהֽוּד",
"absolute_consonants": "עמיהוד"
}
]
}
+30
View File
@@ -100,5 +100,35 @@
],
"shoresh": "צור"
}
],
"smikhut": [
{
"position": 2,
"construct": "צְבָ֔א",
"construct_consonants": "צבא",
"absolute": "מַטֵּ֖ה",
"absolute_consonants": "מטה"
},
{
"position": 3,
"construct": "מַטֵּ֖ה",
"construct_consonants": "מטה",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 4,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "מְנַשֶּׁ֑ה",
"absolute_consonants": "מנשה"
},
{
"position": 7,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "פְּדָה",
"absolute_consonants": "פדה"
}
]
}
+30
View File
@@ -91,5 +91,35 @@
],
"shoresh": "גדע"
}
],
"smikhut": [
{
"position": 2,
"construct": "צְבָ֔א",
"construct_consonants": "צבא",
"absolute": "מַטֵּ֖ה",
"absolute_consonants": "מטה"
},
{
"position": 3,
"construct": "מַטֵּ֖ה",
"construct_consonants": "מטה",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 4,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "בִנְיָמִ֑ן",
"absolute_consonants": "בנימן"
},
{
"position": 7,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "גִּדְעוֹנִֽי",
"absolute_consonants": "גדעוני"
}
]
}
+37
View File
@@ -154,5 +154,42 @@
],
"shoresh": "עמי"
}
],
"smikhut": [
{
"position": 2,
"construct": "דֶּ֚גֶל",
"construct_consonants": "דגל",
"absolute": "מַחֲנֵ֣ה",
"absolute_consonants": "מחנה"
},
{
"position": 3,
"construct": "מַחֲנֵ֣ה",
"construct_consonants": "מחנה",
"absolute": "בְנֵי",
"absolute_consonants": "בני"
},
{
"position": 4,
"construct": "בְנֵי",
"construct_consonants": "בני",
"absolute": "דָ֔ן",
"absolute_consonants": "דן"
},
{
"position": 7,
"construct": "לְכָל",
"construct_consonants": "לכל",
"absolute": "הַֽמַּחֲנֹ֖ת",
"absolute_consonants": "המחנת"
},
{
"position": 13,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "עַמִּישַׁדָּֽי",
"absolute_consonants": "עמישדי"
}
]
}
+30
View File
@@ -89,5 +89,35 @@
],
"shoresh": "עכר"
}
],
"smikhut": [
{
"position": 2,
"construct": "צְבָ֔א",
"construct_consonants": "צבא",
"absolute": "מַטֵּ֖ה",
"absolute_consonants": "מטה"
},
{
"position": 3,
"construct": "מַטֵּ֖ה",
"construct_consonants": "מטה",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 4,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "אָשֵׁ֑ר",
"absolute_consonants": "אשר"
},
{
"position": 7,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "עָכְרָֽן",
"absolute_consonants": "עכרן"
}
]
}
+30
View File
@@ -91,5 +91,35 @@
],
"shoresh": "עינ"
}
],
"smikhut": [
{
"position": 2,
"construct": "צְבָ֔א",
"construct_consonants": "צבא",
"absolute": "מַטֵּ֖ה",
"absolute_consonants": "מטה"
},
{
"position": 3,
"construct": "מַטֵּ֖ה",
"construct_consonants": "מטה",
"absolute": "בְּנֵ֣י",
"absolute_consonants": "בני"
},
{
"position": 4,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "נַפְתָּלִ֑י",
"absolute_consonants": "נפתלי"
},
{
"position": 7,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "עֵינָֽן",
"absolute_consonants": "עינן"
}
]
}
+16
View File
@@ -71,5 +71,21 @@
"prefix": "ו",
"shoresh": "סעו"
}
],
"smikhut": [
{
"position": 2,
"construct": "מַסְעֵ֥י",
"construct_consonants": "מסעי",
"absolute": "בְנֵֽי",
"absolute_consonants": "בני"
},
{
"position": 3,
"construct": "בְנֵֽי",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֖ל",
"absolute_consonants": "ישראל"
}
]
}
+9
View File
@@ -301,5 +301,14 @@
],
"shoresh": "ישר"
}
],
"smikhut": [
{
"position": 4,
"construct": "בֶּן",
"construct_consonants": "בן",
"absolute": "רְעוּאֵ֣ל",
"absolute_consonants": "רעואל"
}
]
}
+23
View File
@@ -114,5 +114,28 @@
],
"shoresh": "מוע"
}
],
"smikhut": [
{
"position": 5,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הָ֣עֵדָ֔ה",
"absolute_consonants": "העדה"
},
{
"position": 8,
"construct": "פֶּ֖תַח",
"construct_consonants": "פתח",
"absolute": "אֹ֥הֶל",
"absolute_consonants": "אהל"
},
{
"position": 9,
"construct": "אֹ֥הֶל",
"construct_consonants": "אהל",
"absolute": "מוֹעֵֽד",
"absolute_consonants": "מועד"
}
]
}
+51
View File
@@ -193,5 +193,56 @@
],
"shoresh": "מנו"
}
],
"smikhut": [
{
"position": 2,
"construct": "מֵהַ֣ר",
"construct_consonants": "מהר",
"absolute": "יְהוָ֔ה",
"absolute_consonants": "יהוה"
},
{
"position": 4,
"construct": "דֶּ֖רֶךְ",
"construct_consonants": "דרך",
"absolute": "שְׁלֹ֣שֶׁת",
"absolute_consonants": "שלשת"
},
{
"position": 5,
"construct": "שְׁלֹ֣שֶׁת",
"construct_consonants": "שלשת",
"absolute": "יָמִ֑ים",
"absolute_consonants": "ימים"
},
{
"position": 7,
"construct": "וַאֲר֨וֹן",
"construct_consonants": "וארון",
"absolute": "בְּרִית",
"absolute_consonants": "ברית"
},
{
"position": 8,
"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
@@ -81,5 +81,14 @@
"prefix": "ה",
"shoresh": "מחנ"
}
],
"smikhut": [
{
"position": 1,
"construct": "וַעֲנַ֧ן",
"construct_consonants": "וענן",
"absolute": "יְהוָ֛ה",
"absolute_consonants": "יהוה"
}
]
}
+16
View File
@@ -82,5 +82,21 @@
],
"shoresh": "ישר"
}
],
"smikhut": [
{
"position": 5,
"construct": "רִֽבְב֖וֹת",
"construct_consonants": "רבבות",
"absolute": "אַלְפֵ֥י",
"absolute_consonants": "אלפי"
},
{
"position": 6,
"construct": "אַלְפֵ֥י",
"construct_consonants": "אלפי",
"absolute": "יִשְׂרָאֵֽל",
"absolute_consonants": "ישראל"
}
]
}
+16
View File
@@ -105,5 +105,21 @@
],
"shoresh": "ישר"
}
],
"smikhut": [
{
"position": 7,
"construct": "רָאשֵׁ֖י",
"construct_consonants": "ראשי",
"absolute": "אַלְפֵ֥י",
"absolute_consonants": "אלפי"
},
{
"position": 8,
"construct": "אַלְפֵ֥י",
"construct_consonants": "אלפי",
"absolute": "יִשְׂרָאֵֽל",
"absolute_consonants": "ישראל"
}
]
}
+16
View File
@@ -121,5 +121,21 @@
],
"prefix": "ל"
}
],
"smikhut": [
{
"position": 1,
"construct": "וּבְנֵ֤י",
"construct_consonants": "ובני",
"absolute": "אַהֲרֹן֙",
"absolute_consonants": "אהרן"
},
{
"position": 8,
"construct": "לְחֻקַּ֥ת",
"construct_consonants": "לחקת",
"absolute": "עוֹלָ֖ם",
"absolute_consonants": "עולם"
}
]
}
+9
View File
@@ -184,5 +184,14 @@
],
"prefix": "מ"
}
],
"smikhut": [
{
"position": 12,
"construct": "לִפְנֵי֙",
"construct_consonants": "לפני",
"absolute": "יְהוָ֣ה",
"absolute_consonants": "יהוה"
}
]
}