Skip to main content
← Back to list
01Issue
BugShippedSwamp CLI
Assigneeskeeb

#337 Workflow-scope report artifacts unreachable via `swamp data get --workflow`

Opened by keeb Ā· 5/12/2026Ā· Shipped 5/12/2026

Summary

Workflow-scope reports (those declared with scope: "workflow") emit markdown + JSON artifacts that are persisted to disk, but no documented swamp data CLI path can read them back. The defect affects the built-in @swamp/workflow-summary report as well as any user-defined workflow-scope report.

Steps to reproduce

  1. Run any workflow that has at least one workflow-scope report attached. @swamp/workflow-summary ships built-in, so any workflow run will do.

  2. The reports render in terminal output and persist successfully. Verify on disk:

    ls ~/.swamp/repos/<repo>/data/workflow/<workflow-uuid>/report-swamp-workflow-summary/

    Versions present, content readable from <version>/raw.

  3. Try to retrieve via the documented CLI:

    $ swamp data get --workflow <name> report-swamp-workflow-summary
    Error: Data not found: "report-swamp-workflow-summary" in workflow "<name>"
  4. swamp data list --workflow <name> does not include the artifacts either — only method/model-scope artifacts are listed.

  5. swamp data query 'name == "report-swamp-workflow-summary"' finds them, but --select content returns null and there's no other CLI that resolves a query result back to content.

Root cause

In src/libswamp/workflows/run.ts, workflow-scope reports persist via:

executeReports(
  reportRegistry,
  wfContext,
  ModelType.create("workflow"),
  workflow.id,
  ...
);

Artifacts are filed under synthetic modelType="workflow", modelId=<workflow-uuid>. They are NOT appended to any step's dataArtifacts array.

The --workflow retrieval path (src/domain/data/workflow_data_service.ts::findAllForWorkflowRun) iterates only run.jobs[].steps[].dataArtifacts[]. So swamp data get --workflow and swamp data list --workflow cannot see any workflow-scope-emitted artifact.

Verified against current main at sha 85567660.

Impact

Users who write workflow-scope reports cannot programmatically retrieve their output — they have to read raw files under ~/.swamp/repos/.../data/workflow/... and resolve the latest version by reading the latest file manually. This silently undermines the report abstraction.

Suggested fixes (pick one)

  1. Append workflow-scope report dataHandles to a workflow-level artifact list that findAllForWorkflowRun also consults, parallel to step.dataArtifacts.
  2. Tag workflow-scope report artifacts with workflowRunId / workflowName and have the retrieval path fall back to tag-based lookup when the step walk returns nothing.
  3. Add an explicit retrieval path (swamp data get --workflow-report <name> <report>) that fetches from modelType="workflow" / modelId=<workflow-uuid> directly.
02Bog Flow
āœ“OPENāœ“TRIAGEDāœ“IN PROGRESSāœ“SHIPPED+ 1 MOREASSIGNED+ 4 MOREREVIEW+ 3 MOREPR_MERGEDSHIPPED

Shipped

5/12/2026, 7:59:29 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
keeb assigned keeb5/12/2026, 6:57:10 PM

Sign in to post a ripple.