Skip to main content

Swamp Triage

@sntxrr/swamp-triagev2026.10.22.1· MIT· 13d agoBEHAVIORSWORKFLOWS
01README

Investigate why any swamp model or workflow is failing, without knowing anything about the domain it automates. Every method and workflow run leaves a @swamp/method-summary or @swamp/workflow-summary report behind as versioned model data, written on failure as well as success — so the full history of a target is already on disk with nothing extra instrumented. investigate resolves a target by name at call time, walks that history back to the boundary where it stopped working, and classifies the error into auth / unreachable / timeout / tls / rate_limit / not_found / config, each with a concrete next step. The distinction it exists to make is auth vs unreachable: a remote answering 403 is healthy and rejecting your credential (go to the vault), while a remote that never answers is a network problem (go to the host) — the two read almost identically in a notification and lead opposite ways. Unrecognised errors are reported as unknown verbatim rather than filed under a plausible-looking category. A run that failed without recording any error text is reported as unrecorded, never as none. recent answers the question an alert with no name leaves open -- what just broke? -- by listing every model and workflow that failed within a window -- still failing first, then those that have since recovered, with when -- each with its instance name and model type and classified the same way. Both methods tell the caller's mistakes apart from the fleet's failures: recent flags the investigator's own failed runs (selfInflicted) and a failure fixed by an immediate retry of the same method (quickRetry), reports each target's definition path, and lists scheduled workflows with no recorded run at all (a schedule that never fires leaves no failure anywhere else); investigate reports a target with no runs as never_run -- failing when it is scheduled to run here -- suggests the closest names for one that matches nothing, and separates a rejected call argument (caller_args) from a definition problem (config). A failed workflow step is reported with the error its own run recorded, and an expression that failed to evaluate classifies as config. resolve maps free alert text to the model and workflow names it most likely means -- token overlap with names, types, tags and descriptions, top matches with score -- for an alert that does not name its target. Read-only: every method reads what previous runs recorded and never invokes the failing target.

02Behaviors1
@sntxrr/swamp-triage/investigationv2026.10.22.1swamp_triage.ts

Global Arguments

ArgumentTypeDescription
repoDir?stringRepository root to investigate. Defaults to the repo the model runs in.
fn investigate(target: string, kind?: enum, maxVersions?: number, placementTag?: string)
Investigate why a model or workflow is failing. Resolves the target
ArgumentTypeDescription
targetstringName of the model or workflow to investigate.
kind?enumWhich definitions to search. 'auto' searches models then workflows.
maxVersions?numberHow many recorded runs to walk back through when looking for the
placementTag?stringkey=value tag (e.g. runs-on=primary) naming the workflows this
fn recent(withinHours?: number, kind?: enum, limit?: number, maxVersions?: number, placementTag?: string)
List every model and workflow that failed within the last
ArgumentTypeDescription
withinHours?number
kind?enumWhich targets to list. 'auto' lists models and workflows.
limit?numberMaximum failures to list; the rest are counted, not dropped.
maxVersions?numberHow many earlier runs to read per recovered target when looking
placementTag?stringkey=value tag (e.g. runs-on=primary) naming the workflows this
fn resolve(text: string, kind?: enum, limit?: number)
Map free alert text to the model and workflow names it most likely
ArgumentTypeDescription
textstringFree alert text, e.g. a notification title or a step name.
kind?enumWhich definitions to search. 'auto' searches both.
limit?numberMost matches to return.

Resources

investigation(infinite)— A classified finding for one investigated model or workflow.
recent(infinite)— Every model and workflow that failed within a window,
resolution(infinite)— The definitions free alert text most likely names,
03Workflows2
@sntxrr/investigate-apprise1d18f54e-b7f1-433d-a5e1-0d37c79de3fd

Investigate why any model or workflow in this repo is failing, and raise the finding through Apprise. Domain-agnostic: the target is named at run time, so this is the same workflow whether the thing that broke talks to a network controller, a DNS server, or an object store. swamp workflow run @sntxrr/investigate-apprise --input target=<name> Requires @sntxrr/apprise-notify and a model instance of it named `apprise`: swamp extension pull @sntxrr/apprise-notify swamp model create @sntxrr/

investigateRead the target's recorded history and classify the failure
1.collecttriage.investigate— Resolve the target by name, walk its summary-report versions back to the last success, and classify the recorded error. When the target is a workflow, this also follows the failing step into the model that step invoked -- a workflow summary names the step but not its error, so stopping at the workflow level would report `detect-drift failed` and omit the actual cause. Identifiable secret values are redacted from the error here, before the finding is written, so the notification below cannot carr
reportNotify through Apprise when the target is actually failing
1.notify-findingapprise.notify— Gated by a step `guard` rather than by the notifier's own arguments. A guard is a CEL predicate over step output, which `dependsOn` conditions cannot express -- those are status-based only. Truthy guard means SKIP, so this reads as "skip when notification is turned off, or when the target turned out to be healthy". Deliberately not the notifier's `when` argument, even though Apprise offers one: the guard keeps the gate identical in this workflow and in `investigate-ntfy`, whose notifier has no s
@sntxrr/investigate-ntfycd960c91-5a03-47f0-8823-b272a37cbbad

Investigate why any model or workflow in this repo is failing, and post the finding straight to ntfy. Domain-agnostic: the target is named at run time, so this is the same workflow whether the thing that broke talks to a network controller, a DNS server, or an object store. swamp workflow run @sntxrr/investigate-ntfy --input target=<name> Requires @mgreten/ntfy-notify and a model instance of it named `ntfy`: swamp extension pull @mgreten/ntfy-notify swamp model create @mgreten/ntfy-noti

investigateRead the target's recorded history and classify the failure
1.collecttriage.investigate— Resolve the target by name, walk its summary-report versions back to the last success, and classify the recorded error. When the target is a workflow, this also follows the failing step into the model that step invoked -- a workflow summary names the step but not its error, so stopping at the workflow level would report `detect-drift failed` and omit the actual cause. Identifiable secret values are redacted from the error here, before the finding is written, so the notification below cannot carr
reportPost to ntfy when the target is actually failing
1.notify-findingntfy.send— Gated by a step `guard` rather than by the notifier's own arguments. A guard is a CEL predicate over step output, which `dependsOn` conditions cannot express -- those are status-based only. Truthy guard means SKIP, so this reads as "skip when notification is turned off, or when the target turned out to be healthy". This notifier has no gating argument of its own -- `send` always sends -- so the guard is the only thing standing between a healthy target and a phone buzzing at 3am. It is the same g
04Previous Versions10
2026.10.21.1MIT
2026.10.14.1MIT(was none)

Declare SPDX license (MIT) in manifest.

2026.09.28.1
2026.09.26.1
2026.09.25.1

recent reports each failure's model type as targetType ("workflow" for workflows), so a run-history line or alert that names only a type maps to the failing instance without a catalog search.

2026.09.24.1

Add recent: list every model and workflow whose latest run failed within a window, newest first, classified like investigate — for alerts that name no target. Reserve current and recent as instance names so investigating a target with either name cannot overwrite the stable handle.

Modified 1 behaviors

2026.08.04.4
2026.08.04.3

Added 2 workflows

2026.08.04.2
2026.08.04.1
05Stats
A
100 / 100
Downloads
97
Archive size
54.2 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
06Platforms
07Labels