Repository navigation
D-CODEGRAPH-0 slice C: lance-graph-codegraph — callers, callees, impact and structural diagnostics - #1921
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
…RAPH-0 slice C) Reads the ruff_charon store artifacts by schema column name, interns symbols in natural row order, and builds one xlog cube (CALLS, NODE, MAY, IMPL, RCONF, RPOSS) plus position masks. Workspace-excluded, like sag-ra-probe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
…ved call, dangling call, unused import NOT_RUN) Each finding follows crai-rs's review semantics: grade COMPILER, run status COMPLETE / PARTIAL / NOT_RUN / REFUSED, so a diagnostic that did not run is never reported as clean. Unused imports are NOT_RUN: LLBC has no use items. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
…nd guard tests Queries answer as confirmed / possible / unknown masks over the xlog cube: support and bag_count over bound joins, and the RCONF / RPOSS closures for impact. MAY_DISPATCH is never confirmed; a dyn or pointer call is UNKNOWN. Oracles are hand-checked against the rev1 / rev2 / mixed / fnref stores; guards cover ClosureWidth(70), TooMany(300), version, arity, permuted columns and the PARTIAL run status. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09484d1bc5
ℹ️ 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".
| let scan = cube.scan(rel)?; | ||
| let bound = cube.bind(table, scan, bound_col, u32::from(v))?; | ||
| let node = cube.scan(NODE)?; | ||
| let join = cube.join(bound, join_col, node, 0)?; |
There was a problem hiding this comment.
Reuse query views instead of retaining new nodes on every call
When a Codegraph is reused for repeated caller/callee queries, every invocation of partners permanently adds four nodes to Cube::nodes: scan, bind, and join all append through Cube::push, and those nodes are never reclaimed. Even repeating the same query therefore grows memory without bound despite the graph remaining unchanged; dispatch queries amplify this through or_partners. Cache and reuse the views for each relation/position/direction, or provide a way to release temporary query nodes after the terminals finish.
Useful? React with 👍 / 👎.
| _ => {} | ||
| } | ||
| } | ||
| let overall = if partial { Run::Partial } else { Run::Complete }; |
There was a problem hiding this comment.
Require extraction evidence before reporting a complete run
If the supplied directory contains no *.rows.tsv files, Codegraph::open succeeds, and this default reports Complete with empty findings for dead functions, unresolved calls, and dangling calls. I reproduced this against an empty temporary directory. The same problem occurs with a header-only artifact lacking a CRATE row: no extraction has been established, yet consumers receive a clean, completed verdict. Track whether completion evidence was present and return NotRun/Refused (or reject the intake) when it is absent.
Useful? React with 👍 / 👎.
…fixture scale) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
…1a5sw board: post-merge record for #1921
Summary
This adds a new workspace-excluded crate,
crates/lance-graph-codegraph. It reads theruff_charonstore artifacts (rows v2, from ruff #132, mergeded8fd4194f) and answers code queries over one xlog cube. It reads the artifact files by#schemacolumn name, the same wayruff_r2il::sinkdoes, and does not depend onruff_charonor Charon.Graph. Every symbol becomes a position in natural row order: 15 on the rev1 fixture. One cube holds six relations:
CALLS: confirmed calls, caller to callee.NODE: each position paired with itself.MAY: possible dispatch, caller to trait method.IMPL: impl method to the trait method it implements.RCONF:CALLSreversed.RPOSS: the possible reverse edges, built from dispatch and dynamic calls.Position masks cover functions, public, impl, synthetic, referenced, called, dynamic callers and stored owner.
Queries. Each answers as a mask graded confirmed, possible or unknown.
MAY_DISPATCHis never counted as confirmed. A dyn call or function-pointer call is unknown, never "unaffected".callersandcalleesuse cubesupportover bound joins, with site counts frombag_count.referencesuses a row scan into a mask.impactuses the cachedRCONF⁺andRPOSS⁺closures.cube().stats().rows_materialized == 0after the whole suite, so no answer path builds tuples.Diagnostics. They follow crai-rs's review semantics: grade
COMPILER,POSSIBLEis a qualifier, and the run status can say NOT_RUN, so no finding set is reported as clean when the check never ran.NO_ENTRY_FACTS.NO_IMPORT_FACTS, because LLBC has nouseitems.Deferred, surfaced as typed refusals. Closure is limited to 64 positions (
ClosureWidth) and a tile to 256 symbols (TooMany), so every cube query on mask-risc (459 functions) is refused today and reported as UNKNOWN. Tiled closure and multi-tile cubes need their own D-id.Test Plan
Fixture stores in
tests/data: rev1, rev2, mixed (cg_lib rev2 with cg_app rev1) and fnref.tests/oracle.rs, 20 tests. Every expected answer was hand-checked against the stores:impact(double)on rev1: confirmed {Square::area, run}, possible {area_of}, unknown {area_dyn}.impact(double)on rev2: 4 confirmed, including the two-hopchecked.callees(run)on rev2: 3 callees across 4 sites, so caller count and site count are tested separately.private_unused, which matches rustc'sdead_code. fnref reportsunused_privateand stays silent on the pointer-onlyhelper.run → area_dyn. rustc reports E0425 atcg_app/src/lib.rs:7on the same tree. rev1 and rev2 report nothing, even though they contain an external callee (core::panicking::assert_failed).tests/guards.rs, 7 tests:ClosureWidth(70);TooMany(300);Disable runs. Twelve, each turning its own test red:
RPOSS;ClosureWidthsurfacing;The impl-method exclusion first stayed green, because Charon marks every impl method of a public trait public. The synthetic store in
guards.rsnow covers it.Release timing (
examples/timing.rs), in ns per call: callers 5103, callees 3643, references 184, impact 387. Opening takes 166 µs and the first closure 5 µs; both are one-time costs, reported but not gated.Checks:
cargo clippy --all-targets -- -D warningsandcargo fmtare clean.entries_index.py --check,append_only_gate.py origin/mainand the supersession index are all current.Board:
Generated by Claude Code