Skip to content

Cache mobile typechecks and overlap CI setup - #28192

Merged
nwparker merged 6 commits into
mainfrom
nwparker/mobile-checks-next-speed
Oct 13, 2026
Merged

nwparker merged 6 commits into
mainfrom
nwparker/mobile-checks-next-speed

Conversation

@nwparker

@nwparker nwparker commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Mobile checks repeatedly typecheck thousands of unchanged files. Save TypeScript's small incremental state so subsequent runs spend less CPU on those files, leaving more CPU for the tests.

What Changed

  • Keep the existing single Mobile Checks / verify job and every Node/Bun test. Cache separate production and test compiler state, keyed by platform, lockfiles, compiler configurations and commit. Both checks always run; TypeScript rechecks changed source and imports.
  • Run both typechecks on main too, in the background beside the existing tests, to seed a cache every PR can restore. Wait for all checks before reporting success.
  • Overlap Ruby setup with dependency installation and checks. Avoid the large pnpm download-store restore on PRs while retaining its verification record and frozen installs.
  • Stop JSON-encoding full source on compilation-cache hits and serialize recording values once for hashing and collision checks. Preserve module identity, the 512-entry bound and golden hashes.
  • Launch the ratchet compiler through @orca/process-host for portable process handling.
  • Unblock an unrelated upstream test failure from Show Codex model capacity failures as red agent status #28231: record the new capacity transcript's 12 existing serializer limitations in the existing baseline. Replaying against the pre-capture serializer at 4559c250b3e confirms identical output and no regression; serializer code stays unchanged.

Why

The referenced job took 3m20s after #28127. Runner sharding reduced execution to 2m11s, but an extra result job's queue made the measured total 5m52s; a repeat also delayed the companion runner. This version keeps one runner and reduces repeated compiler work instead. The two compiler-state files total about 3.4 MB locally, compared with a 131 MB persistent Vitest cache that saved only about 3s in an experiment.

Linked Issue

Maintainer follow-up to #28127 and the 3m20s run.

Visual Proof

N/A — CI and recording-test infrastructure only.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

macOS: all 496 Node tests and 9,972 Bun tests pass. Production/test typechecks, mobile lint/format and changed-code quality checks pass. The 133 focused workflow/cache-policy tests pass. A real-compiler integration test proves cached checks detect changed imported types, retain unchanged diagnostics, update test-file membership and preserve the @ts-nocheck guard.

A local cold/warm comparison retained the same 122 diagnostic files and complete test census: production 11.9s → 2.1s; tests 16.2s → 3.0s. Hosted Linux ARM measurements (complete job execution, including setup and cleanup; initial runner queue excluded):

Run Mobile verify Production / test typechecks
Referenced baseline 3m20s —
New code, cache miss 2m57s 48s / 72s
New code, cache hit 2m39s 8s / 10s
Changed source, restored cache 2m51s 8s / 10s
Final rebased code, cache miss 3m10s 68s / 91s
Rebased code, cache hit 2m38s 8s / 10s
Merge candidate, changed source/cache restore 2m55s 10s / 13s

All six new runs passed all 10,468 mobile tests. The cache hit restored the expected 416 KB archive. The latest merge candidate saved 25s (12.5%) against the baseline. Cached runs ranged from 2m38s to 2m55s, saving 12.5%–21%; the two cold runs saved 10s–23s. Initial runner queues ranged from about five to twelve minutes and are separate from these job durations. The final rebase changed the root lockfile, correctly missing the earlier compiler cache; it saved a new 416 KB archive. Main now does additional compiler work to seed shared state; a miss falls back to full checking.

Final hosted validation: PR Checks passed all five desktop test shards, relay integration, static analysis/typechecking, the mobile bundle and test-assignment evidence. Mobile Checks, Headless Node server and PR test LoC passed on the merge candidate.

Review

Reviewed cache separation and invalidation, failure collection, compiler process handling, recording-cache bounds and cleanup. Local commands retain their existing behavior unless the cache directory is set. No UI, SSH or remote protocol changes. Rebased onto the upstream CI fix #28265; no duplicate UI correction is included. All 114 transcript replay tests pass, and a comparison against the serializer built from 4559c250b3e passes the newly added capacity capture without byte differences or behavioral regressions.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • Relevant local checks pass; broader checks and build are covered by CI

@coderabbitai

coderabbitai Bot commented Oct 13, 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
📝 Walkthrough

The mobile workflow adds TypeScript build-info caching and incremental production typechecks. It runs Ruby setup in the background in the pull-request job and adds the test-typecheck ratchet to the main-branch job. The ratchet script supports incremental compilation through the configured cache directory. The compiled-operation cache now tracks and evicts individual source variants. Golden-value hashing reuses canonical JSON. Tests cover workflow configuration, typecheck caching, compiled-operation cache behavior, serialization calls, and recording resolution. A daemon replay test adds a known pre-existing failure checkpoint.

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to f0fbe

