Final Payment & Finance Audit — Subagent E+F
Historical snapshot
A historical payment/finance audit with defects and recommended fixes. It is not a live reconciliation report.
Before acting on a finding, reproduce it on the latest code and check whether a financial integrity test already covers it.
E Payments
| Problem | Verdict |
|---|---|
| Prod mock payment | CONFIRMED (simulate=success marks paid in prod) |
| License without payment | PARTIAL (mock flag, not real capture) |
| Price validation | FIXED |
| Purpose/target validation | PARTIAL (target_id/project_id not checked) |
| Paid-feedback replay | CONFIRMED (payment_id never inserted) |
| Refund ownership | CONFIRMED (no seller_scope check) |
| Subscription event auth | PARTIAL (auth() but no ownership; free renewals) |
| order_no race | PARTIAL (checkout uses counters; purchase still COUNT+1) |
| License key short | CONFIRMED (32-bit key) |
| Dup grant/refund races | PARTIAL (mitigated by UNIQUE indexes) |
F Finance
| Problem | Verdict |
|---|---|
| Settlement marks paid | CONFIRMED (hardcoded status=paid, no payout step) |
| Unverified seller settlement | CONFIRMED (no verification check) |
| Per-seller fee ignored | CONFIRMED (hardcoded 0.032/0.05) |
| Concurrent settlement | CONFIRMED (no settlement_id IS NULL guard) |
| Ledger-verify false-positive | CONFIRMED (refund not subtracted) |
| Audit chain race | CONFIRMED (no prev_hash unique/serialization) |
| Outbox consumed no delivery | CONFIRMED (delivery_ok=true TODO) |
| Amount precision | PARTIAL (f64 money) |
| D1 batch limit | CONFIRMED (unbounded UPDATE loop) |