Update from 20260227 to 20260311 breaks existing model definitions (symlink + path-based type)
Opened by swampadmin · 9/19/2025
Description
After updating from 20260227.003433.0-sha.349ae436 to 20260311.132338.0-sha.398857eb, existing model definitions are no longer discovered by swamp model list or swamp model method run, failing with Model not found.
Two breaking changes in collectAllDefinitions (yaml_definition_repository.ts):
1. Type reconstructed from directory path, not YAML content
The old version stored definitions at .swamp/definitions/@smith/kibana-dev/<id>.yaml with symlinks from models/kibana/definition.yaml. The type was read from the YAML type field.
The new version reconstructs the type from directory path segments:
const typeStr = pathSegments.join("/");
results.push({ definition, type: ModelType.create(typeStr) });For models/kibana/definition.yaml, this produces type "kibana" instead of "@smith/kibana-dev".
2. Deno readDir doesn't follow symlinks
collectAllDefinitions checks entry.isFile && entry.name.endsWith(".yaml"). Deno's readDir sets isFile: false for symlinks (isSymlink: true), so symlinked definition files are silently skipped.
Steps to Reproduce
- Have a working swamp repo with extension model (version 20260227)
- Run
swamp update swamp model list --jsonreturns{"query":"","results":[]}swamp model method run kibana status --jsonreturnsModel not found: kibana
Workaround
Copy the definition file to models/@smith/kibana-dev/<id>.yaml (matching the type namespace in the directory path) as a real file (not symlink):
mkdir -p models/@smith/kibana-dev
cp .swamp/definitions/@smith/kibana-dev/<id>.yaml models/@smith/kibana-dev/Expected Behavior
swamp update should either migrate existing definitions to the new layout, or the new version should remain compatible with the old layout.
Environment
- Previous version: 20260227.003433.0-sha.349ae436
- New version: 20260311.132338.0-sha.398857eb
- OS: macOS (darwin 25.3.0)
Closed
No activity in this phase yet.
Sign in to post a ripple.