Skip to content

test: overlap independent CLI build admission outcomes - #132091

Merged
steipete merged 1 commit into
mainfrom
test/perf-cli-admission-outcomes
Aug 28, 2026
Merged

steipete merged 1 commit into
mainfrom
test/perf-cli-admission-outcomes

Conversation

@steipete

@steipete steipete commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The CLI build-admission tests spend time running three independent process scenarios serially inside each table row. This adds avoidable latency to the tooling-isolated test lane.

Why This Change Was Made

Overlap only exit 0, exit 7, and SIGTERM inside each of the eleven existing rows using Promise.allSettled. Keep rows serial because their hooks share argv, environment, mocks, and module state. Every scenario retains its own fixture root, builder/preload, PID/readers facts, CLI pipes/output, and joined cleanup. Outcome-labelled assertions report failures after all three finalizers finish.

This also joins the actual CLI close event and builder death after failed assertions before removing the scenario root. No production code, concurrency configuration, timeout deadline, module-reset behavior, or runtime contract changes. This is distinct from the previously rejected resetModules-only experiment.

User Impact

No user-facing behavior change. Developer test latency improves while retaining all 61 registrations and all 33 real outcome executions. Production LOC: +0/-0. Tests: +87/-56 (net +31), for scenario ownership, joined failure cleanup, and labelled diagnostics.

Evidence

AI-assisted implementation and isolated Codex review; no accepted/actionable P0 findings. Test-audit and deslop complete. Full changed gate passed. Local focused 61/61 and owner/sibling 406/406 passed, including shuffled seeds 17 and 91.

Balanced benchmark

One task-owned Blacksmith Testbox (4 visible CPUs, Node v24.19.0, pnpm 11.22.0), source base a939d4bdd811013e2e9469501a95d1f682f134f3, one Vitest worker, distinct filesystem module cache for every invocation, import diagnostics enabled, /usr/bin/time -v, excluded A/B warmups. Eight pairs per scope in AB, BA, AB, BA, BA, AB, BA, AB order. No failed samples dropped. Run: https://github.com/openclaw/openclaw/actions/runs/33207023010. The Testbox lease was explicitly stopped after evidence collection; its workflow wrapper may show cancelled. Successful wrapper command exits and individual results, not that terminal workflow status, are the benchmark proof. Exact-head PR CI is separate.

Scope A wall B wall Saving Favorable
Whole file 51.236s 48.601s 2.635s / 5.14% 7/8
CLI runtime table 5.377s 3.756s 1.621s / 30.14% 8/8
Pair Whole A/B seconds Filtered A/B seconds
1 52.0373 / 51.3489 5.1264 / 3.4250
2 51.4738 / 48.2252 5.2807 / 3.4226
3 51.2279 / 50.1335 5.0450 / 3.8621
4 53.8486 / 47.4711 5.4163 / 3.3138
5 52.7672 / 53.0210 5.6181 / 4.9035
6 46.4722 / 43.3155 5.8146 / 3.8718
7 50.2283 / 48.3491 5.2587 / 3.6757
8 51.8311 / 46.9417 5.4570 / 3.5762
Scope/variant Vitest Test body Import CPU user/system Max RSS (KiB, mean)
whole/A 50.445s 49.377s 0.0519s 53.014/2.439s 685711
whole/B 47.816s 46.824s 0.0466s 52.097/2.345s 698114
rows/A 4.714s 3.855s 0.0424s 6.384/1.191s 487768
rows/B 3.050s 2.109s 0.0461s 6.755/1.272s 483918

Within the whole-file measurements, the sum of the eleven CLI row bodies fell from4.154s to2.085s.

Whole-file paired 95% t interval for the saving: 0.770–4.500s; filtered: 1.236–2.005s. These are measurements on this runner, not a universal CI speed claim. The process tradeoff is explicit: sampled descendant peak 9 → 12; whole-file peak aggregate process-tree RSS 1,021,812 → 1,237,172 KiB. No broader concurrent test registration.

The timed candidate was frozen before refinements to fallback PID readiness, cleanup-finally ordering, and soft outcome reporting. The first two affect only failure cleanup; soft reporting adds 33 synchronous assertion-context wrappers on passing runs. Process work, successful await order, and overlap are unchanged. Exact final-form process/fault and repeated tests are recorded below; the paired numbers are not relabelled as measurements of those later diagnostic refinements.

Reproduction command (use a distinct cache path for each A/B invocation):

/usr/bin/time -v env OPENCLAW_VITEST_MAX_WORKERS=1 \
  OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/tmp/admission-unique-cache \
  OPENCLAW_VITEST_IMPORT_DURATIONS=1 OPENCLAW_VITEST_PRINT_IMPORT_BREAKDOWN=1 \
  node scripts/run-vitest.mjs test/scripts/test-projects-build-admission.test.ts \
  --maxWorkers=1 --reporter=verbose
