Skip to content

test(verify): pay the first boot load at collection and share one boot per configuration in two harness suites - #26175

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-t8vqwe
Oct 26, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-t8vqwe

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread
Part of #23181 (slice 9). The card stays open for its other rows.

Clause-②: no
Metadata-protocol: none

Test files only, so this PR carries skip-changeset: both files are *.test.ts under packages/verify/src, which the package's build does not ship.

What changed

Two @objectstack/verify harness suites booted a fresh in-process stack in every case and paid the boot's first load inside the first case's clock.

  • src/harness.app-default-profile.test.ts: await warmUpBoot() at module scope (boot-warm-up.testkit.ts, the convention slices 3 and 4 used). The first two cases now read ONE boot of the declared-default configuration from a beforeAll. The first reads the profile the boot wired; the second signs a member up and reads as them. Neither reads what the other writes. Boots: 4 → 3.
  • src/harness.org-context.test.ts: await warmUpBoot() at module scope. One beforeAll boots app with the flag off, records what the cases read, and stops. Then it boots with orgContext: true, records, and stops, in the same order the ruling case always booted them. The ruling case compares the two recorded postures, the bind case reads the orgContext: true boot, and the default-boot case reads the default boot. Boots: 4 → 2.

Every assertion reads the same value of the same boot shape (same configuration, same options) as before. The test full names are identical before and after (sorted fullName lists compared).

The reading, and the rows this PR brings under 10 s

The reading is refresh PR #25960's per-file list (runs 40200279306 and others in its window). The newest LANDED refresh, #25409, lists no per-file rows; slice 8's report records why. Of this family, #25960 still lists five rows:

file #25960 slowest (runs over / executed) local before → after, median of 3 this PR
src/harness.app-default-profile.test.ts 18.90 s (1 / 2) 6608 → 3126 ms (×0.47) under 10 s: projected 8.9 s in CI
src/harness.org-context.test.ts 16.60 s (1 / 2) 6741 → 2431 ms (×0.36) under 10 s: projected 6.0 s in CI
src/harness.key-custody.test.ts 22.41 s (2 / 2) 6852–7338 ms, untouched open: see Acceptance notes
src/harness.one-composition.test.ts 17.89 s (2 / 2) 9206–10354 ms, untouched open: see Acceptance notes
src/handle.test.ts 17.30 s (1 / 2) 3857–4253 ms, untouched open: already warmed, one shared boot

The pin is the next landed refresh: it should no longer name the two rows marked under 10 s.

Measurement

On one 4-vCPU box, under os-verify-lock. It is a shared box, so the ratios carry the result rather than the absolute times. Each run is one vitest run --maxWorkers=2 process per file. The number is the default reporter's file line (the module's duration: hooks included, collection excluded), which is the figure the timing refresh reads. The json reporter's endTime - startTime leaves out a beforeAll that runs before the first case, so it is not used. BASE a6e8f95d6 copies and HEAD files were interleaved A/B in the same lock hold.

run app-default BASE app-default HEAD org-context BASE org-context HEAD
1 6488 3126 6523 2431
2 7591 3523 6741 2702
3 6608 3023 7223 2263

Cases still isolated. vitest run --sequence.shuffle --sequence.seed=N over both files, seeds 1 to 5: 11 / 11 passed each time. With seed 1, the member sign-up case ran before the profile read on the shared boot. With seed 2, the default-boot case ran before the ruling case.

Where a boot's time goes. A CPU profile of six warm bootStack calls (0.82–1.09 s each) puts the largest share in the default datasource's schema sync on sql.js (knex ensureConnection / query → driver-sqlite-wasm _query, driver-sql initObjects). A test file can only boot fewer times; it cannot make a boot cheaper.

Acceptance notes

  • harness.key-custody.test.ts (22.41 s, 2 / 2) is untouched. Each of its 5 boots runs under its own key posture, so no two boots can be shared. A warm-up is excluded there by slice 4's seat ruling (option A on 6221027193): it would build the harness data key outside the keyless posture the file inspects.
  • harness.one-composition.test.ts (17.89 s, 2 / 2) is untouched. It is already warmed. Each of its 12 boots is the subject of its case (the instance rule and composition), so no two can be shared. It reads 9.2–10.4 s locally.
  • handle.test.ts (17.30 s, 1 of 2 runs over) is untouched. It is already warmed and boots once per file. The one reading over 10 s came from the window's most loaded run (40200279306, where all five rows took their slowest).
  • #23181 remains open for those rows and for the other packages' rows.

Tests

  • pnpm --filter @objectstack/verify typecheck: VERDICT command-exit 0 (check:test-typecheck: OK, 0 debt).
  • eslint --no-inline-config packages/verify: exit 0.
  • Both files: 11 / 11 passed in 6 A/B runs and 5 shuffled runs.
  • @objectstack/verify whole suite (vitest run --maxWorkers=2): Test Files 46 passed (46), Tests 393 passed (393), VERDICT command-exit 0.
  • Gates at cb29c5b4d: dispatch-gates --commands derived 55 commands, and all 55 exit 0. --ran reports "55 derived, 55 run, 0 NOT-MEASURED, 0 UNRUN" and exits 0. On the first pass two gates exited 3 with PREREQUISITE NOT MET, which is not a verdict: check-plugin-teardown-shape --self-test (shallow clone; fixed by fetching 621a4876) and check:dual-build-cjs-loads (eight packages had no dist/; fixed by building them). Both exit 0 on the re-run.

Generated by Claude Code

…t per configuration in two harness suites

harness.app-default-profile and harness.org-context booted a fresh stack
in every case, and paid the boot's first load inside the first case's
clock. Both now warm up at module scope (boot-warm-up.testkit.ts), and
cases that read the same configuration under the same options read one
boot from a beforeAll: app-default-profile 4 boots to 3, org-context 4
boots to 2, with every assertion unchanged in what it reads.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bmz18vLaqY8KsiVaCXL5zS
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

What this run could not see

Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json c7aa9cde24ca7d17563caa4e01037f3ab1b9e990 → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 · ACCEPT · domain:server seat 1 · os-project-manager · session_01R1q2xdtYgU6FKrZ7LgjPCC · 2026-10-26T15:13Z

Head cb29c5b4df, report 6419000068 (on #23181, slice 9), claim 6417592580 and its amendments. No contract review owed: test-only, no packages/spec/**.

item reading
Shape Draft, base main, Part of #23181 (slice 9), skip-changeset, mergeable clean.
Files 2 files, +99/−63: packages/verify/src/harness.app-default-profile.test.ts and harness.org-context.test.ts. Both use the existing boot-warm-up.testkit.ts (on main).
Fix Each file pays the boot's first load at collection (warmUpBoot()), and cases that read the same boot configuration share one boot in a beforeAll. app-default-profile: the two read-only cases on the declared default. org-context: one bootAndRead per option set, then the cases assert its reading. Every case keeps its assertion. No timeout raised and nothing deleted.
Evidence app-default-profile 6,608 → 3,126 ms and org-context 6,741 → 2,431 ms (interleaved A/B, median of 3); projected CI 8.9 s and 6.0 s. Shuffle seeds 1–5 green. The verify suite passes 393/393. 55/55 gates exit 0, --ran reconciled. On this head 36 check runs succeeded and 16 skipped as expected, with 0 failed.
Carried key-custody, one-composition and handle.test are left untouched, with reasons given in the report. The open question goes with the dev's recommendation: wait for the next refresh, then file a card on bootStack's per-boot cost if those rows remain.
Landing 「按照 pm-dispatch 规则复核过的都授权」 (Leehom, 2026-10-25T11:35Z): ready and auto-merge through the relay.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 26, 2026 15:14
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 26, 2026 15:15
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit e6dfeb0 Oct 26, 2026
53 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-t8vqwe branch October 26, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants