1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//! The process-level **unbridled** marker (ADR 0018 D1/D5 — epic #139 I12).
//!
//! Unbridle is the operator's explicit escape hatch: drop the confinement
//! *mechanism* (the L3 OS sandbox) so the agent can use the host's native
//! shell/tools, while the OCAP authority grant (checked by the L2 interceptor,
//! now advisory) and the human step-up gate stay in force. This marker records
//! that decision **once, at startup**, after the loader has verified the two-key
//! acknowledgement (ADR 0018 D3). The tool layer reads it to (a) skip the OS
//! sandbox and (b) stamp `disclosure.unbridled` on every envelope.
//!
//! It is a **process mechanism, not per-invocation authority**: it deliberately
//! does *not* ride [`crate::ToolContext`] (authority≠mechanism, ADR 0017 D1). It
//! defaults to **bridled** and is *never* reachable by omission — only an
//! explicit [`set_unbridled`] from an acked loader path flips it.
use OnceLock;
use ;
/// The **human-gate posture** an unbridled run still enforces (ADR 0018 D9/D11) —
/// the step-up floor the host will demand for a HIGH-consequence act. Distinguishes
/// the two unbridled postures: `Passkey`/`Prompt` = *Supervised-free* (the human
/// leash remains); `None` = *Autonomous* (no human in the loop — reachable only via
/// the distinct second ack, D10). Disclosed on every envelope (R5).
static UNBRIDLED: = new;
static HUMAN_GATE: = new;
/// Mark this process **unbridled** (confinement mechanism off). Call this once,
/// from the loader, and **only** after the acked two-key opt-in has been verified
/// (ADR 0018 D3). Idempotent: a second call is a no-op (the first wins).
///
/// This never widens *authority* — the granted [`crate::Caveats`] are unchanged;
/// it only signals that the L3 mechanism is off so the tool layer runs native and
/// discloses honestly.
/// Whether this process is running **unbridled**. Defaults to `false` (bridled) —
/// confinement stays on unless an acked loader path explicitly called
/// [`set_unbridled`].
/// Set the process **human-gate posture** (ADR 0018 D10/D11). Call once, from the
/// loader; `HumanGate::None` (Autonomous) is legal **only** when unbridle is also
/// engaged *and* the distinct no-step-up ack was supplied — the loader enforces
/// that before calling this. Idempotent.
/// The process human-gate posture. Defaults to [`HumanGate::Passkey`] — the human
/// leash is assumed **on** unless an acked path explicitly removed it, so the
/// Autonomous posture is never reached by omission.