audit(xaml): join — anchor XAML203 on code-behind to dedup with OWN001#121
Merged
Conversation
XAML203 previously anchored on the .xaml while own-check's OWN001 for the same unreleased subscription anchored on the .xaml.cs — different basenames, so the aggregator never clustered them and the one leak was DOUBLE-REPORTED (two P1 findings). Since XAML203 always derives from the same OwnIR released=false record own-check turns into OWN001 (no own-check facts -> no join), the honest value is a cross-source confirmation, not a second report. Anchor XAML203 at the code-behind subscription site (component.file : subscription.line) — where the matching -= goes anyway — so it lands at the same file+line as OWN001 and CLUSTERS with it into one high-confidence finding; the XAML view + the lifecycle handler that wired it ride in the message. One finding per leaking subscription (each pairs with its OWN001); a component with no file metadata falls back to the markup. - xaml_join: re-anchor + reshaped message; docstring corrected (it DOES cluster). - taxonomy: XAML203 comment corrected (clusters with OWN001 -> high confidence). - run_static selftest: stubbed own-check now emits the matching OWN001; asserts XAML203 + OWN001 collapse to exactly one high-confidence cluster (no double). - xaml_join selftest: code-behind anchoring (path/line/message) across all cases. - README + design note: corrected the anchoring claim and the join's honest value (confidence upgrade + view-lifecycle framing, not new detection). Selftests: xaml_join 13, run_static 22. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zoG4YNCUf7RA5r8GAXMmb
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughXAML203 now anchors findings at the code-behind subscription site, clusters with OWN001 as one high-confidence result, and updates the selftests plus related status and design notes to match that behavior. ChangesXAML203 anchoring and clustering
Sequence Diagram(s)sequenceDiagram
participant run_static.py
participant own-check
participant xaml_join.py
run_static.py->>own-check: run with --emit-facts
own-check-->>run_static.py: own-check.facts.json + own-check.sarif with OWN001
run_static.py->>xaml_join.py: run join when both fact sources exist
xaml_join.py-->>run_static.py: XAML203 anchored at Views/CustomerView.xaml.cs:21
run_static.py-->>run_static.py: totals["clusters"] = 1, totals["high_confidence"] = 1
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A correctness/triage fix for the Phase-2 join shipped in #117.
The bug: XAML203 double-reports an own-check leak
XAML203 anchored its finding on the
.xaml, while own-check'sOWN001for the same unreleased subscription anchors on the.xaml.cs. The aggregator clusters by basename, soCustomerView.xamlandCustomerView.xaml.csnever merged — the one leak surfaced as two P1 findings.Confirmed via the aggregator:
The fix: anchor on the code-behind → cluster, don't duplicate
XAML203 always derives from the same OwnIR
released=falserecord that own-check turns into OWN001 (no own-check facts → no join), so its honest value is cross-source confirmation, not a second report. Anchoring XAML203 at the code-behind subscription site (component.file : subscription.line) — where the matching-=goes anyway — lands it at the same file+line as OWN001, so they cluster into one high-confidence finding; the XAML view + the lifecycle handler that wired it ride in the message.After:
So the join now does what the taxonomy comment originally (wrongly) claimed: it upgrades the own-check subscription finding to high-confidence and tags it as a view-lifecycle (closed-view-retained) leak, instead of a duplicate of it.
Changes
xaml_join.py— one finding per leaking subscription, anchored atcomponent.file : subscription.line; reshaped message (names the view, its.xaml, theLoaded=handler, the event); docstring corrected (it does cluster now). A component with no file metadata falls back to the markup anchor.taxonomy— XAML203 comment corrected (clusters with OWN001 → high confidence).run_static.pyselftest — the stubbed own-check now emits the matching OWN001; asserts XAML203 + OWN001 collapse to exactly one high-confidence cluster (regression guard against the double-report).xaml_join.pyselftest — code-behind anchoring (path/line/message) across all cases.List<T>getter, hot-binding converter — is the deferred XAML200/204 increment).Validation
Full audit selftest suite green (179 checks: normalize/score/report/xaml_check/xaml_facts/xaml_join/run_static/ingest),
ruff check .clean. End-to-end aggregation confirms one high-confidence cluster, no double-report.🤖 Generated with Claude Code
Generated by Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation