Attribution Delta Root Cause Analysis
September 2025: Why Repo B Pays $1,925.71 More to Agents Than Repo A
Date: 2025-01-XXStatus: Root Cause Identified
Impact: $1,925.71 agent commission delta for September 2025
Executive Summary
Root Cause: Repo A is using incorrect PEPM rates for commission calculation, resulting in underpayment to agents. Repo B correctly uses the authoritative PEPM rates fromagent2_pepm.csv.
Evidence:
- Canyon Plumbing LLC: Repo A pays 2,408.00 total
- Agent2_PEPM authoritative rates: KEN YOUNG = 4
- Repo B calculation: (1,720 (KEN) + (688 (KENNY) = $2,408 ✅
- Repo A calculation: 158.24 (KENNY) = 2.30 and 10 and $4)
Detailed Analysis
1. Business-Level Attribution Deltas (Top 5)
| Business Name | Repo A Agent | Repo B Agent | Delta | Root Cause |
|---|---|---|---|---|
| CANYON PLUMBING LLC | $553.84 | $2,408.00 | $1,854.16 | PEPM Rate Mismatch |
| HAWAIIAN HUT INC | $162.00 | $198.00 | $36.00 | Additional agent (GREG DEAN) in Repo B |
| HAWAIIAN HUT II INC | $90.00 | $110.00 | $20.00 | Additional agent (GREG DEAN) in Repo B |
| C&J LIQUORS LLC DBA SPIRITS WORLD | $45.00 | $55.00 | $10.00 | Additional agent (GREG DEAN) in Repo B |
| NUG | $3,102.45 | $3,108.00 | $5.55 | Rounding/timing differences (within tolerance) |
2. Deep Dive: Canyon Plumbing LLC
Agent2_PEPM Authoritative Rates
Repo A Stage3 Breakdown
Repo B Stage3 Breakdown
Root Cause: PEPM Rate Mismatch
Repo A Issue:pepm_rate_cleanis NULL instage3_snapshotsfor Canyon Plumbing- Stored
agent_totalvalues (158.24) imply PEPM rates of 0.92 - These rates are incorrect (should be 4 per agent2_pepm)
- Uses PEPM rates from
agent2_pepm.csvdirectly - Calculates
normalized_pepm = (pepm_rate × 12) / pay_periods - Calculates
agent_total = normalized_pepm × row_count - Matches authoritative agent2_pepm rates ✅
3. Row-Count Basis Check
Both Repo A and Repo B use row_count for commission calculation:- Repo A:
agent_total = tpa_per_pay_amount × absorbed_count(whereabsorbed_count= surviving credit rows) - Repo B:
agent_total = normalized_pepm × row_count(whererow_count= transaction rows)
- Repo A: Reports 344 employees total (172 per agent)
- Repo B: Reports 104 employees (distinct member_ids), 344 rows
- Employee count is for reporting only; commission uses row_count ✅
4. Agent Eligibility Rules
Both repos attribute to the same agents:- KEN YOUNG ✅
- KENNY YOUNG ✅
- HAWAIIAN HUT businesses: Repo B includes GREG DEAN (not in Repo A)
- This accounts for 36 + 10)
5. Reconciliation Against Dashboard Truth
Repo A Dashboard Values (frompayroll_analytics.ceo_metrics):
- Agent Payout Net: $10,534.29
- Owner Net: $18,065.41
- Agent Payout Net: $12,460.00
- Owner Net: $16,139.70
- Repo B uses authoritative PEPM rates from
agent2_pepm.csv - Repo A uses incorrect/stale PEPM rates (NULL or wrong values in stage3_snapshots)
- Repo B is correct; Repo A is underpaying agents
Root Cause Explanation
Why Does Repo B Pay $1,925.71 More to Agents?
Answer: Repo B correctly uses the authoritative PEPM rates fromagent2_pepm.csv, while Repo A uses incorrect/stale PEPM rates stored in stage3_snapshots.
Specific Example (Canyon Plumbing):
-
Authoritative PEPM rates (agent2_pepm.csv):
- KEN YOUNG: $10.00
- KENNY YOUNG: $4.00
-
Repo B calculation (correct):
- KEN YOUNG: (1,720.00**
- KENNY YOUNG: (688.00**
- Total: $2,408.00
-
Repo A calculation (incorrect):
- KEN YOUNG: **2.30)
- KENNY YOUNG: **0.92)
- Total: $553.84
- Delta: 553.84 = **1,925.71 delta)
pepm_rate_cleanis NULL instage3_snapshotsfor Canyon Plumbing- Stored
agent_totalvalues suggest PEPM rates of 0.92 (incorrect) - Possible causes:
- Stale data (stage3_snapshots loaded before PEPM rates were updated)
- PEPM rate lookup failure during Repo A processing
- Manual override or data corruption in stage3_snapshots
Decision Recommendation
Option A: Adjust Repo B Logic to Match Repo A ❌ NOT RECOMMENDED
Why Not:- Repo A is using incorrect PEPM rates
- Matching Repo A would underpay agents by $1,925.71
- Violates audit-grade requirement to use authoritative PEPM rates
- Would require Repo B to ignore
agent2_pepm.csvand use stale/wrong rates
Option B: Declare Repo A Underpaying Agents ✅ RECOMMENDED
Why:- Repo B uses authoritative PEPM rates from
agent2_pepm.csv - Repo A uses incorrect/stale PEPM rates (NULL or wrong values)
- Repo B calculation matches agent2_pepm rates exactly
- Repo A calculation implies PEPM rates that don’t match agent2_pepm
- Canyon Plumbing: Repo A uses ~0.92 PEPM; agent2_pepm says 4
- Repo B calculation: (1,720 ✅ matches agent2_pepm
- Repo A calculation: 2.30 per row ❌ doesn’t match agent2_pepm
- Fix Repo A to use authoritative PEPM rates from
agent2_pepm.csv - Regenerate Repo A stage3_snapshots for September 2025 with correct PEPM rates
- Re-run Repo A payroll for September to correct agent payouts
- Keep Repo B unchanged (it’s already correct)
Regression Guardrail
Target: September 2025 Parity
Current Status: FAIL- Agent Delta: $1,925.71 (Repo B > Repo A)
- Owner Delta: -$1,925.71 (Repo B < Repo A)
- Invariant: ✅
gross = agent + owner + chargebacks(preserved)
- Agent Delta: ≤ $0.01 ✅
- Owner Delta: ≤ $0.01 ✅
- Invariant: ✅
gross = agent + owner + chargebacks
Files Modified
None - This analysis identifies that Repo B is correct and Repo A needs fixing.Next Steps
- Fix Repo A to use authoritative PEPM rates from
agent2_pepm.csv - Regenerate Repo A stage3_snapshots for September 2025
- Re-run parity validation to confirm delta ≤ $0.01
- Document the fix in Repo A codebase
- Add regression test to prevent PEPM rate mismatches in the future
Conclusion
Repo B is paying $1,925.71 more to agents because Repo A is using incorrect PEPM rates. Repo B correctly uses the authoritative rates fromagent2_pepm.csv, while Repo A uses stale/wrong rates stored in stage3_snapshots.
The fix must be in Repo A, not Repo B. Repo B should remain unchanged as it correctly implements the audit-grade commission calculation using authoritative PEPM rates.