Problem
The elision analyser scans RAW source, comments and strings included, when it looks for rendered tags (extractRenderedTags) and cross-module observation signals (WHEN_DEFINED_RE / TAG_DEFINED_RE / INSTANCEOF_RE, from #169). So prose that happens to contain tag-in-angle-brackets or a whenDefined('tag') / instanceof Class call is read as a real signal and skews the verdict.
Found while adding the #169 e2e probe (#175): a doc comment in a fixture component that mentioned <build-stamp> and whenDefined('observed-badge') caused extractRenderedTags to treat build-stamp as a rendered tag (forcing build-stamp to ship via the render rule) and the observation regex to match the commented whenDefined. A real test (build-stamp module is never downloaded) failed as a result. The workaround was to reword the comments, but the analyser should not be fooled by comments at all.
This is the same class of issue as #159 (the import scanner counting imports shown as code), which was fixed by masking string/template/comment content via redactStringsAndTemplates before matching.
Design / approach
Apply the same position-preserving redaction mask to the elision scanners before matching: run redactStringsAndTemplates (or an equivalent) over the source, and only count a rendered-tag / whenDefined / :defined / instanceof match whose position survives redaction (i.e. is real code, not inside a comment or string). Keep it verdict-safe; today the miss only ever OVER-ships (safe direction), but it also caused a genuine false-positive that broke a test, so it is worth fixing.
Acceptance criteria
Labels: bug
Problem
The elision analyser scans RAW source, comments and strings included, when it looks for rendered tags (
extractRenderedTags) and cross-module observation signals (WHEN_DEFINED_RE/TAG_DEFINED_RE/INSTANCEOF_RE, from #169). So prose that happens to contain tag-in-angle-brackets or awhenDefined('tag')/instanceof Classcall is read as a real signal and skews the verdict.Found while adding the #169 e2e probe (#175): a doc comment in a fixture component that mentioned
<build-stamp>andwhenDefined('observed-badge')causedextractRenderedTagsto treatbuild-stampas a rendered tag (forcing build-stamp to ship via the render rule) and the observation regex to match the commentedwhenDefined. A real test (build-stamp module is never downloaded) failed as a result. The workaround was to reword the comments, but the analyser should not be fooled by comments at all.This is the same class of issue as #159 (the import scanner counting imports shown as code), which was fixed by masking string/template/comment content via
redactStringsAndTemplatesbefore matching.Design / approach
Apply the same position-preserving redaction mask to the elision scanners before matching: run
redactStringsAndTemplates(or an equivalent) over the source, and only count a rendered-tag / whenDefined / :defined / instanceof match whose position survives redaction (i.e. is real code, not inside a comment or string). Keep it verdict-safe; today the miss only ever OVER-ships (safe direction), but it also caused a genuine false-positive that broke a test, so it is worth fixing.Acceptance criteria
extractRenderedTagsignores tags written inside comments/stringsLabels: bug