Skip to content

improve: speed up updater preview signal tests - #150439

Merged
steipete merged 1 commit into
mainfrom
codex/preview-signal-test-runtime
Sep 17, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/preview-signal-test-runtime

Conversation

@steipete

@steipete steipete commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Nine updater preview-signal tests repeatedly load the TypeScript runtime in fresh child processes; they account for 70.4 of 79.4 seconds of this test file in a recent main CI run.

User Impact

Faster test execution with no user-visible runtime change. All nine signal scenarios, fresh state directories, IPC handshakes, database assertions, deadlines and child cleanup remain intact. No additional shards or workers.

Why This Change Was Made

Use the shared compiled test runtime already used by the neighboring mutable-signal tests. Reuse the existing command, ledger, state and recovery declarations, and expose the already-loaded signal-barrier module through the same test build. Source/watch execution retains its TypeScript preload.

Evidence

Same-checkout Node 24 / pnpm 12.4 comparison: all nine cases pass; summed case time falls from 43.585s to 9.462s (78.3%). The complete targeted invocation, including preparation and cleanup, falls from 63.48s to 22.18s. These are local measurements, not a whole-CI speedup claim.

The complete updater-run and mutable-signals files pass all 54 cases with the frozen dependency install. The neighboring one-shot-exit file also passed 36 cases. Independent P2 review is clean. Changed-scope checks pass, including the full core-test typecheck, dead-code guards and targeted lint. Exact-head Linux CI passes the changed-test and boundary jobs. On its two-CPU/8.22-GB runner, all nine preview cases pass in 8.228s combined (0.869–0.985s each); the full 44-case file passes in 15.34s. The existing shared build takes 12.377s for the complete changed-test job. These native results confirm behavior and fast execution, not a matched Linux before/after comparison. Source-mode URL checks retain all five original modules and the TypeScript preload.

Production LOC delta: zero. Test/test-support delta: +21/-6.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 17, 2026 01:03
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS maintainer Maintainer-authored PR labels Sep 17, 2026
@clawsweeper clawsweeper Bot added 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 Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 9:10 PM ET / September 17, 2026, 01:10 UTC.

ClawSweeper review

What this changes

The PR runs updater preview-signal tests through the existing compiled test runtime while retaining TypeScript loading for source/watch execution.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused optimization: current main still loads TypeScript separately for these preview tests. No actionable correctness or security defect was found, and the maintainer-protected PR is not a cleanup candidate.

Priority: P3
Reviewed head: d762e57deac19f43a017751bbf3b768e65bfd2e0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused optimization that reuses established infrastructure, preserves coverage, and includes relevant reported validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR changes test loading only and does not trigger the external-contributor proof gate; its reported measurements exercise the affected child-process signal scenarios.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR changes test loading only and does not trigger the external-contributor proof gate; its reported measurements exercise the affected child-process signal scenarios.
Evidence reviewed 6 items Introduced change preserves behavioral coverage: The complete introduced patch changes module URLs and conditional preload selection. All nine scenarios retain their IPC readiness handshake, signal delivery, database assertions, sibling-record checks, timeout, and child cleanup. The introduced diff passes git diff --check.
Existing compiler owns the new entry: The worker build collects every update executor declaration alongside the ledger and state declarations into its shared build. Adding signalExitBarrier therefore creates the referenced compiled entry without adding a production export or separate compiler.
Source and compiled execution remain consistent: The Vitest plugin redirects registered declarations only for repository-runner execution; standalone Vitest and watch retain source declarations. The URL resolver selects source siblings or compiled dist paths, and neighboring mutable-signal tests already use the same preload pattern.
Findings None None.
Security None None.

How this fits together

Updater preview tests launch isolated child processes, send operating-system signals, and inspect update-history records afterward. The shared test compiler supplies the same runtime modules without repeated TypeScript startup.

flowchart TD
  A[Preview signal tests] --> B{Test execution mode}
  B -->|Repository runner| C[Shared compiled modules]
  B -->|Source or watch| D[TypeScript preload]
  C --> E[Isolated child process]
  D --> E
  E --> F[Signals and exit handling]
  F --> G[History and cleanup assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +15. Total +15 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 21 6 +15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 21 6 +15

Review metrics

Metric Value Why it matters
Reported targeted invocation time 63.48s → 22.18s The reported comparison includes preparation and cleanup, supporting a net benefit beyond individual case timings.

Technical review

Best possible solution:

Reuse the shared compiled graph while preserving source/watch execution and every existing signal and state-preservation assertion.

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

Not applicable as a product bug: this is a test-performance optimization with an author-reported before/after comparison; timings were not independently rerun.

Is this the best way to solve the issue?

Yes. Reusing the existing compiler and declaration mechanism follows the neighboring signal tests and avoids weakening coverage or introducing another runtime owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e1804606aebc.

Labels

Label changes:

  • add P3: This improves test execution speed without changing user-facing updater behavior.
  • 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: The maintainer-authored PR changes test loading only and does not trigger the external-contributor proof gate; its reported measurements exercise the affected child-process signal scenarios.

Label justifications:

  • P3: This improves test execution speed without changing user-facing updater behavior.
  • 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: The maintainer-authored PR changes test loading only and does not trigger the external-contributor proof gate; its reported measurements exercise the affected child-process signal scenarios.

Evidence

What I checked:

  • Introduced change preserves behavioral coverage: The complete introduced patch changes module URLs and conditional preload selection. All nine scenarios retain their IPC readiness handshake, signal delivery, database assertions, sibling-record checks, timeout, and child cleanup. The introduced diff passes git diff --check. (src/cli/update-cli/update-command-run.test.ts:447, d762e57deac1)
  • Existing compiler owns the new entry: The worker build collects every update executor declaration alongside the ledger and state declarations into its shared build. Adding signalExitBarrier therefore creates the referenced compiled entry without adding a production export or separate compiler. (scripts/lib/vitest-worker-build-entries.mts:75, d762e57deac1)
  • Source and compiled execution remain consistent: The Vitest plugin redirects registered declarations only for repository-runner execution; standalone Vitest and watch retain source declarations. The URL resolver selects source siblings or compiled dist paths, and neighboring mutable-signal tests already use the same preload pattern. (test/vitest/vitest.worker-artifacts.ts:31, d762e57deac1)
  • Optimization remains absent from inspected main: Fetched main still uses five explicit TypeScript URLs and an unconditional scripts/tsx.mjs preload for these children. Inspection of the latest-release file was unavailable, so no shipped-release claim is made. (src/cli/update-cli/update-command-run.test.ts:457, e1804606aebc)
  • Reported validation: The complete supplied PR body reports Node 24/pnpm 12.4 measurements: nine cases pass, summed case time decreases from 43.585s to 9.462s, and total targeted invocation time decreases from 63.48s to 22.18s. It also reports 54 updater-run/mutable-signal cases and 36 neighboring exit cases passing. These are author-reported results; this read-only review did not execute tests. (d762e57deac1)
  • Prior area history: Current-main file history records several earlier compiled-runtime fixture changes by Peter Steinberger, including the listed commit. This supports routing relevance independently of authorship of this PR; exact source-line introduction was not established. (src/cli/update-cli/update-command-executor-native-runtime.test-support.ts, 6001ca4b418c)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@steipete
steipete merged commit 220eb40 into main Sep 17, 2026
177 checks passed
@steipete
steipete deleted the codex/preview-signal-test-runtime branch September 17, 2026 01:24
@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

cli CLI command changes maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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