Skip to content

#345 — explore: macro view walking skeleton (Slice 1) - #362

Merged
cmbays merged 1 commit into
mainfrom
explore-345-macro-view
Jun 13, 2026
Merged

cmbays merged 1 commit into
mainfrom
explore-345-macro-view

Conversation

@cmbays

@cmbays cmbays commented Jun 13, 2026 •

Copy link
Copy Markdown
Contributor

Part of #345 — the explorer macro view, Slice 1 (the walking skeleton). Epic: explorer arc #99. Sibling: the macro report lens #265 (its domain macro_lens.rs is already merged on main and consumed read-only here).

What Slice 1 delivers

The explorer gains a third sub-page, macro.html, emitted only when a --pr-diff changed a root-project macro. This slice is the end-to-end seam proof — no domain delta, no focused DAG, no directory yet (those land in later slices):

  • ExploreMacroTemplate + templates/explore-macro.html — an empty, zero-egress-clean shell mirroring the sibling explore pages' chassis (shared #242 tokens, the appearance engine, the favicon data: URI). No graph engine, no new vendored asset.
  • render_explore gains has_macro_focus: bool — resolved in the CLI, not the renderer (the explore-lane pure-renderer posture: this layer never calls a domain walker). true emits macro.html and renders the third nav anchor on every page; false keeps the dag.html/tests.html output shape, so the conditional {% if has_macro_focus %} anchor leaves the committed explore goldens byte-identical.
  • resolve_change_context now builds the NormalizedDiffIndex once and derives both the changed-model set and the changed-root-project-macro set (via the already-merged changed_macros_pr_diff), returning an ExploreChangeContext. has_macro_focus = !changed_macros.is_empty().

Plan discrepancies found and reconciled (from the critique)

  • Critique S5 (re-sequenced): the impl-plan claimed Slice 1 "establishes the macro.html golden." The live explore CI golden row renders with no --pr-diff, so it can never emit macro.html. Slice 1's golden is therefore the negative path (the two existing goldens stay byte-identical with the conditional anchor); the first committed macro.html golden lands when the focused DAG renders (Slice 3). Verified: examples/explore/{dag,tests}.html regenerate byte-identically.
  • Critique S4 (honored): render_explore takes the pre-resolved has_macro_focus flag, not the raw changed-macro id set — scope resolution stays in cli/mod.rs, the renderer stays pure. All 5+ render_explore call sites (CLI + headless helpers + in-file tests) updated.
  • B1/B2/S6 (the unbounded-downstream-closure and tests-partition reachability blockers) are Slice 2/3/4 concerns — Slice 1 carries no domain walker, so they don't bear here.

Gates (all run synchronously, in-turn)

Gate Result
clippy --all-targets --locked -D warnings PASS (raw exit 0 via rtk proxy)
cargo fmt --all --check PASS
cargo nextest run --locked PASS (1979 passed, 110 Chrome-skipped)
cargo test --test bdd PASS (30 features, 222 scenarios)
headless explore (real Chromium, file://, network-blocked) PASS (new macro.html test + committed-pages + theme tests)
RUSTDOCFLAGS=-D warnings cargo doc --no-deps --locked PASS
cargo deny check PASS
crap4rs scorecard PASS (render_explore 11.14, resolve_change_context 2.39 — both < 15)
explore byte-identity goldens PASS (dag.html/tests.html unchanged; report goldens untouched)
feature-count mirror (ci.yml + lefthook.yml) bumped 29 → 30 atomically

Invariants

Explore-lane only — render.rs / report.html untouched. Zero-egress preserved (no new asset; macro.html makes zero file:// network requests). Experimental surface inherited from the explore verb's stderr notice. Domain purity intact (no domain delta this slice).

🤖 Generated with Claude Code


Open in Stage

…age (#345 Slice 1)

Add the explorer macro view's walking skeleton (epic #99): a third
explore sub-page, `macro.html`, emitted ONLY when a `--pr-diff` changed
a root-project macro. The focused macro DAG (Slice 3) and the filtered
model+test directory (Slice 4) render into this shell in later slices;
Slice 1 proves the seam end-to-end — conditional emission, the nav
round-trip, and the negative path that keeps the two-page output (and
its byte-identity goldens) unchanged.

- `ExploreMacroTemplate` + `templates/explore-macro.html`: an empty,
  zero-egress-clean shell mirroring the sibling explore pages' chassis
  (shared tokens, appearance engine, favicon data: URI). No graph
  engine, no new asset.
- `render_explore` gains `has_macro_focus: bool` (resolved in the CLI,
  not the renderer — the explore-lane pure-renderer posture). True emits
  `macro.html` and renders the third nav anchor on every page; false
  keeps the dag.html/tests.html shape, so the committed explore goldens
  stay byte-identical (the `{% if has_macro_focus %}` conditional anchor).
- `resolve_change_context` now builds the `NormalizedDiffIndex` once and
  derives BOTH the changed-model set and the changed-root-project-macro
  set (via the already-merged `changed_macros_pr_diff`), returning an
  `ExploreChangeContext`. `has_macro_focus = !changed_macros.is_empty()`.
- BDD: `features/explore_macro_view.feature` (positive: a changed root
  macro emits macro.html + the nav anchor on every page; negative: a
  model-only diff and a no-diff run emit no macro.html). Feature count
  29 -> 30 mirrored atomically in ci.yml + lefthook.yml.
- Headless: a real-Chromium file:// network-block test on macro.html
  (zero requests, heading + empty-state + nav round-trip).

Explore-lane only — render.rs / report.html untouched. CRAP:
render_explore 11.14, resolve_change_context 2.39 (both < 15).

Part of #345

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@cmbays, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 41 minutes and 17 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 70cb6857-2e36-4c3b-a1fc-43990feb37fb

📥 Commits

Reviewing files that changed from the base of the PR and between fdd7a00 and ee7b4aa.

📒 Files selected for processing (15)
  • .github/workflows/ci.yml
  • features/explore_macro_view.feature
  • lefthook.yml
  • src/adapters/explore.rs
  • src/cli/mod.rs
  • templates/explore-dag.html
  • templates/explore-macro.html
  • templates/explore-tests.html
  • tests/headless_toggle.rs
  • tests/headless_zero_egress.rs
  • tests/steps/explore_change_context.rs
  • tests/steps/explore_full_manifest.rs
  • tests/steps/explore_macro_view.rs
  • tests/steps/mod.rs
  • tests/steps/world.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch explore-345-macro-view

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ghost

ghost commented Jun 13, 2026

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements the walking skeleton of the explorer macro focus view, introducing a third sub-page (macro.html) that is conditionally emitted when a PR diff modifies a root-project macro. It updates the CLI change context resolution, the HTML templates, and adds comprehensive integration and headless tests. Feedback on the changes suggests optimizing the page_html helper in the test steps to avoid cloning an Option<String> on the happy path.

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.

Comment thread tests/steps/explore_macro_view.rs
@github-actions

Copy link
Copy Markdown
Contributor

📄 Rendered report preview

All golden examples regenerated cleanly.

🟡 Golden examples

Committed to examples/ and byte-identity gated — the canonical reports contributors and consumers browse. Stable across PRs.

Report View Download
playground-report.html ▶ Open ↗ ⬇ Download
diff-showcase-report.html ▶ Open ↗ ⬇ Download
macro-heavy-report.html ▶ Open ↗ ⬇ Download
jaffle-shop-report.html ▶ Open ↗ ⬇ Download

🐶 Live dogfood preview

This PR doesn't touch dbt-project/, so there's no live dogfood preview.

🧭 Explore preview

The two-page cute-dbt explore explorer — dag.html (model lineage) + tests.html (unit-test viewer). Same golden/live split as the report.

🟡 Golden explore

The committed examples/explore/ playground golden (the full synthetic playground manifest). Byte-identity gated in Example report check. Stable across PRs.

Page View Download
explore/dag.html ▶ Open ↗ ⬇ Download
explore/tests.html ▶ Open ↗ ⬇ Download

🐶 Live explore

This PR doesn't touch dbt-project/, so there's no live explore preview.

▶ Open ↗ opens the report or explorer in your browser in one
click — published to this repo's GitHub Pages under
/pr-362/.
⬇ Download fetches the same self-contained HTML as a workflow
artifact (auth-gated; works fully offline). Either way the report
makes zero external resource requests.

The Pages preview may take ~1 min to update after this comment
posts. On PRs from forks the Open link is unavailable (read-only
token) — use Download.

Alternative: GitHub CLI
# gh CLI >= 2.63 extracts into ./report-preview-playground/.
gh run download 27475131790 -R breezy-bays-labs/cute-dbt -n report-preview-playground
open report-preview-playground/playground-report.html

Posted by report-preview.yml for ee7b4aa876ac4b46cf49e8778f415255fa8bbc92. Affordance only — never blocks merge.

@cmbays
cmbays merged commit 3383601 into main Jun 13, 2026
37 checks passed
@cmbays
cmbays deleted the explore-345-macro-view branch June 13, 2026 18:26
github-actions Bot added a commit that referenced this pull request Jun 13, 2026
@cmbays

cmbays commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

🧾 Merge debrief — #362 (#345 Slice 1: explorer macro view walking skeleton)

Merged 3383601 · Part of #345 · feat → patch. Explore-lane (report lane untouched — clean concurrency with the render-lane builders).

What shipped: the explorer emits a third sub-page macro.html (+ a conditional third nav anchor) only when a --pr-diff changed a root-project macro. resolve_change_context builds the NormalizedDiffIndex once → derives changed-models + changed-root-macros (reusing the merged changed_macros_pr_diff). Renderer stays pure (has_macro_focus: bool, scope resolution in CLI). No domain walker / focused DAG / directory yet (Slices 2–4).

Bot disposition — 1 thread rejected: gemini perf nit in a cucumber test-step helper (Option<String> clone) — test-path perf is irrelevant, behavior-identical, not worth a re-gate.

Plan discrepancies the builder caught + reconciled (good probe work): (1) the macro.html golden re-sequences to Slice 3 — the explore CI golden renders with no --pr-diff so it can never emit macro.html; Slice 1's golden is the negative path (existing goldens byte-identical + the conditional anchor). (2) threaded a pre-resolved has_macro_focus: bool (renderer stays pure) not the raw BTreeSet the plan named. (3) noted explore.rs is NOT strict-15-keyed in crap4rs.toml (default-25) — a future heavier explore slice should add the strict override + lefthook mirror.

Gates (green): clippy via rtk proxy, nextest 1979, BDD 30 features / 222 scenarios (feature-count 29→30 mirrored), headless explore + zero-egress (real Chromium), crap4rs (render_explore 11.14), explore goldens byte-identical, report lane untouched.

Next: #345 Slice 2 (the domain blast-radius walker + focused macro DAG — where the bounded-downstream-closure critique flag bears).

cmbays added a commit that referenced this pull request Jun 14, 2026
…-model DAG (#426)

* #345 — feat(explore): macro view filtered directory + dimmed impacted-model DAG

Finishes the explore macro view (cute-dbt#345, epic #99) — the two
remaining ACs after Slices 1–3 (#362/#364/#369):

- AC1 — filtered artifact directory: for the focused macro, a
  folder-grouped, collapsible directory (native <details>/<summary>, zero
  JS/egress) of ONLY the models + tests whose transitive
  depends_on.macros reaches it, mirroring project folders.
- AC3 — models and tests surfaced as SEPARATE partitions (never merged —
  the get_where_subquery non-merge rule), each grouped independently by
  the directory portion of original_file_path; pathless nodes bucket
  under "(no path)".

AC2 (impacted-model subgraph complement dimmed) shipped in Slice 3
(#369) as the .macro-downstream role-dim; AC4 (one shared domain
authority) is completed here — macro_blast_radius (models) and the new
macro_test_consumers (tests) both route through one
macro_resource_consumers walk, differing only in the resource-type
predicate. AC5 (EXPERIMENTAL-gated) holds — the explore page is already
experimental (#290).

Domain stays POD (the new fn is a pure reverse-walk); the folder
grouping is presentation in the explore adapter. render_explore takes a
new MacroFocus bundle (focus set + test consumers) so the renderer never
performs a domain walk (the explore-lane pure-renderer posture). The
explore-macro golden is regenerated byte-identical and now shows the
directory (3 callers across 2 folders, empty tests partition).

Tests: 8 new domain tests (macro_test_consumers — direct/transitive/
unit_test/vendor-exclude/null-package/unknown), 5 adapter tests (folder
grouping, partition separation, no-path sentinel, empty sets, end-to-end
render), 1 BDD scenario + 3 steps, 1 headless test (live-DOM directory
render + real collapse).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(explore): #345 — single-pass folder/file split in macro_dir_partition

Compute (folder, file) in one match over original_file_path instead of
three redundant path traversals. Functionally identical (golden output
byte-unchanged); idiomatic single pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant