Data instance name uniqueness is global across specs instead of per-spec
Opened by swampadmin · 8/22/2025
Description
When a factory model writes resources to two different resource specs using the same instance name, swamp rejects the output with:
Data output validation failed: Duplicate data instance name 'bixu'This occurs when one spec (e.g. summary) uses a label like a username as the instance name, and another spec (e.g. repo) uses repo names — and one of the repo names happens to match the username.
Steps to Reproduce
- Create an extension model with two resource specs (e.g.
summaryandrepo) - In a method, write to the
summaryspec with instance namebixu - In the same method, write to the
repospec with instance namebixu(a repo that happens to share the name) - The method fails with a duplicate instance name error
Expected Behavior
Instance names should be namespaced per resource spec. Writing summary/bixu and repo/bixu should not conflict — they are different specs with different schemas.
Actual Behavior
Instance names appear to be validated globally across all specs for a single method execution, causing a false collision.
Workaround
Prefix the instance name on one of the specs to avoid collision (e.g. summary-bixu instead of bixu for the summary spec).
Environment
- swamp version: latest (2026-03-09)
- OS: macOS Darwin 25.3.0
Summary
This affects the data output validation layer in the method execution pipeline. The fix would involve scoping the duplicate instance name check to be per-spec rather than global across all specs in a single method return. The dataHandles array likely needs to key uniqueness on (specName, instanceName) pairs rather than instanceName alone.
Closed
No activity in this phase yet.
Sign in to post a ripple.