Answer stability round 1: refuse two more seats once the first two agree, compare scores as decimals, read only ASCII digits as item IDs, refuse a shallow clone's base search, and sort release candidates below their release; also holds product-owner round 1's fixes
This commit is contained in:
@@ -110,8 +110,10 @@ def resolved(places: list[Place], tracked: list[str]) -> tuple[list[Place], list
|
||||
|
||||
def heading(at: float, read: str, paired: bool, moved: bool) -> re.Match[str] | Failure:
|
||||
"""An entry's heading, matched by HEADING: when the seats finished, in UTC, and what they read. A run moved from a decision entry opens instead with the date or time that entry gives."""
|
||||
if moved != bool(DATED.match(read)):
|
||||
return Failure(f"only a seats file holding a {MEAN} line alone opens with a date or UTC time, then `, `: {read}")
|
||||
if moved and not DATED.match(read):
|
||||
return Failure(f"a seats file holding a {MEAN} line alone opens with YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ, then `, `: {read}")
|
||||
if DATED.match(read) and not moved:
|
||||
return Failure(f"only a seats file holding a {MEAN} line alone opens with a date: {read}")
|
||||
title = read if moved else f"{time.strftime(STAMP, time.gmtime(at))}, {read}"
|
||||
if (named := HEADING.match(title)) and bool(named.group(4)) == paired:
|
||||
return named
|
||||
@@ -126,10 +128,14 @@ def appended(history: str, entry: str) -> str:
|
||||
|
||||
def ruling_entry(title: str, seats: list[Seat], counted: dict[str, str], ruled: str) -> str:
|
||||
"""A paired ruling's entry; a seat's vote that counted as same for naming no place says so."""
|
||||
votes = [[seat.name, counted[seat.name] if counted[seat.name] == seat.said else f"same (voted {seat.said}, naming no place)"] for seat in seats]
|
||||
votes = [[seat.name, vote_text(seat, counted[seat.name])] for seat in seats]
|
||||
return entry_text(title, [f"Ruling: {ruled}"], [["Seat", "Vote"], *votes], [(f"{seat.name}, {DECIDED_BY}:", seat.places) for seat in seats])
|
||||
|
||||
|
||||
def vote_text(seat: Seat, counted: str) -> str:
|
||||
return counted if counted == seat.said else f"same (voted {seat.said}, naming no place)"
|
||||
|
||||
|
||||
def scoring_entry(title: str, seats: list[Seat], scores: dict[str, list[str]], means: list[str]) -> str:
|
||||
rows = [[seat, *values] for seat, values in scores.items() if seat != MEAN] + [[MEAN, *means]]
|
||||
labels = [(f"{seat.name}, {RESTRUCTURE_FIRST if seat.name == ARCHITECT else HARDEST_FIRST}:", seat.places) for seat in seats if seat.name != MEAN]
|
||||
|
||||
Reference in New Issue
Block a user