01 / DECIDE
架構決策
適合 offline evaluation、classification、enrichment,或不需要互動 latency 的大型 queue。
Batch work 需要穩定 custom identifier、immutable input manifest、逐項 status、result reconciliation 與 bounded replay。 先把 input、output、state 與 side effect 畫成一條可觀察路徑,再決定 把可容忍延遲的 workload 移到 batch 要放在哪一層。
02 / BUILD
三步實作
- 01
框定合約
先寫下 caller、資料分類、成功條件、timeout、取消與 ownership。適合 offline evaluation、classification、enrichment,或不需要互動 latency 的大型 queue。
- 02
建立單一路徑
只實作一條 end-to-end path,保留 request correlation、typed state 與可逆 failure handling。Batch work 需要穩定 custom identifier、immutable input manifest、逐項 status、result reconciliation 與 bounded replay。
- 03
證明結果
把驗收寫成可重跑的 fixture、contract test 或 browser test。Reconciliation 證明每個 input 都是 succeeded、failed、cancelled 或明確 pending,沒有 silent loss。
03 / BOUND
Production 邊界
不可送出無界敏感資料集;先定義 retention、encryption、cancellation 與 partial-result policy。
04 / PROVE
驗收證據
Reconciliation 證明每個 input 都是 succeeded、failed、cancelled 或明確 pending,沒有 silent loss。
SOURCE / HTTP
可重現來源探針
curl -fsSI 'https://developers.openai.com/api/docs/guides/batch' | sed -n '1,5p'