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
//! Public wire DTOs for the release engine's per-target adapter facts (ADR-0002).
//!
//! These are the shapes an [adapter](crate::release::adapters::ReleaseAdapter)
//! produces and the coordinator journals and re-emits: the dry-run command plan,
//! the build-artifact manifest, the **publish receipt** (a durable *fact* — the
//! canonical ref/digest/URL captured at publish time, never re-derived later),
//! and the read-only **verify outcome** that drives the resume/reconcile state
//! table (ADR-0003).
//!
//! Like every other `ossctl` wire surface these ride the CLI's canonical
//! envelope — a `--json` `{schema_version, data, warnings}` document or a
//! `--output=jsonl` event stream — so they carry no document version of their
//! own; [`crate::SCHEMA_VERSION`] versions the envelope they travel in. They are
//! versioned **independently** of the internal domain types so `ossctl-core` can
//! refactor adapter internals without a wire break (ADR-0001 §2). This is a hot
//! file under the migration rule: a breaking change here bumps
//! [`crate::SCHEMA_VERSION`], never silently.
//!
//! ## The `Unknown` discipline
//!
//! [`VerifyOutcome`] mirrors the audit's tri-state presence discipline: a remote
//! reconcile that *could not be performed* (a registry outage, a package the
//! `RegistryQuery` port cannot resolve) yields [`VerifyOutcome::Unknown`], never
//! [`VerifyOutcome::Missing`]. An outage must never be read as "the release did
//! not land" — that is the one classification that would drive a dangerous
//! re-publish of an already-published version.
use Serialize;
use crate;
/// One external command an adapter intends to run, captured as data rather than
/// executed — the atom of a [`DryRunReport`] and the auditable record of what a
/// build/publish step shelled out to.
///
/// Rendered, never re-parsed: a caller keys off [`Self::program`] /
/// [`Self::args`], and [`Self::rendered`] is the human-readable one-liner for a
/// planning envelope or a log line.
/// The result of an adapter's `dry_run` — the re-runnable, side-effect-free
/// preview of exactly what a real cut would do for this target.
///
/// Purely descriptive: it lists the commands that *would* run (so `release plan`
/// can seal them and a human can approve the concrete actions) plus any adapter
/// notes (e.g. "publish happens in CI via a trusted-publisher workflow, not from
/// this host"). Running a dry-run never mutates external state.
/// The result of an adapter's `build` — the re-runnable artifact manifest.
///
/// Names the artifacts the build produced (crate `.crate` files, wheels/sdists,
/// tarballs, release binaries) so the publish phase and the journal can refer to
/// them as facts. Re-running `build` is safe (it overwrites its own outputs).
/// A **publish receipt** — the durable fact captured the moment a target's
/// publish landed (ADR-0002 §1).
///
/// `publish` returns this rather than `()` precisely so the canonical
/// ref/digest/URL are *recorded*, not re-derived later: a publish that landed
/// under a drifted version must be detectable, and `verify` reconciles the
/// receipt's [`Self::version`] against what the registry actually holds. The
/// receipt is journaled as a fact and is the input to [`VerifyOutcome`]
/// classification.
/// The typed result of an adapter's read-only `verify` — how the published
/// receipt reconciles against what the registry currently holds (ADR-0002 §1).
///
/// This drives the resume/reconcile state table (ADR-0003): `Matches` seals the
/// target as landed, `Conflicts` and `Missing` surface a human-recoverable
/// discrepancy, and `Unknown` says the check could not be performed and must not
/// be treated as `Missing`.