Skip to content

A design-rationale task set runs on request - #255

Merged
zlareb1 merged 41 commits into
mainfrom
feat/bench-design-rationale
Nov 4, 2026
Merged

zlareb1 merged 41 commits into
mainfrom
feat/bench-design-rationale

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

A design-rationale benchmark (python -m bench.design_rationale) measures whether decisions served from design documents keep a coding agent from re-proposing rejected options and whether its "why" answers are correct, cited and current, over a task set read from a directory.

Why

Decisions mined from design documents reach agents through the pre-edit block and loom_search, but nothing measures whether they change what an agent does. This harness answers that with six arms on the same tasks: no design knowledge (0), the whole document through knowledge.get (1), the document as knowledge through loom_search (2), hand-written gold rows through the pre-edit block and the loom_search memory section (3), and the rows loom decisions extract mines from the documents, or that a document source's sync wrote, through the same surfaces (4), and the gold rows through the loom_search memory section only (5), added whenever arm 4 has no files so that it is compared like for like.

The task set the numbers will come from is private, so the harness never reads one from the repository: it takes a directory with tasks.json, gold_rows.json, documents.json and the documents (schema in bench/design_rationale/README.md). The repository ships only a synthetic set about an invented service, which the unit tests run end to end.

An extracted row names code by its names, and the harness's own Loom has no code index (and an arm's org must not share one with another arm), so loom decisions extract --repo cannot link the rows there. With --code-index (the Loom that indexes the repository, its org and namespace) the harness resolves each kept row's code names with read-only code.symbol calls under the extractor's own rule (one defining file that is not a test or a page, server.memory.domain.decision_extract) and writes the files on the row as a new version under the extractor's identity, every other field kept; arm 4 then reaches the pre-edit block as arm 3 does. Without --code-index (and without --arm4-namespace), arm 4 reads no pre-edit block and is served through loom_search only, and arm 5 (gold rows through loom_search only) is added, so the 4-versus-5 comparison is like for like. With --arm4-namespace the sync's rows keep the files it linked and arm 4 is compared with arm 3. Writing files on an extracted row keeps every other field it reads back (source trace and entities included) and the paths the decision record's reasoning spells out, which the extractor also links (the row's own files and the quote cannot be read back). A code index that does not answer for a name is counted in the treatment check, which reports, per arm, the tasks whose pre-edit block and whose search section served a row; without files, arm 4's pre-edit line and its comparison with arm 3 are left out of the report. A namespace given with --arm4-namespace is read in --org itself and is the exception to the run's isolation: the harness neither registers nor erases it, and its server spend is not read back.

What it measures, per task kind:

  • A, why questions: argument-level precision and recall against the gold arguments, and the share of answers a judge flags as potentially misleading. Every judge reads the task's gold and the text the answer's citations resolve to, never the arm's surface, so all arms are judged alike; the abstention sentence alone never makes an answer misleading, and the points after it are judged by the same rules.
  • B, change tasks where the obvious change is a rejected option: avoidance (deterministic diff detectors first, a judge for the rest) and design satisfaction (no gold constraint broken), plus push-back.
  • C, supersession (a statement a later revision of the document reversed) and abstention (nothing recorded): serving the stale statement as governing, or inventing a rationale, fails; whether the answer states the current design is reported beside it.
  • Citations: recall (claims with a citation whose resolved text supports them) and precision; every knowledge:<ns>/<uri>#section resolves through knowledge.get and every memory key through memory.get, and a pointer to a deleted document fails.
  • Injected tokens per task and surface (each pre-edit block planned at the whole-row ceiling for decisions, plus its 300-token budget, plus 300 tokens for the left-out line naming the decisions past the ceiling (PRE_EDIT_FIXED_TOKENS); a test renders a block at that margin and checks it fits), the largest pre-edit block, the arm 1 to arm 3 ratio; extraction precision per document and the misleading-rationale rate from a human-judged file, with the share of gold rows whose source has no extractable text; judge accuracy and kappa against a human-labelled slice.
  • Not covered: a change's test pass rate. The harness applies no patch and runs no test.
  • A judge verdict missing its kind's keys is unreadable, never a pass, and the report counts unreadable passes per arm.

