Relationships
↔ sibling #2925#2923 swamp model create crashes with an [FTL] ZodError stack trace on an invalid (uppercase) model name
Opened by hammz · 10/1/2026· Shipped 10/1/2026
Description
Passing a model name that fails definition-name validation to swamp model create crashes the CLI with an [FTL] fatal log, a raw ZodError JSON dump and a full stack trace, instead of a clean validation error.
Found while reproducing swamp-club#2918 on 20261001.202145.0-sha.a3515474.
Steps to reproduce
- swamp repo init --tool none in a scratch dir
- swamp model create command/shell shUpper
Actual
[FTL] error: ZodError: [ { code: custom, path: [name], message: Definition name must be lowercase alphanumeric with hyphens or underscores (e.g. 'my-server'). Must start with a letter or number. } ] followed by a stack trace through Definition.create (src/domain/definitions/definition.ts) and createAndSave (src/libswamp/models/create.ts).
Expected
A user-facing validation error naming the rule (and a json-mode error object under --json), with no stack trace. The name should be validated up front, before Definition.create throws.
Shipped
Click a lifecycle step above to view its details.