Answer product-owner round 1: 0 🔴, 5 🟡 (0 misread); merge allows a minute for checks to report, prepare-scoring replaces a stale setup, and the skill runs merge in the background

This commit is contained in:
2026-11-12 09:04:28 +01:00
parent c04864b6f0
commit eaa67bfcd9
9 changed files with 116 additions and 46 deletions
+7 -4
View File
@@ -136,8 +136,10 @@ def prepare_scoring(worktree: str, preloaded: str | None) -> 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."""
home = pathlib.Path.home()
folder = scoring_folder(worktree, home)
if folder.exists():
return Failure(f"a scoring run is already set up in {folder}: record-scoring removes it once it records the run")
# 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), Failure):
return removed
# Where AGENTS.md is missing, this repo keeps the values in seat-prompts.md: .claude/rules/this-repo-keeps-no-agents-md.md.
source = pathlib.Path(worktree) / "AGENTS.md"
if not source.is_file() and (own := pathlib.Path(worktree) / "skills" / "comprehension-panel" / "seat-prompts.md").is_file():
@@ -188,7 +190,8 @@ def prepare_scoring(worktree: str, preloaded: str | None) -> str | Failure:
path = folder / f"{name}.md"
path.write_text(placeholder.sub(lambda found: filled[found.group(1)], prompt) + "\n")
written.append(str(path))
return f"Scoring worktree, at {head.strip()}: {checkout}\nPrompts:\n" + "\n".join(written)
before = f"Removed the scoring run set up before in {folder}.\n" if replaced else ""
return before + f"Scoring worktree, at {head.strip()}: {checkout}\nPrompts:\n" + "\n".join(written)
def removed_setup(worktree: str) -> Failure | None:
@@ -197,6 +200,6 @@ def removed_setup(worktree: str) -> Failure | None:
if not folder.exists():
return None
if (folder / "checkout").exists() and isinstance(removed := git("worktree", "remove", "--force", str(folder / "checkout"), cwd=worktree), Failure):
return Failure(f"recorded the run, but could not remove the scoring worktree: {removed.reason}")
return Failure(f"could not remove the scoring worktree {folder / 'checkout'}: {removed.reason}")
shutil.rmtree(folder, ignore_errors=True)
return None