#541: file versioning v1 #622
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-541"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements the accepted ADR (VERSIONING.md) end to end.
Engine + decorator (
internal/storage/versions, TDD on an in-memory driver):<dir>/.cairn-versions/<basename>/<rfc3339>_<seq>_<author>.v— lexicographic = chronological, author rides the key (no metadata index). Mint before write: a crash leaves a harmless extra version, never a lost file.baseStore(raw), so rotation covers version blobs with no change.API:
GET /api/v1/versions,GET /api/v1/versions/raw,POST /api/v1/versions/restore— Stat-gated,/sharedrefused (recipients hidden, per review), restore own-home-only in v1 (the raw restore bypasses scope/hold by design — ADR allows restore under hold since it mints current first). Restore emitsversion-restoreaudit (registered in Verbs) + arestoreactivity event.Settings:
versionsMaxPerFile/versionsMaxAgeDays(-1 = forever) /versionsCoalesceMinutes, zero = ADR defaults, read live.UI: Versions drill-in row in the details pane (files only, hidden on delegated paths), panel rows time · author · size with Download and Restore (restore hidden on read-only), inline empty state, i18n ×4.
feat.versionsboot probe.Deferred (noted in ADR + issue): admin "of which versions" line, changes-journal nudge on restore, restore beyond own home.