package graph generator to understand dependencies - #6441
Open
tantaman wants to merge 1 commit into
Open
Conversation
If we can clean these up then we can make LLMs more trustworthy and succesful in the codebase.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a package dependency graph generator to expose architectural relationships and layer inversions.
Changes:
- Builds a deterministic workspace dependency model.
- Generates Markdown/Mermaid and interactive HTML views.
- Adds graph commands, documentation, and generated-output handling.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
.gitignore |
Ignores generated interactive graph files. |
.oxfmtrc.json |
Excludes generated Markdown from formatting. |
AGENTS.md |
Documents graph usage and architecture checks. |
docs/PACKAGE-GRAPH.md |
Adds the committed dependency report. |
notes.md |
Adds an unrelated scratch note. |
package.json |
Adds root graph commands. |
pnpm-lock.yaml |
Locks the new tool dependencies. |
tools/package-graph/package.json |
Defines the graph workspace package. |
tools/package-graph/tsconfig.json |
Configures TypeScript compilation. |
tools/package-graph/src/main.ts |
Implements CLI generation and checking. |
tools/package-graph/src/model.ts |
Builds and analyzes the dependency model. |
tools/package-graph/src/render-html.ts |
Generates the interactive graph. |
tools/package-graph/src/render-markdown.ts |
Generates Markdown and Mermaid output. |
tools/package-graph/src/workspace.ts |
Defines layers and extracts workspace dependencies. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+386
to
+390
| const layerViolations: LayerViolation[] = edges | ||
| .filter( | ||
| edge => | ||
| layerIndex.get(packageToLayer.get(edge.from)!)! < | ||
| layerIndex.get(packageToLayer.get(edge.to)!)!, |
| "check-types:watch": "turbo watch check-types", | ||
| "start-zero-cache": "cd packages/zero-cache && pnpm run start", | ||
| "graph": "node tools/package-graph/src/main.ts", | ||
| "graph:check": "node tools/package-graph/src/main.ts --check", |
Comment on lines
+13
to
+14
| * appears under `devDependencies` -- 120 of the 136 internal edges do. Dropping | ||
| * them, as a published-artifact view would, leaves an empty graph. The edge's |
Comment on lines
+881
to
+884
| var visible = | ||
| (state.edgeSet === "all" || edge.structural || ownEdge || entry.inverted) && | ||
| (state.showDev || edge.kind !== "dev") && | ||
| (!state.inversionsOnly || entry.inverted); |
Comment on lines
+814
to
+821
| function focusSets(name) { | ||
| var pkg = pkgByName[name]; | ||
| if (state.focus === "neighbours") { | ||
| return { down: new Set(pkg.dependsOn), up: new Set(pkg.dependents) }; | ||
| } | ||
| if (state.focus === "dependencies") return { down: down[name], up: new Set() }; | ||
| if (state.focus === "dependents") return { down: new Set(), up: up[name] }; | ||
| return { down: down[name], up: up[name] }; |
Comment on lines
+112
to
+117
| try { | ||
| spawn(command, args, {stdio: 'ignore', detached: true}).unref(); | ||
| } catch { | ||
| // Opening a browser is a convenience; the file is already on disk either | ||
| // way. | ||
| } |
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.
the tldr is: I have a tough time trusting LLM changes given we have no strict module boundaries. A LLM puts up a diff and it changes zero-cache where I only expected zero-client changes, for example.
Idk to what extent the lack of bounds cause problems for LLMs themselves but I do always have less success with an LLM in the Zero repo than I do in other repos.
Some red flags this shows:
Zero-server should not:
Zero-client should not depend on: