Keep configs in ~/.config/build-release/ and tool state in ~/.local/state/build-release/, under XDG_* where set
CI / tests (pull_request) Successful in 6m34s

This commit is contained in:
2026-12-03 18:56:28 +01:00
parent 20c83f861f
commit 1ca2c8efe0
142 changed files with 1095 additions and 933 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
from collections.abc import Mapping
import pathlib
from loop_state.paths import CLAUDE_HOME
@@ -22,7 +23,7 @@ HUMAN_RULE_NAMES = (f"~/{CLAUDE_HOME}/{HUMAN_RULES_FILE}", f"~/{CLAUDE_HOME}/{HU
CONSEQUENCE = "the judge cannot read the records"
def read_records(root: str | None, home: pathlib.Path, claude_dir: pathlib.Path, first: tuple[tuple[str, str], ...] = ()) -> str | Failure:
def read_records(root: str | None, home: pathlib.Path, env: Mapping[str, str], claude_dir: pathlib.Path, first: tuple[tuple[str, str], ...] = ()) -> str | Failure:
"""The project's `AGENTS.md` and decision log, then the human's rules, CLAUDE.md first, each headed by its name. One that does not exist, or is empty, is left out. A text that several of them hold appears once, headed by all their names.
`AGENTS.md` is read where the config under home of root's project puts it, and the decision log from the store that config names. Each is headed by its name in RECORD_FILES wherever it is kept.
@@ -31,7 +32,7 @@ def read_records(root: str | None, home: pathlib.Path, claude_dir: pathlib.Path,
texts: list[tuple[str, str | Failure]] = list(first)
rules = [claude_dir / HUMAN_RULES_FILE, *sorted((claude_dir / HUMAN_RULE_DIR).glob("*.md"))]
if root is not None:
config = located(root, home)
config = located(root, home, env)
if isinstance(config, Failure):
return Failure(f"{config.reason} - {CONSEQUENCE}.")
rules += sorted(config.paths["standards"].glob("*.md"))