Repository navigation
feat(devex): pnpm check:changed as the single pre-handoff gate - #33432
Conversation
Runs format, oxlint, the changed-code gate, affected typecheck projects, affected unit tests, and the ratchets/verifiers whose inputs changed, in parallel against the origin/main merge base plus local edits. Printing is limited to failures, and a pass is cached by a hash of the diff, untracked files, lockfile, and config so an unchanged rerun exits immediately.
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
45f4bdd5-8cd9-4c2e-8384-ba863152a101
Files selected for processing: 8-
.gitignoreAGENTS.mdconfig/scripts/check-changed-pass-cache.mjsconfig/scripts/check-changed-pass-cache.test.mjsconfig/scripts/check-changed-selection.mjsconfig/scripts/check-changed-selection.test.mjsconfig/scripts/check-changed.mjspackage.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
| git('init', '-q') | ||
| git('config', 'user.email', 'test@example.com') | ||
| git('config', 'user.name', 'Test') | ||
| git('config', 'core.autocrlf', 'false') |
There was a problem hiding this comment.
Disable commit signing in the temp repository.
The test runs git commit in a temp repository. A developer with global commit.gpgsign=true makes that commit fail, or wait for a pinentry prompt. The git() helper asserts exit code 0, so beforeEach fails. The test then fails for a reason unrelated to the code. Set commit.gpgsign to false locally in the temp repository.
Proposed fix
-
--- "a/config/scripts/check-changed-pass-cache.test.mjs" +++ "b/config/scripts/check-changed-pass-cache.test.mjs" @@ -24,7 +24,8 @@ git('init', '-q') git('config', 'user.email', 'test@example.com') git('config', 'user.name', 'Test') git('config', 'core.autocrlf', 'false') + git('config', 'commit.gpgsign', 'false') writeFileSync(join(root, '.gitignore'), '.cache/\n') writeFileSync(join(root, 'tracked.ts'), 'export const a = 1\n') writeFileSync(join(root, 'pnpm-lock.yaml'), 'lockfileVersion: 9\n')
Committable suggestion
-
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.Suggested changegit('config', 'core.autocrlf', 'false') git('config', 'core.autocrlf', 'false') git('config', 'commit.gpgsign', 'false')
What Changed
Adds
pnpm check:changed, one command an agent runs before handing work off. It replaces having to remembertest:changed,check:code-quality:changed,tc, and the ratchets.origin/mainmerge base, plus staged, unstaged, and untracked files. If nothing changed, it exits immediately.relatedtests, and any ratchets or verifiers whose inputs were touched. Only failures are printed, each with the tail of its output.classifyPrJobsdecides whether static analysis, typecheck, and tests run at all. CI'saffectsLocalizationExtractiongates the extraction check, andlistRatchetScriptssupplies the ratchets, so local selection and CI selection can't drift.config/scripts/check-changed-selection.mjsholds a small table from path prefixes to verifiers. For example, locale files trigger the localization catalog and coverage checks, and changes undersrc/main/runtime/rpctrigger the RPC params catalog check. Typecheck runs only the projects a changed tree can reach..cache/check-changed.json. The hash covers the merge base, each changed path's contents, untracked files, the lockfile, and the relevant config. If the hash still matches on the next run, it printsNothing changed since last passing runand exits. Staging or committing a change that already passed keeps the pass.--forceskips the cache.forceRerunTriggers(config/**,package.json, the lockfile,src/packages/**). For these it runs only their colocated*.test.*files. The full run stays CI's job.pnpm check:changed --maxWorkers=2as the single command to run before handoff.Why
Agents skip or forget some of the four or five gates before saying they're done, and running them one after another is slow. One parallel command that knows which checks a diff needs, and returns instantly when nothing changed, makes the right thing the easy thing.
Testing
This branch (8 changed files, which touch
package.jsonand so select every check: 4 typecheck projects plus 31 other checks), on a heavily loaded M-series Mac:--force(tsrs incremental cache warm)✗ unit testswith the Vitest diff, and the cache was not written. Reverting the change hit the cache again.pnpm tcpasses, and oxlint and oxfmt are clean on the changed files.Tested on macOS only. Process launches go through
@orca/process-host, oxc bins run under node, and pnpm is resolved throughpnpm-cli-invocation.mjs.