Skip to content

#428 — feat(domain): 1-hop context halo for disconnected modified models in the PR-scope mini-DAG - #434

Merged
cmbays merged 4 commits into
mainfrom
domain-428-dag-1hop-halo
Jun 14, 2026
Merged

cmbays merged 4 commits into
mainfrom
domain-428-dag-1hop-halo

Conversation

@cmbays

@cmbays cmbays commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the 1-hop context halo for disconnected modified models to compute_pr_dag (src/domain/pr_dag.rs). A modified model with no connector path to any other modified model is now disconnected, and its immediate depends_on parents + direct children join the mini-DAG as quiet, is_halo-flagged context nodes — so an isolated change is shown with its neighbors rather than alone (the module doc previously excluded 1-hop, rendering an isolated model alone).

This is epic #427 slice A (the domain graph-computation change). The engine-aware, Models-tab, filter-reactive halo render is slice B (#429), which is blocked-by this.

What changed

Domain (src/domain/pr_dag.rs):

  • New is_halo: bool on PrDagNode, #[serde(default, skip_serializing_if = "std::ops::Not::not")] so halo-free goldens stay byte-identical (the established golden-stability serde pattern).
  • halo_for_disconnected + is_connected_to_another_seed + collect_halo_neighbors: a seed is connected iff some other seed is reachable forward/backward over the model→model lineage; a disconnected seed earns a halo. Dedup: a neighbor that is itself a seed or connector keeps its stronger role.
  • Halo nodes induce edges only to/from their anchor (merge_halo_edges); the generic induced_edges pass excludes halo nodes, so no spurious halo↔halo links between two independent isolated anchors. Graph stays acyclic + BTreeSet-deterministic.
  • Exhaustive enumeration tests (house style, no proptest): connected cluster (no halo), directly-adjacent pair (no halo), single isolated with neighbors (halo), full 1-hop ring, isolated with no neighbors (renders alone), two independent halos, halo-node-is-modified/connector dedup, shared halo between two anchors, no halo↔halo edge bleed, determinism + acyclicity. Four pre-existing tests that encoded the old "renders alone" contract were updated to the new halo behavior (intent preserved).

Render — honest descriptor only (the minimal companion; #429 owns the styling):

  • PrDagPayload.halo_count counts halo nodes in their own dimmed-context tier so the descriptor reads "1 modified · 3 context" instead of a misleading "4 modified".
  • templates/report.html: data-halo attr + "N context models" wording + a dimmed prdag_halo Mermaid classDef.

Role-encoding choice

New is_halo flag, not reused is_connector. A connector lies between two modified models; a halo node is context for a single isolated one — a distinct role. Reusing is_connector would pollute connector_count and conflate the two for #429. The flag is serde-skipped when false, keeping it byte-neutral where no halo exists.

Goldens

  • diff-showcase SHIFTED — playground's fct_provider_metrics is a disconnected modified model, so it gains 3 parent halo nodes (dim_date, fct_encounters, stg_synthea__procedures). This dogfoods the halo in the canonical showcase. Descriptor now reads "1 modified model · 3 context models".
  • prdiff-minidag + seed-showcase SHIFTED cosmetically — the new prdag_halo classDef + descriptor wording + halo_count JSON field; is_halo is omitted for their halo-free nodes.
  • jaffle-shop, playground, macro-heavy, all explore goldens, diff-showcase-findings.json: byte-identical.

All goldens regenerated and byte-verified; headless zero-egress (incl. Cytoscape engine) passes against the regenerated examples.

Gates

cargo fmt --check, clippy --all-targets --locked -D warnings, nextest (2255 pass), cargo doc -D warnings, cargo deny, domain_clean_arch, resource_ref_lint, BDD (226 scenarios), headless zero-egress + mini-DAG toggle — all green. crap4rs (strict ≤15 on pr_dag.rs): compute_pr_dag CRAP 1.0, halo_for_disconnected 5.0, max-in-file 11.

Closes #428

🤖 Generated with Claude Code


Open in Stage

Summary by CodeRabbit

  • New Features
    • Added halo node visualization in PR DAG diagrams—displays 1-hop context nodes around modified models to provide deeper lineage insights.
    • Halo nodes are visually dimmed to distinguish them from directly-modified models, improving PR scope clarity.

…the PR-scope mini-DAG

A modified model with no connector path to any OTHER modified model is
"disconnected" and now pulls its immediate depends_on parents + direct
children into the mini-DAG as quiet, is_halo-flagged context nodes — so
an isolated change is shown with its neighbors rather than alone. A
connected cluster gets no halo; a disconnected model with no neighbors
still renders alone.

Domain (src/domain/pr_dag.rs):
- New is_halo: bool on PrDagNode (#[serde(default, skip_serializing_if =
  "std::ops::Not::not")] → halo-free goldens stay byte-identical).
- halo_for_disconnected + is_connected_to_another_seed +
  collect_halo_neighbors: a seed is connected iff another seed is
  reachable forward/backward over the model graph; disconnected seeds
  earn a halo. Dedup: a neighbor that is itself a seed or connector
  keeps its stronger role.
