chore(dx): add scoped-verify wrapper + enforce filtered verify on low-end HW#424
Conversation
…-end HW A bare `turbo run typecheck` runs all five tasks -- ai-core build + typecheck, ui build + typecheck, web typecheck -- and takes 6-9 minutes cold on the dual-core / ~4 GB machine this repo is developed on. Scoped to the one workspace a PR actually touches, the same check finishes in well under a minute. That gap is large enough that "remember to pass --filter" is not a workable rule; it gets forgotten, and the forgetting is expensive. scripts/scoped-verify.mjs derives the affected workspaces from the diff against the merge-base (not against origin/main's tip, which would widen the scope every time something lands on main while a branch is open), maps them to package names, and builds a single filtered turbo invocation with --concurrency=1. Changing ai-core or ui pulls their consumers in via turbo's trailing `...`. A diff that touches no workspace at all exits 0 without running anything. Exposed as `pnpm verify`, `pnpm verify:test`, `pnpm verify:lint`. The unfiltered `typecheck` / `test` scripts stay for CI, which runs on hardware that can afford them. CLAUDE.md records the rule, and that PRs are worked on named branches: a detached HEAD invalidates the turbo hash on every switch, so the cache never hits. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 29 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Docker | Jul 14, 2026 12:21p.m. | Review ↗ | |
| JavaScript | Jul 14, 2026 12:21p.m. | Review ↗ | |
| Python | Jul 14, 2026 12:21p.m. | Review ↗ | |
| Rust | Jul 14, 2026 12:21p.m. | Review ↗ | |
| Shell | Jul 14, 2026 12:21p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/scoped-verify.mjs`:
- Line 75: Replace the non-ASCII characters in the console output strings within
the scoped verification script, including the messages near the no-workspace and
related output lines, with ASCII-only equivalents while preserving their
meaning.
- Around line 95-96: Update the launcher around spawnSync in the run flow to
invoke pnpm reliably on Windows, matching the platform-handling approach used by
the other launcher scripts; preserve the existing arguments, inherited stdio,
and exit-status propagation for non-Windows platforms.
- Around line 56-64: Update affectedWorkspaces to recognize shared
repository-root files such as package.json, pnpm-lock.yaml, tsconfig.json, and
turbo.json and mark every workspace as affected when any is present. Preserve
the existing prefix-based handling for workspace-specific files.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ac97da31-d54b-4d4b-9b37-d83a2c165f21
📒 Files selected for processing (3)
CLAUDE.mdpackage.jsonscripts/scoped-verify.mjs
- Shared root inputs were a hole, and a bad one: a change to package.json, pnpm-lock.yaml, pnpm-workspace.yaml, tsconfig*.json, turbo.json or .npmrc matches no workspace prefix, so `affected` came back empty and verify skipped entirely -- on exactly the changes that move the ground under every workspace at once. Those inputs now widen the scope to all of them. (This PR is its own test case: it touches package.json, and verify now fans out to all four.) - pnpm is a .cmd shim on Windows, which spawnSync cannot execute without a shell since Node's CVE-2024-27980 fix. `shell: isWindows`, mirroring gitkraken-mcp-launcher and graphify-mcp-doctor. The argv is built entirely from literals in this file, never from the diff, so the shell has nothing to inject into -- noted in a comment so it stays that way. - Replaced the em dash and arrow in the output with ASCII. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
What
pnpm verify/pnpm verify:test/pnpm verify:lint— a wrapper that derives the affected workspaces from the git diff and runs one filtered turbo invocation with--concurrency=1.The unfiltered
typecheck/testscripts stay as they are, for CI.Why
A bare
turbo run typecheckruns all five tasks — ai-core build + typecheck, ui build + typecheck, web typecheck. Measured on the dual-core / ~4 GB machine this repo is developed on, that is 6–9 minutes cold. Scoped to the workspace a PR actually touches, most of that work disappears.The gap is large enough that "remember to pass
--filter" is not a workable rule. It gets forgotten, and forgetting it is what caused atsc --noEmitto sit at 848 MB for 28 minutes and hard-freeze the editor earlier today. So the scoping is derived, not remembered.How it scopes
apps/web/**@cannaguide/webapps/desktop/**@cannaguide/desktoppackages/ai-core/**@cannaguide/ai-core...(library → pull in its consumers)packages/ui/**@cannaguide/ui...no workspace touched — skip verifyThe diff is taken against the merge-base, not against
origin/main's tip — otherwise every commit that lands on main while a branch is open would widen that branch's scope.Verified
Both paths exercised:
One scoped command, not five tasks.
An honest caveat
This does not make a cold
apps/webtypecheck fast — that is 6–9 minutes on this hardware no matter how it is invoked, and no scoping changes it. What the wrapper removes is the other four tasks, which is most of the waste on a PR that only touches one workspace.CLAUDE.md
Added, recording the rule and one more thing that mattered in practice: work each PR on a named branch, never a detached HEAD — every switch in detached HEAD invalidates the turbo hash, so the cache never hits and every run is cold.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation