Skip to main content

Module effective_policy

Module effective_policy 

Source
Expand description

Unified Control on the engine (Release B 3.1.4, 3.1.6): receive, verify, apply and acknowledge the signed effective policy a 2.x Cloud adds to GET /v1/policy/bundle (effective_policy).

  • Verification (verify): the bundle names this engine’s org and instance; its key is a key-set v3 key of purpose policy that was valid when the bundle arrived; the signature covers the raw bundle; the digest is the policy’s own; the version only grows — a lower version, or the same version with another digest, is a downgrade and refused.
  • A refused bundle (or one dropped to null once a policy is in force) never replaces the last valid one. That one stays installed (super::effective_floor) and keeps restricting local work, also offline and after not_after.
  • After installing, the engine acks {version, digest, unenforced} (POST /v1/policy/ack); unenforced lists every member it received but does not enforce. A failed ack is retried on the next pull.
  • Sensitive operations (team sharing, a new trust boundary, rights expansion: the consent kinds of sensitive_kind) fail closed when the policy’s authorisation has expired or the policy in force is missing or damaged (sensitive_gate).
  • Agents never change it: only the scheduler/cloud sync pull writes these files, no MCP tool reaches them, and a local pack can only tighten the floor. Cloud enforces on paths through LeanCTX only.

A 1.x Cloud (prod until the cutover) sends no effective_policy; then nothing here runs and the 1.x policy path is unchanged.

Structs§

AckRecord
The answer to an ack of this version.
EffectiveState
What the engine keeps of the effective policy in force (in the policy state, <data_dir>/cloud/policy/state.json).
RefusalRecord
A refused bundle as Cloud hears of it (SERVER-B4 refused): once per received version and digest, with the bundle the engine keeps.

Enums§

Verdict
The verdict on a received bundle.

Functions§

ack_with
Ack the installed version once (again after a failure, or once a newer version is in force). Only after install: the ack says “applied”.
install
Install a verified bundle under cloud_data: the floor first, then the requirement (a crash in between leaves an older requirement, which the newer floor satisfies).
receive
Take the effective_policy of a pulled bundle response into state (which starts as the previous state’s copy): verify, install, record. Never fails the pull; a refusal is recorded and the last valid policy stays. false when the response’s effective policy was not taken (refused, or dropped while one is in force): the pull then keeps no ETag of it, so the next pull fetches the bundle in full.
report_refusal_with
Tell Cloud once that this engine refused the bundle record names (again after a failure). Only a 2.x Cloud sends effective policies, so only one ever gets a refusal.
sensitive_gate
Whether a sensitive operation may go on under the Cloud policy in cloud_data: never once an installed policy’s authorisation expired (now ≥ not_after), nor while the policy in force is missing or damaged. Without any installed Cloud policy (1.x, or never sent) there is nothing to check.
sensitive_kind
Consent kinds that are sensitive operations: they open a new trust boundary, share with a team or the public, or expand rights.
status_lines
cloud status lines of the effective policy, deterministic in state, now and the installed files; with project_root, also the local settings there that the Cloud policy overrides.
verify
Verify raw (the effective_policy object as received) for this engine. received_at is the service time in ms.