Skip to content

test: consolidate CLI regressions and simplify IPC lifecycle proof - #29298

Merged
OrcaWin merged 9 commits into
mainfrom
OrcaWin/test-audit-owner-coverage
Oct 16, 2026
Merged

OrcaWin merged 9 commits into
mainfrom
OrcaWin/test-audit-owner-coverage

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​220 $\color{#cf222e}{\Huge{\mathbf{−}}}$​637 $\color{#cf222e}{\Huge{\mathbf{−}}}$​417
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1 $\color{#cf222e}{\Huge{\mathbf{−}}}$​19 $\color{#cf222e}{\Huge{\mathbf{−}}}$​18

ELI5

Keep regression tests with the code that owns their behavior, and remove checks that merely repeat implementation details or test their own mocks.

What Changed

Retire two standalone CLI suites after moving their unique formatting, dispatch, and real-socket timeout regressions into existing owner suites. The unsafe-integer helper replay is already covered through real handlers; payload normalization now runs through the handler too. Remove a Unicode test that did its own decoding before handing strings to a mock socket. The remaining framing table checks production's UTF-8 setup and fragmented Unicode response.

Simplify renderer IPC lifecycle proof: keep listener cleanup/remount and causal subscription-before-snapshot assertions; remove copied channel inventories, a mocked React dependency-array assertion, and a post-cleanup assertion whose fixture could never dispatch. Remove the production cleanup-phase observer used only by that test. Executable cleanup operations/order remain unchanged.

Why

These tests should catch lost behavior while permitting internal refactors. Consolidation avoids two isolated suite setups and fixes the moved timeout fixture's temporary-directory leak. Copying entire registration inventories adds maintenance without testing each feature's behavior.

Linked Issue

Maintainer-requested CI test audit. Base PR #29286 is merged. This branch now includes main at24bec2d260; final main-based CI must pass before merge.

Visual Proof

N/A — test maintenance and removal of a test-only production observer; UI behavior unchanged.

Testing

  • I manually tested these changes locally
  • Automated tests updated

Linux: 250 tests passed across 18 focused suites using the CI coordinator/runtime versions (Bun 1.4.3 and Node 24.21.0). CLI and web typechecks passed. Changed-code-quality, formatting, and whitespace gates pass. Independent preservation reviews found no lost contracts.

Three alternating local comparisons refreshed against main a49295f, with explicit Node24.21.0 Vitest and two workers:

Batch Baseline suites/tests Candidate suites/tests Median wall Median summed module time
CLI 8 / 111 6 / 108 2.685 → 2.412s 2.934 → 2.566s
IPC lifecycle + siblings 3 / 24 3 / 23 4.749 → 4.691s 7.667 → 7.535s

CLI elapsed fell 10.2%; IPC elapsed fell only 1.2%, treated as noise with no stable speedup claim. Earlier local comparisons (CLI2.540→2.316s, IPC4.443→4.469s) are retained in the audit evidence. Every comparison run passed. Hosted selected module-duration-v1 worker cost: CLI3532→3020ms(-14.5%), lifecycle3574→3327ms(-6.9%). All five unit jobs and all five timing reports pass with zero unhandled errors; every selected file passes. Baseline run38827086842 actual79f463a863, candidate run38844420635 actualc62610908d. Both use Node24.21/Bun1.4.3, five ARM shards/four workers. This historical unpaired comparison is not whole-PR elapsed time or an isolated causal estimate: main changed imports, runtime routing and suite consolidation/shard contention. Candidate checkout has five unrelated CI/cache paths beyond head8486; baseline has19 unrelated merge-checkout paths. Neither checkout drift changes selected owners/routing. Full aggregate must still pass before merge. After merging current main at a49295f, 151 tests across 12 affected owner/sibling suites passed again under the exact CI runtimes, and full pnpm tc passed; the nine-file audit diff is preserved. Current main updates the project-catalog bridge, and its relevant catalog and worktree-event siblings are included in this check.

Earlier CI runs exposed inherited Git/mobile line-limit failures; main independently split both suites (#29357, #29368), so our temporary repairs were removed. Main subsequently landed the same mobile-fixture lint classification (#29378); reconciliation adopts main's config exactly and removes our duplicate. The final diff is the original nine CLI/lifecycle audit files only. The intermediate config repair was locally measured (77→76ms), hosted (21.5→23.7s), and independently reviewed, with12→0errors and no speed claim; those measurements are history, not final-diff savings.

Current head includes main24bec2d260. CLI and renderer-hook sources are byte-unchanged from measured head8486aab522. After reconciliation, all131 directly affected tests across9suites, full pnpm tc, changed-code quality and diff checks pass. The hosted owner comparison above comes from preceding head8486aab522; fresh full required CI/aggregate must pass for the new head before merge.

Review

Preserved distinctive contracts: blank terminal lines, circular tool input, image references, ordered release receipts, dry-run preamble without recipient, lookup without coordinator resolution, and real omitted-params timeout resolution. Renderer proof checks actual registered listener cleanup and remount instead of copied inventories. Net test/support reduction ~400 lines; production removes 18 lines, adds no behavior.

Agent skill upstream boundary

  • Not applicable; no upstream skill source copied.

Checklist

  • Small owner-focused changes
  • Before/after, mechanism, and rationale explained
  • N/A visual proof explained
  • Self-reviewed and independently reviewed
  • SSH/remote lifecycle and cross-platform behavior preserved; Unix socket tests retain Windows skip
  • Main-based full required CI and hosted timing comparison complete

@OrcaWin
OrcaWin changed the base branch from OrcaWin/faster-CI to main October 16, 2026 01:13
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6b2c235e-647c-4a30-9c12-a0ad26f2469e
📥 Commits

Reviewing files that changed from the base of the PR and between 4b75eb6 and 8486aab.

📒 Files selected for processing: 1
  • config/oxlint-anti-slop.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The changes update orchestration and worker-output test coverage, adjust runtime test coverage, and revise renderer IPC cleanup and lifecycle tests. They also add a file-scoped lint-rule override for a mobile chat view harness test fixture.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 8486a

No material user-facing or runtime regression is established by these test consolidations or the scoped lint exception. The change is mergeable with normal checks.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 18 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check Warning The description references PR #29286 and related PRs, but it does not link an actual issue as required by the template. Add a link to the actual issue addressed by this PR, or document the applicable maintainer exception according to repository policy.
Passed Passed checks: 3 passed
Check name Status Explanation
Out of Scope Changes check Passed The changes remain within the stated scope of consolidating regression tests, simplifying IPC lifecycle proof, and adding the related exact-file lint exception.
Title check Passed The title clearly and concisely describes the main changes: consolidating CLI regression tests and simplifying IPC lifecycle tests.
Description check Passed The description covers the required sections, explains the changes and rationale, documents testing, and states the remaining CI work. The linked issue section does not provide a standard issue link, …
Full details: Docstring Coverage

Explanation

Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 18 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
⚔️ Resolve merge conflicts: 💡
  • Resolve merge conflict in branch OrcaWin/test-audit-owner-coverage
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments: 1
src/cli/runtime-client.test.ts: 1

455-489: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

The test passes only because the mock server accepts a request that the real contract rejects.

The test calls client.call('terminal.wait') with no params. The TerminalWait schema in src/shared/rpc-contract/terminal-unary-params.ts requires a handle and a for value. The test therefore does not show that a real runtime accepts this request. It checks only that RuntimeClient.call does not throw while it resolves the default timeout.

Rename the test so the name states the real intent. For example, use resolves the default terminal.wait timeout when params are omitted. Do not imply that the request is valid.

The mock server also throws inside a socket data handler when the request is invalid. That throw becomes an uncaught exception, not a clean test failure. Write an error response instead.

Proposed change
-  it('does not crash while resolving terminal.wait defaults without params', async () => {
+  it('resolves the default terminal.wait timeout when params are omitted', async () => {
-          throw new Error('Expected a runtime request with an id')
+          socket.destroy(new Error('Expected a runtime request with an id'))
+          return

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 994b0e7e-519d-441a-9582-d3e507b85b11
📥 Commits

Reviewing files that changed from the base of the PR and between fb529aa and 12d5117.

📒 Files selected for processing: 16
  • config/scripts/anti-slop-scope-regression.test.mjs
  • config/scripts/check-runtime-electron-ratchet.test.mjs
  • config/scripts/ime-enter-guard-plugin.test.mjs
  • config/scripts/native-chat-design-tokens-plugin.test.mjs
  • config/scripts/oxlint-plugin-test-runner.mjs
  • config/scripts/quadratic-buffer-concat-plugin.test.mjs
  • config/scripts/renderer-scrollbar-style-plugin.test.mjs
  • src/cli/handlers/orchestration-caller-identity-cli.test.ts
  • src/cli/handlers/orchestration-module-boundaries.test.ts
  • src/cli/handlers/orchestration.test.ts
  • src/cli/handlers/orchestration/worker-output.test.ts
  • src/cli/runtime-client.test.ts
  • src/cli/runtime/client-timeout-policy.test.ts
  • src/cli/runtime/transport-framing.test.ts
  • src/renderer/src/hooks/ipc-events/app-lifetime-ipc-bridge.ts
  • src/renderer/src/hooks/useIpcEvents-lifecycle.test.ts
💤 Files with no reviewable changes: 4
  • src/cli/runtime/client-timeout-policy.test.ts
  • src/cli/handlers/orchestration-module-boundaries.test.ts
  • config/scripts/check-runtime-electron-ratchet.test.mjs
  • src/cli/runtime/transport-framing.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@OrcaWin
OrcaWin merged commit ac0d8c4 into main Oct 16, 2026
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant