feat(review): the rest of the dbt PR review stack as one PR
What this is
The rest of the dbt PR review stack as one PR. It replaces #1724, #1725, #1726, #1739, #1758, #1769, #1770, #1771, #1772, #1773, #1836, #1837 and #1838, which stay open until this merges and are then closed. Reviewing them one at a time took too long, so they are folded here on top of #1723 (already merged). 39 commits: one per original PR or hardening pass, three commits of fixes from our own review rounds, one test fix for CI, and the fixes for the four reviews here. Squash on merge.
What it adds to altimate review
- Checks: consumers outside dbt, contract vs SELECT, integer division by dialect, incremental / microbatch / snapshot semantics, data tests that cannot do their job, macro, join, docs and project-file rules.
- Posting: rule tiers (inline / summary / off), an inline budget of 10 per PR, findings anchored on the diff, a coverage ledger of what was not reviewed.
- AI lane (advisory): wider input (file quotas, hunk excerpts, context cards), focused batches, a verifier for AI findings, a rule verifier and a not-posted list that cut low-value rule comments, team conventions read from the repository's instruction files.
--all-projects: reviews every dbt project in a repository, discovered at the base commit, within a 30-minute budget.
Rules the branch holds to
- An engine error, an unreadable file, or a changed model without compiled head SQL holds back approval. A check that could not decide is listed and does not.
- No error text or source line in the comment, envelope or telemetry: failures are a fixed category through
reportFailure. - The AI lane and both verifiers never change the verdict, approvability or the exit code. The not-posted list hides a finding from posting, never from the verdict. An off rule never removes a blocking finding from the verdict; a non-blocking finding that is off does not count toward COMMENT. Hidden findings are in the signed envelope.
- Names and values in posted text go through codeSpan; model text is plain text.
- Sent to the AI provider: model SQL. Never sent: seed data rows, credential-named files, symlinked files, files holding key material. One withheld set covers every lane and every verifier tool.
- Policy that can weaken the review is read from the base branch. No automatic dismissal and no approve-to-replace.
Behaviour changes against main
- Undecidable equivalence is listed as "not fully verified" (was a warning), so those PRs approve.
- A false "table not found" from undocumented upstreams is dropped and the model is listed. "Column not found" is unchanged.
- A removed column still read downstream, and a PII column on an undocumented mart, now block (were comments).
- The "high downstream fan-out" warning and the core injection lints are removed.
- An unreadable macro, snapshot or changed dbt_project.yml holds back approval.
- A clean run posts nothing by default (silentWhenClean), except while this tool's own earlier request stands.
- An unknown key under rules: or posting: in the base config fails the run (exit 1).
- A "not implemented" planner message is an engine error, not a warning.
- Suggestions are never inline; several rules moved tier.
Cost
With the AI lane on, a 6-file PR makes about 3 model calls where main makes 1 (focused batches plus the verifiers). --no-ai is unchanged.
How it was checked
- Suite: 3,450 tests pass, typecheck clean, stable under random order.
- Verdict and exit code compared with main on base/head pairs with the real engine, five dialects, gate and comment mode. Remaining differences are the ones listed above.
- Three rounds of independent review with reproductions (gate result, failures that read as clean, incomplete runs, secrets, injection). They found 17 major issues; all are fixed with tests.
- Not independently re-reviewed: the third round of fixes. Please look hardest at the withheld-file screening in
orchestrate.ts(aiScreen), the escaping helpers informat.ts, and the posting flow inpost-github.ts.
Known limits
- Rendering safety was checked with a local CommonMark renderer, not on GitHub itself.
- The BigQuery PII result can differ between identical runs (same on main, in the core engine).
- Job-log masking and masking of echoed model text are best-effort.
- A credential file copied (not renamed) into a dbt directory is sent masked.
- Issue references such as #123 in posted text stay live (same as main).
- Engine calls have no time bound (same as main).
Review guide
Read commit by commit; the first 17 map to the original PRs in order. Docs: docs/docs/usage/dbt-pr-review.md has the full rule table, exit codes and what the AI lane sends.
🤖 Generated with Claude Code
Summary by CodeRabbit
- New Features
- Added multi-project dbt reviews with
--all-projectsand project-level results. - Expanded dbt checks for incremental models, snapshots, contracts, tests, joins, consumer columns, and project configuration.
- Added configurable AI review coverage, context, verification, replay, and optional Python and other-file review.
- Added optional dbt preparation in the GitHub Action, including compile and full modes.
- Improved review summaries with coverage details, grouped findings, safer inline comments, and clearer posting outcomes.
- Added multi-project dbt reviews with
- Bug Fixes
- Improved handling and reporting of undecided findings, incomplete reviews, and review failures.
- Documentation
- Expanded the usage guide, telemetry reference, and example workflow.