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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
//! Derived capability levels and the signing readiness they come from.
//!
//! Design `stikk-04` AC-01…04, OPL-04. stikk has no accounts. What a session may do is *derived*
//! per session from prikk-side facts — which signing roles are ready, and whether read-only mode is
//! on — and is displayed, never stored. The capability is checked twice (design OPL-04): once to
//! decide UI affordance, once at the seam before a mutating call, because readiness can lapse between
//! render and click.
//!
//! Critically, [`Readiness`] records only **whether** a role's key material is present, never the
//! material itself (threat model C-I1, data model LC-13). This type cannot hold a secret.
/// Whether prikk's repository-side trust policy has adopted a MAINTAINER key (design `FR-104`; RFC
/// 016 F2/F3).
///
/// Presence of `PRIKK_MAINTAINER_KEY_ID`/`_SEED` in the environment is necessary but not sufficient:
/// prikk's `verify_signer_trusted` also requires the key to be **adopted** in the repository's trust
/// policy before a MAINTAINER-gated operation succeeds. **Adoption is object trust, not ref
/// authority** — prikk accepts that key's signatures on objects; adopting a key never lets it move a
/// ref (`RefStore::publish` still requires this operator's own signature). Say so wherever this state
/// is named; wording that lets a reader conclude "may publish here" is a defect (prikk RFC 138 §7.3).
///
/// No supported prikk (0.28–0.33) exposes a way to check adoption ahead of attempting the gated
/// operation itself (RFC 016 F3): `prikk trust maintainer` offers only `add`/`remove`, and `verify`'s
/// `sealed-block <id>: <key_id>` line is historical signer attribution — a since-revoked key still
/// prints — not current policy, and does not exist before a repository's first seal, which is exactly
/// when this question is asked. So today only two of the three states below are reachable; **no
/// future increment may resolve `Unknown` from `verify` output** (RFC 016's own named trap).
///
/// This is the gate for all **eight** of prikk's `GatedOperation` variants — `Seal`, `Merge`,
/// `SyncBuild`, `SyncSeal`, `SyncAdoptTag`, `TagCreate`, `BranchCreate`, `BranchClose` — not seal's
/// alone; seal is only stikk's first consumer of it.
/// Whether each signing role's key material is available to the current session, plus whether the
/// session is in read-only mode.
///
/// This carries no key material — only presence flags (and, for MAINTAINER, the further-unverifiable
/// adoption question — see [`MaintainerReadiness`]). It is the input to [`Capability::derive`].
/// What a session may do, derived from [`Readiness`] (design AC-01…04).
///
/// The levels are cumulative for the mutating axis (`Maintainer` implies `Author` implies `Viewer`).
/// `Operator` is orthogonal — recovery actions available to any human at the machine under explicit
/// confirmation — and is represented as a separate query on [`Readiness`] itself
/// ([`Readiness::may_operate`]) rather than a point on this ladder or a method here: `derive` below
/// discards `read_only` on the way to a `Capability`, so the one fact `may_operate` needs does not
/// survive to exist as a method on this type (RFC 012 F-a).