Statistics: K samples per task and arm (default 4), each answer judged in both orders and twice per order (agreement between orders, repeats and judge models is reported: A on the misleading flag, B on avoidance over the answers no detector decided, C on the pass), comparisons paired per task with a bootstrap that resamples whole documents (bench/bootstrap.py), and an MDE per comparison from the run's own spread (none with a single document); the dry run prints a planning MDE per kind at an assumed spread.

Cost guard: run --dry-run prints the calls, tokens and spend, typical and with every output at its cap, without a server (with arm 4 it reads this environment's server settings for the extraction model). A real run refuses to start without --max-usd or with a model the price table does not list. Every HTTP request the provider client sends, a resend with a learned field or a raised cap included, is checked against the cap (input at three characters a token, output at the request's own cap) and its billed usage recorded. The extraction runs in the server's code, on the model the server settings name (read in-process; refused when --extract-model names another, and --offline with arm 4 needs the fake provider): its worst case is charged before each document: two calls per window the extractor reads (the server's own chunker and the extractor's own windowing, called directly; a unit test checks the count on a long document with few headings), each carrying the system prompt with the known decisions a re-run lists and the window as the extractor sends it (user_prompt, its document and section lines included), the second call also a failed-span note bounded by the output cap, each writing up to that cap; --extract-window-chars is passed to the CLI. On the private set the count is the 13 windows the earlier spot check's extraction reported. A paid run refuses an extraction on the fake model, whose decisions pass the extractor's checks by construction. The server's own model and embedding spend in the run's orgs (embeddings on every write and search; query expansion, rerank or a sampled judge when the deployment turns them on) is read back from cost.summary, from the run's first day, into the ledger after each stage over every traffic class in the run's own orgs, so a worker's cost row on the run's rows counts (the extraction CLI binds no cost accumulator, so neither its model calls nor the embeddings of its writes reach cost.summary; the ledger's estimate, model calls only, is their only record): recorded after the fact, not refused in advance. What stops the server itself is each namespace's daily cost cap, set to --max-usd at registration. An arm-4 run refuses a configured fallback model, which the estimate would not price. On the private server with the fake provider, every op the run sends recorded zero model calls.

Every run file (state, surfaces, answers, verdicts) is written through a temp file and a rename, and a ledger row cut short by an interrupt is dropped when the ledger opens (with a warning that it undercounts by one call; a whole row that lost its newline is kept), so an interrupt mid-write never breaks a resume. Resume: a run the cap stops, in its setup or later, keeps its namespaces, exits 1, prints the command that erases them, and continues on the same --out without repeating a setup step or a finished call; a resume with another --org, arm list, --arm4-namespace, code index use, window size, or reader, judge or extraction model is refused. A run that fails or is interrupted after setup (a provider error, a lost server, Ctrl-C) keeps its namespaces and prints the resume and the loom namespaces-gc command that erases them. A setup that fails or is interrupted other than by the cap is never resumed: it erases its half-filled namespaces, or with --keep-namespaces keeps them and prints the command that erases them. A finished run erases its namespaces and refuses a resume; with --keep-namespaces it keeps them, and a rerun finds every stage done. Namespaces are registered as kept so the idle gc never empties one under a resumed run; the harness erases its own.

Scope and risk

Bench code, its unit tests and docs only; no server change, no wire change, no setting. Auth: each run creates its own orgs, so it runs against a server with auth off, or with a token covering every org (loom mint-token --subject <name> --org '*' --namespaces '*' --roles writer); erasing the run's namespaces needs an org-wide admin (loom mint-token --subject sa:<name> --org '*' --platform-admin --ttl-days 1). Pass the admin token as --token to erase at the end; a writer-token run's erasure is refused, prints the loom namespaces-gc command that finishes it and leaves the run unerased, so rerunning the same command with the admin token erases it. Each arm's namespace is registered as a bench namespace in an org of its own run and role (<org>-<run prefix>-<role>) and erased at the end of the run (--keep-namespaces keeps them): a search and the cost readback read a whole org, so arms, or runs, sharing one org read each other's rows (seen on the first local run: arm 3's search served arm 4's extracted rows).

