Repository navigation
#265 — render: macro lens section MVP (Slice B) - #356
Conversation
…ree (#265 Slice B) The render lane for the macro perspective (epic #265). A macros/*.sql edit is invisible to model-and-unit-test scope selection; this adds an EXPERIMENTAL "macro changed" report section that consumes the merged Slice-A domain layer (macro_blast_radius + changed_macros_{pr_diff,baseline}) and surfaces, per changed root-project macro: - the rendered macro body diff (reusing the #111 reconstruct hunk renderer via a new domain reconstruct_macro_sql_diff, the model_sql_diff sibling), - the impacted-model count (the reverse blast radius cardinality), - the impacted models as a collapsible directory tree grouped by original_file_path (founder D3 — list/tree only, no inline bodies), - a per-arm fidelity chip (baseline = exact macro-body comparison; pr-diff = path/name heuristic). Everything is gated behind a new Experiment::MacroLens ("macro-lens" id): when off the cli passes macro_lens = None, so the JSON key is omitted (skip_serializing_if) and the {% if macro_lens %} template section emits zero bytes — the non-macro goldens (jaffle-shop, playground) stay byte-identical. The section renders ABOVE the governance chips (founder "near the top"). Copy says "macro changed", never a state:modified.macros selector (critique S2). Vendor-package macros are filtered out of the lens (critique posture). No focused DAG, no report→explore hyperlink (explore-only, #345; the one-file zero-egress contract holds). Dogfood (same PR): a synthetic root-project macro source file (playground-source/macros/data_quality/quarantine_filter.sql, byte-aligned to the committed manifest macro_sql) + a macro edit hunk in playground-pr-diff.patch; the diff-showcase golden regenerates with the section (3 impacted models across two directory subtrees). The only golden payload change is the added macro_lens key. Gates: new features/macro_perspective.feature (4 scenarios — pr-diff edit / no-edit byte-stable / experiment-off / vendor-filtered), feature-count mirror bumped 28→29 in ci.yml + lefthook.yml. Headless (real Chromium, file://, network-blocked) asserts the section renders + the tree expands. crap4rs PASS (every new fn <15; worst overall 15.0). fmt/clippy --locked/ nextest (1931)/bdd (216)/headless (95)/zero-egress (11)/doc/deny all green. Part of #265. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 3 minutes and 3 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (16)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Ready to review this PR? Stage has broken it down into 9 individual chapters for you: Chapters generated by Stage for commit eae7a31 on Jun 13, 2026 3:49pm UTC. |
📄 Rendered report previewAll golden examples regenerated cleanly. 🟡 Golden examplesCommitted to
🐶 Live dogfood previewThis PR doesn't touch 🧭 Explore previewThe two-page 🟡 Golden exploreThe committed
🐶 Live exploreThis PR doesn't touch ▶ Open ↗ opens the report or explorer in your browser in one The Pages preview may take ~1 min to update after this comment Alternative: GitHub CLI# gh CLI >= 2.63 extracts into ./report-preview-playground/.
gh run download 27471437940 -R breezy-bays-labs/cute-dbt -n report-preview-playground
open report-preview-playground/playground-report.htmlPosted by |
There was a problem hiding this comment.
Code Review
This pull request implements the macro perspective lens (cute-dbt#265, Slice B), which identifies changed root-project macros and displays their body diffs alongside a collapsible directory tree of impacted models. The feature is gated behind the macro-lens experimental switch. Key additions include the build_macro_lens and reconstruct_macro_sql_diff functions, updated CLI and rendering pipelines, HTML template integration, and comprehensive BDD and headless browser tests. Feedback on the changes suggests a defensive panic-safety improvement in src/adapters/render.rs to use .iter().skip(shared) instead of direct slicing when traversing directory segments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
🧾 Merge debrief — #356 (
|
Summary
The render lane for the macro perspective (epic #265, Slice B). A
macros/*.sqledit is invisible to cute-dbt's model-and-unit-test scope selection; this adds an EXPERIMENTAL "macro changed" report section that consumes the merged Slice-A domain layer (macro_blast_radius+changed_macros_{pr_diff,baseline}) and surfaces, per changed root-project macro:reconstruct_macro_sql_diff, themodel_sql_diffsibling),original_file_path(founder D3 — list/tree only, no inline bodies),Gating + invariants
Experiment::MacroLens("macro-lens"id, additive). Off ⇒macro_lens = None⇒ JSON key omitted +{% if macro_lens %}emits zero bytes ⇒ non-macro goldens byte-identical (jaffle-shop,playgroundregenerate unchanged; onlydiff-showcasemoves, and its only payload delta is the addedmacro_lenskey).state:modified.macrosselector (critique S2). Vendor-package macros are filtered out of the lens. No focused DAG, no report→explore hyperlink (explore-only, explore: macro view — filtered artifact directory + dimmed impacted-model DAG #345; one-file zero-egress holds).reconstruct_macro_sql_diff) is additive inpr_diff.rs; no comparator/scoping/state.rstouch.Dogfood (same PR)
Synthetic root-project macro source
playground-source/macros/data_quality/quarantine_filter.sql(byte-aligned to the committed manifestmacro_sql) + a macro edit hunk inplayground-pr-diff.patch; thediff-showcasegolden regenerates with the section (3 impacted models across two directory subtrees:marts/core+intermediate/healthcare). Both new fixtures are listed intests/fixtures/MANIFEST.toml(synthetic_only = true).Gates (all green)
cargo fmt --check,cargo clippy --all-targets --locked -D warnings,cargo nextest run(1931 pass),cargo test --test bdd(216 scenarios), headless--run-ignored all(95 pass, real Chromium / file:// / network-blocked — section renders + tree expands),headless_zero_egress(11 pass — zero requests),cargo doc -D warnings,cargo deny check, crap4rs scorecard PASS (every new fn < 15; worst overall 15.0).features/macro_perspective.feature(4 scenarios: pr-diff edit → section present; no edit → absent + byte-stable; experiment OFF → absent; vendor macro → filtered). Feature-count mirror bumped 28→29 inci.ymlANDlefthook.ymlatomically.diff-showcasegolden byte-identical to renderer output (verified).Part of #265.
🤖 Generated with Claude Code