Sort the new imports, narrow prepare-scoring's git results, and take run-tests' worker count from the heavy slot
CI / tests (pull_request) Successful in 2m20s

This commit is contained in:
2026-11-12 08:56:39 +01:00
parent 90773cfa5f
commit c04864b6f0
8 changed files with 18 additions and 30 deletions
+8 -6
View File
@@ -4,10 +4,11 @@ import re
import shutil
from failure import Failure
from git_cli.git_repo import git
from records.markdown_text import FENCE, listed
from git_cli.git_repo import git
from review_rules.review_folder import made_review_folder, review_folder
CLAUDE_MD = "CLAUDE.md"
PANEL = pathlib.Path(__file__).resolve().parents[2] / "skills" / "comprehension-panel"
# The file name of each seat's prompt, its label in seat-prompts.md → "Backgrounds", and the heading of its report there.
SEATS = (
@@ -97,9 +98,9 @@ def file_globs(paths: list[str]) -> str:
def preloaded_files(main: pathlib.Path, home: pathlib.Path) -> str:
"""The files Claude Code loads into a seat started in main before its first tool call: each CLAUDE.md, the files it imports, and each rule file without `paths:`."""
found = []
for shown, claude_md, rules in (("~/.claude/", home / ".claude" / "CLAUDE.md", home / ".claude" / "rules"), ("", main / "CLAUDE.md", main / ".claude" / "rules")):
for shown, claude_md, rules in (("~/.claude/", home / ".claude" / CLAUDE_MD, home / ".claude" / "rules"), ("", main / CLAUDE_MD, main / ".claude" / "rules")):
if claude_md.is_file():
found.append(f"`{shown}CLAUDE.md`")
found.append(f"`{shown}{CLAUDE_MD}`")
found += [f"`{shown}{name}`, which it imports" for name in re.findall(r"^@(\S+)", claude_md.read_text(), re.M)]
found += [f"`{shown}{rule.relative_to(claude_md.parent)}`" for rule in sorted(rules.glob("*.md")) if not re.search(r"^paths:", rule.read_text(), re.M)]
return listed(found, "and") if found else "none"
@@ -153,9 +154,10 @@ def prepare_scoring(worktree: str, preloaded: str | None) -> str | Failure:
listing = git("worktree", "list", "--porcelain", cwd=worktree)
branch = git("symbolic-ref", "--short", "-q", "HEAD", cwd=worktree)
head = git("rev-parse", "--short", "HEAD", cwd=worktree)
for read in (listing, head):
if isinstance(read, Failure):
return read
if isinstance(listing, Failure):
return listing
if isinstance(head, Failure):
return head
main = listing.splitlines()[0].removeprefix("worktree ")
made = made_review_folder(worktree)
if isinstance(made, Failure):