Two things found while wiring it, left for their own changes:

  • loom_search's text summary prints a knowledge hit's content_excerpt, which knowledge hits do not carry, so every knowledge line reads as a bare source URI. Arm 2 renders the knowledge hits from the structured result (source, section, chunk text) instead, and the docstring says so.
  • loom_search's repository legs now need a configured repository for X-Loom-Code-Scope, so the harness serves arms 3 and 4 as the agent's own namespace (the --into source shape) rather than through a code scope.

It uses the repository virtualenv with PYTHONPATH=$PWD, as the other harnesses under bench/ do: it reuses bench/judges.py, bench/bootstrap.py, bench/_http.py and the server's price table.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none.
  • Rollback: revert; nothing is stored.

Tests

  • tests/unit/test_bench_design_rationale.py (75 tests): the task-set loader and its refusals, every detector type (file touched, added or removed line matching a pattern, judge rubric, the one place a rubric is given; a changed default is a diff_added_regex on its declaration line), the citation parser and exact citation matching, per-pass scoring for A, B and C, unreadable verdicts, kappa, the planning MDE and no MDE on one document, extraction precision, the spend cap (a call or a provider resend that could cross it is never sent; an unpriced model is refused; the extraction model must be the server's), the extraction bound, the dry-run call counts, and the synthetic set end to end over a fake Loom, a fake code index and a fake model: gold rows never in the extraction namespace, the revised row written after the first, the revision extracted again, extracted rows given files so arm 4's pre-edit block fires, the cap as each namespace's daily cap, namespaces erased at the end and a finished run not resumed; without a code index, arm 5 added and compared; a run stopped by the cap resumed with no setup repeated and exactly the remaining answers spent; a cap below the first extraction stopping the setup and the resume finishing it without repeating a step; two runs under one --org reading neither each other's orgs nor spend; files written on a row with every field and its spelled-out paths kept; a task id with '/' refused; a supersession verdict without current_stated unreadable; a cap stop exiting 1; a fallback model refused; a paid run refusing the fake extraction model; arm 5 added by the CLI without a code index and not with one; a resume with other flags refused; an error after setup keeping the namespaces with the erase command printed; a code index that does not answer reported; section citations found by the chunker's cleaned breadcrumb (a heading with a code span, a Setext heading), by a suffix of the path only when one section fits (two sections of one title under different parents), when cut short at a backtick or a closing parenthesis, and not by words in a sentence; task ids holding "arm" scored; two knowledge pointers on one line, with or without a space between them, and a sectionless pointer followed by prose; a citation of a whole path chosen though another path ends so; the known-decision allowance covering the longest rows decision.record accepts; a resume with another reader refused; a pre-edit block counting only the rows it prints (from real render output with a decision past the whole-row ceiling and a key that prefixes another); server spend read over every traffic class; a resume with another judge or extraction model refused; the pre-edit bound covering a block at its margin (the whole-row ceiling filled, six decisions left out at the longest key the left-out line prints, facts past the budget); a failed setup not resumed even with its namespaces kept, and an interrupted setup erased and not resumed; a rerun of a finished run with its namespaces kept adding no ledger rows and erasing nothing; an A task without rejected options refused; scoring with the unfilled label sheet refused with a clear message; a ledger line cut short by an interrupt dropped on resume with a warning, and a whole row without its newline kept; a failed JSON write leaving the old file whole and no temp file; a diff read by one header rule without trusting hunk counts (an undercounted hunk before a second file, a blank context line, a second hunk in one file, +++-only headers, removed -- x and added ++ x lines); a detector missing its keys, of the wrong shape, or with a pattern that does not compile, refused; a change verdict that leaves its task's rubric unanswered unreadable; a refused erasure leaving the run unerased and the next run erasing it, with one warning per refused namespace naming its gc command; a failed setup's refused erasure retried on the next try, and a rerun with other flags refused before it erases anything; documents, gold rows and task entries missing their keys (a task without an id included), or not objects, refused, and a tasks.json that is not an object; a --tasks filter naming an unknown task refused; judge agreement leaving out change answers a detector decided, and judge accuracy against human labels leaving out labels on avoids or satisfies for those answers, and every detector_fired label; a diff fence closing only at a line start; the judge's list fields required to be lists of strings, and a document id with '/' refused; a loom_search error raised with its text; a timed-out extraction keeping both output streams; extracted and linked rows counted once across a revision's run; an interrupt after setup keeping the namespaces with the erase command printed; gold rows required on every task and the current design on a supersession task; a failed setup erased.
  • An offline run of the synthetic set (--offline, a free stub for answers and verdicts) against a private server and ClickHouse with auth off: documents ingested, gold rows written and the revised one re-pinned, loom decisions extract --apply run per document and per revision, pre-edit blocks and loom_search sections read for all six arms, citations of each kind resolved through knowledge.get and memory.get, cost.summary read per org. Treatment check, over the 7 tasks with gold rows: arm 3 pre-edit 7/7 and search 6/7, arm 5 search 6/7, arm 4 search 5/7 (no code index there, so no pre-edit block), 9 distinct rows extracted (14 key lines over the three runs, the run over the revision reporting rows again), no failed run. The record reasoning read back and the file write on a real extracted row were checked against the same server. Writing files on a real extracted row kept its agent, value, tags, confidence, source and class, and memory.for_file then served it.
  • No paid model call. Dry runs on the private set, all on gpt-6-luna (reader, judge and extractor, 0.10/0.50 USD per million tokens in/out), K = 4, one judge model, two orders, two repeats (run <set> --dry-run --reader-model gpt-6-luna --judge-model gpt-6-luna, with --code-index <url> for arms 0-4; the extraction model read from the server settings, LOOM_LLM_MODEL=gpt-6-luna). The set as it stands (10 A, 15 B, 5 documents), arms 0-4 with a code index: 500 answer calls, 2,000 judge calls and at most 26 extraction calls (13 windows, two calls each), about 2.2 USD typical and 6.7 USD with every output at its cap; without a code index (arm 5 added): 600 answers, 2,400 judge calls, about 2.6 USD typical and 8.0 USD at the caps. With 10 placeholder C tasks (10 A, 15 B, 10 C): arms 0-4 with a code index, 700 answer calls and 2,800 judge calls, about 2.8 USD typical and 9.0 USD at the caps; without a code index, 840 answers and 3,360 judge calls, about 3.3 USD typical and 10.7 USD at the caps. A second judge model doubles the judge calls at its own price.
  • make format lint typecheck, tests/unit/test_public_copy.py, test_doc_links.py, test_benchmark_publication_copy.py, test_agent_instructions.py, and the full make test-unit.
  • Docs: the harness is a "harness only" row in docs/benchmarks/coverage.md linking its README (schema, arms, running, outputs); docs/benchmarks/results.md is unchanged until a measurement exists.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code; the offline run against a private server checked the surfaces, the setup order and the citation resolution.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed.
  • Generated files are regenerated in this PR, not by hand: none affected.
  • A new migration is additive and numbered after the latest on main; no merged migration is edited. (none)
  • A behaviour change to any file a plugin ships bumps both plugin manifests' version. (none)
  • The frontend builds and its tests pass, if frontend/ changed. (unchanged)
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers.
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

🤖 Generated with Claude Code

@zlareb1
zlareb1 force-pushed the feat/bench-design-rationale branch 9 times, most recently from 0eeae0b to 3c446a4 Compare November 4, 2026 12:18
zlareb1 and others added 21 commits November 4, 2026 13:52
bench/design_rationale/ answers whether decisions served from design
documents keep a coding agent from re-proposing rejected options, and
whether its "why" answers are correct, cited and current. Five arms (no
knowledge, whole document, document through loom_search, gold rows and
extracted rows through the pre-edit block and loom_search), task kinds
A/B/C, K samples, judges in both orders and repeated, a paired bootstrap
over documents with MDEs, and a spend cap enforced from a ledger with a
dry run that prints the plan. The task set is read from a directory; only
a synthetic set is committed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Extracted rows are linked to files through a read-only code index
(--code-index) under the extractor's own rule; without one, arm 5 (gold
rows through loom_search only) is the like-for-like reference. The
treatment check reports pre-edit and search keys per arm.

