Skip to content

Commit a9c6eac

Browse files
test(server): share repeated setup in four slow non-cli test files, budget five distinct floors (#28599)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X73hQETkXSTyG7U1jQZSGsv)_ Part of #23181 (slice 26). The card stays open: other `domain:server` files still read over 10 s (slices 24, 25, 27 and 28 hold the cli ones), and one cause found here needs a shared helper this slice may not edit (Acceptance notes). Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么**:6 个非 cli 的服务端测试文件(plugin-auth、plugin-pinyin-search、rest、verify ×2、plugin-security)。4 个文件把重复执行的相同准备工作合并成一次(cloud-managed 只注册一次三个用户再给每个用例复制数据;posture-only 三次相同启动合成一次;pinyin 三个用例共用第一次 2,500 行遍历的数据库副本;promotion-selection 每种排序只跑一遍);5 个文件加第 2 行 `// test-budget: 20` 头,因为剩下的地板是互不相同的真实工作。 - **为什么改**:卡 #23181 的测试提速职责:CI 里超过 10 s 的测试文件要么提速,要么按裁决 6181973363 B 声明预算。 - **风险与回滚**:只改测试文件,五个包的 `files[]` 都只发 `dist`、README、CHANGELOG,不发布任何东西;用例名和断言一条没删、没放宽(四个改动文件 base/head 用例名逐条一致);回滚即 revert。 - **先看**:`packages/plugins/plugin-auth/src/cloud-managed.test.ts`(`produceStagedRows` + 每例 `structuredClone` 复制);`packages/plugins/plugin-pinyin-search/src/boot-reconcile.integration.test.ts`(`beforeAll` 的首次遍历与 `fromWalked`);`packages/verify/src/harness.posture-only.test.ts`(合并的启动)。 - **两分钟验证**:`pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2 src/cloud-managed.test.ts` → 32/32 通过,文件行约 2 s(base 约 6.5 s)。 - **需要你做的**:无,席位落地。 ## What changes The six files slice 23's offender table (`pm-orders/server/evidence/23181-s23/offenders-after-s23.md`) lists outside `packages/cli`, read from the default reporter's per-file module line in the Test Core shard logs of the scheduled `ci.yml` runs `41199450735`, `41217827347`, `41237094739`, `41255489006` and `41271604267`: | file | 0735 | 7347 | 4739 | 9006 | 4267 | tests | boots / staged units, base → head | distinct | cause | fix | |:--|--:|--:|--:|--:|--:|--:|:--|--:|:--|:--| | `plugin-auth/src/cloud-managed.test.ts` | 6.9 | 19.9 | **23.6** | 15.3 | 6.8 | 32 | 14 stagings → 1 (3 fresh-salt production-scrypt sign-ups each, about 0.1 s apiece) | 1 | the same staging per case, plus 10 `#8243` cases re-run by importing `impersonation-bearer-rotation.test` | stage once in `beforeAll`; each case builds a fresh engine, `AuthManager` and mount over a `structuredClone` of the staged rows. No header (see Acceptance notes) | | `plugin-pinyin-search/src/boot-reconcile.integration.test.ts` | 12.1 | 14.1 | 10.6 | 11.8 | **15.2** | 8 | 11 kernel boots → 10; 2,500-row seeds 7 → 5; full walks 9 → 7 | first walk ×3 | the first boot over the seeded history, walked with the ledger on, repeated by three cases | that walk runs once in the describe's `beforeAll` (readings taken while it is up); the three cases boot over a copy of the database it left (`fromWalked`). Header 20 | | `rest/src/meta-draft-head-package-inheritance.test.ts` | 10.6 | 11.3 | 13.7 | 13.4 | **15.0** | 25 | 39 real-stack boots at about 12 ms (0.5 s of the file) | 25 | each case's own save/read/publish/discard sequence on the real `/meta` routes | header 20 | | `verify/src/harness.key-custody.test.ts` | **14.2** | 7.0 | 9.1 | 13.6 | 10.3 | 7 | 5 `bootStack` boots, all in hooks | 5 | each boot is its cases' subject (empty home, key file, `OS_SECRET_KEY`, restart pair) | header 20 | | `verify/src/harness.posture-only.test.ts` | **13.8** | 7.7 | 9.8 | 6.4 | 8.7 | 5 | 5 `bootStack` boots → 3 | 3 | three cases booted the same app with the same options and no posture set | one boot in a `beforeAll` takes all three cases' readings (tenancy fields and `org-scoping` while up, the posture before, during and after `stop()`). Header 20 | | `plugin-security/src/bootstrap-platform-admin-promotion-selection.test.ts` | 9.5 | 7.1 | 10.9 | **13.5** | 7.3 | 25 | 27 engine boots → 24; card-population seeds 8 → 5 | per order ×2 | the per-order cases and the same-answer case each ran the same boot + seed + promotion per natural order | one pass per order in the describe's `beforeAll`; both sets of cases read it. Header 20 | **Headers** (ruling 6181973363 letter B, class `spawns the real producer once per single-cause fixture`): N = the slowest of the five CI readings × 1.25, rounded up to 10 s; 20 for all five. Where the file also changed, the header keeps its pre-change CI reading. All five parse with `readTestBudget` (`scripts/measure-test-shard-timings.mjs`); `cloud-managed` reads `null` (no header). Not changed: no case name, assertion, timeout, tier or project; no source file; no test helper (the shared `createMemoryEngine` double, `audience-gate-test-support`, the verify harness and the security testkits are untouched). ## Tests - **A/B** (one box, one lock hold, base copied beside head as `zzbase.*`, interleaved, N=3, `--maxWorkers=1`, default reporter file line; copies deleted before the gate run): | file | base (s) | head (s) | change (mean) | |:--|:--|:--|--:| | `cloud-managed` | 7.08, 6.51, 6.03 | 2.21, 2.40, 2.15 | −65.9% (6.54 → 2.25) | | `harness.posture-only` | 6.58, 6.27, 4.94 | 4.55, 3.76, 4.11 | −29.0% (5.93 → 4.14) | | `promotion-selection` | 2.18, 2.10, 1.99 | 1.76, 1.78, 1.75 | −16.3% (2.09 → 1.76) | | `boot-reconcile.integration` | 3.89, 3.55, 3.38 | 3.05, 3.12, 3.05 | −13.6% (3.61 → 3.07) | Every run exit 0, same test counts both sides (32, 5, 25, 8). `vitest list` on base and head gives the same case names for all four files (posture-only's three cases sit one describe deeper). - **Header-only files**, run on head: `meta-draft-head-package-inheritance` 25/25, `harness.key-custody` 7/7. - `pnpm --filter PKG typecheck` (tsc + `check:test-typecheck`) exit 0 for `@objectstack/plugin-auth`, `plugin-pinyin-search`, `rest`, `verify`, `plugin-security`. - No ablation: no tested behaviour changed (test-only). ## Acceptance notes - **`cloud-managed` re-runs another file's ten cases.** It imports `createMemoryEngine` from `impersonation-bearer-rotation.test.ts`, and importing that file registers its ten `#8243` cases in the importer. On head they are about 2.3 s of the file's per-case time, against 0.85 s for its own 22 cases. 32 test files in `plugin-auth` import that double the same way, so each re-runs the same ten cases. The fix is a registration guard in that file (the shape `metadata-protocol/src/protocol.lock-one-resolution.kit.test.ts` already uses: register its suites only when it is the file under test), which is a helper shared beyond this slice's files, so it is not in this PR. That is why `cloud-managed` takes no header: its remainder is not distinct work. Carrier: #23181. - **`skip-changeset`.** Test-only. All five packages ship `files: ["dist", "README.md", "CHANGELOG.md"]`; after build, a source symbol from each package is in its `dist/` (positive control) and a fixture string from each changed test is not, so no `files[]` content changes. ## Verification All readings on head `978d4163` (two commits, then one merge of `origin/main` after slice 23, #28581, landed). - **Derived gate families:** `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` on the final head → 54 families, each run with its exit code captured before any pipe, all exit 0, after a full `pnpm exec turbo run build --concurrency=2` (the `check:dual-build-cjs-loads` and `check:i18n` prerequisites) and `git fetch --depth=1` of the commit the teardown-shape self-test names. `--ran` reconciliation: `✓ dispatch-gates --ran: 54 derived famil(ies) accounted for — 54 run, 0 NOT-MEASURED`. List: `pm-orders/server/evidence/23181-s26-gates-ran-978d4163.txt` in the project files. - **The six files on the final head:** 32/32, 8/8, 25/25, 7/7, 5/5, 25/25, every run exit 0. - **Hand gates:** `pnpm exec eslint --no-inline-config` over the six files exit 0 (none of the five packages has a `lint` script; the repo-wide `pnpm lint` is CI's); `node scripts/check-commit-card-trailers.mjs --range origin/main..HEAD` exit 0. - **CI** families (Test Core, lint farm, type-check lanes) are read off this PR's check-runs by the seat. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5kTs9zGs8tcMtB1Kys --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7449e47 commit a9c6eac

6 files changed

Lines changed: 189 additions & 87 deletions

File tree

‎packages/plugins/plugin-auth/src/cloud-managed.test.ts‎

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// SSO-only switched on there, so the narrowing is the managed mode's and not
2121
// SSO-only's.
2222

23-
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
23+
import { describe, it, expect, vi, beforeAll, beforeEach, afterEach } from 'vitest';
2424
import { Hono } from 'hono';
2525
import type { PluginContext } from '@objectstack/core';
2626
import { resetCloudManagedForTesting } from '@objectstack/core';
@@ -116,10 +116,11 @@ const makeManager = (engine: ReturnType<typeof createMemoryEngine>, extra: Recor
116116
} as any);
117117

