Skip to main content

Module host_note

Module host_note 

Source
Expand description

Host-authored notes the session records into history as plain user-role text, recognised by their exact generated wording (like the interruption markers in synaps_engine::engine::interrupt), never by a host key.

A host key (_synaps_context) would make a rolled-back 0.10.2 take the note for a context-archive marker and refuse every turn under Axel memory, so the note stays ordinary text on disk and on the wire. Readers that must not treat it as something the user said (turn starts, archive projection, memory capture) ask is_tool_in_flight_note.

Constants§

CANCEL_PHRASES
Every cancel phrase a note can lead with: the engine’s CancelCause::phrase values, plus the generic one for reasons without a live cancel. The engine pins that its phrases are all listed here.
UNRECOGNISED_TOOL
How the note names a tool whose name isn’t a plausible tool name.

Functions§

is_plausible_tool_name
A name the note may quote: what tool wire names look like (ToolRegistry exposes [A-Za-z0-9_-]{1,128}), plus . and : for runtime-style names. The name comes straight from the model’s call, so anything else (a backtick, a newline, an overlong string) is never copied into a user-role message: it reads UNRECOGNISED_TOOL.
is_tool_in_flight_note
A user-role history message whose string content is exactly a tool-in-flight note.
tool_in_flight_note_label
text without its brackets iff it is exactly a note tool_in_flight_note_text generates: a single line, a known phrase, one or more names that are each a backticked plausible tool name or UNRECOGNISED_TOOL, and nothing else. Checked by regenerating the note from the names it contains, so there is no free-form part. None for anything else.
tool_in_flight_note_text
The note a cancel records for tool calls the interrupted response made when the engine never reported back on them: the engine’s canceled tool_result wording, hedged to “may have already started” because the host can’t tell whether the call began. One line.