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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user