Skip to content

Instantly share code, notes, and snippets.

@esz135888
Last active May 24, 2026 01:06
Show Gist options
  • Select an option

  • Save esz135888/58c3c8f8a16faea9ca64567ccd0f4d80 to your computer and use it in GitHub Desktop.

Select an option

Save esz135888/58c3c8f8a16faea9ca64567ccd0f4d80 to your computer and use it in GitHub Desktop.
PLS job 6d5be6ac Kolable order payment reconciliation production pack

Acceptance Tests

Human Acceptance

  1. Wade 能在 D1 前提供 5/12-5/21 訂單付款 CSV。
  2. Louis 能在 D7 前判斷實收、未收、退款風險與是否繼續 pilot。
  3. zihrou 能檢查是否有高風險退款/信任問題需要先處理。
  4. 兩位已購買學員的課綱升級溝通狀態有 evidence。

System Acceptance

  1. 匯入 CSV 後,每筆 kolable_orders 都有唯一 order_id
  2. 每筆 order 都必須有一筆 payment event;缺失時標 missing_payment
  3. amountmatched_amount 不一致時標 amount_mismatch,不得列為 recognized revenue。
  4. curriculum_upgrade risk 未 resolved 時,該訂單列為 refund risk。
  5. 每次 status change 都寫入 audit log。

E2E Pass Criteria

  • 100% 訂單有付款狀態。
  • 100% 金額差異可解釋或標為 manual review。
  • 2/2 已購買且受課綱升級影響的學員有溝通狀態。
  • D7 產出 continue / adjust / pause 三選一 pilot decision。

Data Model / API / Sync

Tables

kolable_order_exports

  • id uuid primary key
  • export_range_start date
  • export_range_end date
  • uploaded_by uuid
  • raw_file_ref text
  • row_count int
  • uploaded_at timestamptz

kolable_orders

  • id uuid primary key
  • export_id uuid
  • order_id text
  • buyer_name text
  • buyer_contact_hash text
  • product_name text
  • order_at timestamptz
  • amount numeric
  • currency text
  • order_source text

kolable_payment_events

  • id uuid primary key
  • order_id text
  • payment_status enum: paid, unpaid, partial, failed, refunded, disputed
  • payment_method text
  • paid_at timestamptz nullable
  • gateway_transaction_id text nullable
  • matched_amount numeric
  • reconciliation_state enum: matched, amount_mismatch, missing_payment, manual_review

kolable_refund_risks

  • id uuid primary key
  • order_id text
  • risk_type enum: curriculum_upgrade, payment_dispute, duplicate_order, manual_transfer_unknown
  • risk_level enum: low, medium, high
  • owner_id uuid
  • resolution_note text
  • resolved_at timestamptz nullable

curriculum_upgrade_contacts

  • id uuid primary key
  • order_id text
  • buyer_contact_hash text
  • contact_owner uuid
  • upgrade_message_sent_at timestamptz nullable
  • buyer_response_state enum: accepted, refund_requested, no_response, needs_followup
  • evidence_ref text

APIs

  • POST /api/pls/kolable/order-exports
  • POST /api/pls/kolable/payments/reconcile
  • GET /api/pls/kolable/revenue-scorecard?from=2026-05-12&to=2026-05-21
  • PATCH /api/pls/kolable/orders/:order_id/refund-risk
  • POST /api/pls/kolable/curriculum-upgrade-contacts

Permissions

  • Wade:upload/export raw orders and payment status。
  • Louis:reconcile, classify revenue, decide pilot status。
  • zihrou:approve risk gate and escalation。
  • PLS worker:can generate reconciliation draft, but cannot mark revenue as recognized without Louis approval。

Audit / Rollback

所有 payment_status、refund_risk、revenue_recognition state change 都寫 actor、old_state、new_state、source_file_ref、reason。若匯入 CSV 欄位錯誤,只能建立 corrected export version,不覆蓋 raw export。

Decision Record

Decision

將「Wade 匯出 5/12-5/21 訂單與付款狀態」升級成 spreadsheet + dashboard + project 型 production pack。

Options Considered

  • communication only:可以催 Wade 匯出,但不能解決營收對帳、退款風險與 pilot 決策。
  • spreadsheet only:可核對資料,但缺 owner/due/權限/稽核與 D30 平台化路徑。
  • dashboard + project:最佳,能把 raw export、付款狀態、退款風險、課綱升級溝通與 pilot decision 接成操作台。
  • full system:暫不採用,因 D1 仍缺 Wade raw export 與實際欄位,需要先驗證資料形狀。

Recommendation

D1 先用 HTML 作戰台與 CSV/data model;D7 用真實資料生成 revenue scorecard;D14 建直播銷講 funnel;D30 接 webhook/API。

Adoption Status

Ready for Wade/Louis/zihrou review. Self-service systemization waits for first raw export.

If Not Adopted

請明確回覆 blocker 是:Wade 權限不足、匯出欄位不存在、付款來源不清、課綱升級風險未處理,或 Louis 不採用此營收判斷方式。

E2E Verification

Checks

  1. Context confirmed AI-native project 4715ad23-b78b-467b-93b6-c0927e259096 and deliverable bucket 297f6002-da2a-41b4-b79b-30e5d0fd2f15.
  2. Primary artifact is HTML, not Markdown.
  3. Required files exist: production-brief.md, data-model.md, acceptance-tests.md, decision-record.md, artifact-url-or-pr.md.
  4. Market context has at least 2 external URLs.
  5. PLS upload-files and public Gist publication must both succeed.
  6. Public URL must return HTTP 200 and list kolable-order-payment-reconciliation-console.html.

Current Result

Pass. Public Gist returned HTTP 200 on 2026-05-24 and gh gist view --files listed kolable-order-payment-reconciliation-console.html plus all appendices.

Primary URL: https://gist.github.com/esz135888/58c3c8f8a16faea9ca64567ccd0f4d80#file-kolable-order-payment-reconciliation-console-html

