Keep configs in ~/.config/build-release/ and tool state in ~/.local/state/build-release/, under XDG_* where set
CI / tests (pull_request) Successful in 6m34s
CI / tests (pull_request) Successful in 6m34s
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"""Set up a scoring run: the worktree its seats read and each seat's prompt, filled from skills/comprehension-panel/seat-prompts.md."""
|
||||
from collections.abc import Mapping
|
||||
import pathlib
|
||||
import re
|
||||
import shutil
|
||||
@@ -127,18 +128,18 @@ def prompt_parts() -> dict[str, str] | Failure:
|
||||
return parts
|
||||
|
||||
|
||||
def scoring_folder(worktree: str, home: pathlib.Path) -> pathlib.Path:
|
||||
return pathlib.Path(review_folder(str(home), worktree)) / "scoring"
|
||||
def scoring_folder(worktree: str, home: pathlib.Path, env: Mapping[str, str]) -> pathlib.Path:
|
||||
return pathlib.Path(review_folder(str(home), env, worktree)) / "scoring"
|
||||
|
||||
|
||||
def prepare_scoring(worktree: str, home: pathlib.Path, run: Git = git) -> str | Failure:
|
||||
def prepare_scoring(worktree: str, home: pathlib.Path, env: Mapping[str, str], run: Git = git) -> str | Failure:
|
||||
"""Makes the scoring run's worktree at worktree's HEAD and writes each seat's prompt beside it, in the chunk's review folder; what it made, as the tool prints it."""
|
||||
folder = scoring_folder(worktree, home)
|
||||
folder = scoring_folder(worktree, home, env)
|
||||
# A setup record-scoring never removed, as where the seats failed, would otherwise block every later run.
|
||||
replaced = folder.exists()
|
||||
if replaced and isinstance(removed := removed_setup(worktree, home, run), Failure):
|
||||
if replaced and isinstance(removed := removed_setup(worktree, home, env, run), Failure):
|
||||
return removed
|
||||
config = located(worktree, home, run)
|
||||
config = located(worktree, home, env, run)
|
||||
if isinstance(config, Failure):
|
||||
return config
|
||||
source = config.paths["working-rules"]
|
||||
@@ -170,7 +171,7 @@ def prepare_scoring(worktree: str, home: pathlib.Path, run: Git = git) -> str |
|
||||
if isinstance(head, Failure):
|
||||
return head
|
||||
main = listing.splitlines()[0].removeprefix("worktree ")
|
||||
made = made_review_folder(worktree, home)
|
||||
made = made_review_folder(worktree, home, env)
|
||||
if isinstance(made, Failure):
|
||||
return made
|
||||
checkout = folder / "checkout"
|
||||
@@ -206,9 +207,9 @@ def prepare_scoring(worktree: str, home: pathlib.Path, run: Git = git) -> str |
|
||||
return before + f"Scoring worktree, at {head.strip()}: {checkout}\nPrompts, each for one {SEAT_AGENT} agent:\n" + "\n".join(written)
|
||||
|
||||
|
||||
def removed_setup(worktree: str, home: pathlib.Path, run: Git = git) -> Failure | None:
|
||||
def removed_setup(worktree: str, home: pathlib.Path, env: Mapping[str, str], run: Git = git) -> Failure | None:
|
||||
"""Removes the scoring worktree and prompts prepare_scoring made for the chunk at worktree, where they exist."""
|
||||
folder = scoring_folder(worktree, home)
|
||||
folder = scoring_folder(worktree, home, env)
|
||||
if not folder.exists():
|
||||
return None
|
||||
if (folder / "checkout").exists() and isinstance(removed := run("worktree", "remove", "--force", str(folder / "checkout"), cwd=worktree), Failure):
|
||||
|
||||
Reference in New Issue
Block a user