Repository navigation
#403 — feat(domain): PR-scope mini-DAG per-node lines added/removed - #405
Conversation
#403 (epic #352, Slice B). Add additive `lines_added` / `lines_removed` counts to `PrDagNode` plus two pure arm-specific counters in `src/domain/pr_dag.rs`: - `pr_dag_lines_from_diff(original_file_path, index)` — pr-diff arm: sums `+`/`-` hunk line counts for the node's file via `NormalizedDiffIndex::hunks_for`. Connector / absent-file / no original_file_path → 0/0 (never panics). - `pr_dag_lines_from_raw_code(old, new)` — baseline arm: counts Added/Removed lines from the `raw_code` old→new `diff_lines` LCS diff. New node (old=None) → all-added; deleted ghost (new=None) → removed-everything; both None → 0/0. A single trailing `\n` is stripped (dbt-core/fusion parity) so the framing terminator never inflates the count. `compute_pr_dag` (Slice A topology) emits 0/0 — the type is EXPERIMENTAL-gated and not yet rendered, so this is byte-neutral to the goldens. Slice C (#404) wires the population + render once the #261 CLI lane settles `cli/mod.rs`. Domain-pure (std + serde + intra-domain pr_diff import only); no cli/render wiring this slice. Closes #403 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? |
|
Warning Review limit reached
More reviews will be available in 11 minutes and 34 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. ✨ 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 4 individual chapters for you:
Chapters generated by Stage for commit b3e1fee on Jun 14, 2026 4:47am 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 27488641183 -R breezy-bays-labs/cute-dbt -n report-preview-playground
open report-preview-playground/playground-report.htmlPosted by |
…rebase The index_of test helper in pr_dag.rs constructs a PrDiff struct literal that did not set the new `deleted` field added by #396 (cute-dbt#396), breaking the build (E0063) once #405 was rebased onto a main carrying that field. Match the explicit-Vec::new() idiom used by the sibling `renames` field. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Merged via gated cascade — adversarial gate verdict SHIP, all 22 required checks green, behind:0. Closes #403. |
Closes #403
Epic #352, Slice B. Pure-domain per-node line counts for the PR-scope mini-DAG (
PrDag, Slice A / #357). Additive and concurrent-safe: reads the diff index /diff_linesonly, nocli/mod.rsrun-loop wiring, no render. ThePrDagNodetype is EXPERIMENTAL-gated and not yet rendered into any golden, so this is byte-neutral (git status examples/clean).What this adds
lines_added/lines_removed(unsignedusize,#[serde(default)]) onPrDagNode.compute_pr_dag(Slice A topology) emits0/0; Slice C (render: PR-scope mini-DAG at the report top + EXPERIMENTAL gate + click→selector + dogfood (#352 Slice C) #404) folds the arm-specific deltas on and renders the±chip once the Epic: machine-readable findings envelope — versioned schema + exit-code gate, OpenLineage-aware (pre-v0.1.0) #261 CLI lane settlescli/mod.rs.LineDelta { added, removed }— a smallCopyPOD the two counters return.pr_dag_lines_from_diff(original_file_path, index)— pr-diff arm. Sums the+/-hunk line counts across the node's file viaNormalizedDiffIndex::hunks_for. The definition is the raw diff line count (the sameadded_lines/removed_linesbodies the inline diff renders from), matchinggit diff --statfor the path.pr_dag_lines_from_raw_code(old, new)— baseline arm. Counts Added/Removed lines from theraw_codeold→newdiff_lines(LCS) diff.Per-node count definitions
+/-line counts summed over every hunk touching the node'soriginal_file_path.diff_lines(old_raw_code, new_raw_code).0/0. pr-diff arm — its file is absent from the diff, sohunks_forreturns an empty slice; baseline arm — identicalraw_codeis all-Context.0/0(empty hunk slice, never a panic).0/0(a deleted model has no currentoriginal_file_path, so the diff arm cannot key it); baseline arm → removed-everything (every baseline line counted as removed — a deletion is a real, countable change, so the baseline arm surfaces it rather than a silent0/0).old == None).None(noraw_codeeither side — synthetic / non-SQL):0/0.Empty (
Some("")) and absent (None)raw_codeare treated identically (both zero lines). A single trailing\nis stripped so the dbt-core (strips) vs dbt-fusion (retains) terminator divergence never inflates the count; a genuine EOF blank line survives.Tests (TDD)
12 new pr_dag tests with exact-count assertions: pr-diff modified node (multi-hunk sum), per-file isolation (no cross-file leak), connector/absent-file →
0/0, no-original_file_path→0/0, empty index; baseline modified node, unchanged →0/0, new node (all-added), deleted ghost (all-removed), both-absent →0/0, empty≡absent equivalence, trailing-newline parity; plus a field-plumbing test assertingcompute_pr_dagemits0/0on every node.Gates (all run directly in a fresh worktree — true exit codes)
cargo fmt --check0 ·cargo clippy --all-targets --locked -- -D warningstrue exit 0 / 0 warnings ·cargo nextest run2123 passed / 0 failed ·cargo test --test bdd226/226 scenarios ·RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --document-private-items --locked0 ·cargo deny check0 · domain-purity (domain_clean_arch) pass · golden byte-identity +git status examples/clean.🤖 Generated with Claude Code