Skip to content

package graph generator to understand dependencies - #6441

Open
tantaman wants to merge 1 commit into
mainfrom
package-graph
Open

package graph generator to understand dependencies#6441
tantaman wants to merge 1 commit into
mainfrom
package-graph

Conversation

@tantaman

@tantaman tantaman commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

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:

CleanShot 2026-08-29 at 10 57 23@2x

Zero-server should not:

  • depend on zero-cache
  • depend on zqlite
CleanShot 2026-08-29 at 10 58 46@2x

Zero-client should not depend on:

  • zero-cache
  • datadog

If we can clean these up then we can make LLMs more trustworthy and succesful in the codebase.
@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
replicache-docs Ready Ready Preview Aug 29, 2026 2:23pm
zbugs Ready Ready Preview Aug 29, 2026 2:23pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)!)!,
Comment thread package.json
"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.
}
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.

2 participants