Repository navigation
#265 — render: macro lens model-selector + usage examples (Slice C) - #358
Conversation
…s (Slice C) Extends the experimental macro-lens section (cute-dbt#265, behind `Experiment::MacroLens`) with the founder D4 model-selector and the founder D6 first-order call-site examples. - `ImpactedModelView` / `CallSiteView` additive payload PODs on `ChangedMacroView`: each impacted (macro-calling) root-project model carries its inline raw SQL (server-rendered from the manifest `raw_code`, the existing Model-SQL source — no new I/O path) plus its first-order call sites of the changed macro, behind a generous cap (default 3 shown + the "more" copy; `MACRO_CALL_SITE_CAP`). - `impacted_model_views` / `macro_call_sites` / `line_invokes_macro`: pure render-lane string scans over already-loaded source (zero-egress, zero new I/O). The call-site match is bounded so `x_macro_name(` never false-matches; it is first-order only (full ref()-lineage downstream is the explorer, #345). - Template: the impacted-model `<select>` (reusing the #91 idiom) + a server-rendered per-model panel (inline SQL + call sites) for every impacted model, only the first visible. The selector behaviour is a GATED inline `<script>` inside the macro section (not the shared interaction.js engine), so the non-macro goldens stay byte-identical and a macro-only PR with zero in-scope models still switches panels. Pure renderer — flips `hidden` on change, never recomputes or fetches. Dogfood: the showcase macro `quarantine_filter` is already called inline in 3 playground models, so the regenerated `diff-showcase` golden shows the selector + call sites live. jaffle-shop + playground stay byte-identical (interaction.js untouched). Gates: clippy/fmt/nextest (1939)/bdd (29 features, +1 scenario in the existing macro_perspective.feature — no feature-count bump)/headless selector-switch + zero-egress/doc/deny all green; every touched fn CRAP<15 (worst new: line_invokes_macro=8). 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 22 minutes and 14 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 (6)
✨ 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 7 individual chapters for you: Chapters generated by Stage for commit 2629c17 on Jun 13, 2026 4:31pm UTC. |
There was a problem hiding this comment.
Code Review
This pull request implements the impacted-model selector and first-order call-site display for the macro lens feature. It introduces the necessary data structures, parsing logic to extract macro call sites from model source code, and frontend rendering templates with inline JavaScript to toggle between model panels. Additionally, comprehensive unit, BDD, and headless browser tests are added. The review feedback highlights a potential infinite loop in line_invokes_macro if macro_name is empty, suggesting a defensive guard to ensure robustness.
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.
📄 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 27472481085 -R breezy-bays-labs/cute-dbt -n report-preview-playground
open report-preview-playground/playground-report.htmlPosted by |
gemini (PR #358) flagged a latent hang: `str::find("")` returns `Some(0)` and a zero-length name never advances the scan cursor, so `line_invokes_macro` would spin forever on an empty `macro_name`. The sole caller (`macro_call_sites`) already guards the empty name, but a private helper whose safety depends on a non-local caller invariant — and whose failure mode is a silent hang — earns a local defensive guard. Returns false at the top on an empty name + a focused unit test (`line_invokes_macro("select foo()", "")` is false and does not hang). No rendered-output path hits the empty-name case, so the goldens are byte-identical (confirmed: `git diff --text` clean on examples/). Part of #265 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🧾 Merge debrief — #358 (
|
Part of #265 — the macro perspective lens, render lane Slice C.
Extends the experimental macro-lens section (behind
Experiment::MacroLens) with the founder D4 model-selector and the founder D6 first-order call-site examples. Append-only on the shared fence files (render.rs,report.html);interaction.jsis untouched.What it adds
<select>listing the impacted (macro-calling) root-project models; selecting one shows that model's inline SQL + its call sites in place. Reuses the feature: scope to updated unit tests by default + toggle to include unchanged #91 changed-models<select>idiom. The model SQL is server-rendered from the manifestraw_code(the existing Model-SQL source — no new I/O path); the JS is a pure renderer that flipshiddenon change.raw_codefor the macro name, behind a generous cap (default 3 shown + a "showing N of M" disclosure;MACRO_CALL_SITE_CAP). First-order only — full ref()-lineage downstream is the explorer (explore: macro view — filtered artifact directory + dimmed impacted-model DAG #345). The per-arm fidelity chip (exact / heuristic) already states confidence honestly (S2).ImpactedModelView,CallSiteView) onChangedMacroView; the macro_lens payload rides the JSON too (the both-surfaces precedent).Invariants
<script>inside the macro section, not the shared interaction.js engine — so the non-macro goldens (jaffle-shop,playground) stay byte-identical and a macro-only PR (zero in-scope models) still switches panels. Experiment OFF ⇒ the whole arm (script included) emits zero bytes.src; inline script + server-rendered panels. Headlessfile://network-block test green.line_invokes_macro=8).Dogfood
The showcase macro
quarantine_filteris already called inline in 3 playground models, so the regeneratedexamples/diff-showcase-report.htmlshows the selector + call sites live.Gates (all run synchronously, in-turn)
clippy (exit 0) · fmt --check · nextest (1939 passed) · bdd (29 features, 217 scenarios — +1 scenario in the existing
macro_perspective.feature, no feature-count bump) · headless selector-switch + zero-egress (real Chromium, file://, network-blocked) · rustdoc -D warnings · cargo deny · crap4rs scorecard PASS.🤖 Generated with Claude Code