Batch API lab
Mastery: ship checklist
A second person can reproduce fixture of 20 lines yields 18 succeeded + 2 failed with error objects; cost ≤ $0.40 from a clean checkout and name the owner for BATCH-DUP-8841.
1Learn the idea
Read
Clean-room demo
From a fresh clone/directory, run the commands that prove fixture of 20 lines yields 18 succeeded + 2 failed with error objects; cost ≤ $0.40. A second person plays QA lead who needs cost-capped offline eval by 07:00 UTC and follows your script without coaching. The demo includes limitations: what overnight batch job that grades 50k support transcripts via provider Batch API still will not do.
Read
Evidence pack
Bundle: contract snippet, passing tests, metric snapshot for batch_line_success_ratio ≥ 0.90 and dollars_per_1k_lines ≤ 8, security negative probe, rollback note, owner name. Reference BATCH-DUP-8841 as the drill you rehearsed. If any item is missing, the ship gate fails even if the happy path dazzles.
Read
Implementation artifact
python submit_batch.py --input grades.jsonl --budget-usd 0.40 --poll 30
python parse_results.py --out report.json --fail-on-dup-ids
Read
Ownership and next review
For Batch API lab, name the human who gets paged, the review date for thresholds, and the condition that triggers reevaluation. Endpoint POST /v1/batches remains the production surface you operate for overnight batch job that grades 50k support transcripts via provider Batch API — not a slide. Keep BATCH-DUP-8841 in the handoff template so the next owner inherits the drill.
Read
Stage depth
After the peer demo, schedule the next threshold review date. File a short changelog that mentions BATCH-DUP-8841 and the control that addresses it. Archive the evidence pack where your team already stores launch records. Resist rewriting everything “for real production” in one weekend — operate this slice until the metrics bore you, then widen. Final self-check: if telemetry vanished, would you still know to hold? If yes, you learned the operating posture this lane teaches.
Read
Field notes for `batch-api-lab` / `mastery-ship`
Trim the demo script until every command is necessary. Record a peer signature line: name, date UTC, pass/fail. File known limitations as bullets, not apologies. Link the evidence pack from the README. Schedule the next game day on a calendar, even if it is solo. Archive the branch tag or release digest you actually shipped. In this chapter the product is overnight batch job that grades 50k support transcripts via provider Batch API, the human stakeholder is QA lead who needs cost-capped offline eval by 07:00 UTC, and the incident id you design against is BATCH-DUP-8841. Re-state the oracle in your notes — fixture of 20 lines yields 18 succeeded + 2 failed with error objects; cost ≤ $0.40 — and keep the invariant visible: each input line has a stable custom_id; failed lines never poison the whole file. Track batch_line_success_ratio ≥ 0.90 and dollars_per_1k_lines ≤ 8 as the scoreboard. Surface under change control: POST /v1/batches. If you only have forty minutes, finish the fixture for duplicate custom_id causes silent overwrite of the better grade before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.
Go deeper
Before you start
Why this matters
Draft a two-minute demo script that proves fixture of 20 lines yields 18 succeeded + 2 failed with error objects; cost ≤ $0.40 from a clean directory. Include the failure rehearsal for duplicate custom_id causes silent overwrite of the better grade and the rollback/owner line. If the script needs tribal knowledge, the lab is not shipped.
In the wild
See how this idea shows up as a product and a company — then come back to the lesson. Skills transfer across vendors.
Related lessons
Check your understanding
Page assessment
Answer from memory. Completion is saved from this evidence, not from opening the next page.
All responses are required.