Introduce internal/storage/faultstore, a storage.Storer wrapper that
injects faults through the existing seam rather than patching production
code: an interrupted upload, a backend that reports success while
storing nothing, and corrupt or truncated reads.
Each test asserts the observable end state — index, destination, and
what the user is told — not just that an error came back. Two scenarios
expose real defects and are skipped, pointing to a tracking issue rather
than asserting today's wrong behavior: retry after an interrupted upload
(#148) and a disk-full restore
that leaves a truncated file at the target
(#163). Automatic repair of a
half-exported snapshot is left to the first.
The tests run serially because each calls log.Initialize, replacing the
global logger a concurrent backup reads.
Model: opus-4-8