Skip to content

ci: reuse Windows hook builds and shorten test setup and shutdown - #29439

Merged
nwparker merged 15 commits into
mainfrom
nwparker/ci-cost-next-20261016
Oct 16, 2026
Merged

nwparker merged 15 commits into
mainfrom
nwparker/ci-cost-next-20261016

Conversation

@nwparker

@nwparker nwparker commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Windows CI reuses the hook it already built. Test fixtures avoid unnecessary waits and close their owned daemons before deleting temporary profiles.

What Changed

  • Default the Windows hook target to the host architecture so build and packaging fingerprints agree. Add a real reuse and invalidation regression.
  • Remove waits from deterministic ownership tests, seed SQLite fixtures transactionally, establish file-signature changes explicitly, and remove source-spelling checks. Enable the existing unit phase report.
  • Reuse authenticated daemon shutdown before profile deletion. Final layout-oracle disposal closes the app and its daemons together; all seven intermediate closes remain.
  • Accept a positively verified Linux zombie as exited, while live processes, denied inspection and missing or malformed evidence still fail at the existing ten-second deadline. Add real zombie/reaping and boundary regressions on the Node route.
  • Preserve a folder's explicit SSH target when inherited project-group rows conflict, using the existing ambiguity-aware lookup.

Why

These changes remove repeated build and fixture work through existing mechanisms. Authenticated shutdown releases terminal handles before deletion. A Linux zombie has exited but can still answer a PID-presence check until its parent reaps it. Runner capacity, isolation, retries, deadlines and aggregate failure handling stay intact.

Linked Issue

N/A — maintainer CI improvement.

Visual Proof

N/A — build, test and ownership checks only; no rendered interface change.

Testing

  • Focused local tests, independent source review, lint, anti-slop, type-aware quality, changed quality, focus/max-lines ratchets, native Node/web typechecks and all four pinned Bun CI compiler projects passed. The hosted full native-plugin gate also passed; the five local warnings were in unchanged mobile files.
  • Automated reuse/invalidation, Linux exit-state and folder SSH ownership regressions added. Local Linux diagnostic and eight real-process shutdown tests passed; the diagnostic used Node 24.22 and is separate from pinned hosted qualification.
  • Exact head 63d6dee2caa27c684dae102869701b3893c1e1c5 qualified in full PR run 38880420231, attempt 1. Actual checkout: merge 994cd8340869773b9e0fa7cef8fe8260013ebb93 with main parent e3f42d76a0adec0a467bf94b638d77f1910dc2e1. All 29 physical PR jobs matched their source conditions; PR checks passed ran on a real runner and its Require successful checks step passed.
  • All five full unit shards: 12,335 roots accounted for once, 122,461 passed, 1,733 skipped, five todo, five expected failures, zero failures. Fresh emitted plan, shard assignments and runtime routes independently reconciled. The real Linux regression passed all 14 cases with no skips. Configured isolate=true and the existing max4 workers remained; upstream test consolidations and count drift were accounted for separately.
  • All 21 layout scenarios passed with one worker, zero retries/skips/findings, 21 final closes, seven intermediate closes and 21 final daemon cleanups.
  • All six affected workflows passed: full PR, headless server (six persistence and five native lanes), Windows installed-app serve-switch, computer E2E, LoC and cache cleanup. Selected Windows packaging retained 76 roots / 738 cases (682 passed, 56 skipped), real native/ConPTY/MSYS/PTY/plugin/CLI checks and all nine staged hook/launcher reuse events.

Observed timings across hosted revisions:

Scope Earlier observation Current
Complete layout test step 551s 438s
Whole changed-layout job 617s 482s
Final close fallbacks 17 0
Whole Windows x64 package job 372s 357s

The Windows job also remains above the preceding 338s observation, and below the original 403s baseline. Source, build, runner and cache differences prevent a causal or fleet-wide savings claim. Final close and daemon cleanup overlap and were not added together. Queue time is excluded from whole-job occupancy.

The previous published aa5fb9d failed PR preflight and two Linux floor lanes; those failures remain recorded. The current revision has fresh passing qualification. Historical failed PIDs were not proven zombies.

Review

Independent Codex reviews cover strict exit proof, process ownership, cleanup ordering, intermediate restart preservation, folder/SSH authority, runtime routing, emitted unit coverage, exact source bindings and aggregate failure handling.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer material copied or translated.

Notes

Explicit x64/ARM64 targets, native guards, SSH and mixed-version contracts remain. Windows packaged smoke covers x64; ARM64 qualification here is the headless persistence lane, not an ARM64 desktop-package claim.

