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 514289d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(extractor): --fix-candidates no longer drops orphaned_awaitables (OWN053)
`--fix-candidates` is additive: it adds fix metadata and changes nothing else.
It removed a section. The same input, the same build:
--flow-locals orphaned_awaitables: 5 sites
--flow-locals --fix-candidates orphaned_awaitables: absent
so every OWN053 advisory disappeared from a run that asked for fix candidates
(corpus/ownership-lab/h29/fx/Orphan.cs: 5 advisories without the flag, 0 with
it, on both engines).
Root cause: the extractor built its envelope in three places, picked by a nested
conditional — `--fix-candidates` ? A : orphans ? B : C. The `--fix-candidates`
envelope was written before `orphaned_awaitables` existed and was never given
it. Each additive section had to be remembered in every envelope, and one was
not.
The fix is the mechanism, not the missing line: ONE envelope, built once, in the
key order the facts have always had; a section that is not always there is one
conditional line. There is no second envelope for the next section to be
forgotten in. Output without the flag is unchanged byte for byte, and so is
every flag-on output that had nothing to lose: 256 outputs compared with main's
build (every C# input CI scans and the two OWN053 fixtures, with and without
--flow-locals, flag on and off) — 254 byte-identical, 2 repaired (they gain
exactly the section they used to drop), 0 other.
Why the S0 control did not see it. The invariant it holds was already the right
one — flag-on minus the S0 fields == flag-off, the whole document. The document
was the problem: FixCandidatesSample.cs has subscriptions and no other section,
and CI scans it without --flow-locals, so nothing the flag could drop was ever
there. Now:
* tests/fixtures/fix_candidates/AdditiveSections.cs makes every top-level
section the extractor can write non-empty under --flow-locals (both OWN053
families included, with no reference directory);
* `check_fix_candidates_facts.py --additive-sections` holds the equality on
it, reads the section list off the extractor's own envelope
(`facts["<key>"] = ...`) and refuses a pair that leaves a section out — so a
section added to the extractor is red until the fixture exercises it — and
requires the reference to give the same findings for both documents;
* the CI step "S0 fix-candidates — extractor metadata (Part A)" runs it.
Negative controls: on main's extractor the new check fails (`orphaned_awaitables`
is in the flag-off facts and MISSING from the flag-on facts; 3 findings with the
flag, 5 without); with the section dropped under the flag in this tree it fails
the same way and passes again once restored; an envelope key the fixture does
not exercise fails it by name; and the old sample, given to the new mode, is
refused as not exercising `services`, `functions` and `orphaned_awaitables`.
No OwnIR vocabulary or version change (OWNIR_VERSION 1, LOWERED_VERSION 2), no
change to the OWN053 rule, to the state-protocol lowering or to the measurement
instrument. spec/OwnIR.md §2 states the producer-side rule.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
0 commit comments