Repository navigation
Commit 5045a2b
feat(revops): revenue model as a config value — one KPI engine, N profiles (RO-7 #182271)
The RevOps KPI layer was built against one revenue model: a B2B SaaS funnel.
The customer it was built toward — GTC MediGuide (bloq anomalyco#601) — is TELEHEALTH,
where revenue operations means the revenue CYCLE: eligibility, prior auth,
coding, claim submission, adjudication, denials, A/R. Not a missing metric, a
missing half (RO-6 #182260).
Only the client can say which model applies. Waiting blocks the build; guessing
wastes weeks in whichever direction is wrong. So the model stops being a
prerequisite and becomes a parameter.
Both models share one spine — work item -> staged pipeline -> terminal outcome
-> reason taxonomy -> recovery motion -> cycle time -> cost ratio. opportunity
/claim, won/paid, lost/denied, loss-reason/CARC, re-engagement/appeal,
sales-cycle/days-in-A-R, CAC/cost-to-collect. That mapping came from laying the
HFMA MAP Keys beside our own gap map, not from analogy-hunting.
Ships:
- revenue-models.ts — typed profile registry: subscription, payer_billed,
cash_pay. Serialisable by design so it can move to a served registry when
agents need it.
- `iris bloq models [bloqId]` — profiles are discoverable, and it says which
one a given bloq is running.
- `iris bloq kpis list` filters to the active profile, ALWAYS prints which
profile answered, and distinguishes "declared on this bloq" from "DEFAULT —
not declared". A default is not a decision, and reporting one as a choice is
the same defect as a gate that says "gated" without saying gated to whom.
- `--model <key>` previews another profile without mutating the bloq; an
unknown key is REFUSED, never silently defaulted, so a typo cannot read as
a deliberate choice.
- `--applies-to` on `bloq kpis add`; `--all` to see every profile's KPIs.
Two safety properties, both tested:
- An untagged KPI applies EVERYWHERE. All 19 KPIs on anomalyco#624 are untagged today;
if absence meant hidden, enabling this would empty the board — and a metric
that vanishes reads as "we don't track that", which is indistinguishable
from "we track it and it's fine".
- Filtering reports what it set aside rather than quietly shrinking the list.
Default is `subscription`, so no existing board changes meaning.
Phase 2 (837/835 ingestion, clearinghouse, CARC parsing) stays correctly
blocked. Verified live against bloq anomalyco#624.
20 new tests; 613 pass across the CLI suite.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HzGwGaksRciQ6AWi4y7WW31 parent 1c40f13 commit 5045a2b
4 files changed
Lines changed: 512 additions & 10 deletions
File tree
- packages/opencode
- src/cli/cmd
0 commit comments