feat(cli): add 'dimos graph' subcommand#2213
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Greptile SummaryAdds
Confidence Score: 5/5Safe to merge — this is a new, self-contained developer CLI tool with no changes to existing production paths. All changed code is additive: new CLI subcommand, new Mermaid renderer, new HTML template, and new tests. The existing codebase is not modified beyond wiring the subcommand into dimos.py. No files require special attention. Important Files Changed
Reviews (17): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile |
Non-root requests (e.g. /favicon.ico) now return 204 instead of terminating the single-request server with the HTML payload.
Route the diagnostic 'Found N blueprint(s)' message to stderr so piping '--markdown' output to a file doesn't get the message injected into the markdown stream.
Records the 5 greptile review comments on jeff/feat/dimos-graph: - 3283875847, 3283875929, 3284014771: already addressed in upstream commits 482d7ad, f87845e, ddb6856 - 3283876031: fixed in autofix commit f62f2f5 (_mermaid_id) - 3283875688: skipped (JS refactor in embedded template, exceeds easy threshold; symptom is mild)
6c2ea2c to
f87845e
Compare
|
we already have a very detailed renderer for dimos blueprints used in our documentation, as well as rerun blueprint graph view tab https://github.com/dimensionalOS/dimos/blob/main/docs/usage/modules.md is there a reason to introduce a new one? from dimos.core.introspection.svg import to_svg
from dimos.robot.unitree_webrtc.unitree_go2_blueprints import agentic
to_svg(agentic, "assets/go2_agentic.svg")I don't super mind this if someone prefers to above, but can add to core.introspection.mermaid perhaps |
…, leshy) Adds an entry for greptile P1 review #3286995045 (relative-imports fix above), records leshy's design question about merging this renderer with core.introspection.svg as a discussion-only entry, and standardizes the existing _mermaid_id entry on a full 40-char commit SHA.
Record pr_responses.yaml entry for mustafab0's 2026-05-23 review comment on PR #2213 (#3292493576) suggesting the 242-line embedded HTML f-string in _build_html become a separate graph.html file. Marked skipped — the choice of templating mechanism (str.format vs string.Template vs marker .replace vs Jinja2) is an architectural call that needs Jeff's input, and there are no unit tests covering _build_html so a silent rendering regression would not be caught by CI.
…s into jeff/feat/dimos-graph
Stream names with characters like [ ] ( ) . would produce invalid Mermaid syntax and break diagram rendering.
Yeah I know. For context, I never planned to PR this, I've been using it since February - Mustafa and Andrew just saw me using it and asked if I could add it to dimos. I don't find the existing tools useful for debugging blueprint streams, so I end up using this a lot. Main differences:
|
…nt.mermaid Move render_mermaid, themes, and color logic out of the CLI module into a reusable location. Add ocean/ember/forest/light themes with per-theme background colors, wire --theme through the CLI, and fix stream resolution for files using `from __future__ import annotations`.
…ering Snapshot test builds HTML from a complex blueprint with dangling streams, serves it over HTTP, and compares to a cached file. Snapshot auto-updates on mismatch so the next run passes.
…rmaid_blueprint for snapshot - Add "Possible Input Fighting" warning box showing topics with 2+ publishers - Color conflict items to match diagram node/stream colors - Module names shown as rounded pills with background color, streams as bordered boxes - Separator lines between multiple conflicts - Return node_color_map from render_mermaid for reuse - Simplify test to load blueprints from test_mermaid_blueprint.py directly
- Bundle mermaid.min.js inline so generated HTML works without network - Track mermaid.min.js with Git LFS - Detect possible typos: dangling In/Out streams with matching types and Levenshtein distance <= 2 (e.g. color_img vs color_image) - Normalize mermaid JS out of snapshot to keep it small
c425955 to
61c8a5f
Compare
…s into jeff/feat/dimos-graph
Adds
dimos graph <python_file>to render Blueprint flowchart diagrams as interactive Mermaid in the browser, designed for debugging.Example
Options
--no-disconnected— hide disconnected streams--markdown— print Mermaid markdown to stdout instead of serving--port— pick HTTP port (default: random)