Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 114 additions & 21 deletions scripts/pm/bare-root-worklist.mjs
Original file line numberDiff line numberDiff line change
Expand Up@@ -243,6 +243,18 @@ const POPULATION_CONSTANT = /^(?:[A-Z0-9_]*_ROOTS?|[A-Z0-9_]*_DIRS?|POPULATION|[
* this file's own hint set and hand a reporting tool a population it does not
* read, which the self-test refuses in as many words.
*
* An entry's `segments` records either ONE hint (a flat array of path
* segments, as above) or SEVERAL (a LIST of segment arrays) — #14233's
* addition, for a gate whose declared population is spelled as more than one
* glob (one hint per extension, or one per file kind at the same root). A
* multi-hint entry's `hintCovers` reach is the UNION of its members, asked of
* every hint in turn; its `holds` is written to accept whatever any member
* covers, since the two-sided pin below (LIVE/PRECISE/COMPLETE/NARROWING)
* still runs over that union. Every hint of a multi-hint entry is required to
* share one root — the sweep below has exactly one denominator per entry, not
* one per hint — and that is verified per entry when the row is written, not
* pinned mechanically here (see the five rows #14233 added).
*
* `holds` is the spelling's claim written INDEPENDENTLY of `hintCovers` — a
* plain segment test a reader can check by eye. It is not a copy of the matcher:
* `hintCovers` reaches its answer through `globInNonFinalSegment`,
Expand DownExpand Up@@ -305,12 +317,66 @@ const SPELLINGS = new Map([
claim: "every file inside a skill's references folder, at any depth",
holds: (s) => s[0] === 'skills' && s.length >= 4 && s[2] === 'references',
}],
// ── Multi-hint entries (#14233) — a gate whose declared population is more
// than one glob at the same root. `holds` accepts whatever any member hint
// covers; see `hintsOf` and the pin loop below for how the union is asked.
['packages TypeScript source', {
segments: [
['packages', '**', '*.ts'],
['packages', '**', '*.tsx'],
['packages', '**', '*.mts'],
],
claim: 'every `.ts`, `.tsx` or `.mts` file at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& ['.ts', '.tsx', '.mts'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['examples TypeScript source', {
segments: ['examples', '**', '*.ts'],
claim: 'every `.ts` file at any depth under the examples root',
holds: (s) => s[0] === 'examples' && s.length >= 2 && s[s.length - 1].endsWith('.ts'),
}],
['apps TypeScript source', {
segments: [
['apps', '**', '*.ts'],
['apps', '**', '*.tsx'],
],
claim: 'every `.ts` or `.tsx` file at any depth under the apps root',
holds: (s) => s[0] === 'apps' && s.length >= 2
&& ['.ts', '.tsx'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['dual-build manifests and configs', {
segments: [
['packages', '**', 'package.json'],
['packages', '**', 'tsup.config.ts'],
],
claim: 'every workspace manifest or tsup config at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& (s[s.length - 1] === 'package.json' || s[s.length - 1] === 'tsup.config.ts'),
}],
['scripts top-level script files', {
segments: [
['scripts', '*.mjs'],
['scripts', '*.mts'],
],
claim: 'every `.mjs` or `.mts` file directly under the scripts root (non-recursive)',
holds: (s) => s.length === 2 && s[0] === 'scripts'
&& (s[1].endsWith('.mjs') || s[1].endsWith('.mts')),
}],
]);

/** The recorded spelling, assembled. Never a literal — see `SPELLINGS`. */
/**
* Normalises a `SPELLINGS` entry's `segments` to a LIST of segment arrays,
* whether it records one hint (a flat array) or several (already a list) —
* distinguished by whether the first element is itself an array. #14233.
*/
function hintsOf(segments) {
return Array.isArray(segments[0]) ? segments : [segments];
}

/** The recorded spelling(s), assembled. Never a literal — see `SPELLINGS`. */
export function spellingOf(name) {
const s = SPELLINGS.get(name);
return s ? s.segments.join('/') : null;
return s ? hintsOf(s.segments).map((seg) => seg.join('/')).join(' | ') : null;
}

const TRIAGE = new Map([
Expand All@@ -322,22 +388,36 @@ const TRIAGE = new Map([
}],
['check:logger-receiver-detach SCAN_ROOTS packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'packages TypeScript source',
why: 'the population is the non-test TypeScript source under the root, declared beside the '
+ 'constant at the three live extensions (4968 of 5485 tracked files, 90.6%) instead of '
+ 'the bare root. The remainder is manifests, JSON, markdown and fixtures the gate never '
+ 'opens, and the test files it deliberately does not read',
+ 'opens, and the test files it deliberately does not read. #14233: the declared population '
+ 'needs three hints (`.ts`/`.tsx`/`.mts`), which the SPELLINGS harness could not hold before '
+ 'it grew a multi-hint entry — the union now pins the three declared hints LIVE, PRECISE and '
+ 'COMPLETE against a plain "ends with one of these extensions" claim (5240 of 5796 tracked '
+ 'files under the bare root, re-measured 2026-09-01 — a different, wider count than the '
+ "gate's own non-test figure above, since the pin holds the raw hints' literal reach and "
+ "the gate's own test-file exclusion is not something a hint can spell)",
}],
['check:logger-receiver-detach SCAN_ROOTS examples', {
verdict: 'DECLARED-NARROWER',
spelling: 'examples TypeScript source',
why: 'same declaration, same gate: the TypeScript source under the examples root, 204 of 241 '
+ 'tracked files (84.6%), rather than the bare word. The uncovered remainder carries no '
+ 'TypeScript for this gate to read',
+ 'TypeScript for this gate to read. #14233: this root needs only the one hint the gate '
+ 'declares (`.ts`), now pinned LIVE, PRECISE and COMPLETE (206 of 243 tracked files under '
+ 'the bare root, re-measured 2026-09-01)',
}],
['check:logger-receiver-detach SCAN_ROOTS apps', {
verdict: 'DECLARED-NARROWER',
spelling: 'apps TypeScript source',
why: 'same declaration, same gate: 28 of 40 tracked files (70.0%) under the apps root, at the '
+ 'two extensions that exist there. The lowest ratio of the three and still a real '
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript',
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript. '
+ '#14233: the two declared hints (`.ts`/`.tsx`) are now pinned as one multi-hint spelling, '
+ 'LIVE, PRECISE and COMPLETE (29 of 41 tracked files under the bare root, re-measured '
+ '2026-09-01)',
}],
['check:objectql-double-limit SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
Expand DownExpand Up@@ -395,6 +475,7 @@ const TRIAGE = new Map([
}],
['check:dual-build-cjs-loads SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'dual-build manifests and configs',
why: 'the gate walks every publishable manifest under the root to find published `require` '
+ 'conditions, then reads only the dist/ those manifests point at — so the two literals it '
+ 'declares beside SCAN_ROOT under the ROOT_DIR_WATCH_HINTS idiom are the files whose '
Expand All@@ -407,10 +488,14 @@ const TRIAGE = new Map([
+ 'error this map names. The recall is not lost: the gate is a step in Build Core, a '
+ 'required context on every PR, so the omission costs one CI round trip rather than a '
+ 'missed defect. The row STAYS in the sweep because the bare root is still not covered — '
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says',
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says. '
+ "#14233: the two declared hints could not be pinned before SPELLINGS held only one per "
+ 'entry; they are now one multi-hint spelling, LIVE, PRECISE and COMPLETE against the same '
+ '74/20 split, re-measured 2026-09-01 (94 of 5796 tracked files under the bare root)',
}],
['check:ratchet-remedy-authority SCRIPTS_DIR scripts', {
verdict: 'DECLARED-NARROWER',
spelling: 'scripts top-level script files',
why: 'RE-DECIDED 2026-09-01 (#13813) from REFUSE-UNSPELLABLE, whose stated reason — "the idiom '
+ 'has no non-recursive spelling" — was TRUE when written and is FALSE of this tree. It '
+ 'rested on the deletion-collapse: a glob carrying a literal SUFFIX in the final segment '
Expand All@@ -424,17 +509,22 @@ const TRIAGE = new Map([
+ 'The gate now declares ONE hint per admitted extension beside SCRIPTS_DIR under the '
+ 'ROOT_DIR_WATCH_HINTS idiom, and the pair is SET-EQUAL to that walk in both directions — '
+ '183 of 183, nothing read left uncovered, nothing covered left unread — so 100% precise '
+ 'and complete. ⛔ NO `spelling` is recorded and that is deliberate, not an omission: '
+ 'SPELLINGS holds ONE hint per entry and this population needs one per extension, the same '
+ 'shape as the check:logger-receiver-detach and check:dual-build-cjs-loads rows above, so '
+ 'the liveness-and-precision coupling is held in the gate own --self-test, which pins the '
+ 'hints against SCRIPTS_DIR and CORPUS_EXTENSIONS and refuses both the subtree spelling and '
+ 'the brace form its own messages print. The consumer is MEASURED, not argued: before this, '
+ 'the derivation placed this family in the residue undetermined bucket, absent from the '
+ 'matched list a brief prints, and a PR that ran its whole derived family green locally '
+ 'lost a CI round to this gate. The row STAYS in the sweep because the bare root is still '
+ 'not covered — no arbitrary file at the top of the root is reached, and no nested script '
+ 'at any depth — which is what this verdict says and is correct, not outstanding debt',
+ 'and complete. The coupling described above was, at the time this row was decided, held '
+ "only in the gate's own --self-test (which pins the hints against SCRIPTS_DIR and "
+ 'CORPUS_EXTENSIONS and refuses both the subtree spelling and the brace form its own '
+ 'messages print), because SPELLINGS held ONE hint per entry and this population needs one '
+ 'per extension — the same shape as the check:logger-receiver-detach and '
+ 'check:dual-build-cjs-loads rows above, and the gap #14233 measured and closed: SPELLINGS '
+ 'now holds a LIST of segment arrays, so the pair is pinned HERE too, LIVE, PRECISE and '
+ 'COMPLETE (183 of 310 tracked files under the bare root, matching the gate own walk exactly, '
+ "re-measured 2026-09-01) — the gate's own pin and this one now independently corroborate "
+ 'the same declaration rather than only one of them re-measuring it. The consumer is '
+ 'MEASURED, not argued: before this, the derivation placed this family in the residue '
+ 'undetermined bucket, absent from the matched list a brief prints, and a PR that ran its '
+ 'whole derived family green locally lost a CI round to this gate. The row STAYS in the '
+ 'sweep because the bare root is still not covered — no arbitrary file at the top of the '
+ 'root is reached, and no nested script at any depth — which is what this verdict says and '
+ 'is correct, not outstanding debt',
}],
// ── Refused: the population is the whole root, and the root is saturated ──
['check:skill-identifier-liveness IMPL_ROOTS packages', {
Expand DownExpand Up@@ -1115,12 +1205,15 @@ function selfTest() {

for (const name of [...usedSpellings].sort()) {
const { segments, claim, holds } = SPELLINGS.get(name);
const hint = segments.join('/');
const covered = files.filter((f) => hintCovers(hint, f));
// A multi-hint entry's `hintCovers` reach is the UNION of its members —
// asked of every hint in turn, never collapsed into one string first
// (there is no glob idiom that would spell "either of these two globs").
const hints = hintsOf(segments).map((s) => s.join('/'));
const covered = files.filter((f) => hints.some((hint) => hintCovers(hint, f)));
const over = covered.filter((f) => !holds(seg(f)));
const claimed = files.filter((f) => holds(seg(f)));
const under = claimed.filter((f) => !hintCovers(hint, f));
const rootFiles = files.filter((f) => seg(f)[0] === segments[0]);
const under = claimed.filter((f) => !hints.some((hint) => hintCovers(hint, f)));
const rootFiles = files.filter((f) => seg(f)[0] === hintsOf(segments)[0][0]);
t(`the spelling recorded as "${name}" is LIVE — hintCovers reaches ${covered.length} tracked `
+ `file(s) with it, so no record below names a hint that covers nothing`, covered.length > 0);
t(`…and it is PRECISE: every file hintCovers admits for "${name}" (${claim}) satisfies that `
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 114 additions & 21 deletions scripts/pm/bare-root-worklist.mjs
Original file line numberDiff line numberDiff line change
Expand Up@@ -243,6 +243,18 @@ const POPULATION_CONSTANT = /^(?:[A-Z0-9_]*_ROOTS?|[A-Z0-9_]*_DIRS?|POPULATION|[
* this file's own hint set and hand a reporting tool a population it does not
* read, which the self-test refuses in as many words.
*
* An entry's `segments` records either ONE hint (a flat array of path
* segments, as above) or SEVERAL (a LIST of segment arrays) — #14233's
* addition, for a gate whose declared population is spelled as more than one
* glob (one hint per extension, or one per file kind at the same root). A
* multi-hint entry's `hintCovers` reach is the UNION of its members, asked of
* every hint in turn; its `holds` is written to accept whatever any member
* covers, since the two-sided pin below (LIVE/PRECISE/COMPLETE/NARROWING)
* still runs over that union. Every hint of a multi-hint entry is required to
* share one root — the sweep below has exactly one denominator per entry, not
* one per hint — and that is verified per entry when the row is written, not
* pinned mechanically here (see the five rows #14233 added).
*
* `holds` is the spelling's claim written INDEPENDENTLY of `hintCovers` — a
* plain segment test a reader can check by eye. It is not a copy of the matcher:
* `hintCovers` reaches its answer through `globInNonFinalSegment`,
Expand DownExpand Up@@ -305,12 +317,66 @@ const SPELLINGS = new Map([
claim: "every file inside a skill's references folder, at any depth",
holds: (s) => s[0] === 'skills' && s.length >= 4 && s[2] === 'references',
}],
// ── Multi-hint entries (#14233) — a gate whose declared population is more
// than one glob at the same root. `holds` accepts whatever any member hint
// covers; see `hintsOf` and the pin loop below for how the union is asked.
['packages TypeScript source', {
segments: [
['packages', '**', '*.ts'],
['packages', '**', '*.tsx'],
['packages', '**', '*.mts'],
],
claim: 'every `.ts`, `.tsx` or `.mts` file at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& ['.ts', '.tsx', '.mts'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['examples TypeScript source', {
segments: ['examples', '**', '*.ts'],
claim: 'every `.ts` file at any depth under the examples root',
holds: (s) => s[0] === 'examples' && s.length >= 2 && s[s.length - 1].endsWith('.ts'),
}],
['apps TypeScript source', {
segments: [
['apps', '**', '*.ts'],
['apps', '**', '*.tsx'],
],
claim: 'every `.ts` or `.tsx` file at any depth under the apps root',
holds: (s) => s[0] === 'apps' && s.length >= 2
&& ['.ts', '.tsx'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['dual-build manifests and configs', {
segments: [
['packages', '**', 'package.json'],
['packages', '**', 'tsup.config.ts'],
],
claim: 'every workspace manifest or tsup config at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& (s[s.length - 1] === 'package.json' || s[s.length - 1] === 'tsup.config.ts'),
}],
['scripts top-level script files', {
segments: [
['scripts', '*.mjs'],
['scripts', '*.mts'],
],
claim: 'every `.mjs` or `.mts` file directly under the scripts root (non-recursive)',
holds: (s) => s.length === 2 && s[0] === 'scripts'
&& (s[1].endsWith('.mjs') || s[1].endsWith('.mts')),
}],
]);

/** The recorded spelling, assembled. Never a literal — see `SPELLINGS`. */
/**
* Normalises a `SPELLINGS` entry's `segments` to a LIST of segment arrays,
* whether it records one hint (a flat array) or several (already a list) —
* distinguished by whether the first element is itself an array. #14233.
*/
function hintsOf(segments) {
return Array.isArray(segments[0]) ? segments : [segments];
}

/** The recorded spelling(s), assembled. Never a literal — see `SPELLINGS`. */
export function spellingOf(name) {
const s = SPELLINGS.get(name);
return s ? s.segments.join('/') : null;
return s ? hintsOf(s.segments).map((seg) => seg.join('/')).join(' | ') : null;
}

const TRIAGE = new Map([
Expand All@@ -322,22 +388,36 @@ const TRIAGE = new Map([
}],
['check:logger-receiver-detach SCAN_ROOTS packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'packages TypeScript source',
why: 'the population is the non-test TypeScript source under the root, declared beside the '
+ 'constant at the three live extensions (4968 of 5485 tracked files, 90.6%) instead of '
+ 'the bare root. The remainder is manifests, JSON, markdown and fixtures the gate never '
+ 'opens, and the test files it deliberately does not read',
+ 'opens, and the test files it deliberately does not read. #14233: the declared population '
+ 'needs three hints (`.ts`/`.tsx`/`.mts`), which the SPELLINGS harness could not hold before '
+ 'it grew a multi-hint entry — the union now pins the three declared hints LIVE, PRECISE and '
+ 'COMPLETE against a plain "ends with one of these extensions" claim (5240 of 5796 tracked '
+ 'files under the bare root, re-measured 2026-09-01 — a different, wider count than the '
+ "gate's own non-test figure above, since the pin holds the raw hints' literal reach and "
+ "the gate's own test-file exclusion is not something a hint can spell)",
}],
['check:logger-receiver-detach SCAN_ROOTS examples', {
verdict: 'DECLARED-NARROWER',
spelling: 'examples TypeScript source',
why: 'same declaration, same gate: the TypeScript source under the examples root, 204 of 241 '
+ 'tracked files (84.6%), rather than the bare word. The uncovered remainder carries no '
+ 'TypeScript for this gate to read',
+ 'TypeScript for this gate to read. #14233: this root needs only the one hint the gate '
+ 'declares (`.ts`), now pinned LIVE, PRECISE and COMPLETE (206 of 243 tracked files under '
+ 'the bare root, re-measured 2026-09-01)',
}],
['check:logger-receiver-detach SCAN_ROOTS apps', {
verdict: 'DECLARED-NARROWER',
spelling: 'apps TypeScript source',
why: 'same declaration, same gate: 28 of 40 tracked files (70.0%) under the apps root, at the '
+ 'two extensions that exist there. The lowest ratio of the three and still a real '
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript',
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript. '
+ '#14233: the two declared hints (`.ts`/`.tsx`) are now pinned as one multi-hint spelling, '
+ 'LIVE, PRECISE and COMPLETE (29 of 41 tracked files under the bare root, re-measured '
+ '2026-09-01)',
}],
['check:objectql-double-limit SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
Expand DownExpand Up@@ -395,6 +475,7 @@ const TRIAGE = new Map([
}],
['check:dual-build-cjs-loads SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'dual-build manifests and configs',
why: 'the gate walks every publishable manifest under the root to find published `require` '
+ 'conditions, then reads only the dist/ those manifests point at — so the two literals it '
+ 'declares beside SCAN_ROOT under the ROOT_DIR_WATCH_HINTS idiom are the files whose '
Expand All@@ -407,10 +488,14 @@ const TRIAGE = new Map([
+ 'error this map names. The recall is not lost: the gate is a step in Build Core, a '
+ 'required context on every PR, so the omission costs one CI round trip rather than a '
+ 'missed defect. The row STAYS in the sweep because the bare root is still not covered — '
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says',
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says. '
+ "#14233: the two declared hints could not be pinned before SPELLINGS held only one per "
+ 'entry; they are now one multi-hint spelling, LIVE, PRECISE and COMPLETE against the same '
+ '74/20 split, re-measured 2026-09-01 (94 of 5796 tracked files under the bare root)',
}],
['check:ratchet-remedy-authority SCRIPTS_DIR scripts', {
verdict: 'DECLARED-NARROWER',
spelling: 'scripts top-level script files',
why: 'RE-DECIDED 2026-09-01 (#13813) from REFUSE-UNSPELLABLE, whose stated reason — "the idiom '
+ 'has no non-recursive spelling" — was TRUE when written and is FALSE of this tree. It '
+ 'rested on the deletion-collapse: a glob carrying a literal SUFFIX in the final segment '
Expand All@@ -424,17 +509,22 @@ const TRIAGE = new Map([
+ 'The gate now declares ONE hint per admitted extension beside SCRIPTS_DIR under the '
+ 'ROOT_DIR_WATCH_HINTS idiom, and the pair is SET-EQUAL to that walk in both directions — '
+ '183 of 183, nothing read left uncovered, nothing covered left unread — so 100% precise '
+ 'and complete. ⛔ NO `spelling` is recorded and that is deliberate, not an omission: '
+ 'SPELLINGS holds ONE hint per entry and this population needs one per extension, the same '
+ 'shape as the check:logger-receiver-detach and check:dual-build-cjs-loads rows above, so '
+ 'the liveness-and-precision coupling is held in the gate own --self-test, which pins the '
+ 'hints against SCRIPTS_DIR and CORPUS_EXTENSIONS and refuses both the subtree spelling and '
+ 'the brace form its own messages print. The consumer is MEASURED, not argued: before this, '
+ 'the derivation placed this family in the residue undetermined bucket, absent from the '
+ 'matched list a brief prints, and a PR that ran its whole derived family green locally '
+ 'lost a CI round to this gate. The row STAYS in the sweep because the bare root is still '
+ 'not covered — no arbitrary file at the top of the root is reached, and no nested script '
+ 'at any depth — which is what this verdict says and is correct, not outstanding debt',
+ 'and complete. The coupling described above was, at the time this row was decided, held '
+ "only in the gate's own --self-test (which pins the hints against SCRIPTS_DIR and "
+ 'CORPUS_EXTENSIONS and refuses both the subtree spelling and the brace form its own '
+ 'messages print), because SPELLINGS held ONE hint per entry and this population needs one '
+ 'per extension — the same shape as the check:logger-receiver-detach and '
+ 'check:dual-build-cjs-loads rows above, and the gap #14233 measured and closed: SPELLINGS '
+ 'now holds a LIST of segment arrays, so the pair is pinned HERE too, LIVE, PRECISE and '
+ 'COMPLETE (183 of 310 tracked files under the bare root, matching the gate own walk exactly, '
+ "re-measured 2026-09-01) — the gate's own pin and this one now independently corroborate "
+ 'the same declaration rather than only one of them re-measuring it. The consumer is '
+ 'MEASURED, not argued: before this, the derivation placed this family in the residue '
+ 'undetermined bucket, absent from the matched list a brief prints, and a PR that ran its '
+ 'whole derived family green locally lost a CI round to this gate. The row STAYS in the '
+ 'sweep because the bare root is still not covered — no arbitrary file at the top of the '
+ 'root is reached, and no nested script at any depth — which is what this verdict says and '
+ 'is correct, not outstanding debt',
}],
// ── Refused: the population is the whole root, and the root is saturated ──
['check:skill-identifier-liveness IMPL_ROOTS packages', {
Expand DownExpand Up@@ -1115,12 +1205,15 @@ function selfTest() {

for (const name of [...usedSpellings].sort()) {
const { segments, claim, holds } = SPELLINGS.get(name);
const hint = segments.join('/');
const covered = files.filter((f) => hintCovers(hint, f));
// A multi-hint entry's `hintCovers` reach is the UNION of its members —
// asked of every hint in turn, never collapsed into one string first
// (there is no glob idiom that would spell "either of these two globs").
const hints = hintsOf(segments).map((s) => s.join('/'));
const covered = files.filter((f) => hints.some((hint) => hintCovers(hint, f)));
const over = covered.filter((f) => !holds(seg(f)));
const claimed = files.filter((f) => holds(seg(f)));
const under = claimed.filter((f) => !hintCovers(hint, f));
const rootFiles = files.filter((f) => seg(f)[0] === segments[0]);
const under = claimed.filter((f) => !hints.some((hint) => hintCovers(hint, f)));
const rootFiles = files.filter((f) => seg(f)[0] === hintsOf(segments)[0][0]);
t(`the spelling recorded as "${name}" is LIVE — hintCovers reaches ${covered.length} tracked `
+ `file(s) with it, so no record below names a hint that covers nothing`, covered.length > 0);
t(`…and it is PRECISE: every file hintCovers admits for "${name}" (${claim}) satisfies that `
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 114 additions & 21 deletions scripts/pm/bare-root-worklist.mjs
Original file line numberDiff line numberDiff line change
Expand Up@@ -243,6 +243,18 @@ const POPULATION_CONSTANT = /^(?:[A-Z0-9_]*_ROOTS?|[A-Z0-9_]*_DIRS?|POPULATION|[
* this file's own hint set and hand a reporting tool a population it does not
* read, which the self-test refuses in as many words.
*
* An entry's `segments` records either ONE hint (a flat array of path
* segments, as above) or SEVERAL (a LIST of segment arrays) — #14233's
* addition, for a gate whose declared population is spelled as more than one
* glob (one hint per extension, or one per file kind at the same root). A
* multi-hint entry's `hintCovers` reach is the UNION of its members, asked of
* every hint in turn; its `holds` is written to accept whatever any member
* covers, since the two-sided pin below (LIVE/PRECISE/COMPLETE/NARROWING)
* still runs over that union. Every hint of a multi-hint entry is required to
* share one root — the sweep below has exactly one denominator per entry, not
* one per hint — and that is verified per entry when the row is written, not
* pinned mechanically here (see the five rows #14233 added).
*
* `holds` is the spelling's claim written INDEPENDENTLY of `hintCovers` — a
* plain segment test a reader can check by eye. It is not a copy of the matcher:
* `hintCovers` reaches its answer through `globInNonFinalSegment`,
Expand DownExpand Up@@ -305,12 +317,66 @@ const SPELLINGS = new Map([
claim: "every file inside a skill's references folder, at any depth",
holds: (s) => s[0] === 'skills' && s.length >= 4 && s[2] === 'references',
}],
// ── Multi-hint entries (#14233) — a gate whose declared population is more
// than one glob at the same root. `holds` accepts whatever any member hint
// covers; see `hintsOf` and the pin loop below for how the union is asked.
['packages TypeScript source', {
segments: [
['packages', '**', '*.ts'],
['packages', '**', '*.tsx'],
['packages', '**', '*.mts'],
],
claim: 'every `.ts`, `.tsx` or `.mts` file at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& ['.ts', '.tsx', '.mts'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['examples TypeScript source', {
segments: ['examples', '**', '*.ts'],
claim: 'every `.ts` file at any depth under the examples root',
holds: (s) => s[0] === 'examples' && s.length >= 2 && s[s.length - 1].endsWith('.ts'),
}],
['apps TypeScript source', {
segments: [
['apps', '**', '*.ts'],
['apps', '**', '*.tsx'],
],
claim: 'every `.ts` or `.tsx` file at any depth under the apps root',
holds: (s) => s[0] === 'apps' && s.length >= 2
&& ['.ts', '.tsx'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['dual-build manifests and configs', {
segments: [
['packages', '**', 'package.json'],
['packages', '**', 'tsup.config.ts'],
],
claim: 'every workspace manifest or tsup config at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& (s[s.length - 1] === 'package.json' || s[s.length - 1] === 'tsup.config.ts'),
}],
['scripts top-level script files', {
segments: [
['scripts', '*.mjs'],
['scripts', '*.mts'],
],
claim: 'every `.mjs` or `.mts` file directly under the scripts root (non-recursive)',
holds: (s) => s.length === 2 && s[0] === 'scripts'
&& (s[1].endsWith('.mjs') || s[1].endsWith('.mts')),
}],
]);

/** The recorded spelling, assembled. Never a literal — see `SPELLINGS`. */
/**
* Normalises a `SPELLINGS` entry's `segments` to a LIST of segment arrays,
* whether it records one hint (a flat array) or several (already a list) —
* distinguished by whether the first element is itself an array. #14233.
*/
function hintsOf(segments) {
return Array.isArray(segments[0]) ? segments : [segments];
}

/** The recorded spelling(s), assembled. Never a literal — see `SPELLINGS`. */
export function spellingOf(name) {
const s = SPELLINGS.get(name);
return s ? s.segments.join('/') : null;
return s ? hintsOf(s.segments).map((seg) => seg.join('/')).join(' | ') : null;
}

const TRIAGE = new Map([
Expand All@@ -322,22 +388,36 @@ const TRIAGE = new Map([
}],
['check:logger-receiver-detach SCAN_ROOTS packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'packages TypeScript source',
why: 'the population is the non-test TypeScript source under the root, declared beside the '
+ 'constant at the three live extensions (4968 of 5485 tracked files, 90.6%) instead of '
+ 'the bare root. The remainder is manifests, JSON, markdown and fixtures the gate never '
+ 'opens, and the test files it deliberately does not read',
+ 'opens, and the test files it deliberately does not read. #14233: the declared population '
+ 'needs three hints (`.ts`/`.tsx`/`.mts`), which the SPELLINGS harness could not hold before '
+ 'it grew a multi-hint entry — the union now pins the three declared hints LIVE, PRECISE and '
+ 'COMPLETE against a plain "ends with one of these extensions" claim (5240 of 5796 tracked '
+ 'files under the bare root, re-measured 2026-09-01 — a different, wider count than the '
+ "gate's own non-test figure above, since the pin holds the raw hints' literal reach and "
+ "the gate's own test-file exclusion is not something a hint can spell)",
}],
['check:logger-receiver-detach SCAN_ROOTS examples', {
verdict: 'DECLARED-NARROWER',
spelling: 'examples TypeScript source',
why: 'same declaration, same gate: the TypeScript source under the examples root, 204 of 241 '
+ 'tracked files (84.6%), rather than the bare word. The uncovered remainder carries no '
+ 'TypeScript for this gate to read',
+ 'TypeScript for this gate to read. #14233: this root needs only the one hint the gate '
+ 'declares (`.ts`), now pinned LIVE, PRECISE and COMPLETE (206 of 243 tracked files under '
+ 'the bare root, re-measured 2026-09-01)',
}],
['check:logger-receiver-detach SCAN_ROOTS apps', {
verdict: 'DECLARED-NARROWER',
spelling: 'apps TypeScript source',
why: 'same declaration, same gate: 28 of 40 tracked files (70.0%) under the apps root, at the '
+ 'two extensions that exist there. The lowest ratio of the three and still a real '
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript',
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript. '
+ '#14233: the two declared hints (`.ts`/`.tsx`) are now pinned as one multi-hint spelling, '
+ 'LIVE, PRECISE and COMPLETE (29 of 41 tracked files under the bare root, re-measured '
+ '2026-09-01)',
}],
['check:objectql-double-limit SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
Expand DownExpand Up@@ -395,6 +475,7 @@ const TRIAGE = new Map([
}],
['check:dual-build-cjs-loads SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'dual-build manifests and configs',
why: 'the gate walks every publishable manifest under the root to find published `require` '
+ 'conditions, then reads only the dist/ those manifests point at — so the two literals it '
+ 'declares beside SCAN_ROOT under the ROOT_DIR_WATCH_HINTS idiom are the files whose '
Expand All@@ -407,10 +488,14 @@ const TRIAGE = new Map([
+ 'error this map names. The recall is not lost: the gate is a step in Build Core, a '
+ 'required context on every PR, so the omission costs one CI round trip rather than a '
+ 'missed defect. The row STAYS in the sweep because the bare root is still not covered — '
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says',
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says. '
+ "#14233: the two declared hints could not be pinned before SPELLINGS held only one per "
+ 'entry; they are now one multi-hint spelling, LIVE, PRECISE and COMPLETE against the same '
+ '74/20 split, re-measured 2026-09-01 (94 of 5796 tracked files under the bare root)',
}],
['check:ratchet-remedy-authority SCRIPTS_DIR scripts', {
verdict: 'DECLARED-NARROWER',
spelling: 'scripts top-level script files',
why: 'RE-DECIDED 2026-09-01 (#13813) from REFUSE-UNSPELLABLE, whose stated reason — "the idiom '
+ 'has no non-recursive spelling" — was TRUE when written and is FALSE of this tree. It '
+ 'rested on the deletion-collapse: a glob carrying a literal SUFFIX in the final segment '
Expand All@@ -424,17 +509,22 @@ const TRIAGE = new Map([
+ 'The gate now declares ONE hint per admitted extension beside SCRIPTS_DIR under the '
+ 'ROOT_DIR_WATCH_HINTS idiom, and the pair is SET-EQUAL to that walk in both directions — '
+ '183 of 183, nothing read left uncovered, nothing covered left unread — so 100% precise '
+ 'and complete. ⛔ NO `spelling` is recorded and that is deliberate, not an omission: '
+ 'SPELLINGS holds ONE hint per entry and this population needs one per extension, the same '
+ 'shape as the check:logger-receiver-detach and check:dual-build-cjs-loads rows above, so '
+ 'the liveness-and-precision coupling is held in the gate own --self-test, which pins the '
+ 'hints against SCRIPTS_DIR and CORPUS_EXTENSIONS and refuses both the subtree spelling and '
+ 'the brace form its own messages print. The consumer is MEASURED, not argued: before this, '
+ 'the derivation placed this family in the residue undetermined bucket, absent from the '
+ 'matched list a brief prints, and a PR that ran its whole derived family green locally '
+ 'lost a CI round to this gate. The row STAYS in the sweep because the bare root is still '
+ 'not covered — no arbitrary file at the top of the root is reached, and no nested script '
+ 'at any depth — which is what this verdict says and is correct, not outstanding debt',
+ 'and complete. The coupling described above was, at the time this row was decided, held '
+ "only in the gate's own --self-test (which pins the hints against SCRIPTS_DIR and "
+ 'CORPUS_EXTENSIONS and refuses both the subtree spelling and the brace form its own '
+ 'messages print), because SPELLINGS held ONE hint per entry and this population needs one '
+ 'per extension — the same shape as the check:logger-receiver-detach and '
+ 'check:dual-build-cjs-loads rows above, and the gap #14233 measured and closed: SPELLINGS '
+ 'now holds a LIST of segment arrays, so the pair is pinned HERE too, LIVE, PRECISE and '
+ 'COMPLETE (183 of 310 tracked files under the bare root, matching the gate own walk exactly, '
+ "re-measured 2026-09-01) — the gate's own pin and this one now independently corroborate "
+ 'the same declaration rather than only one of them re-measuring it. The consumer is '
+ 'MEASURED, not argued: before this, the derivation placed this family in the residue '
+ 'undetermined bucket, absent from the matched list a brief prints, and a PR that ran its '
+ 'whole derived family green locally lost a CI round to this gate. The row STAYS in the '
+ 'sweep because the bare root is still not covered — no arbitrary file at the top of the '
+ 'root is reached, and no nested script at any depth — which is what this verdict says and '
+ 'is correct, not outstanding debt',
}],
// ── Refused: the population is the whole root, and the root is saturated ──
['check:skill-identifier-liveness IMPL_ROOTS packages', {
Expand DownExpand Up@@ -1115,12 +1205,15 @@ function selfTest() {

for (const name of [...usedSpellings].sort()) {
const { segments, claim, holds } = SPELLINGS.get(name);
const hint = segments.join('/');
const covered = files.filter((f) => hintCovers(hint, f));
// A multi-hint entry's `hintCovers` reach is the UNION of its members —
// asked of every hint in turn, never collapsed into one string first
// (there is no glob idiom that would spell "either of these two globs").
const hints = hintsOf(segments).map((s) => s.join('/'));
const covered = files.filter((f) => hints.some((hint) => hintCovers(hint, f)));
const over = covered.filter((f) => !holds(seg(f)));
const claimed = files.filter((f) => holds(seg(f)));
const under = claimed.filter((f) => !hintCovers(hint, f));
const rootFiles = files.filter((f) => seg(f)[0] === segments[0]);
const under = claimed.filter((f) => !hints.some((hint) => hintCovers(hint, f)));
const rootFiles = files.filter((f) => seg(f)[0] === hintsOf(segments)[0][0]);
t(`the spelling recorded as "${name}" is LIVE — hintCovers reaches ${covered.length} tracked `
+ `file(s) with it, so no record below names a hint that covers nothing`, covered.length > 0);
t(`…and it is PRECISE: every file hintCovers admits for "${name}" (${claim}) satisfies that `
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 114 additions & 21 deletions scripts/pm/bare-root-worklist.mjs
Original file line numberDiff line numberDiff line change
Expand Up@@ -243,6 +243,18 @@ const POPULATION_CONSTANT = /^(?:[A-Z0-9_]*_ROOTS?|[A-Z0-9_]*_DIRS?|POPULATION|[
* this file's own hint set and hand a reporting tool a population it does not
* read, which the self-test refuses in as many words.
*
* An entry's `segments` records either ONE hint (a flat array of path
* segments, as above) or SEVERAL (a LIST of segment arrays) — #14233's
* addition, for a gate whose declared population is spelled as more than one
* glob (one hint per extension, or one per file kind at the same root). A
* multi-hint entry's `hintCovers` reach is the UNION of its members, asked of
* every hint in turn; its `holds` is written to accept whatever any member
* covers, since the two-sided pin below (LIVE/PRECISE/COMPLETE/NARROWING)
* still runs over that union. Every hint of a multi-hint entry is required to
* share one root — the sweep below has exactly one denominator per entry, not
* one per hint — and that is verified per entry when the row is written, not
* pinned mechanically here (see the five rows #14233 added).
*
* `holds` is the spelling's claim written INDEPENDENTLY of `hintCovers` — a
* plain segment test a reader can check by eye. It is not a copy of the matcher:
* `hintCovers` reaches its answer through `globInNonFinalSegment`,
Expand DownExpand Up@@ -305,12 +317,66 @@ const SPELLINGS = new Map([
claim: "every file inside a skill's references folder, at any depth",
holds: (s) => s[0] === 'skills' && s.length >= 4 && s[2] === 'references',
}],
// ── Multi-hint entries (#14233) — a gate whose declared population is more
// than one glob at the same root. `holds` accepts whatever any member hint
// covers; see `hintsOf` and the pin loop below for how the union is asked.
['packages TypeScript source', {
segments: [
['packages', '**', '*.ts'],
['packages', '**', '*.tsx'],
['packages', '**', '*.mts'],
],
claim: 'every `.ts`, `.tsx` or `.mts` file at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& ['.ts', '.tsx', '.mts'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['examples TypeScript source', {
segments: ['examples', '**', '*.ts'],
claim: 'every `.ts` file at any depth under the examples root',
holds: (s) => s[0] === 'examples' && s.length >= 2 && s[s.length - 1].endsWith('.ts'),
}],
['apps TypeScript source', {
segments: [
['apps', '**', '*.ts'],
['apps', '**', '*.tsx'],
],
claim: 'every `.ts` or `.tsx` file at any depth under the apps root',
holds: (s) => s[0] === 'apps' && s.length >= 2
&& ['.ts', '.tsx'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['dual-build manifests and configs', {
segments: [
['packages', '**', 'package.json'],
['packages', '**', 'tsup.config.ts'],
],
claim: 'every workspace manifest or tsup config at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& (s[s.length - 1] === 'package.json' || s[s.length - 1] === 'tsup.config.ts'),
}],
['scripts top-level script files', {
segments: [
['scripts', '*.mjs'],
['scripts', '*.mts'],
],
claim: 'every `.mjs` or `.mts` file directly under the scripts root (non-recursive)',
holds: (s) => s.length === 2 && s[0] === 'scripts'
&& (s[1].endsWith('.mjs') || s[1].endsWith('.mts')),
}],
]);

/** The recorded spelling, assembled. Never a literal — see `SPELLINGS`. */
/**
* Normalises a `SPELLINGS` entry's `segments` to a LIST of segment arrays,
* whether it records one hint (a flat array) or several (already a list) —
* distinguished by whether the first element is itself an array. #14233.
*/
function hintsOf(segments) {
return Array.isArray(segments[0]) ? segments : [segments];
}

/** The recorded spelling(s), assembled. Never a literal — see `SPELLINGS`. */
export function spellingOf(name) {
const s = SPELLINGS.get(name);
return s ? s.segments.join('/') : null;
return s ? hintsOf(s.segments).map((seg) => seg.join('/')).join(' | ') : null;
}

const TRIAGE = new Map([
Expand All@@ -322,22 +388,36 @@ const TRIAGE = new Map([
}],
['check:logger-receiver-detach SCAN_ROOTS packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'packages TypeScript source',
why: 'the population is the non-test TypeScript source under the root, declared beside the '
+ 'constant at the three live extensions (4968 of 5485 tracked files, 90.6%) instead of '
+ 'the bare root. The remainder is manifests, JSON, markdown and fixtures the gate never '
+ 'opens, and the test files it deliberately does not read',
+ 'opens, and the test files it deliberately does not read. #14233: the declared population '
+ 'needs three hints (`.ts`/`.tsx`/`.mts`), which the SPELLINGS harness could not hold before '
+ 'it grew a multi-hint entry — the union now pins the three declared hints LIVE, PRECISE and '
+ 'COMPLETE against a plain "ends with one of these extensions" claim (5240 of 5796 tracked '
+ 'files under the bare root, re-measured 2026-09-01 — a different, wider count than the '
+ "gate's own non-test figure above, since the pin holds the raw hints' literal reach and "
+ "the gate's own test-file exclusion is not something a hint can spell)",
}],
['check:logger-receiver-detach SCAN_ROOTS examples', {
verdict: 'DECLARED-NARROWER',
spelling: 'examples TypeScript source',
why: 'same declaration, same gate: the TypeScript source under the examples root, 204 of 241 '
+ 'tracked files (84.6%), rather than the bare word. The uncovered remainder carries no '
+ 'TypeScript for this gate to read',
+ 'TypeScript for this gate to read. #14233: this root needs only the one hint the gate '
+ 'declares (`.ts`), now pinned LIVE, PRECISE and COMPLETE (206 of 243 tracked files under '
+ 'the bare root, re-measured 2026-09-01)',
}],
['check:logger-receiver-detach SCAN_ROOTS apps', {
verdict: 'DECLARED-NARROWER',
spelling: 'apps TypeScript source',
why: 'same declaration, same gate: 28 of 40 tracked files (70.0%) under the apps root, at the '
+ 'two extensions that exist there. The lowest ratio of the three and still a real '
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript',
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript. '
+ '#14233: the two declared hints (`.ts`/`.tsx`) are now pinned as one multi-hint spelling, '
+ 'LIVE, PRECISE and COMPLETE (29 of 41 tracked files under the bare root, re-measured '
+ '2026-09-01)',
}],
['check:objectql-double-limit SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
Expand DownExpand Up@@ -395,6 +475,7 @@ const TRIAGE = new Map([
}],
['check:dual-build-cjs-loads SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'dual-build manifests and configs',
why: 'the gate walks every publishable manifest under the root to find published `require` '
+ 'conditions, then reads only the dist/ those manifests point at — so the two literals it '
+ 'declares beside SCAN_ROOT under the ROOT_DIR_WATCH_HINTS idiom are the files whose '
Expand All@@ -407,10 +488,14 @@ const TRIAGE = new Map([
+ 'error this map names. The recall is not lost: the gate is a step in Build Core, a '
+ 'required context on every PR, so the omission costs one CI round trip rather than a '
+ 'missed defect. The row STAYS in the sweep because the bare root is still not covered — '
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says',
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says. '
+ "#14233: the two declared hints could not be pinned before SPELLINGS held only one per "
+ 'entry; they are now one multi-hint spelling, LIVE, PRECISE and COMPLETE against the same '
+ '74/20 split, re-measured 2026-09-01 (94 of 5796 tracked files under the bare root)',
}],
['check:ratchet-remedy-authority SCRIPTS_DIR scripts', {
verdict: 'DECLARED-NARROWER',
spelling: 'scripts top-level script files',
why: 'RE-DECIDED 2026-09-01 (#13813) from REFUSE-UNSPELLABLE, whose stated reason — "the idiom '
+ 'has no non-recursive spelling" — was TRUE when written and is FALSE of this tree. It '
+ 'rested on the deletion-collapse: a glob carrying a literal SUFFIX in the final segment '
Expand All@@ -424,17 +509,22 @@ const TRIAGE = new Map([
+ 'The gate now declares ONE hint per admitted extension beside SCRIPTS_DIR under the '
+ 'ROOT_DIR_WATCH_HINTS idiom, and the pair is SET-EQUAL to that walk in both directions — '
+ '183 of 183, nothing read left uncovered, nothing covered left unread — so 100% precise '
+ 'and complete. ⛔ NO `spelling` is recorded and that is deliberate, not an omission: '
+ 'SPELLINGS holds ONE hint per entry and this population needs one per extension, the same '
+ 'shape as the check:logger-receiver-detach and check:dual-build-cjs-loads rows above, so '
+ 'the liveness-and-precision coupling is held in the gate own --self-test, which pins the '
+ 'hints against SCRIPTS_DIR and CORPUS_EXTENSIONS and refuses both the subtree spelling and '
+ 'the brace form its own messages print. The consumer is MEASURED, not argued: before this, '
+ 'the derivation placed this family in the residue undetermined bucket, absent from the '
+ 'matched list a brief prints, and a PR that ran its whole derived family green locally '
+ 'lost a CI round to this gate. The row STAYS in the sweep because the bare root is still '
+ 'not covered — no arbitrary file at the top of the root is reached, and no nested script '
+ 'at any depth — which is what this verdict says and is correct, not outstanding debt',
+ 'and complete. The coupling described above was, at the time this row was decided, held '
+ "only in the gate's own --self-test (which pins the hints against SCRIPTS_DIR and "
+ 'CORPUS_EXTENSIONS and refuses both the subtree spelling and the brace form its own '
+ 'messages print), because SPELLINGS held ONE hint per entry and this population needs one '
+ 'per extension — the same shape as the check:logger-receiver-detach and '
+ 'check:dual-build-cjs-loads rows above, and the gap #14233 measured and closed: SPELLINGS '
+ 'now holds a LIST of segment arrays, so the pair is pinned HERE too, LIVE, PRECISE and '
+ 'COMPLETE (183 of 310 tracked files under the bare root, matching the gate own walk exactly, '
+ "re-measured 2026-09-01) — the gate's own pin and this one now independently corroborate "
+ 'the same declaration rather than only one of them re-measuring it. The consumer is '
+ 'MEASURED, not argued: before this, the derivation placed this family in the residue '
+ 'undetermined bucket, absent from the matched list a brief prints, and a PR that ran its '
+ 'whole derived family green locally lost a CI round to this gate. The row STAYS in the '
+ 'sweep because the bare root is still not covered — no arbitrary file at the top of the '
+ 'root is reached, and no nested script at any depth — which is what this verdict says and '
+ 'is correct, not outstanding debt',
}],
// ── Refused: the population is the whole root, and the root is saturated ──
['check:skill-identifier-liveness IMPL_ROOTS packages', {
Expand DownExpand Up@@ -1115,12 +1205,15 @@ function selfTest() {

for (const name of [...usedSpellings].sort()) {
const { segments, claim, holds } = SPELLINGS.get(name);
const hint = segments.join('/');
const covered = files.filter((f) => hintCovers(hint, f));
// A multi-hint entry's `hintCovers` reach is the UNION of its members —
// asked of every hint in turn, never collapsed into one string first
// (there is no glob idiom that would spell "either of these two globs").
const hints = hintsOf(segments).map((s) => s.join('/'));
const covered = files.filter((f) => hints.some((hint) => hintCovers(hint, f)));
const over = covered.filter((f) => !holds(seg(f)));
const claimed = files.filter((f) => holds(seg(f)));
const under = claimed.filter((f) => !hintCovers(hint, f));
const rootFiles = files.filter((f) => seg(f)[0] === segments[0]);
const under = claimed.filter((f) => !hints.some((hint) => hintCovers(hint, f)));
const rootFiles = files.filter((f) => seg(f)[0] === hintsOf(segments)[0][0]);
t(`the spelling recorded as "${name}" is LIVE — hintCovers reaches ${covered.length} tracked `
+ `file(s) with it, so no record below names a hint that covers nothing`, covered.length > 0);
t(`…and it is PRECISE: every file hintCovers admits for "${name}" (${claim}) satisfies that `
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 114 additions & 21 deletions scripts/pm/bare-root-worklist.mjs
Original file line numberDiff line numberDiff line change
Expand Up@@ -243,6 +243,18 @@ const POPULATION_CONSTANT = /^(?:[A-Z0-9_]*_ROOTS?|[A-Z0-9_]*_DIRS?|POPULATION|[
* this file's own hint set and hand a reporting tool a population it does not
* read, which the self-test refuses in as many words.
*
* An entry's `segments` records either ONE hint (a flat array of path
* segments, as above) or SEVERAL (a LIST of segment arrays) — #14233's
* addition, for a gate whose declared population is spelled as more than one
* glob (one hint per extension, or one per file kind at the same root). A
* multi-hint entry's `hintCovers` reach is the UNION of its members, asked of
* every hint in turn; its `holds` is written to accept whatever any member
* covers, since the two-sided pin below (LIVE/PRECISE/COMPLETE/NARROWING)
* still runs over that union. Every hint of a multi-hint entry is required to
* share one root — the sweep below has exactly one denominator per entry, not
* one per hint — and that is verified per entry when the row is written, not
* pinned mechanically here (see the five rows #14233 added).
*
* `holds` is the spelling's claim written INDEPENDENTLY of `hintCovers` — a
* plain segment test a reader can check by eye. It is not a copy of the matcher:
* `hintCovers` reaches its answer through `globInNonFinalSegment`,
Expand DownExpand Up@@ -305,12 +317,66 @@ const SPELLINGS = new Map([
claim: "every file inside a skill's references folder, at any depth",
holds: (s) => s[0] === 'skills' && s.length >= 4 && s[2] === 'references',
}],
// ── Multi-hint entries (#14233) — a gate whose declared population is more
// than one glob at the same root. `holds` accepts whatever any member hint
// covers; see `hintsOf` and the pin loop below for how the union is asked.
['packages TypeScript source', {
segments: [
['packages', '**', '*.ts'],
['packages', '**', '*.tsx'],
['packages', '**', '*.mts'],
],
claim: 'every `.ts`, `.tsx` or `.mts` file at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& ['.ts', '.tsx', '.mts'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['examples TypeScript source', {
segments: ['examples', '**', '*.ts'],
claim: 'every `.ts` file at any depth under the examples root',
holds: (s) => s[0] === 'examples' && s.length >= 2 && s[s.length - 1].endsWith('.ts'),
}],
['apps TypeScript source', {
segments: [
['apps', '**', '*.ts'],
['apps', '**', '*.tsx'],
],
claim: 'every `.ts` or `.tsx` file at any depth under the apps root',
holds: (s) => s[0] === 'apps' && s.length >= 2
&& ['.ts', '.tsx'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['dual-build manifests and configs', {
segments: [
['packages', '**', 'package.json'],
['packages', '**', 'tsup.config.ts'],
],
claim: 'every workspace manifest or tsup config at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& (s[s.length - 1] === 'package.json' || s[s.length - 1] === 'tsup.config.ts'),
}],
['scripts top-level script files', {
segments: [
['scripts', '*.mjs'],
['scripts', '*.mts'],
],
claim: 'every `.mjs` or `.mts` file directly under the scripts root (non-recursive)',
holds: (s) => s.length === 2 && s[0] === 'scripts'
&& (s[1].endsWith('.mjs') || s[1].endsWith('.mts')),
}],
]);

/** The recorded spelling, assembled. Never a literal — see `SPELLINGS`. */
/**
* Normalises a `SPELLINGS` entry's `segments` to a LIST of segment arrays,
* whether it records one hint (a flat array) or several (already a list) —
* distinguished by whether the first element is itself an array. #14233.
*/
function hintsOf(segments) {
return Array.isArray(segments[0]) ? segments : [segments];
}

/** The recorded spelling(s), assembled. Never a literal — see `SPELLINGS`. */
export function spellingOf(name) {
const s = SPELLINGS.get(name);
return s ? s.segments.join('/') : null;
return s ? hintsOf(s.segments).map((seg) => seg.join('/')).join(' | ') : null;
}

const TRIAGE = new Map([
Expand All@@ -322,22 +388,36 @@ const TRIAGE = new Map([
}],
['check:logger-receiver-detach SCAN_ROOTS packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'packages TypeScript source',
why: 'the population is the non-test TypeScript source under the root, declared beside the '
+ 'constant at the three live extensions (4968 of 5485 tracked files, 90.6%) instead of '
+ 'the bare root. The remainder is manifests, JSON, markdown and fixtures the gate never '
+ 'opens, and the test files it deliberately does not read',
+ 'opens, and the test files it deliberately does not read. #14233: the declared population '
+ 'needs three hints (`.ts`/`.tsx`/`.mts`), which the SPELLINGS harness could not hold before '
+ 'it grew a multi-hint entry — the union now pins the three declared hints LIVE, PRECISE and '
+ 'COMPLETE against a plain "ends with one of these extensions" claim (5240 of 5796 tracked '
+ 'files under the bare root, re-measured 2026-09-01 — a different, wider count than the '
+ "gate's own non-test figure above, since the pin holds the raw hints' literal reach and "
+ "the gate's own test-file exclusion is not something a hint can spell)",
}],
['check:logger-receiver-detach SCAN_ROOTS examples', {
verdict: 'DECLARED-NARROWER',
spelling: 'examples TypeScript source',
why: 'same declaration, same gate: the TypeScript source under the examples root, 204 of 241 '
+ 'tracked files (84.6%), rather than the bare word. The uncovered remainder carries no '
+ 'TypeScript for this gate to read',
+ 'TypeScript for this gate to read. #14233: this root needs only the one hint the gate '
+ 'declares (`.ts`), now pinned LIVE, PRECISE and COMPLETE (206 of 243 tracked files under '
+ 'the bare root, re-measured 2026-09-01)',
}],
['check:logger-receiver-detach SCAN_ROOTS apps', {
verdict: 'DECLARED-NARROWER',
spelling: 'apps TypeScript source',
why: 'same declaration, same gate: 28 of 40 tracked files (70.0%) under the apps root, at the '
+ 'two extensions that exist there. The lowest ratio of the three and still a real '
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript',
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript. '
+ '#14233: the two declared hints (`.ts`/`.tsx`) are now pinned as one multi-hint spelling, '
+ 'LIVE, PRECISE and COMPLETE (29 of 41 tracked files under the bare root, re-measured '
+ '2026-09-01)',
}],
['check:objectql-double-limit SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
Expand DownExpand Up@@ -395,6 +475,7 @@ const TRIAGE = new Map([
}],
['check:dual-build-cjs-loads SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'dual-build manifests and configs',
why: 'the gate walks every publishable manifest under the root to find published `require` '
+ 'conditions, then reads only the dist/ those manifests point at — so the two literals it '
+ 'declares beside SCAN_ROOT under the ROOT_DIR_WATCH_HINTS idiom are the files whose '
Expand All@@ -407,10 +488,14 @@ const TRIAGE = new Map([
+ 'error this map names. The recall is not lost: the gate is a step in Build Core, a '
+ 'required context on every PR, so the omission costs one CI round trip rather than a '
+ 'missed defect. The row STAYS in the sweep because the bare root is still not covered — '
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says',
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says. '
+ "#14233: the two declared hints could not be pinned before SPELLINGS held only one per "
+ 'entry; they are now one multi-hint spelling, LIVE, PRECISE and COMPLETE against the same '
+ '74/20 split, re-measured 2026-09-01 (94 of 5796 tracked files under the bare root)',
}],
['check:ratchet-remedy-authority SCRIPTS_DIR scripts', {
verdict: 'DECLARED-NARROWER',
spelling: 'scripts top-level script files',
why: 'RE-DECIDED 2026-09-01 (#13813) from REFUSE-UNSPELLABLE, whose stated reason — "the idiom '
+ 'has no non-recursive spelling" — was TRUE when written and is FALSE of this tree. It '
+ 'rested on the deletion-collapse: a glob carrying a literal SUFFIX in the final segment '
Expand All@@ -424,17 +509,22 @@ const TRIAGE = new Map([
+ 'The gate now declares ONE hint per admitted extension beside SCRIPTS_DIR under the '
+ 'ROOT_DIR_WATCH_HINTS idiom, and the pair is SET-EQUAL to that walk in both directions — '
+ '183 of 183, nothing read left uncovered, nothing covered left unread — so 100% precise '
+ 'and complete. ⛔ NO `spelling` is recorded and that is deliberate, not an omission: '
+ 'SPELLINGS holds ONE hint per entry and this population needs one per extension, the same '
+ 'shape as the check:logger-receiver-detach and check:dual-build-cjs-loads rows above, so '
+ 'the liveness-and-precision coupling is held in the gate own --self-test, which pins the '
+ 'hints against SCRIPTS_DIR and CORPUS_EXTENSIONS and refuses both the subtree spelling and '
+ 'the brace form its own messages print. The consumer is MEASURED, not argued: before this, '
+ 'the derivation placed this family in the residue undetermined bucket, absent from the '
+ 'matched list a brief prints, and a PR that ran its whole derived family green locally '
+ 'lost a CI round to this gate. The row STAYS in the sweep because the bare root is still '
+ 'not covered — no arbitrary file at the top of the root is reached, and no nested script '
+ 'at any depth — which is what this verdict says and is correct, not outstanding debt',
+ 'and complete. The coupling described above was, at the time this row was decided, held '
+ "only in the gate's own --self-test (which pins the hints against SCRIPTS_DIR and "
+ 'CORPUS_EXTENSIONS and refuses both the subtree spelling and the brace form its own '
+ 'messages print), because SPELLINGS held ONE hint per entry and this population needs one '
+ 'per extension — the same shape as the check:logger-receiver-detach and '
+ 'check:dual-build-cjs-loads rows above, and the gap #14233 measured and closed: SPELLINGS '
+ 'now holds a LIST of segment arrays, so the pair is pinned HERE too, LIVE, PRECISE and '
+ 'COMPLETE (183 of 310 tracked files under the bare root, matching the gate own walk exactly, '
+ "re-measured 2026-09-01) — the gate's own pin and this one now independently corroborate "
+ 'the same declaration rather than only one of them re-measuring it. The consumer is '
+ 'MEASURED, not argued: before this, the derivation placed this family in the residue '
+ 'undetermined bucket, absent from the matched list a brief prints, and a PR that ran its '
+ 'whole derived family green locally lost a CI round to this gate. The row STAYS in the '
+ 'sweep because the bare root is still not covered — no arbitrary file at the top of the '
+ 'root is reached, and no nested script at any depth — which is what this verdict says and '
+ 'is correct, not outstanding debt',
}],
// ── Refused: the population is the whole root, and the root is saturated ──
['check:skill-identifier-liveness IMPL_ROOTS packages', {
Expand DownExpand Up@@ -1115,12 +1205,15 @@ function selfTest() {

for (const name of [...usedSpellings].sort()) {
const { segments, claim, holds } = SPELLINGS.get(name);
const hint = segments.join('/');
const covered = files.filter((f) => hintCovers(hint, f));
// A multi-hint entry's `hintCovers` reach is the UNION of its members —
// asked of every hint in turn, never collapsed into one string first
// (there is no glob idiom that would spell "either of these two globs").
const hints = hintsOf(segments).map((s) => s.join('/'));
const covered = files.filter((f) => hints.some((hint) => hintCovers(hint, f)));
const over = covered.filter((f) => !holds(seg(f)));
const claimed = files.filter((f) => holds(seg(f)));
const under = claimed.filter((f) => !hintCovers(hint, f));
const rootFiles = files.filter((f) => seg(f)[0] === segments[0]);
const under = claimed.filter((f) => !hints.some((hint) => hintCovers(hint, f)));
const rootFiles = files.filter((f) => seg(f)[0] === hintsOf(segments)[0][0]);
t(`the spelling recorded as "${name}" is LIVE — hintCovers reaches ${covered.length} tracked `
+ `file(s) with it, so no record below names a hint that covers nothing`, covered.length > 0);
t(`…and it is PRECISE: every file hintCovers admits for "${name}" (${claim}) satisfies that `
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 114 additions & 21 deletions scripts/pm/bare-root-worklist.mjs
Original file line numberDiff line numberDiff line change
Expand Up@@ -243,6 +243,18 @@ const POPULATION_CONSTANT = /^(?:[A-Z0-9_]*_ROOTS?|[A-Z0-9_]*_DIRS?|POPULATION|[
* this file's own hint set and hand a reporting tool a population it does not
* read, which the self-test refuses in as many words.
*
* An entry's `segments` records either ONE hint (a flat array of path
* segments, as above) or SEVERAL (a LIST of segment arrays) — #14233's
* addition, for a gate whose declared population is spelled as more than one
* glob (one hint per extension, or one per file kind at the same root). A
* multi-hint entry's `hintCovers` reach is the UNION of its members, asked of
* every hint in turn; its `holds` is written to accept whatever any member
* covers, since the two-sided pin below (LIVE/PRECISE/COMPLETE/NARROWING)
* still runs over that union. Every hint of a multi-hint entry is required to
* share one root — the sweep below has exactly one denominator per entry, not
* one per hint — and that is verified per entry when the row is written, not
* pinned mechanically here (see the five rows #14233 added).
*
* `holds` is the spelling's claim written INDEPENDENTLY of `hintCovers` — a
* plain segment test a reader can check by eye. It is not a copy of the matcher:
* `hintCovers` reaches its answer through `globInNonFinalSegment`,
Expand DownExpand Up@@ -305,12 +317,66 @@ const SPELLINGS = new Map([
claim: "every file inside a skill's references folder, at any depth",
holds: (s) => s[0] === 'skills' && s.length >= 4 && s[2] === 'references',
}],
// ── Multi-hint entries (#14233) — a gate whose declared population is more
// than one glob at the same root. `holds` accepts whatever any member hint
// covers; see `hintsOf` and the pin loop below for how the union is asked.
['packages TypeScript source', {
segments: [
['packages', '**', '*.ts'],
['packages', '**', '*.tsx'],
['packages', '**', '*.mts'],
],
claim: 'every `.ts`, `.tsx` or `.mts` file at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& ['.ts', '.tsx', '.mts'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['examples TypeScript source', {
segments: ['examples', '**', '*.ts'],
claim: 'every `.ts` file at any depth under the examples root',
holds: (s) => s[0] === 'examples' && s.length >= 2 && s[s.length - 1].endsWith('.ts'),
}],
['apps TypeScript source', {
segments: [
['apps', '**', '*.ts'],
['apps', '**', '*.tsx'],
],
claim: 'every `.ts` or `.tsx` file at any depth under the apps root',
holds: (s) => s[0] === 'apps' && s.length >= 2
&& ['.ts', '.tsx'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['dual-build manifests and configs', {
segments: [
['packages', '**', 'package.json'],
['packages', '**', 'tsup.config.ts'],
],
claim: 'every workspace manifest or tsup config at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& (s[s.length - 1] === 'package.json' || s[s.length - 1] === 'tsup.config.ts'),
}],
['scripts top-level script files', {
segments: [
['scripts', '*.mjs'],
['scripts', '*.mts'],
],
claim: 'every `.mjs` or `.mts` file directly under the scripts root (non-recursive)',
holds: (s) => s.length === 2 && s[0] === 'scripts'
&& (s[1].endsWith('.mjs') || s[1].endsWith('.mts')),
}],
]);

/** The recorded spelling, assembled. Never a literal — see `SPELLINGS`. */
/**
* Normalises a `SPELLINGS` entry's `segments` to a LIST of segment arrays,
* whether it records one hint (a flat array) or several (already a list) —
* distinguished by whether the first element is itself an array. #14233.
*/
function hintsOf(segments) {
return Array.isArray(segments[0]) ? segments : [segments];
}

/** The recorded spelling(s), assembled. Never a literal — see `SPELLINGS`. */
export function spellingOf(name) {
const s = SPELLINGS.get(name);
return s ? s.segments.join('/') : null;
return s ? hintsOf(s.segments).map((seg) => seg.join('/')).join(' | ') : null;
}

const TRIAGE = new Map([
Expand All@@ -322,22 +388,36 @@ const TRIAGE = new Map([
}],
['check:logger-receiver-detach SCAN_ROOTS packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'packages TypeScript source',
why: 'the population is the non-test TypeScript source under the root, declared beside the '
+ 'constant at the three live extensions (4968 of 5485 tracked files, 90.6%) instead of '
+ 'the bare root. The remainder is manifests, JSON, markdown and fixtures the gate never '
+ 'opens, and the test files it deliberately does not read',
+ 'opens, and the test files it deliberately does not read. #14233: the declared population '
+ 'needs three hints (`.ts`/`.tsx`/`.mts`), which the SPELLINGS harness could not hold before '
+ 'it grew a multi-hint entry — the union now pins the three declared hints LIVE, PRECISE and '
+ 'COMPLETE against a plain "ends with one of these extensions" claim (5240 of 5796 tracked '
+ 'files under the bare root, re-measured 2026-09-01 — a different, wider count than the '
+ "gate's own non-test figure above, since the pin holds the raw hints' literal reach and "
+ "the gate's own test-file exclusion is not something a hint can spell)",
}],
['check:logger-receiver-detach SCAN_ROOTS examples', {
verdict: 'DECLARED-NARROWER',
spelling: 'examples TypeScript source',
why: 'same declaration, same gate: the TypeScript source under the examples root, 204 of 241 '
+ 'tracked files (84.6%), rather than the bare word. The uncovered remainder carries no '
+ 'TypeScript for this gate to read',
+ 'TypeScript for this gate to read. #14233: this root needs only the one hint the gate '
+ 'declares (`.ts`), now pinned LIVE, PRECISE and COMPLETE (206 of 243 tracked files under '
+ 'the bare root, re-measured 2026-09-01)',
}],
['check:logger-receiver-detach SCAN_ROOTS apps', {
verdict: 'DECLARED-NARROWER',
spelling: 'apps TypeScript source',
why: 'same declaration, same gate: 28 of 40 tracked files (70.0%) under the apps root, at the '
+ 'two extensions that exist there. The lowest ratio of the three and still a real '
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript',
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript. '
+ '#14233: the two declared hints (`.ts`/`.tsx`) are now pinned as one multi-hint spelling, '
+ 'LIVE, PRECISE and COMPLETE (29 of 41 tracked files under the bare root, re-measured '
+ '2026-09-01)',
}],
['check:objectql-double-limit SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
Expand DownExpand Up@@ -395,6 +475,7 @@ const TRIAGE = new Map([
}],
['check:dual-build-cjs-loads SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'dual-build manifests and configs',
why: 'the gate walks every publishable manifest under the root to find published `require` '
+ 'conditions, then reads only the dist/ those manifests point at — so the two literals it '
+ 'declares beside SCAN_ROOT under the ROOT_DIR_WATCH_HINTS idiom are the files whose '
Expand All@@ -407,10 +488,14 @@ const TRIAGE = new Map([
+ 'error this map names. The recall is not lost: the gate is a step in Build Core, a '
+ 'required context on every PR, so the omission costs one CI round trip rather than a '
+ 'missed defect. The row STAYS in the sweep because the bare root is still not covered — '
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says',
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says. '
+ "#14233: the two declared hints could not be pinned before SPELLINGS held only one per "
+ 'entry; they are now one multi-hint spelling, LIVE, PRECISE and COMPLETE against the same '
+ '74/20 split, re-measured 2026-09-01 (94 of 5796 tracked files under the bare root)',
}],
['check:ratchet-remedy-authority SCRIPTS_DIR scripts', {
verdict: 'DECLARED-NARROWER',
spelling: 'scripts top-level script files',
why: 'RE-DECIDED 2026-09-01 (#13813) from REFUSE-UNSPELLABLE, whose stated reason — "the idiom '
+ 'has no non-recursive spelling" — was TRUE when written and is FALSE of this tree. It '
+ 'rested on the deletion-collapse: a glob carrying a literal SUFFIX in the final segment '
Expand All@@ -424,17 +509,22 @@ const TRIAGE = new Map([
+ 'The gate now declares ONE hint per admitted extension beside SCRIPTS_DIR under the '
+ 'ROOT_DIR_WATCH_HINTS idiom, and the pair is SET-EQUAL to that walk in both directions — '
+ '183 of 183, nothing read left uncovered, nothing covered left unread — so 100% precise '
+ 'and complete. ⛔ NO `spelling` is recorded and that is deliberate, not an omission: '
+ 'SPELLINGS holds ONE hint per entry and this population needs one per extension, the same '
+ 'shape as the check:logger-receiver-detach and check:dual-build-cjs-loads rows above, so '
+ 'the liveness-and-precision coupling is held in the gate own --self-test, which pins the '
+ 'hints against SCRIPTS_DIR and CORPUS_EXTENSIONS and refuses both the subtree spelling and '
+ 'the brace form its own messages print. The consumer is MEASURED, not argued: before this, '
+ 'the derivation placed this family in the residue undetermined bucket, absent from the '
+ 'matched list a brief prints, and a PR that ran its whole derived family green locally '
+ 'lost a CI round to this gate. The row STAYS in the sweep because the bare root is still '
+ 'not covered — no arbitrary file at the top of the root is reached, and no nested script '
+ 'at any depth — which is what this verdict says and is correct, not outstanding debt',
+ 'and complete. The coupling described above was, at the time this row was decided, held '
+ "only in the gate's own --self-test (which pins the hints against SCRIPTS_DIR and "
+ 'CORPUS_EXTENSIONS and refuses both the subtree spelling and the brace form its own '
+ 'messages print), because SPELLINGS held ONE hint per entry and this population needs one '
+ 'per extension — the same shape as the check:logger-receiver-detach and '
+ 'check:dual-build-cjs-loads rows above, and the gap #14233 measured and closed: SPELLINGS '
+ 'now holds a LIST of segment arrays, so the pair is pinned HERE too, LIVE, PRECISE and '
+ 'COMPLETE (183 of 310 tracked files under the bare root, matching the gate own walk exactly, '
+ "re-measured 2026-09-01) — the gate's own pin and this one now independently corroborate "
+ 'the same declaration rather than only one of them re-measuring it. The consumer is '
+ 'MEASURED, not argued: before this, the derivation placed this family in the residue '
+ 'undetermined bucket, absent from the matched list a brief prints, and a PR that ran its '
+ 'whole derived family green locally lost a CI round to this gate. The row STAYS in the '
+ 'sweep because the bare root is still not covered — no arbitrary file at the top of the '
+ 'root is reached, and no nested script at any depth — which is what this verdict says and '
+ 'is correct, not outstanding debt',
}],
// ── Refused: the population is the whole root, and the root is saturated ──
['check:skill-identifier-liveness IMPL_ROOTS packages', {
Expand DownExpand Up@@ -1115,12 +1205,15 @@ function selfTest() {

for (const name of [...usedSpellings].sort()) {
const { segments, claim, holds } = SPELLINGS.get(name);
const hint = segments.join('/');
const covered = files.filter((f) => hintCovers(hint, f));
// A multi-hint entry's `hintCovers` reach is the UNION of its members —
// asked of every hint in turn, never collapsed into one string first
// (there is no glob idiom that would spell "either of these two globs").
const hints = hintsOf(segments).map((s) => s.join('/'));
const covered = files.filter((f) => hints.some((hint) => hintCovers(hint, f)));
const over = covered.filter((f) => !holds(seg(f)));
const claimed = files.filter((f) => holds(seg(f)));
const under = claimed.filter((f) => !hintCovers(hint, f));
const rootFiles = files.filter((f) => seg(f)[0] === segments[0]);
const under = claimed.filter((f) => !hints.some((hint) => hintCovers(hint, f)));
const rootFiles = files.filter((f) => seg(f)[0] === hintsOf(segments)[0][0]);
t(`the spelling recorded as "${name}" is LIVE — hintCovers reaches ${covered.length} tracked `
+ `file(s) with it, so no record below names a hint that covers nothing`, covered.length > 0);
t(`…and it is PRECISE: every file hintCovers admits for "${name}" (${claim}) satisfies that `
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 114 additions & 21 deletions scripts/pm/bare-root-worklist.mjs
Original file line numberDiff line numberDiff line change
Expand Up@@ -243,6 +243,18 @@ const POPULATION_CONSTANT = /^(?:[A-Z0-9_]*_ROOTS?|[A-Z0-9_]*_DIRS?|POPULATION|[
* this file's own hint set and hand a reporting tool a population it does not
* read, which the self-test refuses in as many words.
*
* An entry's `segments` records either ONE hint (a flat array of path
* segments, as above) or SEVERAL (a LIST of segment arrays) — #14233's
* addition, for a gate whose declared population is spelled as more than one
* glob (one hint per extension, or one per file kind at the same root). A
* multi-hint entry's `hintCovers` reach is the UNION of its members, asked of
* every hint in turn; its `holds` is written to accept whatever any member
* covers, since the two-sided pin below (LIVE/PRECISE/COMPLETE/NARROWING)
* still runs over that union. Every hint of a multi-hint entry is required to
* share one root — the sweep below has exactly one denominator per entry, not
* one per hint — and that is verified per entry when the row is written, not
* pinned mechanically here (see the five rows #14233 added).
*
* `holds` is the spelling's claim written INDEPENDENTLY of `hintCovers` — a
* plain segment test a reader can check by eye. It is not a copy of the matcher:
* `hintCovers` reaches its answer through `globInNonFinalSegment`,
Expand DownExpand Up@@ -305,12 +317,66 @@ const SPELLINGS = new Map([
claim: "every file inside a skill's references folder, at any depth",
holds: (s) => s[0] === 'skills' && s.length >= 4 && s[2] === 'references',
}],
// ── Multi-hint entries (#14233) — a gate whose declared population is more
// than one glob at the same root. `holds` accepts whatever any member hint
// covers; see `hintsOf` and the pin loop below for how the union is asked.
['packages TypeScript source', {
segments: [
['packages', '**', '*.ts'],
['packages', '**', '*.tsx'],
['packages', '**', '*.mts'],
],
claim: 'every `.ts`, `.tsx` or `.mts` file at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& ['.ts', '.tsx', '.mts'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['examples TypeScript source', {
segments: ['examples', '**', '*.ts'],
claim: 'every `.ts` file at any depth under the examples root',
holds: (s) => s[0] === 'examples' && s.length >= 2 && s[s.length - 1].endsWith('.ts'),
}],
['apps TypeScript source', {
segments: [
['apps', '**', '*.ts'],
['apps', '**', '*.tsx'],
],
claim: 'every `.ts` or `.tsx` file at any depth under the apps root',
holds: (s) => s[0] === 'apps' && s.length >= 2
&& ['.ts', '.tsx'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['dual-build manifests and configs', {
segments: [
['packages', '**', 'package.json'],
['packages', '**', 'tsup.config.ts'],
],
claim: 'every workspace manifest or tsup config at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& (s[s.length - 1] === 'package.json' || s[s.length - 1] === 'tsup.config.ts'),
}],
['scripts top-level script files', {
segments: [
['scripts', '*.mjs'],
['scripts', '*.mts'],
],
claim: 'every `.mjs` or `.mts` file directly under the scripts root (non-recursive)',
holds: (s) => s.length === 2 && s[0] === 'scripts'
&& (s[1].endsWith('.mjs') || s[1].endsWith('.mts')),
}],
]);

/** The recorded spelling, assembled. Never a literal — see `SPELLINGS`. */
/**
* Normalises a `SPELLINGS` entry's `segments` to a LIST of segment arrays,
* whether it records one hint (a flat array) or several (already a list) —
* distinguished by whether the first element is itself an array. #14233.
*/
function hintsOf(segments) {
return Array.isArray(segments[0]) ? segments : [segments];
}

/** The recorded spelling(s), assembled. Never a literal — see `SPELLINGS`. */
export function spellingOf(name) {
const s = SPELLINGS.get(name);
return s ? s.segments.join('/') : null;
return s ? hintsOf(s.segments).map((seg) => seg.join('/')).join(' | ') : null;
}

const TRIAGE = new Map([
Expand All@@ -322,22 +388,36 @@ const TRIAGE = new Map([
}],
['check:logger-receiver-detach SCAN_ROOTS packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'packages TypeScript source',
why: 'the population is the non-test TypeScript source under the root, declared beside the '
+ 'constant at the three live extensions (4968 of 5485 tracked files, 90.6%) instead of '
+ 'the bare root. The remainder is manifests, JSON, markdown and fixtures the gate never '
+ 'opens, and the test files it deliberately does not read',
+ 'opens, and the test files it deliberately does not read. #14233: the declared population '
+ 'needs three hints (`.ts`/`.tsx`/`.mts`), which the SPELLINGS harness could not hold before '
+ 'it grew a multi-hint entry — the union now pins the three declared hints LIVE, PRECISE and '
+ 'COMPLETE against a plain "ends with one of these extensions" claim (5240 of 5796 tracked '
+ 'files under the bare root, re-measured 2026-09-01 — a different, wider count than the '
+ "gate's own non-test figure above, since the pin holds the raw hints' literal reach and "
+ "the gate's own test-file exclusion is not something a hint can spell)",
}],
['check:logger-receiver-detach SCAN_ROOTS examples', {
verdict: 'DECLARED-NARROWER',
spelling: 'examples TypeScript source',
why: 'same declaration, same gate: the TypeScript source under the examples root, 204 of 241 '
+ 'tracked files (84.6%), rather than the bare word. The uncovered remainder carries no '
+ 'TypeScript for this gate to read',
+ 'TypeScript for this gate to read. #14233: this root needs only the one hint the gate '
+ 'declares (`.ts`), now pinned LIVE, PRECISE and COMPLETE (206 of 243 tracked files under '
+ 'the bare root, re-measured 2026-09-01)',
}],
['check:logger-receiver-detach SCAN_ROOTS apps', {
verdict: 'DECLARED-NARROWER',
spelling: 'apps TypeScript source',
why: 'same declaration, same gate: 28 of 40 tracked files (70.0%) under the apps root, at the '
+ 'two extensions that exist there. The lowest ratio of the three and still a real '
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript',
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript. '
+ '#14233: the two declared hints (`.ts`/`.tsx`) are now pinned as one multi-hint spelling, '
+ 'LIVE, PRECISE and COMPLETE (29 of 41 tracked files under the bare root, re-measured '
+ '2026-09-01)',
}],
['check:objectql-double-limit SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
Expand DownExpand Up@@ -395,6 +475,7 @@ const TRIAGE = new Map([
}],
['check:dual-build-cjs-loads SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'dual-build manifests and configs',
why: 'the gate walks every publishable manifest under the root to find published `require` '
+ 'conditions, then reads only the dist/ those manifests point at — so the two literals it '
+ 'declares beside SCAN_ROOT under the ROOT_DIR_WATCH_HINTS idiom are the files whose '
Expand All@@ -407,10 +488,14 @@ const TRIAGE = new Map([
+ 'error this map names. The recall is not lost: the gate is a step in Build Core, a '
+ 'required context on every PR, so the omission costs one CI round trip rather than a '
+ 'missed defect. The row STAYS in the sweep because the bare root is still not covered — '
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says',
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says. '
+ "#14233: the two declared hints could not be pinned before SPELLINGS held only one per "
+ 'entry; they are now one multi-hint spelling, LIVE, PRECISE and COMPLETE against the same '
+ '74/20 split, re-measured 2026-09-01 (94 of 5796 tracked files under the bare root)',
}],
['check:ratchet-remedy-authority SCRIPTS_DIR scripts', {
verdict: 'DECLARED-NARROWER',
spelling: 'scripts top-level script files',
why: 'RE-DECIDED 2026-09-01 (#13813) from REFUSE-UNSPELLABLE, whose stated reason — "the idiom '
+ 'has no non-recursive spelling" — was TRUE when written and is FALSE of this tree. It '
+ 'rested on the deletion-collapse: a glob carrying a literal SUFFIX in the final segment '
Expand All@@ -424,17 +509,22 @@ const TRIAGE = new Map([
+ 'The gate now declares ONE hint per admitted extension beside SCRIPTS_DIR under the '
+ 'ROOT_DIR_WATCH_HINTS idiom, and the pair is SET-EQUAL to that walk in both directions — '
+ '183 of 183, nothing read left uncovered, nothing covered left unread — so 100% precise '
+ 'and complete. ⛔ NO `spelling` is recorded and that is deliberate, not an omission: '
+ 'SPELLINGS holds ONE hint per entry and this population needs one per extension, the same '
+ 'shape as the check:logger-receiver-detach and check:dual-build-cjs-loads rows above, so '
+ 'the liveness-and-precision coupling is held in the gate own --self-test, which pins the '
+ 'hints against SCRIPTS_DIR and CORPUS_EXTENSIONS and refuses both the subtree spelling and '
+ 'the brace form its own messages print. The consumer is MEASURED, not argued: before this, '
+ 'the derivation placed this family in the residue undetermined bucket, absent from the '
+ 'matched list a brief prints, and a PR that ran its whole derived family green locally '
+ 'lost a CI round to this gate. The row STAYS in the sweep because the bare root is still '
+ 'not covered — no arbitrary file at the top of the root is reached, and no nested script '
+ 'at any depth — which is what this verdict says and is correct, not outstanding debt',
+ 'and complete. The coupling described above was, at the time this row was decided, held '
+ "only in the gate's own --self-test (which pins the hints against SCRIPTS_DIR and "
+ 'CORPUS_EXTENSIONS and refuses both the subtree spelling and the brace form its own '
+ 'messages print), because SPELLINGS held ONE hint per entry and this population needs one '
+ 'per extension — the same shape as the check:logger-receiver-detach and '
+ 'check:dual-build-cjs-loads rows above, and the gap #14233 measured and closed: SPELLINGS '
+ 'now holds a LIST of segment arrays, so the pair is pinned HERE too, LIVE, PRECISE and '
+ 'COMPLETE (183 of 310 tracked files under the bare root, matching the gate own walk exactly, '
+ "re-measured 2026-09-01) — the gate's own pin and this one now independently corroborate "
+ 'the same declaration rather than only one of them re-measuring it. The consumer is '
+ 'MEASURED, not argued: before this, the derivation placed this family in the residue '
+ 'undetermined bucket, absent from the matched list a brief prints, and a PR that ran its '
+ 'whole derived family green locally lost a CI round to this gate. The row STAYS in the '
+ 'sweep because the bare root is still not covered — no arbitrary file at the top of the '
+ 'root is reached, and no nested script at any depth — which is what this verdict says and '
+ 'is correct, not outstanding debt',
}],
// ── Refused: the population is the whole root, and the root is saturated ──
['check:skill-identifier-liveness IMPL_ROOTS packages', {
Expand DownExpand Up@@ -1115,12 +1205,15 @@ function selfTest() {

for (const name of [...usedSpellings].sort()) {
const { segments, claim, holds } = SPELLINGS.get(name);
const hint = segments.join('/');
const covered = files.filter((f) => hintCovers(hint, f));
// A multi-hint entry's `hintCovers` reach is the UNION of its members —
// asked of every hint in turn, never collapsed into one string first
// (there is no glob idiom that would spell "either of these two globs").
const hints = hintsOf(segments).map((s) => s.join('/'));
const covered = files.filter((f) => hints.some((hint) => hintCovers(hint, f)));
const over = covered.filter((f) => !holds(seg(f)));
const claimed = files.filter((f) => holds(seg(f)));
const under = claimed.filter((f) => !hintCovers(hint, f));
const rootFiles = files.filter((f) => seg(f)[0] === segments[0]);
const under = claimed.filter((f) => !hints.some((hint) => hintCovers(hint, f)));
const rootFiles = files.filter((f) => seg(f)[0] === hintsOf(segments)[0][0]);
t(`the spelling recorded as "${name}" is LIVE — hintCovers reaches ${covered.length} tracked `
+ `file(s) with it, so no record below names a hint that covers nothing`, covered.length > 0);
t(`…and it is PRECISE: every file hintCovers admits for "${name}" (${claim}) satisfies that `
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 114 additions & 21 deletions scripts/pm/bare-root-worklist.mjs
Original file line numberDiff line numberDiff line change
Expand Up@@ -243,6 +243,18 @@ const POPULATION_CONSTANT = /^(?:[A-Z0-9_]*_ROOTS?|[A-Z0-9_]*_DIRS?|POPULATION|[
* this file's own hint set and hand a reporting tool a population it does not
* read, which the self-test refuses in as many words.
*
* An entry's `segments` records either ONE hint (a flat array of path
* segments, as above) or SEVERAL (a LIST of segment arrays) — #14233's
* addition, for a gate whose declared population is spelled as more than one
* glob (one hint per extension, or one per file kind at the same root). A
* multi-hint entry's `hintCovers` reach is the UNION of its members, asked of
* every hint in turn; its `holds` is written to accept whatever any member
* covers, since the two-sided pin below (LIVE/PRECISE/COMPLETE/NARROWING)
* still runs over that union. Every hint of a multi-hint entry is required to
* share one root — the sweep below has exactly one denominator per entry, not
* one per hint — and that is verified per entry when the row is written, not
* pinned mechanically here (see the five rows #14233 added).
*
* `holds` is the spelling's claim written INDEPENDENTLY of `hintCovers` — a
* plain segment test a reader can check by eye. It is not a copy of the matcher:
* `hintCovers` reaches its answer through `globInNonFinalSegment`,
Expand DownExpand Up@@ -305,12 +317,66 @@ const SPELLINGS = new Map([
claim: "every file inside a skill's references folder, at any depth",
holds: (s) => s[0] === 'skills' && s.length >= 4 && s[2] === 'references',
}],
// ── Multi-hint entries (#14233) — a gate whose declared population is more
// than one glob at the same root. `holds` accepts whatever any member hint
// covers; see `hintsOf` and the pin loop below for how the union is asked.
['packages TypeScript source', {
segments: [
['packages', '**', '*.ts'],
['packages', '**', '*.tsx'],
['packages', '**', '*.mts'],
],
claim: 'every `.ts`, `.tsx` or `.mts` file at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& ['.ts', '.tsx', '.mts'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['examples TypeScript source', {
segments: ['examples', '**', '*.ts'],
claim: 'every `.ts` file at any depth under the examples root',
holds: (s) => s[0] === 'examples' && s.length >= 2 && s[s.length - 1].endsWith('.ts'),
}],
['apps TypeScript source', {
segments: [
['apps', '**', '*.ts'],
['apps', '**', '*.tsx'],
],
claim: 'every `.ts` or `.tsx` file at any depth under the apps root',
holds: (s) => s[0] === 'apps' && s.length >= 2
&& ['.ts', '.tsx'].some((ext) => s[s.length - 1].endsWith(ext)),
}],
['dual-build manifests and configs', {
segments: [
['packages', '**', 'package.json'],
['packages', '**', 'tsup.config.ts'],
],
claim: 'every workspace manifest or tsup config at any depth under the packages root',
holds: (s) => s[0] === 'packages' && s.length >= 2
&& (s[s.length - 1] === 'package.json' || s[s.length - 1] === 'tsup.config.ts'),
}],
['scripts top-level script files', {
segments: [
['scripts', '*.mjs'],
['scripts', '*.mts'],
],
claim: 'every `.mjs` or `.mts` file directly under the scripts root (non-recursive)',
holds: (s) => s.length === 2 && s[0] === 'scripts'
&& (s[1].endsWith('.mjs') || s[1].endsWith('.mts')),
}],
]);

/** The recorded spelling, assembled. Never a literal — see `SPELLINGS`. */
/**
* Normalises a `SPELLINGS` entry's `segments` to a LIST of segment arrays,
* whether it records one hint (a flat array) or several (already a list) —
* distinguished by whether the first element is itself an array. #14233.
*/
function hintsOf(segments) {
return Array.isArray(segments[0]) ? segments : [segments];
}

/** The recorded spelling(s), assembled. Never a literal — see `SPELLINGS`. */
export function spellingOf(name) {
const s = SPELLINGS.get(name);
return s ? s.segments.join('/') : null;
return s ? hintsOf(s.segments).map((seg) => seg.join('/')).join(' | ') : null;
}

const TRIAGE = new Map([
Expand All@@ -322,22 +388,36 @@ const TRIAGE = new Map([
}],
['check:logger-receiver-detach SCAN_ROOTS packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'packages TypeScript source',
why: 'the population is the non-test TypeScript source under the root, declared beside the '
+ 'constant at the three live extensions (4968 of 5485 tracked files, 90.6%) instead of '
+ 'the bare root. The remainder is manifests, JSON, markdown and fixtures the gate never '
+ 'opens, and the test files it deliberately does not read',
+ 'opens, and the test files it deliberately does not read. #14233: the declared population '
+ 'needs three hints (`.ts`/`.tsx`/`.mts`), which the SPELLINGS harness could not hold before '
+ 'it grew a multi-hint entry — the union now pins the three declared hints LIVE, PRECISE and '
+ 'COMPLETE against a plain "ends with one of these extensions" claim (5240 of 5796 tracked '
+ 'files under the bare root, re-measured 2026-09-01 — a different, wider count than the '
+ "gate's own non-test figure above, since the pin holds the raw hints' literal reach and "
+ "the gate's own test-file exclusion is not something a hint can spell)",
}],
['check:logger-receiver-detach SCAN_ROOTS examples', {
verdict: 'DECLARED-NARROWER',
spelling: 'examples TypeScript source',
why: 'same declaration, same gate: the TypeScript source under the examples root, 204 of 241 '
+ 'tracked files (84.6%), rather than the bare word. The uncovered remainder carries no '
+ 'TypeScript for this gate to read',
+ 'TypeScript for this gate to read. #14233: this root needs only the one hint the gate '
+ 'declares (`.ts`), now pinned LIVE, PRECISE and COMPLETE (206 of 243 tracked files under '
+ 'the bare root, re-measured 2026-09-01)',
}],
['check:logger-receiver-detach SCAN_ROOTS apps', {
verdict: 'DECLARED-NARROWER',
spelling: 'apps TypeScript source',
why: 'same declaration, same gate: 28 of 40 tracked files (70.0%) under the apps root, at the '
+ 'two extensions that exist there. The lowest ratio of the three and still a real '
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript',
+ 'narrowing — the uncovered dozen are config and content files, none of them TypeScript. '
+ '#14233: the two declared hints (`.ts`/`.tsx`) are now pinned as one multi-hint spelling, '
+ 'LIVE, PRECISE and COMPLETE (29 of 41 tracked files under the bare root, re-measured '
+ '2026-09-01)',
}],
['check:objectql-double-limit SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
Expand DownExpand Up@@ -395,6 +475,7 @@ const TRIAGE = new Map([
}],
['check:dual-build-cjs-loads SCAN_ROOT packages', {
verdict: 'DECLARED-NARROWER',
spelling: 'dual-build manifests and configs',
why: 'the gate walks every publishable manifest under the root to find published `require` '
+ 'conditions, then reads only the dist/ those manifests point at — so the two literals it '
+ 'declares beside SCAN_ROOT under the ROOT_DIR_WATCH_HINTS idiom are the files whose '
Expand All@@ -407,10 +488,14 @@ const TRIAGE = new Map([
+ 'error this map names. The recall is not lost: the gate is a step in Build Core, a '
+ 'required context on every PR, so the omission costs one CI round trip rather than a '
+ 'missed defect. The row STAYS in the sweep because the bare root is still not covered — '
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says',
+ 'no arbitrary file at the top of packages/ is reached — which is what this verdict says. '
+ "#14233: the two declared hints could not be pinned before SPELLINGS held only one per "
+ 'entry; they are now one multi-hint spelling, LIVE, PRECISE and COMPLETE against the same '
+ '74/20 split, re-measured 2026-09-01 (94 of 5796 tracked files under the bare root)',
}],
['check:ratchet-remedy-authority SCRIPTS_DIR scripts', {
verdict: 'DECLARED-NARROWER',
spelling: 'scripts top-level script files',
why: 'RE-DECIDED 2026-09-01 (#13813) from REFUSE-UNSPELLABLE, whose stated reason — "the idiom '
+ 'has no non-recursive spelling" — was TRUE when written and is FALSE of this tree. It '
+ 'rested on the deletion-collapse: a glob carrying a literal SUFFIX in the final segment '
Expand All@@ -424,17 +509,22 @@ const TRIAGE = new Map([
+ 'The gate now declares ONE hint per admitted extension beside SCRIPTS_DIR under the '
+ 'ROOT_DIR_WATCH_HINTS idiom, and the pair is SET-EQUAL to that walk in both directions — '
+ '183 of 183, nothing read left uncovered, nothing covered left unread — so 100% precise '
+ 'and complete. ⛔ NO `spelling` is recorded and that is deliberate, not an omission: '
+ 'SPELLINGS holds ONE hint per entry and this population needs one per extension, the same '
+ 'shape as the check:logger-receiver-detach and check:dual-build-cjs-loads rows above, so '
+ 'the liveness-and-precision coupling is held in the gate own --self-test, which pins the '
+ 'hints against SCRIPTS_DIR and CORPUS_EXTENSIONS and refuses both the subtree spelling and '
+ 'the brace form its own messages print. The consumer is MEASURED, not argued: before this, '
+ 'the derivation placed this family in the residue undetermined bucket, absent from the '
+ 'matched list a brief prints, and a PR that ran its whole derived family green locally '
+ 'lost a CI round to this gate. The row STAYS in the sweep because the bare root is still '
+ 'not covered — no arbitrary file at the top of the root is reached, and no nested script '
+ 'at any depth — which is what this verdict says and is correct, not outstanding debt',
+ 'and complete. The coupling described above was, at the time this row was decided, held '
+ "only in the gate's own --self-test (which pins the hints against SCRIPTS_DIR and "
+ 'CORPUS_EXTENSIONS and refuses both the subtree spelling and the brace form its own '
+ 'messages print), because SPELLINGS held ONE hint per entry and this population needs one '
+ 'per extension — the same shape as the check:logger-receiver-detach and '
+ 'check:dual-build-cjs-loads rows above, and the gap #14233 measured and closed: SPELLINGS '
+ 'now holds a LIST of segment arrays, so the pair is pinned HERE too, LIVE, PRECISE and '
+ 'COMPLETE (183 of 310 tracked files under the bare root, matching the gate own walk exactly, '
+ "re-measured 2026-09-01) — the gate's own pin and this one now independently corroborate "
+ 'the same declaration rather than only one of them re-measuring it. The consumer is '
+ 'MEASURED, not argued: before this, the derivation placed this family in the residue '
+ 'undetermined bucket, absent from the matched list a brief prints, and a PR that ran its '
+ 'whole derived family green locally lost a CI round to this gate. The row STAYS in the '
+ 'sweep because the bare root is still not covered — no arbitrary file at the top of the '
+ 'root is reached, and no nested script at any depth — which is what this verdict says and '
+ 'is correct, not outstanding debt',
}],
// ── Refused: the population is the whole root, and the root is saturated ──
['check:skill-identifier-liveness IMPL_ROOTS packages', {
Expand DownExpand Up@@ -1115,12 +1205,15 @@ function selfTest() {

for (const name of [...usedSpellings].sort()) {
const { segments, claim, holds } = SPELLINGS.get(name);
const hint = segments.join('/');
const covered = files.filter((f) => hintCovers(hint, f));
// A multi-hint entry's `hintCovers` reach is the UNION of its members —
// asked of every hint in turn, never collapsed into one string first
// (there is no glob idiom that would spell "either of these two globs").
const hints = hintsOf(segments).map((s) => s.join('/'));
const covered = files.filter((f) => hints.some((hint) => hintCovers(hint, f)));
const over = covered.filter((f) => !holds(seg(f)));
const claimed = files.filter((f) => holds(seg(f)));
const under = claimed.filter((f) => !hintCovers(hint, f));
const rootFiles = files.filter((f) => seg(f)[0] === segments[0]);
const under = claimed.filter((f) => !hints.some((hint) => hintCovers(hint, f)));
const rootFiles = files.filter((f) => seg(f)[0] === hintsOf(segments)[0][0]);
t(`the spelling recorded as "${name}" is LIVE — hintCovers reaches ${covered.length} tracked `
+ `file(s) with it, so no record below names a hint that covers nothing`, covered.length > 0);
t(`…and it is PRECISE: every file hintCovers admits for "${name}" (${claim}) satisfies that `
Expand Down
Loading