- Halo nodes induce edges ONLY to/from their anchor (merge_halo_edges);
  induced_edges excludes halo nodes from the generic pass so no spurious
  halo↔halo links. Graph stays acyclic + BTreeSet-deterministic.
- Exhaustive enumeration tests: connected cluster (no halo), single
  isolated with neighbors (halo), isolated with no neighbors (alone),
  two independent halos, halo-node-is-modified/connector dedup, shared
  halo, no halo↔halo bleed, determinism + acyclicity.

Render (honest descriptor only — #429 owns the engine-aware halo render):
- PrDagPayload.halo_count counts halo in its own dimmed-context tier so
  the descriptor reads "1 modified · 3 context" not a misleading "4
  modified".
- report.html: data-halo + "N context models" wording + prdag_halo
  dimmed classDef.

Goldens: diff-showcase shifts (playground's fct_provider_metrics is
disconnected → 3 parent halo nodes); prdiff-minidag + seed-showcase
shift cosmetically (new classDef + descriptor wording, is_halo omitted
for halo-free nodes). All regenerated + byte-verified. crap4rs:
compute_pr_dag CRAP 1.0, halo_for_disconnected 5.0 — strict ≤15 held.

Closes #428

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cmbays cmbays added the type:feature New capability label Jun 14, 2026
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jun 14, 2026 •

Copy link
Copy Markdown

Review Change Stack

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 39 minutes and 41 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: 76176ac1-0125-4bdd-aafc-8ac751d84feb

📥 Commits

Reviewing files that changed from the base of the PR and between 8a0825c and 1538369.

📒 Files selected for processing (6)
  • examples/diff-showcase-report.html
  • examples/prdiff-minidag-report.html
  • examples/seed-showcase-report.html
  • src/adapters/render.rs
  • src/domain/pr_dag.rs
  • templates/report.html
📝 Walkthrough

Note: range_1165168 was listed above in domain_tests layer—it appears to be a rangeId not present in <all_range_ids> so I need to correct. Let me redo without that spurious id.

Walkthrough

Adds a "halo" node role to the PR-scope lineage mini-DAG (src/domain/pr_dag.rs): disconnected modified models now include their 1-hop neighbors as dimmed context. PrDagNode gains is_halo: bool, PrDagPayload gains halo_count, templates/report.html adds prdag_halo Mermaid styling, and both example HTML files are regenerated.

Changes

Halo Nodes for Disconnected Modified Models in PR-scope Mini-DAG

Layer / File(s) Summary
PrDagNode.is_halo field and edge semantics docs
src/domain/pr_dag.rs
PrDagNode gains pub is_halo: bool (serde skip-if-false). Module docs are updated to define halo's node role and anchor-only edge restriction (no halo↔halo induced edges).
Halo graph construction and edge induction
src/domain/pr_dag.rs
compute_pr_dag is extended to derive a halo set for disconnected modified seeds via BFS connectivity check, 1-hop neighbor collection with seed/connector dedup, and deterministic anchor edge merging. assemble_nodes and induced_edges are updated to set is_halo and exclude halo endpoints from the generic edge pass.
Halo domain unit tests
src/domain/pr_dag.rs
Existing downstream-of-one and convergence-sink tests are updated to expect halo (not connector) classification. New halo_ids_of/connector_ids_of helpers and test cases added for connected clusters, isolated halos, neighbor dedup, shared halo, determinism/acyclicity, and no-halo-bleed edge exclusion.
PrDagPayload.halo_count and render tier counting
src/adapters/render.rs
halo_count: usize added to PrDagPayload; from_graph routes is_halo nodes into the new tier. Test fixture helper sets is_halo: false; partition assertion and a new unit test verify halo nodes increment only halo_count.
Template and example HTML halo rendering
templates/report.html, examples/prdiff-minidag-report.html, examples/seed-showcase-report.html
report.html adds the n.is_halo branch in Mermaid node classification and prdag_halo classDef (dashed stroke). Both example HTML files are regenerated with the same JS/CSS changes, updated "context dimmed" descriptor text, and refreshed embedded JSON payloads.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related issues

  • #428 (domain: 1-hop context halo for disconnected modified models in the PR-scope mini-DAG) — This PR directly implements all acceptance criteria from #428: halo nodes for disconnected modified seeds, anchor-only edges, deterministic/acyclic output, and exhaustive enumeration tests for connected/disconnected/dedup scenarios.

Possibly related PRs

  • breezy-bays-labs/cute-dbt#357: Introduces the original compute_pr_dag and PrDagNode taxonomy in src/domain/pr_dag.rs that this PR directly extends with the is_halo field and halo computation logic.
  • breezy-bays-labs/cute-dbt#38: Also modifies src/adapters/render.rs and templates/report.html as part of the Askama renderer pipeline, the same files extended here to carry halo_count and prdag_halo styling.

Poem

🐇 A node sits alone, no neighbor in sight,
So halo-friends gather to dim in the light.
One hop to the left, one hop to the right—
is_halo: true, anchored just right!
The graph stays acyclic, deterministic, and neat,
A dimmed ring of context makes the DAG complete. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: implementing 1-hop context halo for disconnected modified models in the PR-scope mini-DAG, which is the core feature across all modified files.
Linked Issues check ✅ Passed All acceptance criteria from #428 are addressed: disconnected modified models gain 1-hop neighbors as context nodes (is_halo field), connected models remain unchanged, halo nodes induce edges only to anchor, graph maintains acyclicity, and exhaustive enumeration tests cover all required scenarios.
Out of Scope Changes check ✅ Passed All changes are in-scope: domain logic for halo computation in pr_dag.rs, render adapter updates for halo_count field, HTML template adjustments for halo visualization, and golden file updates reflect the new feature behavior.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch domain-428-dag-1hop-halo

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 14, 2026 •

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 6 individual chapters for you:

Title
1 Define halo role in domain types
2 Implement halo computation logic
3 Verify domain logic with exhaustive tests
4 Expose halo counts to render layer
5 Update report templates and styling
6 Regenerate example goldens
Open in Stage

Chapters generated by Stage for commit 1538369 on Jun 14, 2026 5:02pm UTC.

@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 introduces a 1-hop context halo feature for disconnected modified models in the PR DAG, allowing isolated changes to be rendered with their immediate neighbors. It updates the payload structures, DAG computation logic, HTML reporting templates, and adds comprehensive unit tests. The review feedback suggests simplifying the induced_edges function by removing the redundant halo parameter and directly filtering nodes using the is_halo flag, as well as adopting BTreeSet<String> for more idiomatic string deduplication in Rust.

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 src/domain/pr_dag.rs Outdated
Comment thread src/domain/pr_dag.rs Outdated
@github-actions

github-actions Bot commented Jun 14, 2026 •

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
seed-showcase-report.html ▶ Open ↗ ⬇ Download
diff-showcase-report.html ▶ Open ↗ ⬇ Download
prdiff-minidag-report.html ▶ Open ↗ ⬇ Download
macro-heavy-report.html ▶ Open ↗ ⬇ Download
playground-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-434/.
⬇ 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 27505903992 -R breezy-bays-labs/cute-dbt -n report-preview-playground
open report-preview-playground/playground-report.html

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

cmbays and others added 2 commits June 14, 2026 12:59
# Conflicts:
#	examples/diff-showcase-report.html
#	examples/prdiff-minidag-report.html
#	examples/seed-showcase-report.html
… (derive from is_halo)

The halo parameter passed to induced_edges was redundant: every PrDagNode
already carries is_halo, and the node set is fully assembled (all is_halo
set) before induced_edges runs. Derive the non-halo in-set directly from
the node flags instead of threading a separate halo set.

Keeps the in-set keys borrowed &str (BTreeSet<&str> from n.id.as_str()) —
no per-id String allocation, per the no-alloc house style. Emitted edge set
is unchanged; induced_edges_are_exactly_the_model_edges_among_the_node_set
and all pr_dag tests pass unchanged.

Folds the accepted gemini review simplification on PR #434.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cmbays
cmbays merged commit ad6e103 into main Jun 14, 2026
44 checks passed
@cmbays
cmbays deleted the domain-428-dag-1hop-halo branch June 14, 2026 17:07
github-actions Bot added a commit that referenced this pull request Jun 14, 2026
@cmbays

cmbays commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Merge debrief (#434 → #428) — squash ad6e103, #428 closed.

Shipped: 1-hop context halo for disconnected modified models in the PR-scope mini-DAG. A changed model with no connector path to any other changed model now pulls its immediate parents+children as quiet is_halo-flagged context (connected clusters get no halo; isolated-with-no-neighbors still renders alone). New is_halo role (distinct from is_connector), edges only to the anchor, serde byte-neutral where absent.

Justified scope deviation: the brief said domain-only, but a domain change shifts the diff-showcase golden — committing it as-is would bake a false '4 modified' descriptor (3 are halo). The builder added the minimal-honest render companion (halo_count + dimmed prdag_halo class + 'N context models' descriptor) so the golden stays truthful. NOT the #429 work (engine-aware/Models-tab/filter-reactive) — just truthfulness. Sound call.

Bot disposition: 2 gemini medium on induced_edges — #1 (drop redundant halo param, derive from is_halo) accepted (single source of truth, edge set test-pinned); #2 (BTreeSet<String> vs &str) declined (reverses a deliberate no-alloc; kept &str).

Merge mechanics: render.rs + report.html auto-merged with #423 (disjoint regions — chips + halo coexist, verified); 3 report goldens regenerated; a 2nd clean update pulled in #432. All gates green (2026 lib + headless 114 + zero-egress 12 over regenerated goldens + crap4rs strict ≤15 on pr_dag.rs).

Follow-up: #429/#430 (Models-tab DAG relocation + engine-aware + filter-reactive) build on this halo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

domain: 1-hop context halo for disconnected modified models in the PR-scope mini-DAG

1 participant