Architecture Note · Operations & RevOps

Deterministic Sales Compensation & ASC 606 Commission Engine

Why prompt-driven commission spreadsheets break payroll trust and revenue recognition—and the deterministic architecture that locks every payout behind reproducible math, SQLite audit traces, and dual sign-off.

The Problem: Multi-Region Comp Cycles Running on Fragile Spreadsheets

Quarter-end commission runs sit directly on the fault line between Revenue Operations and Corporate Finance. A single payout cycle spans Account Executives, SDRs, and Solutions Engineers across US, UK, EU, Canada, and APAC payroll currencies, each carrying distinct quota bands, co-sell split rules, multi-year spiffs, and 90- or 180-day churn clawbacks. When those calculations live in chained spreadsheet tabs, one broken lookup or stale FX rate cascades into rep disputes, delayed payroll batches, and restated ASC 606 / IFRS 15 deferred commission schedules.

Why Naive AI Wrappers Fail in Commission & Close Workflows

Dropping an LLM chat wrapper over CRM exports creates four operational failure modes that Finance controllers cannot sign off on:

  • Nondeterministic payout math: Language models approximate marginal tax-style brackets poorly. A subtle rounding error between a 100%–125% cliff tier and a >125% super-accelerator—or misapplying a net payout floor after an early-churn clawback—produces numbers that shift between runs.
  • Silent policy drift without trace snapshots: When a plan rule changes mid-quarter, ad-hoc scripts overwrite prior calculations without preserving which plan_rule_snapshot and FX rate produced a rep’s statement.
  • Uncontrolled compensation egress: Uploading raw rep quotas, closed-won deal tables, and payroll figures to public third-party model endpoints exposes sensitive compensation data outside the firm’s perimeter.
  • Missing segregation of duties: Automated pipelines that export payroll CSVs directly from a calculation step bypass the boundary between RevOps quota verification and Finance general-ledger sign-off.

The Deterministic Architecture That Fixes It

Our shipped architecture separates deterministic financial computation from optional natural-language explanation, backed by SQLite in WAL mode and strict token-scoped authorization:

  1. Deterministic marginal tier, split, FX, and clawback engine: POST /api/comp/calculate and POST /api/comp/upload-batch execute pure Python math in comp_engine.py. Deals convert to USD using explicit per-batch FX maps across USD, GBP, EUR, CAD, AUD, SGD, and zero-decimal JPY, credit AE/SDR/SE splits, allocate marginal volume across base (0%–100%), cliff (100%–125%), and super-accelerator (>125%) bands, apply 24- or 36-month term spiffs, and compute full or pro-rata early-churn clawbacks bounded by net_payout_floor_usd with unrecovered carryforwards persisted in calc_trace_json.
  2. Side-by-side dispute traces with offline-first explanations: POST /api/comp/disputes stores the exact payout variance alongside immutable JSON snapshots of the deal lineage and plan rules, then resolves adjustments via POST /api/comp/disputes/{dispute_id}/resolve. An LLMAdapter defaults to deterministic offline mode (emitting structured math narratives with zero external calls) or routes to a customer-hosted OpenAI-compatible endpoint.
  3. ASC 606 / IFRS 15 schedule separation: GET /api/asc606/amortization partitions capitalizable incremental acquisition commissions from immediately expensed draws and non-incremental bonuses, deducts early-churn clawbacks and impairment write-offs under ASC 606-10-35, and generates monthly deferred-asset rollforwards across 14 edge-case pytest checks covering accelerators, zero-quota fallbacks, and clawbacks.
  4. Scoped token auth, upload wiping, and append-only audit triggers: Every route enforces SHA-256 hashed invite tokens with SQLite sliding-window rate limiting. Staged CSV uploads are overwritten with zeros, fsynced, and unlinked immediately in a finally block (backed by a 60-second sweep enforcing a 1-hour TTL), while SQLite BEFORE UPDATE and BEFORE DELETE triggers enforce an append-only audit_logs table.
  5. Mandatory dual human sign-off gate: POST /api/payouts/{period}/approve requires confirm_human_review=true from both a payouts:finance token and a distinct payouts:sales_ops token (returning HTTP 409 if the same actor or token attempts both approvals) before GET /api/payouts/{period}/export.csv releases the RFC-4180 payroll file.

Operational Takeaway

Commission automation earns Finance and sales-floor trust when every dollar traces back to deterministic tier math, raw uploads vanish after parsing, ASC 606 adjustments stay linked to clawback events, and no payroll CSV leaves the system without verified dual human approval.

Test a deterministic commission engine on your own comp plans

Start with a free 30-minute workflow check. Bring one comp plan, split policy, or ASC 606 schedule and leave with one concrete architecture recommendation in writing within one business day.