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 53950f8
Browse filesBrowse the repository at this point in the historyBrowse files
feat(di): anchor DI004 at the GetRequiredService call site (P-006 Q#1, DI004 arm) (#67)
#66 anchored DI001/2/3 at the consuming constructor; this finishes the anchoring story
for DI004, whose consumer is different — a resolution CALL SITE (GetRequiredService<T>()),
not a ctor. And because the leak *is* that call (the fix is there too, while the resolver's
registration is barely relevant), the call site is DI004's PRIMARY anchor — unlike the
registration-graph rules (DI001/2/3), which rightly anchor at the registration. The
registration is demoted to the Finding.related secondary + a [singleton registered at …]
message tail; falls back to the registration when the call is unknown.
- Extractor: RootResolvedTypes yields the call line; the service fact gains a parallel
root_resolve_sites ({type, file, line}) alongside the string-array root_resolves
(additive, backward-compatible).
- Core: ExplicitRootResolution gains resolved_file/resolved_line (the entry type's call —
path[1], so a transitive WrapperResolver -> MidConnection -> PooledConnection anchors at
where MidConnection was hand-resolved, not the container-built disposable); the bridge
makes that the finding's primary location. ownir load() validates root_resolve_sites.
Pinned by DiCaptiveSample.cs (primary line = call site: ConnectionResolver:79,
ExprBodiedResolver:123, transitive WrapperResolver:137; the registration named as the
secondary, exactly 3) and by tests/test_ownir.py. ruff + mypy --strict clean, ownir 116/116;
DI001=4 / DI002=3 / DI003=1 / DI004=3 unchanged. All four DI rules now anchor at their
consumer. Next: per-parameter precision for the captive anchor.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED
0 commit comments