Answer the principles audit: keep every session file under session/, and stop on a folder the archive cannot read
This commit is contained in:
@@ -45,7 +45,7 @@ def run_cycle(cycle: Cycle) -> Stop | None:
|
||||
def stopped(cycle: Cycle, stop: Stop, why: str) -> Stop:
|
||||
path = transcript_file(cycle.session)
|
||||
failure = archive(cycle.project_key, path, cycle.task, f"Stopped: {why}", cycle.paths) if path else None
|
||||
# When the stop is itself a failed archive, archiving again fails the same way: say it once.
|
||||
# A failed archive exits 1 whatever stopped the loop; one that is the stop itself fails the same way again, so say it once.
|
||||
return Stop(1, f"{failure.reason}\n{stop.reason}".rstrip()) if failure and failure.reason != stop.reason else stop
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ def rule(cycle: Cycle, transcript_path: str) -> Ruled | Stop:
|
||||
|
||||
|
||||
def ask(cycle: Cycle, transcript_path: str, question: str) -> Answered | Stop:
|
||||
# Archived now, so the transcript the question was asked on is kept with it; the interrupt appends the answer.
|
||||
# Archived now, so the transcript the question was asked on is kept with it; the human's answer then grows the transcript.
|
||||
if failure := archive(cycle.project_key, transcript_path, cycle.task, f"Verdict: interrupt\n\n{question}", cycle.paths):
|
||||
return Stop(1, failure.reason)
|
||||
return interrupt(cycle.root, cycle.session.id, cycle.models.worker, transcript_path, question, cycle.paths, cycle.effects) or Answered()
|
||||
|
||||
Reference in New Issue
Block a user