Every provider request, a resend included, is checked against the cap and
recorded; the extraction bound follows the windows, sections, prompt and
output cap the CLI uses, on the model the server settings name; the
server's own spend is read back from cost.summary and capped per
namespace. A run the cap stops keeps its namespaces and resumes; a
finished or failed one erases them and is not resumed. Verdicts missing
their keys are unreadable; citations match exactly; the setting detector
compares values as tokens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
The run prefix is part of each role's org, so namespaces another run left
behind reach neither this run's arms nor its server-spend readback.
Namespaces are registered as kept (the idle gc would empty them under a
resumed run). A cap stop during setup keeps what it wrote and the resume
continues at the step it stopped on. The extraction bound counts two
calls per window. Writing files on an extracted row keeps the paths its
text spells out and every other field, source_trace included. Without a
code index arm 4 reads no pre-edit block; with --arm4-namespace it is
compared with arm 3. A supersession verdict needs current_stated, a task
id may not hold '/', a cap stop exits 1, and an arm-4 run refuses a
fallback model.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…cks its flags

The worst case per document now counts the windows the extractor reads
(the document chunked as knowledge.upsert chunks it, grouped as the CLI
groups them), two calls each. A paid run refuses an extraction on the fake
model. Without a code index the report leaves out arm 4 against arm 3 and
its pre-edit line. A resume must use the same flags; an error after setup
keeps the namespaces and prints the command that erases them. The cost
readback starts at the run's first day; the ledger keeps a running total;
the extraction child has a timeout; a code index that does not answer is
reported. Paths kept on an extracted row come from its reasoning, section
citations match a heading line, supersession tasks name their current
design and every task its gold rows. The harness moves from the results
page to the coverage matrix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…the extractor's own code

