Skip to main content
← Back to list
01Issue
BugShippedSwamp CLI
Assigneesadam

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

  1. Run any workflow that writes model data (e.g. provision-hetzner-node) β€” catalog gets marked as populated
  2. Run another workflow that calls data.latest("model-name", "new-instance") referencing the data just written
  3. Observe: Invalid expression: No such key: attributes β€” despite the data existing on disk and appearing in swamp 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
02Bog Flow
βœ“OPENβœ“TRIAGEDβœ“IN PROGRESSβœ“SHIPPEDTRIAGE+ 7 MOREREVIEW+ 3 MOREPR_MERGEDSHIPPED

Shipped

4/9/2026, 3:10:07 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned adam4/9/2026, 2:16:49 PM

adam commented 4/9/2026, 2:04:49 PM

Looking at this now!

Sign in to post a ripple.