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

Relationships

#3726 A workflow step fails on a static validation error in a method it does not invoke, where swamp behavior run of the same method succeeds

Opened by zack · 10/21/2026· Shipped 10/21/2026

Description

A workflow step validates the whole behavior definition before it runs, including methods the step never invokes. swamp behavior run does no such pre-validation. After swamp-club#3628 (commit 71515d341) scoped every delivery's runtime pass to the global arguments and the invoked method, the same behavior and method can succeed from swamp behavior run and fail inside a workflow.

  • swamp behavior run c execute: no static pre-validation. Its only gate on other methods was the runtime pass, which now covers the global arguments and execute only.
  • Workflow step c.execute: src/domain/workflows/execution_service.ts (~line 2236) calls validationService.validateModel(originalDefinition, …) with no method scope and fails fast with Behavior validation failed for "c": …. Its Expression paths check scans every expression in the definition, including uninvoked methods.

Before #3628 both commands failed on a broken uninvoked method, for different reasons, so the difference was invisible. Now only the workflow fails.

What still diverges: static problems in an uninvoked method that Expression paths (or the rest of validateModel) rejects, such as a vault alias (dyn(vault).get(...)), an unresolvable model.x... / self.x... reference.

What no longer diverges: runtime-only problems in an uninvoked method (missing vault key, unknown vault, unset env var). Both commands ignore those now.

swamp behavior validate c --method execute also reports the other method's Expression paths failure, since that check is not scoped to --method either.

Steps to reproduce

  1. swamp repo init --tool none; swamp vault put default token=[REDACTED-SECRET-1]
  2. Create models/command/shell/c.yaml:
    type: command/shell
    typeVersion: 2026.02.09.1
    id: cccccccc-2ae6-4a6a-8eec-9c0becbb6a7b
    name: c
    version: 1
    tags: {}
    globalArguments: {}
    methods:
      execute:
        arguments:
          run: "echo c=${{ vault.get('default','token') }}"
      third:
        arguments:
          run: "echo ${{ dyn(vault).get('default','token') }}"
  3. swamp behavior run c execute: succeeds, prints c=***.
  4. Create a workflow with one step { type: model_method, modelIdOrName: c, methodName: execute } and run it: fails with Behavior validation failed for "c": Expression paths: ... at "methods.third.arguments.run".

Expected: the two commands agree on whether c.execute can run.

Proposed fix

Scope the workflow step's pre-validation (and behavior validate --method's static checks) to the invoked method, using isDeliveredWithMethod from src/domain/expressions/splice_pair.ts, the predicate the runtime pass already uses. Alternatives: keep validating the whole definition and document that workflows are stricter, or give behavior run the same gate so they match.

To pick up after the swamp-club#3628 PR merges.

Environment

  • swamp branch issue-3628 at 71515d341; Linux, Deno 2.9.7
02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 8 MOREPR_LINKED+ 2 MORESESSION_SUMMARIZED

Shipped

10/21/2026, 6:44:58 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
zack assigned zack10/21/2026, 5:25:51 PM

Sign in to post a ripple.