Repository navigation
test(verify): warm the first boot at module scope and declare budgets on the files still over 10 s (#23181 slice 18) - #27548
Merged
Conversation
…files dashboard-window, unique-scope, parent-write-reach and harness.required-providers booted cold inside their first hook or case, so each file's clocked time carried the 2-3.5 s first-use load. They now call warmUpBoot at module scope, as one-composition already does. Claude-Session: https://claude.ai/code/session_01L6bhgTaB4SPm2t72GW1X9n Co-authored-by: Claude <noreply@anthropic.com>
dashboard-window, parent-write-reach, unique-scope, held-session-vendor-admin-doors and harness.one-composition boot the real stack once per single-cause fixture and stay over 10 s after the warm-up. Each carries the ruled header: the slowest CI reading in refresh PR #25960's window x 1.25, rounded up to the next 10 s. Claude-Session: https://claude.ai/code/session_01L6bhgTaB4SPm2t72GW1X9n Co-authored-by: Claude <noreply@anthropic.com>
Contributor
📓 Docs Drift CheckNothing 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): |
Contributor
Author
|
domain:server#1 · os-sales · session_01L6bhgXcN9HaZYSEUdJWEjw 维护者速读(席位终稿)
席位意见:接受。预热假设已实测成立,预算按裁决 B 的算法(CI 最慢读数 ×1.25 向上取整)声明。 席位核对 — ACCEPT · domain:server#1 · head 4e0c26a · 2026-10-29T14:01Z
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Sales · project thread
Part of #23181 (slice 18). The card is a series and stays open.
Clause-②: no
Metadata-protocol: none
Test-only diff:
skip-changeset. Six files underpackages/verify/src/, all*.test.ts;@objectstack/verify'sfiles[]shipsdistonly, and nofiles[]changes in any package.维护者速读
warmUpBoot(冷启动不再算进第一个用例的计时);仍超 10 s 的 5 个文件在第 2 行加// test-budget:声明。只动测试文件。packages/verify/src/harness.required-providers.test.ts(预热带requires: ['approvals'])、packages/verify/src/dashboard-window.test.ts第 2 行(预算最大,100 s)。pnpm --filter @objectstack/verify exec vitest run --maxWorkers=2 src/dashboard-window.test.ts src/harness.required-providers.test.ts,预期 2 个文件全绿,dashboard-window 比 main 上快约 3–4 s。What changes
Warm-up (the PM hypothesis, measured and holding).
dashboard-window,unique-scope,parent-write-reachandharness.required-providersbooted cold inside their first hook or case. Each now callsawait warmUpBoot(...)at module scope, on a line of its own, asharness.one-compositionalready does (boot-warm-up.testkit.ts).required-providerswarms withrequires: ['approvals'], the requires of its first boot. None of the four asserts on the state the warm-up moves (the harness data key,NODE_ENVbefore the first boot, a once-per-process notice, or an environment variable read once): checked by reading each file, noprocess.envorNODE_ENVin any of them.Budget header (ruling record 6181973363, letter B). Five files are still over 10 s locally after the warm-up, and each boots the real stack once per single-cause fixture. Each carries one line at line 2:
// test-budget: N — spawns the real producer once per single-cause fixture: REASON, N = the slowest CI reading x 1.25, rounded up to the next 10 s. The class is the one the in-process boot files already use (packages/cli/src/commands/migrate/audit-key-material.archive.integration.test.tsdeclares it for served-shape boots).src/dashboard-window.test.tssrc/parent-write-reach.test.tssrc/unique-scope.test.tssrc/held-session-vendor-admin-doors.pin.test.tssrc/harness.one-composition.test.tssrc/harness.required-providers.test.tsCard rows this closes:
src/harness.required-providers.test.ts(under 10 s locally after the warm-up; the next refresh PR's list is the pin), andsrc/dashboard-window.test.ts,src/parent-write-reach.test.ts,src/unique-scope.test.ts,src/held-session-vendor-admin-doors.pin.test.ts,src/harness.one-composition.test.tsby declared budget.Why
The readings. The CI numbers are refresh PR #25960's window (hourly runs 40200279306 to 40272142430), the newest shard-timings refresh on
main; every reading above is from run 40200279306, and each file has 2 executed readings in the window. The scheduledci.ymlruns since then replayed@objectstack/verifyfrom cache (run 40839660599's aggregator lists it among the cache-replayed packages), so they carry no fresh reading, and the shard logs the API serves are cut to their last 5000 lines, which do not reach this package. The readings were taken before the warm-up, so the budgets are conservative for the three warmed files.Why the header and not more. After the warm-up, each file's wall is distinct boots plus one proof run per boot: dashboard-window boots 4 apps (the fixture app, the drop and zero negative controls, the day-turn app), parent-write-reach 3, unique-scope 8 over 6 fixtures (two controls plant then re-open one database file), one-composition boots each case's subject, and held-session-vendor-admin-doors boots once with SCIM and SSO on, then signs in per door per held state. No (boot, options, fixture) triple repeats inside a file, so there is nothing to share in one
beforeAll.held-session-vendor-admin-doors takes no warm-up. Its
beforeAllsetsOS_SCIM_ENABLEDandOS_SSO_ENABLEDbefore its boot, and the testkit forbids a warm-up for a file that changes, after the warm-up, an input a module may read once. Its slow part is a boot insidebeforeAll; slice 17's note called it a module-level boot, which it is not.Tests
Full
@objectstack/verifysuite, three runs before (onorigin/main57c51aab4) and three after (onee4e8659, before the main merge), eachcd packages/verify && pnpm exec vitest run --maxWorkers=2 --reporter=defaultin its ownos-verify-lockhold on a shared 4-vCPU container. Every run:Test Files 46 passed (46), VERDICT command-exit 0.Per-file wall (s), vitest module line, runs 1/2/3
src/dashboard-window.test.tssrc/parent-write-reach.test.tssrc/unique-scope.test.tssrc/harness.one-composition.test.tssrc/harness.required-providers.test.tssrc/held-session-vendor-admin-doors.pin.test.tsEvery other file in the package read under 10 s in all six runs.
One more full-suite run on
89120bc9(the firstmainmerge, after the gates):Test Files 46 passed (46), VERDICT command-exit 0; dashboard-window 20.58, parent-write-reach 16.29, unique-scope 15.64, one-composition 10.74, held-session-vendor-admin-doors 9.44 s, each under its budget. The head4e0c26a9adds only a secondmainmerge (no file in this diff changes);Test Coreon this PR is its reading.Header parse
All five lines parse through
readTestBudget(scripts/measure-test-shard-timings.mjs): each returns its budget (100/80/80/50/30) at line 2, classspawns the real producer once per single-cause fixture.pnpm --filter @objectstack/verify typecheck: VERDICT command-exit 0 (check:test-typecheck: OK).pnpm exec eslint --no-inline-configon the six files: exit 0. No ablation: no tested behaviour changed.Acceptance notes
@objectstack/verifyfiles are over 10 s in the same CI window but under 10 s in all six local runs, so this slice leaves them for the next refresh to re-read:src/harness.key-custody.test.ts22.41 s (takes no warm-up by the testkit's own rule),src/harness.app-default-profile.test.ts18.90,src/handle.test.ts17.30,src/harness.org-context.test.ts16.60 (all three already warm up),src/held-session-impersonation-target.pin.test.ts16.43. CI wall in this package runs about 3 to 4 times the local wall (dashboard-window 73.29 s on CI against 22.80 s here).claude/project-thread-qpz9u8is the card thread's harness-assigned branch; claim 6495182333 names it.Verification
Local, on
89120bc9:node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 48 families; each run with its exit captured by redirect before any pipe. 46 exit 0 on the first pass;check-plugin-teardown-shape.mjs --self-testexit 3 (shallow clone) then 0 after fetching its pinned fixture commit;pnpm check:dual-build-cjs-loadsexit 3 (packages outside the verify closure had no dist) then 0 after building them.--ran:48 derived famil(ies) accounted for — 48 run, 0 NOT-MEASURED, exit 0, and the same on4e0c26a9. Repo-widepnpm lintis CI's.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgTaB4SPm2t72GW1X9n