Repository navigation
Commit 4a00b2b
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuGToctYbgzCLJHD15UdEDwi)_
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:` 声明。只动测试文件。
- 为什么改:卡 #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.
<details><summary>Per-file wall (s), vitest module line, runs
1/2/3</summary>
| 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.
</details>
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.
<details><summary>Header parse</summary>
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`.
</details>
`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](https://claude.ai/code/session_01L6bhgTaB4SPm2t72GW1X9n)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgTaB4SPm2t72GW1X9n
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 72c0152 commit 4a00b2b
6 files changed
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
0 commit comments