Skip to content

Function.is_test is false for functions under tests/ — query_graph cannot exclude tests #1294

Closed

Description

@melihemreguler

Summary

The stored is_test node property disagrees with the tool-level test filter. The property reports false for a function that lives in tests/, while trace_path classifies the same node as a test. Anyone filtering with WHERE f.is_test = false in query_graph gets tests back.

Repro

query_graph --query "MATCH (f:Function {name:'pipeline_create_free'}) RETURN f.file_path, f.is_test"
-> ["tests/test_pipeline.c", "false"]

The same node is treated as a test by trace_path: inbound callers of cbm_pipeline_new go from 83 with include_tests=true to 3 with the default false, and this node is among those excluded.

So the tool-level filter is correct and the stored property is wrong.

Secondary: the path filter misses tests/repro/

With the default include_tests=false, rpd_index_and_fingerprint (in tests/repro/) still appears in results. The filter appears to match tests/test_* rather than the whole tests/ tree.

Impact

  • query_graph cannot exclude tests at all — the documented property is unusable as a filter.
  • The search_graph(max_degree=0) dead-code candidate list is polluted with test files; GraphTab.deadcode.test.tsx and GraphTab.filters.test.tsx appear at the top.

Environment

  • Version: codebase-memory-mcp 0.9.0 (release binary, darwin-arm64)
  • OS: macOS 26.5.2, Apple Silicon
  • Repo under test: DeusData/codebase-memory-mcp @ af3ffbd (21,143 nodes / 123,103 edges)
  • Verified identically through both the MCP server and cli mode (outputs byte-identical)

Activity

  1. added a commit that references this issue on Jul 28, 2026
    45c162c
  2. added
    bugSomething isn't working
    priority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.
    on Jul 28, 2026
  3. added this to the 0.9.1-rc milestone on Jul 28, 2026
  4. DeusData commented on Jul 28, 2026

    @DeusData
    Owner

    Thanks for isolating the difference between file classification and node properties.

    Current main confirms the gap: cbm_is_test_file classifies the file (internal/cbm/cbm.c:1219), but function properties are serialized from def.is_test (src/pipeline/pass_definitions.c:264-277), and ordinary definitions do not inherit result->is_test_file. That is why query_graph sees false even though the separate tests/ path filter can still recognize the file.

    PR #1308 is linked and queued for review. The issue is routed to 0.9.1-rc at priority/high because the property silently changes query results. Thank you for the minimal contract-level report.

  5. added a commit that references this issue on Jul 31, 2026
    cc7b4a8
  6. Gonic0 commented on Aug 1, 2026

    @Gonic0

    Confirmed independently on 0.9.0 against a TypeScript/TSX repository after a clean full index. The graph contained 135 test-path files and 244 Function nodes under test/spec paths, while MATCH (f:Function) WHERE f.is_test = true returned zero rows. Path-based filtering remains necessary until the node property inherits file classification.

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

    bugSomething isn't workingparsing/qualityGraph extraction bugs, false positives, missing edgespriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions