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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//! Which stamped call may ask the vault for a label, and under which two
//! scopes.
//!
//! A call is eligible in exactly three forms, and every other call is
//! ineligible and never reaches `resolve`:
//!
//! 1. **Direct Head**: a Classic call whose route carries the head agent's own
//! stamp. Authorization and lifetime scopes are both that stamp.
//! 2. **Direct Worker**: the same for a worker's stamp. Both scopes are the
//! worker's own `(owner, Worker, ref, epoch)`, so a worker's grant never
//! covers its head or a sibling.
//! 3. **Bound codemode**: a Codemode call that `codemode::admit`/`resolve_owner`
//! already bound to a live head route. The lifetime scope is the run's
//! Ephemeral stamp, and the authorization scope is the head route's, so the
//! program cannot outlive its own lifetime.
//!
//! Ineligible: no stamp, a standalone call, a plugin-only route, another
//! owner, a flow-read scope, and any Ephemeral stamp on a non-codemode identity
//! (parented or not).
//!
//! Both scopes here are rebuilt from the daemon's stamp on every call. Nothing
//! is read from tool arguments or from a session id. A background command
//! resolves its scopes once at launch and keeps them, which is why
//! [`CallScopes`] owns plain data instead of borrowing the route.
use crateSecretScope;
use ScopeKind;
/// The two scopes one eligible call asks the vault under.
/// Which of the three eligible forms a call took.
/// Why a call may not ask the vault. Every variant maps to
/// `secret_refused`, and to no `resolve` call.
/// Whether `stamp` is a Prefrontal stamp of one of `kinds`.
///
/// This is `access_grants::alfonso`, the daemon-facing predicate the rest of the
/// route policy uses, narrowed to the kinds a command runs under. It is
/// repeated here because that function is private to its module, and the
/// eligibility answer is the vault seam's own.
/// The kinds a stamped command runs under; an Ephemeral stamp only qualifies
/// inside a bound codemode run.
pub const COMMAND_SCOPE_KINDS: =
;