Context
The layout mapper (toElkGraph in core/layout/compose-to-elk.ts) filters
edges using a knownIds guard: If an edge points to a node that
does not exist, it is silently discarded. This is intentional because ELK
would otherwise abort the entire layout run with JsonImportException: Referenced shape does not exist.
Side effect: A depends_on, networks, or volume entry that references something
undeclared produces an incomplete graph without any
indication. The user sees a missing edge and doesn’t know why.
Problem
The guard prevents a crash but suppresses the information. For a tool
whose stated MVP goal is “understandable error feedback instead of a crash”
(see MVP Doc §2.1, point 3), silent rejection is the wrong final step.
Context
This is not a layout issue, but a validation issue. The parser currently checks
structure and required fields, but not the referential integrity
between services, networks, and volumes.
Possible Approach
- Add semantic validation to the parser: For each
dependsOn,
networks, and named volume reference, check whether the target exists in the
top-level declarations.
- Collect unresolvable references as
ParseError (using the same two-level
mechanism as for existing semantic errors), specifying the
service, reference type, and missing name.
- Decision pending: hard error (graph is not drawn) vs.
warning (graph is drawn, a note is displayed). For dangling
references, a warning is likely more user-friendly—the
graph remains visible, and the note explains the missing edge.
- The
knownIds guard in the mapper remains in place as a safety net, even
when the parser validates—a double safeguard against the ELK crash.
Acceptance Criteria
Dependencies
Affects the error feedback UI (Roadmap Phase 6). It makes sense to
consider both together.
Context
The layout mapper (
toElkGraphincore/layout/compose-to-elk.ts) filtersedges using a
knownIdsguard: If an edge points to a node thatdoes not exist, it is silently discarded. This is intentional because ELK
would otherwise abort the entire layout run with
JsonImportException: Referenced shape does not exist.Side effect: A
depends_on,networks, or volume entry that references somethingundeclared produces an incomplete graph without any
indication. The user sees a missing edge and doesn’t know why.
Problem
The guard prevents a crash but suppresses the information. For a tool
whose stated MVP goal is “understandable error feedback instead of a crash”
(see MVP Doc §2.1, point 3), silent rejection is the wrong final step.
Context
This is not a layout issue, but a validation issue. The parser currently checks
structure and required fields, but not the referential integrity
between services, networks, and volumes.
Possible Approach
dependsOn,networks, and named volume reference, check whether the target exists in thetop-level declarations.
ParseError(using the same two-levelmechanism as for existing semantic errors), specifying the
service, reference type, and missing name.
warning (graph is drawn, a note is displayed). For dangling
references, a warning is likely more user-friendly—the
graph remains visible, and the note explains the missing edge.
knownIdsguard in the mapper remains in place as a safety net, evenwhen the parser validates—a double safeguard against the ELK crash.
Acceptance Criteria
a clear message (reason + affected name).
Dependencies
Affects the error feedback UI (Roadmap Phase 6). It makes sense to
consider both together.