Answer stability round 1: 0 🔴, 10 🟡 (0 misread); share one REST client and env-file reader, read each issue into a checked value, convert descriptions last, and simplify the hard places the change touched

This commit is contained in:
2026-11-14 19:40:36 +01:00
parent d008dc09f2
commit 8ee67ed2b7
16 changed files with 501 additions and 283 deletions
+9 -4
View File
@@ -33,8 +33,11 @@ def todo_breaches(directory: str, home: pathlib.Path, own: pathlib.Path = OWN) -
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.plan_file, config.tracked("plan")
# A plan outside the checkout has no commit in the checkout to differ from, so it is checked on every call. A plan in Jira is no file, and Jira's backlog ranks it.
if todo is None or not todo.is_file() or (tracked is not None and not changed(top, todo, tracked)):
# A plan in Jira is no file, and Jira's backlog ranks it.
if todo is None or not todo.is_file():
return []
# A plan outside the checkout has no commit in the checkout to differ from, so it is checked on every call.
if tracked is not None and not changed(top, todo, tracked):
return []
return [Breach("todo-rank-check", line, top) for line in check_failures(top, todo, config, own)]
@@ -43,8 +46,10 @@ def folder_breaches(top: str, config: ProjectConfig | Failure, own: pathlib.Path
"""Why the plan kept in top, a config's folder, is not ranked, where the plan has changed in that folder's repo; ranked as for a commit in the project's checkout.
A config that fails to load doesn't block anything here, so that the commit that fixes it goes through."""
todo = None if isinstance(config, Failure) else config.plan_file
if isinstance(config, Failure) or todo is None or not todo.is_relative_to(config.folder):
if isinstance(config, Failure):
return []
todo = config.plan_file
if todo is None or not todo.is_relative_to(config.folder):
return []
if not todo.is_file() or not changed(str(config.folder), todo, todo.relative_to(config.folder).as_posix()):
return []