Skip to content

checkGuardAdoption still passes a gate that counts messages from lintText() — the adoption check tests the call it names, not the measurement it guards #10599

Description

@os-zhuang

Filed unassigned from the #10458 dev seat (session session_01DdCnBGcHeufjrq7drTD3wt, branch
claude/issue-10458-fatal-guard-adoption-mask, PR #10598). #10458 closed the two holes it named —
comments counting as code, and nothing asserting the guard is CALLED. This is the residue it named
in passing and deliberately did not close, recorded so it is not lost.

The gap

After #10598, checkGuardAdoption() asks three questions of each gate's comment-masked source:

if(!/eslint-fatal-guard\.mjs/.test(src))// importedelseif(!/lintFilesStrict\s*\(/.test(src))// and calledif(/\.lintFiles\s*\(/.test(src))// and not bypassed

A gate that kept its lintFilesStrict() call for one population and measured a second one through
eslint.lintText() would satisfy all three while the lintText() path does zero guarding —
lintFilesStrict wraps lintFiles only. The check proves a call site exists; it does not prove
every measured population goes through it.

Why #10598 did not just ban .lintText(

Measured, not assumed: scripts/check-query-options-erasure-ratchet.mjs calls eslint.lintText()
throughout its own --self-test (the unparseable-file fixture at ~L405 and the parses-cleanly
control right after it, among others). A blanket /\.lintText\s*\(/ problem would report that gate
as unguarded on main today — a false positive on the gate whose self-test drives the check.

Severity: latent, and narrower than #10458 was

Neither gate measures anything through lintText() today; both route their real population through
lintFilesStrict(). This is a bound on what the adoption check can claim, not a live false green.
It is worth writing down because the same sentence — "both gates still routed through it" — is what
the check prints, and that sentence is now true of the call site rather than of the measurement.

Shapes worth weighing, none obviously right

  1. Leave it, and narrow the printed sentence to what is actually proved.
  2. Ban .lintText( only OUTSIDE a self-test region, which needs a region concept the check does not
    have and which a gate could drift out of.
  3. Assert the guard from the RUN rather than the source — e.g. lintFilesStrict() records that it
    ran and the gate asserts it — which is a real behaviour change to both gates, not a check change.

Refs: #10123 (the card that created the guard) · #10458 / PR #10598 (where this was measured).


Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions