Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -118,6 +118,9 @@ judged on the **shallowest** point a path reaches, not where it ends — a liter
climbs past the package root and then descends into a sibling ends at a positive depth
while addressing another package entirely.

Clocked windows measure behaviour, never loading — a test that boots a real plugin chain
pays its first load at module top; `pnpm check:test-source-alias` gates it.

### Running the dev server

| Scenario | Command | Notes |
Expand Down
7 changes: 7 additions & 0 deletions examples/app-crm/test/smoke.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,13 @@ import { describe, it, expect } from 'vitest';
import stack from '../objectstack.config.js';
import { PipelineDashboard } from '../src/dashboards/pipeline.dashboard.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/spec/ui';

describe('app-crm minimal metadata bundle', () => {
it('exposes the expected manifest', () => {
// `manifest` is optional on the stack bundle type; this example always
Expand Down
7 changes: 7 additions & 0 deletions examples/embed-objectql/test/embed.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,13 @@
import { describe, it, expect } from 'vitest';
import { runEmbeddedEngine } from '../src/index.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/objectql/core';

describe('embed @objectstack/objectql/core (ADR-0076)', () => {
it('runs the engine standalone and round-trips CRUD via the lean entry', async () => {
const active = await runEmbeddedEngine();
Expand Down
15 changes: 10 additions & 5 deletions packages/cli/src/commands/dev-default-db.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,16 +12,21 @@
* cross-command agreement is pinned by `unified-db-resolution.pin.test.ts`.
*/

import { describe, it, expect, beforeAll, beforeEach, afterEach } from 'vitest';
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import path from 'path';
import { resolveDevDatabase } from './dev.js';

// The dev seam lazy-imports @objectstack/runtime (oclif startup weight, #5726);
// the FIRST import cold-loads that graph and can exceed vitest's 5s default on
// a cold worker — warm it once, like standalone-stack.test.ts's BOOT_TIMEOUT.
beforeAll(async () => { await import('@objectstack/runtime'); }, 60_000);
// [#10126] The dev seam lazy-imports @objectstack/runtime (oclif startup weight,
// #5726), and the FIRST import cold-loads that whole graph. This file used to warm
// it in a `beforeAll` with a 60s budget; a hook is still a CLOCKED window, and any
// budget the cost is moved INTO can be exhausted by a heavier shard — which is how
// #10115 / PR #10120 ejected a file from the merge queue four times in one night.
// A module-top side-effect import pays the transform during COLLECTION instead, and
// vitest clocks hooks and test bodies only. See `scripts/check-test-source-alias.mjs`
// (the clocked-window rule), which now gates this shape.
import '@objectstack/runtime';

let cwd: string;
beforeEach(() => { cwd = mkdtempSync(path.join(tmpdir(), 'os-dev-db-')); });
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -55,6 +55,13 @@ import Doctor, {
installedPackageLedgerSkippedEntriesCheck,
} from './doctor.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/cloud-connection';

const HERE = path.dirname(fileURLToPath(import.meta.url));
/** `packages/cli` — the oclif root the real command is loaded against below. */
const CLI_ROOT = path.resolve(HERE, '..', '..');
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,6 +69,13 @@ import { fileURLToPath } from 'node:url';

import Doctor from './doctor.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/cloud-connection';

const HERE = path.dirname(fileURLToPath(import.meta.url));
/** `packages/cli` — the oclif root the real command is loaded against below. */
const CLI_ROOT = path.resolve(HERE, '..', '..');
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/src/commands/doctor-ledger-read-failure.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -93,6 +93,13 @@ import Doctor, {
installedPackageLedgerReaderFailureCheck,
} from './doctor.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/cloud-connection';

const HERE = path.dirname(fileURLToPath(import.meta.url));
/** `packages/cli` — the oclif root the real command is loaded against below. */
const CLI_ROOT = path.resolve(HERE, '..', '..');
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,6 +47,14 @@ import { SqlDriver } from '@objectstack/driver-sql';
import { GLOBAL_TENANT, SEQUENCES_TABLE, ORGANIZATION_TABLE } from '@objectstack/metadata-protocol';
import { bootSchemaStack } from './schema-migrate.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/objectql';
import '@objectstack/runtime';

const ORG_ID = 'org_x';
/** The `__global__` counter the seed loader ran ahead to before the org existed. */
const SEEDED_LAST_VALUE = 38;
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/test/serve-marketplace-offline-install.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,6 +31,13 @@
import { describe, expect, it } from 'vitest';
import Serve from '../src/commands/serve.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/cloud-connection';

/** Minimal stand-in for a loaded plugin: what the resolver actually reads. */
function plugin(name: string, ctorName: string): { name: string } {
const Ctor = { [ctorName]: class { name: string; constructor(n: string) { this.name = n; } } }[ctorName]!;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,13 @@ import { join } from 'node:path';
import { tmpdir } from 'node:os';
import Serve from '../src/commands/serve.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/cloud-connection';

interface RouteRecord { method: string; path: string }

interface HonoShapedApp {
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -106,6 +106,13 @@ import { zodIssuesToFields } from '@objectstack/spec/api';
// calls: `saveMetaItem`'s 422 (#5364) and `computeMetadataDiagnostics` (#5598).
import { zodIssuesToMetadataIssues } from './protocol.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/spec/shared';

// ---------------------------------------------------------------------------
// Normalisation: the projection all three walks can be read as producing.
// ---------------------------------------------------------------------------
Expand Down
8 changes: 8 additions & 0 deletions packages/objectql/src/engine-write-not-found-gate.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -73,6 +73,14 @@ import { ObjectQL } from './engine.js';
import { bindHooksToEngine } from './hook-binder.js';
import type { Hook, ServiceObject } from '@objectstack/spec/data';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/core';
import '@objectstack/metadata-protocol';

const silentLogger = { debug: () => {}, info: () => {}, warn: () => {}, error: () => {} };

/**
Expand Down
7 changes: 7 additions & 0 deletions packages/objectql/src/validation/rule-validator.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,13 @@ import {
} from './rule-validator.js';
import { ValidationError } from './record-validator.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/spec';

// B2 — field-level conditional rules (CEL over `record`).
const invoiceFields = {
fields: {
Expand Down
7 changes: 7 additions & 0 deletions packages/qa/dogfood/test/storage-growth.dogfood.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,6 +26,13 @@ import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import { bootStack, type VerifyStack } from '@objectstack/verify';
import showcaseStack from '@objectstack/example-showcase';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/driver-sql';

const DAY_MS = 86_400_000;

interface EngineLike {
Expand Down
7 changes: 7 additions & 0 deletions packages/rest/src/public-form-routes.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,13 @@
import { describe, it, expect, vi } from 'vitest';
import { RestServer } from './rest-server';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/spec/ui';

function mockServer() {
return {
get: vi.fn(), post: vi.fn(), put: vi.fn(), delete: vi.fn(), patch: vi.fn(),
Expand Down
9 changes: 9 additions & 0 deletions packages/runtime/src/datasource-autoconnect.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,6 +28,15 @@ import { DriverPlugin } from './driver-plugin.js';
import { AppPlugin } from './app-plugin.js';
import type { DatasourceConnectPolicy } from '@objectstack/service-datasource';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/driver-sql';
import '@objectstack/objectql';
import '@objectstack/service-datasource';

const BOOT_TIMEOUT = 60_000;

/** The host's default driver — sqlite `:memory:`, constructed the canonical way. */
Expand Down
9 changes: 9 additions & 0 deletions packages/runtime/src/datasource-visibility.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,6 +26,15 @@ import { Runtime } from './runtime.js';
import { DriverPlugin } from './driver-plugin.js';
import { AppPlugin } from './app-plugin.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/driver-sqlite-wasm';
import '@objectstack/objectql';
import '@objectstack/service-datasource';

// A minimal compiled artifact carrying ONE code-defined external datasource
// (origin stamped by `defineDatasource` at compile time) plus a single object.
const ARTIFACT = {
Expand Down
9 changes: 9 additions & 0 deletions packages/runtime/src/default-datasource-plugin.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,6 +12,15 @@ import { Runtime } from './runtime.js';
import { DefaultDatasourcePlugin } from './default-datasource-plugin.js';
import { AppPlugin } from './app-plugin.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/driver-sqlite-wasm';
import '@objectstack/objectql';
import '@objectstack/service-datasource';

const BOOT_TIMEOUT = 60_000;
const ENV = 'OS_ALLOW_DRIVER_CONNECT_FAILURE';

Expand Down
9 changes: 9 additions & 0 deletions packages/runtime/src/federated-boot-binding.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,6 +43,15 @@ import { Runtime } from './runtime.js';
import { DriverPlugin } from './driver-plugin.js';
import { AppPlugin } from './app-plugin.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/driver-sql';
import '@objectstack/objectql';
import '@objectstack/service-datasource';

const BOOT_TIMEOUT = 60_000;

async function makeDefaultDriver() {
Expand Down
7 changes: 7 additions & 0 deletions packages/runtime/src/http-dispatcher.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,13 @@ import { ApiErrorSchema } from '@objectstack/spec/api';
import type { ConnectorDescriptor } from '@objectstack/spec/integration';
import type { IAuthService, IAutomationService } from '@objectstack/spec/contracts';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/metadata-protocol';

/**
* [#4127] Mock-shape guard: every key must be a method the contract DECLARES.
*
Expand Down
7 changes: 7 additions & 0 deletions packages/runtime/src/standalone-stack.mysql.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,6 +32,13 @@ import {
StandaloneDatabaseDriverSchema,
} from './standalone-stack.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/service-datasource';

/** Env keys these tests write; restored after every case. */
const ENV_KEYS = [
'OS_DATABASE_URL',
Expand Down
7 changes: 7 additions & 0 deletions packages/runtime/src/standalone-stack.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,6 +43,13 @@ import { createDefaultHostConfig, resolveDefaultArtifactPath } from './default-h
// config that resolution reads correctly.
import { appDefaultPermissionSetName, appSecurityPluginOptions } from '@objectstack/plugin-security';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/service-datasource';

// A minimal `objectstack build` artifact carrying an app-declared default
// profile with a hierarchy read scope, an add-on permission set, app roles,
// plus the metadata the path already surfaced (objects/requires/manifest).
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,13 @@ import {
type DatasourceAdminServicePluginOptions,
} from '../datasource-admin-plugin.js';

// [#10126] Pay the first transform of these dist-resolved workspace deps at MODULE
// LOAD. Each is reached below through a dynamic `import()` inside an `it()` body or a
// hook -- both of which vitest clocks, while collection is clocked against nothing. See
// `scripts/check-test-source-alias.mjs` (the clocked-window rule) and #10115 / PR #10120,
// where the same shape cost 30 ejected merge-queue builds in one night.
import '@objectstack/spec/kernel';

/**
* Minimal PluginContext + in-memory metadata service. Boots the plugin and
* returns the registered `datasource-admin` service so we can exercise the
Expand Down
Loading
Loading