Skip to content

Add deal-concentration risk metric and --max-concentration CI gate#6

Open
cognis-digital wants to merge 1 commit into
mainfrom
feat/concentration-risk
Open

Add deal-concentration risk metric and --max-concentration CI gate#6
cognis-digital wants to merge 1 commit into
mainfrom
feat/concentration-risk

Conversation

@cognis-digital

@cognis-digital cognis-digital commented Jul 1, 2026

Copy link
Copy Markdown
Owner

What

A weighted forecast can look healthy while resting almost entirely on a single large, still-open deal. If that one deal slips, the number collapses. This PR surfaces that fragility.

  • New concentration field on Report — the share of the weighted forecast carried by the single largest open deal's expected value (0.0 when there is no forecast). Included in to_dict() / --format json and shown in the table output.
  • New --max-concentration CI gate — exits non-zero when concentration exceeds the given fraction, so a fragile, whale-dependent pipeline fails the build the same way --min-forecast and --min-win-rate guard the dollar and quality numbers.

Why

RevOps and finance already gate on the total forecast and win rate, but a $1M forecast that is 80% one deal is a very different risk than the same $1M spread across ten. This makes that risk a first-class, gate-able signal.

Compatibility

concentration is appended to Report with a default value, so existing positional/keyword construction of Report is unchanged. No existing public signature changes.

Tests / demos

  • tests/test_concentration.py — 11 tests (metric math, unit-interval bound, backward-compat default, table/JSON surfacing, and the gate passing/failing).
  • demos/18_concentration_risk.py — narrated scenario over the enterprise-ACV sample; wired into run_all.py and docs/DEMOS.md.
  • Full suite green: python -m pytest -q -> 312 passed.

A weighted forecast can look healthy while resting almost entirely on one
large, still-open deal; if it slips the number collapses. This adds a
'concentration' field to the Report — the share of the weighted forecast
carried by the single largest open deal (0.0 when there is no forecast) — shown
in the table and JSON output.

The new --max-concentration CLI gate exits non-zero when concentration exceeds
a threshold, letting CI flag a fragile, whale-dependent pipeline the same way
--min-forecast / --min-win-rate guard the dollar and quality numbers.

Backward compatible: concentration is appended to Report with a default, so
existing construction is unaffected. Adds demo 18 and 11 tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant