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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
//! Public wire DTO for the readiness gap-report (`ossctl audit`).
//!
//! The versioned surface the `/oss-readiness` skill wraps: `ossctl audit` scores
//! a repo against the **gated core** (README + LICENSE + CI), the **tier-scaled
//! canon** (recommended artifacts scaled to the facts' maturity), the
//! **producer-existence** obligations the contract declares (a `fragment`
//! changelog needs its dir, a `coverage`/`scorecard` badge needs its CI
//! producer, a registry target needs an SPDX license), and the **GitHub
//! community standards** (`gh api …/community/profile`). It is **read-only** —
//! nothing here nor in [`crate::audit`] ever writes the repo (ADR-0001 §3).
//!
//! Consumers read this document under the CLI's canonical `data` envelope:
//! `{schema_version, data: <this shape>, warnings}` — the same envelope every
//! `ossctl --json` command shares (`crate::SCHEMA_VERSION` versions that wire
//! envelope). Like the facts report, the gap-report is *derived*, never
//! authored, so it has no document version of its own; the envelope's
//! `schema_version` is the single version consumers gate on.
//!
//! The report **reuses** [`Maturity`] from the canonical contract model rather
//! than restating its wire strings: the audit and the contract must agree on
//! `"mvp"` down to the byte, and sharing the one enum makes that agreement
//! structural instead of coincidental.
//!
//! ## The `unknown` discipline
//!
//! Every check distinguishes **checked-and-absent** from **could-not-check**.
//! Filesystem probes are always determinate ([`Presence::Present`] /
//! [`Presence::Absent`]). A GitHub-API or registry lookup that *fails* yields
//! [`Presence::Unknown`], never `Absent` — an outage must never be read as "the
//! artifact is missing" (issue: registry/GH-API failure ⇒ `unknown`, never
//! `false`).
use Serialize;
use crateMaturity;
/// Tri-state presence of one checked artifact.
///
/// `Unknown` is reserved for a check that *could not be performed* (a failed
/// `gh api` call, an unresolved remote) — it is never a synonym for `Absent`,
/// which means "checked, and the artifact is not there".
/// Whether the tier-scaled **gated core** is complete.
///
/// The gated core is README + LICENSE + CI, but the CI leg only gates at `mvp`
/// and above: a `spike` is not being published, so it is gated on README +
/// LICENSE alone and CI is reported as a (non-blocking) gap toward `mvp`
/// (design §4). `Unknown` is a forward-compatible third state; today every core
/// leg is a determinate filesystem probe, so the core resolves to
/// `Complete`/`Incomplete`.
/// Which scoring axis a gap comes from.
/// How much a gap matters — its gating weight.
/// One unmet readiness obligation — an artifact that is absent (or could not be
/// checked) but is expected at this maturity tier (or required by the contract).
///
/// The report lists only actual gaps; a satisfied check produces no entry. Each
/// gap names the `/oss-*` member skill that closes it, so `/oss-readiness` can
/// sequence the fixes highest-severity first.
/// GitHub's own community-standards view of the repo — the parsed
/// `gh api repos/<owner>/<repo>/community/profile` `files` block.
///
/// Supplementary evidence alongside the filesystem-derived gaps: GitHub also
/// recognizes health files under `.github/` and `docs/`, so a `Present` here
/// can corroborate a file the root-level probe did not see. When the lookup
/// could not run ([`Self::checked`] is `false`), every field is
/// [`Presence::Unknown`] — the outage is never read as "absent".
/// The readiness gap-report — a read-only score of the repo against the gated
/// core, the tier-scaled canon, the contract's producer obligations, and the
/// GitHub community standards.