Skip to content

feat(dh): store the printed dibbur alongside its key (line_dh.dhDisplay) - #24

Open
palmoni5 wants to merge 3 commits into
Otzaria:otzariafrom
palmoni5:feat/line-dh-display
Open

feat(dh): store the printed dibbur alongside its key (line_dh.dhDisplay)#24
palmoni5 wants to merge 3 commits into
Otzaria:otzariafrom
palmoni5:feat/line-dh-display

Conversation

@palmoni5

@palmoni5 palmoni5 commented Sep 2, 2026

Copy link
Copy Markdown
Member

Why

line_dh.dhText is the normalized DhKey used for prefix matching, not suitable for display. The client also needs the printed dibbur, preserving points and quote marks.

v26 has now shipped with DB schema 4, so adding dhDisplay can no longer reuse schema 4.

What

  • DhExtractor.extract returns both the normalized key and a display form.
  • line_dh gains dhDisplay TEXT NOT NULL; the primary key stays (bookId, dhText, lineIndex).
  • The database contract advances to schema 5, while the patch.db artifact format deliberately remains 4.
  • The released schema-4 table/column contracts are frozen in dedicated fixtures.
  • Stamping schema 5 now refuses a DB unless line_dh.dhDisplay exists as TEXT NOT NULL.
  • The release patch fan accepts 1/2/3/4→5. For v26→v27 the producer emits:
    ALTER TABLE line_dh ADD COLUMN dhDisplay TEXT NOT NULL DEFAULT ''
    and ships a full line_dh snapshot so the synthetic default cannot survive.
  • Cross-platform contract tests normalize checkout line endings before comparing canonical JSON.

Companion consumer change: Otzaria/otzaria_library_updater#9. The cross-repository contract jobs compare against the companion repository's default branch, so one of the paired PRs must land (or be merged together) before both contract jobs can be green.

Verification

  • .\gradlew.bat :generator-common:jvmTest --no-daemon
  • python .github/scripts/test_manual_release_workflow.py
  • Focused v26→v27 producer/apply round-trip, frozen schema-4 contract, schema-5 stamp guard, and direct 1/2/3→5 promotion tests.

@palmoni5

palmoni5 commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

ה-job contract אדום כי ה-cmp משווה את ה-fixture מול ענף ה-main של ה-updater. PR מקביל שמעדכן את הצד השני: Otzaria/otzaria_library_updater#9 — למזג יחד.

palmoni5 and others added 2 commits September 4, 2026 18:48
dhText is the DhKey form — points, quote marks and edge punctuation
stripped — which is right for prefix matching but unfit to show: the
Otzaria client wants to list dibburim as sub-headings under the TOC, and
"בראשית" is not what the page prints for "בְּרֵאשִׁית." So the extractor
now returns both forms (DhExtractor.Dh) and the index stores the printed
one in a new NOT NULL column, dhDisplay: tags never occur inside an
accepted dibbur, whitespace is collapsed, and the same edge punctuation
DhKey trims is trimmed so key and display end at the same place. Points
and quote marks stay.

The PK is unchanged; the column rides along as the table's first non-PK
column, so line_dh becomes updatable in the patch contract (fixture
updated). Schema 4 has not shipped — the latest release is the schema-3
v23→v24 delta — so no schema bump: the promotion migration is inferred
from the new DB's sqlite_master and already carries the new shape.

Tests: DhExtractorTest goes through a key() helper for the existing
assertions and adds display cases; BuildLineDhIndexCliTest asserts the
stored pair.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@palmoni5
palmoni5 force-pushed the feat/line-dh-display branch from c234476 to 2f870f1 Compare September 4, 2026 16:04
palmoni5 added a commit to palmoni5/otzaria_library_updater that referenced this pull request Sep 4, 2026
ב-SeforimLibrary (Otzaria/SeforimLibrary#24) נוספה ל-line_dh עמודה שאינה חלק מהמפתח — dhDisplay, הצורה המודפסת של הדיבור להצגה בעץ הניווט. טבלה עם עמודה שאינה PK חייבת ON CONFLICT DO UPDATE, אחרת שינוי בצורת התצוגה של דיבור קיים היה נבלע בשקט ומפיל את אימות ה-hash. המפתח לא השתנה; סכמה 4 עדיין לא שוחררה ולכן אין קפיצת סכמה.

ה-fixture המשותף מתעדכן בהתאם כדי שבדיקת ה-cmp הדו-צדדית תישאר ירוקה.
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.

2 participants