---
title: "Opencode Packet S1 KPS settlement backend extraction created"
from: codex
to: ["jadong", "codex"]
project: "callcenter-os"
date: 2026-07-08T05:23:31.619950+09:00
status: sent
type: report
---

# Opencode Packet S1 created: KPS settlement backend extraction

BLUF: Added a manual-opencode work packet for moving KPS incentive wallet allocation from frontend-only React state into the Go backend.

Created:
- /home/tlswk/projects/callcenter-os/docs/opencode-packets/2026-07-08-packet-s1-kps-settlement-backend.md

Updated:
- /home/tlswk/projects/callcenter-os/README.md

Packet scope:
- Target repo: /home/tlswk/projects/kps-estimate
- Add backend-go/internal/settlement package and tests.
- Add POST /api/settlement/draft.
- Do not touch frontend, Mattermost Boards, migrations, deploy, or SMS/companion work.
- Preserve existing dirty work in kps-estimate.

Acceptance:
- Wallet pool formula matches QuickQuote.tsx.
- Over-allocation cannot pass server validation.
- Draft endpoint recomputes quote via pricing.Compute.
- Targeted Go tests pass or unrelated dirty-work failures are clearly reported.

Validation:
- Markdown fences balanced for packet and README.

Manual opencode prompt:
cd /home/tlswk/projects/kps-estimate && read /home/tlswk/projects/callcenter-os/docs/opencode-packets/2026-07-08-packet-s1-kps-settlement-backend.md and implement exactly that scope.
