Record a bench in the comprehension history with task-bench record-figures, and run the bench beside a scoring run
CI / tests (pull_request) Failing after 4m58s
CI / tests (pull_request) Failing after 4m58s
This commit is contained in:
+14
-1
@@ -2,6 +2,7 @@ r"""Measure how hard a project's code is to fix a bug in, at a base commit and a
|
||||
each several times at both, and print how often the fix passes and what it took.
|
||||
|
||||
usage: task-bench --image <image> --test <shell text> [--base <ref>] [--head <ref>] [--prefix <shell text>] [--seed <n>] [--bugs <n>] [--runs <n>]
|
||||
task-bench record-figures
|
||||
task-bench gather
|
||||
|
||||
Run it in a checkout, under ~/.claude/bin/run-heavy, with a long-lived token in CLAUDE_CODE_OAUTH_TOKEN, which `claude setup-token`
|
||||
@@ -52,6 +53,11 @@ in 19 cases of 20, an All change under 12% in output tokens, 16% in cache-read t
|
||||
passed, so the pass rate's noise is unmeasured.
|
||||
`docs/decisions.md` → `task-bench: a bench takes` has the figures.
|
||||
|
||||
`task-bench record-figures`, run in the same checkout, appends the bench's figures to the project's comprehension history: the
|
||||
table's heading and its three All rows, under a heading of the current UTC time and `task-bench of <branch>: head <commit>
|
||||
against base <commit>`. It is a report beside the panel's scores there, which no tool reads as one of them. It waits for a
|
||||
bench that still runs, and leaves the bench's folder, so run it before gather.
|
||||
|
||||
`task-bench gather`, run in the same checkout, turns the digest into plan items. It starts a claude on the project's rung, the
|
||||
cheapest rung of the model loop-claude runs the project on, with the digest and the prompt in gather-prompt.md beside this file.
|
||||
That claude files an item with `todo-item add` for each place the runs show to be hard, and leaves the plan's file uncommitted.
|
||||
@@ -64,6 +70,8 @@ Exit 1, saying why, on an unknown or repeated argument, a missing --image or --t
|
||||
number from 1, or no token; and where git, docker or Gremlins fails, the seats' places don't name any Go file, the tests fail at a side
|
||||
without a bug, or no mutant becomes a bug. Where the API refuses a run, the bench stops there and exits 1 too, after the table of
|
||||
the runs that finished.
|
||||
record-figures exits 1, saying why, outside a checkout, without a digest, on a digest without its commits or its three All
|
||||
rows, where no config names the checkout, and where the history already holds that bench or cannot be written.
|
||||
gather exits 1, saying why, outside a checkout, without a digest, where loop-claude has saved no model for the project or the
|
||||
model is not on its routing ladder, and where its claude fails or hits a usage limit.
|
||||
"""
|
||||
@@ -76,6 +84,7 @@ import pathlib
|
||||
import shutil
|
||||
import sys
|
||||
import tarfile
|
||||
import time
|
||||
import typing
|
||||
import uuid
|
||||
|
||||
@@ -94,9 +103,10 @@ from task_bench.figures import figures, Result, Side, SIDES, table
|
||||
from git_cli import git_repo
|
||||
from review_rules.review_folder import made_review_folder, REPORTS
|
||||
from larv_review.history_commands import read_places
|
||||
from task_bench.record_figures import record_figures
|
||||
from run_heavy.capped_docker import SHARE_VARIABLE
|
||||
|
||||
USAGE = "usage: task-bench --image <image> --test <shell text> [--base <ref>] [--head <ref>] [--prefix <shell text>] [--seed <n>] [--bugs <n>] [--runs <n>], or task-bench gather"
|
||||
USAGE = "usage: task-bench --image <image> --test <shell text> [--base <ref>] [--head <ref>] [--prefix <shell text>] [--seed <n>] [--bugs <n>] [--runs <n>], task-bench record-figures, or task-bench gather"
|
||||
# A panel of three readers, seated as the README's audience, picked these options on 2026-11-21, each 3 to 0.
|
||||
OPTIONS = ("--base", "--bugs", "--head", "--image", "--prefix", "--runs", "--seed", "--test")
|
||||
COUNTS = {"--bugs": "5", "--runs": "5", "--seed": "1"}
|
||||
@@ -154,6 +164,9 @@ def main(argv: list[str], env: typing.Mapping[str, str], read: typing.Callable[[
|
||||
home = pathlib.Path(env.get("HOME") or pathlib.Path.home())
|
||||
if argv[:1] == ["gather"]:
|
||||
report = gather(env, home, claude) if argv == ["gather"] else Failure(f"gather takes no arguments; {USAGE}")
|
||||
elif argv[:1] == ["record-figures"]:
|
||||
recorded = record_figures(env, home, time.time()) if argv == ["record-figures"] else Failure(f"record-figures takes no arguments; {USAGE}")
|
||||
report = recorded if isinstance(recorded, Failure) else [recorded]
|
||||
else:
|
||||
given = options(argv, env)
|
||||
if isinstance(given, Failure):
|
||||
|
||||
Reference in New Issue
Block a user