From e07e9b00878d4513f0b3781736298fd8311bdce2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 30 Aug 2026 06:44:20 +0000 Subject: [PATCH 1/2] test(rest): drop rest.test.ts's unused RouteGroupBuilder import and re-record the ledger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `@objectstack/rest` test-layer ledger held 4 errors for `src/rest.test.ts`, fenced until PR #12421 landed. Measured, exactly one of the four is reachable by an annotation-only repair: src/rest.test.ts(5,24) TS6133 'RouteGroupBuilder' is declared but its value is never read src/rest.test.ts(1267,26) TS2345 Buffer vs exceljs' own module-local Buffer src/rest.test.ts(2064,7) TS2345 request literal missing IHttpRequest's headers/method/path src/rest.test.ts(2089,7) TS2345 request literal missing IHttpRequest's headers/method/path Only the TS6133 is repaired here: the import specifier is unused (one occurrence in the file, the import itself; `RouteManager` beside it has 13). Removing it changes no emitted JavaScript. The other three are stopped and reported, not forced. The two TS2345 request literals are the same class as the two already out of scope on this card — they need the fixture's data, not its annotation, and the durable answer is a typed IHttpRequest builder. The exceljs one is a third-party declaration defect and its only in-repo answer today is `as any`, which this card forbids. Ledger regenerated with `pnpm --filter @objectstack/rest gen:test-typecheck-debt`, never hand-edited: src/rest.test.ts 4 -> 3, both other entries byte-identical, no number raised, no entry reached zero so none was deleted. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01TvqBFLRzXdSPcbusDoED9k --- packages/rest/src/rest.test.ts | 2 +- packages/rest/test-typecheck-debt.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rest/src/rest.test.ts b/packages/rest/src/rest.test.ts index 5e9b6fc378..4e2fe9ae11 100644 --- a/packages/rest/src/rest.test.ts +++ b/packages/rest/src/rest.test.ts @@ -2,7 +2,7 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; import ExcelJS from 'exceljs'; -import { RouteManager, RouteGroupBuilder } from './route-manager'; +import { RouteManager } from './route-manager'; import { RestServer, mapDataError } from './rest-server'; import { createRestApiPlugin } from './rest-api-plugin'; import type { RestApiPluginConfig } from './rest-api-plugin'; diff --git a/packages/rest/test-typecheck-debt.json b/packages/rest/test-typecheck-debt.json index 2d1c92d256..e94dc2eead 100644 --- a/packages/rest/test-typecheck-debt.json +++ b/packages/rest/test-typecheck-debt.json @@ -3,6 +3,6 @@ "entries": { "src/meta-public-book-grant.test.ts": 1, "src/rest-batch-size-cap.test.ts": 1, - "src/rest.test.ts": 4 + "src/rest.test.ts": 3 } } From 022a2a0950f647d66747386c6b7d5f9c681b9022 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 30 Aug 2026 07:41:05 +0000 Subject: [PATCH 2/2] test(rest): record in the ledger's authored _note which card holds each remaining entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The entries left in `@objectstack/rest`'s test-typecheck ledger are not annotation repairs, and two rounds on this ledger have now each had to re-measure that fact from scratch before learning it. `_note` is the field built for exactly this: unlike the generated `_comment`, it is authored, preserved verbatim, and never written by the generator. Written as card pointers rather than as readings — no TS codes, no line numbers, no counts. Those are the parts that go stale, they already live on the cards and in the PR that measured them, and a pointer expires only when the card it names closes, by which time the ledger entry is gone too. Verified rather than assumed, since preservation is the whole premise: regenerating with `pnpm --filter @objectstack/rest gen:test-typecheck-debt` leaves the file byte-identical (sha256 c88a74929f880fa55ea838c8ec8b1021ef 559a4ebf88aa0930454c30321a0e33 before and after) — `_note` unchanged, entries unchanged, `_comment` rewritten identically. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01TvqBFLRzXdSPcbusDoED9k --- packages/rest/test-typecheck-debt.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/rest/test-typecheck-debt.json b/packages/rest/test-typecheck-debt.json index e94dc2eead..cf3fc4cf3c 100644 --- a/packages/rest/test-typecheck-debt.json +++ b/packages/rest/test-typecheck-debt.json @@ -1,5 +1,6 @@ { "_comment": "Per-file tsc error debt of the @objectstack/rest TEST layer (#5286). `tsconfig.test.json` compiles `src/**/*.test.ts` — which `tsconfig.json` excludes and therefore no gate ever read — and every file below still carries errors from before that gate existed. THIS FIELD IS GENERATED: every regeneration rewrites it from scripts/check-test-typecheck.mts, and the EXACT ratchet below requires a regeneration on every repair — so an edit made here is gone by the next one. Anything true of THIS package goes in the sibling `_note` field, which is authored, is preserved verbatim, and is never written by the generator (#12624). This comment states NO cause for the errors, deliberately: the classes differ per package and per file, they move as the debt is paid down, and a cause written here is rewritten verbatim into every ledger by every regeneration — so it outlives its own repair and cannot be corrected in the file where it is read. Measure instead, before repairing anything: `tsc --noEmit --pretty false -p tsconfig.test.json` in the package prints the real classes with their TS codes. EXACT ratchet, judged by re-running tsc: a file that gains errors is red, a file that loses them is red until its number is re-recorded, a file that reaches zero is red until its entry is deleted, and a file NOT listed here may have no errors at all. Regenerate with: pnpm --filter @objectstack/rest gen:test-typecheck-debt", + "_note": "Everything still recorded here is held by its own card, and none of it is an annotation repair. #13377 holds the request literals this package builds by hand against IHttpRequest, which omit members that interface requires. #13378 holds the exceljs call whose parameter type resolves to that package's own module-local Buffer declaration rather than Node's. Repairing either one here would mean changing a fixture's data, or adding an assertion this package's paydown rules out, so these entries shrink when those cards land and not before.", "entries": { "src/meta-public-book-grant.test.ts": 1, "src/rest-batch-size-cap.test.ts": 1,