section_text looks the breadcrumb up in the server's heading parser, so a
heading with a code span or a Setext heading resolves. The extraction
bound calls the server's chunker and the extractor's windowing directly
and counts each window as the extractor sends it, with its document and
section lines, plus a second-call note up to the output cap. Extracted
and linked rows are counted once when a revision reports them again; an
interrupt after setup keeps the namespaces and prints how to erase them;
a timed-out extraction keeps both output streams.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… hold "arm"

A citation's segments match a suffix of a section's path, a cut-short
citation the start of one, and words after a path that path; exactly one
section must fit, so two sections of one title under different parents no
longer resolve to the first. Backticks and emphasis in a citation are
stripped as the chunker strips them. Answer and surface keys are parsed
from the right, so a task id holding "arm" scores. The extraction bound
reads the windows itself and names the per-section count it assumes; a
timed-out extraction joins both streams; the unused current_documents is
gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ance is counted whole

The known decisions a re-run's prompt lists are counted in the scenario,
which the prompt keeps uncut. A knowledge pointer ends before the next
pointer on its line, and its section is read only after `#`. A citation
of a section's whole path names it even when another path ends so. Arm 5
is added whenever arm 4 has no files; the pre-edit budget is one constant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
The pointer pattern's first part also stops before the next pointer, so
`#A,knowledge:...#B` reads as two citations. The --arms help says when
arm 5 is added, the section-matching rules are listed in the order they
apply, and the known-decision test compares one document with and without
a revision.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ts cap

The plan's inputs are planning estimates, so its upper figure is the
spend at every output cap, not a worst case. The dry run's docstring says
it reads this environment's server settings for arm 4. set_files writes
the row's own agent and confidence. README paragraphs wrap at 88.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…e wraps at 88

