Description
In src/domain/data/data_lifecycle_service.ts (lines 186-195), findExpiredData() iterates the .swamp/data/ directory using readDir(), which yields only the first path segment. For nested types like command/shell or @docker/host, it reads command or @docker as the type name. Subdirectories (shell, host) are incorrectly treated as model IDs, causing the scan to fail silently.
Steps to Reproduce
- Create a model of type
command/shell or @docker/host
- Run the model to produce data with a lifetime (e.g.,
1h)
- Wait for the data to expire
- Run garbage collection
- The expired data is never cleaned up
Expected Behavior
GC scanning should correctly handle nested type directory structures (type/subtype/modelId/dataName/version/).
Actual Behavior
The scanner treats the type subdirectory (shell, host) as a model UUID, resulting in failed lookups. Data for all nested/namespaced types is never garbage collected.
Summary
This affects the data lifecycle service's directory scanning logic. The fix would involve walking the directory tree to the correct depth based on the type structure, or using the model registry to enumerate known types and their directory paths rather than relying on directory listing.
Description
In
src/domain/data/data_lifecycle_service.ts(lines 186-195),findExpiredData()iterates the.swamp/data/directory usingreadDir(), which yields only the first path segment. For nested types likecommand/shellor@docker/host, it readscommandor@dockeras the type name. Subdirectories (shell,host) are incorrectly treated as model IDs, causing the scan to fail silently.Steps to Reproduce
command/shellor@docker/host1h)Expected Behavior
GC scanning should correctly handle nested type directory structures (
type/subtype/modelId/dataName/version/).Actual Behavior
The scanner treats the type subdirectory (
shell,host) as a model UUID, resulting in failed lookups. Data for all nested/namespaced types is never garbage collected.Summary
This affects the data lifecycle service's directory scanning logic. The fix would involve walking the directory tree to the correct depth based on the type structure, or using the model registry to enumerate known types and their directory paths rather than relying on directory listing.