One page for the four formulas and three checklists. Every number below uses labelled example parameters.
Cost is tokens times price, counted separately for input and output. State both counts and both prices before multiplying.
Example parameters: 20,000 input tokens at $2 per million, 5,000 output tokens at $8 per million.
Input cost = 20,000 x 2 / 1,000,000 = $0.04
Output cost = 5,000 x 8 / 1,000,000 = $0.04
Job cost = 0.04 + 0.04 = $0.08Latency is time to first token plus output tokens over decode speed. Streaming shows tokens early but does not change this total.
Example parameters: time to first token 0.4 s, 200 output tokens at 50 tokens/s.
Decode time = 200 / 50 = 4.0 s
Latency = 0.4 + 4.0 = 4.4 sA chain needs every step to pass, so if steps succeed independently with probability p each, overall success is p to the power n. Small per-step losses compound fast.
Example parameters: per-step success p = 0.90, steps n = 5.
Chain success = 0.90^5 = 0.90 x 0.90 x 0.90 x 0.90 x 0.90 = 0.59049, about 0.59Pass rate is passed over total on a fixed set. Cost per accepted result divides total spend by accepted results only.
Example parameters: 40 passed of 50 trials, each trial $0.10.
Pass rate = 40 / 50 = 0.80
Total cost = 50 x 0.10 = $5.00
Cost per accepted = 5.00 / 40 = $0.125Check | Action |
|---|---|
Scope | Restate the task and what the draft must not change. |
Diff | Review the diff line by line, not just the final result. |
Differential | Run the draft against a reference on the same inputs. |
Properties | Check widths, resets, and protocol invariants the reference may miss. |
Experiment | The engineer runs the test and keeps the log as evidence. |
Refuse | Reject the draft when evidence is missing or the check fails. |
Tier | Rule | Example |
|---|---|---|
Read-only | The agent reads and proposes without changing state. | Summarise a regression log and rank suspects with file lines. |
Approval-gated | Each state change needs explicit approval and a preview. | Propose a lint patch in a scratch copy, then wait for review. |
Restricted | Destructive or secret-adjacent acts need a human, a sandbox, and logs. | Push a fix, rotate a key, or open a network path. |
Item | Ask |
|---|---|
Goal | Does the first line name the task and done criteria. |
Context | Are the files, logs, and constraints attached, trimmed to fit. |
Format | Is the output shape and schema stated for validation. |
Self-check | Is a recheck or worked check requested before the answer. |
Budget | Are tokens, steps, and cost capped for this call. |
Use this | When | Why |
|---|---|---|
Script | Fixed repeatable steps with no judgment calls. | Deterministic, cheap, and easy to regress. |
Workflow | Multi-step path with approvals and fixed branches. | Control stays explicit while tools do the routine parts. |
Agent | Open-ended search over tools with uncertain order. | Flexibility costs budgets, guardrails, and evaluation. |