Relationships
#3319 datastore namespace list --json reports a corrupt .namespace.json as an unexpected exception with a stack trace
Opened by zack · 10/12/2026· Shipped 10/13/2026
Found while working on #3316; unrelated to that fix.
A namespace manifest that is not valid JSON makes swamp datastore namespace list --json exit with an error envelope that carries a stack field, which marks an unexpected exception rather than a handled refusal. The JSON.parse SyntaxError escapes instead of being reported as a UserError (or the manifest being skipped).
Affects: swamp 20261012.194115.0-sha.9b7f54f4 (released binary), and source main at 421e0b1e.
Steps to reproduce
swamp init, thenswamp datastore namespace set corrupt-ns- Overwrite
.swamp/corrupt-ns/.namespace.jsonwith{INVALID JSON!!!} swamp datastore namespace list --json
Expected
Either the unreadable manifest is skipped or flagged (exit 0), or the command refuses with a handled error (exit 1) whose JSON envelope has a message and no stack.
Actual
Exit 1 with a JSON error envelope that includes stack.
How it was found
swamp-uat branch test-investigation, tests/cli/adversarial/namespace_isolation_test.ts, test: swamp datastore namespace list handles corrupt .namespace.json gracefully. It fails against the released binary and against a build of the #3316 fix alike. Root cause not investigated; manifest reading lives in src/infrastructure/persistence/namespace_manifest.ts (listNamespaceManifests).
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.