You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 789255e
Browse filesBrowse the repository at this point in the historyBrowse files
feat(extractor): transitive consume contract — use-after-handoff through a forwarding consumer (#68)
The D4 frontier: cross-method use-after-dispose through a FORWARDING consumer. The
inter-procedural consume-handoff (#55) caught a use-after-handoff when the callee disposes a
by-value IDisposable parameter directly, but stopped one hop short — a parameter merely
forwarded to another call was left ambiguous (ownir.py's `passed` branch: "awaiting a later
transitive pass"). This is that pass.
The extractor's consumer detection (ConsumesParam) is now transitive: a parameter is consumed
if the body disposes it directly OR forwards it to another first-party consumer that consumes
it — following Consume -> Inner -> Dispose through the chain (incl. directly-called local
functions), cycle-guarded per parameter, binding each callee's body with its own tree's
SemanticModel so cross-file chains resolve. So Consume(s) is still a call-site release and a
use after it trips OWN002. The emitted facts match the direct handoff, so the core is
unchanged. Conservative: a parameter handed to an unknown or borrowing callee is not consumed
(no false release, no false OWN002).
Deferred-body safety (Codex/CodeRabbit): the scan (ImmediateInvocations, shared with
DisposesLocal) does NOT descend into nested lambda / local-function bodies — a dispose/forward
stored in a callback runs deferred, not at the call boundary, so it is not a phantom handoff.
Pinned by a silent control (DeferredHandoffNoFalsePositive) and by the new corpus case
ownership-handoff-use-transitive (before -> OWN002, after silent), which lifts the benchmark
recall floor 10 -> 11.
ruff + mypy --strict clean, corpus 9/9, ownir 116/116; corpus benchmark green at recall 11.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED
0 commit comments