Resume after step 5
Decide where a crashed seven-step statement harness resumes when the step that failed is not the step that broke, and cost the rerun against the deadline.
On this page
A resume file makes "start from where it failed" cheap, as workflow scripts and deterministic harnesses shows. The case is harder when the step that failed is not the step that broke.
The situation
A monthly statement harness runs seven steps for 2,000 business customers: (1) pull 120,000 transactions, code, 40 minutes; (2) categorise them, model, 1,200 calls of 5,000 tokens in and 1,000 out, 3 hours; (3) compute totals, code, seconds; (4) draft each customer's narrative, model, 3,000 in and 400 out per customer, 2 hours; (5) fact-check each narrative against the totals, 4,000 in and 100 out per customer, 2.5 hours; (6) the finance lead reviews, 4 hours; (7) email statements.
Step 5 crashed at customer 1,412 when the API kept returning overloaded errors past the retry budget. Of the 1,411 checked, 37 failed: the narrative's totals disagree with step 3's. All 37 have refunds from one card network that step 2 labelled as purchases, and a fix is ready. The resume file holds steps 1 to 4 and step 5's results so far, each under a hash of its inputs. Statements are due in 26 hours.
Course constants: P_in = $3 and P_out = $15 per million tokens.
The question
Decide where the run resumes, which stored outputs you keep, and what the rerun costs in money and hours against the deadline.
A strong answer · Rubric · Where answers go wrong
Write your answer first, then open