Take the scoring run's values from seat-prompts.md where the working rules hold none
CI / tests (pull_request) Successful in 4m17s

This commit is contained in:
Lilleman
2026-11-19 22:27:29 +01:00
parent 005a23f431
commit 7c178038c5
3 changed files with 43 additions and 5 deletions
+10 -4
View File
@@ -61,9 +61,13 @@ def score_bullets(skill: str) -> tuple[list[str], list[str]] | Failure:
return anchors, [line.replace("**", "") for _, line in dimensions]
# The heading of the section that holds a project's values: `Scoring run`, numbered or not, or `<name>'s values`.
VALUES_HEADING = r"(\d+\.\s+)?Scoring run|.+'s values"
def project_values(text: str, source: str) -> dict[str, str] | Failure:
"""Each value seat-prompts.md fills from the project, from the section of text, read from source, headed `Scoring run` or `<name>'s values`."""
lines = section(text, r"(\d+\.\s+)?Scoring run|.+'s values")
lines = section(text, VALUES_HEADING)
if lines is None:
return Failure(f"{source} has no \"Scoring run\" section to fill the seats' prompts from; add one with {listed([f'{{{name}}}' for name in VALUE_NAMES], 'and')}")
values = {}
@@ -137,13 +141,15 @@ def prepare_scoring(worktree: str, home: pathlib.Path, run: Git = git) -> str |
config = located(worktree, home, run)
if isinstance(config, Failure):
return config
# Where AGENTS.md is missing, this repo keeps the values in seat-prompts.md: .claude/rules/this-repo-keeps-no-agents-md.md.
source = config.paths["working-rules"]
if not source.is_file() and (own := pathlib.Path(worktree) / "skills" / "comprehension-panel" / "seat-prompts.md").is_file():
source = own
rules = read(source) if source.is_file() else ""
if isinstance(rules, Failure):
return rules
# Where the working rules hold no values, this repo keeps them in seat-prompts.md: .claude/rules/this-repo-keeps-no-agents-md.md.
if section(rules, VALUES_HEADING) is None and (own := pathlib.Path(worktree) / "skills" / "comprehension-panel" / "seat-prompts.md").is_file():
source, rules = own, read(own)
if isinstance(rules, Failure):
return rules
skill = read(PANEL / "SKILL.md")
if isinstance(skill, Failure):
return skill