Answer architecture round 3: 0 🔴, 3 🟡; date the legacy case by PR #255, count the newest scoring entry's own worse places, and read a seat's vote from the votes table only
This commit is contained in:
@@ -67,10 +67,10 @@ paired ruling's base. It appends the seats' scores and their means, rounded half
|
||||
decimals, prints the means and, when a mean is under the floor of {floor}, a line opening `Floor:`
|
||||
naming each one.
|
||||
|
||||
places prints the places seats found hard since the history's newest entry, by time, that holds
|
||||
scoring seats' places: all of that entry's, then, from each later paired ruling, each place that
|
||||
opens with a dimension, or Overall, its seat's vote counted as worse. Each entry's places come under
|
||||
its heading, oldest first. With no such entry, it reads every ruling.
|
||||
places prints the places seats found hard from the history's newest entry, by time, that holds
|
||||
scoring seats' places: in it and each later entry, every scoring seat's place, and each ruled place
|
||||
that opens with a dimension, or Overall, its seat's vote counted as worse. Each entry's places come
|
||||
under its heading, oldest first. With no such entry, it reads every ruling.
|
||||
|
||||
Each record is appended to the history, created when missing, under a heading of the current UTC
|
||||
time and the seats file's first line. Each commit that line names must be in the checkout. It exits 1
|
||||
|
||||
@@ -81,7 +81,7 @@ def show_places() -> Failure | None:
|
||||
history = history_file()
|
||||
if isinstance(history, Failure):
|
||||
return history
|
||||
print((latest_places(history[1]) or "The comprehension history names no places seats found hard since its newest scoring run.").rstrip("\n"))
|
||||
print((latest_places(history[1]) or "The comprehension history names no places seats found hard since its newest scoring run, or ever when it holds none.").rstrip("\n"))
|
||||
return None
|
||||
|
||||
|
||||
|
||||
@@ -149,6 +149,8 @@ class History(unittest.TestCase):
|
||||
history = appended(appended(appended("", wrapped), calm), ruled)
|
||||
self.assertEqual(entries(history)[0].scored_places, [Place("bin/f.py", "p")])
|
||||
self.assertEqual(latest_places(history), "## 2026-10-09T12:00:00Z, PR #3 at ccccccc\n\nJunior A, hardest first:\n\n- `bin/f.py:1` `p`: long,\n like `bin/g.py:2` `q`\n\n" + hard_since)
|
||||
fell = ruled.replace("2026-10-10T12:00:00Z", "2026-10-09T12:00:00Z") + "\n| Seat | Navigation | Locality | Shape | Self-sufficiency | Overall |\n|---|---|---|---|---|---|\n| Mid A | 7 | 6 | 7 | 7 | 7 |\n| Mean | 7 | 6 | 7 | 7 | 7 |\n\nJunior A, hardest first:\n\n- `bin/j.py:5` `s`: wide\n"
|
||||
self.assertEqual(latest_places(appended(appended("", scored), fell)), hard_since.replace("2026-10-10T12:00:00Z", "2026-10-09T12:00:00Z") + "\nJunior A, hardest first:\n\n- `bin/j.py:5` `s`: wide\n")
|
||||
|
||||
|
||||
class Base(unittest.TestCase):
|
||||
@@ -324,7 +326,7 @@ class LarvReviewTool(unittest.TestCase):
|
||||
self.assertEqual(entries(text)[0].scored_places, [Place("bin/a.py", "f")] * 4)
|
||||
|
||||
def test_prints_the_places_seats_found_hard_since_the_newest_scoring_run(self):
|
||||
self.assertEqual(self.run_tool("places").stdout, "The comprehension history names no places seats found hard since its newest scoring run.\n")
|
||||
self.assertEqual(self.run_tool("places").stdout, "The comprehension history names no places seats found hard since its newest scoring run, or ever when it holds none.\n")
|
||||
self.commit("Record a scoring run", {"docs/comprehension-history.md": appended("", SCORING + "\nJunior A, hardest first:\n\n- `bin/b.py:4` `h`: long\n")})
|
||||
ran = self.run_tool("places")
|
||||
self.assertEqual((ran.returncode, ran.stdout), (0, "## 2026-10-08T12:00:00Z, PR #1 at aaaaaaa\n\nJunior A, hardest first:\n\n- `bin/b.py:4` `h`: long\n"), ran.stderr)
|
||||
|
||||
Reference in New Issue
Block a user