Answer stability round 1: 1 🔴, 6 🟡 (0 misread); say what a plan outside the checkout leaves undone in scoring-run-owed, the release standing and rank_todo.py

This commit is contained in:
2026-11-13 01:44:33 +01:00
parent f907c2e773
commit c5dc8b5755
24 changed files with 151 additions and 57 deletions
+6 -5
View File
@@ -12,7 +12,7 @@ from project_config.main import project
def owed_scoring_run(default: str) -> Failure | None:
"""A Failure saying which scoring runs the chunk owes and has not recorded; None where it owes none.
The chunk owes the runs `plan_reasons` calls, two where it empties a release, else one. It has recorded the scoring runs its committed history holds beyond those at the merge base, so a default branch that has moved on since the branch began doesn't count. A project with no plan owes none. A missing run blocks the merge and a low score never does, which keeps the decision `review: the comprehension check records …`: it bars only scores from blocking.
The chunk owes the runs `plan_reasons` calls, two where it empties a release, else one. It has recorded the scoring runs its committed history holds beyond those at the merge base, so a default branch that has moved on since the branch began doesn't count. A project with no plan owes none. Neither does one whose plan or history is outside the checkout: it says on stderr that it cannot tell. A missing run blocks the merge and a low score never does, which keeps the decision `review: the comprehension check records …`: it bars only scores from blocking.
"""
config = project()
if isinstance(config, Failure):
@@ -20,10 +20,11 @@ def owed_scoring_run(default: str) -> Failure | None:
checkout = str(config.top)
if not has_plan(config.paths["plan"]):
return None
history = config.tracked("comprehension-history")
if history is None:
# No commit holds a history outside the checkout, so the runs the branch recorded cannot be counted; the merge goes on, as `docs/decisions.md` → "project config: a tool that reads a file's commits …" says.
print(f"larv-review doesn't support a comprehension history outside the checkout, so it cannot tell whether the chunk owes a scoring run: {config.paths['comprehension-history']}", file=sys.stderr)
# No commit holds a file outside the checkout. So the plan as the chunk found it cannot be read, nor the runs the branch recorded counted; the merge goes on, as `docs/decisions.md` → "project config: a tool that reads a file's commits …" says.
plan, history = config.tracked("plan"), config.tracked("comprehension-history")
if plan is None or history is None:
name, setting = ("plan", "plan") if plan is None else ("comprehension history", "comprehension-history")
print(f"larv-review doesn't support a {name} outside the checkout, so it cannot tell whether the chunk owes a scoring run: {config.paths[setting]}", file=sys.stderr)
return None
base = git("merge-base", default, "HEAD", cwd=checkout)
if isinstance(base, Failure):