# Filtered scope adds: -t 'CLI runtime admission.*blocks'

Final-form structure and reversible faults

Temporary observation-only instrumentation verified before and after: 33 CLI + 33 builder + 12 reader processes, 33 distinct roots and distinct PIDs, all 33 outcomes verified, outer-row overlap absent, scenario peak 1 → 3. All mode/script/cwd/argument cases remain. No test registration or five-second readiness/close/death deadline was removed or shortened.

Reversible production faults were applied only on the task-owned runner, one at a time:

Fault Distinct failure Unaffected outcomes
Return from preparation before build completes All 33 detect a reader before completion (true vs false) All three outcomes remain observed in every row; this owner defect affects all three
Convert nonzero builder status to 0 All eleven exit-7 scenarios see 0 instead of 7 22 exit-0/SIGTERM scenarios verify successfully
Convert signal status to 0 All eleven SIGTERM scenarios see 0 instead of 143 22 numeric scenarios verify successfully
Remove SIGTERM forwarding/cancellation All eleven SIGTERM scenarios hit the existing five-second close deadline 22 numeric scenarios verify successfully

Every injected-fault row joined its three finalizers, with no surviving CLI/builders/readers or fixture roots. Both production owners were byte-for-byte restored and hash-checked; the restored table passed all 33 outcomes. Instrumentation is not retained in the PR.

Final-form Linux: three whole-file repeats passed61/61; seven-file owner/sibling sets in normal order and shuffled seeds17/91 each passed406/406 (61 tooling-isolated +345 tooling). All49 monitored benchmark, structure/fault/restoration, repeat and sibling invocations had zero observed surviving descendants or fixture roots. The whole-file repeats took64.425s,48.722s,49.256s; these are validation timings, not additional paired samples. Raw per-case test bodies, import diagnostics, CPU/RSS, and lifecycle observations were retained as task evidence (217 artifacts). The Testbox sync commit differs from the source baseline only in this test; final test and all628 checked script/helper/config/dependency-manifest hashes match the local source.

Latest-main refresh to 02a162b8bf2: admission runtime/helpers/config/dependencies unchanged. The declaration-owner arrival expanded managed-process coverage; the refreshed admission + managed-process + run-tsgo set passed127/127 with seed91. Fresh isolated Codex review again reports no actionable P0 findings. The complete changed gate also passed after this refresh.

Repaired-main refresh and two-CPU runner proof

Refreshed onto repaired main 5b605da389460fd035d9a2031064ed949303b14f; new head 5d9e4d2f8cce39ac25045de57fda7808a323bf27. Rebase had no conflicts. Stable patch ID 61419e2058853ab837e9e4fff10e97062d56d4ff and test SHA-256 6d0987f4aa271e0d5e4b23daff33ca8310297eab1af2a1835357cc16dfcd1557 are unchanged; git range-diff reports equality. No test, production behavior, or assertion changed. The prior clean isolated Codex reviews therefore remain applicable; no redundant review was run for this byte-identical refresh.

ClawSweeper's smallest-runner resource move is now measured on a fresh Testbox: Node24.19.0/pnpm11.22.0; host4 CPUs, harness and children restricted to CPUs0–1; nproc=2 and Node availableParallelism=2, normal two-worker cap. This is a real two-CPU execution restriction, not the prior unrestricted four-CPU proof. No memory cgroup cap was imposed; RSS below is measured, not a claim of identical hosted hardware.

Two-CPU measurement Serial baseline Accepted overlap
Table mean wall,8 balanced pairs 8.493s 7.427s
Table mean Vitest 7.543s 6.326s
Table mean test body 5.909s 4.579s
Table mean CPU user/system 8.338/1.459s 8.970/1.521s
Table peak aggregate process-tree RSS 955,224KiB 1,215,560KiB
Table peak descendants 9 13
Full8-file isolated lane 187/187 187/187
Full-lane peak aggregate RSS 2,085,304KiB 1,993,664KiB
Full-lane peak descendants 11 12

The table saves 1.065s /12.54%, with6/8 favorable pairs; warmups excluded, no failed samples dropped. Full-lane before/after59.189/54.342s are one validation run each, not a new paired speed benchmark. Sampled full-lane descendants were checked to stay within CPUs0–1. Three exact final-form whole-file repeats passed 61/61 in52.718,51.150,49.445s.

Instrumented two-CPU before/after runs retain 33 CLI +33 builder +12 reader processes,33 distinct roots, all33 outcomes, outer rows serial, inner scenario peak1→3. All25 monitored invocations (warmups, paired table, whole-file, structure and full lane) had zero failures, surviving descendants, fixture roots or temporary-namespace contents. Existing four-fault proof is retained; this refresh changes none of its owners. Final target/runtime/helper hashes match locally and remotely, and the Testbox is stopped. Raw113 artifacts are retained locally.

