fix(codegraph): strip comments before parameterize alignment — found by the live v8 dry-run#100
Merged
Merged
Conversation
…by the live v8 dry-run Ran the extract-helper (v8) selection live against QodeX itself (1,686 functions → 25 near-dupe clusters). Verdict: blocked — 0 qualifying clusters. Hand-inspection confirmed every decline was CORRECT (dedupeStr vs dedupe differ on empty-string handling; the isPrivateOrLocal pair is structurally divergent; walkSource is genuinely a 4-way divergent family; the path-helpers cluster mixes two arg-shapes) — the conservative gate is doing its job. But the run also exposed a real calibration bug: 100%-similar pairs were declining as "structurally divergent" ONLY because their COMMENTS tokenized differently. Comments are semantically irrelevant to alignment. - helper-extract.ts: stripComments() (string-literal-aware — a // inside a string survives) applied before token alignment in proposeParameterizedHelper. - Regression test: comment-only differences now align (params = the actual varying literal); a // inside a string is not eaten. - ADOPTION.md: the live dry-run story — "a block worth reading": receipt, per-decline inspection, and the refine-the-guardrail loop.
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.
Live
extract-helper(v8) dry-run on QodeX itself, as planned: 1,686 functions → 25 near-dupe clusters →VERIFIED-PR: blocked — dry-run: 0 candidate(s).The block is the product working
Hand-inspection of every near-miss confirmed the declines are correct:
dedupeStrvsdedupe(99%) — behaviorally different (empty-string filtering)isPrivateOrLocal×2 (100%) — merged-ifvs split-if: structurally divergent though equivalentwalkSourcefamily — genuinely divergent shapes/filters → human-judgment territory (the existing task chip covers it)The bug the run caught
100%-similar pairs were declining as "structurally divergent" only because their comments tokenized differently. Fixed:
stripComments()(string-literal-aware —//inside a string survives) runs before token alignment inproposeParameterizedHelper.+1 regression test (comment-only diff aligns; string-embedded
//preserved). ADOPTION.md gains the live dry-run story — run → receipt → refine guardrail → remaining blocks all correct. Full suite 1526 green, tsc clean.