ONE ENGINE / TWO OPERATING MODES

Run one workflow. Or evaluate it as a grid.

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.

OPERATE / FIXED ASSIGNMENT
1 cell
Execute the selected workflow.

Model, condition, policy, and constraints each have one active value.

EXPERIMENT / VARIED FACTORS
G cells
Execute controlled variants.

The factor cross-product creates cells; every cell enters the same workflow engine.

Who this is for: Organizations operating AI workflows at scale, from human-assisted engineering sessions to bounded autonomous pipelines. The current evidence is drawn from Python/Flask REST APIs and TypeScript/Node.js; validate the instrument in other domains before adopting its policy candidates.
WORKFLOW COMPILER / OPERATING MODES

One execution engine,
from cell to campaign.

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.

One workflow engine operating as a single cell or an experimental grid A fixed factor assignment and a factor cross-product converge on the same cell, compiler, jobs, attempts, and ledger. The ledger produces information for runtime policy. Experimental grids additionally compare arms and adapt the next specification. A lower rail shows grid breadth times workflow depth times measurement breadth. OPERATING MODEL / SHARED EXECUTION ONE ENGINE, FROM CELL TO CAMPAIGN FIX THE FACTORS TO OPERATE · VARY THEM TO LEARN OPERATE / FIXED ASSIGNMENT 1 CELL one active model · condition policy · seed · constraints EXPERIMENT / FACTOR LEVELS G CELLS product of active factor levels same workflow in every assignment selectexpand SHARED UNIT CELL workflow + assignment validatematerializeexecuterecord 02 / ORDERCOMPILEdependencies → DAG 03 / CONTROLJOBSpolicy · budget · due 04 / EXECUTEATTEMPTScalls · tools · retries 05 / VISIBILITYLEDGERappend-only events derive MEASUREMENT RULESINFORMATIONquality · cost · grit · uncertainty consume RUNTIME CONTROLPOLICYroute · retry · escalatebudget · halt acts inside job WHEN G > 1COMPARE ARMScost · quality · latency · value CAMPAIGNADAPTchange one factoremit next grid next specification SCALE / INSTRUMENTED EVIDENCE SURFACE GGRID BREADTHPRODUCT OF FACTOR LEVELSMODEL × CONDITION × POLICY × SEED × NWORKFLOW DEPTHLINKED SESSIONS OR STAGESACCUMULATED EFFECTS STAY VISIBLE × MMEASUREMENT BREADTHINDEPENDENT ANGLES PER STAGEQUALITY · COST · RECOVERY · VALUE = G×N×MEVIDENCE SURFACEEACH NEW LEVEL MULTIPLIES CELLSCAMPAIGNS REPEAT THE SURFACE
OPERATE Fixed factor assignment → 1 cell

Run the workflow with one selected model, condition, policy, seed, and set of constraints.

EXPERIMENT Factor levels → G cells

Expand the same workflow across the product of active factor levels. Each assignment is one controlled cell.

same execution engine
  1. 01 / DECLARECell

    Workflow, factor assignment, instrumentation, budget, and deadline.

  2. 02 / ORDERCompile

    Validate dependencies and produce the executable DAG.

  3. 03 / CONTROLJobs

    Materialize work with a policy arm and operating limits.

  4. 04 / EXECUTEAttempts

    Model calls, tools, retries, timing, tokens, and outcomes.

  5. 05 / RECORDLedger

    Append-only events shared by operations and experiments.

OBSERVE / MEASUREMENT

Measurement rules turn ledger fields into named information: first-pass quality, cost, grit, uncertainty, and value.

CONTROL / POLICY

Control rules consume available information to route, retry, escalate, budget, or halt work inside the running workflow.

LEARN / CAMPAIGN

When G > 1, compare policy arms, change one factor, and emit the next grid. The winning arm is already executable.

A production workflow is one cell. An experiment is a controlled grid of those same cells. A campaign uses their evidence to revise the next workflow policy.
  1. 1 / SELECT OR VARYFixed factors produce one cell. Varied factors produce G cells without changing the workflow executor.
  2. 2 / EXECUTE AND RECORDEvery cell becomes jobs and attempts that emit append-only events to the same ledger.
  3. 3 / MEASURE AND CONTROLMeasurement rules produce information. Admissible control rules consume it inside the running workflow.
  4. 4 / COMPARE AND ADAPTGrids compare arms. Campaigns alter one factor and run the next evidence-acquisition pass.
