Measure each chunk's reading cost from its transcript and keep it in the comprehension history

This commit is contained in:
2026-10-08 15:40:43 +02:00
parent cefb297e14
commit 1b8142e7e5
14 changed files with 400 additions and 12 deletions
+2 -1
View File
@@ -12,6 +12,7 @@ from loop_claude.cycle.judge import judge
from loop_claude.project.model_choice import Models
from loop_claude.paths import Paths
from loop_claude.claude_code.transcript import read_transcript, render
from loop_claude.cycle.reading_cost import record_reading
from loop_claude.cycle.retry import retried
from loop_claude.cycle.worker import run_worker, worker_args
from loop_claude.stop import Stop
@@ -111,7 +112,7 @@ def close(cycle: Cycle, transcript_path: str, verdict: Finished | Unfinished) ->
finished = isinstance(verdict, Finished)
if failure := archive(cycle.project_key, transcript_path, cycle.task, f"Verdict: {'finished' if finished else 'unfinished'}\n\nEvidence:\n{quoted(verdict.evidence)}", cycle.effects.now(), cycle.paths):
return Stop(1, failure.reason)
if finished and (failure := delete_session(cycle.session)):
if finished and (failure := record_reading(cycle.project_key, transcript_path, cycle.effects.now(), cycle.paths) or delete_session(cycle.session)):
return Stop(1, failure.reason)
return Archived()