feat: dependency-cone browser on portfolio page#9
Merged
Conversation
Implements the site's #1 "Next work" item: a real dependency-cone browser. (1) New CLI subcommand `export-graph-json` (gpu_stack/cli_export_graph.py) walks the registry and writes a bounded JSON slice for chosen target variables. Default targets: econ.cost.per_token, training.tokens_per_sec, thermal.dc.pue. Per-node fields: name, units, scope, description (trimmed to 160 chars), is_root_input, is_constant, defining_equations. Edges are value-defining dependency links. Deterministic ordering (sorted keys and edges) for stable diffs. 706 nodes, 1011 edges, 377 KB payload. (2) Generated docs/data/registry-cone.json with that command and committed as a build artifact. Regeneration command noted in docs/readme_fragments/data_pipeline.md. (3) New section-window on the portfolio page (docs/index.html) with a nav tree-button. Vanilla JS cone browser in docs/cone-browser.js: fetches the JSON, renders the selected target's upstream cone as expandable OS-styled rows (depth-indented inset rows, gold "root" badge for root inputs, muted "const" badge for constants). Keyboard-operable buttons, aria-live status bar, graceful failure with informative notice when JSON cannot be loaded (e.g. file:// protocol). Bugs from code review fixed: stale openNodes entries purged recursively on collapse; aria-expanded omitted entirely on non-expandable leaf nodes. (4) Design verification: impeccable detect docs/ reports only the known false positive (7 em-dashes = CLI --flag tokens in console sample). Zero new findings. Tests: 21 new tests in tests/test_cli_export_graph.py covering subcommand wiring, JSON schema shape, determinism, bounds, file output, and error paths. Full pytest: 691 passed. Verify --profile full: 4/4 gates passed. https://claude.ai/code/session_01Eu2JVnPFgMQftwYTP3cGQZ
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.
$(cat <<'EOF'
Summary
export-graph-jsonCLI subcommand walks the registry dependency cones for three default targets (econ.cost.per_token,training.tokens_per_sec,thermal.dc.pue) and writes a bounded, deterministically-ordered JSON artifact (706 nodes, 1011 edges, ~377 KB).docs/data/registry-cone.jsoncommitted as a build artifact; regeneration command documented indocs/readme_fragments/data_pipeline.md.aria-livestatus bar, graceful file:// degradation with informative notice.Test plan
node --check docs/app.jsandnode --check docs/cone-browser.jsboth passpython -m pytest -qfull suite: 691 passed (baseline 670 + 21 new)python -m gpu_stack.cli verify --profile full --gate-timeout 600: 4/4 gates passedpython -m gpu_stack.cli audit --fail-on-issues: PASS, hard_failures=0cd docs && python3 -m http.server: page 200, data JSON 200, all key markup presentnode /tmp/impeccable/cli/bin/cli.js detect docs/: only the known false positive[em-dash-overuse] 7 em-dashes(CLI--flagtokens in console sample); zero new findings__pycache__and.pytest_cacheremoved before commithttps://claude.ai/code/session_01Eu2JVnPFgMQftwYTP3cGQZ
EOF
)
Generated by Claude Code