You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bcf4319
Browse filesBrowse the repository at this point in the historyBrowse files
test(pm): pin the clause-② test exception in dispatch-gates' self-test
The lit case (a test-only spec diff) raises no suspicion and --tier prints no
SUSPECT line; a *.zod.ts diff still does; each of the four ruled test shapes
is excepted; a mixed diff keeps its contract file; qa/testing.zod.ts stays a
suspect; the exception is the imported predicate and never drops a tracked
*.zod.ts on this tree.
Claude-Session: https://claude.ai/code/session_01A22sUB3mUWs6M36VgfijBq
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: scripts/pm/dispatch-gates.mjs
+53Lines changed: 53 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -25619,6 +25619,51 @@ function selfTest() {
25619
25619
t('a mandated surface still prints its suspect paths — the enqueue gate reads diffs, not dispatch tiers', mandatedAndSuspect.mandatory && mandatedAndSuspect.suspects.length === 1 && tierLines(mandatedAndSuspect).join('\n').includes('SUSPECT'));
25620
25620
t('a verdict built without a suspects field still renders (suspicion defaults empty)', tierLines({ mandatory: false, tier: null, hits: [], declared: 1 }).length === 3);
25621
25621
25622
+
// ── Test files under the contract surface are EXCEPTED (#19936) ──────────
25623
+
//
25624
+
// The path limb must read what the review rule reads — non-test contract
25625
+
// files — or a test-only spec PR from an off-tier seat can never enqueue.
25626
+
// Ruling 5805897677 (letter A) names the pins: a test-only spec diff shows
25627
+
// no SUSPECT line, a `*.zod.ts` diff still does, and PR #19932's one file is
25628
+
// the lit case. The shapes are the four the ruling lists; the paths are
25629
+
// judged by the pure function, so a hypothetical one decides as well as a
t('⭐ the lit case — a test-only spec diff, PR #19932\'s one file — raises NO suspicion', litTestOnly.suspects.length === 0 && !litTestOnly.mandatory, litTestOnly.suspects);
25635
+
t('…renders no SUSPECT line, and still prints the clause-② note, so the silence is not a clearance', !litRendered.includes('SUSPECT') && litRendered.includes('Clause ② is NOT reachable from paths'), litRendered);
t('⭐ a *.zod.ts contract schema is STILL a suspect and still renders the SUSPECT line', zodStill.suspects.length === 1 && tierLines(zodStill).join('\n').includes('SUSPECT'));
t('a MIXED diff keeps its contract file\'s suspicion — the exception is per path, never per diff', mixedDiff.suspects.length === 1 && mixedDiff.suspects[0].path === 'packages/spec/src/ui/view.zod.ts', mixedDiff.suspects);
25649
+
t('⛔ a contract domain whose NAME reads test-flavoured is no test: qa/testing.zod.ts stays a suspect', fableOf(['packages/spec/src/qa/testing.zod.ts']).suspects.length === 1);
25650
+
t('…while the test file beside it is excepted', fableOf(['packages/spec/src/qa/testing.test.ts']).suspects.length === 0);
25651
+
t('an input that CONTAINS the contract surface is still a suspect — the exception narrows files, never the reverse match', fableOf(['packages/spec']).suspects.length === 1);
25652
+
t('a mandate is never excepted: a test-named file under a mandated root keeps its mandate', fableOf(['skills/objectstack-data/x.test.ts']).mandatory === true);
t('the exception is the IMPORTED test-file predicate — the repo\'s own, never a respelling here', contractEntry?.except === isTestPath);
25655
+
t('…whose home is a gate script, so a card editing it derives this gate by gate-script identity', isGateScriptPath('scripts/check-undeclared-dep-imports.mjs', gateFamilyFiles()));
25656
+
t('every suspect entry that excepts carries a predicate and the reason for it', SUSPECT_TIER_GLOBS.every((g) => g.except === undefined || (typeof g.except === 'function' && typeof g.exceptWhy === 'string' && g.exceptWhy.length > 0)));
25657
+
// The subtraction held LIVE, because a subtraction fails silent: the
25658
+
// package's files[] ships every `*.zod.ts` under `src/` verbatim, so an
25659
+
// exception that dropped one would take a shipped contract off the limb.
t('the exception is live, not vacuous: it drops tracked test files on this tree, and only what the predicate names', exceptedTracked.length > 0 && exceptedTracked.every((f) => isTestPath(f)), `${exceptedTracked.length} of ${specSrcTracked.length}`);
25666
+
25622
25667
// ── The changed-line reading beside the tier verdict (2026-09-18 ruling) ──
t('over the threshold, the line says HUMAN MERGE, names the governed terminal and the landing pre-check',
@@ -26556,6 +26601,14 @@ function selfTest() {
26556
26601
t('⭐ a second catalog SKILL.md prints the same mandate', catalogAiCli.status === 0 && (catalogAiCli.stdout ?? '').includes('MANDATORY') && (catalogAiCli.stdout ?? '').includes("'skills/**'"));
t('⭐ --tier on an internal pm-dispatch references file still prints NO mandate', internalRefsCli.status === 0 && (internalRefsCli.stdout ?? '').includes('no path-derived mandate') && !(internalRefsCli.stdout ?? '').includes('MANDATORY'));
26604
+
// The clause-② test exception on the real CLI (#19936): the ruling's pins are
26605
+
// on `--tier` OUTPUT, so both acceptance paths are measured end to end. The
26606
+
// lit case goes through the asserted helper, so a later rename of that file
26607
+
// leaves the pin deciding rather than refusing as an absent path.
t('⭐ --tier on the lit case (a test-only spec diff) derives, and prints NO SUSPECT line', litTierCli.status === 0 && (litTierCli.stdout ?? '').includes('no path-derived mandate') && !(litTierCli.stdout ?? '').includes('SUSPECT'), litTierCli.stdout);
t('⭐ --tier on a *.zod.ts contract schema still prints the SUSPECT line naming it', zodTierCli.status === 0 && (zodTierCli.stdout ?? '').includes('SUSPECT') && (zodTierCli.stdout ?? '').includes('packages/spec/src/ui/view.zod.ts'), zodTierCli.stdout);
26559
26612
26560
26613
// ── The entry guard (#9757) ───────────────────────────────────────────────
0 commit comments