Repository navigation
Speed up process-host import enforcement in CI - #27124
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to Build reuse could miss a dependency change when compiler output is unusually large. Reject truncated output before saving state; otherwise the PR appears mergeable with this bounded risk. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b29e5100-1c5f-4b40-9cbd-ff0a2f5934db
📒 Files selected for processing (2)
config/scripts/codex-usage-parser-memory-benchmark.mjsconfig/scripts/pr-workflow-parallelism.test.mjs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
| fileURLToPath(import.meta.resolve('@orca/process-host')), | ||
| join(import.meta.dirname, 'process-failure-message.mjs'), |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
set -eu
sed -n '10,22p' src/packages/process-host/package.json
for file in \
src/packages/process-host/src/run-process.ts \
src/packages/process-host/dist/run-process.js
do
if [[ -f "$file" ]]; then
printf '\n--- %s ---\n' "$file"
sed -n '1,100p' "$file"
fi
done
rg -n --glob '*.ts' --glob '*.js' \
"from ['\"]\\.|import\\(['\"]\\." \
src/packages/process-host/src || trueRepository: stablyai/orca
Length of output: 8726
🏁 Script executed:
set -eu
printf '%s\n' '--- package metadata ---'
cat src/packages/process-host/package.json
printf '%s\n' '--- package files ---'
find src/packages/process-host -maxdepth 3 -type f \( -path '*/dist/*' -o -name '*tsconfig*' -o -name '*build*' \) -print | sort
printf '%s\n' '--- benchmark hash references ---'
rg -n -C 8 -F -- 'instrumentationSha256' config/scripts/codex-usage-parser-memory-benchmark.mjs
printf '%s\n' '--- hash helper references ---'
rg -n -C 5 --glob '*.mjs' --glob '*.js' --glob '*.ts' 'sha256|createHash|hashFile|hash.*file' config/scripts src/packages/process-host | head -240
printf '%s\n' '--- built entrypoint ---'
if [ -f src/packages/process-host/dist/run-process.js ]; then
sed -n '1,180p' src/packages/process-host/dist/run-process.js
else
printf '%s\n' 'dist/run-process.js is absent'
fiRepository: stablyai/orca
Length of output: 26388
🏁 Script executed:
set -eu
printf '%s\n' '--- build script ---'
nl -ba src/packages/process-host/scripts/build-dist.mjs
printf '%s\n' '--- tsconfig ---'
cat src/packages/process-host/tsconfig.json
printf '%s\n' '--- benchmark digest definition ---'
nl -ba config/scripts/codex-usage-parser-memory-benchmark.mjs | sed -n '1,35p;250,288p'Repository: stablyai/orca
Length of output: 18080
Hash the complete @orca/process-host runtime dependency graph.
run-process.js imports project-owned runtime modules. The build emits separate files with TypeScript and does not bundle them. Hashing only the resolved entrypoint allows changes in those dependency files to leave instrumentationSha256 unchanged.
Include every emitted runtime file reachable from the resolved @orca/process-host entrypoint in the hash inputs.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Reject truncated compiler output before saving build state. · build-dist.mjs:110-119
src/packages/process-host/scripts/build-dist.mjs:110-119
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winReject truncated compiler output before saving build state.
compileAndSyncusescompile.stdoutas the completecompiledFileslist without checkingcompile.outputTruncated. A truncated--listFilesresult can omit dependencies and allow reusable state to be saved with an incomplete input fingerprint.🐛 Suggested fix
if (compile.code !== 0) { const detail = [compile.stdout, compile.stderr].filter(Boolean).join('\n').trim() const reason = compile.timedOut ? 'timed out' : (compile.signal ?? compile.code) throw new Error(`process-host compilation failed (${reason})${detail ? `:\n${detail}` : ''}`) } + if (compile.outputTruncated) { + throw new Error('process-host compilation output was truncated') + }
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
0c76097b-2add-4f5d-b08d-22c1e9eba7f6
📒 Files selected for processing (2)
config/scripts/process-host-build-reuse.test.mjssrc/packages/process-host/scripts/build-dist.mjs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
ELI5
The package extraction added an import check that spent about 30 seconds on the static CI path. This follow-up reduces its work and runs it alongside other checks, keeping it mandatory before CI can succeed.
What Changed
Why
This improves the existing checker and scheduling without changing package APIs, test selection, or shard count. Package builds retain their original locked compilation and publication: controlled Windows measurements favored that simpler path over a persistent build cache for jobs with few builds.
Linked Issue
Maintainer-requested performance follow-up to #26963.
Visual Proof
N/A — CI and tooling changes only.
Testing
Exact final commit
41a3661911657cd510ebaa475d1b68bd36cf7d3apasses all 143 focused tests, fullpnpm tc, changed-code quality, and the full anti-slop audit. Both workflow contract suites pass all 37 cases, including phase selection, failure, cancellation, successful no-op registration, and mandatory waits. The benchmark passes eight small smoke measurements. The same exact commit passes frozen installation, package build, all 143 focused cases, live import enforcement, and full typechecking on native Windows through paired hostawin. Final CI is clean on that exact commit: 22 checks pass, eight skip under the existing path rules, and no failures or active jobs remain. All five full Node 24 unit shards, Linux and Windows packaging, static/typecheck, runtime contracts, aggregate verification, and evidence collection pass without reruns.The original guard added 29.485 seconds in the extraction’s static job. An interleaved local comparison returns identical results for all 32,420 sources and reduces parsing/analysis from 10.19 to 7.33 seconds, about 28% less work. The exact final-head static job passes: the mandatory scan takes 25.659 seconds entirely in parallel, finishes 165.162 seconds before its join, and adds no serial wait (the join takes about 0.10 ms). Full unit execution totals 2,904.42 seconds across five shards, median 575.52 seconds. The original extraction sample was 2,887 total / 571 median: differences of about 0.6% / 0.8% across different source snapshots do not establish a regression. Cache state, runner load, and independent main changes prevent claiming a fixed whole-workflow percentage improvement.
Review
Independent native reviewers cleared parser semantics, mandatory background-check enforcement, both workflow contracts, the benchmark migration, and upstream merge preservation. The entire process-host package tree is byte-identical to main. Windows measurement counsel supports keeping its existing build path.
Agent skill upstream boundary
Notes
This final change is six files, 104 additions and 39 deletions. Package manifests, compiler settings, runtime code, artifact publication, and unit selection are unchanged. Main #27109’s independent test consolidation is preserved.
Checklist