Class: Xeno::TurnRunner
- Inherits:
-
Object
- Object
- Xeno::TurnRunner
- Includes:
- Compaction
- Defined in:
- lib/xeno/turn_runner.rb
Overview
Drives one turn to completion or to a park, checkpointing every move in the database. Uses
RubyLLM's decomposed loop — generate, self-executed tools, add_message injection — and never
run_tools (no approval gate, no per-call checkpoint) or complete (a turn must bound its
model calls).
Invariants:
- A tool execution and its transcript injection commit in one transaction; recorded calls are never re-run.
- Every write is fenced on the claim token; a zombie affects zero rows.
- Trailing blank assistant rows (mid-generate crash artifacts) are removed before anything else.
Constant Summary
Constants included from Compaction
Compaction::COMPACTION_PROMPT, Compaction::SUMMARY_PREFIX
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#turn ⇒ Object
readonly
Returns the value of attribute turn.
Instance Method Summary collapse
-
#initialize(turn, definition: Xeno.definition) ⇒ TurnRunner
constructor
A new instance of TurnRunner.
- #run ⇒ Object
Constructor Details
#initialize(turn, definition: Xeno.definition) ⇒ TurnRunner
Returns a new instance of TurnRunner.
20 21 22 23 24 |
# File 'lib/xeno/turn_runner.rb', line 20 def initialize(turn, definition: Xeno.definition) @turn = turn @session = turn.session @definition = definition end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
18 19 20 |
# File 'lib/xeno/turn_runner.rb', line 18 def definition @definition end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
18 19 20 |
# File 'lib/xeno/turn_runner.rb', line 18 def session @session end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
18 19 20 |
# File 'lib/xeno/turn_runner.rb', line 18 def token @token end |
#turn ⇒ Object (readonly)
Returns the value of attribute turn.
18 19 20 |
# File 'lib/xeno/turn_runner.rb', line 18 def turn @turn end |