Answer prose round 1: 0 🔴, 9 🟡 (0 misread); split the interrupt entry, unstack the decisions' lists, say why Cycle's fields and the package's modules stay at one level, name the import cycle, and say how the judge's quotes are checked
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""loop-claude: headless claude cycles, judged, that interrupt the human only for a decision that is theirs (loop/main.py's help).
|
||||
|
||||
Its packages hold one concern each: cycle/ runs a cycle, loop/ runs the cycles, project/ reads a checkout's files, and waiting/ shows a question to loop-inbox. The modules at this level are those more than one of them imports, and loop-inbox imports several. A reader finds each by its name, so they stay at one level: docs/decisions.md → `principles: about seven things per level, …`.
|
||||
Its packages hold one concern each: cycle/ runs a cycle, loop/ runs the cycles, project/ reads a checkout's files, and waiting/ shows a question to loop-inbox. Each module at this level is imported by more than one package, and loop-inbox imports several. A reader finds a module by its name, so the modules stay at one level. docs/decisions.md → `principles: about seven things per level, …` allows that.
|
||||
"""
|
||||
|
||||
@@ -97,7 +97,7 @@ class Rejected(Failure):
|
||||
|
||||
|
||||
class Grounds(typing.NamedTuple):
|
||||
"""The texts quotes_checked holds the judge's quotes to, word for word, since stitched fragments can say what their source does not."""
|
||||
"""The texts quotes_checked checks the judge's quotes against. A quote must appear in its text as written, since a quote reworded or stitched together can say what its source does not; only the evidence may join passages with an ellipsis, each passage in order."""
|
||||
# The transcript as the judge saw it.
|
||||
shown: str
|
||||
# The worker's own lines after the escalation mark, as escalation_mark.since_step renders them.
|
||||
@@ -192,7 +192,7 @@ def cost_of(reply: dict) -> float:
|
||||
|
||||
|
||||
def quotes_checked(verdict: Verdict, grounds: Grounds) -> Verdict | Failure:
|
||||
"""The verdict with each quote it makes held to the text that must hold it, word for word:
|
||||
"""The verdict with each of its quotes checked against the text it must appear in, as written:
|
||||
|
||||
| Quote | Must be in | Where it isn't |
|
||||
|---|---|---|
|
||||
@@ -200,7 +200,7 @@ def quotes_checked(verdict: Verdict, grounds: Grounds) -> Verdict | Failure:
|
||||
| a quoted answer | grounds.quotable | the question goes to the human as an interrupt, which keeps the escalation the answer carried |
|
||||
| the escalation | grounds.shown and grounds.since_step | the escalation is dropped, so the worker's rung holds, as escalation_mark.checked says |
|
||||
|
||||
Only a misquoted evidence fails: the other two misquotes would otherwise exit an unattended loop.
|
||||
Only a misquoted evidence fails. A Failure for either of the other two would exit an unattended loop, so each changes the verdict instead.
|
||||
"""
|
||||
if not grounded(verdict.evidence, grounds.shown):
|
||||
return Failure(f"the judge quoted {verdict.evidence!r}, which is not in the transcript" + (f", for the question: {verdict.question}" if isinstance(verdict, Interrupt | QuotedAnswer) else ""))
|
||||
|
||||
@@ -24,7 +24,10 @@ from model_routing import worker_rungs
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Cycle:
|
||||
"""What a cycle runs on, which no step changes but the route. Each step reads the few fields it needs by name, so they stay at one level: docs/decisions.md → `principles: about seven things per level, …`, more where a reader finds them by name."""
|
||||
"""What a cycle runs on. run_cycle replaces the route on a ruling's step-up; nothing changes the other fields.
|
||||
|
||||
Each step reads the few fields it needs by name, so the fields stay at one level. docs/decisions.md → `principles: about seven things per level, …` allows more than seven where a reader finds them by name.
|
||||
"""
|
||||
effects: Effects
|
||||
# What chunk-preflight found, or why it could not run, for a fresh worker's prompt; empty when the session was open as the cycle began.
|
||||
facts: str
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""The effects loop-claude reaches the world through: its terminal, clock, processes and git. loop-inbox runs on them too (bin/loop_inbox/main.py), so a change here, such as to how input reads a line, changes both tools."""
|
||||
"""The effects loop-claude reaches the world through, such as its terminal, clock, processes, git and the machine's memory. loop-inbox runs on them too, so a change here, such as to how input reads a line, changes both tools."""
|
||||
import dataclasses
|
||||
import os
|
||||
import select
|
||||
|
||||
@@ -80,9 +80,8 @@ loop to close one measures every finished chunk there, with no model run, and wr
|
||||
routing-figures.md at the archive's root (bin/routing_figures/measure.py). Each call the figures
|
||||
make for a routing change, unless raised before, is an interrupt: claude, on the project's model,
|
||||
on the terminal in the setup's development clone, ~/code/claude-config, asked to put the calls to
|
||||
the human; loop-inbox lists it too. Once
|
||||
that claude ends, the calls are listed in routing-calls-raised.md beside the figures, and not
|
||||
raised again. Off a terminal, the calls are said on stderr, the loop goes on, and they are raised
|
||||
the human; loop-inbox lists it too. Once that claude ends, the calls are listed in
|
||||
routing-calls-raised.md beside the figures, and not raised again. Off a terminal, the calls are said on stderr, the loop goes on, and they are raised
|
||||
again at the next measurement.
|
||||
|
||||
A change to bin/loop-claude or any bin/**/*.py takes effect at the next cycle boundary, once
|
||||
|
||||
@@ -7,7 +7,7 @@ worker took in, each listed once. loop-inbox lists a loop, and its question (wai
|
||||
lock. So a killed loop drops off the list, though its files stay until loop-inbox removes them: <session>.running
|
||||
through drop_ended_loops here, and the question through waiting.listing.drop_ended.
|
||||
|
||||
These files, waiting/ and session_lock.py are loop-claude's state, which loop-inbox reads. They stay in loop_claude/: they run on its effects and hand_over.py, so a package of their own would import loop_claude back.
|
||||
This module, waiting/ and session_lock.py hold loop-claude's state, which loop-inbox reads. They stay in loop_claude/ because they import its effects.py and hand_over.py: a package of their own would import loop_claude, and loop_claude would import it, a cycle.
|
||||
"""
|
||||
import contextlib
|
||||
import dataclasses
|
||||
|
||||
Reference in New Issue
Block a user