Skip to main content
← Back to list
01Issue
BugTriagedSwamp CLI
Assigneesstack72

#351 Surface type-extraction failures in doctor JSON output

Opened by stack72 · 5/13/2026

Problem

Post-W7 (#342), models with non-literal type fields (e.g. type: TYPE where TYPE is a const) produce stderr warnings via emitTypeExtractionFailure but don't appear in swamp doctor extensions --json output and don't flip the doctor exit code. Users have a silently-broken extension state — the model doesn't register but doctor reports "pass."

Why this exists

W7 removed registries.failures[] which previously surfaced these via the recordLoadFailuresgetExtensionLoadWarnings pipeline. The new sourceDetails[] surface derives from the Extension aggregate, but type-extraction failures don't write to the aggregate — they only emit stderr warnings.

Proposed solution

Two implementation options:

  1. New RowState TypeExtractionFailed — route through the aggregate with a catalog state, migration, and aggregate transition. Most consistent with W7's single-surface design.
  2. Add warnings[] field to doctor JSON output — lighter touch, keeps type-extraction warnings as warnings (not failures) but makes them visible in JSON mode and available for exit-code derivation.

Alternatives considered

  • Accept as a known limitation — rejected because it creates a silent UX failure where users think their model is healthy.

Acceptance criteria

  • A model with const TYPE = "@foo/bar"; export const model = { type: TYPE } appears in swamp doctor extensions --json output
  • Doctor exit code reflects the presence of type-extraction failures
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW

Triaged

5/14/2026, 1:01:54 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack725/14/2026, 12:59:08 AM

Sign in to post a ripple.