PR Ready
Read the ## Git & PR workflow section in AGENTS.md if PR or CI behavior changed.
Trust These Facts
- Required PR checks live in
.github/workflows/ci-cd.yml. - Merge-gating jobs:
changeset-check,lint,audit,typecheck,test-unit,test-integration,test-web,e2e,build-api,build-cli,build-web,db-validate. - Local equivalents:
bun run lint,bun run typecheck,bun run test:cov:unit,bun run test:cov:integration,bun run --cwd apps/web test,bun run test:e2e. - Release-surface paths live in
scripts/releases/registry.ts(packagescli,mcp). Touching them requires a changeset in.changeset/, orchangeset-checkblocks the PR. - Base branch is
main. Rebase ontoorigin/main. The repo merges with merge commits, not squash. - "Merge-ready" means CI is green via
gh pr checks, not that the diff looks right.
Use This Workflow
- Snapshot before touching history. Record the tip so a bad rebase is recoverable:
git rev-parse HEAD(andgit reflogis always available). Never start a rebase blind. - Sync and rebase.
git fetch origin && git rebase origin/main. Resolve conflicts againstorigin/main. Rebase in small increments, not one long chain. - Verify nothing was stripped. Compare commit count/subjects against the snapshot. If commits vanished, recover with
git reflog+git cherry-pick— do not redo the work from memory. - Run the local gate.
bun run lint && bun run typecheck, then the relevant test buckets. Fix failures (including SSR/build breaks — see the SSR-safe-state rule inAGENTS.mdWeb rules) before pushing. - Changesets. If the diff touches a release surface, add a changeset (
bun run changeset) describing the bump. - Push.
git push --force-with-lease(never bare--force). - Confirm CI.
gh pr checks <pr>— wait for every gating job to pass. - Address review. Resolve Greptile/reviewer comments; keep replies concise; re-run the gate after changes.
Only Report Merge-Ready When
gh pr checks <pr>shows all gating jobs green (not pending, not skipped-by-error).- No commits were lost in rebase (verified against the step-1 snapshot).
- Changeset present if a release surface changed.
Until all three hold, report status honestly ("CI still running", "2 checks red") — never "merge-ready".