Relationships
#1370 model search/list doesn't enumerate auto-created definitions under .swamp/auto-definitions/
Opened by shelson · 7/23/2026· Shipped 7/23/2026
Description
`swamp model search` (and its `model list` alias) silently omits model definitions that were auto-created via the `@type` prefix pattern (e.g. `modelType: @foo/bar` + `modelName` in a workflow step, or `model method run @type/name method`). Those definitions live under `.swamp/auto-definitions//` rather than `models//`, and `model search`/`list` only walks the `models/` tree.
The models are otherwise fully functional — `swamp model get ` returns them correctly, workflow steps targeting them succeed, and reports show correct execution — they simply don't appear when listing/searching.
This is already a known internal distinction: `src/libswamp/models/doctor_secrets.ts` explicitly wires up a second repository pointed at `.swamp/auto-definitions` because "the public `findAllGlobal()` only walks its own `baseDir`". `doctor secrets`/`doctor vaults` do this correctly; `model_search.ts` does not — it only calls `HOST-1` against the primary repo.
Steps to Reproduce
- Create a model definition via the auto-create path, e.g. run a workflow step with `modelType: @some/type`, `modelName: foo` where no `models/@some/type/foo.yaml` exists yet. This creates the definition under `.swamp/auto-definitions/@some/type/` instead.
- Run `swamp model search --json` (or `swamp model list`).
- Observe the auto-created model is absent from results, even though `swamp model get foo --json` returns it successfully.
Concrete case
A workflow fanning out over 710 AWS accounts (one `@webframp/terraform` model per account, auto-created via `modelName: account-${accountId}`) ran successfully end-to-end — 710/710 steps succeeded per the workflow report. But `swamp model list` reported only 150 `@webframp/terraform` models. On-disk inspection showed:
- `models/@webframp/terraform/`: 150 hand-authored/datastore-synced definitions
- `.swamp/auto-definitions/@webframp/terraform/`: 565 auto-created definitions (invisible to `list`/`search`)
150 + 565 ≈ matches the full 710-account set. `swamp model get account- --json` succeeds for models in either location.
Environment
- swamp version: 20260722.233513.0-sha.6e04abec
- OS: macOS (Darwin 25.5.0)
Expected behavior
`swamp model search`/`list` should enumerate definitions from both `models/` and `.swamp/auto-definitions/`, matching the pattern already used by `doctor secrets`/`doctor vaults` (a second `YamlDefinitionRepository` instance pointed at `SWAMP_SUBDIRS.autoDefinitions`).
Shipped
Click a lifecycle step above to view its details.
shelson commented 7/23/2026, 9:44:09 PM
I just had a thought, maybe this is a ... feature? I remember reading something about autocreated being different.. Keen to understand because I don't want these to be temporary in any way either so this could indicate a design issue my end too
stack72 commented 7/23/2026, 9:56:46 PM
@shelson yeah this is actually by design that they don't show up in lists - I need to add to get that they are auto-created. The reason they exist are ONLY for data ownership - they are not used for anything other than a parent of the data created. I will add this detail to the docs so that it's not confusing as it has been here
Sign in to post a ripple.