Remote proof: https://github.com/openclaw/openclaw/actions/runs/33213447220 (Testbox lifecycle may show cancelled after explicit stop; command exits and retained results prove the runs). Fresh exact-head CI: https://github.com/openclaw/openclaw/actions/runs/33213456173. Its Linux build is green at 345,140B startup gzip, below even the original 347,037B limit. Full exact-head CI completed SUCCESS on this head. The latest21:45UTC ClawSweeper review requests only this CI and the compact-runner proof above; both are now satisfied. Proceeding through native prepare/merge without bypass.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 28, 2026
@steipete
steipete marked this pull request as ready for review August 28, 2026 20:46
@steipete

steipete commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor Author

The original UI budget blocker is repaired by #132124, merged as 5b605da. Its exact-head Linux build measured345,110B against the unchanged347,037B limit, and merged-main validation with a read-only copy of that original baseline measured345,136B. This repair did not change the baseline; concurrent unrelated #132020 did, and the original-limit proof is retained separately.

This PR is now rebased without changing its patch to 5d9e4d2f8cce39ac25045de57fda7808a323bf27. Fresh Linux build is green at345,140B, also below the original limit. The requested two-CPU resource proof passed; details are in the updated existing proof comment: #132091 (comment).

Fresh CI: https://github.com/openclaw/openclaw/actions/runs/33213456173. All jobs completed and exact-head CI is SUCCESS. Both the UI blocker and requested two-CPU proof are resolved; repository-native prepare/merge is proceeding without bypass. The old red run33209653401 is retained as historical blocker evidence, not waived or called passing.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 5:45 PM ET / 21:45 UTC.

ClawSweeper review

What this changes

The branch runs three independent CLI build-admission exit scenarios concurrently within each existing test row while preserving separate fixtures and joined cleanup.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. The test-only change has no source-proven correctness defect, but its higher concurrent process envelope still needs confirmation on the smallest applicable CI runner; this is also a maintainer-owned, assigned PR.

Priority: P3
Reviewed head: 5d9e4d2f8cce39ac25045de57fda7808a323bf27

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused, source-consistent test improvement with a remaining CI resource-envelope check.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test-only change is exempt from the external-contributor proof gate; supplied real-process fault evidence is consistent with the exercised CLI boundary but was not rerun in this read-only review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored test-only change is exempt from the external-contributor proof gate; supplied real-process fault evidence is consistent with the exercised CLI boundary but was not rerun in this read-only review.
Evidence reviewed 5 items Introduced test isolation: Each concurrent outcome receives a separate temporary-directory tracker and its own child process, then all outcomes settle before assertions report results.
Cleanup ordering: The test retains the real close event, kills an unfinished child, waits for builder death, and only then removes that scenario’s fixture root.
Admission owner behavior: Both CLI owners await build preparation and return before dispatching readers when preparation is nonzero.
Findings None None.
Security None None.

How this fits together

The CLI admission test invokes OpenClaw’s test-project and extension-batch scripts, which must finish build preparation before launching reader processes. The test checks successful, failing, and SIGTERM outcomes through real child-process boundaries.

flowchart LR
  A[CLI test row] --> B[Three outcome scenarios]
  B --> C[Separate fixture roots]
  C --> D[Build admission scripts]
  D --> E[Reader child processes]
  E --> F[Joined close and cleanup checks]
Loading

Before merge

  • Resolve merge risk (P1) - Concurrent child-process scenarios increase the observed process-tree RSS and descendant count; compact two-CPU runner capacity has not yet been demonstrated.
  • Complete next step (P2) - Await exact-head CI and the outstanding compact-runner envelope confirmation; no discrete code repair is identified.
Agent review details

Security

None.

PR surface

Tests +31. Total +31 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 87 56 +31
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 87 56 +31

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +87/-56 (net +31) All introduced lines are test fixture ownership, joined cleanup, and per-outcome diagnostics; no runtime contract changes.

Merge-risk options

Maintainer options:

  1. Verify the compact-runner envelope (recommended)
    After the merged UI-budget repair, run the isolated tooling test on the smallest applicable CI runner and retain its process and completion evidence.
  2. Accept the measured envelope
    A maintainer may intentionally accept the documented higher process footprint if compact-runner capacity is not required for this lane.

Technical review

Best possible solution:

Retain the scoped concurrent scenario structure, complete exact-head CI, and prove the isolated tooling test fits the smallest applicable runner before merge.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR changes test scheduling rather than reporting a user-facing defect.

Is this the best way to solve the issue?

Yes, subject to runner-envelope proof: concurrency is limited to independent process trees while row-level shared hooks and module state remain serial.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5b605da38946.

Labels