The workflow may expose repository credentials to dependency-controlled code, so this security risk should be resolved before merging.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 14 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 No active directly linked issue remains. Linked issue #28265 is closed and completed, so its host-routing acceptance criteria are historical context only and do not impose coding requirements on this …
Out of Scope Changes check Passed The reported changes stay within the pull request scope. The workflow cache, incremental typecheck, process-host, recording-cache, focused tests, and capacity-transcript baseline changes support the s…
Title check Passed The title clearly summarizes the primary changes: caching mobile typechecks and overlapping CI setup.
Description check Passed The description follows the repository template and explains the changes, motivation, testing, performance results, review scope, and checklist status. It also documents that the change has no visual …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • 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.

@nwparker nwparker changed the title Run Mobile Checks runtime groups on separate runners Split Mobile Checks tests across two runners Oct 13, 2026

@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: 58710c0e-6d5a-4c23-af7f-5e163ed68339
📥 Commits

Reviewing files that changed from the base of the PR and between cf1504f and a016b9f.

📒 Files selected for processing (5)
  • .github/workflows/mobile.yml
  • config/scripts/ci-dependency-download-cache.test.mjs
  • config/scripts/mobile-test-change-scope.test.mjs
  • config/scripts/run-mobile-ci-tests.mjs
  • config/scripts/run-mobile-ci-tests.test.mjs

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

Comment thread .github/workflows/mobile.yml Outdated
- name: Check formatting
run: pnpm format:check

test-shard:

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.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

set -eu
printf '%s\n' '--- workflow header and relevant jobs ---'
nl -ba .github/workflows/mobile.yml | sed -n '1,45p;175,265p'
printf '%s\n' '--- exact PR diff for mobile workflow ---'
git diff --no-ext-diff --unified=30 ef890ae2bd547206868cbec3a506d85fd8b274b6 a016b9f226151a46962203f7cec991cc741304dd -- .github/workflows/mobile.yml

Repository: stablyai/orca

Length of output: 17177


🏁 Script executed:

set -eu
printf '%s\n' '--- permissions declarations and jobs boundary ---'
rg -n -F -- 'permissions:' .github/workflows/mobile.yml || test "$?" -eq 1
nl -ba .github/workflows/mobile.yml | sed -n '40,75p'

Repository: stablyai/orca

Length of output: 1985


Restrict the token in the new test job.

test-shard runs pnpm install after checkout. Disable checkout credential persistence and grant the job only contents: read. Dependency code can otherwise access the persisted GITHUB_TOKEN; its write permissions depend on repository settings.

🐛 Suggested fix
   test-shard:
     name: Mobile Node and Bun tests
     if: github.event_name == 'pull_request'
+    permissions:
+      contents: read
     runs-on: ubuntu-24.04-arm
@@
         uses: actions/checkout@v6
         with:
           fetch-depth: 2
+          persist-credentials: false
🧰 Tools
🪛 zizmor (1.30.1)

[warning] 1-309: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)


[warning] 211-258: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

Sources: Learnings, Linters/SAST tools

@nwparker nwparker changed the title Split Mobile Checks tests across two runners Cache mobile typechecks and overlap CI setup Oct 13, 2026
@nwparker
nwparker force-pushed the nwparker/mobile-checks-next-speed branch 2 times, most recently from 4149a02 to aa5461b Compare October 13, 2026 09:29
@nwparker
nwparker force-pushed the nwparker/mobile-checks-next-speed branch from aa5461b to f0fbe0d Compare October 13, 2026 10:05

@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: 611d6d69-a9b2-4c22-baee-2af167b6f7c0
📥 Commits

Reviewing files that changed from the base of the PR and between aa5461b92f8bfb29f1d123168d44ea039e548966 and f0fbe0d.

📒 Files selected for processing (1)
  • src/main/daemon/serialize-grid-transcript-replay.test.ts

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

'codex-fullscreen-multiline-early-input': 10,
'codex-fullscreen-startup': 14,
// Capacity capture: identical attribute leaks with the pre-capture 4559c250b3e serializer.
'codex-model-capacity-fullscreen': 12,

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -euo pipefail
nl -ba src/main/daemon/serialize-grid-transcript-replay.test.ts | sed -n '1,310p'

Repository: stablyai/orca

Length of output: 14975


Pin the failure signatures for codex-model-capacity-fullscreen.

With SEEDS === 2 and no OLD_ADDON_PATH, this transcript checks only that counts['new-fail'] equals 12. No assertion checks its failureSignatures, so a different set of 12 diffs can pass. Add an expected-signature assertion for this transcript.

@nwparker
nwparker merged commit fba7b75 into main Oct 13, 2026
32 checks passed
OrcaWin added a commit that referenced this pull request Oct 13, 2026
)

#28192 and #28286 both recorded 'codex-model-capacity-fullscreen' with the same count, and the
duplicate object key fails typecheck (TS1117) on main.

Co-authored-by: m4air <[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