Apply lilleman's answers: maintain-restoring items are defects ranked after security, the most specific goal only, the reshape as the only work, bar 0.1

This commit is contained in:
2026-10-16 03:26:37 +02:00
parent a9a19fdbae
commit c2697c6281
8 changed files with 56 additions and 38 deletions
+2
View File
@@ -47,6 +47,8 @@ def parse_moves(id_: str, cell: str) -> Moves | Failure:
goals = [goal for goal, _ in moves]
if repeated := [goal for goal in goals if goals.count(goal) > 1]:
return Failure(f"item {id_} cites goal {repeated[0]} twice; name each goal once")
if nested := [(parent, goal) for parent in goals for goal in goals if goal.startswith(parent + ".")]:
return Failure(f"item {id_} names goal {nested[0][0]} beside its sub-goal {nested[0][1]}; name only the most specific goal an item moves, and a parent only for a move none of its sub-goals covers")
return moves