Skip to content

[finding] bare-root-worklist's POPULATION_CONSTANT does not match a bare ROOTS or DIRS, so the plainest spelling of the class it sweeps is invisible to it #15468

Description

@claude

Found by the #15341 dev seat (session session_012zGPuVVX3deAx9LdjK8jCk) while reading every
bare-root walker that card names. Filed rather than folded in: the repair is to a different
instrument than that card's, and it changes what that instrument SWEEPS.

The defect

scripts/pm/bare-root-worklist.mjs restricts its sweep to literals held in a constant
whose NAME says "this is my population" — the judgement call #10840 refused to put in the
derivation, and correctly so. That judgement is one regex:

const POPULATION_CONSTANT = /^(?:[A-Z0-9_]*_ROOTS?|[A-Z0-9_]*_DIRS?|POPULATION|[A-Z0-9_]*_SCOPE)$/;

Every alternative but POPULATION requires a literal underscore, and [A-Z0-9_]* may be
empty only if an underscore follows it. So the PLAINEST spelling of the shape this sweep
exists to find does not match:

SCAN_ROOTS      matches
SCANNED_ROOTS   matches
SCAN_DIRS       matches
_ROOTS          matches
ROOTS           DOES NOT MATCH
DIRS            DOES NOT MATCH

Measured on the tree at 565db3e17: seven files under scripts/ open with
const ROOTS = [, and at least two of them are bare-root walkers of exactly the class this
map triages — check-live-db-isolation.mjs (ROOTS = ['packages','apps','examples'],
walked) and check-org-identifier.mjs (ROOTS = ['examples','apps','packages'], enumerated
with git ls-files). Neither appears in the sweep, neither owes a row, and neither is
therefore judged either way.

Why it matters, and why it is not the same card as #14695

That card asked why 14 measured root-wide families carry no ledger row: rows that COULD be
written and were not. This is one level earlier — families the sweep cannot see at all,
because of how their author spelled a constant. The consequence is the shape this map's own
header warns about in the other direction: a debt list that reads as complete while a
member of the class is missing from it for a reason no reader can infer from the output.

It is live: a seat can declare a wholesale hint on one of these gates and no --self-test
anywhere will contradict it, while the identical declaration on SCAN_ROOTS reds by name.
That asymmetry was met on #15341's branch — eleven declarations, six of them caught by the
map, five of the same measured shape sailing through because their constant is spelled
ROOTS or their walk root was inline.

What a repair owes

Widening the regex is the obvious move and it is NOT obviously right — the restriction is
deliberate and its price is recorded (--wide finds roughly twice the rows, overwhelmingly
join() path components in gates that never read those roots). Admitting bare ROOTS and
DIRS is a much smaller widening than --wide, but it is still a widening, and whatever
new rows it surfaces must each be triaged rather than batch-refused. Both halves want
measuring before the regex is touched: how many NEW rows the two names add, and how many of
those are real populations rather than path components.

⚠️ This card records a measurement and a question, not a decision. Its resolution belongs
with whoever owns the map's triage.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions