Answer stability round 2: 0 🔴, 1 🟡; name when a replay applies in ladder.py and have chosen find the higher E + I that end it, so a top-rung project keeps them

This commit is contained in:
2026-10-23 03:53:14 +02:00
parent 28b64042ba
commit f58fe5a9db
3 changed files with 15 additions and 12 deletions
+6 -5
View File
@@ -2,7 +2,7 @@
import dataclasses
from model_routing.route import HIGHEST_ESCAPE_AND_IMPACT, Route
from model_routing.ladder import review_rungs, reviewers_rung, Rung
from model_routing.ladder import replay_applies, review_rungs, reviewers_rung, Rung
from review_passes import ReviewedPass, REVIEWERS
@@ -14,7 +14,7 @@ class ReviewChoice:
lowered: dict[ReviewedPass, Rung]
seat: Rung
security: Rung
# Each rung that a higher E + I than the route's picks for the reviewers, with the lowest E + I that picks it, lowest E + I first, so a worker that takes in such an item reviews it on that rung in the same run.
# Each rung a higher E + I than the route's picks for the reviewers, with the lowest E + I that picks it, in rising order.
higher: dict[Rung, int]
@@ -22,10 +22,11 @@ def chosen(project: Rung, route: Route) -> ReviewChoice:
"""The rung each kind of review runs on for a chunk whose route is route, on a project whose rung is project."""
rungs = review_rungs(project, route.rung, route.reviewed_on())
reviewers = reviewers_rung(project, route.rung, route.reviewed_on())
lowered = {kind: rungs[kind] for kind in REVIEWERS if rungs[kind] != reviewers}
higher: dict[Rung, int] = {}
for escape_and_impact in range(route.reviewed_on() + 1, HIGHEST_ESCAPE_AND_IMPACT + 1):
# A higher E + I changes a review only by moving the reviewers' rung: a replay lowers a pass only where the worker runs no higher than the project and the E + I steps no review up, and the first E + I that steps one up moves the reviewers too.
# A higher E + I changes a review by moving the reviewers' rung, or by ending the replay that lowered a pass.
rung = reviewers_rung(project, route.rung, escape_and_impact)
if rung != reviewers:
if rung != reviewers or (lowered and not replay_applies(project, route.rung, escape_and_impact)):
higher.setdefault(rung, escape_and_impact)
return ReviewChoice(reviewers, {kind: rungs[kind] for kind in REVIEWERS if rungs[kind] != reviewers}, rungs["seat"], rungs["security"], higher)
return ReviewChoice(reviewers, lowered, rungs["seat"], rungs["security"], higher)