Repository navigation
ruff_charon: offline Codegraph store with per-crate incremental refresh (D-CODEGRAPH-0 slice B) - #130
Conversation
…sh (D-CODEGRAPH-0 slice B) store::Store keeps, per crate, the relation rows, the residuals and the digests of the source files the rows came from, in ruff_r2il::sink's artifact discipline (#version + #schema, readers key off column names). RefinedTruthSink itself is not reused: it is typed to R2IL FlatFacts. - import: replaces a crate's three artifacts (temp file + rename); refuses an unconserved receipt; - stale: crates with a recorded file that changed or vanished; - with_dependents: adds every crate that depends on a stale one; - dangling: call rows whose callee no stored crate defines. Tests on the codegraph fixture rev1 -> rev2 (rev2 deletes triple and area_dyn): an incremental refresh equals a clean import; deleted functions leave no rows; skipping the dependent crate leaves exactly the edge cg_app::run -> cg_lib::area_dyn; stale names exactly the edited crates; readers refuse a newer version or a renamed column. 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: 502a80806a
ℹ️ 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".
Summary
Follows #129.
ruff_charon::store::Storepersists the Codegraph rows across sessions and refreshes them per crate when sources change.What it stores, per crate:
DEFINES,CALLS_RESOLVED,MAY_DISPATCH,UNRESOLVED_CALL, with grade and byte span);Artifact format. The artifacts follow
ruff_r2il::sink's discipline: a#version N+#schema <names>header, columns appended never reordered, and readers that key on column names. Readers refuse a newer version or a missing column.Why not
RefinedTruthSink. That trait is typed to R2IL'sFlatFact/ResidualLedger/HarvestReport. These rows are call relations (Kythe-side facts), not R2IL, so filing them through it would mix the two representations.The unit of update is a crate, because Charon translates whole crates:
importstale(root)with_dependentscargo metadatagives.dangling()A file added to a crate is detected through the file that declares it (
mod x;), which changes with it.CLI:
ruff_charon import <dir> <file.llbc> <crate>,stale <dir> <root>,dangling <dir>(exit 1 if any).Test Plan
The fixture is lance-graph
crates/sag-ra-probe/fixtures/codegraph, rev1 → rev2. rev2 deletestripleandarea_dynfromcg_liband drops thearea_dyncall fromcg_app. Its LLBC is committed intests/data.tests/store.rs, 6 tests:cg_libwithout its dependent leaves exactlycg_app::run → cg_lib::area_dyn, andwith_dependentsnamescg_app;staleis empty on unchanged sources, names onlycg_libafter a one-byte edit, names both crates on the rev2 tree, and names the crate of a deleted file;danglingreports nothing: the dangling test;cargo clippy --all-targets -- -D warningsandcargo fmt --checkare clean.diff -r).Not in this PR: residency in lance-graph's SoA. Per the sink's own seam, that is a lance-graph-side crate reading these artifacts.
Generated by Claude Code