Skip to content

feat(store): atomically restore selected project annotations - #1688

Merged
leemour merged 3 commits into
mainfrom
feat/project-snapshot-restore
Oct 20, 2026
Merged

leemour merged 3 commits into
mainfrom
feat/project-snapshot-restore

Conversation

@leemour

@leemour leemour commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Project annotation restore needs the target preview rechecked under the actual write lock. Add an optional provider-neutral store.projectAnnotations port over the existing connection: preview and atomic selected-facet restore requiring an exact preview fingerprint.

Restore rechecks real target content/namespace/preconditions within BEGIN IMMEDIATE, maps external and owned references, preserves alias/project metadata, fact lifecycle/authorship and generic-link provenance, and rolls back all insertions on failure. It opens or migrates no additional store. Native read-only handles still refuse writes. Hosts must enforce owner authorization; this SDK adds no CLI/MCP mutation host or live reset, and omitted facets remain outside the selected format.

Thin hosts also reuse the exported structural snapshot schema and readBoundedUtf8File (ordinary-file size preflight, bounded reads, fatal UTF-8 decoding), keeping the shared batch-input limit unchanged. Graph/total-byte validation remains in the snapshot decoder.

Validation: 58 focused synthetic cases, typecheck and build/docs checks pass. Nine restore cases cover different IDs and logical snapshot equality, unchanged shared/unrelated records, exact retry refusal, injected mid-insertion rollback, stale target/source/namespace, unknown fields, decision replacement/reversal, later owned-fact references and native read-only refusal; two file cases cover exact budgets, oversize, invalid UTF-8 and invalid budgets. Full coverage/parity/Bun/old-Node/restart checks run in CI. Captured0.373 source/changelog stays unchanged.

@leemour
leemour merged commit 28913a4 into main Oct 20, 2026
12 checks passed
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