Checklist

  • Explained behavior, mechanism and approach
  • Reviewed correctness, security, performance, cross-platform and SSH impact
  • N/A visual proof with reason
  • Final affected checks and physical PR aggregate passed for the current commit

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

The Windows agent hook build now defaults to the current process architecture. The test workflow enables phase diagnostics, and workflow tests check draft pull request conditions. Other test changes update hook assertions, persistence and teardown fixtures, IPC expectations, and timestamp-sensitive scanner and runtime-probe checks.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to aa5fb

This change only touches test cleanup helpers. If a daemon loses its endpoint, cleanup can fail and leave test roots behind, which would make those integration tests flaky. Production behavior is unchanged, so the risk is bounded.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 46.15% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 describes the main Windows hook reuse and test setup and shutdown improvements. It is concise and specific, although it does not mention every secondary change.
Description check Passed The description includes the required explanation, changes, rationale, issue handling, visual proof, testing, review, notes, and checklist sections. It provides detailed validation results and appropr…
Full details: Description check

Explanation

The description includes the required explanation, changes, rationale, issue handling, visual proof, testing, review, notes, and checklist sections. It provides detailed validation results and appropriately marks visual proof as not applicable for a non-UI change.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • 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.

The hook reuse regression first built into a missing private --output, so it
always reached Cargo (74s warm on Windows). Build through the default output
instead, which reuses a warm canonical prebuild, then copy its executable and
fingerprint into the private fixture root.
…fter main merge

Combine the duplicate shared/execution-host imports in runtime-host-services
(301 -> 300 lines) and type the overlap test's tab mapper with the
RuntimeMobileSessionClientTab owner type instead of object.

@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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ef23c3f7-b15b-43cd-9af4-76dcbab0ec0a
📥 Commits

Reviewing files that changed from the base of the PR and between f7e214b and aa5fb9d.

📒 Files selected for processing: 2
  • src/main/orcad/orcad-daemon-teardown-fixture.ts
  • src/main/orcad/orcad-serve-parity.integration.test.ts

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

Comment on lines +85 to +86
await cleanupDaemonForProtocol(daemonDir, protocolVersion, pid)
await waitForProcessExit([pid])

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.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

🔎 Supported by static analysis

🏁 Script executed:

rg -n 'cleanupDaemonForProtocol' src
sed -n '60,110p' src/main/orcad/orcad-daemon-teardown-fixture.ts

Repository: stablyai/orca

Length of output: 4830


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- cleanup implementation and related declarations ---'
sed -n '1,260p' src/main/daemon/daemon-protocol-cleanup.ts
printf '%s\n' '--- teardown fixture complete relevant section ---'
sed -n '1,150p' src/main/orcad/orcad-daemon-teardown-fixture.ts
printf '%s\n' '--- cleanup tests ---'
sed -n '1,180p' src/main/daemon/daemon-protocol-cleanup.test.ts
printf '%s\n' '--- serve-parity references ---'
rg -n -F --glob '*.{ts,tsx}' -e 'serve-parity' -e 'killProfileDaemons' -e 'daemon-v' -e 'cleanupDaemonForProtocol' src test tests 2>/dev/null || true

Repository: stablyai/orca

Length of output: 26993


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- serve-parity integration lifecycle ---'
sed -n '1,290p' src/main/orcad/orcad-serve-parity.integration.test.ts
printf '%s\n' '--- protocol constants and daemon endpoint lifecycle references ---'
rg -n -F --glob '*.ts' -e 'CLEAN_DISCONNECT_PROTOCOL_VERSION' -e 'PROTOCOL_VERSION' -e 'daemon-v${' src/main/daemon src/main/orcad | head -120
printf '%s\n' '--- serve-parity test teardown and daemon shutdown controls ---'
rg -n -F --glob '*.ts' -e 'shutdown' -e 'SIGKILL' -e 'removeTestRoot' -e 'killProfileDaemons' src/main/orcad/orcad-serve-parity.integration.test.ts

Repository: stablyai/orca

Length of output: 23204


Handle a live daemon whose endpoint is unavailable.

If the PID record names a live daemon but probeSocket reports no endpoint, cleanupDaemonForProtocol returns without stopping the PID. For current protocols, it also leaves the PID record. killProfileDaemons then waits for the live PID and can fail teardown after the exit deadline.

The existing PID-kill fallback is not safe for this path. It runs only after connected-endpoint cleanup fails, and targeted cleanup rejects before invoking it. Add an ownership-safe fallback for the unavailable-endpoint branch. Do not kill an unverified PID.

@nwparker nwparker changed the title ci: remove repeated Windows work and report unit phases ci: reuse Windows hook builds and shorten test setup and shutdown Oct 16, 2026
@nwparker
nwparker merged commit b16a71c into main Oct 16, 2026
50 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