Answer stability round 1: 1 🔴, 6 🟡 (2 misread); read the scoring rule from the clone, hand windows XDG_DATA_HOME, retry the home check where nobody watches, tell an unreadable sign-in status and settings file apart, and bound the claude commands that build the home
CI / tests (pull_request) Successful in 4m35s

This commit is contained in:
2026-12-04 02:45:02 +01:00
parent 71865e0479
commit 3519922f01
19 changed files with 153 additions and 69 deletions
+8 -8
View File
@@ -11,7 +11,6 @@ import pathlib
import re
from build_epic.config import BuildEpicConfig
from loop_state.paths import CLAUDE_HOME
from loop_effects.effects import Effects, say
from build_epic.backend.protocol import EpicIssue, EpicStore, no_scores
from build_epic.epic_record import EpicRecord
@@ -22,6 +21,7 @@ from plan.todo_table import Item
from claude_code.reply import Limited
from plan_store.jira_epic import number
from model_routing.ladder_file import read_ladder, SHIPPED
from loop_state.paths import RELEASE_ROOT
from model_routing.ladder import Rung
from build_epic.scheduler import unblocks
from plan_store.scoring import weighing_texts
@@ -30,8 +30,8 @@ from plan_store.scoring import weighing_texts
FORMULA = re.compile(r"^`Score = ([^`]+)`$", re.M)
# An epic item has no release, and ranking wants every item of one epic in the same one.
NO_RELEASE = (0, 0, 0)
# The rule every plan item is scored by, under the home folder, where each machine's setup keeps it.
RULE = f"{CLAUDE_HOME}/rules/todo-items.md"
# The rule every plan item is scored by, under the clone the setup ships in.
RULE = pathlib.Path("rules/todo-items.md")
@dataclasses.dataclass(frozen=True)
@@ -209,7 +209,7 @@ def scored(epic: Planned, issues: list[EpicIssue]) -> tuple[list[EpicIssue], Fai
bare = [issue for issue in ours if not issue.scores]
if not bare or len(ours) < 2:
return issues, None
rung, language, rule, weighed = planning_rung(epic.config.repoless_model), epic.record.language(), scoring_rule(epic.home), weighing(epic, bare)
rung, language, rule, weighed = planning_rung(epic.config.repoless_model), epic.record.language(), scoring_rule(RELEASE_ROOT), weighing(epic, bare)
if failed := next((each for each in (rung, language, rule, weighed) if isinstance(each, Failure)), None):
return issues, failed
assert isinstance(rung, Rung) and not isinstance(language, Failure) and isinstance(rule, str) and isinstance(weighed, Weighing)
@@ -241,12 +241,12 @@ def scores_set(epic: Planned, issue: EpicIssue, answer: issue_scores.Scores, wei
return ranked if isinstance(ranked, Failure) else epic.store.set_scores(issue.key, answer.scores, answer.moves, answer.comment) or held
def scoring_rule(home: pathlib.Path) -> str | Failure:
"""The text every plan item is scored by, which says what L, E, I and S mean."""
def scoring_rule(clone: pathlib.Path) -> str | Failure:
"""The text every plan item is scored by, in clone, which says what L, E, I and S mean."""
try:
return (home / RULE).read_text(encoding="utf-8")
return (clone / RULE).read_text(encoding="utf-8")
except (OSError, UnicodeDecodeError) as failure:
return Failure(f"cannot read the scoring rule {home / RULE}, so no issue is scored: {failure}")
return Failure(f"cannot read the scoring rule {clone / RULE}, so no issue is scored: {failure}")
def start_order(epic: Planned, issues: list[EpicIssue]) -> list[str] | Failure: