Answer prose round 1: 1 🔴, 9 🟡 (0 misread); count the home's six links everywhere, say that gather builds the home too, define the setup as the release the machine runs, and reword what the reviewer read twice
This commit is contained in:
@@ -61,7 +61,7 @@ FINISHED_RULES = (
|
||||
"finished=true when the chunk is complete: merged, or nothing remains that the worker could do on "
|
||||
"its own. Even then, it is finished only once {answers_recorded}.\n\n"
|
||||
"An answer counts as recorded where the premises or the records above already hold it, the human's rules "
|
||||
"(the setup's CLAUDE.md, the setup's rules/, the project's review standards, each headed by its path) included. "
|
||||
"(the setup's CLAUDE.md, the setup's rules/, the project's review standards, each headed by its name) included. "
|
||||
"It also counts where the transcript shows the worker writing it into {answer_destinations}, "
|
||||
"but not into one of the human's rules.\n\n"
|
||||
"finished=false when work remains that a further run can "
|
||||
|
||||
@@ -18,8 +18,8 @@ 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"
|
||||
# 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")
|
||||
OF_THE_SETUP = "the setup's"
|
||||
HUMAN_RULE_NAMES = (f"{OF_THE_SETUP} {HUMAN_RULES_FILE}", f"{OF_THE_SETUP} {HUMAN_RULE_DIR}/", "the project's review standards")
|
||||
|
||||
|
||||
CONSEQUENCE = "the judge cannot read the records"
|
||||
@@ -57,8 +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: 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."""
|
||||
"""rule's path as the human writes it. A file in claude_dir, the loop's Claude home, or in the clone is the setup's. Any other is written from ~/ where it lies in home, 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"{OF_THE_SETUP} {rule.relative_to(setup)}"
|
||||
return f"~/{rule.relative_to(home)}" if rule.is_relative_to(home) else str(rule)
|
||||
|
||||
@@ -11,6 +11,9 @@ from agent_cycle import judge
|
||||
from chunk_driver.project import records
|
||||
from loop_state.paths import RELEASE_ROOT
|
||||
|
||||
KIM = pathlib.Path("/home/kim")
|
||||
CLAUDE_HOME = KIM / "share" / "claude-home"
|
||||
|
||||
|
||||
class Records(unittest.TestCase):
|
||||
def test_heads_each_record_by_its_name_the_humans_rules_last(self):
|
||||
@@ -55,11 +58,15 @@ class Records(unittest.TestCase):
|
||||
self.assertEqual(records.read_records(root, claude_md.parents[1], {}, claude_md.parent), Failure(f"no config names the checkout {root}: write {claude_md.parents[1]}/.config/build-release/<key>/config.toml, as `project-config --help` shows - the judge cannot read the records."))
|
||||
|
||||
def test_names_a_file_of_the_setup_alike_in_the_loops_home_and_in_the_clone(self):
|
||||
home = pathlib.Path("/home/kim")
|
||||
for rule in (home / "share" / "claude-home" / "rules" / "todo-items.md", RELEASE_ROOT / "rules" / "todo-items.md"):
|
||||
self.assertEqual(records.named(rule, home, home / "share" / "claude-home"), "the setup's rules/todo-items.md")
|
||||
self.assertEqual(records.named(home / "standards" / "prose.md", home, home / "share" / "claude-home"), "~/standards/prose.md")
|
||||
self.assertEqual(records.named(pathlib.Path("/srv/standards/prose.md"), home, home / "share" / "claude-home"), "/srv/standards/prose.md")
|
||||
for rule in (CLAUDE_HOME / "rules" / "todo-items.md", RELEASE_ROOT / "rules" / "todo-items.md"):
|
||||
with self.subTest(rule):
|
||||
self.assertEqual(records.named(rule, KIM, CLAUDE_HOME), "the setup's rules/todo-items.md")
|
||||
|
||||
def test_names_any_other_file_under_the_home_from_the_tilde(self):
|
||||
self.assertEqual(records.named(KIM / "standards" / "prose.md", KIM, CLAUDE_HOME), "~/standards/prose.md")
|
||||
|
||||
def test_names_a_file_outside_the_home_in_full(self):
|
||||
self.assertEqual(records.named(pathlib.Path("/srv/standards/prose.md"), KIM, CLAUDE_HOME), "/srv/standards/prose.md")
|
||||
|
||||
def test_puts_the_records_handed_in_first_and_reads_only_the_humans_rules_without_a_checkout(self):
|
||||
with tempfile.TemporaryDirectory() as root:
|
||||
|
||||
@@ -28,7 +28,7 @@ SETUP = "~/setup"
|
||||
|
||||
|
||||
def write_config(home: pathlib.Path, checkout: pathlib.Path, goals: str = "checkout:README.md") -> pathlib.Path:
|
||||
"""A config under home that names checkout, every setting inside it but goals-and-audience, principles and standards, which lie in SETUP; for the tests of each tool that reads the config."""
|
||||
"""A config under home that names checkout, every setting inside it but principles and standards, which lie in SETUP, and goals-and-audience, which is goals; for the tests of each tool that reads the config."""
|
||||
folder = config_folder({}, home) / checkout.name
|
||||
folder.mkdir(parents=True, exist_ok=True)
|
||||
(folder / "config.toml").write_text(CLIENT.replace('"~/code/acme-billing"', f'"{checkout}"').replace('"folder:', '"checkout:').replace('"setup:', f'"{SETUP}/').replace('"checkout:goals.md"', f'"{goals}"'), encoding="utf-8")
|
||||
|
||||
@@ -475,7 +475,7 @@ def placed(value: object, top: pathlib.Path, folder: pathlib.Path, home: pathlib
|
||||
"""The path a setting's value spells, or None where it doesn't spell one. A prefixed path stays inside its place."""
|
||||
if not isinstance(value, str):
|
||||
return None
|
||||
# "setup:" is the clone this tool runs from, so a config holds wherever that clone lies. Five readers, seated as people who write a config and as claudes that read one, each picked the prefix over a path in the loop's Claude home and over the clone's path written out.
|
||||
# "setup:" is the clone this tool runs from, so a config holds wherever that clone lies. docs/decisions.md → `setup files: …` holds the bench that picked the prefix.
|
||||
for prefix, place in (("checkout:", top), ("folder:", folder), ("setup:", RELEASE_ROOT)):
|
||||
if value.startswith(prefix):
|
||||
inside = pathlib.PurePosixPath(value.removeprefix(prefix))
|
||||
|
||||
@@ -4,7 +4,7 @@ import unittest
|
||||
from git_cli.git_repo import git
|
||||
from repo_checks import ROOT
|
||||
|
||||
# A file of the setup spelled by a place in the person's own Claude home, where no release lies: a tool, or an instruction file. A session the loop starts has the release's tools on PATH, so prose names a tool bare, and names any other file as the setup's `CLAUDE.md` → "Vocabulary", "setup" says. Both hold wherever the release is cloned.
|
||||
# A file of the setup spelled by a place in the person's own Claude home, where no release lies: a tool, or an instruction file. A session the loop starts has the release's tools on PATH, so prose names a tool bare. It names any other file as the setup's: `CLAUDE.md` → "Vocabulary", "setup". Both hold wherever the release is cloned.
|
||||
BY_ITS_FOLDER = re.compile(r"(?:~|\$HOME)/\.claude/(?:CLAUDE\.md|(?:agents|bin|principles|rules|skills)\b[\w.<>*/-]*)")
|
||||
# The plan, the changelog and the records, then the dated benches and trials: their text names a file as it was spelled when the line was written, and nobody rewrites it.
|
||||
HISTORY = ("CHANGELOG.md", "docs/", "todo.md", "reviewer-merge-trials/", "workflow-bench/")
|
||||
@@ -22,7 +22,7 @@ class SetupFilesNamedWhereverTheCloneLies(unittest.TestCase):
|
||||
for number, line in enumerate(path.read_text(encoding="utf-8", errors="replace").splitlines(), 1):
|
||||
found += [f"{name}:{number}: {spelled}" for spelled in BY_ITS_FOLDER.findall(line)]
|
||||
|
||||
self.assertEqual(found, [], "name a tool bare, as in `todo-item`, and any other file as the setup's: the setup's `rules/todo-items.md`, never a path into `~/.claude`")
|
||||
self.assertEqual(found, [], "name a tool bare, as in `todo-item`, and any other file as the setup's: the setup's `rules/todo-items.md`, never a path into `~/.claude`; in a line a person types, name the clone as the README does, `~/build-release/bin/<tool>`")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -11,7 +11,7 @@ from text_files.markdown_text import section
|
||||
SECTIONS = ("Shared goal", "Prose", "Vocabulary")
|
||||
|
||||
|
||||
# The text calls the file the setup's, the word that file uses for the release's rules, and names the loop's Claude home as the place to open one: a reviewer without a shell cannot learn where `XDG_DATA_HOME` puts that home.
|
||||
# The text calls the file the setup's, as that file's "Vocabulary" does, and names the loop's Claude home as the place to open a file of the setup: a reviewer without a shell cannot learn where `XDG_DATA_HOME` puts that home.
|
||||
def reviewer_context(claude_dir: pathlib.Path) -> str | Failure:
|
||||
"""SECTIONS of the CLAUDE.md in claude_dir, the loop's Claude home, as a reviewer is told them; a Failure where the file or a section is missing."""
|
||||
path = claude_dir / "CLAUDE.md"
|
||||
|
||||
@@ -185,7 +185,7 @@ With --record-figures it also exits 1, saying why: before it plants a bug, where
|
||||
cannot be read; and after the bench, where the history already holds that branch's bench of those two commits or cannot be
|
||||
written. The folder then still holds the bench's results.
|
||||
gather exits 1, saying why, outside a checkout, without a digest, where build-release has saved no model for the project or the
|
||||
model is not on its routing ladder, and where the loop's Claude home is not ready or its claude fails or hits a usage limit.
|
||||
model is not on its routing ladder, and where the loop's Claude home is not ready, and where gather's claude fails or hits a usage limit.
|
||||
"""
|
||||
import dataclasses
|
||||
import functools
|
||||
|
||||
Reference in New Issue
Block a user