feat(review): 11 deterministic rules for macro, test and yml defects

RA
25m ago
+1011-8

Stacked on #1769. Adds 11 deterministic rules for macro, test and yml defects that the replay showed every reviewer missing. They are written from defects in the tuning repos and checked on repos never used for tuning. All start at summary tier.

Results (rules only, no AI)

SetDefects caught, before → afterFindings per PR
Tuning repos (dev recall set)+11–
25 repos never used for tuning (129 PR snapshots, 188 defects)11 → 12 (+1, 95% CI 0 to +3)8.49 → 8.54 (+0.6%)
  • On the never-used repos the new rules fired 7 times in 129 PR snapshots, and no repo lost a catch. They are quiet and safe, but mostly specific to the defect shapes they were written from.
  • Planted-bug suite on the never-used repos (one injected defect per rule per repo, each with a no-defect twin): 236 of 238 caught, 1 false alarm on 237 twins (a twin whose edited line already had a second unspaced Jinja seam).

New rules

  • GROUP BY <n> with a single position inside macro SQL.
  • A parameter added to an existing macro without a default (dispatch variants skipped).
  • adapter.dispatch keywords an adapter variant doesn't accept.
  • A singular test whose lookback window literal got shorter.
  • YAML structure errors, and quickstart public_models missing a new model.
  • A doc() reference with no docs block.
  • package-lock.yml added to a package repository.
  • An unbounded BigQuery merge, a join predicate repeated after an earlier INNER join, and SQL seams in Jinja string concatenation.

Testing

  • bun test test/altimate/review: 711 pass.
  • bunx tsc --noEmit: clean.
  • Each rule has positive and negative cases in review-dbt-patterns / review-project-rules tests.

🤖 Generated with Claude Code