Called once per user turn, before the tool loop.
Optional scopesThe scope ids of a turn, by the session's rule, without counting the turn: the pipeline asks it for the standalone
retriever and sink before the GMI prepares the turn, and a turn of another user or namespace latches the session's
loss of its learner here as prepareTurn does.
Optional recordRecords a memory write: the freeze, the tombstone, a pending row, the write, the tombstone again, the verdict.
turn is the turn the write belongs to; without it, the session's own state (its learner unless a turn of
another user or namespace ended it).
Optional turn: SelfChangeTurnOptional guardRuns a write of the user's memory inside the user's write chain, with the tombstone read before and after it. A
store that cannot be read refuses the write (store_unavailable), so nothing is filed that a deletion could miss.
Optional turn: SelfChangeTurnOptional isWhether a freeze holds right now (AGENTOS_LEARNING_FREEZE=1, mode frozen, a run-time freeze) for the turn's
scope: the learner's on a learner's turn, the agent's on a turn with none; without turn, the session's own.
Optional turn: SelfChangeTurn
One session's view of the layer: what a GMI calls around its turns.