Repository navigation
ruff_charon: Rust intake arm reading Charon LLBC (D-CODEGRAPH-0 slice A) - #129
Conversation
Reads Charon's LLBC through charon-lib (AdaWorldAPI fork, library only, stable) and reports what Charon witnessed: - calls: byte-identical to lance-graph sag-ra-probe/tools/llbc_calls.py; - rows: DEFINES / CALLS_RESOLVED / MAY_DISPATCH / UNRESOLVED_CALL (crai-rs vocabulary, grade COMPILER) with byte spans, residuals, and a receipt checking harvested == represented + residual; - kythe: defines, ref/call and childof entries plus file nodes, in the shape kythe_entries.py writes. A call through a generic bound or a trait object is never a confirmed caller. Impl methods are named by Charon's formatter, so the two Shape::area impls stay distinct across crates. Excluded from the ruff workspace, like ruff_r2il. Tests run on the codegraph fixture's LLBC with llbc_calls.py's output as the reference. 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: ec0ac5da24
ℹ️ 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".
…129 review) Two Codex findings on #129: - A call through `TraitRefKind::TraitImpl` was a CALLS_RESOLVED row naming only the trait, so two impls of one trait gave one target, the row matched no DEFINES, and the Kythe ref/call edge pointed at the trait. It now names the function it resolves to: the impl's own method from `TraitImpl.methods`, else the trait's default method. An impl or method missing from the LLBC is a TRAIT_IMPL_METHOD_NOT_FOUND residual, never a row pointing at the trait. - A local function without a structured body was harvested once but represented by its DEFINES row and also counted as a residual, so the receipt could not conserve and `rows` exited 3. The body is now harvested as its own item. Tests: a_call_through_a_known_impl_names_the_resolved_function (real LLBC of a one-file crate, calls rewritten into TraitImpl calls: impl method, trait default, and a missing impl); an_opaque_body_keeps_the_receipt_conserved. Charon emits no TraitImpl calls for any source tried here (fixture, mask-risc, method/qualified/default-method calls), hence the rewrite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
Summary
A new crate,
crates/ruff_charon, is the Rust intake arm of the Codegraph route Charon → ruff → lance-graph + crai-rs (lance-graph pland-codegraph-0-resident-codegraph-v1.md, PR AdaWorldAPI/lance-graph#1918). It reads Charon's LLBC throughcharon-libfrom the AdaWorldAPI Charon fork, library only, on stable 1.99. It reports only what Charon witnessed, in three modes:calls: one line per local function, byte-identical to lance-graphcrates/sag-ra-probe/tools/llbc_calls.py, the reference this crate is checked against.rows: relation rows in the crai-rs vocabulary, each gradedCOMPILERand carrying its byte span. A receipt checksharvested == represented + residual, so nothing is dropped silently.CALLS_RESOLVEDClause) or other trait referenceMAY_DISPATCHdynvtable slotUNRESOLVED_CALLA
MAY_DISPATCHrow is never counted as a confirmed caller.kythe: Kythe entries in the shapekythe_entries.pywrites:defines,ref/callandchildofedges, plus afilenode with each file's text, which Kythe needs to serve anchors.Impl methods are named with Charon's own formatter. The two
Shape::areaimpls in the fixture therefore stay distinct, including when called from another crate. Under the path-only spelling the Python tools use, both print ascg_lib::shapes::Impl::area.The crate is excluded from the ruff workspace, like
ruff_r2ilandruff_metta_spo, because it path-depends on a sibling checkout (../../../charon/charon, built withdefault-features = false). The only change outside the crate is that rootexcludeline.Test Plan
cargo test --manifest-path crates/ruff_charon/Cargo.toml: 3 unit and 6 integration tests pass. They run on committed LLBC of lance-graph'ssag-ra-probe/fixtures/codegraph/rev1(tests/data, provenance in its README), withllbc_calls.py's output as the reference:callsreport equals the reference byte for byte;MAY_DISPATCHand thedyncall isUNRESOLVED_CALL, neitherCALLS_RESOLVED;assert_eq!, made through the aliast3, is witnessed at its exact byte span;Shape::areaimpls get distinct names, andcg_app::runnames theSquareone;cg_lib);ref/callanchor and its file text.cargo clippy --all-targets -- -D warningsandcargo fmt --checkare clean.cargo metadataon the ruff workspace still resolves with the newexcludeentry.callsis byte-identical tollbc_calls.py, in 5.6 s release.rowsconserves 16,149 = 16,149 + 0: 459 DEFINES, 15,684 CALLS_RESOLVED, 2 MAY_DISPATCH, 4 UNRESOLVED_CALL./xrefsover thekytheoutput returns 3/3 hand-read call pins; without the file nodes it returns 0/3.Producing LLBC needs the fork's
charonbinary on its pinnednightly-2026-09-17, built with--no-default-features --features rustc: the defaultminirustfeature needs a git submodule. That step is not in CI here.Generated by Claude Code