data.latest() returns null when new data written while _catalog.db is already marked populated
Opened by 4chems Β· 4/9/2026Β· Shipped 4/9/2026
Description
data.latest() queries .swamp/data/_catalog.db (SQLite). The catalog is only rebuilt (backfill) when it is not yet marked as populated. If data is written while the catalog is already marked populated, the new entry is never indexed β the catalog stays stale indefinitely.
data.latest() then returns null, and accessing .attributes on null produces the runtime error: Invalid expression: No such key: attributes.
Steps to Reproduce
- Run any workflow that writes model data (e.g.
provision-hetzner-node) β catalog gets marked as populated - Run another workflow that calls
data.latest("model-name", "new-instance")referencing the data just written - Observe:
Invalid expression: No such key: attributesβ despite the data existing on disk and appearing inswamp data list
Expected Behavior
The write-through path in FileSystemUnifiedDataRepository should upsert entries into _catalog.db at write time, not only during backfill. This would make stale catalog entries impossible.
Workaround
Delete .swamp/data/_catalog.db to force a full rebuild on next invocation.
Environment
- swamp version: 20260409.030033.0-sha.07dae003
- OS: macOS Darwin 25.3.0
Shipped
Click a lifecycle step above to view its details.
adam commented 4/9/2026, 2:04:49 PM
Looking at this now!
Sign in to post a ripple.