Answer the principles audit: keep every session file under session/, and stop on a folder the archive cannot read

This commit is contained in:
2026-10-02 17:10:03 +02:00
parent 6ccd5b190f
commit 4620d2e29b
8 changed files with 76 additions and 28 deletions
+2 -2
View File
@@ -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()