Skip to content

feat(code-graph): --link, cross-repository graph links - #139

Merged
h0ffmann merged 1 commit into
mainfrom
feat/code-graph-link
Oct 21, 2026
Merged

h0ffmann merged 1 commit into
mainfrom
feat/code-graph-link

Conversation

@h0ffmann

Copy link
Copy Markdown
Owner

Adds code-graph extract DIR --link NAME=PATH/graph.json[@URL] (repeatable): references in DIR's text files to another repository (flake ?dir=, GitHub tree/blob URLs, lab=PATH, labs/X in a file that names it) become external nodes NAME:<id> with a depends_on edge and an href to the other page. graph.html draws them as dashed rings, a click opens the other page, #node=<id> focuses a node on load. Without --link graph.json is byte-identical to before. README section: Linking graphs across repositories.

Real case (ptbr-writer adfa9a5 + picasso 4bc03e5): 4 external nodes (labs/gleam-website, labs/code-graph, labs/ptbr-pdf, labs/ptbr-tools), 15 edges from 10 files.

Not run: aarch64 checks; no Chrome test in the flake (the #node= focus was checked by hand in headless Chrome).

`extract DIR --link NAME=PATH/graph.json[@url]` reads DIR's text files for references
to the other repository (flake ?dir= URLs, GitHub tree/blob URLs, lab=PATH, labs/X in
a file that names it) and adds the nodes they resolve to as external nodes with a
depends_on edge and an href to the other page. graph.html draws them as dashed rings,
opens their href on a click, and focuses #node=<id> on load. Without --link graph.json
is unchanged.

Tested: nix flake check --no-update-lock-file in labs/code-graph (build+cargo test, clippy -D warnings, fmt, size, smoke); old vs new graph.json byte-identical on 4 trees; real case ptbr-writer + forks/picasso, headless Chrome #node= focus and screenshot
Co-Authored-By: Claude <[email protected]>
@h0ffmann
h0ffmann merged commit 002a5c8 into main Oct 21, 2026
h0ffmann added a commit that referenced this pull request Oct 21, 2026
…) (#140)

An external node is labelled by the PATH it was found by (`picasso: labs/ptbr-pdf`; the first
PATH in sorted order if several resolve to one node) and keeps its own label as `linked_label`,
shown in the side panel. The Relations legend lists only the relations the graph has and now
has depends_on, with its own colour. External nodes and the files that point at them are always
labelled. The README Size table has the new binary sizes.

Tested: nix flake check --no-update-lock-file in labs/code-graph (build+cargo test, clippy -D warnings, fmt, size, smoke); real case ptbr-writer + forks/picasso, headless Chrome screenshot; nix build, nix build .#static, stat, xz -9e for the sizes

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant