Skip to content

Commit 0e7ef84

Browse files
claude[bot]claude
andauthored
docs(tests): replace a false typecheck-script premise in four pin headers (#17303)
Four test files justified a pin's placement (or a typing choice) with the claim that the package "has no `typecheck` script (a type-check DEBT ledger entry)". Both halves are false on this tree: `@objectstack/core`, `@objectstack/runtime` and `@objectstack/service-automation` each declare a `typecheck` script ending in `check:test-typecheck`, and none of them holds an entry in `scripts/check-type-check-coverage.mjs`'s `DEBT`. Following the pattern #16738 set for the two sibling headers: delete the false premise, promote the surviving true reason, and record the correction in place so the next reader does not re-derive it. - rest/core retired-fields pair: the pin lives in `rest` because only that program resolves `@objectstack/core` to the BUILT `dist/index.d.ts`. Measured with `tsc --listFiles` on both programs: rest's contains `packages/core/dist/index.d.ts` and zero files under `packages/core/src/`; core's own test program contains `packages/core/src/plugin-loader.ts` and zero under `packages/core/dist/`. - runtime's quickjs `ctx.crypto` pin is executable because the defect was a member declared on the host seam and never installed, so a type-level assertion reads the artefact that lied. Its file IS in the program #14504's `tsconfig.test.json` defines, so a directive there would be live. - service-automation's `FlowTrigger` typing note: that package's build config carries no test exclusion, so its `tsc --noEmit` already compiles the file, and no `test-typecheck-debt.json` exists beside its test config, so the floor is zero errors rather than a shrink-only lane. Comment prose only: every changed line begins with `//`. Claude-Session: https://claude.ai/code/session_012GKcPZbMoGq7WPzKLfRBTU Co-authored-by: Claude <noreply@anthropic.com>
1 parent d2c1d19 commit 0e7ef84

4 files changed

Lines changed: 77 additions & 23 deletions

File tree

‎packages/core/src/plugin-loader.retired-fields.pin.test.ts‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,23 @@
88
// The COMPILE-TIME half — a declared `configSchema` / `hotReloadable` no
99
// longer type-checks against the published `PluginMetadata` — lives in
1010
// `packages/rest/src/plugin-metadata-retired-fields.pin.test.ts`, deliberately
11-
// NOT here: `@objectstack/core` has no `typecheck` script (type-check DEBT
12-
// ledger entry), so a `@ts-expect-error` in this package is a phantom pin no
13-
// tsc program a `typecheck` script runs would ever evaluate —
14-
// `check:type-check-coverage` refuses exactly that. The rest package's
15-
// `tsconfig.test.json` program is compiled by its `typecheck` script and reads
16-
// core's BUILT `.d.ts`, so the pin over there guards the published contract
11+
// NOT here. The rest package's `tsconfig.test.json` program is compiled by its
12+
// `typecheck` script and resolves `@objectstack/core` to core's BUILT
13+
// `dist/index.d.ts`, so the pin over there guards the published contract
1714
// itself.
15+
//
16+
// ⚠️ This used to read as though the split were forced — that
17+
// `@objectstack/core` "has no `typecheck` script (type-check DEBT ledger
18+
// entry)", making a `@ts-expect-error` here a phantom pin
19+
// `check:type-check-coverage` refuses. False on this tree in BOTH halves:
20+
// #14613 split a `tsconfig.test.json` out of the build config,
21+
// `package.json`'s `typecheck` NAMES it (via `check:test-typecheck
22+
// --project`), and this package holds no DEBT entry. A directive here WOULD be
23+
// evaluated — against `./plugin-loader.ts`, this package's own SOURCE, which
24+
// `tsc --listFiles` puts in that program alongside ZERO files under
25+
// `packages/core/dist/`. The published `.d.ts` is what these pins are about
26+
// and only the rest program reads it, which is a reason that outlives any
27+
// package's script list.
1828

1929
import { describe, it, expect } from 'vitest';
2030
import * as securityBarrel from './security/index.js';

‎packages/rest/src/plugin-metadata-retired-fields.pin.test.ts‎

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,29 @@
44
// `PluginMetadata` surface of `@objectstack/core` (#11982 `configSchema`,
55
// #12587 `hotReloadable`), recorded in ADR-0025 §3.7.
66
//
7-
// Why the pins live in THIS package: `@objectstack/core` has no `typecheck`
8-
// script (it is a type-check DEBT ledger entry), so a `@ts-expect-error` there
9-
// is a phantom pin — no tsc program a `typecheck` script runs ever evaluates
10-
// it, and `check:type-check-coverage` refuses it. This package's
11-
// `tsconfig.test.json` program IS run by its `typecheck` script
12-
// (`check:test-typecheck`, EXACT per-file ratchet: an unlisted file must stay
13-
// at zero errors), and it resolves `@objectstack/core` to the BUILT
14-
// `dist/index.d.ts` — so these directives pin the contract consumers actually
15-
// see. This package is also the retirement's worked replacement: the REST
7+
// Why the pins live in THIS package: this package's `tsconfig.test.json`
8+
// program IS run by its `typecheck` script (`check:test-typecheck`, EXACT
9+
// per-file ratchet: an unlisted file must stay at zero errors), and it
10+
// resolves `@objectstack/core` to the BUILT `dist/index.d.ts` — so these
11+
// directives pin the contract consumers actually see.
12+
//
13+
// ⚠️ NOT because core cannot compile a pin — this header used to say
14+
// `@objectstack/core` "has no `typecheck` script (it is a type-check DEBT
15+
// ledger entry)", and that is false on this tree in BOTH halves. #14613 split
16+
// a `tsconfig.test.json` out of core's build config and core's `typecheck`
17+
// NAMES it (via `check:test-typecheck --project`), so a `@ts-expect-error`
18+
// over there is compiled rather than the phantom pin
19+
// `check:type-check-coverage` refuses; and core holds no DEBT entry. What
20+
// core's program cannot do is read core's own PUBLISHED surface: it compiles
21+
// `src`, so a pin there would read `plugin-loader.ts` — the declaration —
22+
// not the `.d.ts` the build emits from it. Measured with `tsc --listFiles` on
23+
// both programs: this one contains `packages/core/dist/index.d.ts` and ZERO
24+
// files under `packages/core/src/`, while core's own test program contains
25+
// `packages/core/src/plugin-loader.ts` and ZERO under `packages/core/dist/`.
26+
// That reason is durable where the script-list one was not. Same placement as
27+
// `plugin-type-closed-set.pin.test.ts`.
28+
//
29+
// This package is also the retirement's worked replacement: the REST
1630
// server parses its own config at its own seam (#11637,
1731
// `rest-config-parse-not-cast.test.ts`) precisely because the kernel-side
1832
// validator could never run.

‎packages/runtime/src/sandbox/quickjs-runner.test.ts‎

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,27 @@ describe('QuickJSScriptRunner — L2 hook script', () => {
153153
// without also installing it.
154154

155155
it('the VM ctx.crypto exposes exactly randomUUID, under ANY grant (#4391)', async () => {
156-
// The EXECUTABLE pin, and the load-bearing one. `@objectstack/runtime` has
157-
// no `typecheck` script (it sits in the DEBT table of
158-
// scripts/check-type-check-coverage.mjs), so a type-level assertion here
159-
// would never be compiled — a dead pin reads as assurance and gives none.
160-
// This enumerates what `installCtx` actually put on the seam instead.
156+
// The EXECUTABLE pin, and the load-bearing one. It enumerates what
157+
// `installCtx` actually put on the seam, and it has to: the defect was a
158+
// member DECLARED on the host seam and never installed, so a type-level
159+
// assertion reads the declaration — the very artefact that lied — and
160+
// would have passed green on the broken tree. Only running the sandbox
161+
// observes what the VM really got. That reason outlives any package's
162+
// script list.
163+
//
164+
// ⚠️ This used to justify itself the other way round — that
165+
// `@objectstack/runtime` "has no `typecheck` script (it sits in the DEBT
166+
// table of scripts/check-type-check-coverage.mjs)", so a type-level
167+
// assertion here "would never be compiled". False on this tree in BOTH
168+
// halves: the package declares `typecheck`
169+
// (`tsc --noEmit && pnpm check:test-typecheck`) and holds no DEBT entry,
170+
// and #14504's `tsconfig.test.json` — which that script NAMES via
171+
// `check:test-typecheck --project` — puts THIS file in its program
172+
// (measured with `tsc --listFiles`). The build config still excludes
173+
// `**/*.test.ts`, which is where the old sentence came from; it stopped
174+
// being the whole story when the test layer got its own program. A
175+
// directive here would be LIVE, so the pin below is executable by
176+
// ARGUMENT, not for want of a compiler.
161177
//
162178
// It is deliberately exhaustive rather than `hash`-specific: the defect was
163179
// a member advertised ahead of its implementation, so ANY new member must

‎packages/services/service-automation/src/flow-trigger-kind-shared-resolver.test.ts‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,23 @@ describe('[#14328] the ARRAY-form divergence is PRESERVED, not unified away', ()
247247
// reports it verbatim and binds nothing).
248248
// Typed as the real `FlowTrigger`, NOT `… as never`: the cast erases the
249249
// contextual type for `start`, which leaves `binding` implicitly `any`
250-
// (TS7006). This package has no `typecheck` script, so its `tsc --noEmit`
251-
// runs only in the type-check DEBT lane — which compiles `src/**`, tests
252-
// included, and is a shrink-only ratchet. Same shape as `engine.test.ts`.
250+
// (TS7006) — and here that error is reported on arrival. This package's
251+
// `tsconfig.json` carries NO test exclusion (its `include` is `["src"]`),
252+
// so the `tsc --noEmit` its `typecheck` script runs already compiles this
253+
// file, and #15048's `tsconfig.test.json` — NAMED by the same script via
254+
// `check:test-typecheck --project` — compiles it too. There is no
255+
// `test-typecheck-debt.json` beside that config, and the ABSENCE is the
256+
// zero: any error in any file here is red immediately, with no entry to
257+
// be added to. Same shape as `engine.test.ts`.
258+
//
259+
// ⚠️ This used to say the package "has no `typecheck` script, so its
260+
// `tsc --noEmit` runs only in the type-check DEBT lane", a shrink-only
261+
// ratchet. False on this tree in BOTH halves: the package declares
262+
// `typecheck` (`tsc --noEmit && pnpm check:test-typecheck`) and holds no
263+
// entry in `scripts/check-type-check-coverage.mjs`'s `DEBT`. The floor
264+
// under this file is stricter than that sentence claimed, not laxer —
265+
// and the reason above is a property of the two configs, which outlives
266+
// any package's script list.
253267
const started: FlowTriggerBinding[] = [];
254268
const trigger: FlowTrigger = {
255269
type: 'record_change',

0 commit comments

Comments
 (0)