Compute hotspots per-source coverage gap in SDK#370
Conversation
The Rust hotspots presenter walked the ledger a second time after the SDK verb already walked it, just to recover the per-source breakdown that drives the coverage-notice clause. For multi-month ledgers that doubled the I/O cost of `burn hotspots`. Widen `HotspotsFidelityBlock` with a non-serialized `excluded_by_source` field that the SDK populates during the same eligible/excluded split. The CLI becomes a pure renderer over already-computed data, dropping its `describe_excluded_turns` re-walk. Closes #342 https://claude.ai/code/session_01M2cRDSDfUwi4MPSxRq3WaA
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR eliminates a redundant ledger walk in the hotspots CLI command by moving per-source coverage-gap breakdown computation from the CLI into the SDK. The SDK now embeds this breakdown in ChangesHotspots Per-Source Coverage Breakdown
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Poem
🚥 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)
Comment |
Summary
HotspotsFidelityBlock(inrelayburn-sdk) with a non-serializedexcluded_by_sourcefield that records the per-source coverage gap during the same eligible/excluded split that produces the rest of the attribution result.crates/relayburn-cli/src/commands/hotspots.rs(describe_excluded_turnsand the localCoverageGapBreakdown/SourceClausetypes). The CLI is now a pure renderer over the SDK's breakdown, matching the layering rule from Hoist CLI-side summary/hotspots aggregation into a richer relayburn-sdk verb #316.#[serde(skip)], so the attribution result still serializes exactly as before, and the golden tests undercrates/relayburn-cli/tests/golden.rsremain byte-identical against the TS CLI.For a many-month ledger this halves the I/O
burn hotspotsdoes on the Rust path.Closes #342
Test plan
cargo build -p relayburn-sdk -p relayburn-clicargo test -p relayburn-sdk -p relayburn-clicargo test -p relayburn-cli --test golden(TS-conformance goldens)burn hotspotson a real ledger with mixed sources (excluded codex + opencode turns) to confirm the inline coverage clause still names each sourcehttps://claude.ai/code/session_01M2cRDSDfUwi4MPSxRq3WaA
Generated by Claude Code