Skip to content

test(cli): authoring-door spawn family — share repeated spawns, declare budgets (#23181 slice 16) - #26493

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-r1ybjk
Oct 27, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-r1ybjk

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Part of #23181 (slice 16). The card is a series and stays open.

Clause-②: no
Metadata-protocol: none

Test-only diff: skip-changeset. Eight files under packages/cli/test/, which is not in @objectstack/cli's files[] (dist, README.md, CHANGELOG.md); no files[] changes in any package.

维护者速读

  • 改了什么:cli 里 8 个「真实调用 os validate / os build / os lint」的作者门测试文件。其中 2 个把重复的同一条 CLI 调用合并成 beforeAll 里跑一次;8 个都在第 2 行加了 // test-budget: 声明。
  • 为什么改:这 8 个文件在 CI 上都超过 10 s。逐个数了调用:6 个文件的每次调用都是不同的(命令、参数、夹具)组合,耗时下限就是调用次数,按裁决 6181973363 B 声明预算;2 个对等性文件把同一组合跑了 2–3 次,合并后本地实测各快约 43%。
  • 风险与回滚:无运行时风险,只动测试;每条断言原样保留、含义不变,未改超时与分层。回滚即 revert 本 PR。
  • 先看:packages/cli/test/lint-per-package-authoring-parity.test.ts 的 beforeAll、packages/cli/test/validate-per-package-authoring-parity.test.ts 的 beforeAll(唯二有逻辑改动的地方),其余 6 个文件只有第 2 行。
  • 两分钟验证:cd packages/cli && pnpm exec vitest run --project integration test/lint-per-package-authoring-parity.test.ts test/validate-per-package-authoring-parity.test.ts,预期 2 个文件 9 个用例全绿,单文件约 14–17 s。
  • 需要你做的:无,席位落地。

What changes

Counted from the code (spawns = CLI child processes per file run; triples = distinct command, flags and fixture):

file CI max (s) tests spawns before distinct triples change budget
test/stack-conversion-record-door.test.ts 141.61 22 24 24 header 180
test/stack-provenance-door.test.ts 60.77 12 12 12 header 80
test/picklist-reference-doors.test.ts 57.37 11 11 11 header 80
test/lint-per-package-authoring-parity.test.ts 43.77 5 9 5 shared beforeAll (9 → 5 spawns) + header 60
test/union-fold-command-parity.test.ts 33.65 9 9 9 header 50
test/package-union-readers.test.ts 32.22 7 9 9 header 50
test/validate-per-package-authoring-parity.test.ts 28.80 4 7 4 shared beforeAll (7 → 4 spawns) + header 40
test/validate-view-container-name.test.ts 20.34 5 4 4 header 30

No file is under 10 s in any reading, so every file gets a header.

The two hoists. In lint-per-package-authoring-parity the cases spawned os build --json on the flip fixture three times and os lint --json on it three times. In validate-per-package-authoring-parity the cases spawned os build --json on the multi-package fixture three times and os validate --json on it twice. Each file now runs each distinct triple once, in sequence, in its existing beforeAll, and each case reads the shared run of its triple. Every assertion is unchanged, in the same case, on the output of the same command, flags and fixture. The hook's timeout is the old per-case allowance (180 s) times the spawns it runs, so no per-spawn allowance moved. The spawns stay sequential: no in-file concurrency.

The header. One line at line 2 of each file, the ruled grammar // test-budget: N — spawns the real producer once per single-cause fixture: REASON (ruling record 6181973363, letter B; grammar readTestBudget in scripts/measure-test-shard-timings.mjs). N = slowest CI reading x 1.25, rounded up to the next 10 s. After the hoists every remaining spawn in all eight files is a distinct triple, so the spawn count is the floor.

Why

The reading. No shard-timings refresh has run on main since the oclif test manifest (PR #26256). The CI numbers are the vitest module lines (they include beforeAll) of the three scheduled full-battery ci.yml runs on main after it, all with the manifest setup on:

file 40392443783 (69aa630b9f) 40424746941 (e843b5b320) 40447801748 (26e7c75e9a)
stack-conversion-record-door 141.61 98.16 97.84
stack-provenance-door 60.77 59.62 37.58
picklist-reference-doors 43.88 56.55 57.37
lint-per-package-authoring-parity 43.77 42.36 26.12
union-fold-command-parity 33.65 32.07 20.57
package-union-readers 22.68 30.03 32.22
validate-per-package-authoring-parity 28.80 21.83 24.89
validate-view-container-name 20.34 19.96 12.91

The first two columns are slice 15's readings (report on #23181). The third run is newer, so it was read too (its Test Core shards via get_job_logs: 510 cli file lines; the run's own failure is in Test UI (1/16), not Test Core).

The two hoisted files keep the pre-hoist budget. Their budgets come from CI readings of the 9-spawn and 7-spawn shapes, the only CI readings that exist. Locally the hoist cuts them by about 44%. A shard-timings refresh re-sizes the budget from the new shape; it is not lowered by hand.

Tests

A/B of the two hoisted files (N=3, one lock hold)

The BASE file (775a0006bd) copied next to the HEAD file as test/zzbase-*.test.ts, all four in one run, cd packages/cli && pnpm exec vitest run --project integration --maxWorkers=1 --reporter=default, three runs in one os-verify-lock hold on a shared 4-vCPU container, manifest setup on (queue tier). The copies were deleted before the gates ran. Each run: Test Files 4 passed (4), Tests 18 passed (18), exit 0.

file BASE (s) HEAD (s) change
lint-per-package-authoring-parity 32.21 / 30.80 / 30.29 17.36 / 17.08 / 17.25 about -44% (9 → 5 spawns)
validate-per-package-authoring-parity 25.54 / 23.35 / 24.31 13.72 / 13.77 / 14.67 about -43% (7 → 4 spawns)
The family on this head

Same command, --maxWorkers=2, the eight files: Test Files 8 passed (8), Tests 75 passed (75), exit 0, run wall 155.3 s. Per file (s): stack-conversion-record-door 102.2, stack-provenance-door 41.6, picklist-reference-doors 38.5, union-fold-command-parity 23.8, package-union-readers 20.2, lint-per-package-authoring-parity 18.3, validate-view-container-name 14.1, validate-per-package-authoring-parity 13.9.

Header parse, before and after

readTestBudget on each file at BASE 775a0006bd returns null for all eight (a file over 10 s with no declared budget, the offender reading). On this head all eight return class spawns the real producer once per single-cause fixture at line 2, seconds 180 / 80 / 80 / 60 / 50 / 50 / 40 / 30.

Typecheck and lint

pnpm --filter @objectstack/cli typecheck: VERDICT command-exit 0 (check:test-typecheck: OK). pnpm exec eslint --no-inline-config on the eight files: exit 0.

Acceptance notes

  • Pin: the next shard-timings refresh lists none of these eight files in its over-budget table. Each appears under the budget it declares, and comes back only if a run reads it over its own budget.
  • Nothing else repeats a triple in this family. package-union-readers already ran its nine distinct spawns in shared beforeAll hooks, two at a time; that pre-existing shape is untouched.
  • Next unheadered family (out of scope here, per the order): test/verify-*.test.ts.

Verification

Local gates at 35212c7e: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 48 commands. Each ran with its exit code captured by redirect before any pipe: 47 exit 0. check-plugin-teardown-shape.mjs --self-test first exited 3 on the shallow clone and exited 0 after git fetch origin 621a487607. pnpm check:dual-build-cjs-loads exited 3 (PREREQUISITE NOT MET: it needs every package's dist/, and only the cli dependency closure was built); it is NOT MEASURED locally and runs in CI. --ran reconciliation: 48 derived famil(ies) accounted for — 47 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3), exit 0.

The three artifact-roster families whose roster sits under packages/ were run too: pnpm check:authz-resolver, pnpm check:error-code-casing and pnpm check:filter-alias-parity, each exit 0. The repo-wide pnpm lint and the test:repo project are left to CI (Lint & Repo Gates, Test Core).

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (eslint on the eight files locally; the repo-wide run is CI's)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (publishes nothing: skip-changeset)
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5pUpKjymejZTAe9SWn


Generated by Claude Code

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 · ACCEPT · domain:server seat 1 · os-project-manager · session_01R1q2xdtYgU6FKrZ7LgjPCC · 2026-10-27T05:28Z

Head 35212c7ebf, report 6434324319 (on #23181), claim 6433822478. No contract review is owed: there is no packages/spec/** diff, no governed path, no narrowing and no Clause-②: yes.

item reading
Shape Draft, base main, Part of #23181 (slice 16), skip-changeset (test-only, no files[] change). 8 files in packages/cli/test, +77/−38, all inside the claimed family.
Fix 6 of the 8 files spawn only distinct (command, flags, fixture) triples, so each gets the ruled // test-budget: header at line 2 (ruling 6181973363 letter B). In the 2 per-package parity files, triples repeated: lint parity spawned 9 times for 5 triples, validate parity 7 times for 4. Each now runs every triple once in its beforeAll, and each case reads the shared result.
Seat check The sorted expect( lines of both hoisted files are identical to main's, so every assertion keeps its meaning. The beforeAll allowance is the old per-case 180 s times the spawn count, which is not a raise per spawn. The seat recomputed all 8 budgets from the slowest of three scheduled CI readings × 1.25, rounded up to 10 s: 141.61→180, 60.77→80, 57.37→80, 43.77→60, 33.65→50, 32.22→50, 28.80→40, 20.34→30.
Evidence CI on head 35212c7ebf is green: 36 checks succeeded, 16 were expected skips, and none failed or are pending; mergeable clean. Locally the family ran 75 of 75 green on the head. A/B N=3 for the hoisted files: lint parity 30–32 s → 17 s, validate parity 23–26 s → 14 s. Derived gates: 48, of which 47 exit 0 and 1 is NOT MEASURED locally (check:dual-build-cjs-loads, which needs a full build and which CI runs).
Carried The two hoisted files' budgets (60, 40) come from readings taken before the hoist. The next shard-timings refresh re-sizes them; this PR lowers none by hand, as ordered. Slice 17 (the os verify family, claim 6434344323) is live on other files.
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

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 27, 2026 05:29
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 27, 2026 05:29
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit 6f1e195 Oct 27, 2026
53 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-r1ybjk branch October 27, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

2 participants