Skip to content

ruff_charon: no '?' dispatch targets; record witnessed effects with exact assert kind - #135

Merged
AdaWorldAPI merged 6 commits into
mainfrom
claude/sgr-charon-identity
Nov 2, 2026
Merged

AdaWorldAPI merged 6 commits into
mainfrom
claude/sgr-charon-identity

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Summary

These are producer-side fixes from the Semantic Grammar Recovery map (operator decisions S1/S2, items B7 and B1).

No placeholder dispatch targets (B7).

  • Before: a MAY_DISPATCH whose trait or method has no name was emitted as ?::?. Every unresolved target shared that one symbol, and the IMPLEMENTS join merged distinct calls through it.
  • Now: such a call is recorded as a CALLEE_NOT_NAMED residual. That is the existing convention for an unnamed callee.
  • One harvested call is still exactly one row or one residual, so the receipt stays conserved.
  • lance-graph codegraph also refuses any ? path segment at intake (defence in depth, claude/sgr-coverage-gates).

Witnessed effects (B1). Every import writes <crate>.effects.tsv (version 1: subject, effect, kind, file, start, end), one row per occurrence:

  • ASSERT, with Charon's BuiltinAssertKind tag: Overflow:<BinOp>, BoundsCheck, DivisionByZero, and so on, or User for a source assert!;
  • DEREF_WRITE Arg / Local.

Subjects equal the DEFINES subjects, so effects join to the relation rows. The file is an observation list. A function with no row is not proven pure:

  • Charon passes may fold checks into fallible operations;
  • callees' effects are not included;
  • an unstructured body records nothing.

The calls_text counters are unchanged.

Test plan

Each test was committed red first, then the fix.

  • may_dispatch_object unit tests: unnamed trait/method → no target; the twin is a named target.
  • tests/effects.rs (5 tests), on the committed LLBC:
    • double/triple → Overflow:Mul;
    • Square::area → [DivisionByZero, Overflow:Mul];
    • unit has no row (silence twin);
    • cg_app::run has 3 × Overflow:Add (one row per occurrence);
    • the assert total matches the independent reference output cg_lib.llbc_calls.txt.
  • The full crate suite is green; clippy --all-targets -D warnings is clean; fmt is clean.

Disable runs, each red:

Disable Result
? fallback restored unit test fails
Assert kind lost witness test fails
Asserts not recorded 2 tests fail
Same-kind occurrences collapsed occurrence test fails

The first version of the occurrence test stayed green under the collapse disable, because no cg_lib function repeats an assert kind. It was rewritten on cg_app::run.

Remaining

  • No committed LLBC fixture contains an unnamed trait method, so the B7 path is covered by the unit test, not by real compiler output.
  • Codegraph does not read effects.tsv yet. Promoting effects into a shared evidence grade is deferred (S3).

Not to be merged automatically.


Generated by Claude Code

…ed dispatch targets

Behaviour-preserving extraction (missing names still render as '?'), plus a
test that fails on it: a dispatch whose trait or method has no name must get
no target, since a shared '?' placeholder merges distinct calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
…7 producer side)

A dispatch whose trait or method has no name is recorded as a
CALLEE_NOT_NAMED residual (the existing convention for an unnamed callee)
instead of a MAY_DISPATCH row to '?::?'. One harvested call is still one row
or one residual, so the receipt stays conserved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
The committed cg_lib LLBC has an overflow check in util::double (x * 2) that
no output records; util::unit has none. Expect <crate>.effects.tsv with one
row per witnessed effect and its exact kind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
…cer side)

Each import now writes <crate>.effects.tsv (version 1:
subject, effect, kind, file, start, end), one row per occurrence:
- ASSERT with Charon's BuiltinAssertKind tag (Overflow:<BinOp>, BoundsCheck,
  DivisionByZero, ...; User for a source assert!);
- DEREF_WRITE Arg / Local.

The counters printed by calls_text are unchanged. It is an observation list:
a function with no row is not proven pure (Charon passes may fold checks into
fallible operations, callees' effects and unstructured bodies are not
recorded).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
…run: 3 x Overflow:Add)

The first occurrence test could not fail when same-kind effects were
collapsed (no cg_lib function repeats a kind). It now uses cg_app::run;
the reference-count check is kept as its own test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c41c2229-102e-4331-9352-c0448aafc0be
  • 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T20:12:17.912884Z a36cdb9 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a36cdb9703

ℹ️ 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".

Comment thread crates/ruff_charon/src/lib.rs Resolved
…ixture

derefw.rs writes twice through argument-rooted derefs, once through a local
reference, and has a function that assigns only locals. The new test pins
the emitted kinds and counts, so dropping the rows or swapping Arg/Local
fails. Codex P1 on #135.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
@AdaWorldAPI
AdaWorldAPI merged commit 9eb6e11 into main Nov 2, 2026
36 of 37 checks passed
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