118118
/**
119-
* One deployment, staged UNMANAGED (so its fixture users can sign up through
120-
* the invitation lane), then served through the real mount chain. The tests
121-
* switch the mode on afterwards: every door under test reads the accessor per
122-
* request.
119+
* The staged rows every door case starts from, produced ONCE for the file
120+
* (#23181): staging signs three users up, and each sign-up is a fresh-salt
121+
* production scrypt derivation, the cost that made fourteen identical
122+
* stagings the bulk of this file's wall. Staged UNMANAGED (so the fixture
123+
* users can sign up through the invitation lane), with SSO-only off.
123124
*
124125
* - `admin`: a platform admin (the legacy `role` scalar, which
125126
* `isPlatformAdminUser` accepts) and the owner of the default organization,
@@ -128,8 +129,11 @@ const makeManager = (engine: ReturnType<typeof createMemoryEngine>, extra: Recor
128129
* - `member`: an ordinary `env_native` user holding a local password.
129130
* - `idp`: an `idp_provisioned` user with no local credential, the
130131
* population the cloud's identity provider owns.
132+
*
133+
* The bearers are the sessions better-auth minted at staging; they live as
134+
* `sys_session` rows, so every copy of the tables carries them.
131135
*/
132-
async function stage() {
136+
async function produceStagedRows() {
133137
const engine = createMemoryEngine();
134138
engine.tables.set('sys_organization', [{ id: DEFAULT_ORG, name: 'Default', slug: 'default' }]);
135139
const manager = makeManager(engine);
@@ -187,6 +191,45 @@ async function stage() {
187191
users().find((r) => String(r.id) === ids.idp)!.source = 'idp_provisioned';
188192
users().find((r) => String(r.id) === ids.member)!.source = 'env_native';
189193

194+
return { tables: structuredClone(new Map(engine.tables)), ids, bearers };
195+
}
196+
197+
let staged: Awaited<ReturnType<typeof produceStagedRows>>;
198+
199+
beforeAll(async () => {
200+
const saved = { [MANAGED_ENV]: process.env[MANAGED_ENV], [SSO_ONLY_ENV]: process.env[SSO_ONLY_ENV] };
201+
setManaged(false);
202+
delete process.env[SSO_ONLY_ENV];
203+
const quiet = (['info', 'warn', 'error'] as const).map((level) =>
204+
vi.spyOn(console, level).mockImplementation(() => {}),
205+
);
206+
try {
207+
staged = await produceStagedRows();
208+
} finally {
209+
for (const spy of quiet) spy.mockRestore();
210+
for (const [key, value] of Object.entries(saved)) {
211+
if (value === undefined) delete process.env[key];
212+
else process.env[key] = value;
213+
}
214+
resetCloudManagedForTesting();
215+
}
216+
}, 120_000);
217+
218+
/**
219+
* One deployment over its OWN copy of the staged rows: a fresh engine, a fresh
220+
* `AuthManager` and a fresh mount chain per case, exactly as a per-case
221+
* staging gave, so no case sees another's writes. The tests switch the mode
222+
* on afterwards: every door under test reads the accessor per request.
223+
*/
224+
async function stage() {
225+
const engine = createMemoryEngine();
226+
for (const [name, rows] of structuredClone(staged.tables)) engine.tables.set(name, rows);
227+
const manager = makeManager(engine);
228+
const { ids, bearers } = staged;
229+
230+
const users = () => (engine.tables.get('sys_user') ?? []) as any[];
231+
const accounts = () => (engine.tables.get('sys_account') ?? []) as any[];
232+
190233
const app = new Hono();
191234
const ctx = mockCtx();
192235
const plugin = new AuthPlugin({ secret: SECRET });

‎packages/plugins/plugin-pinyin-search/src/boot-reconcile.integration.test.ts‎

Lines changed: 60 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
// test-budget: 20 — spawns the real producer once per single-cause fixture: real-kernel boots over a SQLite file holding a 2,500-row history, each remaining full walk its case's subject (the shared first walk, a write raced against a held walk, readiness against a held page, a shutdown mid-walk, the ledger-less boots, the forced rebuild); slowest CI reading 15.2 s (scheduled full-battery run 41271604267, Test Core shard log) x 1.25, rounded up; read before the three cases sharing the first walk took a copy of it
23

34
/**
45
* #25634 — the boot reconcile reads what changed, not the whole table, and
@@ -17,8 +18,8 @@
1718
* `find` for the probe object — the cost a boot actually pays.
1819
*/
1920

20-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
21-
import { mkdtempSync, rmSync } from 'node:fs';
21+
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
22+
import { copyFileSync, mkdtempSync, readdirSync, rmSync } from 'node:fs';
2223
import { tmpdir } from 'node:os';
2324
import { join } from 'node:path';
2425
import { ObjectKernel } from '@objectstack/core';
@@ -144,10 +145,12 @@ async function boot(opts: {
144145
gate?: Promise<void>;
145146
holdFrom?: number;
146147
before?: (f: FixturePlugin) => Promise<void>;
148+
/** The database file; the case's own `file` unless named. */
149+
on?: string;
147150
} = {}) {
148151
const kernel = new ObjectKernel({ logger: { level: 'silent' } });
149152
kernels.push(kernel);
150-
const fixture = new FixturePlugin(file, opts);
153+
const fixture = new FixturePlugin(opts.on ?? file, opts);
151154
const plugin = new PinyinSearchPlugin({ enabled: true });
152155
await kernel.use(new ObjectQLPlugin());
153156
await kernel.use(fixture);
@@ -180,28 +183,63 @@ function history(): Array<Record<string, unknown>> {
180183
}
181184

182185
// [#25749] Each case pays for real-kernel boots over a SQLite file (two in
183-
// most) and at least one full 2,500-row reconcile walk; the forced-rebuild
184-
// case walks twice. Idle, the slowest case takes about 1 s. On a 4-core box
186+
// most) and a full 2,500-row walk. Since #23181 the first walk three cases
187+
// share runs once, in the describe's hook; those cases boot over a copy of
188+
// what it left, and the forced-rebuild case still walks every row in its
189+
// explicit rebuild. Idle, the slowest case took about 1 s. On a 4-core box
185190
// with 20 busy loops the boots and walks alone took 6.8 s and 10.1 s (seed
186191
// excluded), past vitest's 5 s default, so the suite carries its own budget.
187192
describe('#25634 the boot reconcile reads what changed since its last completed walk', { timeout: 30_000 }, () => {
193+
// [#23181] The first boot over the 2,500-row history, walked to completion
194+
// with the ledger on, is the same setup in three cases. It runs ONCE, here,
195+
// and its readings are taken while it is up; each of those cases then boots
196+
// over its own copy of the database that walk left (`fromWalked`).
197+
let walkedDir: string;
198+
let walked: string;
199+
let firstReads: Reads;
200+
let firstCjkSearch: unknown;
201+
let firstLatinSearch: unknown;
202+
let firstReceipt: any;
203+
204+
beforeAll(async () => {
205+
vi.stubEnv('OS_SEARCH_PINYIN_ENABLED', 'true');
206+
walkedDir = mkdtempSync(join(tmpdir(), 'pinyin-reconcile-walked-'));
207+
walked = join(walkedDir, 'db.sqlite');
208+
const first = await boot({ on: walked, before: (f) => f.directInsert(history()) });
209+
try {
210+
await first.plugin.whenReconciled();
211+
firstReads = { ...first.fixture.reads };
212+
firstCjkSearch = (await first.fixture.row('p00010'))?.__search;
213+
firstLatinSearch = (await first.fixture.row('p00011'))?.__search ?? null;
214+
firstReceipt = await first.fixture.engine.findOne('sys_migration', {
215+
where: { id: SEARCH_COMPANION_RECONCILE_MIGRATION_ID }, context: SYSTEM,
216+
});
217+
} finally {
218+
await shutdown(first.kernel);
219+
vi.unstubAllEnvs();
220+
}
221+
}, 30_000);
222+
223+
afterAll(() => {
224+
rmSync(walkedDir, { recursive: true, force: true });
225+
});
226+
227+
/** This case's database becomes a copy of the one the first walk left. */
228+
function fromWalked(): void {
229+
for (const name of readdirSync(walkedDir)) copyFileSync(join(walkedDir, name), join(dir, name));
230+
}
231+
188232
it('a first boot walks every row; an unchanged second boot reads none — and a receipt sits in sys_migration', async () => {
189-
const first = await boot({ before: (f) => f.directInsert(history()) });
190-
await first.plugin.whenReconciled();
191-
const firstReads = { ...first.fixture.reads };
192233
expect(firstReads.rows).toBe(ROWS);
193234
expect(firstReads.queries).toBe(Math.ceil(ROWS / PAGE));
194235
// The walk did its job: a CJK history row now carries its companion.
195-
expect((await first.fixture.row('p00010'))?.__search).toBe('zhangwei10 zw10');
196-
expect((await first.fixture.row('p00011'))?.__search ?? null).toBeNull();
197-
const receipt: any = await first.fixture.engine.findOne('sys_migration', {
198-
where: { id: SEARCH_COMPANION_RECONCILE_MIGRATION_ID }, context: SYSTEM,
199-
});
200-
expect(receipt?.blocking).toBe(0);
201-
expect(receipt?.verified_at ?? null).toBeNull();
202-
expect(JSON.parse(receipt.details).objects[PROBE].sources).toEqual(['title']);
203-
await shutdown(first.kernel);
236+
expect(firstCjkSearch).toBe('zhangwei10 zw10');
237+
expect(firstLatinSearch).toBeNull();
238+
expect(firstReceipt?.blocking).toBe(0);
239+
expect(firstReceipt?.verified_at ?? null).toBeNull();
240+
expect(JSON.parse(firstReceipt.details).objects[PROBE].sources).toEqual(['title']);
204241

242+
fromWalked();
205243
const second = await boot();
206244
await second.plugin.whenReconciled();
207245
// THE PIN: the unchanged table is not read again — one filtered query
@@ -212,10 +250,7 @@ describe('#25634 the boot reconcile reads what changed since its last completed
212250
});
213251

214252
it('a second boot still fills a row a hook-bypassing writer added since the last walk, reading only that row', async () => {
215-
const first = await boot({ before: (f) => f.directInsert(history()) });
216-
await first.plugin.whenReconciled();
217-
await shutdown(first.kernel);
218-
253+
fromWalked();
219254
const second = await boot({
220255
before: (f) => f.directInsert([{ id: 'p_new', title: '李娜', created_at: new Date().toISOString(), updated_at: new Date().toISOString() }]),
221256
});
@@ -236,7 +271,10 @@ describe('#25634 the boot reconcile reads what changed since its last completed
236271
});
237272

238273
it('control: the explicit rebuild (force) still walks every row, and fills a row the watermark cannot see', async () => {
239-
const first = await boot({ before: (f) => f.directInsert(history()) });
274+
// Booted over the walked history: the watermark that walk recorded is the
275+
// one the back-dated write below hides from.
276+
fromWalked();
277+
const first = await boot();
240278
await first.plugin.whenReconciled();
241279
// A hook- AND stamp-bypassing write that back-dates itself: no watermark
242280
// can see it. That is what the explicit rebuild is for.

‎packages/plugins/plugin-security/src/bootstrap-platform-admin-promotion-selection.test.ts‎

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
// test-budget: 20 — spawns the real producer once per single-cause fixture: a fresh real ObjectQL engine on its own better-sqlite3 :memory: database per fixture, most seeded row by row through a natural-order facade (populations of up to 201 users) before the real promotion pass, each population and order its case's subject; slowest CI reading 13.5 s (scheduled full-battery run 41255489006, Test Core shard log) x 1.25, rounded up; read before the card-shape passes were shared by the per-order and same-answer cases
23

34
/**
45
* Commit 9b9581b11 — WHICH user the `single`-posture bootstrap promotes, and why.
@@ -59,7 +60,7 @@
5960
* back to being a function of the driver.
6061
*/
6162

62-
import { describe, it, expect, afterEach, beforeEach } from 'vitest';
63+
import { describe, it, expect, afterEach, beforeAll, beforeEach } from 'vitest';
6364
import { assertEngineUpdateDispatch } from '@objectstack/metadata-core';
6465
import { ObjectQL } from '@objectstack/objectql';
6566
import { SqlDriver } from '@objectstack/driver-sql';
@@ -318,33 +319,44 @@ describe('#16682 — the promotion target is chosen, not sampled', () => {
318319
// ─────────────────────────────────────────────────────────────────────────
319320

320321
describe('the card\'s shape: >50 users, owner last by id and first by created_at', () => {
321-
for (const order of NATURAL_ORDERS) {
322-
it(`promotes the oldest authenticable human under natural order ${order}`, async () => {
322+
// [#23181] One pass per natural order — a fresh engine, the card's
323+
// population seeded through that order's facade, then the promotion — is
324+
// the setup of both the per-order cases and the same-answer case, so it
325+
// runs once per order, here, and the cases read what each pass produced.
326+
const passes = new Map<
327+
NaturalOrder,
328+
{ report: Awaited<ReturnType<typeof bootstrapPlatformAdmin>>; info: string[]; grants: string[] }
329+
>();
330+
331+
beforeAll(async () => {
332+
delete process.env[OWNER_ENV];
333+
resetPlatformAdminEmailMemo();
334+
for (const order of NATURAL_ORDERS) {
323335
const engine = await boot();
324336
const ql = withNaturalOrder(engine, order);
325337
await seedCardPopulation(ql);
326338

327339
const { info, logger } = collectingLogger();
328340
const report = await bootstrapPlatformAdmin(ql, defaultPermissionSets, { logger });
341+
passes.set(order, { report, info, grants: await adminGrantEmails(engine) });
342+
}
343+
}, 30_000);
344+
345+
for (const order of NATURAL_ORDERS) {
346+
it(`promotes the oldest authenticable human under natural order ${order}`, () => {
347+
const { report, info, grants } = passes.get(order)!;
329348

330349
expect(report.adminPromoted).toBe(true);
331350
expect(report.basis).toBe('oldest-authenticable');
332-
expect(await adminGrantEmails(engine)).toEqual(['admin@objectos.ai']);
351+
expect(grants).toEqual(['admin@objectos.ai']);
333352
expect(info.join('\n')).toContain(
334353
'first user promoted to platform admin: admin@objectos.ai',
335354
);
336355
});
337356
}
338357

339-
it('gives the SAME answer under all three orders (the driver may not decide this)', async () => {
340-
const answers: string[] = [];
341-
for (const order of NATURAL_ORDERS) {
342-
const engine = await boot();
343-
const ql = withNaturalOrder(engine, order);
344-
await seedCardPopulation(ql);
345-
await bootstrapPlatformAdmin(ql, defaultPermissionSets, {});
346-
answers.push((await adminGrantEmails(engine)).join(','));
347-
}
358+
it('gives the SAME answer under all three orders (the driver may not decide this)', () => {
359+
const answers = NATURAL_ORDERS.map((order) => passes.get(order)!.grants.join(','));
348360
expect(answers).toEqual(['admin@objectos.ai', 'admin@objectos.ai', 'admin@objectos.ai']);
349361
});
350362

‎packages/rest/src/meta-draft-head-package-inheritance.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
// test-budget: 20 — spawns the real producer once per single-cause fixture: 25 cases on 39 real-stack boots (better-sqlite3 :memory:, the real sys_metadata objects, protocol and routes; about 12 ms each, 0.5 s of the file), each case's own save, read, publish and discard sequence on the real /meta routes being its subject, no two the same; slowest CI reading 15.0 s (scheduled full-battery run 41271604267, Test Core shard log) x 1.25, rounded up
23

34
/**
45
* [#22128] One head row per `/meta` write address: the save's expected-parent

‎packages/verify/src/harness.key-custody.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
// test-budget: 20 — spawns the real producer once per single-cause fixture: five in-process bootStack boots, each the subject of its cases and no two the same setup (an empty key home, a key file already in the home, an OS_SECRET_KEY in the environment, and a restart pair over one database file), every boot in a hook and none warmed up at module scope; slowest CI reading 14.2 s (scheduled full-battery run 41199450735, Test Core shard log) x 1.25, rounded up
23
//
34
// [#21499] `bootStack` never creates key material in the key home, and never
45
// seals under a real key the host already holds.

0 commit comments

Comments
 (0)