Answer stability round 1: 0 🔴, 5 🟡 (1 misread); keep locks out of compress-archives, count only a search's hits, show an unfinished failing run, and test the walk and the home
This commit is contained in:
@@ -12,11 +12,11 @@ from failure import Failure
|
||||
from git_cli.git_repo import Git, top
|
||||
from git_cli import git_repo
|
||||
from task_bench.bench_folder import held
|
||||
from review_rules.review_folder import made_review_folder
|
||||
from loop_state.paths import paths_from
|
||||
from transcript_archive.project_key import project_key
|
||||
from model_routing.ladder_file import project_ladder
|
||||
from chunk_driver.project.model_choice import read_models_file
|
||||
from review_rules.review_folder import review_folder
|
||||
from model_routing.ladder import Rung
|
||||
|
||||
DIGEST = "digest.md"
|
||||
@@ -24,8 +24,8 @@ PROMPT = pathlib.Path(__file__).with_name("gather-prompt.md")
|
||||
|
||||
|
||||
def gather(env: typing.Mapping[str, str], home: pathlib.Path, claude: Claude) -> list[str] | Failure:
|
||||
"""What the gathering claude answered, once the bench's folder of the checkout the process runs in is gone. A Failure, with
|
||||
the folder kept, where there is no digest, the project's rung cannot be read or claude fails."""
|
||||
"""Gathers the bench of the checkout the process runs in: what the gathering claude answered, once the bench's folder is
|
||||
removed. A Failure, with the folder kept, where there is no digest, the project's rung cannot be read or claude fails."""
|
||||
git = functools.partial(git_repo.git, env=env)
|
||||
checkout = top(git)
|
||||
if isinstance(checkout, Failure):
|
||||
@@ -33,7 +33,10 @@ def gather(env: typing.Mapping[str, str], home: pathlib.Path, claude: Claude) ->
|
||||
rung = project_rung(home, git)
|
||||
if isinstance(rung, Failure):
|
||||
return rung
|
||||
with held(pathlib.Path(review_folder(str(home), checkout))) as folder:
|
||||
review = made_review_folder(checkout, home)
|
||||
if isinstance(review, Failure):
|
||||
return review
|
||||
with held(review) as folder:
|
||||
if isinstance(folder, Failure):
|
||||
return folder
|
||||
try:
|
||||
@@ -46,6 +49,8 @@ def gather(env: typing.Mapping[str, str], home: pathlib.Path, claude: Claude) ->
|
||||
reply = claude_reply(claude, [*rung.flags(), "--strict-mcp-config"], checkout, f"{prompt.strip()}\n\nThe bench's folder: {folder}\n\n{digest}", "the gathering claude")
|
||||
if isinstance(reply, Limited):
|
||||
reply = Failure(f"claude hit a usage limit: {reply.said}")
|
||||
elif not isinstance(reply, Failure) and reply.get("is_error"):
|
||||
reply = Failure(f"the gathering claude ended in an error: {reply.get('result') or 'it gave none'}")
|
||||
if isinstance(reply, Failure):
|
||||
return Failure(f"{reply.reason}\nThe digest stays in {folder} until the next bench: run `task-bench gather` again.")
|
||||
shutil.rmtree(folder, ignore_errors=True)
|
||||
@@ -57,7 +62,7 @@ def run_claude(args: list[str], cwd: str, prompt: str) -> subprocess.CompletedPr
|
||||
|
||||
|
||||
def project_rung(home: pathlib.Path, git: Git) -> Rung | Failure:
|
||||
"""The cheapest rung of the model loop-claude runs the project on, on the routing ladder of the project the process runs in."""
|
||||
"""The cheapest rung for the model loop-claude runs the project on. The routing ladder is that of the project the process runs in."""
|
||||
common = git("rev-parse", "--path-format=absolute", "--git-common-dir")
|
||||
if isinstance(common, Failure):
|
||||
return common
|
||||
|
||||
Reference in New Issue
Block a user