Answer stability round 1: 1 🔴, 6 🟡 (0 misread); say what a plan outside the checkout leaves undone in scoring-run-owed, the release standing and rank_todo.py

This commit is contained in:
2026-11-13 01:44:33 +01:00
parent f907c2e773
commit c5dc8b5755
24 changed files with 151 additions and 57 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ RULES: dict[RuleName, Rule] = {
),
"todo-rank-check": Rule(
"while todo.md has changes, staged or not, a git commit waits until rank_todo.py --check passes on it: the checkout's own bin/rank_todo.py where the checkout is of this setup's repo, else ~/.claude/bin/rank_todo.py",
"a git commit in a checkout whose todo.md has changes",
"a git commit in a checkout whose todo.md has changes, and every git commit where the project's config puts todo.md outside the checkout, where no commit says whether it changed",
),
}
# The lookahead ends each reason at the next marker on its line, or at the line's end. The reason is lazy, so it stops at the next marker instead of running on and swallowing the markers after it.
+4 -1
View File
@@ -937,10 +937,13 @@ class TodoRankCheck(unittest.TestCase):
git(checkout, "commit", "-q", "-m", "plan")
self.assertEqual(self.details(checkout), [], "committed, so unchanged")
def test_a_checkout_with_a_todo_md_and_no_config_is_told_to_write_one(self):
def test_a_checkout_with_a_changed_todo_md_and_no_config_is_told_to_write_one(self):
checkout = self.changed_plan(self.other, self.STUB)
self.config.unlink()
self.assertEqual(self.details(checkout), [f"no config names the checkout {checkout}: write ~/.claude-projects/<key>/config.toml, as `project-config --help` shows"])
git(checkout, "add", "todo.md")
git(checkout, "commit", "-q", "-m", "plan")
self.assertEqual(self.details(checkout), [], "a commit that leaves todo.md alone, as in a clone of someone else's project, is not held")
pathlib.Path(checkout, "todo.md").unlink()
self.assertEqual(self.details(checkout), [])
+3 -2
View File
@@ -26,8 +26,9 @@ def todo_breaches(directory: str, own: pathlib.Path = OWN) -> list[Breach]:
return []
config = located(top, pathlib.Path.home(), functools.partial(git, guarded=True))
if isinstance(config, Failure):
# A checkout with a todo.md and no config is one whose config is still to write.
return [Breach("todo-rank-check", config.reason, top)] if (pathlib.Path(top) / "todo.md").is_file() else []
# A checkout whose todo.md changes with no config is one whose config is still to write. An unchanged todo.md may be a third party's, whose clone needs no config.
unconfigured = pathlib.Path(top) / "todo.md"
return [Breach("todo-rank-check", config.reason, top)] if unconfigured.is_file() and changed(top, unconfigured, "todo.md") else []
todo, tracked = config.paths["plan"], config.tracked("plan")
# A plan outside the checkout has no commit to differ from, so it is checked on every call.
if not todo.is_file() or (tracked is not None and not changed(top, todo, tracked)):