refactor(snapshot): give the snapshot codec its own layer
The durable snapshot format moves from internal/usecase/snapshot to internal/snapshotcodec, a layer that depends only on domain and ports. The daemon and the snapshot adapter both import it, so the adapters/snapshot -> usecase/snapshot boundary exception is removed.
- commit
- 5c38eb4b06d98b831d2ed07316c345ead4e1e1c4
- author
- brice · · 2026-10-08 05:24 UTC
- parent
- 59ad951
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
42 files · +59 -49
M AGENTS.md +3 -2
| @@ -31,14 +31,15 @@ go test ./internal/adapters/ipc ./internal/usecase/daemon -run '^$' -bench=. -be | |||
| 31 | 31 | The exhaustive production matrix and separate test-import policy are enforced by `boundary_test.go`; package ownership is documented in `docs/architecture.md`. | |
| 32 | 32 | ||
| 33 | 33 | - `pkg/` is reusable and never imports `internal/`. | |
| 34 | - | - Production use cases import only `internal/ports`, semantic `internal/protocol` packages, `internal/domain`, and approved sibling use cases. | |
| 34 | + | - Production use cases import only `internal/ports`, semantic `internal/protocol` packages, `internal/domain`, `internal/snapshotcodec`, and approved sibling use cases. | |
| 35 | 35 | - Production use cases never import `internal/protocol/wire`, concrete adapters, `internal/app`, `internal/persist`, or `internal/platform`. | |
| 36 | 36 | - `internal/ports` owns application seams, not codecs, raw frames, environment policy, or worker implementations. | |
| 37 | 37 | ||
| 38 | 38 | Layer map: | |
| 39 | 39 | ||
| 40 | 40 | - `main.go` → `internal/app`: CLI parsing, composition, daemon startup, and hidden subcommands. | |
| 41 | - | - `internal/domain`: pure shared values and terminal capability policy. | |
| 41 | + | - `internal/domain`: pure shared values, the pane layout tree, and terminal capability policy. | |
| 42 | + | - `internal/snapshotcodec`: durable snapshot format, shared by the daemon and the snapshot adapter. | |
| 42 | 43 | - `internal/protocol`: typed session messages; `protocol/catalogue` owns remote JSON schema; `protocol/wire` owns binary encoding and raw carriage contracts. | |
| 43 | 44 | - `internal/ports`: typed application connections and infrastructure-facing use-case seams. | |
| 44 | 45 | - `internal/adapters/sessionwire`: typed message ↔ raw frame adaptation. | |
| @@ -31,14 +31,15 @@ go test ./internal/adapters/ipc ./internal/usecase/daemon -run '^$' -bench=. -be | |||||
| 31 | The exhaustive production matrix and separate test-import policy are enforced by `boundary_test.go`; package ownership is documented in `docs/architecture.md`. | 31 | The exhaustive production matrix and separate test-import policy are enforced by `boundary_test.go`; package ownership is documented in `docs/architecture.md`. | ||
| 32 | 32 | ||||
| 33 | - `pkg/` is reusable and never imports `internal/`. | 33 | - `pkg/` is reusable and never imports `internal/`. | ||
| 34 | - | - Production use cases import only `internal/ports`, semantic `internal/protocol` packages, `internal/domain`, and approved sibling use cases. | 34 | + | - Production use cases import only `internal/ports`, semantic `internal/protocol` packages, `internal/domain`, `internal/snapshotcodec`, and approved sibling use cases. |
| 35 | - Production use cases never import `internal/protocol/wire`, concrete adapters, `internal/app`, `internal/persist`, or `internal/platform`. | 35 | - Production use cases never import `internal/protocol/wire`, concrete adapters, `internal/app`, `internal/persist`, or `internal/platform`. | ||
| 36 | - `internal/ports` owns application seams, not codecs, raw frames, environment policy, or worker implementations. | 36 | - `internal/ports` owns application seams, not codecs, raw frames, environment policy, or worker implementations. | ||
| 37 | 37 | ||||
| 38 | Layer map: | 38 | Layer map: | ||
| 39 | 39 | ||||
| 40 | - `main.go` → `internal/app`: CLI parsing, composition, daemon startup, and hidden subcommands. | 40 | - `main.go` → `internal/app`: CLI parsing, composition, daemon startup, and hidden subcommands. | ||
| 41 | - | - `internal/domain`: pure shared values and terminal capability policy. | 41 | + | - `internal/domain`: pure shared values, the pane layout tree, and terminal capability policy. |
| 42 | + | - `internal/snapshotcodec`: durable snapshot format, shared by the daemon and the snapshot adapter. | |||
| 42 | - `internal/protocol`: typed session messages; `protocol/catalogue` owns remote JSON schema; `protocol/wire` owns binary encoding and raw carriage contracts. | 43 | - `internal/protocol`: typed session messages; `protocol/catalogue` owns remote JSON schema; `protocol/wire` owns binary encoding and raw carriage contracts. | ||
| 43 | - `internal/ports`: typed application connections and infrastructure-facing use-case seams. | 44 | - `internal/ports`: typed application connections and infrastructure-facing use-case seams. | ||
| 44 | - `internal/adapters/sessionwire`: typed message ↔ raw frame adaptation. | 45 | - `internal/adapters/sessionwire`: typed message ↔ raw frame adaptation. | ||
M boundary_test.go +12 -7
| @@ -30,6 +30,7 @@ const ( | |||
| 30 | 30 | layerWire packageLayer = "wire" | |
| 31 | 31 | layerDomain packageLayer = "domain" | |
| 32 | 32 | layerPersist packageLayer = "persist" | |
| 33 | + | layerSnapshot packageLayer = "snapshot-codec" | |
| 33 | 34 | layerPlatform packageLayer = "platform" | |
| 34 | 35 | layerLogging packageLayer = "logging" | |
| 35 | 36 | layerPkg packageLayer = "pkg" | |
| @@ -40,15 +41,16 @@ var productionDependencies = map[packageLayer]map[packageLayer]bool{ | |||
| 40 | 41 | layerRoot: {layerApp: true}, | |
| 41 | 42 | layerCommand: {layerPkg: true}, | |
| 42 | 43 | layerScript: {layerAdapter: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true, layerWire: true, layerPkg: true}, | |
| 43 | - | layerApp: {layerAdapter: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true, layerWire: true, layerUsecase: true, layerPersist: true, layerPlatform: true, layerLogging: true, layerPkg: true}, | |
| 44 | - | layerAdapter: {layerAdapter: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true, layerWire: true, layerPlatform: true, layerPkg: true}, | |
| 45 | - | layerUsecase: {layerUsecase: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true}, | |
| 44 | + | layerApp: {layerAdapter: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true, layerWire: true, layerUsecase: true, layerPersist: true, layerSnapshot: true, layerPlatform: true, layerLogging: true, layerPkg: true}, | |
| 45 | + | layerAdapter: {layerAdapter: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true, layerWire: true, layerSnapshot: true, layerPlatform: true, layerPkg: true}, | |
| 46 | + | layerUsecase: {layerUsecase: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true, layerSnapshot: true}, | |
| 46 | 47 | layerPorts: {layerDomain: true, layerProtocol: true, layerCatalogue: true}, | |
| 47 | 48 | layerProtocol: {layerDomain: true}, | |
| 48 | 49 | layerCatalogue: {layerDomain: true, layerProtocol: true}, | |
| 49 | 50 | layerWire: {layerDomain: true, layerProtocol: true}, | |
| 50 | 51 | layerDomain: {layerDomain: true}, | |
| 51 | 52 | layerPersist: {layerDomain: true, layerPorts: true, layerProtocol: true, layerPkg: true}, | |
| 53 | + | layerSnapshot: {layerDomain: true, layerPorts: true}, | |
| 52 | 54 | layerPlatform: {}, | |
| 53 | 55 | layerLogging: {layerPkg: true}, | |
| 54 | 56 | layerPkg: {layerPkg: true}, | |
| @@ -91,7 +93,11 @@ func TestImportBoundaryNegativeFixtures(t *testing.T) { | |||
| 91 | 93 | {"usecase rejects adapter", modulePath + "/internal/usecase/client", modulePath + "/internal/adapters/ipc", false, false}, | |
| 92 | 94 | {"domain rejects ports", modulePath + "/internal/domain", modulePath + "/internal/ports", false, false}, | |
| 93 | 95 | {"pkg rejects internal", modulePath + "/pkg/rawterm", modulePath + "/internal/domain", false, false}, | |
| 94 | - | {"snapshot adapter exception", modulePath + "/internal/adapters/snapshot", modulePath + "/internal/usecase/snapshot", false, true}, | |
| 96 | + | {"snapshot adapter accepts codec", modulePath + "/internal/adapters/snapshot", modulePath + "/internal/snapshotcodec", false, true}, | |
| 97 | + | {"daemon accepts snapshot codec", modulePath + "/internal/usecase/daemon", modulePath + "/internal/snapshotcodec", false, true}, | |
| 98 | + | {"snapshot codec rejects usecase", modulePath + "/internal/snapshotcodec", modulePath + "/internal/usecase/daemon", false, false}, | |
| 99 | + | {"snapshot codec rejects adapter", modulePath + "/internal/snapshotcodec", modulePath + "/internal/adapters/snapshot", false, false}, | |
| 100 | + | {"snapshot adapter rejects usecase", modulePath + "/internal/adapters/snapshot", modulePath + "/internal/usecase/daemon", false, false}, | |
| 95 | 101 | {"other adapter rejects usecase", modulePath + "/internal/adapters/ipc", modulePath + "/internal/usecase/client", false, false}, | |
| 96 | 102 | {"usecase test may use wire fixture", modulePath + "/internal/usecase/client", modulePath + "/internal/protocol/wire", true, true}, | |
| 97 | 103 | {"pkg test still rejects internal", modulePath + "/pkg/rawterm", modulePath + "/internal/domain", true, false}, | |
| @@ -201,9 +207,6 @@ func dependencyAllowed(source, target string, testFile bool) (bool, error) { | |||
| 201 | 207 | if sourceLayer == layerTestSupport { | |
| 202 | 208 | return testSupportDependencyAllowed(source, targetLayer), nil | |
| 203 | 209 | } | |
| 204 | - | if source == modulePath+"/internal/adapters/snapshot" && target == modulePath+"/internal/usecase/snapshot" { | |
| 205 | - | return true, nil | |
| 206 | - | } | |
| 207 | 210 | if packageImportDenied(source, target) { | |
| 208 | 211 | return false, nil | |
| 209 | 212 | } | |
| @@ -275,6 +278,8 @@ func classifyPackage(path string) (packageLayer, error) { | |||
| 275 | 278 | return layerUsecase, nil | |
| 276 | 279 | case path == modulePath+"/internal/persist": | |
| 277 | 280 | return layerPersist, nil | |
| 281 | + | case path == modulePath+"/internal/snapshotcodec": | |
| 282 | + | return layerSnapshot, nil | |
| 278 | 283 | case path == modulePath+"/internal/platform": | |
| 279 | 284 | return layerPlatform, nil | |
| 280 | 285 | case path == modulePath+"/internal/logging": | |
| @@ -30,6 +30,7 @@ const ( | |||||
| 30 | layerWire packageLayer = "wire" | 30 | layerWire packageLayer = "wire" | ||
| 31 | layerDomain packageLayer = "domain" | 31 | layerDomain packageLayer = "domain" | ||
| 32 | layerPersist packageLayer = "persist" | 32 | layerPersist packageLayer = "persist" | ||
| 33 | + | layerSnapshot packageLayer = "snapshot-codec" | |||
| 33 | layerPlatform packageLayer = "platform" | 34 | layerPlatform packageLayer = "platform" | ||
| 34 | layerLogging packageLayer = "logging" | 35 | layerLogging packageLayer = "logging" | ||
| 35 | layerPkg packageLayer = "pkg" | 36 | layerPkg packageLayer = "pkg" | ||
| @@ -40,15 +41,16 @@ var productionDependencies = map[packageLayer]map[packageLayer]bool{ | |||||
| 40 | layerRoot: {layerApp: true}, | 41 | layerRoot: {layerApp: true}, | ||
| 41 | layerCommand: {layerPkg: true}, | 42 | layerCommand: {layerPkg: true}, | ||
| 42 | layerScript: {layerAdapter: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true, layerWire: true, layerPkg: true}, | 43 | layerScript: {layerAdapter: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true, layerWire: true, layerPkg: true}, | ||
| 43 | - | layerApp: {layerAdapter: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true, layerWire: true, layerUsecase: true, layerPersist: true, layerPlatform: true, layerLogging: true, layerPkg: true}, | 44 | + | layerApp: {layerAdapter: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true, layerWire: true, layerUsecase: true, layerPersist: true, layerSnapshot: true, layerPlatform: true, layerLogging: true, layerPkg: true}, |
| 44 | - | layerAdapter: {layerAdapter: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true, layerWire: true, layerPlatform: true, layerPkg: true}, | 45 | + | layerAdapter: {layerAdapter: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true, layerWire: true, layerSnapshot: true, layerPlatform: true, layerPkg: true}, |
| 45 | - | layerUsecase: {layerUsecase: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true}, | 46 | + | layerUsecase: {layerUsecase: true, layerDomain: true, layerPorts: true, layerProtocol: true, layerCatalogue: true, layerSnapshot: true}, |
| 46 | layerPorts: {layerDomain: true, layerProtocol: true, layerCatalogue: true}, | 47 | layerPorts: {layerDomain: true, layerProtocol: true, layerCatalogue: true}, | ||
| 47 | layerProtocol: {layerDomain: true}, | 48 | layerProtocol: {layerDomain: true}, | ||
| 48 | layerCatalogue: {layerDomain: true, layerProtocol: true}, | 49 | layerCatalogue: {layerDomain: true, layerProtocol: true}, | ||
| 49 | layerWire: {layerDomain: true, layerProtocol: true}, | 50 | layerWire: {layerDomain: true, layerProtocol: true}, | ||
| 50 | layerDomain: {layerDomain: true}, | 51 | layerDomain: {layerDomain: true}, | ||
| 51 | layerPersist: {layerDomain: true, layerPorts: true, layerProtocol: true, layerPkg: true}, | 52 | layerPersist: {layerDomain: true, layerPorts: true, layerProtocol: true, layerPkg: true}, | ||
| 53 | + | layerSnapshot: {layerDomain: true, layerPorts: true}, | |||
| 52 | layerPlatform: {}, | 54 | layerPlatform: {}, | ||
| 53 | layerLogging: {layerPkg: true}, | 55 | layerLogging: {layerPkg: true}, | ||
| 54 | layerPkg: {layerPkg: true}, | 56 | layerPkg: {layerPkg: true}, | ||
| @@ -91,7 +93,11 @@ func TestImportBoundaryNegativeFixtures(t *testing.T) { | |||||
| 91 | {"usecase rejects adapter", modulePath + "/internal/usecase/client", modulePath + "/internal/adapters/ipc", false, false}, | 93 | {"usecase rejects adapter", modulePath + "/internal/usecase/client", modulePath + "/internal/adapters/ipc", false, false}, | ||
| 92 | {"domain rejects ports", modulePath + "/internal/domain", modulePath + "/internal/ports", false, false}, | 94 | {"domain rejects ports", modulePath + "/internal/domain", modulePath + "/internal/ports", false, false}, | ||
| 93 | {"pkg rejects internal", modulePath + "/pkg/rawterm", modulePath + "/internal/domain", false, false}, | 95 | {"pkg rejects internal", modulePath + "/pkg/rawterm", modulePath + "/internal/domain", false, false}, | ||
| 94 | - | {"snapshot adapter exception", modulePath + "/internal/adapters/snapshot", modulePath + "/internal/usecase/snapshot", false, true}, | 96 | + | {"snapshot adapter accepts codec", modulePath + "/internal/adapters/snapshot", modulePath + "/internal/snapshotcodec", false, true}, |
| 97 | + | {"daemon accepts snapshot codec", modulePath + "/internal/usecase/daemon", modulePath + "/internal/snapshotcodec", false, true}, | |||
| 98 | + | {"snapshot codec rejects usecase", modulePath + "/internal/snapshotcodec", modulePath + "/internal/usecase/daemon", false, false}, | |||
| 99 | + | {"snapshot codec rejects adapter", modulePath + "/internal/snapshotcodec", modulePath + "/internal/adapters/snapshot", false, false}, | |||
| 100 | + | {"snapshot adapter rejects usecase", modulePath + "/internal/adapters/snapshot", modulePath + "/internal/usecase/daemon", false, false}, | |||
| 95 | {"other adapter rejects usecase", modulePath + "/internal/adapters/ipc", modulePath + "/internal/usecase/client", false, false}, | 101 | {"other adapter rejects usecase", modulePath + "/internal/adapters/ipc", modulePath + "/internal/usecase/client", false, false}, | ||
| 96 | {"usecase test may use wire fixture", modulePath + "/internal/usecase/client", modulePath + "/internal/protocol/wire", true, true}, | 102 | {"usecase test may use wire fixture", modulePath + "/internal/usecase/client", modulePath + "/internal/protocol/wire", true, true}, | ||
| 97 | {"pkg test still rejects internal", modulePath + "/pkg/rawterm", modulePath + "/internal/domain", true, false}, | 103 | {"pkg test still rejects internal", modulePath + "/pkg/rawterm", modulePath + "/internal/domain", true, false}, | ||
| @@ -201,9 +207,6 @@ func dependencyAllowed(source, target string, testFile bool) (bool, error) { | |||||
| 201 | if sourceLayer == layerTestSupport { | 207 | if sourceLayer == layerTestSupport { | ||
| 202 | return testSupportDependencyAllowed(source, targetLayer), nil | 208 | return testSupportDependencyAllowed(source, targetLayer), nil | ||
| 203 | } | 209 | } | ||
| 204 | - | if source == modulePath+"/internal/adapters/snapshot" && target == modulePath+"/internal/usecase/snapshot" { | |||
| 205 | - | return true, nil | |||
| 206 | - | } | |||
| 207 | if packageImportDenied(source, target) { | 210 | if packageImportDenied(source, target) { | ||
| 208 | return false, nil | 211 | return false, nil | ||
| 209 | } | 212 | } | ||
| @@ -275,6 +278,8 @@ func classifyPackage(path string) (packageLayer, error) { | |||||
| 275 | return layerUsecase, nil | 278 | return layerUsecase, nil | ||
| 276 | case path == modulePath+"/internal/persist": | 279 | case path == modulePath+"/internal/persist": | ||
| 277 | return layerPersist, nil | 280 | return layerPersist, nil | ||
| 281 | + | case path == modulePath+"/internal/snapshotcodec": | |||
| 282 | + | return layerSnapshot, nil | |||
| 278 | case path == modulePath+"/internal/platform": | 283 | case path == modulePath+"/internal/platform": | ||
| 279 | return layerPlatform, nil | 284 | return layerPlatform, nil | ||
| 280 | case path == modulePath+"/internal/logging": | 285 | case path == modulePath+"/internal/logging": | ||
M docs/architecture.md +1 -1
| @@ -60,7 +60,7 @@ main → app → usecase → ports | |||
| 60 | 60 | carriage adapters | |
| 61 | 61 | ``` | |
| 62 | 62 | ||
| 63 | - | `internal/app` may import every layer to compose the process. Adapters depend inward on ports, protocol, and domain. The existing `adapters/snapshot → usecase/snapshot` dependency is an explicit exception until the snapshot codec has its own owner. Production dependency rules and the separate test-import policy are executable in `boundary_test.go`. | |
| 63 | + | `internal/app` may import every layer to compose the process. Adapters depend inward on ports, protocol, and domain. `internal/snapshotcodec` owns the durable snapshot format (session codec, manifests, objects, preflight); it depends only on domain and ports, and both the daemon use case and the snapshot adapter consume it. Production dependency rules and the separate test-import policy are executable in `boundary_test.go`. | |
| 64 | 64 | ||
| 65 | 65 | ## UI observation and control | |
| 66 | 66 | ||
| @@ -60,7 +60,7 @@ main → app → usecase → ports | |||||
| 60 | carriage adapters | 60 | carriage adapters | ||
| 61 | ``` | 61 | ``` | ||
| 62 | 62 | ||||
| 63 | - | `internal/app` may import every layer to compose the process. Adapters depend inward on ports, protocol, and domain. The existing `adapters/snapshot → usecase/snapshot` dependency is an explicit exception until the snapshot codec has its own owner. Production dependency rules and the separate test-import policy are executable in `boundary_test.go`. | 63 | + | `internal/app` may import every layer to compose the process. Adapters depend inward on ports, protocol, and domain. `internal/snapshotcodec` owns the durable snapshot format (session codec, manifests, objects, preflight); it depends only on domain and ports, and both the daemon use case and the snapshot adapter consume it. Production dependency rules and the separate test-import policy are executable in `boundary_test.go`. |
| 64 | 64 | ||||
| 65 | ## UI observation and control | 65 | ## UI observation and control | ||
| 66 | 66 | ||||
M internal/adapters/snapshot/direct_load_test.go +1 -1
| @@ -11,8 +11,8 @@ import ( | |||
| 11 | 11 | ||
| 12 | 12 | "github.com/bnema/vev/internal/domain" | |
| 13 | 13 | "github.com/bnema/vev/internal/ports" | |
| 14 | + | codec "github.com/bnema/vev/internal/snapshotcodec" | |
| 14 | 15 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | |
| 15 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 16 | 16 | "github.com/stretchr/testify/require" | |
| 17 | 17 | ) | |
| 18 | 18 | ||
| @@ -11,8 +11,8 @@ import ( | |||||
| 11 | 11 | ||||
| 12 | "github.com/bnema/vev/internal/domain" | 12 | "github.com/bnema/vev/internal/domain" | ||
| 13 | "github.com/bnema/vev/internal/ports" | 13 | "github.com/bnema/vev/internal/ports" | ||
| 14 | + | codec "github.com/bnema/vev/internal/snapshotcodec" | |||
| 14 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | 15 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | ||
| 15 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | |||
| 16 | "github.com/stretchr/testify/require" | 16 | "github.com/stretchr/testify/require" | ||
| 17 | ) | 17 | ) | ||
| 18 | 18 | ||||
M internal/adapters/snapshot/load.go +1 -1
| @@ -10,7 +10,7 @@ import ( | |||
| 10 | 10 | ||
| 11 | 11 | "github.com/bnema/vev/internal/domain" | |
| 12 | 12 | "github.com/bnema/vev/internal/ports" | |
| 13 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 13 | + | codec "github.com/bnema/vev/internal/snapshotcodec" | |
| 14 | 14 | ) | |
| 15 | 15 | ||
| 16 | 16 | var ErrInvalidHEAD = errors.New("invalid snapshot HEAD") | |
| @@ -10,7 +10,7 @@ import ( | |||||
| 10 | 10 | ||||
| 11 | "github.com/bnema/vev/internal/domain" | 11 | "github.com/bnema/vev/internal/domain" | ||
| 12 | "github.com/bnema/vev/internal/ports" | 12 | "github.com/bnema/vev/internal/ports" | ||
| 13 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | 13 | + | codec "github.com/bnema/vev/internal/snapshotcodec" |
| 14 | ) | 14 | ) | ||
| 15 | 15 | ||||
| 16 | var ErrInvalidHEAD = errors.New("invalid snapshot HEAD") | 16 | var ErrInvalidHEAD = errors.New("invalid snapshot HEAD") | ||
M internal/adapters/snapshot/maintenance_gc.go +1 -1
| @@ -10,7 +10,7 @@ import ( | |||
| 10 | 10 | ||
| 11 | 11 | "github.com/bnema/vev/internal/domain" | |
| 12 | 12 | "github.com/bnema/vev/internal/ports" | |
| 13 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 13 | + | codec "github.com/bnema/vev/internal/snapshotcodec" | |
| 14 | 14 | ) | |
| 15 | 15 | ||
| 16 | 16 | // SnapshotIncarnations lists the canonical incarnation directories. | |
| @@ -10,7 +10,7 @@ import ( | |||||
| 10 | 10 | ||||
| 11 | "github.com/bnema/vev/internal/domain" | 11 | "github.com/bnema/vev/internal/domain" | ||
| 12 | "github.com/bnema/vev/internal/ports" | 12 | "github.com/bnema/vev/internal/ports" | ||
| 13 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | 13 | + | codec "github.com/bnema/vev/internal/snapshotcodec" |
| 14 | ) | 14 | ) | ||
| 15 | 15 | ||||
| 16 | // SnapshotIncarnations lists the canonical incarnation directories. | 16 | // SnapshotIncarnations lists the canonical incarnation directories. | ||
M internal/adapters/snapshot/path_security_test.go +1 -1
| @@ -10,7 +10,7 @@ import ( | |||
| 10 | 10 | "testing" | |
| 11 | 11 | ||
| 12 | 12 | "github.com/bnema/vev/internal/domain" | |
| 13 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 13 | + | codec "github.com/bnema/vev/internal/snapshotcodec" | |
| 14 | 14 | ) | |
| 15 | 15 | ||
| 16 | 16 | func TestRepositoryRejectsSymlinkedRoot(t *testing.T) { | |
| @@ -10,7 +10,7 @@ import ( | |||||
| 10 | "testing" | 10 | "testing" | ||
| 11 | 11 | ||||
| 12 | "github.com/bnema/vev/internal/domain" | 12 | "github.com/bnema/vev/internal/domain" | ||
| 13 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | 13 | + | codec "github.com/bnema/vev/internal/snapshotcodec" |
| 14 | ) | 14 | ) | ||
| 15 | 15 | ||||
| 16 | func TestRepositoryRejectsSymlinkedRoot(t *testing.T) { | 16 | func TestRepositoryRejectsSymlinkedRoot(t *testing.T) { | ||
M internal/adapters/snapshot/publish.go +1 -1
| @@ -10,7 +10,7 @@ import ( | |||
| 10 | 10 | ||
| 11 | 11 | "github.com/bnema/vev/internal/domain" | |
| 12 | 12 | "github.com/bnema/vev/internal/ports" | |
| 13 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 13 | + | codec "github.com/bnema/vev/internal/snapshotcodec" | |
| 14 | 14 | ) | |
| 15 | 15 | ||
| 16 | 16 | func (r *Repository) Publish(ctx context.Context, publication ports.SnapshotPublication) error { | |
| @@ -10,7 +10,7 @@ import ( | |||||
| 10 | 10 | ||||
| 11 | "github.com/bnema/vev/internal/domain" | 11 | "github.com/bnema/vev/internal/domain" | ||
| 12 | "github.com/bnema/vev/internal/ports" | 12 | "github.com/bnema/vev/internal/ports" | ||
| 13 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | 13 | + | codec "github.com/bnema/vev/internal/snapshotcodec" |
| 14 | ) | 14 | ) | ||
| 15 | 15 | ||||
| 16 | func (r *Repository) Publish(ctx context.Context, publication ports.SnapshotPublication) error { | 16 | func (r *Repository) Publish(ctx context.Context, publication ports.SnapshotPublication) error { | ||
M internal/adapters/snapshot/publish_efficiency_test.go +1 -1
| @@ -10,7 +10,7 @@ import ( | |||
| 10 | 10 | ||
| 11 | 11 | "github.com/bnema/vev/internal/domain" | |
| 12 | 12 | "github.com/bnema/vev/internal/ports" | |
| 13 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 13 | + | codec "github.com/bnema/vev/internal/snapshotcodec" | |
| 14 | 14 | ) | |
| 15 | 15 | ||
| 16 | 16 | func TestRepositoryPublishRevalidatesUnchangedTenThousandObjectHistory(t *testing.T) { | |
| @@ -10,7 +10,7 @@ import ( | |||||
| 10 | 10 | ||||
| 11 | "github.com/bnema/vev/internal/domain" | 11 | "github.com/bnema/vev/internal/domain" | ||
| 12 | "github.com/bnema/vev/internal/ports" | 12 | "github.com/bnema/vev/internal/ports" | ||
| 13 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | 13 | + | codec "github.com/bnema/vev/internal/snapshotcodec" |
| 14 | ) | 14 | ) | ||
| 15 | 15 | ||||
| 16 | func TestRepositoryPublishRevalidatesUnchangedTenThousandObjectHistory(t *testing.T) { | 16 | func TestRepositoryPublishRevalidatesUnchangedTenThousandObjectHistory(t *testing.T) { | ||
M internal/adapters/snapshot/repository_hardening_test.go +1 -1
| @@ -8,7 +8,7 @@ import ( | |||
| 8 | 8 | "syscall" | |
| 9 | 9 | "testing" | |
| 10 | 10 | ||
| 11 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 11 | + | codec "github.com/bnema/vev/internal/snapshotcodec" | |
| 12 | 12 | ) | |
| 13 | 13 | ||
| 14 | 14 | func TestReadBoundedRejectsUnsafeFiles(t *testing.T) { | |
| @@ -8,7 +8,7 @@ import ( | |||||
| 8 | "syscall" | 8 | "syscall" | ||
| 9 | "testing" | 9 | "testing" | ||
| 10 | 10 | ||||
| 11 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | 11 | + | codec "github.com/bnema/vev/internal/snapshotcodec" |
| 12 | ) | 12 | ) | ||
| 13 | 13 | ||||
| 14 | func TestReadBoundedRejectsUnsafeFiles(t *testing.T) { | 14 | func TestReadBoundedRejectsUnsafeFiles(t *testing.T) { | ||
M internal/adapters/snapshot/repository_test.go +1 -1
| @@ -8,7 +8,7 @@ import ( | |||
| 8 | 8 | "github.com/bnema/vev/internal/domain" | |
| 9 | 9 | ||
| 10 | 10 | "github.com/bnema/vev/internal/ports" | |
| 11 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 11 | + | codec "github.com/bnema/vev/internal/snapshotcodec" | |
| 12 | 12 | ) | |
| 13 | 13 | ||
| 14 | 14 | func TestRepositoryPublishesAndLoadsCompleteGeneration(t *testing.T) { | |
| @@ -8,7 +8,7 @@ import ( | |||||
| 8 | "github.com/bnema/vev/internal/domain" | 8 | "github.com/bnema/vev/internal/domain" | ||
| 9 | 9 | ||||
| 10 | "github.com/bnema/vev/internal/ports" | 10 | "github.com/bnema/vev/internal/ports" | ||
| 11 | - | codec "github.com/bnema/vev/internal/usecase/snapshot" | 11 | + | codec "github.com/bnema/vev/internal/snapshotcodec" |
| 12 | ) | 12 | ) | ||
| 13 | 13 | ||||
| 14 | func TestRepositoryPublishesAndLoadsCompleteGeneration(t *testing.T) { | 14 | func TestRepositoryPublishesAndLoadsCompleteGeneration(t *testing.T) { | ||
R internal/usecase/snapshot/codec.go → internal/snapshotcodec/codec.go +1 -1 renamed, 99% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "encoding/binary" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "encoding/binary" | 4 | "encoding/binary" | ||
R internal/usecase/snapshot/codec_encoder_test.go → internal/snapshotcodec/codec_encoder_test.go +1 -1 renamed, 99% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "encoding/binary" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "encoding/binary" | 4 | "encoding/binary" | ||
R internal/usecase/snapshot/codec_fuzz_test.go → internal/snapshotcodec/codec_fuzz_test.go +1 -1 renamed, 97% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "encoding/hex" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "encoding/hex" | 4 | "encoding/hex" | ||
R internal/usecase/snapshot/codec_test.go → internal/snapshotcodec/codec_test.go +1 -1 renamed, 99% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "bytes" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "bytes" | 4 | "bytes" | ||
R internal/usecase/snapshot/head_test.go → internal/snapshotcodec/head_test.go +1 -1 renamed, 98% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "errors" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "errors" | 4 | "errors" | ||
R internal/usecase/snapshot/manifest.go → internal/snapshotcodec/manifest.go +1 -1 renamed, 99% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "crypto/sha256" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "crypto/sha256" | 4 | "crypto/sha256" | ||
R internal/usecase/snapshot/manifest_preflight.go → internal/snapshotcodec/manifest_preflight.go +1 -1 renamed, 99% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "fmt" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "fmt" | 4 | "fmt" | ||
R internal/usecase/snapshot/manifest_preflight_test.go → internal/snapshotcodec/manifest_preflight_test.go +1 -1 renamed, 99% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "encoding/binary" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "encoding/binary" | 4 | "encoding/binary" | ||
R internal/usecase/snapshot/manifest_test.go → internal/snapshotcodec/manifest_test.go +1 -1 renamed, 99% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "bytes" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "bytes" | 4 | "bytes" | ||
R internal/usecase/snapshot/object_compress.go → internal/snapshotcodec/object_compress.go +1 -1 renamed, 99% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "bytes" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "bytes" | 4 | "bytes" | ||
R internal/usecase/snapshot/object_compress_test.go → internal/snapshotcodec/object_compress_test.go +1 -1 renamed, 99% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "bytes" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "bytes" | 4 | "bytes" | ||
R internal/usecase/snapshot/preflight.go → internal/snapshotcodec/preflight.go +1 -1 renamed, 99% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "fmt" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "fmt" | 4 | "fmt" | ||
R internal/usecase/snapshot/preflight_acceptance_test.go → internal/snapshotcodec/preflight_acceptance_test.go +1 -1 renamed, 98% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "errors" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "errors" | 4 | "errors" | ||
R internal/usecase/snapshot/snapshot.go → internal/snapshotcodec/snapshot.go +5 -1 renamed, 79% similar
| @@ -1,4 +1,8 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | // Package snapshotcodec owns the durable snapshot format: the session codec, | |
| 2 | + | // checkpoint manifests, content-addressed objects, and their bounded preflight. | |
| 3 | + | // It depends only on domain values and ports, so both the daemon use case and | |
| 4 | + | // the snapshot repository adapter can consume it. | |
| 5 | + | package snapshotcodec | |
| 2 | 6 | ||
| 3 | 7 | import "github.com/bnema/vev/internal/domain/layout" | |
| 4 | 8 | ||
| @@ -1,4 +1,8 @@ | |||||
| 1 | - | package snapshot | 1 | + | // Package snapshotcodec owns the durable snapshot format: the session codec, |
| 2 | + | // checkpoint manifests, content-addressed objects, and their bounded preflight. | |||
| 3 | + | // It depends only on domain values and ports, so both the daemon use case and | |||
| 4 | + | // the snapshot repository adapter can consume it. | |||
| 5 | + | package snapshotcodec | |||
| 2 | 6 | ||||
| 3 | import "github.com/bnema/vev/internal/domain/layout" | 7 | import "github.com/bnema/vev/internal/domain/layout" | ||
| 4 | 8 | ||||
R internal/usecase/snapshot/vevs_v4_golden_test.go → internal/snapshotcodec/vevs_v4_golden_test.go +1 -1 renamed, 99% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "bytes" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "bytes" | 4 | "bytes" | ||
R internal/usecase/snapshot/weights_test.go → internal/snapshotcodec/weights_test.go +1 -1 renamed, 99% similar
| @@ -1,4 +1,4 @@ | |||
| 1 | - | package snapshot | |
| 1 | + | package snapshotcodec | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "bytes" | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | package snapshot | 1 | + | package snapshotcodec |
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "bytes" | 4 | "bytes" | ||
M internal/usecase/daemon/coderabbit_regression_test.go +1 -1
| @@ -15,9 +15,9 @@ import ( | |||
| 15 | 15 | "github.com/bnema/vev/internal/ports" | |
| 16 | 16 | portsmocks "github.com/bnema/vev/internal/ports/mocks" | |
| 17 | 17 | "github.com/bnema/vev/internal/protocol" | |
| 18 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 18 | 19 | "github.com/bnema/vev/internal/usecase/picker" | |
| 19 | 20 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | |
| 20 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 21 | 21 | ) | |
| 22 | 22 | ||
| 23 | 23 | func TestRestoreAmbiguousBadVersionLoadFailurePreservesCheckpoint(t *testing.T) { | |
| @@ -15,9 +15,9 @@ import ( | |||||
| 15 | "github.com/bnema/vev/internal/ports" | 15 | "github.com/bnema/vev/internal/ports" | ||
| 16 | portsmocks "github.com/bnema/vev/internal/ports/mocks" | 16 | portsmocks "github.com/bnema/vev/internal/ports/mocks" | ||
| 17 | "github.com/bnema/vev/internal/protocol" | 17 | "github.com/bnema/vev/internal/protocol" | ||
| 18 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |||
| 18 | "github.com/bnema/vev/internal/usecase/picker" | 19 | "github.com/bnema/vev/internal/usecase/picker" | ||
| 19 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | 20 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | ||
| 20 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |||
| 21 | ) | 21 | ) | ||
| 22 | 22 | ||||
| 23 | func TestRestoreAmbiguousBadVersionLoadFailurePreservesCheckpoint(t *testing.T) { | 23 | func TestRestoreAmbiguousBadVersionLoadFailurePreservesCheckpoint(t *testing.T) { | ||
M internal/usecase/daemon/durable_recovery_test.go +1 -1
| @@ -21,8 +21,8 @@ import ( | |||
| 21 | 21 | "github.com/bnema/vev/internal/ports" | |
| 22 | 22 | portsmocks "github.com/bnema/vev/internal/ports/mocks" | |
| 23 | 23 | "github.com/bnema/vev/internal/protocol" | |
| 24 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 24 | 25 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | |
| 25 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 26 | 26 | ) | |
| 27 | 27 | ||
| 28 | 28 | type durableRecoveryCatalogue struct { | |
| @@ -21,8 +21,8 @@ import ( | |||||
| 21 | "github.com/bnema/vev/internal/ports" | 21 | "github.com/bnema/vev/internal/ports" | ||
| 22 | portsmocks "github.com/bnema/vev/internal/ports/mocks" | 22 | portsmocks "github.com/bnema/vev/internal/ports/mocks" | ||
| 23 | "github.com/bnema/vev/internal/protocol" | 23 | "github.com/bnema/vev/internal/protocol" | ||
| 24 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |||
| 24 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | 25 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | ||
| 25 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |||
| 26 | ) | 26 | ) | ||
| 27 | 27 | ||||
| 28 | type durableRecoveryCatalogue struct { | 28 | type durableRecoveryCatalogue struct { | ||
M internal/usecase/daemon/performance_benchmark_test.go +1 -1
| @@ -18,7 +18,7 @@ import ( | |||
| 18 | 18 | "github.com/bnema/vev/internal/ports" | |
| 19 | 19 | "github.com/bnema/vev/internal/protocol" | |
| 20 | 20 | "github.com/bnema/vev/internal/protocol/wire" | |
| 21 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 21 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 22 | 22 | ) | |
| 23 | 23 | ||
| 24 | 24 | func TestCountingSnapshotRepositoryPublishCountsAndRetainsManifest(t *testing.T) { | |
| @@ -18,7 +18,7 @@ import ( | |||||
| 18 | "github.com/bnema/vev/internal/ports" | 18 | "github.com/bnema/vev/internal/ports" | ||
| 19 | "github.com/bnema/vev/internal/protocol" | 19 | "github.com/bnema/vev/internal/protocol" | ||
| 20 | "github.com/bnema/vev/internal/protocol/wire" | 20 | "github.com/bnema/vev/internal/protocol/wire" | ||
| 21 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | 21 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" |
| 22 | ) | 22 | ) | ||
| 23 | 23 | ||||
| 24 | func TestCountingSnapshotRepositoryPublishCountsAndRetainsManifest(t *testing.T) { | 24 | func TestCountingSnapshotRepositoryPublishCountsAndRetainsManifest(t *testing.T) { | ||
M internal/usecase/daemon/process_restore.go +1 -1
| @@ -5,7 +5,7 @@ import ( | |||
| 5 | 5 | "strings" | |
| 6 | 6 | "unicode" | |
| 7 | 7 | ||
| 8 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 8 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 9 | 9 | ) | |
| 10 | 10 | ||
| 11 | 11 | const ( | |
| @@ -5,7 +5,7 @@ import ( | |||||
| 5 | "strings" | 5 | "strings" | ||
| 6 | "unicode" | 6 | "unicode" | ||
| 7 | 7 | ||||
| 8 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | 8 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" |
| 9 | ) | 9 | ) | ||
| 10 | 10 | ||||
| 11 | const ( | 11 | const ( | ||
M internal/usecase/daemon/process_restore_test.go +1 -1
| @@ -3,7 +3,7 @@ package daemon | |||
| 3 | 3 | import ( | |
| 4 | 4 | "testing" | |
| 5 | 5 | ||
| 6 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 6 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 7 | 7 | ) | |
| 8 | 8 | ||
| 9 | 9 | func TestProcessRestorePlan(t *testing.T) { | |
| @@ -3,7 +3,7 @@ package daemon | |||||
| 3 | import ( | 3 | import ( | ||
| 4 | "testing" | 4 | "testing" | ||
| 5 | 5 | ||||
| 6 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | 6 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" |
| 7 | ) | 7 | ) | ||
| 8 | 8 | ||||
| 9 | func TestProcessRestorePlan(t *testing.T) { | 9 | func TestProcessRestorePlan(t *testing.T) { | ||
M internal/usecase/daemon/purge_test.go +1 -1
| @@ -20,8 +20,8 @@ import ( | |||
| 20 | 20 | "github.com/bnema/vev/internal/ports" | |
| 21 | 21 | portsmocks "github.com/bnema/vev/internal/ports/mocks" | |
| 22 | 22 | "github.com/bnema/vev/internal/protocol" | |
| 23 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 23 | 24 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | |
| 24 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 25 | 25 | ) | |
| 26 | 26 | ||
| 27 | 27 | // selectivePurgeRepository fails incarnation deletion only for the configured | |
| @@ -20,8 +20,8 @@ import ( | |||||
| 20 | "github.com/bnema/vev/internal/ports" | 20 | "github.com/bnema/vev/internal/ports" | ||
| 21 | portsmocks "github.com/bnema/vev/internal/ports/mocks" | 21 | portsmocks "github.com/bnema/vev/internal/ports/mocks" | ||
| 22 | "github.com/bnema/vev/internal/protocol" | 22 | "github.com/bnema/vev/internal/protocol" | ||
| 23 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |||
| 23 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | 24 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | ||
| 24 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |||
| 25 | ) | 25 | ) | ||
| 26 | 26 | ||||
| 27 | // selectivePurgeRepository fails incarnation deletion only for the configured | 27 | // selectivePurgeRepository fails incarnation deletion only for the configured | ||
M internal/usecase/daemon/session_env_test.go +1 -1
| @@ -5,7 +5,7 @@ import ( | |||
| 5 | 5 | ||
| 6 | 6 | "github.com/bnema/vev/internal/ports" | |
| 7 | 7 | "github.com/bnema/vev/internal/protocol" | |
| 8 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 8 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 9 | 9 | "github.com/stretchr/testify/require" | |
| 10 | 10 | ) | |
| 11 | 11 | ||
| @@ -5,7 +5,7 @@ import ( | |||||
| 5 | 5 | ||||
| 6 | "github.com/bnema/vev/internal/ports" | 6 | "github.com/bnema/vev/internal/ports" | ||
| 7 | "github.com/bnema/vev/internal/protocol" | 7 | "github.com/bnema/vev/internal/protocol" | ||
| 8 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | 8 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" |
| 9 | "github.com/stretchr/testify/require" | 9 | "github.com/stretchr/testify/require" | ||
| 10 | ) | 10 | ) | ||
| 11 | 11 | ||||
M internal/usecase/daemon/snapshot.go +1 -1
| @@ -10,7 +10,7 @@ import ( | |||
| 10 | 10 | vt "github.com/bnema/vev-vt" | |
| 11 | 11 | "github.com/bnema/vev/internal/domain" | |
| 12 | 12 | "github.com/bnema/vev/internal/domain/layout" | |
| 13 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 13 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 14 | 14 | ) | |
| 15 | 15 | ||
| 16 | 16 | // snapshotQueueCapacity bounds retained immutable captures. A full queue never | |
| @@ -10,7 +10,7 @@ import ( | |||||
| 10 | vt "github.com/bnema/vev-vt" | 10 | vt "github.com/bnema/vev-vt" | ||
| 11 | "github.com/bnema/vev/internal/domain" | 11 | "github.com/bnema/vev/internal/domain" | ||
| 12 | "github.com/bnema/vev/internal/domain/layout" | 12 | "github.com/bnema/vev/internal/domain/layout" | ||
| 13 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | 13 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" |
| 14 | ) | 14 | ) | ||
| 15 | 15 | ||||
| 16 | // snapshotQueueCapacity bounds retained immutable captures. A full queue never | 16 | // snapshotQueueCapacity bounds retained immutable captures. A full queue never | ||
M internal/usecase/daemon/snapshot_capture.go +1 -1
| @@ -1,6 +1,6 @@ | |||
| 1 | 1 | package daemon | |
| 2 | 2 | ||
| 3 | - | import snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 3 | + | import snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 4 | 4 | ||
| 5 | 5 | // captureSnapshotState copies history tails and recovery transcripts while holding | |
| 6 | 6 | // each pane lock. The returned capture contains only immutable state; encoding | |
| @@ -1,6 +1,6 @@ | |||||
| 1 | package daemon | 1 | package daemon | ||
| 2 | 2 | ||||
| 3 | - | import snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | 3 | + | import snapcodec "github.com/bnema/vev/internal/snapshotcodec" |
| 4 | 4 | ||||
| 5 | // captureSnapshotState copies history tails and recovery transcripts while holding | 5 | // captureSnapshotState copies history tails and recovery transcripts while holding | ||
| 6 | // each pane lock. The returned capture contains only immutable state; encoding | 6 | // each pane lock. The returned capture contains only immutable state; encoding | ||
M internal/usecase/daemon/snapshot_incremental.go +1 -1
| @@ -6,7 +6,7 @@ import ( | |||
| 6 | 6 | vt "github.com/bnema/vev-vt" | |
| 7 | 7 | "github.com/bnema/vev/internal/domain" | |
| 8 | 8 | "github.com/bnema/vev/internal/ports" | |
| 9 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 9 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 10 | 10 | ) | |
| 11 | 11 | ||
| 12 | 12 | // snapshotChunkCacheLimit is deliberately small: history chunks remain owned | |
| @@ -6,7 +6,7 @@ import ( | |||||
| 6 | vt "github.com/bnema/vev-vt" | 6 | vt "github.com/bnema/vev-vt" | ||
| 7 | "github.com/bnema/vev/internal/domain" | 7 | "github.com/bnema/vev/internal/domain" | ||
| 8 | "github.com/bnema/vev/internal/ports" | 8 | "github.com/bnema/vev/internal/ports" | ||
| 9 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | 9 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" |
| 10 | ) | 10 | ) | ||
| 11 | 11 | ||||
| 12 | // snapshotChunkCacheLimit is deliberately small: history chunks remain owned | 12 | // snapshotChunkCacheLimit is deliberately small: history chunks remain owned | ||
M internal/usecase/daemon/snapshot_incremental_test.go +1 -1
| @@ -10,7 +10,7 @@ import ( | |||
| 10 | 10 | vt "github.com/bnema/vev-vt" | |
| 11 | 11 | renderer "github.com/bnema/vev-vt/ansi" | |
| 12 | 12 | "github.com/bnema/vev/internal/domain" | |
| 13 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 13 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 14 | 14 | ) | |
| 15 | 15 | ||
| 16 | 16 | func TestMarshalSnapshotTailSelectsCanonicalEncoder(t *testing.T) { | |
| @@ -10,7 +10,7 @@ import ( | |||||
| 10 | vt "github.com/bnema/vev-vt" | 10 | vt "github.com/bnema/vev-vt" | ||
| 11 | renderer "github.com/bnema/vev-vt/ansi" | 11 | renderer "github.com/bnema/vev-vt/ansi" | ||
| 12 | "github.com/bnema/vev/internal/domain" | 12 | "github.com/bnema/vev/internal/domain" | ||
| 13 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | 13 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" |
| 14 | ) | 14 | ) | ||
| 15 | 15 | ||||
| 16 | func TestMarshalSnapshotTailSelectsCanonicalEncoder(t *testing.T) { | 16 | func TestMarshalSnapshotTailSelectsCanonicalEncoder(t *testing.T) { | ||
M internal/usecase/daemon/snapshot_restore.go +1 -1
| @@ -11,7 +11,7 @@ import ( | |||
| 11 | 11 | "github.com/bnema/vev/internal/domain" | |
| 12 | 12 | "github.com/bnema/vev/internal/domain/layout" | |
| 13 | 13 | "github.com/bnema/vev/internal/protocol" | |
| 14 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 14 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 15 | 15 | ) | |
| 16 | 16 | ||
| 17 | 17 | func (d *Daemon) closeRestoreDone() { | |
| @@ -11,7 +11,7 @@ import ( | |||||
| 11 | "github.com/bnema/vev/internal/domain" | 11 | "github.com/bnema/vev/internal/domain" | ||
| 12 | "github.com/bnema/vev/internal/domain/layout" | 12 | "github.com/bnema/vev/internal/domain/layout" | ||
| 13 | "github.com/bnema/vev/internal/protocol" | 13 | "github.com/bnema/vev/internal/protocol" | ||
| 14 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | 14 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" |
| 15 | ) | 15 | ) | ||
| 16 | 16 | ||||
| 17 | func (d *Daemon) closeRestoreDone() { | 17 | func (d *Daemon) closeRestoreDone() { | ||
M internal/usecase/daemon/snapshot_restore_fixture_test.go +1 -1
| @@ -5,7 +5,7 @@ import ( | |||
| 5 | 5 | ||
| 6 | 6 | "github.com/bnema/vev/internal/domain" | |
| 7 | 7 | "github.com/bnema/vev/internal/ports" | |
| 8 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 8 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 9 | 9 | ) | |
| 10 | 10 | ||
| 11 | 11 | func acceptancePublication(snapshot snapcodec.Session) (ports.SnapshotPublication, error) { | |
| @@ -5,7 +5,7 @@ import ( | |||||
| 5 | 5 | ||||
| 6 | "github.com/bnema/vev/internal/domain" | 6 | "github.com/bnema/vev/internal/domain" | ||
| 7 | "github.com/bnema/vev/internal/ports" | 7 | "github.com/bnema/vev/internal/ports" | ||
| 8 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | 8 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" |
| 9 | ) | 9 | ) | ||
| 10 | 10 | ||||
| 11 | func acceptancePublication(snapshot snapcodec.Session) (ports.SnapshotPublication, error) { | 11 | func acceptancePublication(snapshot snapcodec.Session) (ports.SnapshotPublication, error) { | ||
M internal/usecase/daemon/snapshot_restore_incremental.go +1 -1
| @@ -12,7 +12,7 @@ import ( | |||
| 12 | 12 | "github.com/bnema/vev/internal/domain" | |
| 13 | 13 | "github.com/bnema/vev/internal/ports" | |
| 14 | 14 | "github.com/bnema/vev/internal/protocol" | |
| 15 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 15 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 16 | 16 | ) | |
| 17 | 17 | ||
| 18 | 18 | const catalogueRestoreConcurrency = 8 | |
| @@ -12,7 +12,7 @@ import ( | |||||
| 12 | "github.com/bnema/vev/internal/domain" | 12 | "github.com/bnema/vev/internal/domain" | ||
| 13 | "github.com/bnema/vev/internal/ports" | 13 | "github.com/bnema/vev/internal/ports" | ||
| 14 | "github.com/bnema/vev/internal/protocol" | 14 | "github.com/bnema/vev/internal/protocol" | ||
| 15 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | 15 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" |
| 16 | ) | 16 | ) | ||
| 17 | 17 | ||||
| 18 | const catalogueRestoreConcurrency = 8 | 18 | const catalogueRestoreConcurrency = 8 | ||
M internal/usecase/daemon/snapshot_restore_test.go +1 -1
| @@ -17,8 +17,8 @@ import ( | |||
| 17 | 17 | "github.com/bnema/vev/internal/domain/layout" | |
| 18 | 18 | "github.com/bnema/vev/internal/ports" | |
| 19 | 19 | portsmocks "github.com/bnema/vev/internal/ports/mocks" | |
| 20 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |
| 20 | 21 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | |
| 21 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |
| 22 | 22 | ) | |
| 23 | 23 | ||
| 24 | 24 | type snapshotAcceptanceRepository struct { | |
| @@ -17,8 +17,8 @@ import ( | |||||
| 17 | "github.com/bnema/vev/internal/domain/layout" | 17 | "github.com/bnema/vev/internal/domain/layout" | ||
| 18 | "github.com/bnema/vev/internal/ports" | 18 | "github.com/bnema/vev/internal/ports" | ||
| 19 | portsmocks "github.com/bnema/vev/internal/ports/mocks" | 19 | portsmocks "github.com/bnema/vev/internal/ports/mocks" | ||
| 20 | + | snapcodec "github.com/bnema/vev/internal/snapshotcodec" | |||
| 20 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | 21 | recoveryusecase "github.com/bnema/vev/internal/usecase/recovery" | ||
| 21 | - | snapcodec "github.com/bnema/vev/internal/usecase/snapshot" | |||
| 22 | ) | 22 | ) | ||
| 23 | 23 | ||||
| 24 | type snapshotAcceptanceRepository struct { | 24 | type snapshotAcceptanceRepository struct { | ||