Skip to content

feat(flow): lint uses SGCR checkInvariants for ungrouped flows (Phase 6/6) - #298

Merged
ivanmkc merged 1 commit into
masterfrom
feat/sgcr-phase6
Aug 8, 2026
Merged

feat(flow): lint uses SGCR checkInvariants for ungrouped flows (Phase 6/6)#298
ivanmkc merged 1 commit into
masterfrom
feat/sgcr-phase6

Conversation

@ivanmkc

@ivanmkc ivanmkc commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Final phase: geometry lint now uses SGCR's checkInvariants() (exact arithmetic) for ungrouped flows instead of heuristic dagre-based segment checks. Grouped + manual-layout flows still use the dagre lint. Also: flow-too-many-nodes ported to the SGCR path, sgcr-skipped-grouped warning removed (obsolete since Phase 3). 735 tests, tsc clean. Completes the 6-phase SGCR-default plan.

The geometry lint now matches the renderer: ungrouped flows (which render
through SgcrFlowInner since Phase 4) are linted via SGCR's checkInvariants()
— exact arithmetic that replaces the heuristic dagre-based segment checks.
Grouped flows (FlowInner + smoothstep edges) and manual-layout specs still
use the dagre lint. This is the final phase of the SGCR-default plan.

Changes:
- geometryReport() detects the effective engine (same gate as flow.tsx:
  engine !== "dagre" && !grouped && layout !== "manual") and delegates
  to sgcrReport() for SGCR-path flows.
- sgcrReport() now runs checkInvariants() — any violation is reported as
  an error-severity finding (SGCR should produce zero violations by
  construction, so this catches engine bugs).
- sgcrReport() also checks flow-too-many-nodes (was dagre-path only;
  fires independently of whether SGCR lays out, even on edge-less graphs).
- toSgcrInput() extracted as a shared helper for sgcrReport + bestLayout.
- Removed the sgcr-skipped-grouped warning (Phase 3 made grouped SGCR
  supported; the warning is obsolete).
- Tests updated: sgcr-skipped-grouped → "SGCR lint integration (Phase 6)";
  low-readability → "large-graph overflow finding" (ungrouped → sgcr-overflow,
  dagre-opt-out → low-readability); cleanEnough guard now checks edgeNearNode.

735 viewer tests pass (+1 from Phase 6 test updates). tsc strict clean.
@ivanmkc
ivanmkc merged commit cda8424 into master Aug 8, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants