feat(dbt): dbt mart optimizer commands, skills and a review schema-lag lane

Closed
RA
2d ago
+8030-189

Summary

dbt mart optimization commands and skills, plus a deploy-order check in PR review.

This branch also carries five earlier, unmerged commits it builds on: the Claude Code plugin, project-scope review (altimate review --all), altimate dbt-perf, and the CROSS JOIN / rule-catalog review fixes. New in this PR:

  • altimate dbt-impact (4626aedeb4): impact of a model change through dbt models, loaders and served tables.

    • Diff mode compares compiled SQL from --base-manifest / --head-manifest, or from its own offline compile of each side.
    • --jobs jobs.json / --jobs-from selectors enable the schema-lag check, which catches a reader of a new column that runs in another job before the producer is rebuilt.
    • --live reads the deployed columns.
  • altimate dbt-optimize, dbt-factor, dbt-parity (4626aedeb4): proved rewrites with a cost verdict and apply, factoring of shared logic, and before/after row parity.

  • Skills (57a9c1b279): dbt-impact, dbt-optimize, dbt-factor, dbt-parity, mirrored into the Claude Code plugin.

  • Review schema-lag lane (c40a1cfa83): runs on compiled base and head, and altimate review now takes:

    • --jobs / --jobs-from
    • --base-manifest / --head-manifest
    • --dbt-bin / --profiles-dir / --dbt-target

    Job-map failures are now reported instead of skipped silently.

Results

On the public benchmark (king-kong-bench kong_marts, DuckDB and Trino), the schema-lag cases are caught 3/3 with 0 false alarms by both dbt-impact and review. Before the review fix, review caught 0/3.

Test plan

  • bun test on the dbt-*, review, skills, core-native, data-diff and skill suites (1402 pass)
  • tsc --noEmit clean for packages/opencode
  • Rebased on main; resolved one test-file conflict by keeping both test blocks

Depends on the altimate-core-internal PR (feat/dbt-mart-optimizer) for the new core bindings.

🤖 Generated with Claude Code


Summary by cubic

Adds dbt mart optimizer commands and skills, plus a schema-lag lane to altimate review that catches when a reader of a new column runs in an earlier job than the producer that builds it.

New Features

  • altimate dbt-impact traces the blast radius of a model change through dbt models, loaders, and served tables, comparing compiled SQL from --base-manifest/--head-manifest or offline compiles of each side; --jobs/--jobs-from selectors enable the schema-lag check and --live reads deployed columns.
  • Adds altimate dbt-optimize, dbt-factor, and dbt-parity for proven rewrites with a cost verdict, factoring shared logic into one model, and before/after row parity.
  • Ships matching skills in .opencode/skills/ and the Claude Code plugin.
  • altimate review now takes --jobs, --base-manifest/--head-manifest, and --dbt-bin/--profiles-dir/--dbt-target; job-map failures are reported instead of silently skipped.

On the public benchmark, schema-lag cases are caught 3/3 with 0 false alarms by both dbt-impact and review, where review previously caught 0/3. Depends on the matching altimate-core-internal PR for the new core bindings.

Summary by CodeRabbit

  • New Features
    • Added commands for dbt performance analysis, model optimization, before-and-after parity checks, downstream impact analysis, and shared-logic factoring.
    • Added whole-project dbt reviews, including compiled-model coverage and schema-lag checks across configured jobs.
    • Added Claude Code and OpenCode skills for dbt reviews, analysis, optimization, verification, and SQL review.
    • Improved Trino support for data comparisons and made review findings more aware of SQL dialects, comments, and literals.
  • Documentation
    • Documented new commands, project-wide reviews, configuration options, and review workflows.