Repository navigation
test(server): share repeated boots in four server test files and budget the 17 files between 10 and 13 s - #28631
Merged
Conversation
Four files booted the same setup in several cases that only read it: the plain bootStack in harness.served-composition (3 to 1), the kernel in sys-user-default-row-scope (10 to 2), and the seeded real stack in meta-history-diff-authoring-door (20 to 1) and meta-draft-read-builder-gate (21 to 1). Each now boots once in a hook; spies and the dataset mock are cleared before each case, as a fresh boot left them. All 17 files take a line-2 test-budget header (20) from their slowest of the five scheduled CI readings x 1.25: what remains is distinct real work. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mAySGuLppSnAtNXaa
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-project-manager · session_01R1q2xdtYgU6FKrZ7LgjPCC 席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | Draft, base main, Part of #23181. Exactly slice 33's 17 non-cli files, labels tests + skip-changeset. Clause-②: no, Metadata-protocol: none. |
| Diff check (seat) | Four files share one boot in a hook, each with its reason written beside it, and the seat read the case bodies against it: meta-draft-read-builder-gate and meta-history-diff-authoring-door only read after seeding, and their spies are cleared before each case as a fresh boot left them; sys-user-default-row-scope cases each assert on their own read context, and the only rows written (hook_probe) are read by no case; harness.served-composition shares the plain one-package boot across the slate, cube and mail controls, and only the mail control sends (its sys_email count is its own). Teardown moves from afterEach to afterAll to match. Line-2 // test-budget: 20 on all 17. No assertion changes, no shared helper touched, no timeout raised. |
| Evidence | CI green on head 9f399f58 (35 success, 18 skipped, 0 failed; the CI and Lint & Type Check workflow runs both success). Governed check: NOT governed, 156 changed lines. The report gives 54 of 54 derived gates exit 0 on the merged head and A/B N=3 of −30 % (served-composition), −69 % (sys-user-default-row-scope), −79 % (meta-history-diff), −78 % (meta-draft-read-builder-gate). |
| Landing | 「按照 pm-dispatch 规则复核过的都授权」 (Leehom, 2026-10-25T11:35Z): ready and auto-merge through the relay, once every check on this head is green or an expected skip. |
Generated by Claude Code
This was referenced Nov 26, 2026
Nenzyz
pushed a commit
to Nenzyz/objectstack
that referenced
this pull request
Dec 1, 2026
…s 120_000 budget (objectstack-ai#37708) <!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg3zXREECfPtgrM8TPQaxn1v)_ Fixes objectstack-ai#37700 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户无感:只改了一份内部测试的等待上限,产品行为前后不变。 - 为什么做:知识库能力的一条新测试在主干定时全量构建里超时,把主干标红;本改动让它在繁忙的构建机上也有足够时间。 - 出错会怎样:最坏只是这条测试仍偶发超时,主干再红一次,可直接撤回,不影响任何用户。 - 要你做什么:无。 ## What changes `packages/verify/src/harness.required-providers.test.ts` only. The two cases in the `requires: ['knowledge']` describe that still ran on vitest's 5000 ms default now take the file's per-case `120_000`, which every other boot/import case in the file already carries. Each carries a comment with its measurement: - **an install without the optional libSQL store** (the failing case). It clears the module cache (`vi.resetModules()`) and `constructServedProviders` then re-imports the provider graph. Local: 1138 / 1358 / 1365 ms over three runs. The scheduled run 45888214247 (job 140145134703, Test Core 10/10) read this file's tests at 57.8 s, which is 52.8 s outside this case against 16.2 s locally, so 3.3x. 1365 ms x 3.3 = 4.5 s, which leaves no margin under 5000 ms. The case was killed at 5000 ms. - **a host that mounts the service itself**. The same `constructServedProviders` shape, and it had no timeout either. 111-114 ms in file order, 431 ms alone on a cold cache (`-t`). x 3.3 = 1.4 s cold. It is not failing today; it gets the same budget so the risk is covered the same way. The other three knowledge cases already carry `120_000`. I chose a per-case timeout over a shared boot (the objectstack-ai#28631 shape) because the slow case is not a repeated boot. Its cost is a module re-import that it causes on purpose, and nothing could share it. The file's own convention is a per-case `120_000`. Nothing is skipped. ## Tests <details><summary>File run on the final head, plus three earlier measurement runs</summary> ``` head fdf439c: pnpm --filter @objectstack/verify exec vitest run --maxWorkers=2 --reporter=verbose src/harness.required-providers.test.ts ✓ ... a host that mounts the service itself keeps its own, and the runtime adds no store 235ms ✓ ... an install without the optional libSQL store: ... says so once 1487ms Test Files 1 passed (1) Tests 15 passed (15) os-verify-lock: VERDICT command-exit 0 measurement runs (base 9476092, verbose): libSQL case 1138 / 1358 / 1365 ms; host case 114 / 113 / 111 ms; file tests 17.44 / 17.19 / 17.55 s; host case alone (-t) 431 ms pnpm --filter @objectstack/verify typecheck -> VERDICT command-exit 0 (check:test-typecheck: OK, the test layer compiles) ``` </details> ## Acceptance notes - `overlap-check`: `objectstack-ai#37676 (shares packages/verify/src/harness.required-providers.test.ts): merges cleanly`, `VERDICT clean exit 0`. The overlap is textual only. - The file's `test-budget: 28` header is out of date. The CI run above read the file at 57.8 s (including the 5 s timeout), and its own text says "the first CI reading after the knowledge boots re-measures it". This PR does not re-set the budget, because that is outside the card's acceptance. Noted here for the lane. - No changeset. The diff is a `*.test.ts` under `src/`. `@objectstack/verify` ships `dist`, `README.md` and `CHANGELOG.md`. After `pnpm --filter @objectstack/verify build`, grepping `dist` finds 0 hits for the case title, and the positive control `bootStack` is found (`dist/index.js`, `dist/index.cjs`). The PR carries `skip-changeset`. ## Verification Read first: the one hunk at the end of the knowledge describe (the libSQL case's closing `}, 120_000);` and its comment). Two-minute check: `pnpm --filter @objectstack/verify exec vitest run --reporter=verbose src/harness.required-providers.test.ts` should print 15 passed, with the libSQL case at about 1-1.5 s locally. The real proof is the next scheduled full run going green on Test Core 10/10. --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6Cb4BAjgQ43tqy1DvVJ)_ Co-authored-by: Claude <noreply@anthropic.com>
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 Leehom · project thread
Part of #23181 (slice 33). The card stays open for later slices:
plugin-auth/src/invitation-delivery-outcome.test.ts(10.5 s) is left to slice 30's effect, and slices 29–32 hold other files.Clause-②: no
Metadata-protocol: none
维护者速读
// test-budget: 20头。files[]都只发dist、README、CHANGELOG,不发布任何东西;用例名和断言一条没删、没放宽(4 个改动文件 base/head 用例名逐条一致,且在 3 个随机顺序种子下全过);回滚即 revert。packages/rest/src/meta-history-diff-authoring-door.test.ts(共享启动 + 每例前清空 spy);packages/services/service-automation/src/sys-user-default-row-scope.integration.test.ts(两个beforeAll);packages/verify/src/harness.served-composition.test.ts(共享的 plain 启动)。pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/meta-history-diff-authoring-door.test.ts→ 20/20 通过,文件行约 0.5 s(base 约 2.3 s)。What changes
The 17 files the order lists from slice 23's offender table (
pm-orders/server/evidence/23181-s23/offenders-after-s23.md), read from the default reporter's per-file module line in the Test Core shard logs of the scheduledci.ymlruns41199450735,41217827347,41237094739,41255489006and41271604267. "local" is the same file line from one run on this box (--maxWorkers=1, based94dd3a65d).plugin-security/src/rls-check-stored-form.test.tsruntime/src/plugin-driver-external-object.spike.test.tsbeforeAllrest/src/meta-history-diff-authoring-door.test.tsboot()(six saves) per case; every case only readsbeforeAll, spies cleared before each case; header 20plugin-auth/src/walled-owner-operator-stamp.test.tsAuthManagerplugin-security/src/rls-stored-list-ordering-fails-closed.test.tsverify/src/harness.required-providers.test.tsbootStackverify/src/harness.served-composition.test.tsbootStackbeforeAll; header 20plugin-security/src/org-admin-assignment-boundary.posture.test.tsservice-automation/src/sys-user-default-row-scope.integration.test.tsboot()per case in each describe; the only case writes arehook_proberows no case readsbeforeAll; header 20runtime/src/installed-plugin-loader.test.tsverify/src/held-session-impersonation-target.pin.test.tsbootStackinbeforeAllplugin-auth/src/scim-deactivation-reconcile-user.test.tsAuthManagerper caserest/src/meta-draft-read-builder-gate.test.tsboot()(seven saves) per case; every case only readsbeforeAll,queryDatasetcleared before each case; header 20verify/src/held-session-platform-admin.pin.test.tsbootStackinbeforeAllruntime/src/app-automation-identity-write-refusal.integration.test.tsruntime/src/sandbox/quickjs-runner.test.tsverify/src/handle.test.tsCause across the set. Every file reads 1.6–6.2 s locally, and its CI readings spread two to four times across runs of the same code (
walled-owner-operator-stamp3.4 s and 11.9 s): the overrun is the Test Core shard's concurrent load on in-process work. No file spawns a CLI; none repeats a boot beyond the four fixed here.Headers (ruling 6181973363 letter B, class
spawns the real producer once per single-cause fixture, the class slice 26 used for in-process boots): N = the slowest of the five CI readings × 1.25, rounded up to 10 s; 20 for all 17. Where the file also changed, the header keeps its pre-change CI reading and says so. All 17 parse withreadTestBudget(scripts/measure-test-shard-timings.mjs): 20 s, line 2.The shares. Only where no case writes what another reads, as the order allows:
harness.served-composition: the slate case and the cube control only read the kernel; the mail control's send leaves asys_emailrow only it counts. Its own anti-vacuity line (onePackage().requiresis undefined) stays.sys-user-default-row-scope: each case reads through its own producer, and asserts on the lastreadContextsentry its own read pushed and on the hook firing it counts from its ownbefore. In theextenddescribe the second case's contribution is refused and the case itself pins that the registry is unchanged.GETdoors,draftVersion's system read; the dataset door hands its query to thequeryDatasetspy, which stores nothing). The protocol spies (history-diff) andqueryDataset(builder-gate) are cleared inbeforeEach, as a fresh boot left them.Not changed: no case name, assertion, timeout, tier or project; no source file; no shared helper or testkit (
verify/src/harness.ts,boot-warm-up.testkit.ts,default-organization.testkit.ts,audience-gate-test-supportuntouched).Tests
A/B (one box, one lock hold, base copied beside head as
zzbase.*, each side in its own vitest invocation, order alternated per round, N=3,--maxWorkers=1, default reporter file line; copies deleted after):meta-history-diff-authoring-doormeta-draft-read-builder-gatesys-user-default-row-scope.integrationharness.served-compositionEvery run exit 0, the same test counts both sides (20, 21, 10, 7).
vitest liston base and head gives the same case names for all four files.Order independence of the shares: each changed file run plain and with
--sequence.shuffle --sequence.seed=11,=22,=33: 16 runs, all exit 0 (7/7, 10/10, 20/20, 21/21).Header-only files: all 13 run on base with the full count passing (local readings in the table); the header is a comment line.
No ablation: no tested behaviour changed (test-only).
Acceptance notes
skip-changeset. Test-only. All six packages shipfiles: ["dist", "README.md", "CHANGELOG.md"]; after the full build, a source symbol from each package is in itsdist/(positive control:bootStack,AutomationServicePlugin,RestServer,QuickJSScriptRunner,SecurityPlugin,AuthManager) and a fixture string from each package's changed tests is not (svc_note_cube,qa_star_reader,nav_atlas_launch_plan,spike_tree,qa_due_stored_,operator@corp.example), nor istest-budget:. Nofiles[]content changes.rls-stored-list-ordering-fails-closed(120 boots) andorg-admin-assignment-boundary.posture(60) could share a boot per key only if their cases stopped reading the whole table, which would change what those assertions say; left as is.Verification
All readings on head
9f399f58(one commit, then one merge oforigin/mainafter slices 24, 25, 26 and 28 landed: #28610, #28601, #28599, #28616), after a fullpnpm exec turbo run build --concurrency=2(118/118).node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackon the final head → 54 families, each run with its exit code captured before any pipe, all exit 0 (withgit fetch --depth=1of the commit the teardown-shape self-test names).--ranreconciliation:✓ dispatch-gates --ran: 54 derived famil(ies) accounted for — 54 run, 0 NOT-MEASURED. List:pm-orders/server/evidence/23181-s33-gates-ran-9f399f58.txtin the project files.pnpm --filterthe six packagesrun typecheck(tsc +check:test-typecheck) exit 0.pnpm exec eslint --no-inline-configover the 17 files exit 0 (none of the six packages has alintscript; the repo-widepnpm lintis CI's);node scripts/check-commit-card-trailers.mjs --range origin/main..HEADexit 0.🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5mAySGuLppSnAtNXaa