Canonical internal messages for goal state and work continuation.
Prefix for synthetic human messages (e.g. interrupt cancellation notices).
Such messages are written to the messages channel for the agent's benefit on
resume but are not user-authored, so they are filtered out of both the rendered
transcript and a thread's initial prompt. Shared here so the single producer
(textual_adapter) and its consumers (app, sessions) agree on one literal.
Return ordinary text from a local or serialized message.
Return message metadata from a local or serialized message.
Return a message's lc_source value when present.
Return whether a local or serialized message has the human role.
Return whether a message is a goal-state notice or continuation.
Return whether a message claims to be a goal-state notice.
Return whether the latest human turn carries an unsaved goal fallback.
Return whether a message should be omitted from derived transcripts.
Return whether a message is hidden from user-facing session history.
Build a one-time goal continuation.
Project authoritative channels into deterministic notice state.
Serialize authoritative notice state with canonical JSON formatting.
Return a stable digest for authoritative goal/rubric state.
Return whether state contains a goal or an active rubric.
Build one canonical append-only goal/rubric state notice.
Return validated canonical notice metadata from a message.
Return the newest valid notice and its raw-history index.
Return the newest goal-state source index, including invalid messages.