~bigbes/sourcehut-dolt: 19645e70

storage: bare store init/delete and remotesrv DBCache

InitStore writes a bare NBS store (LoadDoltDB Format_DOLT + WriteEmptyRepo)
with partial-failure cleanup; DeleteStore guards against paths escaping the
configured repos root; RepoDiskPath lays out <root>/~<owner>/<name>.

Cache implements remotesrv.DBCache over an injected RepoLookup (no db import,
no push-to-create): Get resolves via core.ParseRepoPath, memoizes one
nbs.NewLocalStore per disk path, never creates directories; Evict/Close for
delete and shutdown. Package doc records the LocalFilesysWithWorkingDir
sealed-URL requirement proven by the Phase-0 spike.

Unit tests cover store validity (reopen, main branch, initial commit),
partial-failure cleanup, root-escape guard, and cache hit/miss/memoize/evict.
Spike test untouched and still green.

Eugene Blikh <bigbes@gmail.com> — 2026-07-18 17:31:21 UTC

Commit 19645e70751196242d9c3bd4bdd002f43d89ee2aview raw patch

Parent(s): ca9357a0

3 changed file(s)

FileStatus+
storage/dbcache.go A +118
storage/init.go A +115
storage/storage_test.go A +261