Skip to content

feat(lifeboard): export and restore - #325

Open
ivanmkc wants to merge 1 commit into
lifeboard/13-practicefrom
lifeboard/14-backup
Open

feat(lifeboard): export and restore#325
ivanmkc wants to merge 1 commit into
lifeboard/13-practicefrom
lifeboard/14-backup

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: 15 of 19. Base: lifeboard/13-practice.

Closes the finding the persistence audit called the largest remaining risk, and the cheapest to fix: everything lifeboard knew lived in one browser's IndexedDB, and "clear site data" took the calendar, the lists and the vaccination dates with it. The durable state is an array of entries, so export is serialising it and restore is putting it back.

Restore replaces; it does not merge. Two logs that grew independently both number their entries from 1, and deciding which "seq 7" wins is a guess dressed up as a policy. Merging devices is a real feature that needs a real design; pretending this is that would lose someone's records quietly. So the screen shows what is here, what is in the file, and that there is no undo — and waits.

Reading a backup is strict on purpose. This is the one path that overwrites everything: the format, the version, every entry's shape and collection, and duplicate sequence numbers are all checked, and the error names the offending entry.

Adds Backend.replace and Store.restore — the only thing in the codebase allowed to discard the log. The next write after a restore continues the restored numbering rather than colliding with it, and history and undo keep working; both are covered.

Verified: lifeboard 389 (+17), all packages green, offline e2e passes.

…way from gone

The persistence audit called this the largest remaining risk and the cheapest
thing on the list to fix: everything lifeboard knows lived in one browser's
IndexedDB, and "clear site data" took the calendar, the lists and the
vaccination dates with it. The durable state is an array of entries, so export
is serialising it and restore is putting it back.

Restore replaces; it does not merge. Two logs that grew independently both
number their entries from 1, and deciding which "seq 7" wins is a guess dressed
up as a policy. Merging devices is a real feature that needs a real design, and
pretending this is that would lose someone's records quietly. So the screen says
what is here, what is in the file, and that there is no undo -- and waits.

Reading a backup is strict on purpose. This is the one path that overwrites
everything, so a cheerful "looks close enough" here costs a household its
records: the format, the version, every entry's shape and collection, and
duplicate sequence numbers are all checked, and the error names the entry.

Also adds Backend.replace and Store.restore, which is the only thing in the code
allowed to discard the log. The next write after a restore continues the
restored numbering rather than colliding with it, and history and undo keep
working -- both covered by tests.

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