Skip to content

[3a] Add host sessions #440

Closed
Closed

Description

@imnasnainaec

Part of Phase 3 (#426) of the data layer plan.

Sessions over a draft and its interlinear project, plus setAnalysisLanguage; read-only for PT9 imports. Not called by the WebView yet.

Done when: sessions open on a draft, a draft with its interlinear project, and a PT9 import, and commands on an import's session are refused, and openSession returns hasFreeTranslations as main computes it, and setAnalysisLanguage passes its parity test.

Depends on: Phase 1 (#424), Phase 2 (#425).

From the plan

API

Call Kind Request Response Replaces today Issue
openSession / closeSession command source project, optional interlinear project sessionId, read-only flag, hasFreeTranslations getDraft seeding Redux 3a

Cross-book answers

Answer Today Planned Freshness Issue
hasFreeTranslations Scans every segment analysis Returned by openSession, and beside the ChangeSet in a wipe's reply; recomputed on New, Open and both wipes, as on main At session open and after a wipe 3a, 3i

Decisions

Question Decision From
Addressing Carried: each open draft gets a session, a host-side handle for the draft and its interlinear project, addressed by a sessionId J
Concurrent commands Carried: no segment-page versions; the host queues commands and reanchor passes per session and runs one at a time, since async commands would otherwise interleave, and only one WebView opens per source project —

Activity

  1. imnasnainaec commented on Oct 19, 2026

    @imnasnainaec
    ContributorAuthor

    Four things from #431:

    • The repository interface. [1b] Route getDraft and saveDraft through an async repository #431 shipped only whole-draft calls, exportAll and replaceAll, which are temporary until 4c. The rest of the interface is settled here, with this issue's callers as its first users. This issue may defer parts to the issues that build them.

      • Scope: a type pairing a draft with its interlinear project.
      • capabilities, starting with read-only for PT9 imports.
      • Reads by id per kind (getTokenAnalyses, …) or a generic read.
      • ChangeSet as one list per kind or one mixed list, with ApplyResult and intent. Built in 3b.
      • The naming pattern for lookups (built in 3c) and the catalog query (built in 5a).
      • How setAnalysisLanguage writes the scope before 3b's apply exists.

      The interface sketch in [1b] Route getDraft and saveDraft through an async repository #431's comment is a starting point.

    • Release point. The draft repository lives for the life of the process, one per source project. It holds only the per-book record of what storage holds. Sessions take it over: one per session, released on close.

    • Close after the final save. A view's unmount sends its pending autosave. closeSession must not run before that save lands, or the save hits a fresh repository and rewrites every shard.

    • Perf seeding. The dev-core perf run writes storage directly between tiers, with the app running. It relies on no host state for a source outliving its view's close without a reload at the next open. A session that outlives its view would hide the seeded draft.

  2. imnasnainaec commented on Oct 21, 2026

    @imnasnainaec
    ContributorAuthor

    From #432: interface changes here get conformance tests in the same PR. A new scope type changes the suite's DraftProject fixtures. Once a scope pairs a draft with its interlinear project, the suite tests the project half too. Read-only refusal belongs in the suite.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions