Answer architecture round 1: 1 🔴, 21 🟡 (0 misread); skip the routing call where no development clone exists, name the judge's rules the setup's, record two accepted trade-offs, and update stale plan paths
This commit is contained in:
@@ -7,32 +7,32 @@ 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.
|
||||
# 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 setup's rules below.
|
||||
WORKING_RULES = ("AGENTS.md", "working-rules")
|
||||
DECISIONS = ("docs/decisions.md", "decisions")
|
||||
RECORD_FILES = (WORKING_RULES[0], DECISIONS[0])
|
||||
# The human's rules, in the order the judge reads them: the setup's CLAUDE.md, each .md file in its rules/,
|
||||
# The setup's rules, in the order the judge reads them: the setup's CLAUDE.md, each .md file in its rules/,
|
||||
# then each .md file in the review standards folder the project's config sets.
|
||||
HUMAN_RULES_FILE = "CLAUDE.md"
|
||||
HUMAN_RULE_DIR = "rules"
|
||||
SETUP_RULES_FILE = "CLAUDE.md"
|
||||
SETUP_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"
|
||||
RECORDS_NAMED = "the project's working rules and decisions, then the setup's rules for every project"
|
||||
# How prose names a file of the setup wherever its clone lies: the setup's CLAUDE.md → "Vocabulary", "setup".
|
||||
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")
|
||||
SETUP_RULE_NAMES = (f"{OF_THE_SETUP} {SETUP_RULES_FILE}", f"{OF_THE_SETUP} {SETUP_RULE_DIR}/", "the project's review standards")
|
||||
|
||||
|
||||
CONSEQUENCE = "the judge cannot read the records"
|
||||
|
||||
|
||||
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.
|
||||
"""The project's `AGENTS.md` and decision log, then the setup'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.
|
||||
|
||||
first holds records kept outside the project, such as the sections of a Jira epic's description, each as its heading and text: they come before the project's. A root of None is work without a checkout, which has no project records and no review standards."""
|
||||
texts: list[tuple[str, str | Failure]] = list(first)
|
||||
rules = [claude_dir / HUMAN_RULES_FILE, *sorted((claude_dir / HUMAN_RULE_DIR).glob("*.md"))]
|
||||
rules = [claude_dir / SETUP_RULES_FILE, *sorted((claude_dir / SETUP_RULE_DIR).glob("*.md"))]
|
||||
if root is not None:
|
||||
config = located(root, home, env)
|
||||
if isinstance(config, Failure):
|
||||
|
||||
@@ -107,7 +107,7 @@ class Records(unittest.TestCase):
|
||||
|
||||
class JudgeRules(unittest.TestCase):
|
||||
def test_the_judge_prompt_names_every_rule_the_judge_reads_from_the_human(self):
|
||||
self.assertEqual([name for name in records.HUMAN_RULE_NAMES if name not in judge.judge_rules("the ledger", "a-driver")], [])
|
||||
self.assertEqual([name for name in records.SETUP_RULE_NAMES if name not in judge.judge_rules("the ledger", "a-driver")], [])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -7,13 +7,13 @@ from agent_cycle.escalation_mark import asks_higher_rung
|
||||
from model_routing.review_choice import chosen, ReviewChoice
|
||||
from model_routing.route import ESCALATION_MARKER, Route
|
||||
from agent_cycle.routing import escalation_rungs
|
||||
from chunk_driver.project.records import HUMAN_RULE_NAMES, RECORD_FILES, RECORDS_NAMED
|
||||
from chunk_driver.project.records import SETUP_RULE_NAMES, RECORD_FILES, RECORDS_NAMED
|
||||
from review_rules.review_passes import INSTRUCTION_FILES, INSTRUCTION_FOLDERS
|
||||
from text_files.markdown_text import listed, quoted
|
||||
from model_routing.ladder import ProjectRung, Rung
|
||||
|
||||
# Where the judge may quote an answer from, named as the human and the worker see them; of the goals file the judge sees only the premises.
|
||||
QUOTE_SOURCES = listed(("the goals file's Goals and Audience", *RECORD_FILES, *HUMAN_RULE_NAMES), "or")
|
||||
QUOTE_SOURCES = listed(("the goals file's Goals and Audience", *RECORD_FILES, *SETUP_RULE_NAMES), "or")
|
||||
# Where the worker may write an answer the human typed, so it counts as recorded.
|
||||
ANSWER_DESTINATIONS = "the goals file's Goals or Audience, " + ", ".join(RECORD_FILES) + ", the plan or a comment"
|
||||
ANSWERS_RECORDED = answers_recorded(ANSWER_DESTINATIONS)
|
||||
|
||||
Reference in New Issue
Block a user