Skip to content

Commit 437fd47

Browse files
committed
test(scripts): type the roster wiring in the .mts gate
scripts/check-test-typecheck.mts is the one .mts file in the batch and it is reached by the root `tsc --noEmit`, so the untyped `battery()` / `registerCase()` / `floorFailure()` insertions added 7 raw errors and drifted the frozen DEBT entry for @objectstack/spec-monorepo upward (26 -> 33, measured). Typing the wiring and widening the roster to `Readonly<Record<string, number>>` puts the count back at its recorded 26 with check:type-check-debt green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Swfxm6gT9ESmjSS7pqfVw
1 parent 91cb5d0 commit 437fd47

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

scripts/check-test-typecheck.mts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ const SELF_TEST_VERDICT = 'check-test-typecheck self-test reached its verdict';
532532
// The counts are a FLOOR, not an equality — adding cases is ordinary work and
533533
// must not red. A battery BELOW its floor means cases stopped running; the
534534
// remedy is to find what stopped registering.
535-
const SELF_TEST_BATTERIES = Object.freeze({
535+
const SELF_TEST_BATTERIES: Readonly<Record<string, number>> = Object.freeze({
536536
'the cardinality-preserving control (#13470)': 1,
537537
'What a signature must and must not notice (#13470)': 4,
538538
'The ratchet-remedy authority convention (#8435)': 7,
@@ -554,12 +554,12 @@ function selfTest(): string {
554554
// `battery()` opens a battery; every assertion below is attributed to the one
555555
// most recently opened, so a section that stops running stops registering and
556556
// names ITSELF at the floor rather than going quiet.
557-
const seen = new Map();
558-
let openBattery = null;
559-
const battery = (name) => {
557+
const seen = new Map<string, number>();
558+
let openBattery: string | null = null;
559+
const battery = (name: string): void => {
560560
openBattery = name;
561561
};
562-
const registerCase = () => {
562+
const registerCase = (): void => {
563563
const b = openBattery ?? UNATTRIBUTED_BATTERY;
564564
seen.set(b, (seen.get(b) ?? 0) + 1);
565565
};
@@ -1018,7 +1018,7 @@ function selfTest(): string {
10181018
// the success line below can only be printed by a run in which the set of
10191019
// batteries that registered assertions EQUALS the set declared. A set
10201020
// difference names WHICH battery stopped; a count says only that something did.
1021-
const floorFailure = (message) => {
1021+
const floorFailure = (message: string): void => {
10221022
failures.push(message);
10231023
};
10241024
const declaredBatteries = Object.keys(SELF_TEST_BATTERIES);

0 commit comments

Comments
 (0)