Model, condition, policy, and constraints each have one active value.
A production workflow and an experiment use the same compiler, jobs, attempts, ledger, and policy controls. Fix the factors and the engine runs one cell. Vary them and it runs a controlled grid. Compare the cells, adapt one variable, and the grid becomes a campaign.
Model, condition, policy, and constraints each have one active value.
The factor cross-product creates cells; every cell enters the same workflow engine.
A fixed assignment produces one workflow cell. Factor levels produce a grid of cells. Both compile into the same jobs and attempts; only the grid adds cross-arm comparison and adaptation.
Run the workflow with one selected model, condition, policy, seed, and set of constraints.
Expand the same workflow across the product of active factor levels. Each assignment is one controlled cell.
Workflow, factor assignment, instrumentation, budget, and deadline.
Validate dependencies and produce the executable DAG.
Materialize work with a policy arm and operating limits.
Model calls, tools, retries, timing, tokens, and outcomes.
Append-only events shared by operations and experiments.
Measurement rules turn ledger fields into named information: first-pass quality, cost, grit, uncertainty, and value.
Control rules consume available information to route, retry, escalate, budget, or halt work inside the running workflow.
When G > 1, compare policy arms, change one factor, and emit the next grid. The winning arm is already executable.
Grid breadth: the product of active factor levels, such as model × condition × policy × seed.
Workflow depth: linked sessions or stages whose accumulated effects must remain visible.
Measurement breadth: independent angles applied to each stage, from correctness to cost and recovery.
Adding a factor level multiplies cells; adding a stage or measurement expands every cell.
The instrument is modular but not flat: the eight package planes form a dependency chain, and control consumes the information the lower planes produce. A plane's state is either instrumented (built and measured), proposed (designed but not run), or decided (a verdict binds it).
A fixed factor assignment produces one cell; a factor cross-product produces G cells. Both converge on the same compile → jobs → attempts → ledger path; only the grid branches to compare and adapt.
The human policy boundary sits outside; inside it, declared constraints bound execution and independent verification. Exits are accept, reject/rework, or halt/escalate. Typed checkpoints remain proposed capability, not a run state.
The agent may operate the workflow, but people define its objective, information requirements, policy, budget, and intervention conditions. Exceptions cross the boundary; routine work does not.
Set objectives and specifications · approve policy arms · allocate budgets · define acceptance and escalation thresholds · review exceptions
The agent proposes work; a person approves consequential actions.
The agent executes routine work; a person reviews outcomes and exceptions.
The policy routes, retries, and escalates inside explicit limits; people govern the boundary.
Observed cost, outcome, and narration fields come from 227 historical experiment worktrees. Retry rate is a workload input until the attempt ledger measures it directly. Modeling parameters (β, EPM) are calibrated to your codebase and energy market. Separating observations, controls, and assumptions is the difference between deterministic budgeting and surprise overruns.
These drive the human+AI cost model. Teams using AI coding assistants interact with these every session.
These drive the bounded autonomous cost model. Routine jobs run inside the declared policy; failed verification, exhausted limits, and material uncertainty return to the human control plane above.
The equations are the same. The resource under management is the only difference.
Every rule derives from these equations. Cost parameters (C₀, P) are measured from 227 historical experiment worktrees. Modeling parameters (β, EPM) use IEA energy projections and your codebase growth rate. See methodology for provenance detail on each parameter.
Baseline projections at IEA EPM (1.6%/yr). Use 3yr for quarterly budgeting. Use 10yr for strategic planning. Toggle to DS Scenarios for aggressive (2.5%) and optimistic (0.8%) energy paths. Operationalizes the Inference Production Frontier (Zhuang et al., 2025).
Two modes: Augmented Workforce for teams using AI coding assistants, or Autonomous Workloads for jobs operating inside declared policy limits. Every adjustment recalculates your projected spend in real time.
Decisions affecting C₀ alone. Reversible. Switch back anytime. Preserves your runway.
Decisions affecting β, v, or EPM. Compound through N².
Decisions affecting batch routing, escalation chains, and SLA windows. Commit your autonomous workforce architecture for years.
30-day implementation:
Each rule is grouped by its current status: instrumented (its inputs and premise are measured), proposed (modeled or designed but not run as an arm), or decided (a verdict binds it). A rule's premise being measured does not make the rule measured — a policy becomes decided only when it is run as an arm and compared.
Default to models that keep correctness under degraded input.
Inputs: test-executed success under 10 perturbation operators ([M]). Evidence class [M]/[C]. Limitation: single-session + story corpus; not a universal trait. Next test: strength-grid live run.
Measure what resilience costs — flail rate and narration penalty.
Inputs: measured flail + narration overhead per model ([M]). Evidence class [M]/[C]. Limitation: descriptive; not matched-task causal evidence. Next test: re-weight by accepted outcome.
Price the accepted outcome, not the prompt; derive first-pass from the attempt ledger.
Inputs: attempt number, acceptance, independent evaluator ([M]). Evidence class [C]. Limitation: needs per-task/per-model coverage. Next test: coverage-corrected routing.
Codebase growth compounds quadratically; β is calibrated, not measured.
Inputs: β (calibrated, [P]), v ([C]). Evidence class [C]/[P]. Limitation: N² is a modeled extension beyond the measured arc. Next test: canonical lab output for the arc.
Energy prices inflate compute; EPM(t) is externally calibrated.
Inputs: IEA projections ([X]), rate r ([P]). Evidence class [X]/[P]. Limitation: external scenario, not a corpus outcome. Next test: energy-measured campaign.
Deferred batch work is cheaper (50%) with a 72-hour horizon.
Inputs: provider batch pricing ([X]), queue model ([P]). Evidence class [X]/[P]. Limitation: modeled; batch experiments not yet executed. Next test: batch-vs-on-demand arm.
Throughput = Budget / (cost per job × (1 + retry)).
Inputs: measured retry rate r=0.115 ([M]), WFM theory ([P]). Evidence class [C]/[P]. Limitation: capacity formula, not a verified SLA. Next test: budget-policy arm.
Failures auto-escalate through model tiers; design for <1% human escalation.
Inputs: price ratios ([X]), escalation design ([P]). Evidence class [X]/[P]. Limitation: cascade experiments not yet executed. Next test: escalation arm.
Completion time = queue × job time + retry buffer; never batch under 2× queue depth.
Inputs: queue theory ([P]), retry buffer ([P]). Evidence class [P]. Limitation: modeled from WFM, not measured. Next test: live queue-depth validation.
Maximize outcomes per dollar (BVI = outcomes / total cost).
Inputs: accepted outcomes and total cost ([M]), BVI definition ([P]). Evidence class [C]/[P]. Limitation: business-value framing, not a verified outcome metric. Next test: value-weighted arm comparison.
Decided status is reserved for a rule whose verdict binds it (see the 2b decision on The Evidence). No rule card above over-claims a measured rule when only its premise is measured.
These are organized across three provenance tiers. Observed patterns are directly visible in the measurement corpus (227 historical single-session perturbation experiments + 1,067 multi-session story sessions). Derived metrics compute operational quantities from those observations. Modeled extensions project beyond what the experiment directly measures.
Choose for resilience, explanation overhead, and working outcomes.
Model codebase, energy, and outcome effects before they become architecture.
Bound batch, budget, escalation, and SLA behavior.
Observed from the experiment corpus (cost variation, outcome retention, recovery overhead). Derived metrics (Grit, WOC, cost per outcome). Modeling extensions (Snowball, EPM, batch, cascade, SLA, BVI) are modeled projections — not independently tested.
Every playbook tactic below implements one or more of the 10 decision rules. Use this mapping to trace your cost savings back to the empirical evidence.
Rule 1 (Grit) + Rule 2 (Explanation Tax)
Rule 1 (Silent Inference) + Rule 5 (First-Pass)
Rule 5 (First-Pass) + Rule 7 (Budget Ceiling)
Rule 6 (Batch Discount) + Rule 9 (SLA Buffer)
Rule 8 (Cascade Rule) + Rule 10 (Outcome Multiplier)
| Provider | Input (cache miss) | Input (cache hit) | Output |
|---|---|---|---|
| DeepSeek v4 Pro | $0.66 | $0.022 | $1.98 |
| GPT-5.6 Luna | $0.20 | $0.02 | $1.20 |
| Claude Sonnet 5 | $2.00 | $0.20 | $10.00 |
Per 1M tokens. Sources: api-docs.deepseek.com (Aug 2026), Anthropic/OpenAI list pricing. Verified against the experiment billing database — every measured session cost reconciles to these rates. DeepSeek rates are off-peak; peak is 2× (01:00–04:00 & 06:00–10:00 UTC).
Three-layer caching turns the provider economics in your favor. Each layer compounds on the one below.
Routing here isn't a vendor diagram — it's computed. compute_routing() (in src/instrument/routing.py) reads the experiment corpus, groups sessions by task, and recommends per task a default model (cheapest that clears the correctness threshold) or an escalation model (when a higher-correctness model leads by a meaningful margin). It then simulates single-model vs grit-routed strategies across the whole corpus.
Hard caps prevent runaway costs. These tools enforce limits at the gateway layer.
Input: $0.66 (miss) · $0.022 (hit) · Output: $1.98 (off-peak; 2× at peak)
Cache: 78% hit rate measured — re-reads codebase each session (35K tokens/session)
Best: High test thoroughness (34 tests/cell) at low cost. Strong for verifiable codegen.
Input: $0.20 · Output: $1.20 · Cache hit: $0.02
Cache: 97.5% hit rate measured — 6.3K tokens/session
Best: Cheapest per cell ($0.09) but minimal test coverage (7 tests/cell). Route to low-risk tasks.
Input: $2.00 · Output: $10.00 · Cache hit: $0.20
Cache: 73% hit rate measured
Best: 122 tests/cell — the deepest verification in the corpus. Reserve for safety-critical work.
Subscription route: the same model runs through the Claude CLI adapter (--backend claude_cli) — subscription-safe, no per-token API spend.
When a cheap model fails, you pay the retry penalty — and you lose the verification the expensive model would have written. Here's what that actually costs.
| Escalation multiplier (Eₔ) | 50× (Luna → Sonnet 5) |
| Test coverage gap | 17× (7 vs 122 tests/cell) |
| Sonnet vs DeepSeek gap | 30× ($4.78 vs $0.16 per session) |
| Tier 1 (Luna) | ~$0.09 |
| Tier 2 (DeepSeek) | ~$0.16 |
| Tier 3 (Sonnet 5) | ~$4.78 |
| Verification depth | 7 → 122 tests/story |
All 7 models across 3 provider families produce structurally sound code (AST-verified). Test pass rates and token economics vary dramatically by provider — not by capability.