Skip to content

feat(lifeboard): the offline foundation — fact log, boards, service worker - #313

Open
ivanmkc wants to merge 4 commits into
lifeboard/01-canvasfrom
lifeboard/02-foundation
Open

feat(lifeboard): the offline foundation — fact log, boards, service worker#313
ivanmkc wants to merge 4 commits into
lifeboard/01-canvasfrom
lifeboard/02-foundation

Conversation

@ivanmkc

@ivanmkc ivanmkc commented Sep 2, 2026

Copy link
Copy Markdown
Owner

The stack

# PR What it adds Tests at this point
1 #311 A real localStorage for the test suite on Node 25 viewer 747
2 #312 @ivanmkc/termchart-canvas; injectable interact transport canvas 473 · viewer 278
3 #313 lifeboard PWA: fact log, boards, service worker lifeboard 36
4 #314 Shell, family profiles, tap layer lifeboard 82
5 #315 The agent turn, four providers, Connections lifeboard 142
6 #316 Packs, recipes, shopping-list arithmetic lifeboard 231
7 #317 Provenance and lineage lifeboard 257
8 #318 Calendar, Gmail, mail triage lifeboard 301
9 #319 The bridge and long jobs cli 314 · lifeboard 320
10 #310 Proactivity, scheduled boards, Google sign-in cli 320 · lifeboard 343
11 #320 Persistence audit fixes: multi-tab, stale builds, no-storage boot lifeboard 350
12 #321 User guide, bridge setup, QA guide, persistence audit lifeboard 350
13 #322 A plan for third-party integrations (docs only) unchanged
14 #323 A practice drill a board can define: audio + Q&A canvas 485 · lifeboard 372
15 #325 Export and restore lifeboard 389
16 #326 Draft a message, approve it, then send lifeboard 399
17 #327 Hand long work to the Mac lifeboard 406
18 #328 A Packs screen, and authoring one by describing it lifeboard 418
19 #329 Activity — what changed, who changed it, undo lifeboard 428
20 #330 Four defects found reviewing the stack cli 323 · lifeboard 431

Every branch in the stack was checked out on its own and verified independently: npm install, tsc --noEmit for every package, npm test across the workspace, and the offline e2e where it exists. All twenty are green — no branch depends on a later one to build or pass. Full viewer e2e (11 suites, 106 assertions) was run on #312 as the behaviour-preservation evidence for the extraction.


Stack position: 3 of 10. Base: lifeboard/01-canvas.

The lifeboard PWA: a static bundle over a local log that renders on the canvas and works with the network switched off.

Two departures from the written plan, both deliberate.

The store is an append-only fact log, not a table of rows. The plan specified applyMutation(items, m) -> Item[]. The design doc requires provenance and undo (§8b, decisions 27–28) and neither can be recovered once a row has been overwritten in place. So the durable artefact is a log of assert / correct / retract entries and the list is a fold over it. Every entry records its author as human, code or model — a distinction that matters later, when deterministic steps may be re-derived automatically while model-authored facts must never be silently recomputed.

There is a service worker, which the plan did not call for. Its own acceptance criterion — "works with the network switched off" — cannot hold without one: Chromium will not serve the document from disk cache when offline, so an offline reload fails at the document request no matter what is in IndexedDB.

es2022 rather than the viewer's es2020, because the entry point uses top-level await.

Verified: e2e/offline.e2e.mjs runs the whole claim with the network off — first render, service worker takes control, offline reload, switch board, tick a box, reload, tick survived — with zero console errors. Unit tests: 40.

🤖 Generated with Claude Code

ivanmkc and others added 4 commits September 2, 2026 07:50
Static PWA built with the viewer's esbuild shape, but targeting es2022 rather
than es2020: the entry point uses top-level await, which es2020 rejects. Ships
its own css.d.ts so tsc resolves the CSS-as-text imports the canvas renderers
make.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Departs from the written plan, which specified a row-shaped store. The design
doc requires provenance and undo (spec 8b, decisions 27-28), and neither can be
recovered once a row has been overwritten in place -- so the durable artefact is
the log of assert/correct/retract entries and the list is a fold over it.

Every entry records its author as human, code or model. That distinction is
load-bearing later: deterministic steps may be re-derived automatically, while
model-authored facts must never be silently recomputed.

Mutations addressing a record that is not in the view are dropped rather than
throwing -- they come from stale boards and retried agent steps, neither of
which is worth interrupting the user for -- and an apply that resolves to no
entries writes nothing and notifies nobody.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Boards are built from the records, not fetched: same records and same day in,
byte-identical component spec out. The specs go through the canvas's own
validator in test, so a board this app builds is a board an agent could have
pushed -- one render path, not two.

Vertical is the main axis. A reader scanning a family board follows one column
down; columns of equal weight make them hunt for where to start. Empty sections
are omitted rather than rendered empty.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The canvas Checklist posts toggles through the transport seam; here that writes
an entry to the local log instead of an HTTP endpoint, so a tick is durable and
attributed. A toggle we originated does not redraw the board -- the widget
already shows it, and re-rendering would tear down its React root and flash.

Adds a service worker, which the plan did not call for but its acceptance
criterion requires: Chromium will not serve the document from disk cache with
the network off, so without a worker an offline reload fails before any of the
locally stored data matters. Shell precached on install, content-hashed renderer
chunks cached on first fetch, cache name versioned so a stale chunk cannot
outlive the app.js that asked for it.

First run seeds a short list, attributed to code rather than to a person: an
empty log renders an empty screen, which reads as broken rather than new.

e2e proves the whole claim with the network switched off -- render, switch
board, tick, reload, tick survived -- with zero console errors.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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