fix(quality): inherited Python hooks were counted as dead overrides - #237
qinghuanandejiangshi wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThis change adds Python inherited ChangesPython dispatch liveness
Priority: ⬇️ Low Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant computeSnapshot
participant pythonDispatchedMethodIds
participant isDeadCandidate
computeSnapshot->>pythonDispatchedMethodIds: build dispatch NodeIds from IngestResult and Graph
pythonDispatchedMethodIds-->>computeSnapshot: return sorted Python override IDs
computeSnapshot->>isDeadCandidate: evaluate symbols with pythonDispatchIds
isDeadCandidate-->>computeSnapshot: return live or dead classification
participant computeDelta
computeDelta->>pythonDispatchedMethodIds: build dispatch NodeIds
pythonDispatchedMethodIds-->>computeDelta: return sorted Python override IDs
computeDelta->>isDeadCandidate: evaluate working-tree symbols
isDeadCandidate-->>computeDelta: return live or dead classification
Merge Risk: ⚪ Minimal · up to The inherited Python dispatch fix is mergeable based on the verified implementation contracts and available coverage. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Removing redundant direct callers from Python subclasses reported inherited hooks as new dead code, even though the parent still called them through
selforcls. The regression exercises 30 subclasses at runtime: all 60 hooks remain callable, but the previous quality delta reported them as regressions.Use direct class ownership, the parser's first-parameter bindings, and the existing inheritance graph as conservative liveness evidence. Snapshot and delta share the same eligibility rule; the quality snapshot cache scheme advances to retire the old dead sets. This does not add precise call-graph edges or exempt every test method.
The gate keeps unrelated and sibling orphans visible, rejects nested-function and second-parameter receiver lookalikes, and reports the hooks again when the inherited calls are removed. It also covers sidecar, HEAD, cached HEAD, and committed-range baselines.
Refs #228. This addresses the inherited-hook false positives only. I have not reproduced the separate unchanged-working-tree mismatch on the current baseline, so that part remains open.
Validation on macOS:
30f14a274binary and passes with this change.qualitycheck.portablebuildcheckand the quality semantic fingerprint gate pass; snapshot scheme is 12.gating=0without added acknowledgements. It still reports two new-function complexity findings (18 and 22), one minor parameter-count finding, and four minor churn findings.632gates,629passed,3skipped,0failed;tree_writes=0(38m 40s, six workers). The skipped gates wereargvdiffcheck, the baseline arm ofeditchecknotecheck, andg1freshcheck(the sanitizer build lives outside the checkout). Follow-up runs passededitchecknotecheckagainst the verified HEAD binary andg1freshcheckusing a temporary link to the external sanitizer build (removed afterward).The optional
argvdiffcheckfollow-up exits 1: 643/645 vectors match stdout, stderr and exit status; the only two differences are--version(with/without a corpus), whosebuilt_fromvalue is30f14a274versus30f14a274+dirty. Both its differential and tree-mutation controls pass. This is recorded as a failed comparison, not folded into the full-suite pass count.