The root pnpm typecheck covers no cloud/ package and vitest strips types, so cloud
packages' own type errors went unseen (261 in sandbox-control). premerge-check.sh now
runs the own pnpm typecheck of every touched cloud/apps or cloud/packages package listed
in premerge-typecheck-packages.txt, after installing the cloud workspace and building its
packages. The list holds the 11 packages that are clean today; sandbox-control joins once
its errors are fixed.
cloud-glossary-lint.test.ts globs and reads src instead of importing it, so
neither name matching nor vitest's module graph ever selected it; #610 broke
it unnoticed. premerge-check.sh now appends every path listed in
config/scripts/cloud-integration/premerge-always-tests.txt to the targeted
set (still subject to the base-list filter).
packaged-cli-assets' macOS launcher test compares an os.tmpdir()-based path
with the realpath the launcher reports, so it failed in the gate on any PR
selecting it (#574 batch 8, parallel and serial). Export a realpath'd TMPDIR
so the gate environment matches what child processes see.
#574 (deletes widely imported card files) selects ~52 batches; batch 1 failed on
three Electron browser-extension tests that pass alone and in full-suite runs.
A failed batch is now re-run once with --maxWorkers=1 and passes only if fully
clean (set -e), logged as 'failed in parallel, passed serially'. A real failure
still fails the gate.
A PR that deletes or changes widely imported modules selects hundreds of
test files; passing them all to one vitest spawn failed with E2BIG. Run them
in batches of PREMERGE_TEST_BATCH (default 150); every batch must pass, so
the gate and the premerge OK record are unchanged.
#462 broke three terminal-multiplex tests (REG-5) that premerge never selected: they import an aggregator
(methods/terminal/terminal) one folder up that imports the changed modules, so neither the same-folder nor the
module-name rule matched. 'vitest list --changed=<integration> --filesOnly' follows the module graph; on #462's
diff (9a2e5c7ce9f..8103fc98861) it selects all three. Its files are unioned with the existing selection, then
the base-list filter applies as before.
The slot-holding python parent now traps INT/TERM (forwarding to a running child) and, in a finally, removes the temp
worktree (git worktree remove --force, rm -rf) and prunes it from the main repo. The pre-exec stage has its own
EXIT/INT/TERM trap for the window between worktree add and the hand-over. Tested: 3 runs, limit 2, run 3 killed with
TERM while queued -> exit 143, 'stopped by signal 15; removed …'; all three temp worktrees gone from disk and from
git worktree list.
The shared Mac hit load 60 from parallel premerges and vitest runs, starving the e2e harness. In the merged copy
every branch re-runs (#447), after the merge and before install/typecheck/lint/tests, the script now takes one of
PREMERGE_MAX_CONCURRENT (default 2) flock'd slot files under PREMERGE_LOCK_DIR (default /tmp/vdrv), held by a python
parent for the run (a killed run frees its slot). Queued runs print 'premerge: queued for one of 2 slots …, waited Ns'
every 30 s and 'got slot i/2 after Ns'. Tested: 3 concurrent runs with a limit of 2, the third queued 10 s.
filter-base-list-tests.sh is the one place premerge drops base-list tests (logged to stderr). The test covers:
a base-list test is dropped and logged while an off-list test is still selected; shared prefix/suffix/folder
never skips; entries are literal (no regex) and comments are ignored; a missing list keeps everything.
w6's #450 premerge pulled in 4 agent-hooks tests through the importer selection; all 4 fail identically on
integration without the change (and on upstream at the merge base) under run-vitest.mjs, so premerge failed
on environment-only reds. The base list (41 files, derived on upstream e295b0d37c) now lives in the repo
and is subtracted from the targeted run.
A branch cut before #437 ran its own old copy of premerge-check.sh (the integration merge only happened in
the temp worktree), so #440's first gate selected 0 tests although the merged gate selects the parity test.
The script now merges, then execs the merged copy; it also prints every targeted test file.
Bare 'npx vitest' skips run-vitest.mjs's env (e.g. ORCA_BACKGROUND_LAUNCH=1) and the workspace package
build, which made 37 tests fail spuriously in a full run on integration HEAD.
#347 (c267ae3676) broke cloud-workspace-archive-delete-race.test.ts and the premerge never ran it,
because it only mapped changed sources to sibling-named tests (foo.ts -> foo.test.ts). #435 then ran 0
targeted files for the same reason. Now each changed source also selects every test in its folder and
every src test that imports it by module name; for cloud-workspace-actions.ts that is 14 files including
the race test. PREMERGE_FULL=1 runs the whole vitest suite.
- cloud-transfer-steps runs git through gitExecFileAsync (no direct child_process); VM replies parsed with zod.
- Casts replaced by types, guards and zod across hosted-sandbox, cloud-api, cloud-api settings and tests.
- Offline cache and message-queue store use node:fs/promises (main-sync-fs ratchet); the offline service's
30 s setInterval becomes a backing-off beat that runs only while prompts are queued; renderer intervals use
installWindowVisibilityInterval.
- Flaky-test gates: fixed timestamps, vi.waitFor, no sleeps in cloud-message-queue/cloud-transfer tests.
- shadcn restyles become primitive variants (Skeleton shape/motion, Button default-held, Textarea compact/bare,
InlineError toast layout, Popover focusRing); exhaustive switch; derived pending state in the run-target hook.
- Localization: routine labels/placeholders and 'Orca Cloud is unavailable.' through t(); cloudSecrets plurals
pass the singular as defaultValue_one.
- config/scripts/cloud-integration/premerge-check.sh: merge-into-integration gate (typecheck + full lint + tests).