Skip to main content

Module consent

Module consent 

Source
Expand description

Out-of-band consent (SPEC-ENGINE §3.8; C0 2.0 consent.schema.json, enums/consent-kinds.json, vectors/consent_*.vectors.json).

The engine creates every consent (RESOLUTIONS R16); a person answers it in a terminal, the Cockpit or the browser. No MCP action can approve: approval lives only in broker::Broker::approve, which takes a Proof that only an approval channel produces.

  • Kind: the two kinds the engine uses, equal to the embedded list (the kinds of the C0 fixture the engine knows; any other is unknown).
  • Record: one request with its decision and its proof, stored <config>/cloud/consent/<id>.json (0600); broker verifies the proof on every read.

Re-exports§

pub use broker::Broker;
pub use broker::Trust;

Modules§

broker
consent::Broker (SPEC-ENGINE §3.8.1): creates requests, stores the person’s decisions with their proof, and checks that proof on every read. A record whose proof fails is ignored and the step returns consent_record_invalid; a hand-written state: approved file therefore has no effect on an os_presence host.
channel
The CLI approval channel (SPEC-ENGINE §3.8.2, first row).
chat_key
The device chat key (rc4-32): an Ed25519 key that lives only in LeanCTX Code and signs the person’s posts (leanctx.cloud.person_publish.v1).
helper_mac
Client of LeanCTX Consent.app (SPEC-ENGINE §3.8.5): the only signer of consent proofs on macOS. The engine checks the helper’s code signature (Team ID pin) before every use, starts it with a private socket and a session secret on stdin, and asks it over JSON-RPC lines.
optin_key
The opt-in key (rc4-16, owner decision 24.11.): an Ed25519 key that lives only in LeanCTX Code (its Keychain) and signs the person’s “turn task pickup on” without a prompt per click.
person_sign
What the person at this Instance signs with its bound presence key, so the Cloud can tell the person from the agents that share the instance token (a person’s publish first; opt-ins and decision changes follow with their own domains).
task_key
The app’s task-propose key (rc4-67): an Ed25519 key that lives only in LeanCTX Code and signs the person’s own task proposals (leanctx.cloud.task_propose_person.v1).
web
Web channel lean-ctx cloud consent --web <id> (SPEC-ENGINE §3.8.2 “Web channel flow”, RESOLUTIONS R49, R61, R82).

Structs§

PresenceSignature
The presence-key signature of an approval (§3.8.4).
Record
One consent request and its decision.

Enums§

Channel
How a decision was made (enums/consent-channels.json).
ConsentError
Why a consent-gated step did not run. code() is the C0/engine error code; Display is the person-facing text of SPEC-ENGINE §3.17.
Kind
The C0 consent kinds (C0 2.2): sharing a checkout into a vault and storing an API key.
Proof
Exactly one proof per approved record (§3.8.1).
State

Constants§

PROOF_DOMAIN
Domain of a presence-key signature (§3.8.1, form (b) of §3.8.3).
REQUEST_TTL_MS
A request may be answered for 24 h.
STATEMENT_DOMAIN
Domain and schema of a Cloud-signed web answer (§3.8.2 step 5).
STATEMENT_SCHEMA

Functions§

check_subject
The subject carries exactly the kind’s fields (no isolation, R107), each of the type the schema gives it.
is_consent_id
new_consent_id
cns_ + 16 lowercase base32 (80 random bits).
subject
Build a subject from its fields (callers name each one).
subject_digest
hex(blake3(canonical_json(subject))).