Responses are read by key where the op always returns the field;
set_files carries every field of the row as read. A gold row is one
write (memory.pin for a pinned row). The server-spend readback records
any increase from zero; knowledge.get is trusted to serve the live
version only. The cited-text length, the extraction window and the
provider timeout are named constants. Docstrings, comments and help text
wrap at 88 columns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… a resume checks its models

The bound lists the known decisions at the longest category and scenario
decision.record accepts and the outcome length the prompt keeps. A resume
must use the same reader and judge models. One timeout per client; a
truncated pre-edit block counts only the rows it shows; a loom_search error
is raised with its text. The README says the extraction CLI's spend is
recorded only by the ledger's estimate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…s every class

A pre-edit block's served keys are the rows it prints, matched by the
row line formats, not a key named on the left-out line or a longer key
it prefixes. The server-spend readback reads every traffic class in the
run's own orgs, so a worker's cost row on the run's rows counts. The plan
budgets a block at the whole-row ceiling plus its budget; the over-300
column is gone. The README says a resume also checks the reader and judge
models and that the extraction CLI's spend reaches no cost.summary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…checks the extraction model

The bound adds the header, the "… more" line, the closing line naming
left-out decisions and the removal footer, each at the longest the server
can print. A resume must use the same extraction model. The prefix test
now leaves out the shorter key, so a plain prefix match would fail it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…rness reads

A dry run plans each block at the whole-row ceiling plus the budget plus
a fixed allowance for the lines around the rows; the ledger enforces the
real sizes. The test renders a block like the harness asks for and checks
its token estimate fits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…re named

The bound test fills the whole-row ceiling to within a few characters,
leaves one decision out and overflows the budget with facts, so the block
is past the rows' own budgets and must still fit the plan. The category
and scenario limits of decision.record are named once with a pointer to
the model. The README says what the page holds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
With --keep-namespaces a failed setup kept half-filled namespaces that a
resume would serve. A setup that fails other than on the cap now marks the
run not resumable, keeping its namespaces only with the erase command
printed. The pre-edit margin test leaves six decisions out at the longest
key the left-out line prints.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…s so

A run refuses a failed setup before an erased one, so an erased failed
setup says "setup failed". Ctrl-C during setup erases like a failure and
is never resumed (tested). The module docstring, run() docstring,
--keep-namespaces help and README now agree on what is kept, erased and
resumed; the pre-edit allowance is named for the left-out line it covers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…nothing

The module docstring names the runs that resume; a test reruns a finished
run with --keep-namespaces and checks the ledger and the namespaces.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ask set

The spend-cap stop prints the erase command beside the resume hint. The
answer and surface keys and their parser move to taskset.py and are used
everywhere a key is built, so score no longer imports run and run imports
planning_mde at the top. Defaults no caller overrides are module
constants: the knowledge hits shown, the Loom call timeout and the cited
text length.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…with a message

