Skip to content

representative-only edge emission relies on a containment star that is env-gated OFF #208

Description

@nikolay-e

Mechanism

Three builders were rewritten (in the 8ff8c2b..a557b30 epoch) to emit only to file representatives, each justified with "the containment star spreads its mass inside the file":

  • edges/base.rs link_by_path_match (~:170-178)
  • edges/semantic/c_family.rs (~:170-176, includes + header/impl pairing)
  • edges/structural/testing.rs (~:122-125)

But the intra-file star in edges/structural/containment.rs:67 is gated behind std::env::var_os("DIFFCTX_FILE_STAR"), which nothing sets — so by default the star does not exist. The containment nesting pass only links nested definitions; a flat file (12 top-level declarations, no nesting) gets nothing.

Failure scenario

a.c includes foo.h; foo.h has 12 flat top-level declarations. The include edge lands only on the largest fragment; the other 11 receive zero mass and are dropped by filter_positive_relevance. Before the rewrite all 12 were reachable. Same for test_foo.py -> foo.py and every path reference.

Minor: reps in containment.rs:25 allocates a String per fragment even when the gate is off.

Question to resolve

Either the flip rode the v5 validation with the star off and the builder comments are stale (then the comments must change and the mass-stranding is accepted, measured), or the star was meant to ship on. Needs a corpus/dcbench A/B before deciding — Q-class either way.

Found by the 2026-08-10 QA diff review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions