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

+23
View File
@@ -127,5 +127,28 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "עֶרְוַ֤ת",
"construct_consonants": "ערות",
"absolute": "בַּת",
"absolute_consonants": "בת"
},
{
"position": 2,
"construct": "בַּת",
"construct_consonants": "בת",
"absolute": "בִּנְךָ֙",
"absolute_consonants": "בנך"
},
{
"position": 5,
"construct": "בַֽת",
"construct_consonants": "בת",
"absolute": "בִּתְּךָ֔",
"absolute_consonants": "בתך"
}
]
}
+30
View File
@@ -119,5 +119,35 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "עֶרְוַ֨ת",
"construct_consonants": "ערות",
"absolute": "בַּת",
"absolute_consonants": "בת"
},
{
"position": 2,
"construct": "בַּת",
"construct_consonants": "בת",
"absolute": "אֵ֤שֶׁת",
"absolute_consonants": "אשת"
},
{
"position": 3,
"construct": "אֵ֤שֶׁת",
"construct_consonants": "אשת",
"absolute": "אָבִ֨יךָ֙",
"absolute_consonants": "אביך"
},
{
"position": 5,
"construct": "מוֹלֶ֣דֶת",
"construct_consonants": "מולדת",
"absolute": "אָבִ֔יךָ",
"absolute_consonants": "אביך"
}
]
}
+23
View File
@@ -87,5 +87,28 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "עֶרְוַ֥ת",
"construct_consonants": "ערות",
"absolute": "אֲחוֹת",
"absolute_consonants": "אחות"
},
{
"position": 2,
"construct": "אֲחוֹת",
"construct_consonants": "אחות",
"absolute": "אָבִ֖יךָ",
"absolute_consonants": "אביך"
},
{
"position": 6,
"construct": "שְׁאֵ֥ר",
"construct_consonants": "שאר",
"absolute": "אָבִ֖יךָ",
"absolute_consonants": "אביך"
}
]
}
+23
View File
@@ -99,5 +99,28 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "עֶרְוַ֥ת",
"construct_consonants": "ערות",
"absolute": "אֲחֽוֹת",
"absolute_consonants": "אחות"
},
{
"position": 2,
"construct": "אֲחֽוֹת",
"construct_consonants": "אחות",
"absolute": "אִמְּךָ֖",
"absolute_consonants": "אמך"
},
{
"position": 7,
"construct": "שְׁאֵ֥ר",
"construct_consonants": "שאר",
"absolute": "אִמְּךָ֖",
"absolute_consonants": "אמך"
}
]
}
+16
View File
@@ -118,5 +118,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "עֶרְוַ֥ת",
"construct_consonants": "ערות",
"absolute": "אֲחִֽי",
"absolute_consonants": "אחי"
},
{
"position": 2,
"construct": "אֲחִֽי",
"construct_consonants": "אחי",
"absolute": "אָבִ֖יךָ",
"absolute_consonants": "אביך"
}
]
}
+16
View File
@@ -110,5 +110,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "עֶרְוַ֥ת",
"construct_consonants": "ערות",
"absolute": "כַּלָּֽתְךָ֖",
"absolute_consonants": "כלתך"
},
{
"position": 5,
"construct": "אֵ֤שֶׁת",
"construct_consonants": "אשת",
"absolute": "בִּנְךָ֙",
"absolute_consonants": "בנך"
}
]
}
+23
View File
@@ -89,5 +89,28 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "עֶרְוַ֥ת",
"construct_consonants": "ערות",
"absolute": "אֵֽשֶׁת",
"absolute_consonants": "אשת"
},
{
"position": 2,
"construct": "אֵֽשֶׁת",
"construct_consonants": "אשת",
"absolute": "אָחִ֖יךָ",
"absolute_consonants": "אחיך"
},
{
"position": 6,
"construct": "עֶרְוַ֥ת",
"construct_consonants": "ערות",
"absolute": "אָחִ֖יךָ",
"absolute_consonants": "אחיך"
}
]
}
+23
View File
@@ -201,5 +201,28 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "עֶרְוַ֥ת",
"construct_consonants": "ערות",
"absolute": "אִשָּׁ֛ה",
"absolute_consonants": "אשה"
},
{
"position": 7,
"construct": "בַּת",
"construct_consonants": "בת",
"absolute": "בְּנָ֞הּ",
"absolute_consonants": "בנה"
},
{
"position": 10,
"construct": "בַּת",
"construct_consonants": "בת",
"absolute": "בִּתָּ֗הּ",
"absolute_consonants": "בתה"
}
]
}
+9
View File
@@ -90,5 +90,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּנִדַּ֣ת",
"construct_consonants": "בנדת",
"absolute": "טֻמְאָתָ֑הּ",
"absolute_consonants": "טמאתה"
}
]
}
+9
View File
@@ -99,5 +99,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּנֵ֣י",
"construct_consonants": "בני",
"absolute": "יִשְׂרָאֵ֔ל",
"absolute_consonants": "ישראל"
}
]
}
+9
View File
@@ -98,5 +98,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 2,
"construct": "אֵ֨שֶׁת֙",
"construct_consonants": "אשת",
"absolute": "עֲמִֽיתְךָ֔",
"absolute_consonants": "עמיתך"
}
]
}
+9
View File
@@ -132,5 +132,14 @@
],
"shoresh": "יהו"
}
],
"smikhut": [
{
"position": 9,
"construct": "שֵׁ֥ם",
"construct_consonants": "שם",
"absolute": "אֱלֹהֶ֖יךָ",
"absolute_consonants": "אלהיך"
}
]
}
+9
View File
@@ -91,5 +91,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 5,
"construct": "מִשְׁכְּבֵ֣י",
"construct_consonants": "משכבי",
"absolute": "אִשָּׁ֑ה",
"absolute_consonants": "אשה"
}
]
}
+16
View File
@@ -163,5 +163,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "וּבְכָל",
"construct_consonants": "ובכל",
"absolute": "בְּהֵמָ֛ה",
"absolute_consonants": "בהמה"
},
{
"position": 11,
"construct": "לִפְנֵ֧י",
"construct_consonants": "לפני",
"absolute": "בְהֵמָ֛ה",
"absolute_consonants": "בהמה"
}
]
}
+16
View File
@@ -139,5 +139,21 @@
],
"prefix": "מ"
}
],
"smikhut": [
{
"position": 3,
"construct": "בְּכָל",
"construct_consonants": "בכל",
"absolute": "אֵ֑לֶּה",
"absolute_consonants": "אלה"
},
{
"position": 6,
"construct": "בְכָל",
"construct_consonants": "בכל",
"absolute": "אֵ֨לֶּה֙",
"absolute_consonants": "אלה"
}
]
}
+9
View File
@@ -169,5 +169,14 @@
],
"prefix": "ב"
}
],
"smikhut": [
{
"position": 9,
"construct": "מִכֹּ֥ל",
"construct_consonants": "מכל",
"absolute": "הַתּוֹעֵבֹ֖ת",
"absolute_consonants": "התועבת"
}
]
}
+16
View File
@@ -134,5 +134,21 @@
"prefix": "ה",
"shoresh": "ארץ"
}
],
"smikhut": [
{
"position": 3,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "הַתּוֹעֵבֹ֣ת",
"absolute_consonants": "התועבת"
},
{
"position": 7,
"construct": "אַנְשֵֽׁי",
"construct_consonants": "אנשי",
"absolute": "הָאָ֖רֶץ",
"absolute_consonants": "הארץ"
}
]
}
+23
View File
@@ -138,5 +138,28 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 2,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "אֲשֶׁ֣ר",
"absolute_consonants": "אשר"
},
{
"position": 5,
"construct": "מִכֹּ֥ל",
"construct_consonants": "מכל",
"absolute": "הַתּוֹעֵב֖וֹת",
"absolute_consonants": "התועבות"
},
{
"position": 11,
"construct": "מִקֶּ֥רֶב",
"construct_consonants": "מקרב",
"absolute": "עַמָּֽם",
"absolute_consonants": "עמם"
}
]
}
+30
View File
@@ -228,5 +228,35 @@
],
"shoresh": "לכו"
}
],
"smikhut": [
{
"position": 1,
"construct": "כְּמַעֲשֵׂ֧ה",
"construct_consonants": "כמעשה",
"absolute": "אֶֽרֶץ",
"absolute_consonants": "ארץ"
},
{
"position": 2,
"construct": "אֶֽרֶץ",
"construct_consonants": "ארץ",
"absolute": "מִצְרַ֛יִם",
"absolute_consonants": "מצרים"
},
{
"position": 9,
"construct": "וּכְמַעֲשֵׂ֣ה",
"construct_consonants": "וכמעשה",
"absolute": "אֶֽרֶץ",
"absolute_consonants": "ארץ"
},
{
"position": 10,
"construct": "אֶֽרֶץ",
"construct_consonants": "ארץ",
"absolute": "כְּנַ֡עַן",
"absolute_consonants": "כנען"
}
]
}
+9
View File
@@ -178,5 +178,14 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 6,
"construct": "מֵחֻקּ֤וֹת",
"construct_consonants": "מחקות",
"absolute": "הַתּֽוֹעֵבֹת֙",
"absolute_consonants": "התועבת"
}
]
}
+16
View File
@@ -130,5 +130,21 @@
],
"shoresh": "יהו"
}
],
"smikhut": [
{
"position": 4,
"construct": "כָּל",
"construct_consonants": "כל",
"absolute": "שְׁאֵ֣ר",
"absolute_consonants": "שאר"
},
{
"position": 5,
"construct": "שְׁאֵ֣ר",
"construct_consonants": "שאר",
"absolute": "בְּשָׂר֔וֹ",
"absolute_consonants": "בשרו"
}
]
}
+16
View File
@@ -120,5 +120,21 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "עֶרְוַ֥ת",
"construct_consonants": "ערות",
"absolute": "אָבִ֛יךָ",
"absolute_consonants": "אביך"
},
{
"position": 3,
"construct": "וְעֶרְוַ֥ת",
"construct_consonants": "וערות",
"absolute": "אִמְּךָ֖",
"absolute_consonants": "אמך"
}
]
}
+23
View File
@@ -89,5 +89,28 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "עֶרְוַ֥ת",
"construct_consonants": "ערות",
"absolute": "אֵֽשֶׁת",
"absolute_consonants": "אשת"
},
{
"position": 2,
"construct": "אֵֽשֶׁת",
"construct_consonants": "אשת",
"absolute": "אָבִ֖יךָ",
"absolute_consonants": "אביך"
},
{
"position": 6,
"construct": "עֶרְוַ֥ת",
"construct_consonants": "ערות",
"absolute": "אָבִ֖יךָ",
"absolute_consonants": "אביך"
}
]
}
+37
View File
@@ -161,5 +161,42 @@
"meteg_siluq"
]
}
],
"smikhut": [
{
"position": 1,
"construct": "עֶרְוַ֨ת",
"construct_consonants": "ערות",
"absolute": "אֲחֽוֹתְךָ֤",
"absolute_consonants": "אחותך"
},
{
"position": 3,
"construct": "בַת",
"construct_consonants": "בת",
"absolute": "אָבִ֨יךָ֙",
"absolute_consonants": "אביך"
},
{
"position": 6,
"construct": "בַת",
"construct_consonants": "בת",
"absolute": "אִמֶּ֔ךָ",
"absolute_consonants": "אמך"
},
{
"position": 8,
"construct": "מוֹלֶ֣דֶת",
"construct_consonants": "מולדת",
"absolute": "בַּ֔יִת",
"absolute_consonants": "בית"
},
{
"position": 11,
"construct": "מוֹלֶ֣דֶת",
"construct_consonants": "מולדת",
"absolute": "ח֑וּץ",
"absolute_consonants": "חוץ"
}
]
}