FIELD MAP / EIGHT PLANES

Eight planes, one dependency direction.

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).

The eight planes (source: ARCHITECTURE.md)
A one-way dependency chain: core is the foundation, six tier-1 planes build on it, control consumes the information they produce, and apps are served by control. FIELD MAP / EIGHT PLANES ONE DEPENDENCY DIRECTION EACH PLANE DEPENDS ON THE PLANES BEFORE IT · CONTROL IS THE ONLY CONSUMER 01 / FOUNDATIONCOREtier 0 · the base 02 / TIER 1EXPERIMENTspecs → cells 03 / TIER 1MEASUREMENTrules → info 04 / TIER 1RUNTIMEruns the workflow 05 / TIER 1ADAPTERSmodel backends 06 / TIER 1KNOWLEDGErag + context 07 / TIER 1REPORTINGreviews + reports 08 / CONSUMERCONTROLconsumes info 09 / TIER 3APPSportal · website TIER MAP / WHAT DEPENDS ON WHAT 0COREFOUNDATION 1TIER 1 — BUILDEXPERIMENT · MEASUREMENT · RUNTIME · ADAPTERS · KNOWLEDGE · REPORTING 2CONTROLTHE ONLY CONSUMER 3APPSSERVED SURFACES INSTRUMENTED [M] · PROPOSED [P] · DECIDED [C] — STATUS, NEVER A CAPABILITY CLAIM
Figure F1. The eight planes (core → experiment → measurement → runtime → adapters → knowledge → reporting → control → apps). One dependency direction, shown as a flow: core is the only foundation, and control is the only plane that consumes information. The diagram explains dependency direction; it makes no performance or capability claim.
[P] architecturesource: ARCHITECTURE.mdref: svg-marker-flow.html, svg-filter-focus.html
The instrument cycle (Framework)
Instrument, derive, write policy, grid, campaign, back to instrument. Derive is the only path into policy; an unmeasured requirement blocks it. THE LOAD-BEARING RULE TO MAKE POLICIES, WE NEED INFORMATION INSTRUMENT → DERIVE → WRITE POLICY → GRID → CAMPAIGN → REPEAT 01 / INSTRUMENTINSTRUMENTledger events: quality · grit · confidence 02 / DERIVEDERIVEmeasurement rules → named information 03 / WRITE POLICYWRITE POLICYcontrol rules consume measured fields 04 / GRIDGRIDtest policy as an arm 05 / CAMPAIGNCAMPAIGNchange one factor · emit next spec emit fields produce · the only path assign as arm compare arms next spec unmeasured requirement blocks policy
Figure F2. The instrument cycle — derive is the only path into policy, and a control rule whose requirements are not measured cannot be written. The red gate on the derive → write-policy arrow is that rejection.
[P] methodref: svg-marker-flow.html
TWO MODES / ONE ENGINE

One engine, two operating modes.

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.

Fixed assignment → one cell; factor cross-product → G cells
Two inputs converge on one shared engine (cell → compile → jobs → attempts → ledger); only the grid adds compare and adapt downstream. TWO MODES / ONE ENGINE ONE ENGINE, TWO INPUTS OPERATE: ONE FIXED ASSIGNMENT → 1 CELL · EXPERIMENT: FACTOR LEVELS → G CELLS OPERATE / FIXED ASSIGNMENT 1 CELL one model · condition · policy · seed same workflow, every assignment EXPERIMENT / FACTOR LEVELS G CELLS product of active factor levels one workflow, every cell THE SAME EXECUTION ENGINE ONE ENGINE cell → compile → jobs → attempts → ledger OPERATE PATH 1 CELL · RECORD append-only ledger, no comparison EXPERIMENT PATH G CELLS · COMPARE arms compared → adapt the next spec THE ENGINE NEVER CHANGES — ONLY THE GRID ADDS COMPARE + ADAPT
Figure F3. One execution engine, two operating modes — both inputs converge on the same cell → compile → jobs → attempts → ledger path, and only the grid branches to compare and adapt. The written compiler/runtime, with no business KPI.
[P] compiler/runtimeref: svg-marker-flow.html
AUTONOMY / PROPOSED NOT RUN

