Skip to content

Learning to Read Midrash ch. 2 close read; primaryLanguage for English-first sheets - #9

Merged
EliezerIsrael merged 1 commit into
mainfrom
claude/midrash-close-read-d21e36
Oct 7, 2026
Merged

EliezerIsrael merged 1 commit into
mainfrom
claude/midrash-close-read-d21e36

Conversation

@EliezerIsrael

Copy link
Copy Markdown
Member

Summary

  • New sheet data/learning-to-read-midrash-2.json (?sheet=learning-to-read-midrash-2): Simi Peters' six-step reading of the Tanhuma's king-and-warrior mashal on "קַח נָא" (Genesis 22:2). 10 sections, 59 cards, linear (no forks).
  • Original Hebrew of every cited passage (Genesis 22:1–2, 22:12, Tanhuma Vayera 22, Rashi on 22:12) is sliced from Sefaria's texts, not retyped. English for the verses and midrash is Peters' own translation, which the chapter's argument depends on (JPS omits "please").
  • Engine: new optional top-level "primaryLanguage": "en". When a passage can't fit the phone panel in both languages, the fallback now keeps that language instead of always keeping Hebrew. Existing sheets are unchanged. Documented in docs/data-format.md, CLAUDE.md and the wiki.

Notes for review

  • The final "Consider" card (Rashi's "Satan and the nations who wonder" set beside the unnamed generals) is the sheet's connection, not Peters'.
  • The book is marked Copyright on Sefaria (Urim 2004). The panel uses Peters' translation verbatim and the narration follows her argument closely. Please confirm this use is covered before it goes public.

Test plan

  • python3 -m pytest: 130 passed, 2 xfailed (data and render, desktop and mobile)
  • Checked in the browser: highlights on the matching cards; phone view keeps the English on the Tanhuma panel

🤖 Generated with Claude Code

…English-first sheets

Simi Peters' six-step reading of the Tanhuma's king-and-warrior mashal on
"kach na" (Genesis 22:2), with the Hebrew of Genesis 22:1-2, 22:12,
Tanhuma Vayera 22 and Rashi 22:12 sliced from Sefaria's texts.

The Tanhuma passage can't fit the phone panel in both languages, and the
fallback always kept Hebrew. A sheet can now set "primaryLanguage": "en"
so phones keep the English the cards refer to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@EliezerIsrael
EliezerIsrael merged commit 3d1fc7a into main Oct 7, 2026
1 check passed
@gitvelocity-reviewer

Copy link
Copy Markdown

📊 Code Quality Score: 29/100

Base 29 (S8 + A3 + I6 + R5 + Q7 + P0) × ESF 1.0 = 29

Category Score Factors
🔭 Scope 8/20 Six files change: one new sheet data/learning-to-read-midrash-2.json, one entry in data/index.json, js/engine.js, js/text-effects.js, tests/test_render.py and one line of CLAUDE.md. Roughly 1,380 of the 1,418 effective lines are sheet JSON; the JS change is about 10 lines.
🏗️ Architecture 3/20 A primaryLanguage field in sheet data is now copied to document.body.dataset.primaryLang in CloseReadApp.init() and read in TextEffects.fitToPanel. No new module or dependency, and the sheet schema gains one optional field.
⚙️ Implementation 6/20 fitToPanel picks [keep, drop] as [en, he] or [he, en] from primaryLang, hides the drop elements and re-runs search on the keep subset. The new sheet defines 10 sections of narration, question and commentary steps, each mapping highlight keys into a words object, with glow and pulse effects and one Rashi commentary step.
⚠️ Risk 5/20 fitToPanel runs on every sheet, but the default path (primaryLang is he) behaves as before. A bad primaryLanguage value falls back to 'he' through the ternary in init(). A wrong highlight key in the new sheet affects only that sheet's rendering.
✅ Quality 7/15 tests/test_render.py widens its hidden-element check to .primary-en, .primary-he and updates the failure message. CLAUDE.md documents the English-only fallback and names the Tanhuma passage as a trigger. No test sets primaryLanguage: "en" and asserts which language is hidden, and no test covers init() setting primaryLang.
🔒 Perf / Security 0/5 No performance or security work is present in the diff. fitToPanel keeps its existing binary-search fit.

Was this score accurate? 👍 Yes · 👎 No

How this was scored →

Scored by GitVelocity · How are scores calculated?

@gitvelocity-reviewer

Copy link
Copy Markdown

📊 Code Quality Score: 26/100

Base Score 26 (S7 + A3 + I6 + R3 + Q6 + P1) × ESF 1.0 (1418 effective lines, Extra Large tier; 6 files, Small file tier, no bump) = 26.

Category Score Factors
🔭 Scope 7/20 Six files are touched. data/learning-to-read-midrash-2.json is new, data/index.json gains one entry, js/engine.js and js/text-effects.js each get a few lines, tests/test_render.py gets two edits and CLAUDE.md gets one edited bullet. Almost all of the line count is content in the one new JSON file.
🏗️ Architecture 3/20 CloseReadApp.init in js/engine.js writes document.body.dataset.primaryLang from data.primaryLanguage, and TextEffects.fitToPanel reads it. This adds one data-driven option shared between two modules. No module or dependency boundary moves.
⚙️ Implementation 6/20 In fitToPanel, the hard-coded hide-English path becomes a destructured [keep, drop] pair chosen by primaryLang === 'en'. The init line falls back to 'he' for any value other than 'en'. The new sheet follows the existing section/step/highlight/word-map schema, with commentary and question step types, effect values and a questionLabel override.
⚠️ Risk 3/20 Existing sheets get primaryLang = 'he' and take the same hide-English path as before. The new sheet is an additive index entry, and removing it reverts the content. A wrong highlight id in the new JSON would affect only that sheet's rendering.
✅ Quality 6/15 tests/test_render.py now queries .primary-en, .primary-he for hidden elements and reports 'a language hidden although the verse fits at the minimum font sizes'. The CLAUDE.md mobile-panel note is updated to name the new case. No test targets the primaryLang === 'en' branch in isolation, and no check validates the JSON highlight ids against each section's words keys.
🔒 Perf / Security 1/5 init accepts only 'en' or 'he' for the dataset value, so arbitrary strings from sheet data never reach dataset.primaryLang. No performance or caching work is present.

Was this score accurate? 👍 Yes · 👎 No

How this was scored →

Scored by GitVelocity · How are scores calculated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant