Skip to main content

Stage 3 Kickoff

Prerequisites: Stage 2 sealed (stage2-certified-2026-01-28), Stage 1 gate green

Stage 3 Definition

Stage 3 certifies the deterministic commission engine execution:
  • Decimal-safe math: All commission calculations use Decimal with proper precision handling
  • Allocation + reconciliation invariants: Engine outputs satisfy business rules (no negative commissions, proper agent splits, etc.)
  • Idempotent reruns: Re-running the engine with same inputs produces identical outputs
  • Deterministic execution: Same inputs → same outputs (no non-deterministic behavior)

Inputs

Stage 3 engine consumes:
  • Stage 1 normalized rows: Business/agent/policy data from ingestion pipeline
  • Stage 2 config readiness state: PEPM assignments, business policies, agent assignments

Outputs

Stage 3 engine produces:
  • Canonical allocation tables/views: Engine outputs ready for dashboard consumption
  • Commission snapshots: Per-agent, per-business, per-period commission records
  • Reconciliation reports: Validation that allocations sum correctly

Explicit Exclusions

Stage 3 does NOT include:
  • Onboarding changes: Stage 1/2 ingestion and configuration logic
  • Dashboard/UI work: Frontend rendering, visualization (Stage 4)
  • AI decisions in math: No AI/ML in commission calculation logic
  • Business rule changes: Only implements existing rules deterministically

Entry Criteria

Before starting Stage 3 work:
  1. Stage 2 sealed tag exists: stage2-certified-2026-01-28
  2. Stage 1 gate green: All Stage 1 tests passing (23 passed)
  3. Stage 2 tests green: All Stage 2 tests passing (21 passed)

Stage 3 Test Strategy

  • Unit tests for decimal math operations
  • Integration tests for allocation invariants
  • Idempotency tests for engine reruns
  • Determinism tests (same inputs → same outputs)

Next Steps

  1. Identify Stage 3 test files (likely test_engine_*.py, test_allocation_*.py)
  2. Run baseline test suite to establish current state
  3. Fix decimal precision issues
  4. Add allocation invariant checks
  5. Verify idempotency and determinism