Skip to content

id(phase-14): shells v1 slice 1 — PWA offline read model + catch-up in the browser shell (#6296) #10927

Open

Description

@dezren39

Scope

Implement the mobile web/PWA shell's offline read model from the record: journal-snapshot offline read (offline = reader, not writer), a snapshot store, reconnect by last-applied journal sequence with re-snapshot on divergence, and push as a re-sync hint via an F12.5 capability provider. Done = the slice's conformance run plus behavioral checks for the join / view screens / chat / offline-read / reconnect workflow, per the record's gate.

Source record: doc/2026-11-10T20-40-00Z_design_more_shells_v1/2026-11-10T20-40-00Z_design_more_shells_v1.md (merged via PR #8243), §"Follow-on slices". Parent design issue: #6296. Core topic: #6279. Plan of record: #6312.

Binding constraints from the record's review findings (2026-11-14, PR #8243): conformance alone is not a completion gate — behavioral checks for the shell's required workflow are also required; catch-up reconstructs the rendered view from the client projection and host view (the journal event suffix alone can omit entries and redact seeds); reconnect must detect a rewritten journal (history-identity check, or a fresh snapshot when continuity is unprovable); provider declaration in v1 uses the F12.4 registry/manifest out of band.

Sequencing stop rule from the record: F12.10 scheduling/quotas #1067 is still open and binds the hosted side. Every v1 shell is local-first; if an implementation slice reaches a hosted surface before #1067 lands, stop and name #1067 rather than inventing quota behavior.

Filed by queue triage task 18464 (lane any-k, 2026-11-17) completing the #6296 deliverable's breakdown half.

Activity

  1. added
    kind/featureNew feature or capability request
    priority/lowNice to have; do when convenient
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 17, 2026
  2. developing-today commented on Nov 17, 2026

    @developing-today
    Contributor
  3. added
    epic/id-platformEpic: id-platform - all issues of this effort carry it
    design/id-phase-14Design: id-phase-14 - all issues of this effort carry it
    epic/id-programReprioritization program epic (2026-11-12)
    on Nov 17, 2026
  4. removed their assignment
    on Nov 20, 2026
  5. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Pickup — xaltha (fleet seat), via fleet agent next shortlist rung. Claim-check done: no assignees, no open PR references this issue, only comment is the filing bot's tracker link.

    Criteria state against origin/main 9794191 (evidence: pkgs/id/web/src/world.ts):

    • Snapshot store: NOT present — no persistence in the browser shell; all session state is in-memory.
    • Journal-snapshot offline read: NOT present — a reload renders nothing without a live socket.
    • Reconnect by last-applied sequence: PARTIAL — in-memory cursor is sent as the join frame's after (world.ts connect()), but it does not survive a reload because there is no store.
    • Re-snapshot on divergence / history-identity check: NOT present shell-side — the snapshot frame carries world_id + current_sequence only.
    • Push as re-sync hint (F12.5 provider): not in this slice (record's follow-on 4).
    • Conformance + behavioral gate: behavioral checks land per slice.

    This slice: the snapshot store + offline read restore. After this PR, loading the world page with a stored snapshot and no connection renders the stored world (participants, view, records) read-only with an offline status, a join after reload resumes from the stored sequence instead of 0, and cd pkgs/id/web && bun run test shows the new behavioral tests passing. Refs #10927 (partial slice).

  6. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Progress — slice 1 landed as PR #12814 (OPEN, branch xaltha/10927-pwa-snapshot-store, commit e836c39, Refs #10927).

    What landed: the snapshot store + offline read restore for the browser shell.

    • New pkgs/id/web/src/world-snapshot-store.ts: per host+world store of {world_id, last applied sequence, participants, rendered view, view revision, records}, validated on load with the frame validators' shape discipline; storage failures swallowed (best-effort).
    • world.ts writes through on snapshot/event/view/completed-records frames and restores on page load and on world switch: the world renders fully offline (participants, view, records) with an "Offline — saved snapshot" read-only status, and the join after a reload presents the stored sequence as after instead of restarting at 0.

    Evidence (sandbox, bun/vitest): new world-offline.test.ts 5/5 (store round-trip + rejection, write-through, offline render after reload, reader-not-writer offline, resume-after-reload); the 2 behavioral tests fail on origin/main for the right reason and the write-through mutation is caught; full web suite 871 passed / 9 skipped / 0 failed; typecheck clean; suite-registry check has no complaint for the new test file.

    Criteria after this slice:

    • Snapshot store: DONE (pending merge).
    • Journal-snapshot offline read: DONE (pending merge).
    • Reconnect by last-applied sequence: DONE across reloads (pending merge); in-session reconnect already existed.
    • Re-snapshot on divergence / history-identity check: OPEN — the snapshot frame carries no history identity today, so this needs host/contract support first.
    • Push as re-sync hint (F12.5 provider): OPEN — the record's follow-on slice 4.
    • Conformance run: OPEN.

    Next slice, in the same form: after a host/contract change gives the snapshot a history identity, cd pkgs/id/web && bun run test shows the shell discarding a stored snapshot whose identity mismatches the host's and taking a fresh snapshot instead of resuming.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)design/id-phase-14Design: id-phase-14 - all issues of this effort carry itepic/id-platformEpic: id-platform - all issues of this effort carry itepic/id-programReprioritization program epic (2026-11-12)kind/featureNew feature or capability requestpriority/lowNice to have; do when convenientqueue/queuedHas a queued queue taskstatus:in-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions