Repository navigation
#404 — feat(render): PR-scope lineage mini-DAG at the report top (EXPERIMENTAL) + click→selector - #407
Conversation
…AL) + click→selector #404 (epic #352, Slice C) — render the focused cross-model lineage subgraph at the top of the report: the models the PR modified (emphasized), the connectors between them (a quiet tier), and the deleted models (ghosts), each with its lines ± chip. Clicking a node selects that model in the report's existing <select>. Run-loop wiring (src/cli/mod.rs): `gather_pr_dag` builds the PrDag for the in-scope set per scope arm (pr-diff: changed_models + diff-hunk line counts; baseline: StateComparator modified + raw_code old→new line counts, plus the new/deleted sets), populates each node's lines ±, and threads an `Option<PrDagPayload>` into render. The single experiment gate lives at the top of `gather_pr_dag` (the gather→render single construction source, the macro-lens precedent). Render (render.rs + templates/report.html): a new `PrDagPayload` render view (graph + per-state descriptor counts + size-bound `collapsed` flag, cap 48 nodes) rides the JSON payload and drives a server-rendered descriptor + static Mermaid host. The mini-DAG paints client-side from `DATA.pr_dag.graph` via a GATED inline script (Mermaid — the static default engine, one engine per page), so the OFF case emits zero bytes and the default goldens stay byte-identical. Click→select reuses the #91 `change.cuteDbt` contract; a viewer toggle row in the settings panel shows/hides the panel. EXPERIMENTAL gate: new `Experiment::PrScopeMiniDag` (id `pr-scope-mini-dag`), default OFF. Byte-identity verified for jaffle-shop + playground (default OFF); the all-experiments diff-showcase golden gains the mini-DAG (1 node); the macro-heavy + seed-showcase goldens are unchanged (their pr-diffs modify no model, so the mini-DAG is None). Dogfood: a synthetic connector-path manifest (stg_orders → int_order_items → fct_orders; stg + fct modified, int the connector) + patch + the new `examples/prdiff-minidag-report.html` golden (experiment ON), wired into the example-report-check byte gate (ci.yml + report-preview.yml), the synthetic-only fixture manifest, the resource-ref + zero-egress gates (COMMITTED_EXAMPLES), and a headless test asserting the mini-DAG renders and a node click selects the model. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughImplements the PR-scope lineage mini-DAG feature ( ChangesPR-scope lineage mini-DAG (Slice C)
Sequence Diagram(s)sequenceDiagram
participant User as User (browser)
participant HTML as report.html panel
participant Mermaid as window.mermaid
participant Select as `#model-select`
rect rgba(70, 130, 180, 0.5)
note over HTML,Mermaid: DOMContentLoaded — mini-DAG init
HTML->>HTML: parse `#cute-dbt-data` JSON → pr_dag.graph
HTML->>Mermaid: mermaid.render(flowchart definition)
Mermaid-->>HTML: SVG injected into .pr-minidag-canvas
end
rect rgba(100, 160, 100, 0.5)
note over HTML,Select: Node click interaction
User->>HTML: click g.node (e.g. fct_orders)
HTML->>Select: dispatch change.cuteDbt (or change)
Select-->>HTML: model detail panel updates
end
rect rgba(180, 100, 80, 0.5)
note over HTML: Viewer toggle
User->>HTML: uncheck `#settings-prdag-input`
HTML->>HTML: hide .pr-minidag-panel
end
sequenceDiagram
participant CLI as execute_report
participant Gather as gather_pr_dag
participant Domain as compute_pr_dag + populate_line_counts
participant Renderer as render_report_with_externals
participant Template as ReportTemplate
CLI->>Gather: manifest, scope, experiments
Gather->>Domain: pr_dag_scope_sets → (modified, new, removed)
Domain-->>Gather: PrDagGraph topology
Gather->>Domain: populate_pr_dag_line_counts
Domain-->>Gather: PrDagGraph with line deltas
Gather-->>CLI: Some(PrDagPayload::from_graph(...))
CLI->>Renderer: pr_dag: Some(&PrDagPayload)
Renderer->>Template: ReportPayload { pr_dag: Some(...) }
Template-->>Renderer: HTML with mini-DAG panel
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
📄 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 27500195705 -R breezy-bays-labs/cute-dbt -n report-preview-playground
open report-preview-playground/playground-report.htmlPosted by |
…xplore helpers (#404) The `crap4rs scorecard` gate on PR #407 was RED because `PrDagPayload::from_graph` (render.rs, strict-keyed <=15) scored CRAP 30.00: CC 5 at 0.0% line coverage. Its only caller is a headless test, which `cargo llvm-cov nextest` does not count. Add four `#[cfg(test)]` unit tests building a `PrDagGraph` and asserting the payload shape (state->tier classification, connector-flag precedence over Deleted, the strict `> cap` collapse boundary, empty-graph zeros, graph carried verbatim). from_graph now CC 5 / cov 100.0% / CRAP 5.00. Founder-flagged hygiene (under the default <=25, non-gating) addressed via behavior-preserving extraction: - explore.rs `focused_typed_node_map` 17.77 -> 13.15: pull the resource_type -> LineageNodeType classification into a named `lineage_vertex_type` helper (CC 2, cov 100%), with a direct unit test over every vertex / non-vertex arm. - cli/mod.rs `gather_external_fixtures_with_reader` 15.01 -> 8.02: pull the per-test given/expect assembly into `external_fixtures_for_test` (CC 5, cov 100%); the gather loop is now a thin per-test driver. `execute_report` left alone (CRAP 17.00, CC 17, cov 99.1%): it is the documented linear composition root carrying `#[allow(too_many_lines)]`; its CC is one named gather/diff-arm step per branch and the prompt flags it as do-not-destabilize. Under the default gate, so non-gating. Scorecard: 0 above threshold (25) | worst 17.0 | PASS. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Merged to main ( What shipped: PR-scope lineage mini-DAG at the report top (EXPERIMENTAL-gated via Gate: crap4rs exits 0; all 22 required checks green. Engineering-cleared SHIP (already adversarially gated last session; the CRAP delta was orchestrator-verified — extractions behavior-preserving by construction, tests assert real invariants, not coverage-padding). Disposition: founder-authorized ship of the mini-DAG arc (#352). Experiment OFF by default → shipping report byte-identical. |
Closes #404
Renders the PR-scope lineage mini-DAG at the top of the report (epic #352, Slice C): the focused cross-model subgraph showing the models the PR modified (emphasized), the connectors between them (a quiet tier), and the deleted models (ghosts), each with its lines ± chip. Clicking a node selects that model in the report's existing selector.
What landed
src/cli/mod.rs):gather_pr_dagbuilds thePrDagper scope arm and populates per-node line counts — pr-diff arm from the diff hunks, baseline arm fromraw_codeold→new (plus the new/deleted sets) — then threads anOption<PrDagPayload>into render. The experiment gate is the single construction source at the top ofgather_pr_dag(thegather_macro_lensprecedent).render.rs+templates/report.html): aPrDagPayloadrender view (graph + per-state descriptor counts + a size-boundcollapsedflag, cap 48 nodes) rides the JSON payload and drives a server-rendered descriptor + a static Mermaid host. The graph paints client-side fromDATA.pr_dag.graphvia a gated inline script (Mermaid — the static default engine, one engine per page), so the OFF case emits zero bytes.change.cuteDbtcontract on#model-selectand scrolls the selection into view. A settings-panel viewer toggle shows/hides the panel.Experiment::PrScopeMiniDag(idpr-scope-mini-dag), default OFF. Byte-identity preserved for the default goldens.stg_orders → int_order_items → fct_orders; stg + fct modified, int the connector) + patch + the newexamples/prdiff-minidag-report.htmlgolden (experiment ON), wired into the byte gate, the synthetic-only fixture manifest, the resource-ref + zero-egress gates, and a headless test asserting the mini-DAG renders and a node click selects the model.Render review
The reviewable artifact is
examples/prdiff-minidag-report.html(open it directly). It shows the connector path withstg_orders (+1/-1)andfct_orders (+1/-1)emphasized andint_order_itemsas the quiet connector between them.Gates
cargo fmt --check,clippy --all-targets --locked -D warnings,cargo nextest run(2209 passed),cargo test --test bdd(226 scenarios), headless zero-egress + toggle (incl. the new click→select assert),cargo doc -D warnings,cargo deny check, resource-ref lint, golden byte-identity — all green. The default OFF goldens (jaffle-shop, playground) stay byte-identical; only the all-experiments diff-showcase golden gains the mini-DAG (1 node).🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Documentation
Tests