Skip to content

Add the Paratext 9 import service, storage, provenance, and commands - #273

Open
jasonleenaylor wants to merge 4 commits into
mainfrom
pt9-parsed-service
Open

Add the Paratext 9 import service, storage, provenance, and commands#273
jasonleenaylor wants to merge 4 commits into
mainfrom
pt9-parsed-service

Conversation

@jasonleenaylor

@jasonleenaylor jasonleenaylor commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

The backend half of the PT9 import, stacked on #272. Supersedes #268.

  • InterlinearProject gains optional pt9Import provenance (per-file hashes and
    the import timestamp). A project carrying it is frozen: storage rejects
    every user write and only the import's own save path replaces its content;
    deleting stays allowed.
  • projectStorage gains savePt9Import (create the source's single import
    project or replace it wholesale), getPt9ImportForSource, and
    createEditableCopy (clone an import's analysis into a new editable project
    with no provenance).
  • pt9ImportService.importPt9Project fetches the parsed payload through the
    platformScripture.Pt9Interlinear projectInterface, rebuilds each referenced
    book's text layer from USJ, converts, and persists - created on first run,
    replaced wholesale on later runs, and kept untouched (staleKept) when the
    source files have vanished.
  • Commands, localized strings for the import project's fixed name and
    description, and the type guards the wire surface needs.

This change is Reviewable

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 78760bdf-afbb-4abe-8387-a9f669877821


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@imnasnainaec

This comment was marked as resolved.

Base automatically changed from pt9-parsed-converter to main August 28, 2026 18:35
jasonleenaylor and others added 4 commits August 28, 2026 11:37
The backend half of the PT9 import: InterlinearProject gains optional
pt9Import provenance (per-file hashes and the import timestamp), and a
project carrying it is frozen - storage rejects user writes and only the
import's own save path replaces its content, while deleting stays
allowed. projectStorage gains savePt9Import, getPt9ImportForSource, and
createEditableCopy; pt9ImportService.importPt9Project fetches the parsed
payload through the platformScripture.Pt9Interlinear projectInterface,
rebuilds each referenced book's text layer from USJ, converts, and
persists the source's single frozen import. Commands and type guards
round out the wire surface.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The provenance doc names the functions that enforce it (updateAnalysis
and updateProjectMetadata reject, savePt9Import replaces, deleteProject
accepts) and no longer claims view behavior this tree does not contain.
The writing-system fallback is pinned for a non-string setting value,
not only an empty one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
isPt9ImportReport and its per-book helper now live in the converter's
report module, next to the type they validate and exported through the
converter's public surface, so the types layer no longer imports upward
from the converters. The frontend-mock helper leaves this tree for the
WebView change that uses it, and the ENOENT error fixture has one
definition in test-helpers instead of one per test file.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jasonleenaylor

Copy link
Copy Markdown
Contributor Author

❓ Nothing in the stack passes a resolver: pt9ImportService calls convertPt9Project({ data, books, importedAt }), so every import persists zero lexicon refs. Fine for the import project, which a later run replaces wholesale, but createEditableCopy keeps sourceProjectId and drops pt9Import, so a re-import never touches a copy already taken. PT9 lexeme identity is permanently gone for that copy.

Is dropping PT9 identity at import decided? (#269 makes a foreign paratext9 ref expressible, which would render identically today and survive into copies.)

--drafted by Claude; reviewed and edited by me--

Resolver implementation is deferred, but that needs tracking, created #280 as a reminder.

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