Skip to content

CG-8: the Codegraph reads the effects rows and answers which effects a symbol reaches - #2006

Draft
AdaWorldAPI wants to merge 2 commits into
ccr-ca0562e7-hudvlz-codegraph-impact-mergedfrom
ccr-ca0562e7-hudvlz-codegraph-effects
Draft

AdaWorldAPI wants to merge 2 commits into
ccr-ca0562e7-hudvlz-codegraph-impact-mergedfrom
ccr-ca0562e7-hudvlz-codegraph-effects

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Stacked on #2004 (base is its branch). If #2004 merges first, this PR must be retargeted to main before it merges, or its commit never reaches main. Linear: EXO-241; ruling D-CODEGRAPH-WAVE0-ACCEPTANCE, priority 2.

Write-up with the real output: .claude/probes/2026-11-11-codegraph-effects/REPORT.md.

What this adds

ruff_charon already writes <crate>.effects.tsv: one row per assert that can panic or write through a dereference, with its span. The Codegraph did not read it. src/effects.rs reads it, read-only:

  • Effects::open, Effects::of(symbol): Witnessed, NoneWitnessed (not a purity verdict) or CrateNotRead.
  • EffectClass::{Division, Remainder, Shift, Write}.
  • Codegraph::effects_reached(symbol, &effects, keep): the effect rows in bodies the symbol is or reaches, graded Own / Confirmed / Possible / Unknown from the call rows, plus every known ReachLimit.
  • cg_query … effects SYMBOL | --kind EFFECT:KIND | --reach SYMBOL (--kind … | --class LIST).

Nothing enters the call masks. Codegraph::impact and the ruff_charon format are unchanged.

Acceptance

  • Reachable effects from a named symbol. On the foundry_parity_lab store, max_quantities reaches the division at arm_b.rs:245 through cook_ops, graded Confirmed.
  • A missing effects file is never a clean empty answer. A store with call rows and no effects file answers UNKNOWN (partial) and names each unread crate.
  • Spans, coverage, residuals, identity.
    • Rows keep file start end.
    • Limits name crates without an effects file, incomplete harvests, callees in crates outside the store, a reachable dynamic call, and effects that cannot be placed.
    • Identity is the file's digest and row count. The effects file carries no source revision, so this identifies the bytes read, not the commit. That is CG-3 (EXO-235).

What it shows on real data

  • All 62 effect subjects of the store resolve to Codegraph positions.
  • method::execute_can_cook reaches no division, although can_cook_guard (method.rs:58) is registered from it through a closure. The call rows have no edge into a closure body; that is CG-1 (EXO-233) and is not fixed or reported as a limit here.
  • Almost every function reaches core or alloc, so almost every answer is PARTIAL. Those bodies were not extracted.

Tests

  • tests/effects.rs: 20 tests on real data (tests/data/effects/, 213 effect rows with their call rows) and on the rev1 fixture.
  • python3 .claude/probes/2026-11-11-codegraph-effects/disable_runs.py: 29 guards patched out one at a time through an asserted anchor. The committed receipt shows 29 red, 0 not red.

Not done

  • Target-kind and cfg rows, the other half of CG-8's plan entry.
  • Declared targets and excluded regions (impact_report's Scope) do not narrow a reach answer yet.
  • The reach runs one impact per candidate symbol. It is not timed and makes no latency claim.

Checks run

In crates/lance-graph-codegraph: cargo fmt --check, cargo clippy --release --all-targets -- -D warnings, cargo test --release (139 pass). .codegraph/ is current.


Generated by Claude Code

…bol reaches (CG-8)

The Codegraph did not read <crate>.effects.tsv. effects.rs reads it
read-only, keeps spans, and joins it with the call rows:
Codegraph::effects_reached lists the effect rows in bodies a symbol is or
reaches, graded Own / Confirmed / Possible / Unknown, with every known limit
(a crate without an effects file, an incomplete harvest, callees in crates
outside the store, a reachable dynamic call, an unplaced effect). A missing
effects file gives a partial answer, never an empty clean one.

EffectClass groups division, remainder, shift and write. The file's digest
and row count identify what was read; the artifact carries no revision
(CG-3). Nothing enters the call masks; impact and the ruff_charon format are
unchanged.

On the foundry_parity_lab store: max_quantities reaches the division at
arm_b.rs:245 through cook_ops. 20 tests on real and fixture data; 29 guards
disabled by a committed script, each red.

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

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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

…a0562e7-hudvlz-codegraph-effects

# Conflicts:
#	.codegraph/crates.tsv
#	.codegraph/crates/lance-graph-codegraph.index.md
#	.codegraph/freshness.tsv

Copy link
Copy Markdown
Owner Author

CI at head d67f92946: every check passed except member-tests, which was cancelled at its 30-minute limit (09:41:43 to 10:11:46) while compiling in the surreal_container step. No test failed.

This is not caused by this PR: the same job takes 19.7 to 29.8 minutes on main, it was cancelled the same way on #2004 and twice on #2001, and the diff touches only crates/lance-graph-codegraph, which is not one of that job's per-crate steps.

No fix exists on main. The proposed patch (raise timeout-minutes to 45, or split the hydrate and surreal_container steps into their own job) belongs in a separate CI PR and is described on #2004. I cannot re-run the job from here; a re-run from the Actions page gives a result for this head.


Generated by Claude Code

This branch has not been deployed

No deployments
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