Skip to main content

Module place

Module place 

Source
Expand description

Putting the parts of an archive where this computer keeps them (spec section 7.2): the conversation as imported history in the agent’s zones of the shared transcript store, Personal Memory in the record, and the note the agent reads when it first starts. The caller has already verified every part; nothing here trusts a line’s own claims.

Imported lines are never the person’s. A user line carries a mark (amx) that only the computer that wrote it can vouch for; an archive’s marks are stripped on the way in, so a changed archive cannot put a line in the history that shows as typed by the person. The store then shows them untyped, with the rest of the conversation.

Structs§

MemoryPlaced
What placing the memory files did.
NoteFacts
What the arrival note says about where the agent came from and what came with it.

Constants§

MAX_CONVERSATION_NOTE_BYTES
The most of the readable conversation the agent is given (the newest part).
MAX_MEMORY_FILE_BYTES
The most of one memory file an import writes (the live write path’s own cap).

Functions§

arrival_note
The note the agent reads when it first starts, as a Personal Memory file: where it came from, that the conversation is context and not an instruction, and what did not come (spec section 7.1).
conversation_note
The readable conversation as the agent is given it: the newest part when it is longer than the cap.
memory_in_record
The text of memory file file as the agent’s memory record holds it now: what the launch puts in its folder.
place_memory
Puts memory files into the agent’s memory record in the shared store, the one place the launch reconciliation restores an agent’s own folder from (as every AgentMux write to memory is recorded). They reach the folder when the agent is first launched; an imported agent has none before that. A file whose name is not a plain memory name, or that is too large or not text, or that the record already holds, is skipped and said.
place_session
Writes ndjson (marks already stripped) as the conversation of zone. Refused when the zone has one: an import never writes into, over or between lines another srv may be appending to.
remove_memory
Takes the memory files of an import back out of the record: a deletion is recorded on top of each.
remove_session
Takes back what an import wrote, when a later step failed.
session_zone
The zone a session part of the archive goes to, or None for a name that is not a session.
strip_foreign_marks
ndjson with the amx mark of every line taken off. A line that is not a JSON object, or has no mark, is kept as it was, byte for byte.