Skip to content

fix(export): write graph.json as one line of compact JSON (companion of Graphify-Labs/graphify#4319) - #13

Closed
andrebrait wants to merge 1 commit into
v8from
fix/compact-graph-json
Closed

andrebrait wants to merge 1 commit into
v8from
fix/compact-graph-json

Conversation

@andrebrait

Copy link
Copy Markdown
Member

Review companion of Graphify-Labs#4319, opened so bot reviews can run in a repository where we can request them. Same head branch (fix/compact-graph-json) and same base commit (v8 at b4e6307, identical to upstream v8), so the diff is the same. Do not merge here; the change lands through the upstream PR.

See Graphify-Labs#4319 for the full description and evidence.

graph.json was pretty-printed (indent=2), so every PR that commits a
rebuilt graph reports tens of thousands of changed lines. GitHub's PR
line counts ignore .gitattributes (-diff, binary), so only the file's
content can fix it: one line of compact JSON is +1 -1.

Every writer of a project graph.json now emits separators=(",", ":")
with no indent: to_json, the `update` raw/no-cluster candidate text,
prune, merge-driver, merge-graphs, `extract --no-cluster` and the global
graph. Readers are unaffected.

`update` compares parsed data, not bytes, so an existing indented graph
would have been "unchanged" forever. It is now rewritten compact once,
then left alone.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Thanks for the pull request, @andrebrait. A maintainer will review it soon.

Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions.

A couple of things that speed up review: make sure the test suite passes on Python 3.10 and 3.13, and that the change keeps extraction deterministic.

@andrebrait

Copy link
Copy Markdown
Member Author

@codex review

@andrebrait

Copy link
Copy Markdown
Member Author

Upstream shipped this in Graphify 0.9.86 as an authorship-preserving cherry-pick (Graphify-Labs#4319). Closing the review copy.

@andrebrait andrebrait closed this Oct 13, 2026
@andrebrait
andrebrait deleted the fix/compact-graph-json branch October 13, 2026 12:23
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