Skip to main content

Module follower

Module follower 

Source
Expand description

The turn follower: a delivered run follows its pane’s agentturn events (blockcontroller::health::TurnLedger) to the end of the turn it started or joined, and takes that turn’s cost, output tokens and steps (spec §3.2).

One task applies arms and turn events in the order they arrive. An arm also reads the pane’s latest ledger from the broker’s history, so a turn that opened while the fire was being delivered, before the arm, is not missed. Applying the same ledger twice changes nothing.

Structs§

Armed
A run waiting on its pane’s turn.
Follower
The follower’s handle: arms go to its task.
TurnSeen
The fields of one agentturn payload the follower reads.

Enums§

Effect
What a turn event means for one armed run.

Constants§

NO_TURN_AFTER_MS
A delivered run whose pane shows no turn for this long is closed with its cost unknown: a pane with no turn ledger (a terminal agent) never reports one.

Functions§

on_turn
Apply t to a. Pure, so the rules are testable without a broker.