Skip to content

[finding] the INVISIBLE half of the bare-root species is ~33 gates, not 4 — a population literal with no separator never reaches the hint set at all #10840

Description

@os-zhuang

Observation-class, measured while implementing #10705 (the escapable-literal ledger, PR #10839).
No gate is red. Filed unassigned, no pm:queue. ⛔ This is not a request to change
hintCovers' :920 refusal — the +139084 measurement stands.

The distinction #10705 does not draw

#10705 bounds the species where a bare root literal reaches the hint set: a source spelling
carrying a separator somewhere ('scripts/'), which extractWatchHints trims to the bare word
scripts. That population is small and is now enumerated and gated — measured on
a7ea3289eb, 4 literals, 2 escaped and 2 on the shrink-only ledger.

There is a strictly larger species beside it, and the ledger cannot see it. looksPathy
requires a separator:

constlooksPathy=s.includes('/')||/^\.(claude|changeset|github|gitattributes)\b/.test(s);

So a gate whose population is spelled with no separator at all builds no hint whatsoever:

extractWatchHints("const POPULATION = 'packages';") -> [] <- invisible
extractWatchHints("const POPULATION = 'packages/';") -> ["packages"] <- #10705's species
extractWatchHints("const POPULATION = 'packages/**';")-> ["packages/**"] <- nameable

This is the same shape #10107 recorded and #10114 fixed for check-role-word.mjs' skills
root — but as a one-instance card. Nothing ever enumerated the class.

The measurement

Swept over all 128 discovered families on a7ea3289eb, restricted to quoted literals bound to
a population-declaring constant name (*_ROOT, *_ROOTS, *_DIR, *_DIRS, POPULATION,
*_SCOPE) whose value is a bare top-level tracked directory, with comments and self-test
bodies masked: 34 (family, constant, word) triples, 33 of them undeclared.

The single declared one is check:examples-live-imports' EXAMPLES_ROOT = 'examples', which
took the escape in #10314 — i.e. the sweep finds exactly the shape the two landed fixes
addressed, and 33 more of them. A sample:

familyconstantword
check:engine-double-contractSCAN_ROOTSpackages, examples
check:error-code-casingSCAN_ROOTSpackages
check:skill-compatibilityPACKAGE_ROOTS, SKILLS_DIRpackages, apps, examples, skills
check:skill-frame-syncSCAN_ROOTSskills
check:verify-stand-inSCAN_ROOTSpackages, examples
check:driver-conformanceDRIVERS_DIR, CASE_SETS_DIRpackages
check:resume-authority-declaredDEFAULT_SCAN_ROOTSpackages, examples
scripts/check-skills-token-ratchet.mjsSKILLS_DIRskills

(Full 33-row listing reproducible with the probe described below.)

Why this was NOT folded into #10705

Two reasons, both measured rather than argued:

  1. The recognizer would be a third idiom.[finding] the escapable-literal species has no ledger — 4 gates found one at a time over 4 cards, and nothing tracks whether the escape was taken #10705's dispatch is explicit that the
    ROOT_DIR_WATCH_HINTS subtree declaration is the idiom to lift, not to reinvent. Detecting
    this species needs a new heuristic over constant NAMES, which is a judgement call baked
    into a regex, on a gate that runs on every PR.
  2. The obvious wider sweep is unenforceable. Dropping the constant-name restriction and
    flagging any bare top-level-dir literal yields 73 (family, word) pairs across 52 of 128
    families
    — overwhelmingly join(ROOT, 'packages', …) path components in gates that never
    read those roots. Demanding a subtree declaration for those is the +139084 fabrication
    re-introduced one level up, and a shrink-only ledger seeded with 73 rows is an allowlist
    nobody re-reads rather than a debt list.

Why it is worth a card anyway

The remedy per gate is known, cheap and already precedented twice (#10114, #10314): declare the
subtree spelling beside the constant and pin the coupling in that gate's own self-test, the way
check-role-word.mjs does. What is missing is the worklist. Left alone, this class keeps
being re-found one gate at a time — which is precisely the discovery cost #10705 was filed to
end, still running in the half its ledger cannot reach.

Note the asymmetry that makes it worth doing deliberately: the remedy for a gate whose real
population is packages/** names that gate for every packages/** card. Whether that is
wanted is a per-gate judgement with fleet-wide blast radius on dispatch prompts, so this wants
triage as a batch, not 33 self-dispatched one-liners.

Reproducing

The probe is ~40 lines against the tool's own exported predicates (discoverFamilies,
extractWatchHints, collapseHint, trackedFiles, maskSelfTests) plus maskComments; it
reads nothing from memory. Both numbers above (33 and 73) came from the same sweep with the
constant-name restriction on and off.

Refs

#10705 / PR #10839 (the visible half, now gated) · #10107 and PR #10114 (skills, first
instance) · #10314 (examples, second) · #10662 / #10687 (two more) · hintCovers' docblock
and extractWatchHints' looksPathy


Generated by Claude Code

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions