Expand description
The cross-instance agent bus: the local bus (ctx_agent) of every
machine of an organization joined through Cloud.
One relay per machine runs in the daemon (spawn); it never runs in a
tool call. Offline, the local bus keeps working exactly as before; on
reconnect the relay catches up from its cursors and republishes what is
pending (Cloud deduplicates by client_msg_id).
Modules§
- address
- Bus addresses (SPEC-ENGINE §3.7.1, C0 2.0
bus.schema.json$defs/address). Only an explicitly addressed message leaves the machine; no address,localor a local agent id stays on the local bus. - control
- Bus controls from Cloud (
hold,stop,veto,resume) and the admission answers derived from them. - exchange
- Agent exchange through LeanCTX Cloud (Welle 4, contract §40): the rules
every knowledge item (
finding) and task hand-over (handoff, with itsquestion,offerandanswerconversation) passes when it leaves this machine for another machine’s agent or person, or arrives from one, and the audit record each exchange leaves. - handoff
- The handoffs this machine offered through Cloud.
- leases
- Cross-instance leases through Cloud (C5c).
- messages_
v2 - Typed agent messages on a C0 2.0 Cloud (bus v2, E14):
ctx_agent sendandreplybecomeplace.publishframes to the vault bus of the checkout. - person_
rules - What an agent may never say on the bus (process v1 §7): no approval or decision in a person’s name, no refused action passed on to another agent, and only the registered Queen appears as the Queen.
- plan_
body - The plan body
leanctx.plan-body/v1(contract §37.3) and its publish (lean-ctx cloud plan publish, §37.10). - plan_
events - Plan updates to running agents (contract §37). A person changes the plan or a team decision in LeanCTX Code; Cloud tells every engine of the vault with a text-free frame:
- plan_
view - The plan versions this instance applied, with what its agents answered,
for a local reader (kind
cloud.plan.updates, contract §37.6). - presence
- Who works where: the workers of other machines on the vault buses this
machine follows, as Cloud reports them in
presence.updateframes.ctx_agent listshows them under the local agents; a message or a handoff addresses one by its worker id (wkr_…). - queen_
kinds - The Queen network’s message kinds on agent-bus/1 (QN0) and the Queen relay rule (HN0).
- relay_
v2 - The bus v2 relay’s decisions (C0 2.0 section 3; SPEC-ENGINE §3.7):
which vault buses this machine subscribes, the hello with its presence,
which local posts become
place.publishframes, how deliveries land and which Cloud-signed controls hold a worker. - task_
events task.eventframes (C0 2.2 §10.1): Cloud tells every engine of a vault when one of its tasks changed. The engine outdates its task cache (the nextctx_tasksread fetches the task again) and hands the work to its own agents on the local bus, so agents orchestrate tasks themselves:- v2
- Bus v2 wire shapes the engine sends and reads (C0 2.0 section 3,
bus.schema.json; SPEC-ENGINE §3.7): typed messages on vault buses, Cloud-signed controls and presence. - veto
- A maintainer’s veto of a host handoff or lock (SPEC-ENGINE §3.7.4, V9.5
phase A): a verified
controlframe withaction = vetoand arefof kindlease(a bus lock) orhandoff.
Structs§
- Report
- Where a relay says what it does. The foreground
cloud bus relayprints it; the daemon’s relay is quiet (its errors reachcloud status). A line equal to the one said last is not repeated, so a relay that waits says why once, not on every tick.
Functions§
- run_for
- Run the relay in the foreground for
duration(lean-ctx cloud bus relay --for <seconds>), e.g. to watch it or in tests. When another relay (the daemon’s) already runs, nothing runs here andOk(false)says so: the caller then asks that relay to announce now.reporthears what the relay sends (each hello’s workers, roles and buses) and why it sends nothing, when it does not. - spawn
- Start the bus relay thread when this machine is connected. While the
bus is off or Cloud is disabled it waits and sends nothing; rc4-82: a
daemon started with
bus = "off"used to stay without a relay for its whole life, so turning the bus on later never reached the team.