From 0eb72b95e467d703908b6628114a700669310574 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 06:05:41 +0000 Subject: [PATCH 1/2] D-CODEGRAPH-0-B: offline store in ruff #130; rev2 fixture deletes area_dyn The rev2 fixture now also deletes cg_lib::area_dyn and drops its call from cg_app, so a refresh that skips the dependent crate leaves a dangling edge the store can be tested on. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX --- .claude/board/STATUS_BOARD.md | 2 +- .../entries/2026-11-02-d-codegraph-0-gap-map.md | 16 ++++++++++++++++ .../fixtures/codegraph/rev2/cg_app/src/lib.rs | 2 +- .../fixtures/codegraph/rev2/cg_lib/src/lib.rs | 4 ---- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.claude/board/STATUS_BOARD.md b/.claude/board/STATUS_BOARD.md index d1c7a28ef..85151610c 100644 --- a/.claude/board/STATUS_BOARD.md +++ b/.claude/board/STATUS_BOARD.md @@ -238,7 +238,7 @@ Plan: [d-codegraph-0-resident-codegraph-v1.md](../plans/d-codegraph-0-resident-c | D-id | scope | status | gate / falsifier | |---|---|---|---| | **D-CODEGRAPH-0-A** | ruff `ruff_charon`: LLBC → Kythe facts with a witness status per call, for one real crate | SHIPPED: ruff #129 (merged `9913e90946`), lance-graph #1918 (merged `c11e4262e`): calls byte-identical to `llbc_calls.py` on the fixture and `mask-risc`; receipt conserved (16,149); Kythe `/xrefs` 3/3 call pins | rust-analyzer oracle (`sag-ra-probe GRAPH=1`) and rustc on `fixtures/codegraph`; `POSSIBLE` never counted as a confirmed caller | -| **D-CODEGRAPH-0-B** | resident rows via the ruff sink; per-file digests; incremental invalidation | QUEUED | clean import == incremental import | +| **D-CODEGRAPH-0-B** | resident rows via the ruff sink; per-file digests; incremental invalidation | IN PR: ruff #130 (offline store in `ruff_charon`; `RefinedTruthSink` not reused, typed to R2IL). Incremental == clean on the fixture, byte-identical; skipped dependent leaves exactly one dangling edge. Lance-graph SoA residency still open | clean import == incremental import | | **D-CODEGRAPH-0-C** | callers / callees / impact / diagnostics; tiled closure; body → R2IL design check | QUEUED | each guard disable-verified; unused import proven only without macros, traits, globs, re-exports | | **D-CODEGRAPH-0-D** | local stdio MCP over C | QUEUED | only after B and C gates | | **D-CODEGRAPH-0-E** | token measurement with and without the Codegraph | QUEUED | same revision, questions, model; nothing claimed before measured | diff --git a/.claude/board/entries/2026-11-02-d-codegraph-0-gap-map.md b/.claude/board/entries/2026-11-02-d-codegraph-0-gap-map.md index ca902e5ae..c9e407fe8 100644 --- a/.claude/board/entries/2026-11-02-d-codegraph-0-gap-map.md +++ b/.claude/board/entries/2026-11-02-d-codegraph-0-gap-map.md @@ -67,3 +67,19 @@ Not yet: rust-analyzer as an independent check of the rows (the comparison is st ## Correction (2026-11-02): G8 withdrawn The ruff sink is not unmerged. Ruff PRs #101 (`RefinedTruthSink` + offline backend), #102 (v2 facts/residuals artifacts and their reader) and #103 (round-trip reconstruction oracle) merged on 2026-08-18. The #121 replay carried their content onto today's `main` (`crates/ruff_r2il/src/sink.rs:72` `pub trait RefinedTruthSink`; `read_facts`, `read_residuals`), where it has since changed. The three `claude/r2il-pr2-*` branches only look unmerged because they share no history with the rebuilt `main`. Slice B builds on `main`'s `sink.rs`, not on those branches. + +## Slice B: the offline store (ruff #130, branch `claude/ruff-charon-intake`, `502a80806a`) + +`ruff_charon::store::Store` persists per crate: relation rows, residuals, and the FNV-1a digest of every source file Charon read. The artifacts follow `ruff_r2il::sink`'s discipline (`#version` + `#schema`, readers keyed by column names). `RefinedTruthSink` is not reused: it is typed to R2IL `FlatFact`s, and these rows are call relations. + +The unit of update is the crate: `import` replaces all of a crate's artifacts, `stale(root)` names crates with a changed or vanished file, `with_dependents` adds their dependents, and `dangling()` reports call rows whose callee no stored crate defines. + +On the fixture, rev1 → rev2 (rev2 now also deletes `area_dyn` from `cg_lib` and drops its call from `cg_app`): +- **Incremental == clean.** Refreshing both crates gives the same rows as a clean rev2 import; through the CLI the store directories are byte-identical (`diff -r`). +- **Deletions.** `triple` and `area_dyn` leave no rows. +- **Skipped dependent.** Refreshing only `cg_lib` leaves exactly one dangling edge, `cg_app::run → cg_lib::area_dyn`. +- **Staleness.** `stale` is empty on unchanged sources, names `cg_lib` after a one-byte edit, and names both crates on the rev2 tree. + +Five disable runs each turn their own tests red. + +G5 (resident, incremental store) is closed for the offline form. Still open: residency in lance-graph's SoA (a lance-graph-side reader of these artifacts), then the queries of slice C. diff --git a/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_app/src/lib.rs b/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_app/src/lib.rs index 5330ddfec..fb6494255 100644 --- a/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_app/src/lib.rs +++ b/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_app/src/lib.rs @@ -4,5 +4,5 @@ use cg_lib::Sq; pub fn run() -> u32 { let s = Sq(3); let r = Rect(1, 2); - cg_lib::area_of(&s) + cg_lib::area_dyn(&r) + s.area() + cg_lib::util::double(2) + cg_lib::area_of(&s) + cg_lib::area_of(&r) + s.area() + cg_lib::util::double(2) } diff --git a/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_lib/src/lib.rs b/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_lib/src/lib.rs index b31d29a95..9fa6a5b48 100644 --- a/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_lib/src/lib.rs +++ b/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_lib/src/lib.rs @@ -8,10 +8,6 @@ pub fn area_of(s: &S) -> u32 { s.area() } -pub fn area_dyn(s: &dyn shapes::Shape) -> u32 { - s.area() -} - #[cfg(any())] pub fn disabled() -> u32 { util::double(1) From 15d6363dcb08b052829614eda9b8176d9a79a925 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 06:05:41 +0000 Subject: [PATCH 2/2] D-CODEGRAPH-0-B: offline store merged as ruff #130; rev2 fixture deletes area_dyn The rev2 fixture now also deletes cg_lib::area_dyn and drops its call from cg_app, so a refresh that skips the dependent crate leaves a dangling edge the store can be tested on. ruff #131 (open) carries the Codex fixes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX --- .claude/board/STATUS_BOARD.md | 2 +- .../2026-11-02-d-codegraph-0-gap-map.md | 18 ++++++++++++++++++ .../fixtures/codegraph/rev2/cg_app/src/lib.rs | 2 +- .../fixtures/codegraph/rev2/cg_lib/src/lib.rs | 4 ---- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.claude/board/STATUS_BOARD.md b/.claude/board/STATUS_BOARD.md index d1c7a28ef..e7757b80a 100644 --- a/.claude/board/STATUS_BOARD.md +++ b/.claude/board/STATUS_BOARD.md @@ -238,7 +238,7 @@ Plan: [d-codegraph-0-resident-codegraph-v1.md](../plans/d-codegraph-0-resident-c | D-id | scope | status | gate / falsifier | |---|---|---|---| | **D-CODEGRAPH-0-A** | ruff `ruff_charon`: LLBC → Kythe facts with a witness status per call, for one real crate | SHIPPED: ruff #129 (merged `9913e90946`), lance-graph #1918 (merged `c11e4262e`): calls byte-identical to `llbc_calls.py` on the fixture and `mask-risc`; receipt conserved (16,149); Kythe `/xrefs` 3/3 call pins | rust-analyzer oracle (`sag-ra-probe GRAPH=1`) and rustc on `fixtures/codegraph`; `POSSIBLE` never counted as a confirmed caller | -| **D-CODEGRAPH-0-B** | resident rows via the ruff sink; per-file digests; incremental invalidation | QUEUED | clean import == incremental import | +| **D-CODEGRAPH-0-B** | resident rows via the ruff sink; per-file digests; incremental invalidation | LANDED (offline form): ruff #130 (merged `95be2e480b`; offline store in `ruff_charon`; `RefinedTruthSink` not reused, typed to R2IL). Incremental == clean on the fixture, byte-identical; skipped dependent leaves exactly one dangling edge. Follow-up fixes in ruff #131 (open). Lance-graph SoA residency still open | clean import == incremental import | | **D-CODEGRAPH-0-C** | callers / callees / impact / diagnostics; tiled closure; body → R2IL design check | QUEUED | each guard disable-verified; unused import proven only without macros, traits, globs, re-exports | | **D-CODEGRAPH-0-D** | local stdio MCP over C | QUEUED | only after B and C gates | | **D-CODEGRAPH-0-E** | token measurement with and without the Codegraph | QUEUED | same revision, questions, model; nothing claimed before measured | diff --git a/.claude/board/entries/2026-11-02-d-codegraph-0-gap-map.md b/.claude/board/entries/2026-11-02-d-codegraph-0-gap-map.md index ca902e5ae..2ef3e1611 100644 --- a/.claude/board/entries/2026-11-02-d-codegraph-0-gap-map.md +++ b/.claude/board/entries/2026-11-02-d-codegraph-0-gap-map.md @@ -67,3 +67,21 @@ Not yet: rust-analyzer as an independent check of the rows (the comparison is st ## Correction (2026-11-02): G8 withdrawn The ruff sink is not unmerged. Ruff PRs #101 (`RefinedTruthSink` + offline backend), #102 (v2 facts/residuals artifacts and their reader) and #103 (round-trip reconstruction oracle) merged on 2026-08-18. The #121 replay carried their content onto today's `main` (`crates/ruff_r2il/src/sink.rs:72` `pub trait RefinedTruthSink`; `read_facts`, `read_residuals`), where it has since changed. The three `claude/r2il-pr2-*` branches only look unmerged because they share no history with the rebuilt `main`. Slice B builds on `main`'s `sink.rs`, not on those branches. + +## Slice B: the offline store (ruff #130, merged `95be2e480b`) + +`ruff_charon::store::Store` persists per crate: relation rows, residuals, and the FNV-1a digest of every source file Charon read. The artifacts follow `ruff_r2il::sink`'s discipline (`#version` + `#schema`, readers keyed by column names). `RefinedTruthSink` is not reused: it is typed to R2IL `FlatFact`s, and these rows are call relations. + +The unit of update is the crate: `import` replaces all of a crate's artifacts, `stale(root)` names crates with a changed or vanished file, `with_dependents` adds their dependents, and `dangling()` reports call rows whose callee no stored crate defines. + +On the fixture, rev1 → rev2 (rev2 now also deletes `area_dyn` from `cg_lib` and drops its call from `cg_app`): +- **Incremental == clean.** Refreshing both crates gives the same rows as a clean rev2 import; through the CLI the store directories are byte-identical (`diff -r`). +- **Deletions.** `triple` and `area_dyn` leave no rows. +- **Skipped dependent.** Refreshing only `cg_lib` leaves exactly one dangling edge, `cg_app::run → cg_lib::area_dyn`. +- **Staleness.** `stale` is empty on unchanged sources, names `cg_lib` after a one-byte edit, and names both crates on the rev2 tree. + +Five disable runs each turn their own tests red. + +G5 (resident, incremental store) is closed for the offline form. Still open: residency in lance-graph's SoA (a lance-graph-side reader of these artifacts), then the queries of slice C. + +ruff #131 (open) corrects four Codex findings on #129/#130: a body Charon left unstructured is still harvested, a call through a known trait impl resolves to the impl's method or the trait default, temporary files are unique per call, and a temporary name left by an interrupted import is skipped instead of aborting the import. diff --git a/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_app/src/lib.rs b/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_app/src/lib.rs index 5330ddfec..fb6494255 100644 --- a/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_app/src/lib.rs +++ b/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_app/src/lib.rs @@ -4,5 +4,5 @@ use cg_lib::Sq; pub fn run() -> u32 { let s = Sq(3); let r = Rect(1, 2); - cg_lib::area_of(&s) + cg_lib::area_dyn(&r) + s.area() + cg_lib::util::double(2) + cg_lib::area_of(&s) + cg_lib::area_of(&r) + s.area() + cg_lib::util::double(2) } diff --git a/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_lib/src/lib.rs b/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_lib/src/lib.rs index b31d29a95..9fa6a5b48 100644 --- a/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_lib/src/lib.rs +++ b/crates/sag-ra-probe/fixtures/codegraph/rev2/cg_lib/src/lib.rs @@ -8,10 +8,6 @@ pub fn area_of(s: &S) -> u32 { s.area() } -pub fn area_dyn(s: &dyn shapes::Shape) -> u32 { - s.area() -} - #[cfg(any())] pub fn disabled() -> u32 { util::double(1)