Answer stability round 1: 0 🔴, 6 🟡; pin the averaged overall with a second pair and a run with no Mean row, test a plan record-scoring reads but cannot rank, share rank_file between rank_todo.py and record-scoring, read the history path from HISTORY, make the comments and larv-review's help true

This commit is contained in:
2026-10-18 21:12:19 +02:00
parent 1605d80cc5
commit eafcefe0da
8 changed files with 131 additions and 70 deletions
+5 -14
View File
@@ -54,28 +54,19 @@ def record_scoring(default: str, scores_file: pathlib.Path, ids: list[int]) -> F
def rerank() -> Failure | None:
"""Rank the checkout's todo.md again, since the overall sets code health's weight. The run stays recorded whatever happens, so a failure says to rank todo.md, not to record the run again."""
"""Rank the checkout's todo.md again as rank_todo.py does, since the overall sets code health's weight, and fail where rank_todo.py would. The run stays recorded whatever happens, so those failures say to settle todo.md and run rank_todo.py on it, not to record the run again."""
checkout = top()
if isinstance(checkout, Failure):
return checkout
todo = pathlib.Path(checkout, "todo.md")
texts = rank_todo.read_all(todo)
if isinstance(texts, Failure):
return unranked(todo, texts)
ranked = rank_todo.rank(*texts)
ranked = rank_todo.rank_file(todo)
if isinstance(ranked, Failure):
return unranked(todo, ranked)
if ranked.text != texts[0] and (unwritten := rank_todo.write(todo, ranked.text)):
return Failure(f"recorded the run, but {unwritten.reason}; run rank_todo.py on {todo}")
for line in ranked.notes + ranked.under_bar:
print(f"{todo}: {line}")
return Failure(f"recorded the run, but rank_todo.py cannot rank {todo}: {ranked.reason}. Repair it and run rank_todo.py on it, not record-scoring again")
if ranked.under_bar:
return Failure(f"recorded the run and ranked {todo}, but the lines above name items now under the bar. Settle each as its line says, then run rank_todo.py on it, not record-scoring again")
return None
def unranked(todo: pathlib.Path, why: Failure) -> Failure:
return Failure(f"recorded the run, but rank_todo.py cannot rank {todo}: {why.reason}. Repair it and run rank_todo.py on it, not record-scoring again")
def scored_seats(given: SeatsFile) -> ScoringRun | Failure:
found = scores(given.seats)
if isinstance(found, Failure):