Answer the first round: resume the worker with the records' answer to its question, read docs/decisions.md alone, scope --help's promise

This commit is contained in:
2026-10-03 00:35:40 +02:00
parent 6d5d19bd69
commit 6340e5a993
11 changed files with 100 additions and 54 deletions
+3 -6
View File
@@ -4,14 +4,11 @@ from loop_claude.stop import Stop
def read_records(root: str) -> str | Stop:
"""AGENTS.md and the decision log, each headed by its path; a file the project lacks is left out."""
project = pathlib.Path(root)
paths = [project / "AGENTS.md", project / "docs" / "decisions.md", *sorted(project.glob("docs/decisions/*.md"))]
"""AGENTS.md and docs/decisions.md, each headed by its path; a file the project lacks is left out."""
records = []
for path in paths:
name = path.relative_to(project)
for name in ("AGENTS.md", "docs/decisions.md"):
try:
text = path.read_text(encoding="utf-8")
text = pathlib.Path(root, name).read_text(encoding="utf-8")
except FileNotFoundError:
continue
except OSError as failure: