Lab 37: Run the books, set the price
- Approved by
- Panaversity ·
What you do. You turn a recorded month of costs from the platform of Labs 33 to 36 into a monthly statement for each worker. You test how it changes when one assumption changes, and set a price floor. Then you compare all of it with the memo you wrote in Lab 32. Then you assemble the First Reference Worker.
What you need. Your Lab 36 folder, or the lab's starting point, with a month of recorded usage rows for both companies. The setup from 32.8. Your docs/foundation-memo.md from Lab 32. No API key. Task 6 is optional.
Download. brightline-lab-ch37.zip. It starts as the Lab 36 solution. It ships model.ts, a month of usage rows for both workers, each assignment's outcome, a sample provider bill, and an empty spec-report.md. The month has 3,868 rows. Two of them are deliberate duplicates, and one dreaming run is recorded under the wrong kind. The month is recorded, with one review policy: 10% of Acme's work and 8% of Lahore Foods' is checked, 3 minutes each, at $12 an hour. That policy stands in for Lab 36's recorded review minutes, about 900 in the month, which at $12 an hour would cost more than the revenue; Task 7 comes back to it. Each task's answer key is its own download, such as Task 1's answer key. For another task, change the number at the end of that address. The complete solution is one more download, brightline-lab-ch37-answer-key.zip. Unzip it inside your lab folder, and open it only after you try.
How a task works. Each task gives you a request to send to Claude Code, then What good looks like, then Check before you approve. Predict first, then check.
Core path. Tasks 1 to 4, and Task 7, the First Reference Worker. Extension. Task 5, the comparison with your memo, and Task 6, the port. The core tasks are enough for the next chapter. Each lab's download includes what it needs from the labs before it, so a skipped extension never blocks you.
Sitting 1: the statement
Task 1. Write the spec
Write spec-report.md yourself, from 37.8. Set the revenue for each company: $100 a month for Acme's worker, $80 for Lahore Foods'.
Task 2. Build the statement
Send Step 1 from 37.8, statement part only.
What good looks like: all four failure tests pass. The report finds the two duplicate rows and the misfiled dreaming run, and says so. The model total agrees with the sample bill within 2%, so there is no warning.
Check before you approve. Pick one assignment by its correlation ID and add up its rows by hand. Does it match? Does the month's model total match the sample bill within 2%?
Task 3. Read your statement
Before you go on, answer in writing, in docs/contribution-report.md:
- What are Contribution I and Contribution II for each worker?
- Which line is the biggest cost of doing the work? Is it the same for both companies?
- Why is Acme's model line higher than Lahore Foods'? (Chapter 35's data rule.)
Sitting 2: sensitivity, price and the reference worker
Task 4. Sensitivity and price
Send the rest of Step 1: the sensitivity runner and the price calculator. Then:
Task 4. Run three sensitivity cases on each worker's measured statement. First, the review rate at 5%, 10% and 20%. Second, all work on Claude Haiku, against your current routes. Third, context in the next price tier up. Then compute the price floor at 50% and 70% margins. Add both to docs/contribution-report.md.
What good looks like: a table per worker. The review rate moves Contribution II more than either other case. If "all work on Claude Haiku" looks cheaper, check why: a case can save money only by breaking a quality minimum. Say so next to the number.
Check before you approve. Predict first: which case hurts Lahore Foods' worker most, and why?
Task 5. Compare with your memo
Open your Lab 32 memo. Write one paragraph at the end of the report: what did you estimate then, what did you measure now, and what turned out different? Name the one number that surprised you most.
Task 6. Port (optional)
Task 6. Add OpenAI prices, from OpenAI's pricing page today and dated, to a copy of model.ts. Produce the same statement for Lahore Foods' worker as if its judge activity ran on the OpenAI model from Lab 35. Do not change the measured usage.
What good looks like: only the model line changes, and only by cents. The review line does not move. Moving one activity to a cheaper model is rarely worth it for the money alone.
Task 7. Assemble the First Reference Worker
Send the assembly request from 37.9.
What good looks like: npm run reference runs every test from Labs 33 to 37 (more than a hundred) and one full recorded month. It writes docs/reference-worker.md with the statement, the autonomy rate before and after, the list of limits, and what did not fit together.
Check before you approve. Read the list of things that did not fit together. Each is a real finding about your platform. Which would you fix first before a real client?
What you have now
A worker you built, measured and priced, on a foundation you chose with evidence. You know its cost per accepted invoice, the line that matters most, the lowest price that leaves your margin, and when building your own platform pays. That is the end of Part IV. Part V takes workers like this into production.
- Owner
- Panaversity