Skip to content

Port upstream #94, #96, #97, #98, #99 - #74

Merged
Y-PLONI merged 9 commits into
otzariafrom
fix/sefaria-section-names-upstream96
Oct 8, 2026
Merged

Y-PLONI merged 9 commits into
otzariafrom
fix/sefaria-section-names-upstream96

Conversation

@Y-PLONI

@Y-PLONI Y-PLONI commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

חלק 1 — Gradle 9.8.0 (פורט של kdroidFilter#94, 8a61325)

הקומיטים לפי סדר upstream: קודם kdroidFilter#94 (29/09), אחריו kdroidFilter#96 (08/10).

  • 5ccc6a2f build: Gradle 9.1.0 → 9.8.0, AGP 8.12.3 → 9.1.1 (androidLibrary {} → android {} ב-core/dao), submodule SeforimMagicIndexer → a5a0245b, ו-computeFacets ב-LuceneSearchEngine עובר ל-CollectorManager (אותה התנהגות).
  • 596b21a3 ci: בדיקות "Verify durable Gradle" ב-manual-generate-release.yml ו-delta-real-diff-test.yml דורשות 9.8.0 (AGP 9.1.1 מסרב ל-Gradle < 9.3.1), ועדכון test_manual_release_workflow.py + הערה ב-ci.yml.

⚠️ לפני מיזוג: יש להתקין Gradle 9.8.0 על ה-runners הקבועים otzaria-db ו-server-2. אחרת שחרור הבא ו-delta-real-diff ייכשלו בבדיקת הגרסה.

אימות: ./gradlew :sefariasqlite:jvmTest :dao:jvmTest :core:jvmTest על 9.8.0 — ירוק; python3 .github/scripts/test_manual_release_workflow.py — 72 OK. (בבדיקה קודמת: allTests מלא על 9.8 — 1239 עברו.)


חלק 2 — שמות מקטעים (פורט של kdroidFilter#96)

פורט של kdroidFilter#96 (upstream 773fcc9f) — רק החלק שעדיין חסר אצלנו; חלק מהתיקון כבר קיים אצלנו מ־7c0f0ff.

מה השתנה

  • mapSectionNameToHebrew — שרשרת when אחת, בלי כפילויות:
    • התאמות מדויקות בראש השרשרת: integer → null, ot, dh → דיבור המתחיל, vav.
    • שמות חדשים מ־upstream (substring): Footnote, Pararaph, Passuk, Tosefta, Midrash, Drush, Remez, Inyan, Mitzvah, Piyyut, Hadran, Kovetz, Sha'ar.
    • מילים אנגליות כלליות בהתאמה מדויקת (Gate, Essay, Statement, Letter, Chamber, Window, Book), כדי שלא יתפסו שמות ארוכים יותר.
    • נרמול קלט כמו ב־upstream: lowercase ו־trim של מרכאות ורווחים.
  • SefariaBookPayloadReader — אותו מנגנון כמו ב־upstream: שם מקטע nullable (List<String?>). רמה מסוג "Integer" מקבלת כותרת עם המספר בלבד (א) במקום Integer א.
  • SefariaSectionNameMappingTest — הטסט של upstream, מותאם לערכים שלנו.

מה נשאר כמו אצלנו (במכוון)

  • Word → מילה (ב־upstream: ערך), Treatise → שער (ב־upstream: מאמר), Maayan → מעיין (ב־upstream: מעין). הערכים שלנו נבדקו מול טקסט המקור (ראו SefariaEnglishSectionNamesTest).
  • Manuscript → כתב יד ו־Vav → וו קיימים רק אצלנו. בטסט של upstream יש בדיקה ש־Manuscript נשאר באנגלית; היא הותאמה לערך שלנו.
  • הטיפול ב־ALIYAH_SECTION_LABEL לא השתנה.

השוואת מיפוי ישן מול חדש (כל שמות המקטעים ב־export)

נבדקו 93 שמות sectionNames ייחודיים, מתוך 6,603 קובצי schema ב־build/inputs/sefaria-extract/schemas. ההשוואה הריצה את הפונקציה הישנה (origin/otzaria) ואת החדשה על כל שם. לאף שם שכבר מופה בעבר לא השתנה הערך העברי. ההבדלים היחידים הם שמות שעד עכשיו עברו כמו שהם באנגלית:

שם חדש ספרים שבהם הכותרת נראית (heSectionNames ריק, רמה שאינה עלה)
Integer (מספר בלבד) 39
Midrash מדרש 13
Gate שער 5
Drush דרוש 3
Kovetz קובץ 2
Letter אות 2
Remez רמז 2
Book ספר 1
Essay מאמר 1
Mitzvah מצוה 1
Piyyut פיוט 1
Window חלון 1
DH, Tosefta, Pararaph, Passuk, Footnote, Hadran, Inyan, Statement, Sha'ar Ha'Gemul (מתורגם) 0 — מופיעים רק ברמת העלה, שלא מייצרת כותרת
Chamber, Negative/Positive Mitzvah (מתורגם) 0 — ב־heSectionNames כבר יש ערך עברי

אף אחד מהשמות האלה לא משמש כ־childLabel של alt-structure בלי שם עברי, ולכן אין שינוי ב־alt-TOC.

השפעה צפויה על ה־DB: רק שורות כותרת (וה־TOC שלהן) בספרים שבטבלה, שבהן מילה אנגלית מתחלפת בעברית או במספר בלבד. זה שינוי תוכן רגיל, והדלתא מטפלת בו. אין שינוי סכמה ואין צורך ב־regeneration מיוחד.

לא נכלל: באג ה־daf/מספרים בדקדוקי הטעמים, שהוא נושא נפרד.

אימות

./gradlew :sefariasqlite:jvmTest

620 טסטים, 0 כשלונות. זה כולל את SefariaEnglishSectionNamesTest הקיים ואת SefariaSectionNameMappingTest החדש.


חלק 3 — PR-97, kdroidFilter#98, kdroidFilter#99 (cherry-pick -x מ-upstream, לפי הסדר)

קומיט upstream מה איך נכנס
c7f42d4b ef17510 (PR-97) קישור בין ספר עיון (קטגוריה עליונה Reference) לספר שאינו עיון → REFERENCE, בלי כיוון cherry-pick; 3 קונפליקטים של שורות סמוכות (topCategoryEn/authorKeys) — נשמרו שני הצדדים. הלוגיקה והטסט כמו upstream
44692ba5 c01360c (kdroidFilter#98) מחבר עם he ריק → מפת slug (11) → שם אנגלי SefariaAuthorNames.kt + טסט כמו upstream; ה-hunk ב-Reader הועבר ידנית לבלוק authorEntries שלנו (שומר על displayName/authorMatchKeys)
7e030817 3e74fb1 (kdroidFilter#99) מהרש"א - לפני כותרות Chidushei Agadot/Halachot cherry-pick נקי

אימות — בנייה מקומית A/B (ספריא בלבד, ייצוא 2026-10-04_15-15-37201295323-1 = קלט v31, buildstate של v31)

A = origin/otzaria (64562fb), B = קצה ה-PR. השוואה מלאה A↔B:

⚠️ תלות: otzaria-library#105

ForDB ממופתח לפי book.title מדויק: בלי Otzaria/otzaria-library#105, 68 ספרי המהרש"א מאבדים את התיאורים המעודנים (sefaria_metadata_changes.csv) ואת קישור הדור (book_info.csv). kdroidFilter#105 מחזיק זמנית שתי השורות (ישן+חדש), כך שהוא בטוח למיזוג לפני/אחרי PR זה.
ראשי תיבות: carryAcronymsAcrossRenames אמור לשאת אותם (אותו id, isSameWorkTitle מתקיים, אין התנגשות כותרות) — נבדק בקוד ובנתונים, לא בריצה מלאה.


עדכון: סדר כרונולוגי, בחירת Gradle לפי עץ, ושער ForDB

סדר הקומיטים (ישן→חדש): 2ca637f9 Gradle 9.8.0 (upstream 8a61325) · bc009750 ci: Gradle 9.8.0 · f57d4313 fix(dao): drop kotlinx-coroutines-test (upstream 7de71c0, 07/10) · 053b278d kdroidFilter#96 · 5a1ba0dd PR-97 · 5bdbd9bf kdroidFilter#98 · 3582a2d3 kdroidFilter#99 · c6e2444d (B) · 36164f0a (C).
העץ שלפני B/C זהה לקצה הקודם (7e030817) למעט השורה האחת ב-dao/build.gradle.kts.

B — ci(release): Gradle לפי העץ שנבדק. עצים ישנים (AGP 8.12.3) נכשלים על Gradle 9.8 ("Failed to apply plugin com.android…multiplatform.library"), ועצים חדשים (AGP 9.1.1) דורשים ≥9.3.1. .github/scripts/select_gradle_toolchain.sh קורא את distributionUrl מ-gradle-wrapper.properties של העץ (התאמה מדויקת gradle-<ver>-(bin|all).zip), בוחר /opt/otzaria-cache/toolchains/gradle-<ver>/bin/gradle, נכשל אם התיקייה חסרה, ומוודא ש---version מחזיר בדיוק <ver>. כל קריאת Gradle במארחים הקבועים עוברת דרך $GRADLE (שני ה-workflows ו-patch_fan_lib.sh); עדיין בלי ./gradlew ובלי הורדה. ARM64 ללא שינוי.

  • delta-real-diff-test: הסקריפט מועתק ל-$RUNNER_TEMP לפני החלפת checkout (ייתכן שעץ ה-baseline לא מכיל אותו), ונבחר מחדש אחרי ה-checkout של ה-baseline ואחרי החזרה ל-head.
  • manual-generate-release: רץ מ-.pipeline-control (גרסת ה-workflow), כי ייתכן ש-source_commit קודם לו.

C — fix(sefariasqlite): שער אי-התאמה ל-ForDB. seedGenerations ו-seedAllMetadata (וכך גם validateForDbInputs) נכשלים לפני כל כתיבה כששורת ForDB לא-מותאמת נושאת את ה-heRef של ספר שהכותרת שלו שונה ממנו, ובאותו קובץ אין שורה לכותרת הנוכחית של הספר. ההתאמה מדויקת. שורות בכותרת חדשה מול DB ישן (CI של otzaria-library מול v31) נשארות אזהרה בלבד, ולכן אין מבוי סתום. ב-kdroidFilter#105 במצבו הנוכחי (שתי השורות) השער עובר; ב-ForDB הנוכחי (רק כותרות ישנות) השער נכשל ומונה את ספרי המהרש"א.

אימות

  • ./gradlew allTests ירוק (1,259 טסטים, 0 כשלים); ForDbTitleGateTest עם 9 טסטים, כולל DB עם כותרות ישנות מול ForDB עם כותרות חדשות (עובר עם אזהרות).
  • .github/scripts/test_*.py כולם OK (כולל טסטים חדשים שמריצים את הבורר ואת שלבי ה-delta מול toolchains מזויפים).
  • על ה-runner otzaria-db (checkouts אמיתיים): 64562fbb (otzaria) → Gradle 9.1.0, help הצליח; 7e030817 → Gradle 9.8.0, help הצליח; בדיקה הפוכה (עץ ישן עם 9.8.0) נכשלה כצפוי ב-"Failed to apply plugin"; גרסה חסרה (9.9.9) → ::error::, ושום דבר לא נכתב ל-GITHUB_ENV.

@Y-PLONI
Y-PLONI force-pushed the fix/sefaria-section-names-upstream96 branch from f01da6b to 3d5f7b2 Compare October 8, 2026 11:32
@Y-PLONI Y-PLONI changed the title fix(sefariasqlite): translate English section names leaking into Hebrew headings Port upstream #94 (Gradle 9.8.0) and #96 (English section names) Oct 8, 2026
@Y-PLONI Y-PLONI changed the title Port upstream #94 (Gradle 9.8.0) and #96 (English section names) Port upstream #94, #96, #97, #98, #99 Oct 8, 2026
- AGP 8.12.3 -> 9.1.1: AGP 8.x relies on a Gradle internal API removed
  in 9.6 and fails to apply. Switch core/dao to the android {} KMP DSL.
- Replace deprecated IndexSearcher.search(Query, Collector) with a
  CollectorManager in LuceneSearchEngine.computeFacets.
- Bump SeforimMagicIndexer (Gradle 9.8.0 upgrade).

Signed-off-by: Elie Gambache <elyahou.hadass@gmail.com>
(cherry picked from commit 8a61325)
AGP 9.1.1 (from the Gradle 9.8.0 upgrade) refuses Gradle older than 9.3.1,
so the release and delta-diff checks now expect 9.8.0.
Nothing in dao uses it, tests included, yet it reached every consumer's
runtime classpath, the app's release build among them.

Signed-off-by: Elie G. <elyahou.hadass@gmail.com>
(cherry picked from commit 7de71c0)
…ew headings

Port of kdroidFilter#96 (upstream 773fcc9) onto our
mapSectionNameToHebrew, which already covered part of it (7c0f0ff).

- Add the names still leaking from blank heSectionNames: DH, Pararaph,
  Passuk, Footnote, Tosefta, Midrash, Drush, Remez, Inyan, Mitzvah, Piyyut,
  Hadran, Kovetz, Gate/Sha'ar, Essay, Statement, Letter, Chamber, Window, Book.
- Treat "Integer" as an unnamed level: its headings are the bare number.
- Normalize input (lowercase, trim quotes/spaces) as upstream does.
- Keep our values where they differ (Word, Treatise, Maayan, Manuscript, Vav);
  generic English words are matched exactly, not as substrings.
…texts

Sefaria types the Otzar La'azei Rashi -> Rashi on X rows as `commentary`.
The dictionary has no `dependence` while Rashi does, so the dependence
asymmetry made the dictionary Rashi's base, and it showed up in Rashi's
sources panel (and as a commentator on the Talmud in the other direction).

Flag books whose top-level Sefaria category is `Reference` and store
oriented links between a reference work and a non-reference book as
REFERENCE. Links inside the reference category (Hafla'ah she-ba'Arakhin
on Sefer HeArukh) keep their orientation.

Fixes kdroidFilter/Zayit#503

Signed-off-by: Elie Gambache <elyahou.hadass@gmail.com>
(cherry picked from commit ef17510)
Sefaria ships some authors with an empty `he` title (e.g. Nissim Chaim
Moshe Mizrachi, author of Admat Kodesh), so the book got a blank author.
11 authors / 16 books are affected in the current export.

Resolve the name from the `he` title, else a Hebrew override keyed by
the Sefaria topic slug, else the English name; drop authors with no name.

Fixes kdroidFilter/Zayit#444

Signed-off-by: Elie Gambache <elyahou.hadass@gmail.com>
(cherry picked from commit c01360c)
Sefaria titles the Maharsha's commentaries "חידושי הלכות/אגדות על <מסכת>",
and the app lists a commentary by its title without " על <base book>",
so the reader saw "חידושי אגדות" with no hint it is the Maharsha.

Prefix the display title with "מהרש\"א - " for the Chidushei Halachot and
Chidushei Agadot collections (45 books). heTitle stays the natural key,
so book ids are unchanged and the delta ships plain upsert_book rows.

Fixes kdroidFilter/Zayit#440

Signed-off-by: Elie Gambache <elyahou.hadass@gmail.com>
(cherry picked from commit 3e74fb1)
AGP 8.12.3 (trees before the Gradle 9.8.0 upgrade) fails on Gradle 9.8, and
AGP 9.1.1 needs Gradle >= 9.3.1, so one fixed durable Gradle cannot build both
an old baseline/source_commit and the current tree.

select_gradle_toolchain.sh reads the tree's gradle-wrapper.properties
distributionUrl, picks /opt/otzaria-cache/toolchains/gradle-<ver>/bin/gradle,
fails if it is missing, and checks that --version reports exactly <ver>.
GRADLE now names that binary for every durable-host Gradle run (both
workflows and patch_fan_lib.sh); durable hosts still never use ./gradlew
or download a distribution, and ARM64 keeps ./gradlew + the setup actions.

- delta-real-diff-test: copy the selector into $RUNNER_TEMP before any
  checkout switch and re-select after the baseline checkout and after the
  restore of the head tree.
- manual-generate-release: run it from .pipeline-control (the workflow
  revision), since source_commit may predate it.
…r title

ForDB generation and metadata rows match books by exact title, and an
unmatched row is only a warning. Now that the Maharsha's commentaries are
shown as "מהרש\"א - <heTitle>", a ForDB still keyed by heTitle would drop
their generations and descriptions without failing anything.

Before writing, seedGenerations and seedAllMetadata (and so
validateForDbInputs) now fail when an unmatched row's title is the heRef
of a book whose title differs from it and the same file has no row under
that book's current title. Exact matching only; rows with titles the DB
does not know yet (a candidate ForDB checked against an older released
DB) still just warn.
@Y-PLONI
Y-PLONI force-pushed the fix/sefaria-section-names-upstream96 branch from 7e03081 to 36164f0 Compare October 8, 2026 14:31
@Y-PLONI
Y-PLONI merged commit 4eadbc9 into otzaria Oct 8, 2026
6 checks passed
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