Skip to main content
← Back to list
01Issue
BugClosedSwamp Club
AssigneesNone

Update from 20260227 to 20260311 breaks existing model definitions (symlink + path-based type)

Opened by swampadmin · 8/29/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".

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

  1. Have a working swamp repo with extension model (version 20260227)
  2. Run swamp update
  3. swamp model list --json returns {"query":"","results":[]}
  4. swamp model method run kibana status --json returns Model 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)
02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED

Closed

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.