A bounded-autonomy envelope.

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.

Bounded-autonomy envelope
A human policy boundary wraps declared constraints and independent verification; typed checkpoints are proposed, not run. Exits accept, reject/rework, or halt/escalate. AUTONOMY / PROPOSED NOT RUN A BOUNDARY, NOT AN ABSENCE PEOPLE DEFINE OBJECTIVE · POLICY · BUDGET · LIMITS — PROPOSED IS NOT A RUN STATE HUMAN POLICY BOUNDARY INSIDE / CONSTRAINTDECLARED CONSTRAINTSbudget · deadline · quality · sla INSIDE / CHECKINDEPENDENT VERIFICATIONa separate acceptance gate INSIDE / PROPOSEDTYPED CHECKPOINTSdesigned capability — NOT RUN EXITACCEPT EXITREJECT · REWORK EXITHALT · ESCALATE exceptions cross the boundary PROPOSED ≠ RUN — TYPED CHECKPOINTS ARE DESIGNED CAPABILITY, NOT A MEASURED STATE
Figure F4. The bounded-autonomy envelope — a policy/architecture explanation. The typed-checkpoint cell is explicitly PROPOSED (amber, glowing), distinguished from the run-state cells.
[P] policy/architectureref: svg-pattern-surface.html, svg-filter-focus.html
AUTHORITY / HUMAN CONTROL POINTS

Autonomy is bounded,
not human-free.

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.

Human governance around a bounded autonomous workflow People set objectives, approve policies, allocate budgets, and define intervention conditions. Inside the bounded workflow, policy admits, routes, executes, verifies, retries, and escalates work. Accepted outcomes continue downstream while exhausted limits and material risk return to human adjudication. Assisted, supervised, and bounded autonomous levels can be compared as policy factors. AUTHORITY MAP / HUMAN CONTROL POINTS AUTONOMY IS A BOUNDARY, NOT AN ABSENCE PEOPLE GOVERN THE ENVELOPE · POLICY OPERATES INSIDE HUMAN CONTROL PLANE OBJECTIVE · POLICY · BUDGET · LIMITS humans govern authority, not each action authorize evidence + exceptions BOUNDED AUTONOMOUS WORKFLOW POLICY ACTS ONLY INSIDE DECLARED LIMITS 01 / GATEADMITscope + eligibility 02 / SELECTROUTEmodel + depth 03 / ACTEXECUTEattempt + tools 04 / DECIDEVERIFYacceptance gate 05 / RECOVERRETRYwithin attempt limit 06 / EXITESCALATEtier or human failed verification returns with bounded context ENFORCED AT EVERY DECISION BUDGET DEADLINE QUALITY SLA ATTEMPT LIMIT REQUIRED INFORMATION accepted limit exhausted AUTONOMY LEVEL = POLICY FACTOR ASSISTEDagent proposeshuman approves action SUPERVISEDagent executes routinehuman reviews exceptions BOUNDED AUTONOMOUSpolicy acts inside limitshuman governs boundary ACCEPTED OUTCOMEDOWNSTREAM SYSTEM →continues without per-action approval EXCEPTIONHUMAN ADJUDICATION ↑uncertainty · failed verification · material risk
HUMAN CONTROL PLANE

Set objectives and specifications · approve policy arms · allocate budgets · define acceptance and escalation thresholds · review exceptions

authorize ↓     evidence and exceptions ↑
BOUNDED AUTONOMOUS WORKFLOWpolicy acts only inside declared limits
  1. Admit
  2. Route
  3. Execute
  4. Verify
  5. Retry
  6. Escalate
budgetdeadlinequalitySLAattempt limitrequired information
Accepted outcome → downstream system

Verified routine work continues without waiting for per-action human approval.

Exception → human adjudication

Policy uncertainty, exhausted budgets, failed verification, and material risk leave the autonomous boundary.

Assisted

The agent proposes work; a person approves consequential actions.

Supervised

The agent executes routine work; a person reviews outcomes and exceptions.

Bounded autonomous

The policy routes, retries, and escalates inside explicit limits; people govern the boundary.

