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
OWN001/OWN014 provide structured static evidence for resource acquisition without release and lifetime promotion/retention. OwnAudit has a runtime arm and a Fix Arm, but there is no narrow bridge that turns supported static evidence into an executable retention witness.
Today the strongest remediation statement is generally:
the static finding disappeared and no new static findings were introduced
For selected WPF/event shapes, the system can do better:
static candidate exists
runtime witness reproduces retention
patch is applied
static candidate disappears
runtime witness becomes green
That is a materially stronger proof than another generated test which merely constructs an object and congratulates itself for not throwing.
A witness should attempt to reproduce the relevant lifecycle, release strong references, force bounded collection attempts, and assert whether the subscriber/owner remains alive.
Unsupported cases must produce typed refusal reasons. The generator must prefer refusal over a tautological or flaky test.
Initial supported shapes
Start narrowly with fixtures, then validate against real cases:
WPF Window or FrameworkElement subscribes a named instance handler to a longer-lived/static event and lacks a matching teardown release.
ViewModel/owner subscribes to an injected singleton/app-lifetime event source, with an explicit lifecycle method available (Dispose, Closed, Unloaded, or fixture-supplied teardown hook).
A matching fix adds the release at a supported teardown boundary.
Do not begin with arbitrary lambdas, unknown delegate storage, cross-thread dispatchers, unmanaged callbacks, or sources whose lifetime cannot be isolated.
Witness shape
Generated code may be equivalent to:
[TestMethod]publicvoidClosing_owner_releases_subscription(){WeakReferenceweak=CreateExerciseAndReleaseOwner();ForceCollectionWithinBound();Assert.IsFalse(weak.IsAlive,"Owner remains retained after its declared lifecycle ended.");}
CreateExerciseAndReleaseOwner() must be generated from evidence + fixture configuration, not guessed from arbitrary application startup code.
Classification
docs/proposals/P-034-runtime-lifetime-guard.mdPhysShell/OwnAudit#43Problem
OWN001/OWN014 provide structured static evidence for resource acquisition without release and lifetime promotion/retention. OwnAudit has a runtime arm and a Fix Arm, but there is no narrow bridge that turns supported static evidence into an executable retention witness.
Today the strongest remediation statement is generally:
For selected WPF/event shapes, the system can do better:
That is a materially stronger proof than another generated test which merely constructs an object and congratulates itself for not throwing.
Goal
Generate conservative, reviewable runtime witness tests from supported OWN001/OWN014 evidence shapes.
A witness should attempt to reproduce the relevant lifecycle, release strong references, force bounded collection attempts, and assert whether the subscriber/owner remains alive.
Unsupported cases must produce typed refusal reasons. The generator must prefer refusal over a tautological or flaky test.
Initial supported shapes
Start narrowly with fixtures, then validate against real cases:
WindoworFrameworkElementsubscribes a named instance handler to a longer-lived/static event and lacks a matching teardown release.Dispose,Closed,Unloaded, or fixture-supplied teardown hook).Do not begin with arbitrary lambdas, unknown delegate storage, cross-thread dispatchers, unmanaged callbacks, or sources whose lifetime cannot be isolated.
Witness shape
Generated code may be equivalent to:
CreateExerciseAndReleaseOwner()must be generated from evidence + fixture configuration, not guessed from arbitrary application startup code.The witness metadata must record:
Flakiness controls
GC tests are notorious for turning certainty into interpretive dance. Required controls:
retained,collected,inconclusive, andenvironment-error.Generator output
Suggested output:
witness.jsonshould be suitable for OwnAudit remediation proof ingestion and include test/build result references and digests.Required controls
Acceptance
Non-goals