Repository navigation
Commit 3c46b87
committed
fix(extractor): revert unsound static-context exemption (Codex P2); keep App-only
Codex flagged the static-context skip as unsound (correctly): a `+=` inside a
static member has no `this`, but the handler can still retain a NON-`this`
instance — `publisher.Fired += subscriber.OnFired`, or a lambda capturing a
parameter — which an outliving source leaks. "No enclosing `this`" does not imply
"nothing can be retained".
The ProcessHelper case is safe only because its source `process` is a FRESH,
non-escaping method-local (`Process.Start(info)`), but there is no sound syntactic
rule that admits a factory-fresh local while still excluding an aliased long-lived
source (`var src = injectedBus; src.X += ...`) — only `new` proves freshness. A
known soundness hole is worse than the FP under the zero-FN mandate, so the
static-context exemption (helper + loop skip + StaticContextSubscription.cs +
its CI assertions) is reverted in full. ProcessHelper's `process.Exited`
subscription stays an honest "possible leak" warning; a proper fresh-source fix
is a separate, deliberate change.
This leaves PR #81 as the clean, uncontested App fix only: OWN014 region-escape
is suppressed for the process-lived WPF `App` singleton. Also handle the
alias-qualified base type `global::System.Windows.Application`
(AliasQualifiedNameSyntax) in IsProcessLivedApplication, per CodeRabbit — without
it `clsIsApp` would miss that declaration shape and re-enable the FP.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED1 parent 5179aac commit 3c46b87
3 files changed
Lines changed: 1 addition & 102 deletions
File tree
- .github/workflows
- frontend/roslyn
- OwnSharp.Extractor
- samples
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
| |||
285 | 284 | | |
286 | 285 | | |
287 | 286 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | 287 | | |
301 | 288 | | |
302 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | 192 | | |
223 | 193 | | |
224 | 194 | | |
| |||
240 | 210 | | |
241 | 211 | | |
242 | 212 | | |
| 213 | + | |
243 | 214 | | |
244 | 215 | | |
245 | 216 | | |
| |||
1985 | 1956 | | |
1986 | 1957 | | |
1987 | 1958 | | |
1988 | | - | |
1989 | | - | |
1990 | | - | |
1991 | | - | |
1992 | | - | |
1993 | | - | |
1994 | 1959 | | |
1995 | 1960 | | |
1996 | 1961 | | |
| |||
This file was deleted.
0 commit comments