Skip to content

graft build in WORKSPACE mode writes empty stats.json #433

Description

@comdevx

Bug Description

When graft build runs in WORKSPACE mode (multi-repo federation, where graft/workspace.json lists child repos like bots, client, server), it successfully builds the index for each child repo but writes graft/.cache/stats.json at the workspace root with all zeros:

{
  "nodeCount": 0,
  "edgeCount": 0,
  ...
}

This causes the Claude Code statusline to show "graft · not built · run graft build" even though the build succeeded and all queries (graft ask, graft grep, MCP tools) work correctly.

Expected Behavior

The stats.json should aggregate the child repo totals. For example, a workspace with three repos should show totals like nodeCount: 35529, edgeCount: 30973, etc.

Additional Issues

  • graft skeleton from the workspace root fails with "no wiring graph" — it only works when run from inside a child repo.

Steps to Reproduce

  1. Set up a workspace with child repos (e.g., bots, client, server in graft/workspace.json)
  2. Run graft build from the workspace root
  3. Observe: Build succeeds, child repos indexed, but graft/.cache/stats.json shows all zeros
  4. Verify: graft skeleton fails from workspace root; queries work correctly

Environment

  • graft version: 0.18.0
  • Node.js: >= 20

Activity

  1. hr1juldey commented on Nov 18, 2026

    @hr1juldey

    Picked this up — the workspace parent now aggregates the children graphs into the root stats.json at build time, and the sync child keeps those totals instead of overwriting them back to zeros. Draft: #858. (The skeleton-from-root half of the issue looks like a separate ask — federated skeleton — happy to take that as a follow-up if you want it.)

  2. added a commit that references this issue on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions