Skip to main content

Module jekt_held

Module jekt_held 

Source
Expand description

Replay of jekts held for an absent agent — SPEC_DURABLE_JEKT_DELIVERY_2026_09_24.md §2.3. The hold itself is in reactive::deliver; this delivers what was held once the agent is back.

Enums§

GateCheck 🔒
What the replay should do about a target’s sign-in, given when its gate was last checked (None: never refused).
ReplayOutcome 🔒
How one replay attempt ended.

Constants§

GATE_RECHECK_EVERY 🔒
How often a target the spawn gate refused is re-checked for sign-in.
MAX_ATTEMPTS 🔒
Failed deliveries to a present target before a held message is dropped.
PEER_PASS_LIMIT 🔒
Longest one replay pass for messages held for peers’ agents may take: it asks the relay about each agent whose machine is down, and a relay that does not answer costs seconds per agent.
REPLAY_PER_PASS 🔒
Deliveries per pass, so a backlog cannot monopolise the handler (and the first-contact spawn it may trigger) in one go.
SWEEP_EVERY 🔒

Functions§

gate_check_due 🔒
install 🔒
Replay held jekts: once now, then whenever an agent registers and every 30 s. Installed after AppState exists. The messages held for peers’ agents are replayed by a loop of their own, so a slow relay never delays the local replay.
is_spawn_gate_refusal 🔒
The spawn gate refusing a target is recoverable (it signs in), so the message is held, not dropped. Whether a delivery error is the target’s spawn gate refusing to start it (run_agent_turn’s “identity spawn gate: …”): not signed in. Recoverable once the receiver signs in (SPEC_JEKT_DELIVERY_STATES_AND_MAILBOX_2026_10_01.md Phase 0 item 4, G4).
mark_needs_login 🔒
Mark uid as refused by the spawn gate, checked just now.
needs_login 🔒
Targets the spawn gate refused, with when the gate was last checked.
replay_one 🔒
replay_pass 🔒
One pass: drop expired rows, then deliver to every target that is now registered, oldest first, at most REPLAY_PER_PASS. A target that is still absent costs a map lookup — no rate-limit token, no audit entry.
request_from_held 🔒
The request a held row is delivered as: addressed by the target’s UID, with the verdicts it was accepted with — never re-verified (a signature is valid for five minutes) and never raised — and its original send time.
routine_decision 🔒
decide for a routine message to an agent in status. The offline model API is asked apart from the cold-session rule: a cold session’s verdict is Wait Cold, which would otherwise hide it, and the replay would inject what was held for the API into a turn that fails.
still_needs_login 🔒
Whether uid is still waiting for sign-in. Runs the spawn gate quietly (no pane frame, no failure event) when a recheck is due.
target_decision 🔒
What a routine message to uid should do now: decide on the target’s status, the answer jekt_cold gives a message arriving at this moment, so replay and a fresh send agree. A read of its block, no gate check. It ends at the reset, a confirmed sign-in or an account move (SPEC_UNRESPONSIVE_AGENTS_2026_10_23.md §5). A target with no block is delivered to, as before.