From 73062e502824fa42969bc672ef2fa95a4d8a9429 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Nov 2026 09:41:44 +0000 Subject: [PATCH] test(rest): pay the objectql load at module top in the meta write-door enumeration The record-currency backfill door's capability control was the one case in meta-write-door-capability-enumeration.test.ts that got past a gate to the door's guarded `import('@objectstack/objectql')`. That specifier resolves through `dist/`, so the first load is a cold transform of the engine's module graph, and it was paid inside the case's 5000 ms window: 3.2 s idle on 4 vCPU, and a timeout on two loaded cores 3 of 3, the Test Core (6/8) red. A module-top `import '@objectstack/objectql'` moves that load into collection, which no timeout clocks. The door's own import becomes a cache hit; the case still drives both bases and both contexts and still expects 501 NOT_IMPLEMENTED past the gate. Claude-Session: https://claude.ai/code/session_016WV4cyFzEX3mhkfxdV1M8E Co-authored-by: Claude --- .../src/meta-write-door-capability-enumeration.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/rest/src/meta-write-door-capability-enumeration.test.ts b/packages/rest/src/meta-write-door-capability-enumeration.test.ts index 76ae2b895fd..53158d4db3f 100644 --- a/packages/rest/src/meta-write-door-capability-enumeration.test.ts +++ b/packages/rest/src/meta-write-door-capability-enumeration.test.ts @@ -55,6 +55,16 @@ * already run would still be the bug and would still pass a status-only check. */ +// [#30873] Paid at module scope so the first load lands during collection, not +// inside a clocked window (`pnpm check:test-source-alias`). The `#30675` control +// at the end of this file is the one case here that gets past a gate to the +// record-currency backfill door's guarded `import('@objectstack/objectql')`, which +// resolves through `dist/` and costs a cold transform of the engine's module +// graph. Measured on 4 vCPU before this line: the import 3.2 s idle, the case +// 3.3-4.0 s idle (every other case under 20 ms) and `Test timed out in 5000ms` +// 3 of 3 on two loaded cores. Loaded here, the door's import is a cache hit. +import '@objectstack/objectql'; + import { describe, it, expect, vi, beforeEach } from 'vitest'; import { ANONYMOUS_DENY_CODE, ANONYMOUS_DENY_STATUS } from '@objectstack/core'; import { RestServer } from './rest-server.js';