Skip to content

test(verify): warm the first boot at module scope and declare budgets on the files still over 10 s (#23181 slice 18) - #27548

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-qpz9u8
Oct 29, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-qpz9u8

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

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 under packages/verify/src/, all *.test.ts; @objectstack/verify's files[] ships dist only, and no files[] changes in any package.

维护者速读

  • 改了什么:verify 包 4 个测试文件在模块顶层先做一次 warmUpBoot(冷启动不再算进第一个用例的计时);仍超 10 s 的 5 个文件在第 2 行加 // test-budget: 声明。只动测试文件。
  • 为什么改:卡 test budget (domain:cli): 119 test file(s) over 10 s of wall in the hourly full battery (Part of #23151) #23181 要求单个测试文件不超过 10 s;这 4 个文件的第一次启动是冷的,多付 2–4 s。剩下的耗时是每个夹具各启动一次真实栈,按裁决 6181973363 B 声明实测预算。
  • 风险与回滚:不改断言、超时与分层;预热只启动一个不带对象的临时应用并停掉。回滚即 revert 本 PR。
  • 先看: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-reach and harness.required-providers booted cold inside their first hook or case. Each now calls await warmUpBoot(...) at module scope, on a line of its own, as harness.one-composition already does (boot-warm-up.testkit.ts). required-providers warms with requires: ['approvals'], the requires of its first boot. None of the four asserts on the state the warm-up moves (the harness data key, NODE_ENV before the first boot, a once-per-process notice, or an environment variable read once): checked by reading each file, no process.env or NODE_ENV in 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.ts declares it for served-shape boots).

file change slowest CI reading (s) budget
src/dashboard-window.test.ts warm-up + header 73.29 100
src/parent-write-reach.test.ts warm-up + header 63.34 80
src/unique-scope.test.ts warm-up + header 61.38 80
src/held-session-vendor-admin-doors.pin.test.ts header 32.65 50
src/harness.one-composition.test.ts header (warm-up already there) 17.89 30
src/harness.required-providers.test.ts warm-up (not in the window's list) under 10 s locally, no header

Card 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), and src/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.ts by 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 scheduled ci.yml runs since then replayed @objectstack/verify from 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 beforeAll sets OS_SCIM_ENABLED and OS_SSO_ENABLED before 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 inside beforeAll; slice 17's note called it a module-level boot, which it is not.

Tests

Full @objectstack/verify suite, three runs before (on origin/main 57c51aab4) and three after (on ee4e8659, before the main merge), each cd packages/verify && pnpm exec vitest run --maxWorkers=2 --reporter=default in its own os-verify-lock hold 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
file before after
src/dashboard-window.test.ts 22.60 / 19.82 / 22.80 17.88 / 17.27 / 18.77
src/parent-write-reach.test.ts 20.56 / 17.90 / 19.32 15.31 / 14.92 / 15.56
src/unique-scope.test.ts 15.71 / 15.03 / 17.74 14.65 / 13.91 / 15.84
src/harness.one-composition.test.ts 10.54 / 10.34 / 11.72 10.60 / 10.36 / 11.54
src/harness.required-providers.test.ts 8.03 / 8.82 / 10.37 7.12 / 6.96 / 8.25
src/held-session-vendor-admin-doors.pin.test.ts 8.63 / 8.87 / 10.20 9.07 / 8.93 / 10.54

Every other file in the package read under 10 s in all six runs.

One more full-suite run on 89120bc9 (the first main merge, 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 head 4e0c26a9 adds only a second main merge (no file in this diff changes); Test Core on 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, class spawns 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-config on the six files: exit 0. No ablation: no tested behaviour changed.

Acceptance notes

  • Five more @objectstack/verify files 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.ts 22.41 s (takes no warm-up by the testkit's own rule), src/harness.app-default-profile.test.ts 18.90, src/handle.test.ts 17.30, src/harness.org-context.test.ts 16.60 (all three already warm up), src/held-session-impersonation-target.pin.test.ts 16.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).
  • Branch claude/project-thread-qpz9u8 is 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/objectstack derived 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-test exit 3 (shallow clone) then 0 after fetching its pinned fixture commit; pnpm check:dual-build-cjs-loads exit 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 on 4e0c26a9. Repo-wide pnpm lint is CI's.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgTaB4SPm2t72GW1X9n

…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>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 29, 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 d4ff1a025fa4568505bfbc66a0f8cbeb3bab06ff → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#1 · os-sales · session_01L6bhgXcN9HaZYSEUdJWEjw

维护者速读(席位终稿)

  • 改了什么:verify 包 4 个测试文件在模块顶层先做一次 warmUpBoot,冷启动不再算进第一个用例的计时;仍超 10 s 的 5 个文件在第 2 行加 // test-budget: 声明。只动测试文件。
  • 为什么改:test budget (domain:cli): 119 test file(s) over 10 s of wall in the hourly full battery (Part of #23151) #23181 要求单个测试文件不超过 10 s。这 4 个文件的第一次启动是冷的,多付 2–4 s;剩下的耗时是每个夹具各启动一次真实栈,按裁决 6181973363 B 声明实测预算。
  • 风险与回滚:极低。不改断言、超时与分层,预热只启动一个不带对象的临时应用并停掉。回滚就是还原这一个 PR。
  • 先看: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,预期全绿。
  • 需要你做的:无。Tier S,测试文件、不碰契约四面,席位落地。

席位意见:接受。预热假设已实测成立,预算按裁决 B 的算法(CI 最慢读数 ×1.25 向上取整)声明。

席位核对 — ACCEPT · domain:server#1 · head 4e0c26a · 2026-10-29T14:01Z

  • Shape: 29 added lines over six packages/verify/src/*.test.ts files. Module-scope await warmUpBoot(...) goes on four files (required-providers warms with requires: ['approvals'], its first boot's requires), and a line-2 // test-budget: N — spawns the real producer once per single-cause fixture: … header on five. Nothing else changes: no assertion, timeout or tier.
  • Premise: claim 6495182333 holds; Part of #23181 (slice 18); ruling record 6181973363 letter B for the header form and N.
  • Gates: 53 check-runs on this head: 34 success, 19 skipped, 0 failed, 0 pending. check-expected-skips --pr 27548 (fresh origin/main): VERDICT … OK — 19 skipped check-run(s), every one in main's roster (exit 0). mergeable_state: clean. Dev (os-dev-report 6496659788): the full verify suite 3 runs before and 3 after, each 46 passed (46), VERDICT exit 0. Local maxima before → after: dashboard-window 22.80 → 18.77, parent-write-reach 20.56 → 15.56, unique-scope 17.74 → 15.84, required-providers 10.37 → 8.25 s. readTestBudget parses all five headers.
  • Contract review: not owed (test files only; Clause-②: no, no narrowing, no spec, no governed path). Seat read the full diff.
  • Accepted deviations: every budget rests on refresh PR chore(ci): refresh the Test Core shard-timings dataset #25960's CI window, read before the warm-up. No refresh has run since, and the scheduled runs replay @objectstack/verify from cache. So the budgets are upper bounds, and the next refresh re-reads them.
  • Declaration: Clause-②: no, Metadata-protocol: none, skip-changeset (test-only; @objectstack/verify ships dist only).
  • Out of scope: five more verify files are over 10 s in chore(ci): refresh the Test Core shard-timings dataset #25960's window but under 10 s in all six local runs (harness.key-custody 22.41, harness.app-default-profile 18.90, handle 17.30, harness.org-context 16.60, held-session-impersonation-target.pin 16.43). They carry on test budget (domain:cli): 119 test file(s) over 10 s of wall in the hourly full battery (Part of #23151) #23181 for the next refresh.
  • Landing: Tier S, NOT governed, 29 changed lines ≤ 3000 → pr_ready + automerge_enable via the relay now. test budget (domain:cli): 119 test file(s) over 10 s of wall in the hourly full battery (Part of #23151) #23181 is a series: on merge it returns to pm:queue with a delivered / remaining note.

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

Labels

size/s 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.

1 participant