Threads · 02 / 18 · Sep 7, 2026 · Apache-2.0

A gate that answers two questions lies about both

Reusing one signal for a second, similar question works right up until the two answers stop agreeing — and they stop agreeing on the case the gate was built for. The symptom is a check that is correct about everything except what matters.

How it happens

A rule: no colour literals outside the design tokens. Somebody writes a check that looks for #RRGGBB. It works.

Then a second question arrives — which files are exempt? — and it gets answered with the same signal, because the signal is right there and, at that moment, it agrees:

const mentions = lines.filter((l) => COLOUR.test(l));                       // question 1
const exempt   = lines.some((l) => l.includes("design tokens") && COLOUR.test(l)); // question 2, same match

Nobody was careless. The two questions genuinely have the same answer on every file anyone tried.

Where they diverge

On the file that documents the rule and also breaks it:

// Colours come from the design tokens. Never a literal like #3B82F6 —
export const hack = { color: "#FF0000" };   // ← a real violation, right underneath
expect(r.exempt).toBe(true);
expect(r.violations).toEqual([]);   // and the violation is invisible

One line mentioned a colour next to the words that grant the exemption, so the whole file became exempt, and a real violation sits under it reported as nothing.

And notice which file it is: the one that talks about the rule — which is the file most likely to be edited by whoever is working on the rule. The gate is not broken in general. It is broken exactly where you were counting on it.

The split

Two questions, two answers, each from its own signal:

findViolations(file)          // is any line CODE that sets a colour? Comments are not code.
isExempt(file, exemptPaths)   // is this file exempt? Declared, not inferred from what it contains.
expect(findViolations(mixto)).toEqual([1]);          // the violation is found
expect(isExempt(mixto, [])).toBe(false);             // and the exemption is a decision somebody made

The part that pays for itself

expect(findViolations(elQueDocumenta)).toEqual([]);  // no exemption needed at all

Once the first question is asked properly — is this line code? rather than does this line mention it? — the file that documents the rule stops needing an exemption. A good fraction of the exemptions in any codebase exist to paper over a gate that was asking the wrong question, and each one is a hole somebody opened for a reason nobody remembers.

So the rule is not only "one gate, one question". It is that an exemption is evidence — usually about the gate, not about the file.

Where this comes from

A gate in niiko that forbids a UI pattern counts its occurrences — and counts them in comments too, so it flags the comment that explains why the pattern is not used there. It happened four times in one review round, and the fourth was not even a search: it was a sweep whose path pattern matched more than intended.

Different gate, same shape: one signal doing two jobs, right until the day it is not.

License

Apache-2.0 — see LICENSE. This is a demonstration, not a package. Copy what you need.


Built by Vorluno — a software studio from Panamá.

// next threadA test you never saw fail proves nothing