Human involvement is itself a policy factor. A grid can compare approval points, intervention thresholds, escalation routes, and autonomy levels using the same workflow engine above.
ECONOMIC INPUTS / MEASURED AND MODELED

Separate what is measured,
controlled, and modeled.

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.

Augmented Workforce (Rules 1–5)

human + AI / per session

These drive the human+AI cost model. Teams using AI coding assistants interact with these every session.

C₀
Which model you call. $0.005 to $1.01 per session. Your primary cost lever. Two-way door – switch per task type.
ObservedTwo-way door
C₀ sub-lever
Cache Strategy. Cache write strategy: Store context at $3.75/Mtok (Anthropic). Cache read strategy: Retrieve existing context at $0.14/Mtok (DeepSeek default). Two-way door — measure your cache hit rate before committing. If <50% reuse, switch to cache-read.
ControlledTwo-way door
P
Whether it produces working code. DeepSeek: 72% general pass rate with correct env. Pin frameworks to maximize this. Drives your retry overhead.
ObservedVerification gate
ε
How much it narrates. Measured flail rates: 8.4% (DeepSeek) to 50% (GPT-5.5). Narration penalty: 0.3% to 30%. Pay only when you need auditable reasoning.
MeasuredSelection
β
Context inflation per line. Compounds quadratically through the Snowball Rule (N²). Default 0.001 — calibrate to your codebase growth rate.
ModeledOne-way door
v
Code velocity per session. How much code you generate per session. Higher velocity accelerates the N² compounding.
ControlledOne-way effect
EPM(t)
Energy price trajectory. Local energy markets determine long-term compute prices. IEA baseline: 1.6%/yr. Hedge scenario: 2.5%/yr.
ModeledOne-way horizon

Autonomous Workloads (Rules 6–9)

bounded autonomy / per job

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.

C₀
Baseline cost per job. Same model cost lever as augmented, applied to a single autonomous unit of work. $0.001 to $1.01 per job depending on model tier.
ObservedTwo-way route
b
Batch fraction. What % of jobs run in batch mode. Batch gives 50% discount: D(b) = 1 − b×0.5. Trade-off: longer completion time.
ControlledAutonomous door
r
Retry rate. Fraction of jobs that fail first-pass and require another attempt or escalation. The calculator begins with an 11.5% scenario; replace it with your attempt-ledger rate before making a policy decision.
Scenario inputEscalation gate
Eₔ
Escalation cost multiplier. How many × more expensive the escalation tier is vs the base model. Price ratio: 28.2× (DeepSeek → GPT-5.6), 68.7× (DS → Claude). Design for <1% escalation to human.
ModeledAutonomous door
W
Workload volume. Jobs per day processed autonomously. Throughput limit: Tmax = Budget / Cjob. Double the budget, double the capacity.
ControlledBudget ceiling
EPM(t)
Energy price trajectory. Same multiplier as augmented. Applies to both the base job cost and the retry/escallation overhead.
ModeledOne-way horizon
Autonomous AI workforce management is call center WFM, reframed.

The equations are the same. The resource under management is the only difference.

Agentic Dynamics Concept
Workforce Management Equivalent
Shared Principle
Budget Ceiling: Tmax = Budget / Cjob
Erlang staffing: throughput from headcount
Capacity is budget-constrained, not infra-constrained
Cascade Rule: Flash → Sonnet → Opus → Human
Tiered support: L1 → L2 → L3 → supervisor
Escalate only what can't be resolved at current tier
SLA Buffer: 72-hour batch horizon
AHT + service level targets
Queue depth × avg completion time = SLA window
First-Pass Rule: WOC = 1/(1+r)
First-call resolution rate (FCR)
First-attempt success is the primary quality metric
Batch Discount: 50% cheaper deferred
Back-office batch processing
Cost of immediacy: cheaper to wait
ECONOMICS / COST MODEL

One equation. Every cost driver.
Any scenario. Your numbers.

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.

Augmented Workforce (Rules 1–5)c(t) = C₀×EPM(t)×(1+β·v·t)
C(N,v) = C₀×EPM(N)×[N+β·v·N(N−1)/2]
CostPerOutcome = C(K/P, v)/K
Cmo = E×C₀×EPM(N)×[N+β·v·N(N−1)/2]Controls: C₀ / P / β / v / EPM
Autonomous Workloads (Rules 6–9)Cjob = C₀×EPM×(1−b×0.5)×(1+r×Eₔ)
Cauto = W×Cjob
Tmax = Budget/Cjob · WOC=1/(1+r)
Example: r=0.115→WOC=0.90 · Eₔ=28.2×Controls: C₀ / b / r / Eₔ / W
Business Value Index (Rule 10)BVI = WOC/(Cjob+H/W)
= successful outcomes per total dollar
Ctotal = Caugmented+Cautonomous+HControls: WOC / Cjob / H / W
Projection: 3 yr 10 yr 25 yr |EPM: Baseline DS Scenarios |View: Cost Throughput

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).

—
DS Monthly Cost
Use calculator above — β·v·N² depends on your inputs
—
Claude Monthly Cost
Use calculator above — same team, same output
1.6%
EPM Annual Rate
IEA baseline projection
2.5%
Aggressive Scenario
Toggle on chart to compare
~667K
Max Jobs/Day
$10K budget, $0.015/job (no retry/batch)
90%
Example WOC Ratio
Scenario: 1/(1+0.115)
SCENARIO / INTERACTIVE WORKBENCH

Turn the equation into
your quarterly budget.

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.

CONTROL / POLICY BOUNDARIES

Test reversible choices.
Model durable commitments.

Two-Way Doors

Decisions affecting C₀ alone. Reversible. Switch back anytime. Preserves your runway.

  • Switching models per task type
  • Toggling Silent Inference mode
  • Adjusting token limits or caching

One-Way Doors

Decisions affecting β, v, or EPM. Compound through N².

  • Selecting provider default architecture
  • Multi-year reserved instances
  • Building proprietary agentic frameworks

Autonomous Doors

Decisions affecting batch routing, escalation chains, and SLA windows. Commit your autonomous workforce architecture for years.

  • Batch vs on-demand workstream split
  • Escalation cascade design (which model when)
  • First-pass targets and retry budgets
policy = a factor level / armRouting architecture appears two-way but becomes one-way at scale – your distribution locks you into provider model availability.

30-day implementation:

Classify tasks by complexity.
Default-route constrained tasks to silent models.
Establish verification gates and escalation paths.
Instrument cost metrics. Use CostPerOutcome as your primary KPI.
POLICY / RULE STATUS

Ten rules, three statuses.

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.

[M] instrumented

1. Grit (Ground-Truth Integrity)

Default to models that keep correctness under degraded input.

Source and limits

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.

inputs [M] · premise measured
[M] instrumented

2. Explanation Tax (ε)

Measure what resilience costs — flail rate and narration penalty.

Source and limits

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.

inputs [M] · premise measured
[M] instrumented

5. First-Pass Rule

Price the accepted outcome, not the prompt; derive first-pass from the attempt ledger.

Source and limits

Inputs: attempt number, acceptance, independent evaluator ([M]). Evidence class [C]. Limitation: needs per-task/per-model coverage. Next test: coverage-corrected routing.

inputs [M] · premise measured
[C] proposed

3. Snowball Rule (N²)

Codebase growth compounds quadratically; β is calibrated, not measured.

Source and limits

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.

modeled — not run as an arm
[C] proposed

4. EPM Horizon

Energy prices inflate compute; EPM(t) is externally calibrated.

Source and limits

Inputs: IEA projections ([X]), rate r ([P]). Evidence class [X]/[P]. Limitation: external scenario, not a corpus outcome. Next test: energy-measured campaign.

modeled — not run as an arm
[C] proposed

6. Batch Discount

Deferred batch work is cheaper (50%) with a 72-hour horizon.

Source and limits

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.

modeled — not run as an arm
[C] proposed

7. Budget Ceiling

Throughput = Budget / (cost per job × (1 + retry)).

Source and limits

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.

modeled — not run as an arm
[C] proposed

8. Cascade Rule

Failures auto-escalate through model tiers; design for <1% human escalation.

Source and limits

Inputs: price ratios ([X]), escalation design ([P]). Evidence class [X]/[P]. Limitation: cascade experiments not yet executed. Next test: escalation arm.

modeled — not run as an arm
[C] proposed

9. SLA Buffer

Completion time = queue × job time + retry buffer; never batch under 2× queue depth.

Source and limits

Inputs: queue theory ([P]), retry buffer ([P]). Evidence class [P]. Limitation: modeled from WFM, not measured. Next test: live queue-depth validation.

modeled — not run as an arm
[C] proposed

10. Outcome Multiplier

Maximize outcomes per dollar (BVI = outcomes / total cost).

Source and limits

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.

modeled — not run as an arm

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.

POLICY / PROPOSED CONTROL RULES

Turn observed patterns into
policy arms to test.

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.

Selection and verification

Choose for resilience, explanation overhead, and working outcomes.

1
Grit (Ground-Truth Integrity). Default to models that maintain correctness when given degraded, contradictory, or incomplete instructions. If a model flails under perturbation — producing zero code despite high token output — it has low Grit. Don't use it for unsupervised work. The 10 perturbation operators measure Grit across three perturbation classes: specification corruption, objective mutation, and process perturbation.Concept: Grit (Ground-Truth Integrity) · Lever: C₀
2
The Explanation Tax. Rule 1 selects models that CAN code under degraded input. Rule 2 measures what their resilience COSTS — the flail rate (sessions producing zero code) and narration penalty (overhead on successful sessions). Measured: Claude 11% flail, 8% penalty. DeepSeek 8% flail, 0.0% penalty. For auditable work, the tax is insurance. For routine tasks, it's waste.Concept: Explanation Tax · Lever: ε
5
The First-Pass Rule. Price the accepted outcome, not the prompt. A cheaper model can lose its price advantage through failed verification, retries, and escalation. Derive first-pass quality from attempt number, acceptance, and an independent evaluator; then track it by task type, model, policy, and time window. Do not substitute a narrated report failure rate for an attempt-ledger measurement.Concept: Cost-Per-Accepted-Outcome / First-Pass · Lever: P, retry rate

Compounding economics

Model codebase, energy, and outcome effects before they become architecture.

3
The Snowball Rule. Your codebase grows with every session. Each new line of generated code increases the context window for every future session. This isn't additive – it's quadratic. The more you build, the more each subsequent build costs. Measured: story cost roughly doubles across the five-session arc ($0.16 → $0.34, a 2.13× Snowball). The β term compounds per-session — model the curve before you commit to an architecture. This is a one-way door.Concept: Snowball Effect (N²) · Lever: β, v · Formula: C(N,v) = C₀ × EPM(N) × [N + β·v·N(N−1)/2]
4
The EPM Horizon Rule. Energy costs are the inflation rate of AI compute. Local energy markets – not global averages – determine your long-term prices. A team in Texas (ERCOT grid) faces different EPM growth than one in Frankfurt (ENTSO-E) or Singapore. Find the year your geographic energy costs flip your model selection. Hedge before that point. EPM(t) = 1.00 + r(t−2024) where r depends on your region.Concept: EPM Horizon · Lever: EPM(t)
10
The Outcome Multiplier. The goal isn't to minimize cost – it's to maximize outcomes per dollar. Business Value Index = Total Successful Outcomes / Total AI + Human Cost. A 2× BVI means twice the work for the same cost. A 10× BVI unlocks new business models. ExtensionConcept: Business Value · Lever: BVI

Autonomous operations

Bound batch, budget, escalation, and SLA behavior.

6
The Batch Discount. Batch processing is 50% cheaper but has a 72-hour horizon. If your task doesn't need a response in <4 hours, run in batch. Monitor queue depth. ExtensionModeledConcept: Batch Economics · Lever: b, Q
7
The Budget Ceiling. Your maximum throughput is set by your budget, not your infrastructure. Max jobs/day = Budget / (Cost per job × (1 + retry_rate)). Double your budget, double your capacity – zero hiring required. ExtensionModeledConcept: Throughput Cap · Lever: W (jobs/day)
8
The Cascade Rule. In autonomous workloads, failures auto-escalate through model tiers: Flash → Sonnet → Opus → Human. A 1% escalation to human review can double your total cost. Design for <1% escalation. ExtensionModeledConcept: Auto-Escalation · Lever: Eₔ (28.2× price ratio: DS → GPT-5.6)
9
The SLA Buffer. Actual batch completion time = (Queue_length × Avg_job_time) + (Retry_buffer × retry_rate). Never batch jobs with an SLA less than 2× your observed queue depth. Always have an on-demand fallback. ExtensionModeledConcept: Batch SLA · Lever: Slack Buffer

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.

CONTROL / CANDIDATE POLICY ARMS

Map provider choices to
cost and verification hypotheses.

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.

RULES 1+2Three-layer caching

Rule 1 (Grit) + Rule 2 (Explanation Tax)

RULES 1+5Model routing cascade

Rule 1 (Silent Inference) + Rule 5 (First-Pass)

RULES 5+7Budget enforcement

Rule 5 (First-Pass) + Rule 7 (Budget Ceiling)

RULES 6+9Batch scheduling

Rule 6 (Batch Discount) + Rule 9 (SLA Buffer)

RULES 8+10Escalation cascade

Rule 8 (Cascade Rule) + Rule 10 (Outcome Multiplier)

Per-Token Pricing (per 1M tokens)

ProviderInput (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).

Cache Strategy

Three-layer caching turns the provider economics in your favor. Each layer compounds on the one below.

Layer 1
Gateway Exact-Match. Return cached responses for identical prompts within TTL. Zero token cost. 80–95% savings on repeated prompts.
Layer 2
Provider Prefix Cache. Structure prompts so repeated prefixes hit the provider-side disk cache (DeepSeek, Anthropic). 50–90% savings on input tokens.
Layer 3
Semantic Cache. Match semantically similar prompts with a threshold (embedding cosine similarity ≥ 0.97). 20–60% savings on similar-but-not-identical prompts.
Critical rule: Static content before dynamic content — one dynamic field in the wrong position invalidates the prefix cache. Place system prompts, tool definitions, and static instructions first. Append user input last.
Two-Way Door
Cache Write vs Read. Cache writes preserve context but cost $3.75/Mtok (Anthropic). Cache reads retrieve context at $0.14/Mtok (DeepSeek). Measure your cache hit rate. If under 50%, switch to cache-read mode. If over 80%, cache-write pays for itself. Toggle per workstream.

Simulated Model Routing

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.

Routing chain: request → task classifier → computed default model → verification gate → escalate-on-margin
60–80% of requests are simple (classification, formatting, lookup). These should never touch a frontier model.
Tier 1 · Simple
~60% of volume. DeepSeek V3 / GPT-4o-mini / Claude Haiku. Classification, extraction, formatting, lookup.
Tier 2 · Moderate
~25% of volume. DeepSeek R1 / GPT-4o / Claude Sonnet. Code generation, structured reasoning, analysis.
Tier 3 · Complex
~15% of volume. GPT-5.6 / Claude Opus. Multi-step architecture, novel problem solving.

Budget Enforcement

Hard caps prevent runaway costs. These tools enforce limits at the gateway layer.

tokencap
Token-based rate limiting per key, per model, per time window. tokencap --key sk-xxx --limit 1M --window 1h --model gpt-5.6
token-limiter
Enforce max tokens per request. Reject before the provider sees it. token-limiter --model gpt-5.6 --max-input 128000 --max-output 16384
agentbudget
Per-agent cost ceilings with automatic escalation to human review. agentbudget --agent coding-agent --daily-cap $5.00 --on-exceed escalate

Per-Provider Reference Cards

DeepSeek

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.

OpenAI (Luna)

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.

Anthropic (Sonnet 5)

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.

Escalation Economics

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.

Key metrics from 215 stories

Escalation multiplier (Eₔ)50× (Luna → Sonnet 5)
Test coverage gap17× (7 vs 122 tests/cell)
Sonnet vs DeepSeek gap30× ($4.78 vs $0.16 per session)

Cost per escalation tier

Tier 1 (Luna)~$0.09
Tier 2 (DeepSeek)~$0.16
Tier 3 (Sonnet 5)~$4.78
Verification depth7 → 122 tests/story
The takeaway: The cascade doesn't just save money — it buys verification where it matters. Route the happy path to Luna, the refactor-heavy work to DeepSeek, and reserve Sonnet for the safety-critical edge cases that would cost more to miss than to test.
EVIDENCE / MODEL CARDS

Narration flail rates 6–50% across models.
See detailed model profiles →

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.

Policy is an arm, not an endpoint.Choose one variable, run the next grid, and let measured information revise the campaign.
Calculate Your Costs →