Skip to content

[CI] Reduce repeated test setup and unnecessary packaging - #27308

Merged
nwparker merged 3 commits into
mainfrom
nwparker/ci-repeated-test-setup-20261010
Oct 10, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/ci-repeated-test-setup-20261010

Conversation

@nwparker

@nwparker nwparker commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 64 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6816 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7560 $\color{#cf222e}{\Huge{\mathbf{−}}}$​744
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​15 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8

ELI5

Group related suites to load the same code fewer times, retaining all 313 original-cohort cases and 403 transcript cases (393 passes, ten existing optional-fixture skips). Separately remove four source text inventory checks; keep their 26 access/routing behavior cases.

What Changed

Consolidate worker RPC, messaging, structured-chat, worktree IPC and captured-transcript suites using existing fixtures and cleanup. Reset the renderer harness queue and mock histories per case; make four IPC suite labels distinct. Performance-cohort case bodies and assertions stay the same. Classify the exact structured-chat unit-test harness beside the existing fixture exception, retaining unit/static/type checks and packaging for unknown helpers, product changes and platform contracts. The removed checks searched source text rather than executing behavior; future-callsite inventory alarms are intentionally lost.

The measured cohorts use macOS arm64, stock Bun 1.4.2, Node 24.21, four workers and ordinary isolation:

Cohort Files before → after Mean elapsed before → after Reduction
Worker RPC, 41 cases 10 → 3 6.236s → 3.766s 39.62%
Structured chat, 116 cases 14 → 11 5.452s → 4.523s 17.04%
Worktree IPC, 71 cases 10 → 5 3.221s → 2.677s 16.89%
Messaging, 85 cases 11 → 3 6.646s → 3.945s 40.63%
Captured transcripts, 403 cases 21 → 7 13.534s → 8.247s 39.07%

Child CPU fell 54.09% for RPC, 58.09% for messaging and 16.94% for renderer and 51.55% for transcripts. Renderer mean child maximum RSS rose 1.39% and transcript child maximum RSS rose 2.68%, without measuring concurrent family memory. Larger RPC files retain more mock callbacks; sustained memory growth is unproved.

Why

Existing fixtures provide a measured improvement with the current runner and assertions. The exact fixture exception prevents future fixture-only edits from requesting product packaging. No application, library, tool-version or workflow changes.

Linked Issue

N/A — ongoing CI throughput work; no existing issue linked.

Visual Proof

N/A — test organization changes only; application rendering and interaction are unchanged.

Testing

  • Four local runs per cohort (before, after, after, before); exact case identities/statuses retained through declared file/suite aliases. Transcript cases retain their same ten optional-fixture skips; all other measured cohorts have no skips. Zero unhandled errors.
  • Benchmark-cohort full focused-plugin scans passed on every live candidate before timing; routing lint passed after its contract runs.
  • Known children exited; original sources, published [CI] Reduce repeated test setup and real CLI waits #27297 changes, tool bytes and foreign files were preserved.
  • Original 43-path combined checks and all 26 retained behavior cases passed.
  • Nine routing modules pass 132 baseline / 134 candidate cases, preserving mixed-product, unknown-helper and real platform boundaries.
  • Final 66-path changed-quality and Node/Web typechecks pass; full focused plugin covers all nine added live files (16 rules/zero diagnostics).

The original 24 first commands cost 74.082s including the preserved IPC diagnostic hold; seven transcript commands cost 43.995s with no failures. IPC has a 327-second pause between arms; messaging has an unmeasured pause after its preserved random-ID diagnostic stop. Its 21 case-linked warnings match after narrow generated-ID normalization. Fewer expected notices reflect existing once-per-module behavior; all other diagnostics match. All 14 renderer callers exercise the reset; no separate reset test was added. Shared local commands cost 21.105s. A result-reader field mismatch stopped after a successful plugin scan; its receipt was preserved and only pending checks continued.

Normal CI cost was 4,263s / 15 runner allocations for the first head, 681s / 7 for the failed manifest head, and 5,041s / 22 for the final corrective head: 9,985 assigned runner-seconds / 44 allocations for this PR. Failed-head unit/package skips were consequences of the manifest failure, not savings. Queue/provisioning time is excluded. No agent dispatches, reruns or cancellations occurred.

Previous #27297's final head used 3,733s/15 allocations versus this first head's 4,263s/15 (+14.20%); unit shards used 2,932s versus 3,062s (+4.43%). The selected non-unit contracts differ. First-head packaging used 281 Linux +359 Windows seconds because the unit harness was misclassified; avoiding that 640s/two-allocation exposure on future fixture-only edits is modeled, not measured. The detector correction itself requests broader CI once; final packaging still cost 547s.

The comparable full-unit configuration stayed unchanged. Final unit occupancy was 3,048s versus first-head 3,062s (−0.46%); actual Test-step sums were 2,868s versus 2,857s (+0.39%). Setup fell 187→160s, while the longest shard increased 631→658s (+4.28%). Relative to #27297, final Test steps rose 2,739→2,868s (+4.71%). Saved job metadata lacks case/file counters; source review retains the 403 transcript statuses and adds two routing cases. Global selection expands other jobs and does not explain unit timing. These observations establish neither a hosted speedup nor a material regression.

Detector qualification cost 8.616s.

Initial updated integration cost 0.232s for the successful plugin and 4.798s for a genuine six-import quality failure; the narrow correction restores original type-only declarations. Retry quality and pending Node/Web types cost 8.445s; no cohort/plugin replay. Transcript timing precedes this syntax correction; all 403 bodies and captures are unchanged. Hosted speedup and overall 2× CI health remain unproved.

AI Disclosure

Review

The five performance cohorts, four-check deletion and exact fixture-routing exception passed independent review.

Agent skill upstream boundary

  • Not applicable; no upstream skill source or artifacts copied.

Notes

Existing SSH, host-routing, platform and runtime boundaries are preserved. The prior updated head failed the reliability manifest gate because its selector still named a moved transcript file. Current references now point at the retained suite; the original dated command remains in the historical summary with no new-run claim. The public manifest check passes all 146 gates, and 24 checker tests pass. All 31 corrective-head checks passed (22 success, nine legitimate skips) on 44e19839. CodeRabbit reviewed that exact head with no actionable findings or open threads. Its optional 80% docstring warning is declined under the concise-comment policy.

Checklist

  • Test-only scope and mechanism explained
  • Visual proof N/A explained
  • Cross-platform and remote boundaries considered
  • Final updated combined local checks pass
  • Corrective-head ordinary PR CI passes

Reliability correction: three local commands cost 1.863s; an absent optional timing receipt caused a retained reader HOLD after the genuine 24-pass run. No tests were replayed.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 3bfe7374-dd2a-48fe-9fd3-e5349d34a93d



📥 Commits

Reviewing files that changed from the base of the PR and between 9174ddf and 44e1983.




📒 Files selected for processing (1)
  • config/reliability-gates.jsonc



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





📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request reorganizes test coverage across worktree IPC, orchestration, native chat, and runtime readiness. It adds tests for host-specific worktree operations, SSH setup and branch handling, mailbox routing, worker lifecycle and projections, structured-session states, and terminal readiness. It also removes standalone test suites and renderer source-scanning checks. The supplied changes describe test files and test harnesses; they do not describe production-code changes.





Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 44e19

This change retargets a CI gate to the consolidated test suite while preserving the historical pass’s original invocation. It changes no product behavior and presents no actionable merge risk.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 18.42% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 76 functions across 24 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly summarizes the main change: reducing repeated test setup and unnecessary packaging in CI.
Description check Passed The description follows the required template and provides clear scope, rationale, testing evidence, visual-proof rationale, review notes, compatibility considerations, and checklist status. The Linke…

Full details: Docstring Coverage

Explanation

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


  • Fix all pre-merge checks with AI
  • 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.

@nwparker nwparker changed the title [CI] Reduce repeated test setup and remove source text checks [CI] Reduce repeated test setup and unnecessary packaging Oct 10, 2026
@nwparker
nwparker merged commit 26ee9bb into main Oct 10, 2026
31 checks passed
sj900211 added a commit to sj900211/orcinus that referenced this pull request Oct 14, 2026
The last stage of the catch-up. Measured from the post-stage-5 main: 425
commits, 23 conflicting files, merge base `6cbbe456c0` — the previous stage's
target, so the lineage is clean. Four analysts planned the clusters in
parallel, one implementer applied all four, and an independent critic reviewed
the staged index.

## What upstream did

Upstream deleted the SSH relay client path, the SSH PTY provider and most of
`src/main/providers/` — about 153 files and 17.8k lines — plus the
`ipc/pty.ts` and `providers/types.ts` barrels. Commits `ff27338299e`,
`a4a96fee704`, `0df25b7ac9b`, `c5224f70d8c`, `b368ebc7a6c`, `aeffeb4cfb5`,
`3c49cdf09ce`.

**It changed no owner-routing logic.** So nearly every conflict had the same
shape: the fork's per-window routing with an SSH-projection line inside it,
against upstream's main-window line with that line removed. The resolution is
the fork's logic minus the SSH lines — `combine`, never `take-ours`, which
would re-reference deleted modules and fail typecheck.

## The two decisions this merge turned on

**The legacy relay bridge must reach every window, and gate its input.**
Upstream's new `legacy-relay-bridge-ipc.ts` keeps 1.4.224's running terminals
alive after an upgrade (stablyai#27787, stablyai#27951). It merges cleanly, and its `send`
reaches `getMainWindow()` only. Three analysts found this independently: a
relay-era SSH pane whose tab lives in a fork project window attaches, replays,
and then never receives output or exit again. It now broadcasts to every app
window, which is safe because each window's transport filters by `ptyId`, and
relay-era ids (`ssh:<target>@@<relay id>`) are often unknown to
`getPtyWorktreeId` so an owner lookup would fall back to main anyway.

Its `write`, `resize` and `detach` also accepted input from any sender, where
every sibling PTY input path in this fork is gated by `isTrustedUIRenderer`
(`write.ts:18,29,41`, `resize-visibility.ts:111,166`, `delivery-flow.ts:167`,
`serialize-buffer.ts:43`). The gate is applied. The legitimate path was traced
end to end before doing so: the only renderer sender is `legacyRelayBridgeApi`,
its only caller is `pty-input-recovery.ts:294`, and that path runs in the main,
workspace and satellite windows, all registered as trusted UI renderers. The
dashboard pop-out loads the same preload and is *not* trusted, but nothing
under `components/dashboard-popout/` imports the bridge transport.

**The user-named access ratchet stays, and the fork now owns it.** Upstream
`26ee9bbfabe` (stablyai#27308, "remove source text checks") deletes the whole ratchet
from `local-file-access.test.ts` — all three lists, the three helpers and the
`node:fs`/`node:path` imports — and replaces it with nothing. Keeping it means
the fork maintains all three lists, not just its own two entries, and a future
upstream commit that adds a user-file builder or a tab opener will fail this
test. That is the point: stage 5's SFTP defect arrived exactly as "upstream
added a new way to open a user-named tab", so a failure here is the alarm
working. The block carries a comment saying the fork owns these lists and that
the response to a failure is to check each new entry against the SFTP guard,
never to delete the fork's entries. The import removal merged cleanly, so the
two imports are restored; without them six identifiers were undefined.

## Defects found that no conflict marker could show

This stage's real work was outside the 23 conflicts: 11 hand edits, three of
which no plan predicted.

- **The scoped reconnect path.** Upstream `bd54fc7fa32` deleted
  `reconnectPersistedTerminals(signal, { workspaceKeys })` as dead code — true
  upstream, where direct SSH was its only caller. The fork has three production
  callers and one test that need it for project windows, and the deletion lands
  cleanly in every region the fork did not touch: the scoping filter, the early
  return, the deferred-SSH preservation, the `remaining*` computation and the
  `workspaceSessionReady` gating. Resolving only the conflict hunks would have
  made every scoped call a silent global reconnect, so the file was replaced
  whole.
- `pty/delivery/payload.ts` — the fork-only `if (!ownerState)` block still used
  the removed `projectionAdmissionIds` and returned the old object from a
  function now typed `boolean`.
- `pty/delivery/window-flow-state.ts` — a fork-only `max-lines` extraction
  stranding upstream's SSH-projection removal; it was not on any extraction
  list. 297 → 287 lines.
- `ssh-filesystem-provider-sftp.ts` — a whole-side take still breaks, because
  the import line upstream deleted sits *outside* the conflict hunks and merges
  cleanly, leaving four types and a helper undefined. Six fork files call them.
- Two fork tests still named the deleted `ipc/pty` barrel: the fork's primary
  multi-window routing suite would have failed to load, and a `vi.mock` of the
  barrel would have silently stopped intercepting, running real PTY
  registration inside a test.
- Found by the cold typecheck: two upstream tests called `isHiddenRendererPty`
  with one argument. The fork keys hidden marks per window, so it takes two.
- Found by the sweep: `daemon-host-path-budget.test.ts` hard-coded upstream's
  `Orca` host root.
- Found by the critic, in a file no gate executes: the fork-only
  `orcinus-cd.yml` still ran `config/scripts/relay-watcher-fault-harness.mjs`,
  which upstream deleted in `2b4b60a87ea` while removing the same step from its
  own release workflows. The next `v*` tag would have failed both build legs
  before publishing. Removed, mirroring upstream.

Coverage upstream deleted and the fork still needs was restored:
`sftp-directory-entries.test.ts` ports the five cases that cover SFTP handle
cleanup on cancellation, for code the fork keeps.

## Review

An independent critic returned REJECT for the `orcinus-cd.yml` defect above and
nothing else: the 27 decisions are applied as specified, both coordinator
decisions hold when re-derived, and every gate re-measures as reported. It found
the defect with a set difference of every repo-path string in every tracked text
file, merged tree minus both parents — it was the only merge-only dangling path
in the repository. No compiler, linter or test executes a workflow file.

The critic also partitioned the sweep's "same" bucket by *which* baseline fails:
`both=2451 mainOnly=35 upOnly=131 neither=5`. Those 35 are the fork's own
pre-existing reds, none merge-caused, and three of them mean a fork feature has
no live test — project windows (`create-project-window.test.ts`), the custom
date-range usage dashboard (`UsageOverviewFilters.test.tsx`) and notifier owner
routing. A follow-up owns them; this merge does not.

`verify-orcinus-identity` is blind to the identity residue this merge adds: the
new macOS terminal-host helper's `CFBundleName` 'Orca', its Orca icon, and the
"Orca allows…" usage-description strings. All inert on an unsigned build.

## macOS terminal-host helper

Upstream `3f8d296b8d7` adds a signed `Orca Terminal Host.app`, about 124 MiB per
mac slice, started from a copy through launchd. Read statically; no Mac host was
available. The fork's unsigned build *can* produce it ad hoc, and can never load
it: the runtime requires the copy to satisfy the running app's designated
requirement, which for an ad-hoc app is its own cdhash. Every failure path falls
back to the pre-merge fork launch. No gate or packaging step the fork runs
assumes a signing identity — `orcinus-ci.yml` is ubuntu-only, `orcinus-cd.yml`
has no macOS leg, and upstream's mac workflows are guarded on their repository.
The cost is that every daemon launch on a fork mac build copies the helper, fails
the check and deletes it. Skipping `packageMacTerminalHost` on unsigned builds is
recorded as a follow-up.

## Gates

Cold typecheck (after deleting `config/*.tsbuildinfo`): 0 errors, measured
independently twice; its first run is what caught the two `isHiddenRendererPty`
arity breaks. Runtime-electron ratchet: `nothing reachable imports electron`.
oxlint: 0 warnings, 0 errors across 32,422 files; oxfmt clean.
verify-orcinus-identity: OK, `upstreamRefs=0`. Unsigned smoke: OK,
`forceCodeSigning=false`. Fork contract tests: 32/32. Windows CLI launcher: the
Rust build runs here and passes. Localization catalog: OK. max-lines ratchet: OK,
4 grandfathered, no new bypasses.

Regression sweep, scoped as the whole universe rather than by directory — the
error that cost stage 4 a rejection and left a 46% hole in stage 5:
`discoverUnitFiles()` is 12,051 files on this tree, every one reported, 0
missing. The three-tree recheck of all 493 failing files gives
`same=2615 diff=2 mergeOnly=5`. One of those five was a real merge defect, the
`Orca` host root, and is fixed. The other four are attributed with evidence:
three flakes that also fail on the upstream baseline in the same file, and one
CRLF artefact of this long-lived working copy whose index blobs are LF in all
three trees. Merge-only failures attributable to this merge: **0**.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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