Skip to content

codegraph: grep-native .codegraph/ projection, reduced Cargo/syntactic slice (D-CODEGRAPH-MEM-1) - #1999

Merged
AdaWorldAPI merged 5 commits into
mainfrom
ccr-ca0562e7-hudvlz-codegraph-mem
Nov 11, 2026
Merged

AdaWorldAPI merged 5 commits into
mainfrom
ccr-ca0562e7-hudvlz-codegraph-mem

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Adds .claude/tools/codegraph_index.py and the generated .codegraph/ directory: compact, line-oriented, source-backed facts that any agent can search with rg. It is a projection: the code stays the truth. There is no new store, registry or executor.

Scope: the reduced slice EXO-230 gate 3 allows only with explicit approval.

  • It covers Cargo dependencies, syntactic declarations and use leaves (cfg kept), and curated architecture rows.
  • No Charon artifact exists for any real crate, so every crate reports CALL_GRAPH=ARTIFACT_MISSING, never an empty graph. Charon ingestion is tested against the Codegraph fixture.
  • The original ~15 navigation commands were not recovered. The recipes in index.md are labelled NEW / DERIVED 2026-11-11.

What it adds

  • codegraph_index.py: stdlib only, deterministic, with --write, --check and --self-test in the entries_index.py / supersession_index.py convention.
  • .codegraph/: 108 generated files, about 4.9 MB:
  • .codegraph/architecture.tsv: the only hand-maintained input, 24 reviewed rows, each with path:line and an anchor token that --check re-validates. Architectural relationships come only from here, never from imports.
  • Freshness: each crate has a digest over the git blob ids of its manifest and src/ files. --check names every stale crate. No timestamps, absolute paths or HEAD sha appear in the output.
  • CI: .github/workflows/codegraph-index.yml runs the self-test and --check on PRs that touch the generator or .codegraph/. Whether to gate every crates/ change is left open on EXO-230.
  • .claude/probes/2026-11-11-codegraph-mem-1/REPORT.md: crosswalk, negative tests, measurement, gap report and the suggested CLAUDE.md line (not applied).

Evidence

  • Self-test: 11 falsifiers, all passing:
    • stale index;
    • cfg import and Cargo target cfg;
    • dispatch never CONFIRMED;
    • a plan never becomes shipped;
    • same-name symbols kept apart;
    • byte-identical output;
    • ARTIFACT_MISSING reported, not empty;
    • Charon fixture ingestion, including fnv64 STALE;
    • use-tree expansion;
    • anchor rot;
    • the lexer.
  • Disable runs: 1, 2, 3, 4, 5, 7, 8 and 10 each turned red, then green again after restoring.
  • On the real repo: appending a line to dt64/src/lane.rs makes --check report STALE crate lance-graph-dt64. Rebasing onto main after foundry-parity-lab: CanCook as a registered DT64 method (G6) + board record for #1991/#1995 #1996 made it flag two views before regeneration.
  • A/B measurement: 10 fresh agents, 5 questions, graded against an answer key built from source beforehand. With the index first:
    • Architecture questions (Q1, Q4, Q5): correct, with 4.6k–8.3k fewer tokens and up to 4 fewer tool calls.
    • Census (Q2): no difference.
    • Call impact (Q3): worse, because calls are ARTIFACT_MISSING.
    • Breadth: source-only answers were broader.
    • Single runs per cell: an indication, not a result. Details are in the report.

What changes in existing behaviour

None. No Rust code changes; this adds a tool, generated files, a workflow and docs.

Open

  • Real-crate Charon artifacts: EXO-229 gate A. Without them the index cannot answer call-impact questions.
  • --check gating scope: whether it should gate every crates/ change (EXO-230).
  • Import resolution: re-exports and globs are marked POSSIBLE, and tests, examples and benches are not scanned.

Board: EXO-230 (navigation), EXO-229 (intake).


Generated by Claude Code

Hand-reviewed rows: subject, relation, object, status, evidence path:line and
an anchor token the generator re-checks on every run. Architectural
relationships are never inferred from imports; this file is their only source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
…EM-1, reduced Cargo/syntactic slice)

Deterministic, stdlib-only generator (--write / --check / --self-test) in
the entries_index.py / supersession_index.py convention. Projects Cargo
dependency edges, Rust declarations and use-tree leaves (cfg kept), validated
curated architecture rows, and ruff_charon call rows when a store is given.
No Charon artifact exists for any real crate, so every crate reports
CALL_GRAPH=ARTIFACT_MISSING rather than an empty call graph. Per-crate digest
over git blob ids; --check names every stale crate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
…D-CODEGRAPH-MEM-1)

Regenerated after #1996/#1997 merged (--check flagged the drift first).
New workflow runs --self-test and --check on PRs touching the generator or
.codegraph/. REPORT.md: unrecovered original recipes, crosswalk, negative
tests with disable runs, 10-agent A/B measurement (index helps on
architecture questions, hurts on call impact while calls are
ARTIFACT_MISSING), gap report with owners, suggested CLAUDE.md line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1d6642d7-b490-4a28-903a-3730e8b84b46
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review November 11, 2026 01:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T01:48:53.147589Z faf7ce1 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: faf7ce1021

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .claude/tools/codegraph_index.py Resolved
…s the child file

#1999 review: an inner attribute was treated as an outer one on the first
item, so crates/deepnsm/src/ticket_emit.rs's file-level contract-ticket gate
reached one import and left emit_ticket and both constants unconditional.
Inner cfgs now scope the enclosing file or inline module, and a #[cfg] on an
out-of-line mod declaration is inherited by the declared file (default layout;
#[path] not followed). Repeated gates are deduplicated. Tests 12 and 13.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
The first version tested the helper alone, so removing the place where the
inherited gate is applied left it green. It now builds a temp workspace and
reads symbols.tsv.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
@AdaWorldAPI
AdaWorldAPI merged commit 9f4563b into main Nov 11, 2026
2 checks passed
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