refactor: replace ExecutionGraph with generic AcyclicGraph and show full cycle path in errors#158
Merged
branchseer merged 2 commits intomainfrom Feb 15, 2026
Merged
Conversation
…ull cycle path in errors - Rename ExecutionGraph to generic AcyclicGraph<N, Ix> with ExecutionGraph as a type alias - Remove precomputed topological order; compute on-the-fly via compute_topological_order() - Use DFS with predecessor tracking to detect cycles and reconstruct the full cycle path - Display all tasks in cycle errors as arrow chain (e.g. pkg#a -> pkg#b -> pkg#a) - Handle graphs with multiple disconnected components correctly - Add 14 unit tests covering DAGs, cycles, self-loops, and multi-component graphs
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.
Summary
ExecutionGraphinto a genericAcyclicGraph<N, Ix>withExecutionGraphkept as a type alias for backward compatibilitycompute_topological_order()petgraph::algo::toposort-based cycle detection with DFS + predecessor tracking that reconstructs the full cycle pathCycle dependency detected: pkg#task-a -> pkg#task-b -> pkg#task-a) instead of just one taskAcyclicGraphcovering DAGs, cycles, self-loops, and multi-component graphs