Skip to content

Delete old-persistence migration tech-debt#232

Merged
nedtwigg merged 2 commits into
mainfrom
migration
Jul 8, 2026
Merged

Delete old-persistence migration tech-debt#232
nedtwigg merged 2 commits into
mainfrom
migration

Conversation

@nedtwigg

@nedtwigg nedtwigg commented Jul 8, 2026

Copy link
Copy Markdown
Member

What

We have effectively zero users, so all code that reads or upgrades old persisted formats is dead weight. This deletes it — keeping only the current write formats — and hardens the boot path so a corrupt/unreadable save can never block startup.

Removed migration tech-debt

Concern What went
Session v1→v2→v3 migration legacy V1/V2 shapes, guards, migrateSessionV1toV2/migrateSessionV2toV3
Dockview layout → Lath lathLayout lath/dockview-convert.ts (+test), the PersistedSession.layout field, the persistedLathLayout fallback
Pre-Lath doors legacy PersistedDoor positioning fields, legacyTokenFromDoor, edgeForDoorDirection, door alias canonicalization in leafMetaFromDoor / LathHost
Pre-workspace bare session → PersistedWindow the migration branch in readPersistedWindow
TODO / status migrateTodoState, legacy ALERT_DISABLED handling
Browser renderMode legacy blob surfaceType: iframe/agent-browser + poppedOut resolution, the BrowserPanel canonicalization effect
WebKit localStorage → Rust store the one-time SUNSET migration branch in tauri-adapter.ts

Hardening (corrupt saves are non-fatal)

  • readPersistedSession / readPersistedWindow warn-and-return-null on present-but-unreadable content (silent on genuinely-empty state).
  • window-persistence.ts parses stored JSON defensively — bad JSON degrades to a fresh start instead of throwing at the boot boundary.

Settings are best-effort; a bad blob logs a [dormouse] Ignoring …; starting fresh. warning and boots clean.

Specs

Updated to match and re-folded (transport, tiling-engine, standalone, alert, dor-browser, layout, glossary); the now-empty standalone.md ## Future SUNSET item was removed. pnpm lint:specs passes.

Net

~1350 lines deleted, 3 files removed. Second commit is /simplify cleanup.

Test plan

  • lib typecheck (tsc -b) clean
  • lib full suite — 1043 passed
  • standalone suite — 47 + 4 passed
  • pnpm lint:specs — OK (23 specs)

🤖 Generated with Claude Code

nedtwigg and others added 2 commits July 8, 2026 10:11
We have effectively zero users, so all code that reads or upgrades OLD
persisted formats is dead weight. Remove it; keep only the current write
formats. A corrupt/unreadable save is now logged and discarded so startup
always continues fresh rather than throwing at the boot boundary.

Removed:
- Session v1→v2→v3 migration (legacy shapes, guards, migrate* fns) — session-types.ts
- Dockview `layout` → Lath `lathLayout` upgrade reader — dockview-convert.ts (+test), the
  `PersistedSession.layout` field, `persistedLathLayout` fallback
- Pre-Lath `PersistedDoor` positioning fields + `legacyTokenFromDoor` +
  `edgeForDoorDirection` + door-alias canonicalization in leafMetaFromDoor / LathHost
- Pre-workspace bare-session → PersistedWindow migration in readPersistedWindow
- `migrateTodoState` + legacy `ALERT_DISABLED` status handling — alert-manager.ts
- Browser `renderMode` legacy-blob resolution (`surfaceType: iframe/agent-browser`,
  `poppedOut`) + BrowserPanel canonicalization effect
- WebKit localStorage → Rust store one-time migration (the SUNSET branch) — tauri-adapter.ts

Hardening: readPersistedSession / readPersistedWindow warn-and-return-null on
unreadable content; loadSessionState parses defensively so bad JSON degrades to
a fresh start instead of throwing.

Specs updated to match (transport, tiling-engine, standalone, alert, dor-browser,
layout, glossary); spec-lint passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cleanups surfaced by the reuse/simplification/efficiency/altitude review:
- agent-browser-surface-controller: `params.renderMode ?? resolveRenderMode(params)`
  collapses to `params.renderMode === 'ab-popout'`; drop the now-dead import.
- browser-surface `resolveRenderMode`: drop the redundant `|| === 'iframe'` arm
  (the fall-through already returns 'iframe').
- session-types `readPersistedSession`: drop the redundant `isRecord()` prefix —
  `isPersistedSessionV3` already checks it.
- Sweep stale test fixtures still spelling the removed legacy `PersistedDoor`
  fields (session-save.test.ts) and the obsolete `.layout` assertion (Wall.test.tsx).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: e32207b
Status: ✅  Deploy successful!
Preview URL: https://4cbf63fa.mouseterm.pages.dev
Branch Preview URL: https://migration.mouseterm.pages.dev

View logs

@nedtwigg nedtwigg merged commit 91d93e5 into main Jul 8, 2026
9 checks passed
@nedtwigg nedtwigg deleted the migration branch July 8, 2026 17:46
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