CI: git hooks, bun run ci, turbo cache, cli-smoke heap cap - #985
Conversation
- .githooks (wired by postinstall via core.hooksPath; works when editor is a submodule too): pre-commit runs Biome on staged files, pre-push checks the lockfile, lints, and runs check-types + tests for packages the branch changes. - bun run ci mirrors the quality job. - Turbo remote cache backed by the Actions cache in both jobs. - setup-bun reads packageManager instead of a second pin. - cli-smoke: NODE_OPTIONS heap 5 GB; the editor build hit Node's default heap limit on the 7 GB macOS runner (exit 137 on three recent runs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VMczFMfWJtZDbBdTARy88m
|
I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…). Please try again, rephrase, or reach out if it keeps failing. Error id: 3da01ee5-991c-439e-a079-c0af50dea257 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 55f8f71. Configure here.
| if ! bun install --frozen-lockfile --dry-run >/dev/null 2>&1; then | ||
| echo "pre-push: bun.lock is out of date. Run \`bun install\` and commit bun.lock." >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
Lockfile check sees working tree
Medium Severity
The lockfile gate runs bun install --frozen-lockfile --dry-run against the working tree, not the commits being pushed. After a local bun install, an uncommitted bun.lock keeps the check green even when the branch still has a stale lockfile, which is the case this hook is meant to stop.
Reviewed by Cursor Bugbot for commit 55f8f71. Configure here.
| ) | ||
| [ ${#files[@]} -eq 0 ] && exit 0 | ||
| bun run --silent check --no-errors-on-unmatched --diagnostic-level=error --write "${files[@]}" | ||
| git add -- "${files[@]}" |
There was a problem hiding this comment.
Pre-commit restages unstaged edits
Low Severity
After Biome --write, the hook git adds every staged path it selected. Unstaged hunks in those same files, including leftover WIP or secrets, get pulled into the commit along with the formatter fixes.
Reviewed by Cursor Bugbot for commit 55f8f71. Configure here.


What does this PR do?
Stops the push → red CI → fix → push loop on editor PRs. Of the last 10 failed CI runs:
Git hooks (
.githooks/, wired bypostinstallviacore.hooksPath)pre-commit runs Biome on staged files, fixes what it can and blocks on the rest.
pre-push:
bun.lockis in sync, when a package.json or the lockfile changedbun run check)check-typesand tests for the packages the branch changes and their dependentsThe worst case is a
corechange, about 33 s. Skip once with--no-verify.The hooks are plain bash (runs on macOS's bash 3.2) and call
bun runscripts, so they also work when editor is a submodule of pascalorg/private-editor. The private repo's install points the submodule at.githooks.postinstalldoes nothing in CI or when there is no.git(Docker).bun run ciruns exactly what the quality job runs: check, skills:validate, check-types, test, build. CONTRIBUTING now points to it.CI
rharkor/caching-for-turbo, SHA-pinned) in both jobs. Unchanged packages replay instead of rerunning.setup-bunreadspackageManagerinstead of a second hard-coded pin.NODE_OPTIONS=--max-old-space-size=5120. Recent runs hit "Reached heap limit" and exit 137.How to test
bun install, thengit config core.hooksPathprints.githooks.bun run cipasses. Validated from a clean worktree withCI=1 bun install --frozen-lockfilein 4.2 min: lint, skills, types 11/11, tests 13/13, build 8/8.Checklist
bun devbun checkto verify)mainbranch🤖 Generated with Claude Code
https://claude.ai/code/session_01VMczFMfWJtZDbBdTARy88m
Note
Low Risk
Changes affect dev tooling and CI only; no runtime product, auth, or data-path changes.
Overview
Adds local guardrails so contributors catch the same failures CI sees before push.
bun installsetscore.hooksPathto.githooks/(skipped in CI and non-git installs): pre-commit runs Biome with--writeon staged JS/TS/CSS/JSON/Markdown and re-stages fixes; pre-push optionally verifiesbun.lockwhen deps changed, runs fullcheck, thenci:changed(turbo run check-types testwith a...[$merge-base]filter) for affected packages.Root
bun run cimirrors the quality job (check, skills validation, types, tests, build). CONTRIBUTING now recommendsbun run ciinstead of separate check + test.GitHub Actions: both jobs read Bun from
packageManagerviabun-version-file, add Turbo cache (caching-for-turbo, SHA-pinned), and cli-smoke setsNODE_OPTIONS=--max-old-space-size=5120to avoid editor build OOM on macOS runners.Reviewed by Cursor Bugbot for commit 55f8f71. Bugbot is set up for automated code reviews on this repo. Configure here.