Skip to main content

Module notes

Module notes 

Source
Expand description

The AgentMux system notes agents get about cloud delivery, and the per-agent bookkeeping behind the resume note. Pure: times come in as unix ms, and hhmm is the one place they become wall-clock text.

Each note waits for its agent’s next turn (reactive::held_notes), one per Note::key: a pause that ends before that turn reaches the agent as one outage_note instead of a pause note and a resume note.

Every note starts with NOTE_MARKER. Only srv writes one: reactive::sanitize::neutralize_markers quotes the marker inside any jekt or forwarded text, the way it quotes [BROADCAST:.

Structs§

ExpiredItem
A message the relay dropped undelivered because it outlived its delivery window, as GET /reactive/pending/:agent_id reports it. No message text: it is a pointer to go and look, not something to act on.
Note
A note for one agent, ready to hold for its next turn.
NoteBook
Which agents were told delivery paused, and which still await their resume note.
RetryQueue
Notes that couldn’t be held (the agent wasn’t registered for a moment, say), retried on later ticks: the NoteBook has already counted them as told, so it won’t produce them again.

Enums§

ExpiredKind
NoteKind
What a note says, which decides the one slot it waits in (Note::key).

Constants§

DELAYED_AFTER_MS
A message delivered later than this after the relay received it is marked with when it was sent.
LIMITED_KEY
Where a note about messages left at the relay waits.
NOTE_ATTEMPTS
Tries for a note that couldn’t be held (one per tick), before it is given up with a warning.
NOTE_MARKER
How every AgentMux system note begins.
OUTAGE_KEY
Where an outage note waits.
PAUSED_KEY
Where a pause note waits.
RESUMED_KEY
Where a resume note waits.
RESUME_NOTE_GRACE_MS
How long after delivery resumes an agent waits for its first pull before its resume note goes out without a count.

Functions§

delayed_prefix
(sent 14:30, delivered 14:41) for a message delivered more than DELAYED_AFTER_MS after the relay received it; empty otherwise.
expired_note
The note for messages that expired outside a pause.
expired_summary
What expired, grouped: notices about pull requests as one list of PRs, everything else counted per sender. None when nothing expired.
hhmm
ms as local wall-clock time, HH:MM.
limited_note
The note an agent gets once, when it can work again after relay messages were left at the relay for it (first_ms to last_ms) because it was out of quota or signed out.
outage_note
The note an agent gets in place of a pause note still waiting for its turn when delivery resumes at until_ms. again: an earlier outage’s note, from since_ms, was waiting too.
parse_created_at
created_at (RFC 3339) as unix ms.
pause_note
The note an agent gets once cloud delivery has been paused a while.
resume_note
The note an agent gets when delivery resumes. delivered is None when its first pull after resuming didn’t come in time to count.
without_delayed_prefix
text without a delayed_prefix at its start: the message as the sender wrote it. A text that does not begin with one comes back as it is.