Skip to main content

Module control

Module control 

Source
Expand description

Bus controls from Cloud (hold, stop, veto, resume) and the admission answers derived from them.

The relay keeps the controls whose signature verifies against a Cloud key of purpose control in state_v2.json (StateV2); tool admission, the lease and handoff paths and cloud status only read them. Rules:

  • hold and stop pause an agent: a worker control the agents attached to that worker, a bus control every agent here (a tool call names no vault). stop wins over hold; resume ends both.
  • veto refuses the lease or handoff its ref names (super::veto).
  • A control only pauses Cloud traffic: Cloud tools (ctx_tasks), bus messages, the Cloud side of a lease and a handoff through Cloud. Local tools, local leases and handoffs on this machine are never refused (connector rule “local work is never gated”), online or offline.
  • Controls apply only while this machine is enrolled and its lease is valid (plan C rule 2: local work never depends on Cloud state); cloud status names the reason when they do not.

Bus controls are org coordination between cooperating agents, not a security boundary: whoever controls this machine can edit these files. Enforcement that must hold belongs to the runtime/policy path (org policy, role and policy guards). That is also why the lapse check reads the stored lease without re-verifying its signature: it can only switch controls off, never on.

A damaged state_v2.json, or one of a version this build does not know, is never read as “no controls” (RB8 M12): until Cloud’s replay of the controls in force after the relay’s next hello is complete, Cloud traffic waits under a “waiting for Cloud” hold; local work goes on.

Network-free and deterministic.

Structs§

ActiveControl
A control that is in force, for cloud status.
Kept
The controls kept for this machine (a resume is never kept, oldest first) and, while state_v2.json was found damaged or of an unknown version and Cloud has not answered a hello since, since when (M12).
Refusal
Why a call is refused.

Enums§

Inactive
Why the controls kept here do not apply.

Constants§

ALL_AGENTS
Target of a control on every agent of this machine.

Functions§

admission
Admission for a mutating tool of agent_id on this machine: a hold or stop on its worker or on a whole vault bus, or the hold of a pending rebuild. The tool call names no vault, so a bus control of any vault linked here holds the Cloud traffic of every agent; a stop wins over a hold.
current_at
The controls kept for this machine and whether they apply at local_now. Empty and active when there are none. A damaged or unknown file is read, without changing it, as a pending rebuild: never as “no controls”.
held
The hold or stop of controls on agent_id’s worker or on a bus.
status_at
For cloud status: a pending rebuild’s hold first, then the controls in force, oldest first (a worker control names its worker, a bus control every agent), or why the ones kept here do not apply (None when there is nothing to say).
status_view
cloud status --json: the controls in force, or why the ones kept here do not apply.
tool_refusal
The admission hook of the tool pipeline: Some(message) refuses tool for agent_id. Only Cloud tools are ever refused; missing or unreadable local state never refuses.
veto_refusal
The veto hook of the Cloud side of a lease (acquire, renew) and of a handoff through Cloud: Some when a verified veto names any of refs (lease id, resource ref, handoff id; V9.5). The caller then skips the Cloud request; the local lease or handoff goes ahead.