roadmap BUILT

401. A gate that selects the set it judges can pass by checking nothing

Built 2026-09-23. Filed 2026-09-14 as an unnumbered proposal by milestone 265 (_proto is a truncation), which broke one and caught it by hand rather than by anything red. Numbered 2026-09-19 by milestone 433 (drain the proposal pile), whose drain of the proposal pile. (Number provisional until the merge queue lands it.)

In brief. Several gates pick the things they judge with a pattern, then judge them. When the pattern stops matching, the loop body never runs and the gate reports clean. Eight such selectors now assert that they selected something. The enumeration, the rule that fell out of it, and what each guarded site now guarantees are in notes/empty-selectors.md.

The exhibit does not hold, and that is the first finding

This block was written around one instance: script/lint's contract-crate check, which globbed crates/*proto until milestone 265 renamed every one of those crates to *_protocol. The block says the glob then matched nothing, the loop ran zero times, and the check passed by checking nothing. The note's replay against 51fee8248^ shows that is false.

POSIX sh leaves an unmatched glob in place as a literal word. basename then yields the string *proto, which does not match the *_proto arm of the case, so it falls to the failure branch:

$ /bin/sh /tmp/replay/script/lint
lint: contract crate *proto should be spelled *_proto (notes/naming.md)
$ echo $?
1

The check would have gone red, loudly, naming a crate that does not exist. That is a bad message and a genuine defect; it is not a silent pass. The loop's shape saved it, because its default arm is a failure rather than an acceptance, and nobody noticed that the shape was doing the work.

The correction matters beyond the arithmetic. The tree has been carrying this instance as the exhibit for a whole class, in this block and in its index row, and a reader who checked it would have found the class unsupported. The class is real anyway, and the sweep found a worse case than the one that was filed.

What was built

One assertion per selector that can go quiet. The rule the enumeration produced is narrower than "every selector", and the narrowing is what keeps it from being thirty-five assertions: a selector whose empty result is silent needs the assertion; one whose empty result raises does not. A shell glob, git ls-files <pattern> and Python's glob/rglob are silent. os.listdir and iterdir raise, which is how script/citations, script/decisions, script/roadmap, script/names, script/journeys and script/falsifications read their record directories.

Guarded, with the full table in the note:

Already guarded, and left alone: script/vendor-verify and script/vendor-watch both exit on an empty vendor/*.pin; script/mutation-census exits on a run with no outcome artifacts. So does script/fatal-risks' no-history check, on a ground the note quotes, and that ground is this block's argument.

Judged not to need one: script/lint's git grep finders (the TODO-milestone scan, the daemon scan, the conflict-marker scan) look for bad things rather than selecting a set to judge. Empty genuinely means clean, and an assertion there would be a false alarm by construction. That distinction, finder against selector, is the thing a lint for this could not make.

BUGS

Follow-on

Index row

Several gates pick the things they judge with a pattern and then judge them, so when the pattern stops matching the loop body never runs and the gate reports clean. The instance this block was filed about turned out not to be one: replayed against the tree at 51fee8248^, script/lint's crates/*proto glob did not pass silently after milestone 265's rename. POSIX sh leaves an unmatched glob in place as a literal word, and *proto falls through the case to the failure arm, so the check went red with a confusing message about a crate that does not exist. The class is real anyway and the sweep found a worse case than the filed one. script/ci-build selects its checks by matching a literal tier string in its own table with awk, so renaming that column left the command a developer runs before pushing running zero checks and printing "all pass". Eight selectors now assert that they selected something, seven of them in script/lint and one in script/ci-build. The rule that keeps this from being thirty-five assertions: a selector whose empty result is silent (a shell glob, git ls-files, Python glob and rglob) needs the assertion, while one whose empty result raises (os.listdir, iterdir) does not. Finders are excluded on purpose, since a git grep for bad things means clean when it is empty, and that distinction is why this is one assertion per site rather than a lint. notes/empty-selectors.md has the per-site table, what each guarded gate now guarantees, and the --exclude family it does not reach.