Skip to content

test(scenarios): give the external-driver crm run a measured 30s budget and a lighter stand-in - #31284

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-mickba
Nov 7, 2026
Merged

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #31281

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:@objectstack/scenarios 的外部驱动端到端用例改为显式 30 秒超时,并在用例旁写明实测数据;测试用的替身命令不再加载 node:crypto,key 指纹从 SHA-256 改为 FNV-1a。只改测试,不动 src/。
  • 为什么改:这个用例每个回合启动一次替身进程,连续 45 次。本地 2.2–2.5 秒,负载高的 Test Core 分片上被 vitest 默认 5 秒超时在 5042ms 截断,把 main 合并队列里别人的 PR 弹出去(fix(auth): record an MCP access token as used only after the MCP door admits the call #31247 两次)。
  • 风险与回滚:只改测试文件与其替身,不发布(skip-changeset)。回滚即 revert。
  • 先看:packages/qa/scenarios/test/runner/external-driver.test.ts 末尾的超时和注释。
  • 两分钟验证:pnpm --filter @objectstack/scenarios exec vitest run test/runner/external-driver.test.ts,预期 8/8 通过。
  • 需要你做的:无,席位落地。

What changes

  • test/runner/external-driver.test.ts, the case "a full crm run through the command…": an explicit 30 000 ms budget instead of vitest's 5 s default, with the measurement written beside it.
  • test/runner/fixtures/fake-external-driver.mjs: the stand-in no longer imports node:crypto. It fingerprints the key it read with FNV-1a (32-bit hex) as keyPrint. The test computes the same function and now also asserts that this run's keys have distinct fingerprints, so the membership check cannot pass by collision.

Root cause. The case starts the stand-in once per turn, one after another: 45 starts (3 author calls; 42 asks over scratch run, scratch iterate-run and template iterate-run, measured from the call log). Each start costs about 50 ms locally, and node's own start-up is about 35 ms of that. On a Test Core shard one start took 212 ms (the info case in the failing job), and this case was cut off at 5042 ms. Both modes are kept: each mode boots its own app and issues its own keys.

Tests

  • Per-start cost, 30 starts each, on this container: bare node about 35 ms; with node:fs/node:path about 39 ms; with node:crypto added 41 to 45 ms. That is the stand-in's start-up before and after.
  • The case, 5 local runs each: before 2374 to 2520 ms; after 2186 to 2425 ms.
  • pnpm --filter @objectstack/scenarios exec vitest run test/runner/external-driver.test.ts: Test Files 1 passed (1), Tests 8 passed (8).

Acceptance notes

Verification

On 31dffb8d: pnpm --filter @objectstack/scenarios typecheck exit 0; scoped lint node --stack-size=4000 node_modules/eslint/bin/eslint.js packages/qa/scenarios/test/runner --no-inline-config exit 0; node scripts/check-nul-bytes.mjs exit 0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5mx64pxVGCbKfuxEwi

…et and a lighter stand-in

The end-to-end case starts the stand-in command once per turn, 45 times
in a row, and vitest's 5s default cut it off at 5042ms on a loaded Test
Core shard. The case now declares a 30s budget, with the measurement
written beside it. The stand-in drops node:crypto (about 7ms a start) and
fingerprints the key with FNV-1a instead of SHA-256.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5mx64pxVGCbKfuxEwi
@github-actions

github-actions Bot commented Nov 7, 2026

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 b3bd75d813ad57b9829b5ff63e84cb2524570fc7 → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:devx#3 · os-project-manager · session_01FEkQ5njkh3xbcDN6EtSfw7

席位核对

Verdict: ACCEPT · head 31dffb8d625736d4915dfcf02c48a51f2af7b0a4 · card #31281 · report 6713716121.

  • Shape: draft → main, Fixes #31281; 2 files, +33/-11, both test-side (test/runner/external-driver.test.ts and its stand-in fixtures/fake-external-driver.mjs), inside the claim's surface; nothing in src/. NOT governed.
  • Root cause, read in the diff and report: the end-to-end case starts the stand-in 45 times in a row (3 author calls, 42 asks across scratch run, scratch iterate-run and template iterate-run). That is 2.2–2.5 s locally at about 50 ms a start. One CI start took 212 ms, and the case was cut off at 5042 ms (merge-queue run 42414930416).
  • Fix: an explicit 30 s budget on that case, measured, with the measurement in a comment beside it (the PR feat(scenarios): publish @objectstack/scenarios with an objectstack-scenarios CLI (npx), carrying the open cards only #31221 pattern). The stand-in drops node:crypto (about 7 ms a start) and fingerprints the key with FNV-1a. A new keys.size assertion pins that the fingerprints still tell every persona's key apart. Both modes are kept, and nothing the case pins (0600 file only, zero artifacts hold the key) was loosened.
  • Gates: the file passes 8/8 locally; typecheck, scoped lint and nul-bytes exit 0. The dev skipped the full local dispatch-gates loop to land fast (deviation accepted: test-only, two files). CI was still running on this head at ACCEPT; auto-merge and the merge queue wait for every required check.
  • Changeset: test-only ⇒ skip-changeset correct. Clause-②: no.
  • Noted, not filed: codex-driver.test.ts took 7.6 s for its 12 cases in the same job, with none failing; the seat watches it.
  • Landing: this red dequeued fix(auth): record an MCP access token as used only after the MCP door admits the call #31247 twice, so it lands now, under 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z) and 「你应该使用 pm-dispatch 技能审核和落地pr」 (2026-11-07T16:59Z): pr_ready + automerge_enable.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 7, 2026 22:15
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 7, 2026 22:15
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 59d9815 Nov 7, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-mickba branch November 7, 2026 23:10
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.

scenarios: external-driver.test.ts's full crm run hits vitest's 5 s default timeout on loaded Test Core shards and merge-queue runs

1 participant