Label changes:

  • add P3: This is internal test-lane performance work with no claimed user-facing behavior change.
  • add merge-risk: 🚨 automation: The introduced three-process overlap raises measured resource use and has not yet been shown to fit the smallest applicable CI runner.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored test-only change is exempt from the external-contributor proof gate; supplied real-process fault evidence is consistent with the exercised CLI boundary but was not rerun in this read-only review.

Label justifications:

  • P3: This is internal test-lane performance work with no claimed user-facing behavior change.
  • merge-risk: 🚨 automation: The introduced three-process overlap raises measured resource use and has not yet been shown to fit the smallest applicable CI runner.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored test-only change is exempt from the external-contributor proof gate; supplied real-process fault evidence is consistent with the exercised CLI boundary but was not rerun in this read-only review.

Evidence

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored the current change and the immediately preceding build-admission repair spanning the test and script owners. (role: feature author and recent area contributor; confidence: high; commits: 5d9e4d2f8cce, f40e5f27a0d8, dd81c6aa1d1a; files: test/scripts/test-projects-build-admission.test.ts, scripts/test-projects.mts, scripts/lib/managed-child-process.mts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let exact-head CI complete and demonstrate the isolated tooling test on the smallest applicable runner, redacting any private runner details.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-28T20:56:27.907Z sha 6d5f45891f6bdb861df4bd18e24482846e6072f4 :: needs maintainer review before merge. :: none

@steipete

steipete commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Refreshed onto repaired main 5b605da389460fd035d9a2031064ed949303b14f; new head 5d9e4d2f8cce39ac25045de57fda7808a323bf27. Rebase had no conflicts. Stable patch ID 61419e2058853ab837e9e4fff10e97062d56d4ff and test SHA-256 6d0987f4aa271e0d5e4b23daff33ca8310297eab1af2a1835357cc16dfcd1557 are unchanged; git range-diff reports equality. No test, production behavior, or assertion changed. The prior clean isolated Codex reviews therefore remain applicable; no redundant review was run for this byte-identical refresh.

ClawSweeper's smallest-runner resource move is now measured on a fresh Testbox: Node24.19.0/pnpm11.22.0; host4 CPUs, harness and children restricted to CPUs0–1; nproc=2 and Node availableParallelism=2, normal two-worker cap. This is a real two-CPU execution restriction, not the prior unrestricted four-CPU proof. No memory cgroup cap was imposed; RSS below is measured, not a claim of identical hosted hardware.

Two-CPU measurement Serial baseline Accepted overlap
Table mean wall,8 balanced pairs 8.493s 7.427s
Table mean Vitest 7.543s 6.326s
Table mean test body 5.909s 4.579s
Table mean CPU user/system 8.338/1.459s 8.970/1.521s
Table peak aggregate process-tree RSS 955,224KiB 1,215,560KiB
Table peak descendants 9 13
Full8-file isolated lane 187/187 187/187
Full-lane peak aggregate RSS 2,085,304KiB 1,993,664KiB
Full-lane peak descendants 11 12

The table saves 1.065s /12.54%, with6/8 favorable pairs; warmups excluded, no failed samples dropped. Full-lane before/after59.189/54.342s are one validation run each, not a new paired speed benchmark. Sampled full-lane descendants were checked to stay within CPUs0–1. Three exact final-form whole-file repeats passed 61/61 in52.718,51.150,49.445s.

Instrumented two-CPU before/after runs retain 33 CLI +33 builder +12 reader processes,33 distinct roots, all33 outcomes, outer rows serial, inner scenario peak1→3. All25 monitored invocations (warmups, paired table, whole-file, structure and full lane) had zero failures, surviving descendants, fixture roots or temporary-namespace contents. Existing four-fault proof is retained; this refresh changes none of its owners. Final target/runtime/helper hashes match locally and remotely, and the Testbox is stopped. Raw113 artifacts are retained locally.

Remote proof: https://github.com/openclaw/openclaw/actions/runs/33213447220 (Testbox lifecycle may show cancelled after explicit stop; command exits and retained results prove the runs). Fresh exact-head CI: https://github.com/openclaw/openclaw/actions/runs/33213456173. Its Linux build is green at 345,140B startup gzip, below even the original 347,037B limit. Full exact-head CI completed SUCCESS on this head. The latest21:45UTC ClawSweeper review requests only this CI and the compact-runner proof above; both are now satisfied. Proceeding through native prepare/merge without bypass.

@steipete
steipete force-pushed the test/perf-cli-admission-outcomes branch from 6d5f458 to 5d9e4d2 Compare August 28, 2026 21:38
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 28, 2026
@steipete
steipete merged commit 8ea0711 into main Aug 28, 2026
161 checks passed
@steipete
steipete deleted the test/perf-cli-admission-outcomes branch August 28, 2026 21:56
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant