Expand description
Transcript budget enforcement and recovery.
A self-contained slice of the session transcript concern: given a
candidate transcript and a session’s SessionTranscriptBudgetPolicy,
decide whether it fits under the message/event/byte caps and, if not,
recover by rejecting, trimming, or LLM-compacting it — attaching an
audit event that records the before/after usage. Extracted verbatim
from agent_sessions (behavior-preserving); the module operates on
VmValue transcripts and the session’s policy, reaching into
SessionState only for the transcript field, the pinned policy, the
last-action audit slot, and the id.