Rename loop-claude to build-release, with no alias #798

Merged
lilleman merged 13 commits from item-485 into main 2026-12-03 17:13:49 +01:00
3 changed files with 10 additions and 2 deletions
Showing only changes of commit 7f8eabf178 - Show all commits
+1
View File
@@ -39,6 +39,7 @@ def item_of(chunk: str) -> int | None:
def chunk_session(key: str, chunk: str, claude_code_transcripts: pathlib.Path) -> Session:
"""The worker's session for a chunk. A rerun finds a chunk left open by this name. "A " is the human's cue in the session picker that the session is the loop's."""
# The rename from loop-claude changed this name, so a chunk left open under the old one starts a fresh session; the changelog says to finish those first.
return session_named(f"A {key} build-release {chunk}", claude_code_transcripts)
+4 -2
View File
@@ -11,8 +11,10 @@ from agent_cycle.worker_prompts import typed_answer
def grounds_of(prompt: str, entries: list[Entry]) -> Grounds | Failure:
"""What the quotes of a judge run on prompt are checked against, as judge_prompt would have made it for the transcript's entries: the premises and the records before the task are quotable, the task is quotable as the evidence, and the transcript the judge was shown comes before the rules. The prompt is split on the headings judge_prompt writes, at the first of each; a Failure where it lacks one. Rules of an earlier wording stay part of the transcript, a slack that lets an evidence quote them pass."""
before_task, task_heading, after_task = prompt.partition(f"\n\n{TASK_HEADING}")
heading = transcript_heading(BUILD_RELEASE)
# A prompt archived before build-release was renamed names its driver loop-claude.
driver = next((name for name in (BUILD_RELEASE, "loop-claude") if transcript_heading(name) in after_task), BUILD_RELEASE)
heading = transcript_heading(driver)
task, found_heading, shown = after_task.partition(heading)
if not (task_heading and found_heading):
return Failure(f"the archived prompt lacks the heading {TASK_HEADING.strip()!r} or {heading.strip()!r}, which judge_prompt writes")
return Grounds(shown.removesuffix(f"\n\n{judge_rules(ANSWER_DESTINATIONS, BUILD_RELEASE)}"), escalation_mark.after_mark(entries, 0), before_task, tuple(human_answers(entries, typed_answer)), task.removesuffix("\n\n"))
return Grounds(shown.removesuffix(f"\n\n{judge_rules(ANSWER_DESTINATIONS, driver)}"), escalation_mark.after_mark(entries, 0), before_task, tuple(human_answers(entries, typed_answer)), task.removesuffix("\n\n"))
+5
View File
@@ -411,6 +411,11 @@ class JudgeArchivedRuns(unittest.TestCase):
self.assertEqual((grounds.quotable, grounds.task), ("HEAD: Ship fast.", "Do it."))
self.assertEqual(grounds_of(self.PROMPT, self.ENTRIES).shown, "Worker chose option B.\n[human] Use Postgres.")
def test_splits_a_prompt_archived_before_the_rename_under_its_old_driver_name(self):
old = f"HEAD: Ship fast.\n\n{TASK_HEADING}Do it.\n\n{transcript_heading('loop-claude')}Worker chose option B.\n[human] Use Postgres.\n\n{judge_rules(ANSWER_DESTINATIONS, 'loop-claude')}"
grounds = grounds_of(old, self.ENTRIES)
self.assertEqual((grounds.quotable, grounds.task, grounds.shown), ("HEAD: Ship fast.", "Do it.", "Worker chose option B.\n[human] Use Postgres."))
def test_keeps_the_cost_and_the_run_of_a_rejected_reply(self):
rejected, _ = self.judged(evidence="Never said.")
self.assertEqual((rejected.cost, rejected.run.prompt), (0.25, self.PROMPT))