Skip to content

test(runtime): reuse the census transports, pay first boots at module scope, and declare two budgets (#23181 slice 19) - #28081

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-388dl6
Oct 30, 2026
Merged

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Part of #23181 (slice 19, @objectstack/runtime). The card is a series and stays open.

Clause-②: no
Metadata-protocol: none

Test-only diff: skip-changeset. Three files under packages/runtime/src/, all *.test.ts; @objectstack/runtime's files[] ships dist only.

维护者速读

  • 改了什么:runtime 包 3 个测试文件。meta-list-projection-parity 的普查用例改为每个调用者复用一对已启动的 dispatcher/RestServer;mcp-package-object-discovery 在模块顶层先付两种形态的首次启动;它和 stored-metadata-reader-contexts.pin 在第 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;这三个文件在最近一次计时刷新里分别是 13.60、14.93、16.31 s。
  • 风险与回滚:不改断言、超时与分层;复用前后 6,136 次读取逐字节一致(一次性证明,见下);整包 8,834 个用例名前后一致。回滚即 revert 本 PR。
  • 先看:packages/runtime/src/domains/meta-list-projection-parity.test.ts 的 censusPair(复用的依据写在注释里);mcp-package-object-discovery.test.ts 第 2 行与模块顶层预热那一行。
  • 两分钟验证:pnpm --filter @objectstack/runtime exec vitest run --project repo --maxWorkers=2 src/domains/meta-list-projection-parity.test.ts,预期 879 个用例全绿,文件耗时约为 main 上的一半。
  • 需要你做的:无,席位落地。

What changes

The newest per-file reading is the weekly shard-timings refresh of 2026-10-26 (job 121418010419 in run 40275747937, refresh PR #25960's window, hourly runs 40200279306 to 40272142430); no refresh has run since. It lists three @objectstack/runtime files over 10 s: src/stored-metadata-reader-contexts.pin.test.ts 16.31 s, src/domains/mcp-package-object-discovery.test.ts 14.93 s and src/domains/meta-list-projection-parity.test.ts (repo project) 13.60 s, all in run 40200279306. The card's two older runtime rows, src/declared-capability-absence-warn-once.test.ts and src/stored-metadata-body-boundary.pin.test.ts, are not in that list and read 0.1 s and 3.7 s here, so this slice leaves them alone.

Fixture reuse: meta-list-projection-parity. Its four census blocks (row A, the item read, the layered route, the book tree) booted a fresh dispatcher and a fresh RestServer (with its registerRoutes()) for every caller of every cell. The file booted a dispatcher 3,179 times, nearly all in these blocks, and a RestServer as often; in one instrumented run the boots took 1.53 s (RestServer) and 0.42 s (dispatcher) of a 3.73 s file. They now read through one pair per caller (censusPair), booted on its first cell. Neither transport keeps an answer between two GET reads (RestServer's execCtxMemo is a WeakMap keyed on the request object; the dispatcher's membershipCache is keyed on an environment no read here names), and every protocol-double read clones its fixture. The blocks that assert on a double's calls, or boot with options, still boot their own.

Module-scope first boots: mcp-package-object-discovery. Each shape's first kernel boot was its slow one (276 and 163 ms against 45 to 131 ms for the other 22, isolated), paid inside a beforeAll. One module-scope line boots and shuts down the first describe's own fixture in each shape, before any hook runs (AGENTS.md: clocked windows measure behaviour, never loading).

Budget headers (ruling record 6181973363, letter B). Two files stay over 10 s on CI by the measured ratio here (CI read these three at about 3.5 to 5 times the local file time), and each boots the real stack per fixture: 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.

file change slowest CI reading (s) budget
src/domains/meta-list-projection-parity.test.ts census reuse 13.60 none (expected under 10 s)
src/domains/mcp-package-object-discovery.test.ts module-scope first boots + header 14.93 20
src/stored-metadata-reader-contexts.pin.test.ts header only (its first loads were already paid at module scope) 16.31 30

The class follows the precedent packages/verify/src/held-session-vendor-admin-doors.pin.test.ts set for one in-process boot followed by per-case door runs.

Tests

Per-file readings, vitest's own file line (what the refresh lane reads) and process wall, 3 isolated runs each, --maxWorkers=2, on a shared 4 vCPU container, before (bc496bf7, the three files checked out from the base) and after (1a5d0aea):

file before r1/r2/r3 (s) after r1/r2/r3 (s) wall before / after (s)
meta-list-projection-parity 3.58 / 3.10 / 2.96 1.50 / 1.37 / 1.40 21.1, 20.0, 19.0 / 17.2, 17.5, 17.3
mcp-package-object-discovery 2.75 / 2.93 / 2.72 2.49 / 2.77 / 2.43 19.4, 19.5, 18.6 / 18.8, 19.0, 18.3
stored-metadata-reader-contexts.pin 3.33 / 3.18 / 2.92 3.10 / 2.89 / 3.06 23.1, 23.4, 21.2 / 22.3, 21.8, 21.3

The wall is mostly the package's import graph (transform about 11 s, import about 15 s per isolated run), which collection pays and no clock in the refresh lane reads.

Whole package, both vitest projects, before and after: local Test Files 483 passed (483), Tests 7870 passed | 19 skipped (7889); repo Test Files 3 passed (3), Tests 948 passed (948), the same on both sides. Name census over the two JSON reports: 8,834 test names before and after, 0 lost, 0 new, 0 with a changed status.

The reuse proof (one-time, not kept)

A temporary wrapper made every census read go through both the reused pair and a freshly booted pair, compared the two answers as JSON (status, code, body, items, item and the four headers), and threw on any difference. Run on the after tree: Tests 879 passed (879), 6,136 reads compared, 0 diverged. Reverted before the readings above; git diff HEAD was empty after.

Header parse

Both lines parse through readTestBudget (scripts/measure-test-shard-timings.mjs): budgets 20 and 30 at line 2, class spawns the real producer once per single-cause fixture; meta-list-projection-parity declares none.

pnpm --filter @objectstack/runtime typecheck: VERDICT command-exit 0 (check:test-typecheck: OK, 188 errors / 68 pinned signatures held, unchanged). No ablation: no tested behaviour changed.

Acceptance notes

  • The newest reading also lists domain:server packages that are not on the card's list: @objectstack/plugin-audit (src/parent-record-read-leaf.integration.test.ts 35.78 s, src/comment-parent-pair.integration.test.ts 28.07 s), @objectstack/metadata (src/serializers/typescript-serializer-annotation.test.ts 23.74 s), @objectstack/plugin-pinyin-search (src/boot-reconcile.integration.test.ts 17.47 s), @objectstack/plugin-security (16.02, 13.48 s), @objectstack/plugin-auth (13.74, 13.38 s). Noted for the card's list; out of this slice.
  • mcp-package-object-discovery may still read over 10 s on CI after its warm-up (local cut about 8 %), which is why it carries a header; meta-list-projection-parity carries none, and the next refresh is the reading that says whether it is under.
  • Branch claude/project-thread-388dl6 is the card thread's platform-assigned branch; claim 6520622267 names it.

Verification

Local, on 1a5d0aea: node scripts/pm/dispatch-gates.mjs --commands derived 49 families; each run with its exit captured by redirect before any pipe, plus pnpm lint. 48 exit 0 and pnpm lint exit 0; pnpm check:dual-build-cjs-loads exit 3 (packages outside the runtime closure have no dist), NOT MEASURED here and CI's. --ran: 49 derived famil(ies) accounted for — 48 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3), exit 0.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cwb48o186kZzEGZ9a1

…ule scope; declare budgets on two files (#23181 slice 19)

meta-list-projection-parity reads its four census blocks through one
booted dispatcher/RestServer pair per caller instead of booting a fresh
pair per caller per cell. mcp-package-object-discovery pays each shape's
first kernel boot at module scope. It and stored-metadata-reader-contexts
carry a ruled test-budget header (ruling record 6181973363, letter B).

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cwb48o186kZzEGZ9a1
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 30, 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 2e955dde6c058e629a439714695667184f5cb783 → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#1 · os-elon-musk · session_016WV4czVnUdQQCVKSW5J2uk

Seat ACCEPT · PR #28081 · head 1a5d0aea4804a52953f04e4ab049541e695fb585 · 2026-10-30T12:25Z

维护者速读

  • 改了什么:runtime 包 3 个测试文件。投影一致性普查改为每个调用者复用一对已启动的 dispatcher/RestServer;MCP 包对象发现测试在模块顶层先付两种形态的首次启动;两个文件第 2 行加 // test-budget: 声明(20 s、30 s)。只动测试,不动产品代码。
  • 为什么改:test budget (domain:cli): 119 test file(s) over 10 s of wall in the hourly full battery (Part of #23151) #23181 要求单个测试文件不超过 10 s;这三个文件在最近一次计时刷新里是 13.60、14.93、16.31 s。
  • 风险与回滚:断言、超时、分层都不变;一次性证明里复用与重新启动的 6,136 次读取逐字节一致;整包 8,834 个用例名前后一致。回滚即 revert。
  • 先看:meta-list-projection-parity.test.ts 的 censusPair 注释(为什么复用不改变任何答案)。
  • 两分钟验证:单跑该文件,879 个用例全绿,文件耗时约为 main 的一半。
  • 需要你做的:无(测试改动,按本席落地授权落地)。

席位核对

  • Shape: draft → main, Part of #23181 (series card stays open). 3 files, +35/−8, all packages/runtime/src/**/*.test.ts; skip-changeset (runtime ships dist only). check-governed-merges --pr 28081: NOT governed (0 of 3 paths on the register).
  • Declarations: Clause-②: no, Metadata-protocol: none. Test-only, no behaviour change, so no ablation owed.
  • Diff read: censusPair is used only in the four census read loops (row A, item read, layers route, book tree), each a pure GET read compared across the two transports; blocks that assert on a double's calls or boot with options still boot their own. The module-scope warm-up boots and shuts down the first describe's own fixture before any hook, per AGENTS.md (clocks measure behaviour, not loading).
  • Budget headers: both parse through readTestBudget on main (seat re-read): 20 s and 30 s, class spawns the real producer once per single-cause fixture (ruling record 6181973363, letter B). Arithmetic holds: 14.93 × 1.25 = 18.7 → 20; 16.31 × 1.25 = 20.4 → 30.
  • Local (card thread): whole runtime package before and after, 8,834 names, 0 lost / 0 new / 0 changed; dispatch-gates 49 derived, 48 exit 0, 1 NOT MEASURED (check:dual-build-cjs-loads, exit 3, CI's); pnpm lint exit 0.
  • Gate check-runs on this head: 53 total, 35 success, 18 skipped, 0 failed.
  • Noted, not filed here: the PR's Acceptance notes list other domain:server files over 10 s (plugin-audit, metadata, plugin-pinyin-search, plugin-security, plugin-auth) — they belong on the series card's list for a later slice.
  • Landing: non-governed, under the maintainer's landing grant for this seat term (2026-10-30 10:20Z, seat-1 thread). Ready + auto-merge through the relay.

ACCEPT

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 30, 2026 12:26
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 30, 2026 12:26
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 6410029 Oct 30, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-388dl6 branch October 30, 2026 12:43
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