Skip to content

[Feature]: one test that pins graph.json invariance for every extractor (checkout folder, rebuild, line endings) #4217

Closed

Description

@rohit-jsfreaky

Problem or use case

The same source tree should always give the same graph.json. Seven recent bugs broke that in one of four ways, and each was found by diffing two builds by hand:

way it broke issues
checkout path (and OS username) inside an id or a graph.json key #4152, #4154, #4156, #4182, #4188
a rebuild of an unchanged tree writes a different graph than the first build #4180, #4188
CRLF checkout gives different ids than LF #4164
raw --no-cluster edge points at a node that is never declared #4182

Each fix added a narrow test for its own extractor or write path. Nothing checks the invariant across all extractors, so the next extractor, or the next change to a write path, can bring the same bug back without any test failing.

Proposed solution

One test file that builds the whole tests/fixtures corpus (every language with an extractor) through the real CLI, in --no-cluster and clustered mode, and compares every node and edge with all attributes:

  • two copies in different folders give the same graph;
  • the checkout folder name appears nowhere in graph.json;
  • a cold build and a rebuild of the unchanged tree are the same (top-level keys too);
  • an LF copy and a CRLF copy give the same graph;
  • every raw edge endpoint is a declared node;
  • the corpus is not trivially empty (guards against a silent empty build).

Community ids are left out of the comparison (they come from clustering; #3761 covers that).

Alternatives considered

  • Keep adding one narrow test per bug: that is what happened seven times, and it only protects the one extractor each bug was found in.
  • A CI job that builds a real repo and diffs: slower, needs network, and harder to run locally than a pytest file on the fixtures already in the repo.

Area

Developer experience or CI

Are you willing to submit a PR?

Yes, I can work on this

Compatibility / behavior impact

Test only. No change to node/edge ids, cache, graph.json schema, skills, MCP output or incremental updates. Adds about 20 s to the suite.

Additional context

Written and checked against 0.9.80 (6478eb7): 12/12 pass. Against 0.9.79 the three checks covered by #4180/#4182/#4188 fail, which is the point. PR right after this issue. Windows 11, Python 3.12.12.

Activity

  1. github-actions commented on Oct 8, 2026

    @github-actions

    Thanks for opening this issue, @rohit-jsfreaky. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  2. safishamsi commented on Oct 8, 2026

    @safishamsi
    Member

    Fixed by #4218 (thanks @rohit-jsfreaky), shipped in v0.9.81. Closing as resolved.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions