Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneesstack72

Relationships

#1838 data.latest() throws ambiguity error on exact dataName matches (regression from #1816 in 20260826.004253.0)

Opened by 4chems · 8/26/2026· Shipped 8/26/2026

Summary

Since 20260826.004253.0 (which shipped #1816), data.latest(model, dataName) throws Ambiguous data.latest() match even when the second argument is an exact, unique data name — the ambiguity guard fires on every successful lookup whenever the resolved item's specName is shared by sibling items, instead of only on specName-fallback matches.

This breaks every factory/fan-out model (one spec producing multiple named data items) — the pattern swamp itself recommends for multi-target methods.

Repro

Model node-provisioner has two data items produced by one spec:

  • data name hs (tags: specName="state")
  • data name learning (tags: specName="state")

Workflow expression: ${{ data.latest("node-provisioner", "hs").attributes.ipv4 }}

Result on 20260826.004253.0: Invalid expression: Ambiguous data.latest() match: specName "state" resolves to 2 data items (hs, learning). Use the specific data name instead.

The message even tells the caller to "use the specific data name" — which is exactly what the expression already does. Same workflow ran fine on 20260815.023608.0.

Cause (from reading the bundled source in the binary)

In getLatestRecord(modelName, dataName, namespace), after findLatestRow succeeds on the exact dataName, the code unconditionally calls checkSpecNameAmbiguity(row.spec_name, modelName, namespace), which throws whenever findLatestRowsBySpecName returns >1 peers. The check should only run when the lookup actually fell back to matching the argument against specName (per #1816's intent), not when it matched dataName directly.

Environment

swamp 20260826.004253.0-sha.b64b034d, macOS (darwin arm64).

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 7 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

8/26/2026, 5:55:00 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack728/26/2026, 5:03:29 PM
Editable. Press Enter to edit.

stack72 commented 8/26/2026, 5:55:10 PM

Thanks @4chems for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.