Name each file of the setup as the setup's, and a config's as setup:<path>
CI / tests (pull_request) Successful in 4m42s

This commit is contained in:
2026-12-04 04:23:17 +01:00
parent eff57c1dfd
commit 6dd2787e7b
41 changed files with 220 additions and 156 deletions
+8 -5
View File
@@ -1,10 +1,10 @@
from collections.abc import Mapping
import pathlib
from loop_state.paths import CLAUDE_HOME
from failure import Failure
from project_config.main import located
from chunk_driver.project.text_file import read_utf8
from loop_state.paths import RELEASE_ROOT
from record_store.stores import store
# The records the judge reads beside the premises, by the name that heads each, with the setting in the project's config that places it; then the human's rules below.
@@ -17,7 +17,9 @@ HUMAN_RULES_FILE = "CLAUDE.md"
HUMAN_RULE_DIR = "rules"
# How the judge's prompt names the records above, in the order it reads them.
RECORDS_NAMED = "the project's working rules and decisions, then the human's rules for every project"
HUMAN_RULE_NAMES = (f"~/{CLAUDE_HOME}/{HUMAN_RULES_FILE}", f"~/{CLAUDE_HOME}/{HUMAN_RULE_DIR}/", "the project's review standards")
# How prose names a file of the setup wherever its clone lies: the setup's CLAUDE.md → "Vocabulary", "setup".
SETUPS = "the setup's"
HUMAN_RULE_NAMES = (f"{SETUPS} {HUMAN_RULES_FILE}", f"{SETUPS} {HUMAN_RULE_DIR}/", "the project's review standards")
CONSEQUENCE = "the judge cannot read the records"
@@ -55,7 +57,8 @@ def file_text(path: pathlib.Path) -> str | Failure:
def named(rule: pathlib.Path, home: pathlib.Path, claude_dir: pathlib.Path) -> str:
"""rule's path as the human writes it: under ~/.claude, or ~/ for the rest of home, or else in full."""
if rule.is_relative_to(claude_dir):
return f"~/{CLAUDE_HOME}/{rule.relative_to(claude_dir)}"
"""rule's path as the human writes it: as the setup's where it lies in claude_dir, the loop's Claude home, or in the clone, or ~/ for the rest of home, or else in full."""
for setup in (claude_dir, RELEASE_ROOT):
if rule.is_relative_to(setup):
return f"{SETUPS} {rule.relative_to(setup)}"
return f"~/{rule.relative_to(home)}" if rule.is_relative_to(home) else str(rule)