feat(flow): lint uses SGCR checkInvariants for ungrouped flows (Phase 6/6) - #298
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.