Skip to content

D-QRY-3 (board half): count and amount per pipeline stage as two grouped programs - #21

Merged
AdaWorldAPI merged 4 commits into
mainfrom
ccr-1d749cc5-q8s5qs
Oct 10, 2026
Merged

AdaWorldAPI merged 4 commits into
mainfrom
ccr-1d749cc5-q8s5qs

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

hubspo-query::board::Board implements HubSpot's pipeline board. For each (pipeline, stage) it gives the record count and the amount sum over the records a view's filter keeps.

  • Two GroupReduce programs over the composite address pipeline × stages + stage (GroupAddr::Pair). No row ids are materialised and no composite key lane is built.
  • Records without an amount are counted but not summed. A stage whose records all lack an amount reads amount: None, never 0; columns() runs both result buffers through normalize_group_sink to make that distinction.
  • weighted(amount, probability_bp) is exact: the product is kept in minor units × basis points (i128). Weighting a stage's total therefore equals summing the per-record weighted amounts to the last unit; rounding is left to the display.

The saved-view half of D-QRY-3 is still open: view definitions as data, and sorting. Quack has no ORDER BY (rows come back in storage order), so a table view sorted by a property needs its own decision.

Evidence

tests/board_oracle.rs checks unfiltered, filtered and narrow boards against a plain per-cell tally. The data is 6,000 deals across 3 pipelines × 7 stages: 4 % are deleted, 25 % have no amount, and one stage has no amounts at all.

Disable runs, each with an asserted patch anchor:

disable tests that went red
sum ignores the amount validity plane 3
empty sum read as 0 2
pipeline / stage swapped 3
zero group universe accepted 1
empty stages reported 1

The last disable stayed green on the first run, because every fixture occupied all 21 stages. I added a narrow-board test, whose own check requires that fewer than half the stages are occupied; with that test in place the disable goes red.

Workspace fmt, clippy (--all-targets --no-deps -D warnings) and tests pass locally. Rebased on main after #20; no other HubSPO-rs PR is open.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PPcakjk7ioQsnasmNDtc5z


Generated by Claude Code

…rograms

Board::count_query / amount_query lower to GroupReduce over the composite
address pipeline × stages + stage; columns() normalises both sinks so a
stage whose records all lack an amount reads None, not 0. weighted() is
exact in minor units × basis points.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPcakjk7ioQsnasmNDtc5z
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPcakjk7ioQsnasmNDtc5z
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPcakjk7ioQsnasmNDtc5z
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPcakjk7ioQsnasmNDtc5z
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@AdaWorldAPI
AdaWorldAPI merged commit 1a0626f into main Oct 10, 2026
1 check passed
AdaWorldAPI pushed a commit that referenced this pull request Oct 10, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPcakjk7ioQsnasmNDtc5z
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.

2 participants