feat(cli): add coder exp sync graph command#27162
Draft
SasSwart wants to merge 1 commit into
Draft
Conversation
Add a `coder exp sync graph` command that renders the unit dependency graph. Vertices are units and edges are declared dependencies. The graph is folded client-side from the existing SyncTimeline event log, so no proto or agent changes are required. Four output formats are supported via the shared output formatter: - text (default): a colorized ASCII summary of units and dependencies. Unit status markers are colored by state (completed green, started yellow, pending gray) and satisfied edges are marked distinctly. - json: the raw graph model (nodes and edges). - table: a flat per-unit listing with dependencies collapsed into a column. - dot: Graphviz DOT with status-colored fill, pipeable to `dot`. Color is applied only in the ASCII renderer and resolves to a colorless profile in tests and on non-TTY output, keeping golden files stable. Generated by Coder Agents on behalf of @SasSwart.
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
Adds a
coder exp sync graphcommand that renders the unit dependency graph: vertices are units and edges are declared dependencies. The graph is folded client-side from the existingSyncTimelineevent log, so no proto or agent changes are required, it is one RPC.This is the new tip of the sync stack, based on #27160.
Output formats
Four formats via the shared
cliuioutput formatter (--output, defaulttext):text(default)✓/✗.jsonnodes+edges).tabledotdot.Color is applied only in the ASCII renderer and resolves to a colorless profile in tests and on non-TTY output, so golden files stay stable with no gating.
Example (
text)Tests
cli/sync_graph_internal_test.go: unit tests for graph folding (node ordering, edge satisfaction, readiness) and each renderer.cli/sync_test.gocovering empty, ascii, json, table, and dot, driven through the agent socket.Design notes
client.SyncTimeline(ctx)events:status_changesets a unit's status and creates its node in first-seen order;dependency_addedcreates an edge and ensures both endpoints exist. After folding, an edge is satisfied when the target's current status equals the required status, and a node is ready when it is pending and all of its edges are satisfied (mirrors the Manager's readiness semantics).dotformat is a small customcliui.OutputFormatimplementation rather than aChangeFormatterData(TextFormat(), ...)wrapper, becauseDataChangeFormat.ID()delegates to the wrapped format and would collide with thetextformat ID.SyncTimelineRPC return a clear "agent does not support graph" error, matching the timeline command's behavior.Generated by Coder Agents on behalf of @SasSwart.