Skip to content

Conversation

@anantham
Copy link
Owner

Summary

  • Add tiered storage abstraction for migration backups (OPFS → BackupDB → localStorage → Download)
  • Shared types and metadata helpers for backup/restore modules
  • Foundation for the migration safety system

Changes

File LOC Purpose
migrationTypes.ts 108 Types, constants, metadata helpers
backupStorage.ts 237 Tiered storage for writing backups
restoreStorage.ts 170 Tiered retrieval for reading backups

Test plan

  • TypeScript compilation passes
  • Unit tests in follow-up PR
  • Manual testing after full integration (PR 3)

Part of Migration Safety Feature

This is PR 1 of 4:

  1. Storage layer (this PR)
  2. Backup + version gate
  3. Restore + connection integration
  4. UI components

🤖 Generated with Claude Code

MOTIVATION:
- Pre-migration backups protect user data during schema upgrades
- Tiered storage (OPFS → BackupDB → localStorage → Download) ensures
  backup succeeds across different browser capabilities
- Shared types enable clean separation between backup and restore modules

APPROACH:
- migrationTypes.ts: Shared types, constants, and metadata helpers
- backupStorage.ts: Tiered storage abstraction for writing backups
- restoreStorage.ts: Tiered retrieval abstraction for reading backups
- Each module is under 300 LOC following project conventions

CHANGES:
- services/db/core/migrationTypes.ts: Types and metadata management (108 LOC)
- services/db/core/backupStorage.ts: Store backup with fallback tiers (237 LOC)
- services/db/core/restoreStorage.ts: Retrieve backup from any tier (170 LOC)

IMPACT:
- Foundation for migration backup/restore system
- No runtime changes yet - modules are not wired into connection.ts
- Part 1 of 4 PRs for migration safety feature

TESTING:
- TypeScript compilation passes
- Unit tests to be added in separate PR

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Dec 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
lexicon-forge Ready Ready Preview, Comment Dec 22, 2025 2:36am

@anantham anantham merged commit 11571d5 into main Dec 22, 2025
3 checks passed
@anantham anantham deleted the feat/migration-safety-1-storage branch December 22, 2025 04:34
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