The v2 foundation (V2-SPEC §5.1). Two things land: - PRAGMA user_version migration runner in internal/hub/meta: ordered, append-only, each step in its own txn with the version bump LAST so a crash rolls back cleanly. Backs up an existing DB to <path>.pre-v2.bak (VACUUM INTO) before migrating; refuses a DB written by a newer build. Every later v2 schema change rides this. - Re-key snapshots from a GLOBAL id PK to per-(share, id). v1's global id meant identical content pushed to two shares collided on one row, so the second share never counted its chunk refcounts (undercount) and recorded no snapshot row. Per-share rows fix the refcount and let each share own its history. Wire id/Head stays the manifest hash — clients unchanged. Migration also backfills any share head left rowless by the v1 idempotent push, restoring the head-has-a-row invariant. GC reworked to prune per (share, id), decrementing each share's chunks and freeing a shared manifest blob at most once. Tests: cross-share refcount, migration versioning + refuse-newer, and a realistic populated-v1 -> v2 upgrade (data preserved, backup written, head backfill). All 17 pkgs -race green; hub cross-compiles linux/amd64. Deferred to M8-3 (conflict sidecar): restore/deploy conflict-copy — a naive version breaks restore-reproduces-snapshot; it needs the base/ancestor awareness the sidecar introduces. snapshot_chunks edge table deferred to M9 (no consumer yet; the runner makes adding it a one-line migration).
9 lines
74 B
Text
9 lines
74 B
Text
.devbox/
|
|
.claude/
|
|
blobs/
|
|
*.pre-v2.bak
|
|
*.db
|
|
*.db-wal
|
|
*.db-shm
|
|
/dist/
|
|
/bin/
|