<!doctype html>
<html lang="zh-Hant">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Kolable 訂單付款核對作戰台</title>
<style>
:root{--ink:#171f27;--muted:#607080;--line:#dce3ea;--bg:#f5f7f9;--panel:#fff;--blue:#285d8f;--green:#1f775a;--amber:#b67817;--red:#ad3f35;--soft:#edf4f8}
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;line-height:1.45}
header{padding:30px 36px 22px;background:#fff;border-bottom:1px solid var(--line)} h1,h2,h3{margin:0;letter-spacing:0} h1{font-size:28px;max-width:1120px} h2{font-size:17px;margin-bottom:12px} h3{font-size:14px;margin-bottom:8px}
p{margin:0;color:var(--muted)} .eyebrow{font-size:12px;font-weight:800;text-transform:uppercase;color:var(--blue);margin-bottom:8px}
.wrap{padding:24px 36px 42px}.grid{display:grid;grid-template-columns:repeat(12,1fr);gap:16px;max-width:1280px;margin:0 auto}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:18px;box-shadow:0 1px 2px rgba(0,0,0,.03)}
.span-12{grid-column:span 12}.span-8{grid-column:span 8}.span-6{grid-column:span 6}.span-4{grid-column:span 4}.span-3{grid-column:span 3}
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.kpi{border:1px solid var(--line);border-radius:8px;padding:14px;min-height:92px;background:#fbfcfd}.kpi strong{display:block;font-size:28px}.kpi span{font-size:13px;color:var(--muted)}
table{width:100%;border-collapse:collapse;font-size:13px} th,td{text-align:left;padding:10px 8px;border-bottom:1px solid var(--line);vertical-align:top} th{font-size:12px;text-transform:uppercase;color:var(--muted);background:#fbfcfd}
.status{display:inline-flex;border-radius:999px;padding:4px 9px;font-size:12px;font-weight:800;white-space:nowrap}.green{background:#e1f0e8;color:var(--green)}.blue{background:#e4eef8;color:var(--blue)}.amber{background:#f7ecd9;color:#81530f}.red{background:#f9e6e3;color:var(--red)}
.timeline{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.stage{border-left:4px solid var(--blue);background:#fbfcfd;padding:12px;border-radius:0 8px 8px 0;min-height:152px}.stage:nth-child(2){border-color:var(--amber)}.stage:nth-child(3){border-color:var(--green)}.stage:nth-child(4){border-color:var(--red)}
.flow{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.step{border:1px solid var(--line);border-radius:8px;padding:12px;background:#fbfcfd;min-height:116px}.step b{display:block;margin-bottom:6px}.small{font-size:12px;color:var(--muted)}
ul{margin:8px 0 0 18px;padding:0;color:var(--muted)} li{margin:4px 0}.script{background:var(--soft);border-radius:8px;padding:12px;color:var(--ink);font-size:13px;white-space:pre-wrap}
.code{background:#16212b;color:#eaf1f7;border-radius:8px;padding:12px;font:12px ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;overflow:auto}
@media(max-width:900px){header,.wrap{padding-left:18px;padding-right:18px}.span-8,.span-6,.span-4,.span-3{grid-column:span 12}.kpis,.timeline,.flow{grid-template-columns:1fr}}
</style>
</head>
<body>
<header>
<div class="eyebrow">PLS production artifact · Kolable order/payment reconciliation · 2026-05-24</div>
<h1>Kolable 5/12-5/21 訂單付款核對作戰台</h1>
<p>把「Wade 匯出 5/12-5/21 訂單與付款狀態」從追人事項升級成可交付的營收核對、退款/課綱升級溝通、pilot 決策與平台資料模型。</p>
</header>
<main class="wrap">
<section class="grid">
<div class="panel span-12"><div class="kpis">
<div class="kpi"><strong>10 天</strong><span>5/12-5/21 訂單/付款核對窗口</span></div>
<div class="kpi"><strong>2</strong><span>已知已購買且受課綱升級影響的學員</span></div>
<div class="kpi"><strong>D1</strong><span>Wade 匯出 CSV 與付款狀態</span></div>
<div class="kpi"><strong>D7</strong><span>完成應收、已收、未收、退款風險表</span></div>
</div></div>
<div class="panel span-8">
<h2>核對 Queue</h2>
<table>
<thead><tr><th>Gate</th><th>Owner</th><th>必填欄位</th><th>Pass</th><th>Fail / Escalation</th></tr></thead>
<tbody>
<tr><td><span class="status red">export_pending</span></td><td>Wade</td><td>order_id, buyer, product, order_at, amount, payment_status, paid_at, refund_status</td><td>D1 前匯出 CSV</td><td>未回覆:Louis 直接升級追問</td></tr>
<tr><td><span class="status amber">payment_reconcile</span></td><td>Louis</td><td>平台訂單金額 vs 金流入帳金額 vs 手動轉帳</td><td>差異小於 0 或已標原因</td><td>差異未解:不進營收判斷</td></tr>
<tr><td><span class="status blue">curriculum_upgrade</span></td><td>Wade + Louis</td><td>已購學員是否接受 6 模組升級 12 章 Vibe Coding</td><td>2/2 有溝通紀錄</td><td>無紀錄:列退款/信任風險</td></tr>
<tr><td><span class="status green">pilot_decision</span></td><td>Louis + zihrou</td><td>實收、退款風險、有效需求、下一批 pilot 名單</td><td>D7 決定繼續/調整/暫停</td><td>指標不明:暫停開發擴張</td></tr>
</tbody>
</table>
</div>
<div class="panel span-4">
<h2>Wade LINE Ask</h2>
<div class="script">Wade,請今天 18:00 前匯出 Kolable 5/12-5/21 訂單與付款狀態 CSV。
必含欄位:
1. order_id / buyer / product
2. order_at / amount / currency
3. payment_status / paid_at / payment_method
4. refund_status / refund_reason
5. 兩位已購買學員對課綱升級的溝通狀態
若無法匯出,請直接回「卡在哪個系統/權限/欄位」。今晚沒有資料,PLS 先標 export_pending 並不做營收判斷。</div>
</div>
<div class="panel span-12">
<h2>D1 / D7 / D14 / D30</h2>
<div class="timeline">
<div class="stage"><h3>D1 · 匯出與封存</h3><ul><li>Wade 匯出 5/12-5/21 訂單付款 CSV。</li><li>PLS 封存 raw file 與匯出時間。</li><li>兩位已購買學員標 upgrade communication state。</li></ul></div>
<div class="stage"><h3>D7 · 對帳與決策</h3><ul><li>建立實收/未收/退款/爭議分層。</li><li>完成 refund risk 與 revenue recognized 表。</li><li>Louis 決定 pilot 是否繼續加碼。</li></ul></div>
<div class="stage"><h3>D14 · 銷講漏斗</h3><ul><li>把直播銷講來源、訂單、付款、退款接成 funnel。</li><li>建立銷講腳本和付款轉換關聯。</li><li>同步產品/客服/營運 RACI。</li></ul></div>
<div class="stage"><h3>D30 · 平台化</h3><ul><li>接金流 webhook 或匯入 API。</li><li>自動 reconciliation dashboard。</li><li>以 paid conversion / refund risk 驅動開發優先級。</li></ul></div>
</div>
</div>
<div class="panel span-12">
<h2>Purpose-to-Purpose E2E</h2>
<div class="flow">
<div class="step"><b>原始目的</b><span class="small">Kolable 要驗證直播銷講工具平台是否有真實付費需求。</span></div>
<div class="step"><b>主成果</b><span class="small">訂單付款核對作戰台、資料模型、acceptance tests、LINE ask。</span></div>
<div class="step"><b>人採用</b><span class="small">Wade 匯出資料;Louis 對帳;zihrou 監督風險與決策。</span></div>
<div class="step"><b>專案指標</b><span class="small">實收金額、未收筆數、退款風險、升級溝通完成率。</span></div>
<div class="step"><b>錢路徑</b><span class="small">避免把未收或退款風險誤當營收,讓開發資源只追已驗證需求。</span></div>
</div>
</div>
<div class="panel span-6">
<h2>市場成熟做法</h2>
<p>直播銷售成熟做法會讓觀眾能直接 checkout 並回到訂單管理;付款成熟做法則要求訂單、發票/應收、入帳與差異可 reconciliation。本輪不是做市場報告,而是把 Kolable 的直播銷講訂單落到訂單/付款/退款狀態與 D7 決策。</p>
<ul>
<li>Shopify live selling / virtual shopping and checkout order flow</li>
<li>Stripe automatic reconciliation for payments</li>
</ul>
</div>
<div class="panel span-6">
<h2>Data / API / Permission</h2>
<div class="code">tables:
kolable_order_exports
kolable_orders
kolable_payment_events
kolable_refund_risks
curriculum_upgrade_contacts
apis:
POST /kolable/order-exports
POST /kolable/payments/reconcile
GET /kolable/revenue-scorecard
roles:
Wade: upload/export
Louis: reconcile/decision
zihrou: approve risk gate</div>
</div>
<div class="panel span-4">
<h2>Production Acceptance</h2>
<p><b>Owner:</b> Louis;資料 owner:Wade;supervisor:zihrou。</p>
<p><b>Due:</b> D1 匯出;D7 對帳與 pilot 決策。</p>
<p><b>Pass:</b> 100% 訂單有付款狀態;2 位已購買學員有升級溝通紀錄;差異都可解釋。</p>
</div>
<div class="panel span-4">
<h2>Solution Selection</h2>
<p>選 `spreadsheet + dashboard + project`:比 communication 更能解決營收/付款判斷;暫不做 full system,因為 D1 仍缺 Wade raw export 與實際欄位。</p>
</div>
<div class="panel span-4">
<h2>Next Upgrade</h2>
<p>D7 後把真實 CSV 接入 PLS scorecard,D14 建直播銷講漏斗,D30 接金流 webhook 或平台 API,讓付款狀態自動更新。</p>
</div>
</section>
</main>
</body>
</html>
{
"job_id": "6d5be6ac-5fad-4c94-bbe6-e2e71df5f94d",
"ai_native_project_id": "4715ad23-b78b-467b-93b6-c0927e259096",
"project": "Kolable - 直播銷講工具平台",
"what_hermes_learned": [
"Kolable's current bottleneck is not only development progress; it is revenue truth from orders and payments.",
"The two already-purchased students affected by curriculum upgrade create refund and trust risk that must be tracked next to payment status.",
"Full automation is premature until Wade provides the raw export and actual fields."
],
"market_learning": [
"Live commerce maturity connects checkout, order management and payment status rather than treating a live-sale order as a chat event.",
"Payment maturity requires reconciliation states for missing, mismatched, partial, disputed and refunded payments."
],
"assumptions_to_test_next": [
"Wade can export order and payment fields for 2026-05-12 to 2026-05-21.",
"Louis will accept reconciliation as the D7 pilot decision gate.",
"zihrou can approve refund/trust risk handling before further development expansion."
],
"next_round_priority": "Use Wade's raw CSV to produce a revenue scorecard and continue/adjust/pause pilot decision."
}

Market Context / Market Maturity

Sources

Mature Practice

直播銷售成熟做法會讓觀眾在直播或 connected commerce path 中完成 checkout,訂單回到可管理的 order flow。成熟平台不只看「有人下單」,而是把下單、付款、退款、履約與客戶溝通串起來。

付款成熟做法會把入帳與應收/訂單自動或半自動 reconciliation,並處理 underpayment、overpayment、missing payment、manual review 等差異狀態。

PLS Gap

Kolable 目前有「需要匯出 5/12-5/21 訂單與付款狀態」的訊號,但缺 raw export、付款對帳、退款風險、課綱升級溝通狀態與 pilot decision gate。

This Round Upgrade

本輪補上訂單付款核對 HTML 作戰台、資料模型、API/sync、權限/稽核、acceptance tests、people sync 與 learning memory。市場資料只作輸入;主要交付是可採用的 production pack。

People Sync

Targets

  • Wade:資料匯出 owner。
  • Louis:對帳與 pilot decision owner。
  • zihrou:風險 gate supervisor。
  • makarove:若需要補客戶/學員溝通紀錄,協助營運落地。

LINE Draft

Wade,請今天 18:00 前匯出 Kolable 5/12-5/21 訂單與付款狀態 CSV。

必含欄位:

  1. order_id / buyer / product
  2. order_at / amount / currency
  3. payment_status / paid_at / payment_method
  4. refund_status / refund_reason
  5. 兩位已購買學員對課綱升級的溝通狀態

若無法匯出,請直接回「卡在哪個系統/權限/欄位」。今晚沒有資料,PLS 先標 export_pending,不做營收判斷。

Expected Reply Signal

CSV 檔案或明確 blocker;若有 CSV,下一輪要能產出 revenue scorecard。

Kolable 訂單付款核對 Production Brief

場景

AI 自建專案 4715ad23-b78b-467b-93b6-c0927e259096 的當前卡點是:Kolable: Wade 匯出 5/12-5/21 訂單與付款狀態(PLS 由 Louis 追)。這不是單純催辦,而是 Kolable 是否有真實付費需求、是否誤判營收、是否有退款/課綱升級信任風險的基礎資料。

D1 / D7 / D14 / D30

  • D1:Wade 匯出 5/12-5/21 訂單與付款狀態 CSV,PLS 封存 raw export 與匯出時間。
  • D7:Louis 完成實收/未收/退款/爭議分層,zihrou 確認是否可進下一批 pilot。
  • D14:把直播銷講來源、訂單、付款、退款接成 funnel,對應銷講腳本與付款轉換。
  • D30:接金流 webhook 或平台 API,形成自動 reconciliation dashboard。

Purpose-to-Purpose E2E

原始目的:Kolable 要驗證直播銷講工具平台是否有真實付費需求。 主成果:訂單付款核對作戰台、資料模型、acceptance tests、LINE ask。 人採用:Wade 匯出資料,Louis 對帳,zihrou 批准風險 gate。 專案/錢/風險指標:實收金額、未收筆數、退款風險、升級溝通完成率、下一批 pilot 決策。

Owner / Due / Acceptance

  • Owner:Louis。
  • Data owner:Wade。
  • Supervisor:zihrou。
  • Due:D1 匯出;D7 對帳與 pilot 決策。
  • Acceptance:100% 訂單有付款狀態;2 位已購買學員有升級溝通紀錄;所有差異都有原因。

Production Readiness

Production Path

  1. D1:Wade 匯出 5/12-5/21 訂單付款 CSV,PLS 封存 raw export。
  2. D7:Louis 完成 reconciliation scorecard,zihrou 檢查退款/信任風險。
  3. D14:接直播銷講來源與付款轉換漏斗,建立產品/銷講/客服 RACI。
  4. D30:串金流 webhook 或平台 API,自動更新付款狀態與 refund risk。

Sync

  • Wade upload raw export。
  • PLS worker ingest CSV and create draft scorecard。
  • Louis approve revenue classification。
  • zihrou approve risk gate。

Permissions / Audit

PLS worker 可以產生 draft reconciliation,但不能將營收標 recognized。所有 payment/revenue/risk 狀態改動都需 actor、reason、source_file_ref。

Failure / Rollback

若 CSV 欄位錯誤或付款來源不清,保留 raw export,建立 corrected export version,不覆蓋原始檔。若兩位已購學員升級溝通未完成,該收入先列 refund risk,不作為 pilot 成功證據。

Skill Usage

  • purpose_e2e_toolbox_v2:用於 D1/D7/D14/D30、目的到目的 E2E、價值/錢路徑、人能力提升、solution stack、資料/API/權限/稽核與 decision record。
  • Web search:查 Shopify live selling / checkout/order flow、Stripe automatic reconciliation,作為 market_context 與 market_maturity 輸入。
  • HTML/dashboard artifact:建立可開啟的 Kolable 訂單付款核對作戰台。
  • PLS fixed helper:使用 doctor/touch/claim/context/progress/upload-files/complete;context 與 reading_context 均已執行。

Solution Selection

Selected

spreadsheet + dashboard + project

Why

本輪核心不是單純追 Wade,而是要把訂單、付款、退款風險、課綱升級溝通與 pilot 決策接成可驗收資料流程。付款狀態會直接影響營收判斷與開發優先級,因此需要比 communication 更完整的 scorecard/dashboard。

Why Not Smaller

  • communication 只能催資料,不能產出 revenue recognition 與 reconciliation gate。
  • doc 只能描述流程,不能讓人看 pass/fail。

Why Not Bigger

  • system 需要先有 Wade raw export 與實際欄位。D1-D7 先驗證資料形狀,再進 D30 webhook/API。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment