feat(review): `--all-projects` reviews every dbt project a PR touches in one run

RA
1h ago
+647-7

Issue for this PR

Part of #1792

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Stacked on #1772. altimate review --all-projects reviews every dbt project a PR touches in one run and posts one combined comment. Before, a monorepo PR needed one run per project.

What changed

  • multi-project.ts:
    • Collects the changed files once and finds every dbt_project.yml on the head side, skipping dbt_packages/, target/ and node_modules/.
    • Assigns each file to the deepest project that contains it.
    • Reviews each touched project in turn, with its own policy, layout and manifest.
  • One signed envelope:
    • Findings are merged and de-duplicated.
    • Verdict and tier: the most severe across projects.
    • The not-reviewed ledgers are unioned, so other projects' files are no longer "outside the project".
    • AI usage is summed.
    • Each project's root, verdict and AI state go in scope.projects / ai.projects.
  • With 0 or 1 touched projects, the single-project result is returned unchanged.
  • The summary adds "Reviewed N dbt projects" only when there are several.

Results

  • A private monorepo PR touching 5 dbt projects took 5 separate runs before. Now it takes 1 run with one comment.
  • Single-project PRs are unchanged (the flag is off by default).

How did you verify your code works?

  • bun test test/altimate/review: 754 pass.
  • bunx tsc --noEmit: clean.
  • New: test/altimate/review-all-projects.test.ts.

Cost side effects

None by default: --all-projects is opt-in. When used, the review runs once per touched dbt project, so any enabled AI-lane calls and opt-in dbt_prepare work scale with the number of touched projects (one run per project, as before, but now in one invocation). Single-project PRs are unchanged.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR
  • I checked for cost side effects (model calls, queries or cloud resources that grow with user data) and described them, or wrote "none"

πŸ€– Generated with Claude Code


Summary by cubic

Adds altimate review --all-projects so a mono-repo PR touching multiple dbt projects is reviewed in one run and gets one combined comment. Previously, each project needed a separate review run.

New Features

  • Discovers every dbt_project.yml the PR touches (git listing uses -z, so non-ASCII directory names work), assigns each changed file to the deepest containing project, and reviews each with its own policy, layout, and manifest. --manifest applies only to the project containing it; when it can't be attributed to a touched project, a warning says no project uses it.
  • Merges per-project results into one signed verdict: findings de-duplicated, most severe post-mode verdict and highest tier kept, AI usage summed with the worst project's state winning, and per-project detail in scope.projects / ai.projects. Shared envelope fields (manifestHash, policy) are kept only when every project agrees.
  • Falls back to the existing single-project review when the PR touches zero or one project, and the summary adds "Reviewed N dbt projects" only when several were reviewed.