Commit 7e93ce6
feat: version history for sketches (image documents) (#4719)
* feat: sketch document version history — data layer
Mirror timeline sequence versioning (#4712) for sketches: an
image_document_versions table with a per-document monotonic version
number, an ImageDocumentVersion model (snapshot with unique-violation
retry, autosave pruning that never touches manual/restore snapshots),
the migration plus PG bootstrap DDL, and the protocol schemas for the
document-level version history distinct from per-layer generation takes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018yzrorMvguPf5DMZjMRNP8
* feat: sketch document version history — router, CLI, harness
The sketch tRPC router gains a documentVersions sub-router (list, get,
create, restore, delete) alongside the existing per-layer generation
takes: restore snapshots the pre-restore state first so it is undoable,
sketch.update writes a best-effort autosave at most every five minutes
(20 kept, pruned), and sketch.delete removes the document's history.
nodetool sketch versions list|show|create|restore|delete reads and
writes the same history against the local database; restore CAS-writes
the snapshot back and exits non-zero when the restored document no
longer parses as a JSON object. The sketch surface and its harness are
registered in the harness registry, and CLAUDE.md documents the command.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018yzrorMvguPf5DMZjMRNP8
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent aee8432 commit 7e93ce6
22 files changed
Lines changed: 2459 additions & 5 deletions
File tree
- packages
- cli
- src
- commands
- harness
- tests
- models
- src
- migrations
- schema-pg
- schema
- tests
- protocol
- src/api-schemas
- tests
- websocket
- src/trpc/routers
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
667 | 667 | | |
668 | 668 | | |
669 | 669 | | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
670 | 694 | | |
671 | 695 | | |
672 | 696 | | |
| |||
0 commit comments