The spend-cap notice goes to stderr. score turns an unfilled or mistyped
verdict in the extraction labels into a clear refusal, and the README
names the filled file to pass. A tasks need their rejected options, as
the judge reads them. Defaults no caller overrides are gone (the
pre-edit budget, the planning spread, the code index token, the
comparison's arm-4 flag) and the timeouts are read from their constants.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
zlareb1 and others added 20 commits November 4, 2026 13:52
The run's JSON files are written through a temp file and a rename, so an
interrupt leaves the old file whole; a ledger line cut short by an
interrupt is dropped when the ledger is opened, so the next append starts
its own line. score refuses only a bad label with its own error; the
judge reads the rejected options as a numbered list; the README states
the labelling procedure once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…row is never joined

Inside a hunk a removed `-- x` line reads `--- x` and an added `++ x` line
`+++ x`: there a header pair counts only when a `@@` line follows it.
The ledger keeps a whole last row that lost its newline and drops only a
cut one, with a warning that it undercounts by one call; the atomic write
removes its temp file when the write fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…s keys

The parser reads a hunk's `@@ -a,b +c,d @@` counts: until they are used
up every line is content, so no `--- x`/`+++ x` line inside it is taken
for a file header; outside a hunk such a line is a header, alone too. A
`@@` without counts falls back to the pair-then-hunk rule. Each detector
type names the keys it needs and the loader refuses one without them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Models miscount hunk headers, and a blank context line broke the counted
parser. A file header is now a `diff --git` line, a `--- ` line before a
`+++ ` line, or a `+++ ` line before a `@@`; `@@` and `\ No newline` lines
are skipped and every other line is added, removed or context. The loader
refuses detectors of the wrong shape, and a setting's `from`/`to` must be
one word or number, as the detector compares them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…nd the loader checks every text field

One token regex (signs, exponents and inner hyphens kept) splits a line's
values and validates a detector's from/to. A diff fence opens and closes
at a line start. The loader compiles detector patterns, requires the
judge's list fields to be lists of strings, and refuses a document id
with '/'.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
The detector counted any line naming the setting; a call argument, an
annotation or a comparison now leaves it alone. A declaration is
`name = <literal>`, `name: <literal>`, a DECLARE(...) line or a
{"name", old, new} history entry, with a number, quoted string or bool
as its value; `to` still matches any token after the name. from and to
are strings. The example's B2 is scored by its rubric alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…s the line

Reading a setting's default from free-form diff lines kept firing on
uses that were not declarations. The detector type, its loader checks and
its token helpers are removed; a task that needs a changed default writes
a diff_added_regex whose path_glob and pattern name the declaration line.
The example's idempotency constraint is judged by its rubric.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…home

A B verdict that leaves rubric_fail unanswered (missing or null) on a task
with a judge detector is unreadable, not a pass. The judge detector is
the only way to give a rubric (judge_rubric is gone); judge stability on
B reads the same avoids figure the report shows. The example's B3 scores
its idempotency constraint through constraints_violated alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
A change answer whose detector fired has the same verdict in every judge
pass, so it is left out of the order, repeat and judge agreement. The
changed-default regex in the detector test no longer backtracks into a
pass, and a kept default with a reworded comment does not fire.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
A change answer whose detector fired carries the detector's verdict, not
the judge's, so a human label on it says nothing about the judge. One
helper reads whether a detector fired for the metrics, the agreement and
the human comparison.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… check

On a change answer whose detector fired, a label on avoids, satisfies or
detector_fired is the detector's; a label on push-back is still the
judge's and is counted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… a token needs

The fields a fired detector decides are one named constant; labels on
detector_fired are never counted against the judge. The README states
the auth a run needs: each run creates its own orgs, so auth is off or
the token covers every org, and erasing them needs an org-wide admin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Loom.erase reports whether every erasure was accepted and prints the
`loom namespaces-gc` command for each refused one; the run marks itself
erased only when all were. The README gives the two token commands, for
the writes and for the erasure.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…each entry's keys

A rerun of a failed setup erases what the first try could not, then
refuses the resume saying whether the namespaces are gone. Each refused
erasure prints one stderr line with its gc command (the harness posts the
erasure itself). The README says how to erase with an admin token after a
writer-token run. documents.json and gold_rows.json entries missing their
keys are refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… before erasing

Loom.erase uses the bench erasure helper, whose warning names the gc
command; with logging left unconfigured, Python prints it on stderr. A
rerun is checked against the stored flags before a failed setup's
erasure is retried, so other flags never erase anything.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…es a gold row that is not an object

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…he why-question judge no longer asks for an unscored verdict

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…filter naming no task is refused

An abstention is never misleading, so the judge needs only the gold and the cited text;
the dry run stops charging every judge pass for the arm's context. The harness wording
says the operator starts the server for the run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ame rules

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ns supports it

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 force-pushed the feat/bench-design-rationale branch from 9f89c98 to 5b88b29 Compare November 4, 2026 13:53
@zlareb1
zlareb1 merged commit 4310d8e into main Nov 4, 2026
@zlareb1
zlareb1 deleted the feat/bench-design-rationale branch November 4, 2026 13:53
@pufit pufit mentioned this pull request Nov 4, 2026
9 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant