Kleene: a relational calculus for language-model computation
Status: engineering write-up for the M0–M7 implementation. Section 3 is
the deterministic test suite (scripted providers, code oracles, replay
fixtures). Section 4 is the first run of the four shipped packs against a
real model (Claude Opus 5.5, 27 September 2026); the per-task rows are
plots/evals.csv.
1. Claim
An agent’s work can be written as queries. Retrieval is a scan or a grep
table function, judgement is a boolean call function in a WHERE, delegation
is a lateral table call that opens a child session, search is a recursive CTE
with a beam LIMIT, and the answer is a relation. Once the work is a query,
three things fall out that a tool-calling loop cannot offer:
- A planner. Call predicates have a cost the optimizer can see, so join
order, conjunct order, semi-joins for
EXISTS, cascades through cheap proxies and beam-limited recursion are rewrite rules with a cost model, not prompt engineering.EXPLAINshows the estimate before the spend. - Budgets as query semantics. Calls, tokens, dollars, depth and wall
clock are dimensions of a
Budgetinherited and sliced by child sessions; a statement whose estimate exceeds what is left is refused with its plan. - Learning as tables. What the harness learns (playbook SQL, ratings, generator dials, sampled selectivities) is rows in DuckDB, inspectable, replay-gated and revertible.
2. The algebra
Ordinary operators (σ, π, ⋈, ∪, γ, μ) plus a call kind on any operator that
evaluates a call expression: λ_f (scalar map-call, one call per distinct
input), κ_g (expand-call, LATERAL g(...), output cardinality the branching
factor), ρ_d (rlm / spawn, the child’s whole plan), and σ_llm / ⋈_llm
(predicates containing calls). Cost is calls × per-alias tokens and dollars;
selectivity comes from observed pass rates once a predicate has been seen.
The eight rewrite rules of the plan are implemented: cheap-first over filters
and join conditions, memo dedupe, batching (a prompt function answers up to n
distinct tuples per call, 20 unless BATCH n says otherwise, priced as
ceil(rows / n) calls),
cascade, semi-join, beam-limited recursion, join ordering with
branch-and-bound over relation subsets, and volatility fences. Estimates mirror the executor’s left-to-right
short-circuit evaluation, so cheap-first is visible in the numbers rather
than assumed.
The complexity fragment of every statement is reported (CQ / FO / REC) as a badge; it is a reminder that a recursive call plan is a program, not a lookup.
3. What was measured, deterministically
| Property | Test | Result |
|---|---|---|
| Relational core equals DuckDB | property-based differential suite | passes, recursive CTEs included |
| Join ordering with two call predicates over three relations | estimate and actual calls against a counting sink | as written 12,000 estimated calls / chosen 60; actual ≥10× fewer with identical rows |
| Plan-space growth | seven-way join | 665,280 bushy orders priced through 1,623 subset splits (309 pruned) |
| Cascade | proxy at 0.1× cost, thresholds (0.2, 0.8) | 100 proxy + 60 oracle calls beat 100 oracle calls by estimate; on data the oracle is asked only for the band (5 of 20) |
| Beam recursion | expand × 4, three rounds | 20 calls with beam 5 against >100 unbounded |
| Continual loop | scripted solver over generated puzzles | tasks solved, playbook v1 adopted after a replay eval, ratings and dial move, restart resumes |
| Terminal-Bench-style pack | shell tasks from SQL | write_file and lines tasks solved, oracles run in fresh workspaces |
| Plain-agent baseline | same provider, JSON actions | tool call then final; the control for cost parity |
4. What the benchmarks measured
The four shipped packs ran once each under the three modes of
docs/BENCHMARKS.md on 27 September 2026, with the default
routing: root on claude-opus-5-5 at high effort, worker and judge on
claude-sonnet-5, proxy on claude-haiku-4-5, priced at the list rates
in the router. The per-task rows (kleene bench csv) are plots/evals.csv
and the table is kleene bench report (plots/report.txt) over the store
those runs left; the model replies were recorded but are not checked in,
because the catalog issue below means they cannot replay the runs yet.
dollars is the
pack total, calls and tokens are per task, and the learning column
excludes the gate replays (below).
| pack | mode | solved | calls / task | tokens / task | dollars |
|---|---|---|---|---|---|
| terminal (6) | frozen | 6/6 | 2.17 | 10,551 | 0.07 |
| terminal (6) | learning | 6/6 | 1.33 | 6,742 | 0.04 |
| terminal (6) | plain | 6/6 | 2.50 | 2,395 | 0.03 |
| oolong-like (20) | frozen | 20/20 | 4.90 | 30,778 | 1.51 |
| oolong-like (20) | learning | 20/20 | 3.85 | 41,991 | 1.92 |
| oolong-like (20) | plain | 20/20 | 1.00 | 3,084 | 0.39 |
| finance-synthetic (20) | frozen | 20/20 | 3.45 | 42,177 | 0.83 |
| finance-synthetic (20) | learning | 20/20 | 2.40 | 29,999 | 0.63 |
| finance-synthetic (20) | plain | 20/20 | 1.00 | 1,244 | 0.07 |
| legal-synthetic (20) | frozen | 20/20 | 12.65 | 62,452 | 1.69 |
| legal-synthetic (20) | learning | 20/20 | 10.60 | 58,315 | 2.61 |
| legal-synthetic (20) | plain | 20/20 | 1.00 | 1,475 | 0.11 |
What the numbers say, read with the caveats of
docs/BENCHMARKS.md:
- Accuracy is saturated. Opus 5.5 solves every task of every pack in every mode. The packs were sized for a weaker model and a dial of 0.5; they separate nothing on accuracy, so the comparison below is on calls and dollars only. Harder dials, longer contexts and real datasets are the next step.
- The playbook cuts calls per task. Learning against frozen: terminal 2.17 to 1.33, oolong 4.90 to 3.85, finance 3.45 to 2.40, legal 12.65 to 10.60. On oolong the second half of the learning run took 3.9 calls per task where the first half took 3.8, so most of the gain arrived with the first adopted entries; on legal the halves are 13.7 and 7.5, the curve the design predicts. Only oolong (16 of 20 candidates) and legal (5 of 21) adopted anything: on terminal and finance every candidate was rejected by the gate because its replay cost more than the baseline’s, so their learning runs are frozen runs with ratings on, and the call reduction there is run-to-run variance, not learning.
- The gate is the cost. Each candidate is replayed on three earlier
tasks in both arms, six task runs per solved task. Those replays are
recorded in
playbook_evals, notevals: they cost $1.25 on terminal, $10.70 on oolong, $5.46 on finance and $16.63 on legal against $0.04, $1.92, $0.63 and $2.61 for the counted runs. At twenty tasks a pack the gate spends far more than the playbook saves; it earns its keep only over a long stream, and a cheaper gate (a smaller sample, a proxy model, a cached baseline) is the obvious next change. - The plain agent wins on cost here. Every context in these packs fits in one prompt (under 4,000 characters), so the tool-calling baseline answers in one call with no tool use: $0.39 against $1.51 on oolong, $0.07 against $0.83 on finance, $0.11 against $1.69 on legal. The SQL abstraction pays for a catalog, a planner and a transcript of rendered results on every turn, and at this scale that is pure overhead. The claim of section 1 is about work that does not fit in one call; these packs do not test it, and the numbers say so.
- Per-clause calls are cheap and visible. On legal, the model classified
clause by clause with a prompt function on the
workeralias (up to 26 calls a task at about $0.10), which is the λ_f map-call of section 2 doing what it is for: many small calls on a cheap model, priced before they run. - Costs drift up within a run. Per-task dollars on oolong learning rose from $0.084 in the first half to $0.107 in the second while calls stayed flat. Two things grow the prompt: the adopted playbook entries, and the scratch tables every session creates in the shared store, which the catalog lists to every later session (287 such tables after these runs). The second was a bug: it also changed the prompt fingerprint from task to task, so a recorded run could not be replayed from its own fixtures. Bench sessions now drop their tables when they finish, so later runs do not carry it.
The other measurements of the design are in place but not yet exercised by
these runs: transfer (learn on a prefix with --limit, then run the rest
frozen), reverts (learn playbook), and the estimate and plan-space plots,
which read trace_statements and were empty because these runs were made
before bench run traced statements (it does now).
Packs shipped: tasks/terminal (Terminal-Bench-style), tasks/oolong-like
(frozen corpus stream), tasks/finance-synthetic (frozen statements
stream), tasks/legal-synthetic (frozen contracts stream). Harvey LAB
imports through bench import-lab from a checkout; LAB’s evaluation.run_eval
stays the scorer of record and the in-loop judge oracle approximates it.
The external datasets themselves (OOLONG, Terminal-Bench, FinanceBench,
CUAD, LAB) are not redistributed here. A coding pack (edit code in a
workspace, judged by its tests) is the next pack to add.
4.1 Haiku 4.5 on the harder packs
The harder packs (tasks/coding, tasks/memo-rubric, tasks/logbook-hard)
ran on 1 October 2026 with every solver alias (root, worker, proxy)
on claude-haiku-4-5-20251001 and the judge alias on claude-sonnet-5-5
(the router file is plots/haiku-2026-10-01/router.toml). The sweep was
stopped before it finished; the table is what completed. Rows and report
are plots/haiku-2026-10-01/evals.csv and report.txt, the SVGs beside
them. Columns as in the table above.
| pack | mode | solved | calls / task | tokens / task | dollars |
|---|---|---|---|---|---|
| coding (12) | frozen | 2/12 | 4.58 | 48,375 | 0.87 |
| coding (12) | learning | 2/12 | 2.67 | 29,910 | 0.47 |
| memo-rubric (20) | frozen | 8/20 | 19.95 | 49,043 | 1.30 |
| memo-rubric (20) | learning | 11/20 | 3.80 | 23,041 | 0.37 |
| memo-rubric (20) | plain | 8/20 | 3.15 | 10,764 | 0.35 |
Not in the table: logbook-hard in any mode (a frozen task took about
500 calls and over twenty minutes at Haiku’s pace, so the pack was capped
at ten tasks and then stopped before the first row landed), and coding
in plain mode (below). The gate replays, in playbook_evals, cost $1.43
on memo-rubric (11 candidates, 3 adopted) and $1.04 on coding (2
candidates, 1 adopted); the counted runs cost $3.36 in all.
What the numbers say:
- These packs separate on accuracy. Where Opus 5.5 solved every task
of the first four packs, Haiku solves 17% of the coding steps and 40 to
55% of the memos. The coding steps it solves are the first step of an
episode (
ledger-1-parse,inventory-1-stock); it solved no “extend” or “fix the bug report” step in either Kleene mode. - Learning beat frozen on memo-rubric, on both axes. 11/20 against
8/20, at 3.8 calls a task against 19.95 and $0.37 against $1.30. Two
effects are mixed in. Three playbook entries were adopted and the
second half of the learning run solved 5 of 10 where the frozen run’s
first half solved 3 of 10. But most of the frozen run’s calls are a
failure mode the playbook happens to steer around: Haiku writes
LLM_JSONoutput schemas the API rejects (additionalPropertiesnot set,minItemsabove 1, a bare{"hours": "number"}), and the statement retries until the call budget goes; five frozen tasks took 22 to 141 calls each. The adapter now rewrites a model-written schema into the accepted subset before the request (bare field maps, missingadditionalProperties,minItemsabove 1), which would have removed most of that cost; these runs predate it. - Learning and frozen share the store’s memo. The learning run comes second in the same store, so a prompt identical to one the frozen run sent is answered from the memo for free. Two coding steps in the learning run finished with zero calls: they replayed the frozen run’s failed answers. The learning column’s calls and dollars are therefore not an independent measurement; a clean comparison needs a fresh store per mode, or the memo excluded from the gate’s cost accounting.
- The plain baseline needs a protocol Haiku keeps. The agent asks for
one JSON action per reply. Haiku answers with five to ten actions and
invented tool output between them; the first extractor took the span
from the first
{to the last}, which never parsed, so on every coding task the model saw only “not a single JSON object” and gave up with a FINAL after two turns (0/12 at $0.45). The extractor now takes the first balanced object and runs it. With that, Haiku worked through the first coding task for all 30 turns without solving it ($1.11), and the rerun was stopped before a row landed. On memo-rubric, where the task fits in one call, the plain agent matches frozen on accuracy at a quarter of the cost, and learning beats it by three tasks for the same money. - The judge wobbles. Sonnet 5.5’s first lines included “PASS (with caveat)”, “PASS (provisional)” and “PASS or FAIL?”; the parser counted all of them as passes. It now requires a first line that says PASS and does not mention FAIL. The memo frozen and learning runs predate that change; the plain run does not.
- Two provider facts. Haiku rejects
output_config.effort, which the adapter sent along with the rest of the family; the default routing putsproxyon Haiku at low effort, so every proxy call failed until the adapter learned to omit it. Andclaude-sonnet-5-5is served now (it was not on 27 September).
4.1.1 Haiku 4.5, the remaining cells (6 October 2026)
The cells the October 1 sweep left empty ran on 6 October 2026 with the
same routing (plots/haiku-2026-10-06/router.toml), one fresh store per
pack and mode, after two adapter changes: the conversation is now cached
turn by turn (a breakpoint on the last message, not only the system
prefix), and the structured-output schema drops maxItems, which the API
rejects and every batched LLM_JSON call used to set. Rows and report
are plots/haiku-2026-10-06/evals.csv and report.txt.
| pack | mode | solved | calls / task | tokens / task | dollars |
|---|---|---|---|---|---|
| oolong-like (20) | frozen | 14/20 | 50.40 | 53,217 | 0.75 |
| oolong-like (20) | learning | 19/20 | 1.95 | 9,115 | 0.20 |
| oolong-like (20) | plain | 20/20 | 4.15 | 24,932 | 0.49 |
| finance-synthetic (20) | frozen | 20/20 | 7.25 | 30,274 | 0.43 |
| finance-synthetic (20) | learning | 19/20 | 7.60 | 18,963 | 0.29 |
| finance-synthetic (20) | plain | 20/20 | 1.65 | 5,375 | 0.13 |
| legal-synthetic (20) | frozen | 14/20 | 43.50 | 48,594 | 0.72 |
| legal-synthetic (20) | learning | 17/20 | 9.95 | 16,541 | 0.29 |
| legal-synthetic (20) | plain | 15/20 | 1.85 | 6,227 | 0.16 |
| terminal (6) | frozen | 6/6 | 3.00 | 11,190 | 0.07 |
| terminal (6) | learning | 6/6 | 2.17 | 8,159 | 0.05 |
| terminal (6) | plain | 6/6 | 2.50 | 7,286 | 0.05 |
| coding (12) | plain | 4/12 | 28.58 | 218,019 | 0.78 |
| logbook-hard (10) | frozen | 1/10 | 1,702.10 | 476,213 | 5.13 |
| logbook-hard (10) | learning | 1/10 | 1,694.40 | 591,443 | 5.95 |
| logbook-hard (10) | plain | 2/10 | 22.20 | 1,365,343 | 4.58 |
The counted runs cost $20.07, of which logbook-hard took $15.66; the
gate replays (62 candidates, 22 adopted) cost another $5.64. What the
numbers say:
- On the original packs Haiku is close to Luna, at ten times the price. Learning beats frozen on oolong-like (19 against 14 at 2 calls a task against 50) and legal (17 against 14 at 10 against 44), as it did for Luna; the one-call plain agent is perfect on finance and oolong-like.
- Logbook-hard is a worker-call storm. The frozen run made 79,324
workercalls of about 37 tokens each, $4.30 of its $5.13: Haiku writes a scalarllm()per row over the 30k-token log, and when it does batch, it answers with the wrong number of elements two times in three, so the harness falls back to one call per row. Two tasks took 5,000 and 8,500 calls. The root session itself was cheap (121 calls, $0.83, 1.2M tokens read from cache against 36k billed in full). This is the fallback the Luna run flagged, now with a price on it. The fix landed the same day (section 4.3): prompt functions batch 20 rows per call unless told otherwise, and a short batch answer is re-asked by item instead of one call per row. - Caching works where the prompt is long enough. Haiku’s minimum cacheable prompt is 4,096 tokens, so terminal and the per-row worker calls never cache; everywhere else the root session reads its history from cache from the third turn on.
4.2 GPT-6 Luna on the harder packs
All seven packs ran on 5 October 2026 with every solver alias on
gpt-6-luna (OpenAI, chat completions, default reasoning effort) and the
judge alias on claude-sonnet-5-5; the router file is
plots/luna-2026-10-05/router.toml. Luna is priced at $0.10 per million
input tokens and $0.50 per million output, a tenth of Haiku. Each pack
and mode ran in its own store, so the learning columns are independent
of the frozen ones this time. logbook-hard was capped at ten tasks
after the Haiku run; its learning run was stopped after three tasks,
with the second task alone taking 1,705 calls and running out of turns.
Rows and report are plots/luna-2026-10-05/evals.csv and report.txt,
the SVGs beside them.
| pack | mode | solved | calls / task | tokens / task | dollars |
|---|---|---|---|---|---|
| oolong-like (20) | frozen | 15/20 | 33.95 | 19,230 | 0.04 |
| oolong-like (20) | learning | 20/20 | 1.30 | 4,516 | 0.00 |
| oolong-like (20) | plain | 14/20 | 1.00 | 2,031 | 0.01 |
| finance-synthetic (20) | frozen | 14/20 | 4.15 | 11,789 | 0.01 |
| finance-synthetic (20) | learning | 15/20 | 3.45 | 12,081 | 0.01 |
| finance-synthetic (20) | plain | 20/20 | 1.00 | 950 | 0.00 |
| legal-synthetic (20) | frozen | 18/20 | 15.65 | 23,973 | 0.03 |
| legal-synthetic (20) | learning | 15/20 | 4.25 | 15,893 | 0.01 |
| legal-synthetic (20) | plain | 20/20 | 1.00 | 1,004 | 0.00 |
| terminal (6) | frozen | 6/6 | 1.50 | 4,128 | 0.00 |
| terminal (6) | learning | 5/6 | 1.50 | 4,219 | 0.00 |
| terminal (6) | plain | 6/6 | 2.33 | 1,584 | 0.00 |
| coding (12) | frozen | 11/12 | 12.08 | 55,286 | 0.02 |
| coding (12) | learning | 10/12 | 8.17 | 42,094 | 0.02 |
| coding (12) | plain | 9/12 | 10.25 | 27,860 | 0.03 |
| memo-rubric (20) | frozen | 8/20 | 13.60 | 36,571 | 0.03 |
| memo-rubric (20) | learning | 18/20 | 6.10 | 27,683 | 0.02 |
| memo-rubric (20) | plain | 11/20 | 1.00 | 1,978 | 0.01 |
| logbook-hard (10) | frozen | 7/10 | 247.30 | 180,736 | 0.24 |
| logbook-hard (3 of 10) | learning | 1/3 | 686.67 | 746,259 | 0.19 |
| logbook-hard (10) | plain | 3/10 | 2.30 | 97,000 | 0.07 |
The counted runs cost $0.74 of Luna in all; the playbook gate’s replays (84 candidates, 17 adopted) cost another $0.31, and the Sonnet judge’s calls are not traced, roughly a dollar at the most. What the numbers say:
-
The four original packs separate on accuracy with Luna. Opus 5.5 solved every task of these packs in every mode; Luna does not, so they measure something now. The one-call plain agent is perfect on finance and legal, where the context fits and the question is one lookup, and weakest on oolong-like (14/20), where aggregation over the whole context is the task. Learning on oolong-like solved 20/20 at 1.3 calls a task against frozen’s 15/20 at 34: the adopted playbook entry carries the aggregation query, and the rest is a lookup.
-
Luna solves what Haiku could not, for a tenth of the money. 11 of the 12 coding steps frozen against Haiku’s 2, including every “extend” and “fix the bug report” step but one; 7 of 10 logbook tasks frozen where Haiku never finished one. Each coding step cost about a fifth of a cent.
-
Learning beat frozen on memo-rubric again, now cleanly. 18/20 against 8/20 at 6.1 calls a task against 13.6, in separate stores, so no memo replay is hiding in the learning column. Four memo entries were adopted out of 18 candidates; both halves of the learning run solved 9 of 10, so the gap to frozen is there from the start and is mostly the shorter route the playbook gives. On coding, learning cost fewer calls (8.2 against 12.1) and lost one task.
-
Plain is the cheap mode where the context fits, and no further. On memo-rubric the one-call agent solves 11/20 for half a cent; on logbook-hard, whose contexts are around 30k tokens, it gets 3/10 and on coding 9/12 with a tool loop. Frozen beats it on every pack on accuracy.
-
Logbook-hard is where the calls go. Frozen tasks took 113 to 719 calls each, nearly all of them
workercalls from batchedLLM_JSONextraction over the log; Luna sometimes answers a batch of 20 with the wrong number of elements, and the harness then retries one call per row. Learning was worse, not better: the one task it finished past the first took 1,705 calls and no FINAL. The per-row fallback is the next thing to fix on this pack, for any model. -
Three provider facts, all now in the adapter. OpenAI rejects
max_tokensfor every GPT-5 and GPT-6 model (the adapter sendsmax_completion_tokensto api.openai.com); strict structured outputs want an object root with every property required andadditionalProperties: false(an array or scalar schema is wrapped and unwrapped); and a model-written schema with a typeless property or a partialrequiredlist is rejected outright, so the adapter completes it. Before those fixes a Luna run could not make a singleLLM_JSONcall.
4.3 Opus 5.5 on the harder packs (6 and 10 October 2026)
The three hard packs Opus 5.5 had not run yet, in all three modes, with
the routing of the 27 September run (root on Opus 5.5 at high effort,
worker and judge on Sonnet 5.5, proxy on Haiku 4.5;
plots/opus-2026-10-06/router.toml), one fresh store per pack and mode,
the conversation cached and prompt functions batched by default. Rows
and report are plots/opus-2026-10-06/evals.csv and report.txt.
Coding and memo-rubric ran on 6 October; logbook-hard, capped at ten
tasks like the Haiku and Luna runs, on 10 October from the same router
file, with its own plots and console under
plots/opus-2026-10-06/logbook-hard/.
| pack | mode | solved | calls / task | tokens / task | dollars |
|---|---|---|---|---|---|
| coding (12) | frozen | 12/12 | 8.58 | 76,533 | 1.31 |
| coding (12) | learning | 12/12 | 8.00 | 88,984 | 1.70 |
| coding (12) | plain | 12/12 | 9.42 | 68,156 | 1.32 |
| memo-rubric (20) | frozen | 10/20 | 5.30 | 40,086 | 1.26 |
| memo-rubric (20) | learning | 4/20 | 5.35 | 44,064 | 1.24 |
| memo-rubric (20) | plain | 10/20 | 1.00 | 5,763 | 0.55 |
| logbook-hard (10) | frozen | 10/10 | 8.50 | 79,296 | 1.45 |
| logbook-hard (10) | learning | 10/10 | 6.70 | 66,997 | 1.43 |
| logbook-hard (10) | plain | 5/10 | 11.90 | 801,803 | 14.82 |
The counted runs cost $25.08, $17.70 of it on logbook-hard and $14.82 of that on its plain run; the gate replays (26 candidates, 13 adopted) cost another $10.63, $7.67 of it on coding alone, so a learning run of coding costs five times what its rows show, while on logbook-hard the gate added $1.41 (10 candidates, 5 adopted, 6 replays). What the numbers say:
- Coding is saturated for Opus, as the original packs were. Every task in every mode, where Luna solved 11, 10 and 9 and Haiku 2, 2 and 4. The three modes cost the same within a few cents, so the pack no longer separates modes at this model size.
- Memo-rubric is the one pack where Opus is behind Luna. Half the tasks in frozen and plain against Luna’s 8 and 11, and learning mode made it worse: the adopted playbook entries pulled Opus from 10 to 4 solved at the same cost. Luna’s learning run on the same pack went the other way (8 to 18). The rubric judge is Sonnet 5.5 in both runs, so the difference is in what the models write, not in how it is scored.
- Logbook-hard is where the SQL abstraction pays for itself. Opus
solves all ten tasks in frozen and learning mode at 8.5 and 6.7 root
calls a task and about $0.14 each, with no worker calls at all: it
reads the 30k-token log through
ctxand aggregates in SQL rather than extracting withLLM_JSON, where Haiku made some 1,700 worker calls a task and solved one. The plain agent on the same model solves five of ten for ten times the money: three tasks ran out of their thirty turns at over $3 each, and every turn re-sends the log, so a task averages 800k tokens against 79k. Frozen beats plain on this pack with every model that ran it (Luna 7/10 to 3/10, Opus 10/10 to 5/10); only Haiku, which could not finish the SQL route, is the exception. - The caching and batching changes hold at Opus prices. Learning coding read 5.0M tokens from cache against 30k billed in full; the batched prompt functions kept the worker side to a few hundred calls per run, where the Haiku logbook-hard runs made tens of thousands, and Opus on logbook-hard needed none.
5. Honest gaps
- One run per pack and mode. Opus 5.5 solved every task of the first four packs, so section 4 compares cost there; the harder packs of section 4.1 separate on accuracy with Haiku 4.5, but only two of the three finished, and the learning column shares the frozen run’s memo.
- Session scratch tables persist in the shared store and appear in every later session’s catalog, which grows prompts over a run and breaks replaying a recorded run from its own fixtures.
- The replay gate costs six task runs per solved task and dominates the cost of a learning run at pack scale.
- Threshold calibration from a sample is not built; thresholds are declared.
- The learned cost model persists only in-session (sampled selectivity), not as versioned tables.
- The
plainbaseline now uses native tool calling (everytool_useblock of a reply runs, the answer comes through afinaltool) and the coding pack’s tasks carry acheckthat refuses aFINALwhilepython3 -m unittest -qfails; the Haiku 4.5 numbers in section 4.1 predate both and have not been rerun. - Output schemas the model writes for
llm_jsonare rewritten into the provider’s accepted subset, but only the shapes seen so far (field maps, open objects,minItems); a schema outside that still fails the call.
6. Reproduce
cargo test --workspace --all-features # every claim in section 3
cargo run -- repl < demos/planner/three_way.sql # the plan space, live
cargo run -- learn run --tasks 20 --generators puzzle,corpus
cargo run -- bench run tasks/terminal --mode frozen --record fixtures/terminal
cargo run -- bench run tasks/terminal --mode plain --record fixtures/terminal-plain
cargo run -- bench report
cargo run -- bench plot plots/
The runs of section 4 are plots/evals.csv and plots/report.txt, with
the SVGs bench plot drew from the same store beside them. fixtures/ is
ignored by git: record your own with --record, and replay with --replay
once the catalog caveat in section 5 is fixed.