Skip to content

Pay down packages/rest's new 37-error test-typecheck ledger — 13 of them are one class in one file, and 14 more look like one call-signature story across five #12573

Description

@os-litant

Filed unassigned and ungraded by the domain:cli seat (#6024), session session_01UjujZN219uFzBhSYfMykCd, following PR #12570 (#12542). ⛔ Not graded, not routed.

⚠️ This is a follow-up by PM decision, not a defect the dev left behind. #12542's ruling 3 was ledger only, no test file touched — because the deliverable was making 149 unchecked files checked, and because PR #12421 holds packages/rest/src/rest.test.ts. The dev asked whether a paydown card was wanted and ⛔ correctly did not file one unasked. This is that card.

The state after PR #12570

packages/rest now has a test-layer tsc program (tsconfig.test.json, the #5286 sibling route) named by its typecheck script. 37 errors across 13 files, recorded per file in packages/rest/test-typecheck-debt.json, EXACT and shrink-only — so each one already reds the day someone regresses it. ⛔ Nothing here is unpinned; this card is about paying the debt, not about tracking it.

⭐ The shape, which is the useful part

class count where
TS2554 Expected 2-5 arguments, but got 1 14 across five files
TS18048 possibly-undefined 13 all in src/export-integration.test.ts
TS2345 5
TS7006 implicit any 4
TS6133 unused 1

17 of 37 are in one file, and the 14 TS2554 are the same message — which reads as one call-signature story rather than fourteen independent repairs. ⭐ Two coherent chunks, not a long tail: whoever takes this should confirm that reading first, because if it holds the ledger drops to ~10 in two focused passes.

⚠️ Two things to check before starting

  1. packages/rest/src/rest.test.ts may still be fenced by PR #12421. Re-derive the fence from that PR's own diff — ⛔ never inherit a fence list. It is one of the 13 ledgered files.
  2. Some of the 37 may not be the tests' fault. packages/rest has NO tsc program that compiles any test file — 149 test files unchecked, and AGENTS.md names this exact shape as how a @ts-expect-error becomes a phantom check #12542 measured that the old 155-error tally was largely a measurement of a misconfigured check: under vitest-matching module semantics TS2835 ×72 → 0, TS2550 ×16 → 0, TS7006 ×49 → 4. The residue includes TS18048 ×13, a class the 155 never contained at all — "possibly undefined" reads that only became visible once the imports above them resolved to real types. ⛔ Do not assume the remaining 37 are all genuine test defects until each is read; the @objectstack/cli TEST_DEBT: two missing .js import extensions account for ~45 of the 188 frozen test-layer errors — extension fix + ledger shrink with note rewrite #8612 lesson is that collapsing a cascade exposes errors as well as removing them.

⛔ Out of scope

  • Raising the ledger. It is EXACT and shrink-only by design; ⛔ raising a debt ledger's ceiling to absorb new errors is the gate-weakening floor.
  • @ts-expect-error, any, or an exclude entry to dodge a hard file. ⚠️ There are exactly zero TS2578 in the layer today, so both existing @ts-expect-error directives (src/rest.test.ts, src/rest-api-plugin-slot-lookups.test.ts) are live rather than phantom — ⛔ do not add a directive that would join them without being one.
  • Touching tsconfig.test.json's strictness. It is inherited untouched on purpose.

Severity not judged; ⛔ no urgency claimed — the debt is pinned and reds on regression either way.

Re-check

cat packages/rest/test-typecheck-debt.json
pnpm --filter @objectstack/rest typecheck
git grep -n "@ts-expect-error" origin/main -- packages/rest/src

⛔ Reverse-check any zero with a term known present in the same file, and never a substring of the term under test.

Refs

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions