@cleocode/contracts 2026.5.78 → 2026.5.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/exit-codes.d.ts +41 -0
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +52 -0
- package/dist/exit-codes.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/operations/worktree.d.ts +251 -0
- package/dist/operations/worktree.d.ts.map +1 -1
- package/dist/release/plan.d.ts +533 -0
- package/dist/release/plan.d.ts.map +1 -0
- package/dist/release/plan.js +393 -0
- package/dist/release/plan.js.map +1 -0
- package/dist/release/plan.test.d.ts +17 -0
- package/dist/release/plan.test.d.ts.map +1 -0
- package/dist/release/plan.test.js +414 -0
- package/dist/release/plan.test.js.map +1 -0
- package/dist/tasks/archive.d.ts +3 -3
- package/package.json +2 -2
- package/src/exit-codes.ts +54 -0
- package/src/index.ts +79 -0
- package/src/operations/worktree.ts +274 -0
- package/src/release/plan.test.ts +501 -0
- package/src/release/plan.ts +493 -0
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release Plan contracts — canonical Zod schema for `.cleo/release/<version>.plan.json`.
|
|
3
|
+
*
|
|
4
|
+
* The plan file is the source-of-truth state record for a release as it moves
|
|
5
|
+
* through the canonical FSM:
|
|
6
|
+
*
|
|
7
|
+
* planned → pr-opened → pr-merged → published → reconciled
|
|
8
|
+
*
|
|
9
|
+
* Off-ramp terminal states: `rolled_back`, `failed`, `cancelled`.
|
|
10
|
+
*
|
|
11
|
+
* This module defines the normative shape per SPEC-T9345 §6.1/§6.2. Consumers:
|
|
12
|
+
*
|
|
13
|
+
* - `cleo release plan` (T9525) — INSERTs status=planned
|
|
14
|
+
* - `cleo release open` (T9525) — UPDATEs status=pr-opened
|
|
15
|
+
* - `cleo release reconcile` (T9526) — re-validates and UPDATEs status=reconciled
|
|
16
|
+
*
|
|
17
|
+
* The schema is permissive on `evidenceAtoms` (length-zero arrays are
|
|
18
|
+
* structurally valid) — the non-empty invariant (R-301) is enforced by the
|
|
19
|
+
* verb implementations, not the contract, so backfill / migration tooling can
|
|
20
|
+
* load historical plans without contract-level rejection.
|
|
21
|
+
*
|
|
22
|
+
* @task T9527
|
|
23
|
+
* @epic T9492
|
|
24
|
+
* @adr ADR-T9345 (IVTR-release-overhaul)
|
|
25
|
+
* @spec .cleo/rcasd/T9345/research/SPEC-T9345-release-pipeline-v2.md §6
|
|
26
|
+
*/
|
|
27
|
+
import { z } from 'zod';
|
|
28
|
+
/**
|
|
29
|
+
* Semantic version of the Release Plan contract.
|
|
30
|
+
*
|
|
31
|
+
* Increment the MAJOR component on incompatible field renames or removals.
|
|
32
|
+
* Increment MINOR on additive optional-field changes. The plan JSON `$schema`
|
|
33
|
+
* URL is keyed off the MAJOR component (`/release-plan/v1.json` for `1.x.y`).
|
|
34
|
+
*/
|
|
35
|
+
export declare const RELEASE_PLAN_SCHEMA_VERSION = "1.0.0";
|
|
36
|
+
/**
|
|
37
|
+
* Canonical `$schema` URL embedded in plan files at write time. Consumers MAY
|
|
38
|
+
* use this string to identify the contract version when parsing legacy plans.
|
|
39
|
+
*/
|
|
40
|
+
export declare const RELEASE_PLAN_SCHEMA_URL = "https://cleocode.io/schemas/release-plan/v1.json";
|
|
41
|
+
/**
|
|
42
|
+
* Canonical npm dist-tag channels supported by the release pipeline.
|
|
43
|
+
*
|
|
44
|
+
* Includes `rc` in addition to the legacy `latest|beta|alpha` triple to allow
|
|
45
|
+
* release candidates without conflating with `beta` per SPEC §6.1.
|
|
46
|
+
*/
|
|
47
|
+
export declare const RELEASE_CHANNEL: readonly ["latest", "beta", "alpha", "rc"];
|
|
48
|
+
/**
|
|
49
|
+
* Version-scheme variants. `calver-suffix` is the hotfix grammar
|
|
50
|
+
* `vYYYY.M.DD.N` per SPEC R-402.
|
|
51
|
+
*/
|
|
52
|
+
export declare const RELEASE_SCHEME: readonly ["calver", "semver", "calver-suffix"];
|
|
53
|
+
/**
|
|
54
|
+
* Release-kind classification. `hotfix` triggers the scope-strict completeness
|
|
55
|
+
* path per SPEC R-401; `prerelease` allows non-`latest` channels.
|
|
56
|
+
*/
|
|
57
|
+
export declare const RELEASE_KIND: readonly ["regular", "hotfix", "prerelease"];
|
|
58
|
+
/**
|
|
59
|
+
* Lifecycle FSM states for a release plan. Ordered for documentation only —
|
|
60
|
+
* the runtime FSM enforces monotonic forward progress per SPEC R-302.
|
|
61
|
+
*/
|
|
62
|
+
export declare const RELEASE_STATUS: readonly ["planned", "pr-opened", "pr-merged", "published", "reconciled", "rolled_back", "failed", "cancelled"];
|
|
63
|
+
/**
|
|
64
|
+
* Gate verification status. `unresolved` indicates ADR-061's resolver could
|
|
65
|
+
* not produce a command for the project archetype (SPEC R-304).
|
|
66
|
+
*/
|
|
67
|
+
export declare const GATE_STATUS: readonly ["passed", "failed", "skipped", "unresolved"];
|
|
68
|
+
/**
|
|
69
|
+
* Canonical gate names recognized by the release pipeline. Mirrors the
|
|
70
|
+
* ADR-051 / ADR-061 evidence-atom canonical names (R-310).
|
|
71
|
+
*/
|
|
72
|
+
export declare const GATE_NAME: readonly ["test", "build", "lint", "typecheck", "audit", "security-scan"];
|
|
73
|
+
/**
|
|
74
|
+
* Platform tuples used by the release matrix per T1737 alignment (R-370).
|
|
75
|
+
*
|
|
76
|
+
* `any` collapses single platform-agnostic artifacts (R-371).
|
|
77
|
+
*/
|
|
78
|
+
export declare const PLATFORM_TUPLE: readonly ["linux-x64", "linux-arm64", "macos-x64", "macos-arm64", "windows-x64", "any"];
|
|
79
|
+
/**
|
|
80
|
+
* Supported publisher backends — the registries / distribution channels the
|
|
81
|
+
* release matrix may target.
|
|
82
|
+
*/
|
|
83
|
+
export declare const PUBLISHER: readonly ["npm", "cargo", "docker", "pypi", "github-release", "binary"];
|
|
84
|
+
/**
|
|
85
|
+
* Conventional-commit-aligned task classification used to slot tasks into the
|
|
86
|
+
* changelog `features` / `fixes` / `chores` / `breaking` buckets (§6.1).
|
|
87
|
+
*/
|
|
88
|
+
export declare const TASK_KIND: readonly ["feat", "fix", "chore", "docs", "refactor", "test", "perf", "revert", "breaking", "hotfix"];
|
|
89
|
+
/**
|
|
90
|
+
* SemVer-impact classification per task. The plan-time aggregate determines
|
|
91
|
+
* the release scheme bump when scheme=`semver` (informational under `calver`).
|
|
92
|
+
*/
|
|
93
|
+
export declare const IMPACT: readonly ["major", "minor", "patch"];
|
|
94
|
+
/**
|
|
95
|
+
* Source attribution for resolved tool commands. Mirrors ADR-061 §1 surfaces.
|
|
96
|
+
*/
|
|
97
|
+
export declare const RESOLVED_SOURCE: readonly ["project-context", "language-default", "legacy-alias"];
|
|
98
|
+
/** Zod schema for {@link RELEASE_CHANNEL}. */
|
|
99
|
+
export declare const ReleaseChannelSchema: z.ZodEnum<{
|
|
100
|
+
latest: "latest";
|
|
101
|
+
beta: "beta";
|
|
102
|
+
alpha: "alpha";
|
|
103
|
+
rc: "rc";
|
|
104
|
+
}>;
|
|
105
|
+
/** Zod schema for {@link RELEASE_SCHEME}. */
|
|
106
|
+
export declare const ReleaseSchemeSchema: z.ZodEnum<{
|
|
107
|
+
calver: "calver";
|
|
108
|
+
semver: "semver";
|
|
109
|
+
"calver-suffix": "calver-suffix";
|
|
110
|
+
}>;
|
|
111
|
+
/** Zod schema for {@link RELEASE_KIND}. */
|
|
112
|
+
export declare const ReleaseKindSchema: z.ZodEnum<{
|
|
113
|
+
regular: "regular";
|
|
114
|
+
hotfix: "hotfix";
|
|
115
|
+
prerelease: "prerelease";
|
|
116
|
+
}>;
|
|
117
|
+
/** Zod schema for {@link RELEASE_STATUS}. */
|
|
118
|
+
export declare const ReleaseStatusSchema: z.ZodEnum<{
|
|
119
|
+
failed: "failed";
|
|
120
|
+
cancelled: "cancelled";
|
|
121
|
+
planned: "planned";
|
|
122
|
+
"pr-opened": "pr-opened";
|
|
123
|
+
"pr-merged": "pr-merged";
|
|
124
|
+
published: "published";
|
|
125
|
+
reconciled: "reconciled";
|
|
126
|
+
rolled_back: "rolled_back";
|
|
127
|
+
}>;
|
|
128
|
+
/** Zod schema for {@link GATE_STATUS}. */
|
|
129
|
+
export declare const GateStatusSchema: z.ZodEnum<{
|
|
130
|
+
skipped: "skipped";
|
|
131
|
+
failed: "failed";
|
|
132
|
+
passed: "passed";
|
|
133
|
+
unresolved: "unresolved";
|
|
134
|
+
}>;
|
|
135
|
+
/** Zod schema for {@link GATE_NAME}. */
|
|
136
|
+
export declare const GateNameSchema: z.ZodEnum<{
|
|
137
|
+
test: "test";
|
|
138
|
+
lint: "lint";
|
|
139
|
+
build: "build";
|
|
140
|
+
typecheck: "typecheck";
|
|
141
|
+
audit: "audit";
|
|
142
|
+
"security-scan": "security-scan";
|
|
143
|
+
}>;
|
|
144
|
+
/** Zod schema for {@link PLATFORM_TUPLE}. */
|
|
145
|
+
export declare const PlatformTupleSchema: z.ZodEnum<{
|
|
146
|
+
any: "any";
|
|
147
|
+
"linux-x64": "linux-x64";
|
|
148
|
+
"linux-arm64": "linux-arm64";
|
|
149
|
+
"macos-x64": "macos-x64";
|
|
150
|
+
"macos-arm64": "macos-arm64";
|
|
151
|
+
"windows-x64": "windows-x64";
|
|
152
|
+
}>;
|
|
153
|
+
/** Zod schema for {@link PUBLISHER}. */
|
|
154
|
+
export declare const PublisherSchema: z.ZodEnum<{
|
|
155
|
+
binary: "binary";
|
|
156
|
+
cargo: "cargo";
|
|
157
|
+
npm: "npm";
|
|
158
|
+
docker: "docker";
|
|
159
|
+
pypi: "pypi";
|
|
160
|
+
"github-release": "github-release";
|
|
161
|
+
}>;
|
|
162
|
+
/** Zod schema for {@link TASK_KIND}. */
|
|
163
|
+
export declare const TaskKindSchema: z.ZodEnum<{
|
|
164
|
+
test: "test";
|
|
165
|
+
docs: "docs";
|
|
166
|
+
fix: "fix";
|
|
167
|
+
refactor: "refactor";
|
|
168
|
+
feat: "feat";
|
|
169
|
+
chore: "chore";
|
|
170
|
+
hotfix: "hotfix";
|
|
171
|
+
perf: "perf";
|
|
172
|
+
revert: "revert";
|
|
173
|
+
breaking: "breaking";
|
|
174
|
+
}>;
|
|
175
|
+
/** Zod schema for {@link IMPACT}. */
|
|
176
|
+
export declare const ImpactSchema: z.ZodEnum<{
|
|
177
|
+
major: "major";
|
|
178
|
+
minor: "minor";
|
|
179
|
+
patch: "patch";
|
|
180
|
+
}>;
|
|
181
|
+
/** Zod schema for {@link RESOLVED_SOURCE}. */
|
|
182
|
+
export declare const ResolvedSourceSchema: z.ZodEnum<{
|
|
183
|
+
"project-context": "project-context";
|
|
184
|
+
"language-default": "language-default";
|
|
185
|
+
"legacy-alias": "legacy-alias";
|
|
186
|
+
}>;
|
|
187
|
+
/**
|
|
188
|
+
* Zod schema for one task row in `plan.tasks[]`. Mirrors the SPEC §6.1 task
|
|
189
|
+
* shape exactly. `evidenceAtoms` is a permissive `string[]` — verbs enforce
|
|
190
|
+
* non-empty per R-301; the contract permits empty arrays so legacy plans
|
|
191
|
+
* remain parseable.
|
|
192
|
+
*
|
|
193
|
+
* `epicAncestor` is locked at plan time (R-303) and MUST NOT be re-derived
|
|
194
|
+
* by downstream consumers.
|
|
195
|
+
*
|
|
196
|
+
* `ivtrPhaseAtPlan` is informational only (R-316) — consumers MUST NOT
|
|
197
|
+
* gate decisions on its value.
|
|
198
|
+
*/
|
|
199
|
+
export declare const ReleasePlanTaskSchema: z.ZodObject<{
|
|
200
|
+
id: z.ZodString;
|
|
201
|
+
kind: z.ZodEnum<{
|
|
202
|
+
test: "test";
|
|
203
|
+
docs: "docs";
|
|
204
|
+
fix: "fix";
|
|
205
|
+
refactor: "refactor";
|
|
206
|
+
feat: "feat";
|
|
207
|
+
chore: "chore";
|
|
208
|
+
hotfix: "hotfix";
|
|
209
|
+
perf: "perf";
|
|
210
|
+
revert: "revert";
|
|
211
|
+
breaking: "breaking";
|
|
212
|
+
}>;
|
|
213
|
+
impact: z.ZodEnum<{
|
|
214
|
+
major: "major";
|
|
215
|
+
minor: "minor";
|
|
216
|
+
patch: "patch";
|
|
217
|
+
}>;
|
|
218
|
+
userFacingSummary: z.ZodString;
|
|
219
|
+
evidenceAtoms: z.ZodArray<z.ZodString>;
|
|
220
|
+
ivtrPhaseAtPlan: z.ZodOptional<z.ZodString>;
|
|
221
|
+
epicAncestor: z.ZodString;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
/**
|
|
224
|
+
* Zod schema for one gate row in `plan.gates[]`. Each gate carries the
|
|
225
|
+
* resolved ADR-061 tool command + source attribution for forensic re-runs.
|
|
226
|
+
*/
|
|
227
|
+
export declare const ReleaseGateSchema: z.ZodObject<{
|
|
228
|
+
name: z.ZodEnum<{
|
|
229
|
+
test: "test";
|
|
230
|
+
lint: "lint";
|
|
231
|
+
build: "build";
|
|
232
|
+
typecheck: "typecheck";
|
|
233
|
+
audit: "audit";
|
|
234
|
+
"security-scan": "security-scan";
|
|
235
|
+
}>;
|
|
236
|
+
atom: z.ZodString;
|
|
237
|
+
status: z.ZodEnum<{
|
|
238
|
+
skipped: "skipped";
|
|
239
|
+
failed: "failed";
|
|
240
|
+
passed: "passed";
|
|
241
|
+
unresolved: "unresolved";
|
|
242
|
+
}>;
|
|
243
|
+
lastVerifiedAt: z.ZodISODateTime;
|
|
244
|
+
resolvedCommand: z.ZodOptional<z.ZodString>;
|
|
245
|
+
resolvedSource: z.ZodOptional<z.ZodEnum<{
|
|
246
|
+
"project-context": "project-context";
|
|
247
|
+
"language-default": "language-default";
|
|
248
|
+
"legacy-alias": "legacy-alias";
|
|
249
|
+
}>>;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
|
+
/**
|
|
252
|
+
* Zod schema for one row in `plan.platformMatrix[]`. Each entry encodes a
|
|
253
|
+
* (platform-tuple, publisher) pair the release will produce per R-370.
|
|
254
|
+
*
|
|
255
|
+
* `smoke` defaults to `true`; archetypes that produce platform-agnostic
|
|
256
|
+
* artifacts MAY set `false` to skip per-platform smoke tests (R-371).
|
|
257
|
+
*/
|
|
258
|
+
export declare const ReleasePlatformMatrixEntrySchema: z.ZodObject<{
|
|
259
|
+
platform: z.ZodEnum<{
|
|
260
|
+
any: "any";
|
|
261
|
+
"linux-x64": "linux-x64";
|
|
262
|
+
"linux-arm64": "linux-arm64";
|
|
263
|
+
"macos-x64": "macos-x64";
|
|
264
|
+
"macos-arm64": "macos-arm64";
|
|
265
|
+
"windows-x64": "windows-x64";
|
|
266
|
+
}>;
|
|
267
|
+
publisher: z.ZodEnum<{
|
|
268
|
+
binary: "binary";
|
|
269
|
+
cargo: "cargo";
|
|
270
|
+
npm: "npm";
|
|
271
|
+
docker: "docker";
|
|
272
|
+
pypi: "pypi";
|
|
273
|
+
"github-release": "github-release";
|
|
274
|
+
}>;
|
|
275
|
+
package: z.ZodString;
|
|
276
|
+
smoke: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
277
|
+
}, z.core.$strip>;
|
|
278
|
+
/**
|
|
279
|
+
* Zod schema for `plan.preflightSummary`. Captures the four preflight checks
|
|
280
|
+
* runs by `cleo release plan` (R-024 / R-261).
|
|
281
|
+
*/
|
|
282
|
+
export declare const ReleasePreflightSummarySchema: z.ZodObject<{
|
|
283
|
+
esbuildExternalsDrift: z.ZodBoolean;
|
|
284
|
+
lockfileDrift: z.ZodBoolean;
|
|
285
|
+
epicCompletenessClean: z.ZodBoolean;
|
|
286
|
+
doubleListingClean: z.ZodBoolean;
|
|
287
|
+
preflightWarnings: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
288
|
+
}, z.core.$strip>;
|
|
289
|
+
/**
|
|
290
|
+
* Zod schema for `plan.changelog`. Tasks are bucketed by `kind` into the four
|
|
291
|
+
* canonical changelog sections; each section holds an array of task IDs
|
|
292
|
+
* preserving plan-time ordering.
|
|
293
|
+
*/
|
|
294
|
+
export declare const ReleasePlanChangelogSchema: z.ZodObject<{
|
|
295
|
+
features: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
296
|
+
fixes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
297
|
+
chores: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
298
|
+
breaking: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
299
|
+
}, z.core.$strip>;
|
|
300
|
+
/**
|
|
301
|
+
* Zod schema for `plan.meta` — open-ended bag of informational fields.
|
|
302
|
+
*
|
|
303
|
+
* The catchall is `z.unknown()` (forward-compat: parsers MUST NOT reject
|
|
304
|
+
* fields the contract does not yet recognize) per ADR-039 envelope discipline.
|
|
305
|
+
*
|
|
306
|
+
* Documented keys:
|
|
307
|
+
*
|
|
308
|
+
* - `firstEverRelease` (R-023) — escape hatch for the first ever
|
|
309
|
+
* release where `previousVersion` is `null`.
|
|
310
|
+
* - `unresolvedTools` (R-024) — canonical tool names whose
|
|
311
|
+
* resolution failed during planning.
|
|
312
|
+
* - `archetype` (R-361) — detected project archetype string.
|
|
313
|
+
*/
|
|
314
|
+
export declare const ReleasePlanMetaSchema: z.ZodObject<{
|
|
315
|
+
firstEverRelease: z.ZodOptional<z.ZodBoolean>;
|
|
316
|
+
unresolvedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
317
|
+
archetype: z.ZodOptional<z.ZodString>;
|
|
318
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
319
|
+
/**
|
|
320
|
+
* Canonical Zod schema for the entire `.cleo/release/<version>.plan.json`
|
|
321
|
+
* envelope. Mirrors SPEC-T9345 §6.1 1:1.
|
|
322
|
+
*
|
|
323
|
+
* Schema invariants enforced by this schema:
|
|
324
|
+
*
|
|
325
|
+
* - All enum fields reject unknown literal values (R-302 / R-304).
|
|
326
|
+
* - `tasks[]` MUST contain only fully-typed task rows (R-303 / R-316).
|
|
327
|
+
* - `gates[]` MUST contain only canonical gate names (R-310).
|
|
328
|
+
* - `platformMatrix[]` MUST be a homogeneous array of entry rows (R-370).
|
|
329
|
+
*
|
|
330
|
+
* Schema invariants enforced by VERBS (NOT this schema):
|
|
331
|
+
*
|
|
332
|
+
* - R-300: `previousVersion` non-null unless `meta.firstEverRelease=true`.
|
|
333
|
+
* - R-301: `tasks[*].evidenceAtoms` non-empty.
|
|
334
|
+
* - R-305: `platformMatrix[]` non-empty.
|
|
335
|
+
* - R-306: deterministic re-validation inside `open` and `reconcile`.
|
|
336
|
+
*/
|
|
337
|
+
export declare const ReleasePlanSchema: z.ZodObject<{
|
|
338
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
339
|
+
version: z.ZodString;
|
|
340
|
+
resolvedVersion: z.ZodString;
|
|
341
|
+
suffixApplied: z.ZodBoolean;
|
|
342
|
+
scheme: z.ZodEnum<{
|
|
343
|
+
calver: "calver";
|
|
344
|
+
semver: "semver";
|
|
345
|
+
"calver-suffix": "calver-suffix";
|
|
346
|
+
}>;
|
|
347
|
+
channel: z.ZodEnum<{
|
|
348
|
+
latest: "latest";
|
|
349
|
+
beta: "beta";
|
|
350
|
+
alpha: "alpha";
|
|
351
|
+
rc: "rc";
|
|
352
|
+
}>;
|
|
353
|
+
epicId: z.ZodString;
|
|
354
|
+
releaseKind: z.ZodEnum<{
|
|
355
|
+
regular: "regular";
|
|
356
|
+
hotfix: "hotfix";
|
|
357
|
+
prerelease: "prerelease";
|
|
358
|
+
}>;
|
|
359
|
+
createdAt: z.ZodISODateTime;
|
|
360
|
+
createdBy: z.ZodString;
|
|
361
|
+
previousVersion: z.ZodNullable<z.ZodString>;
|
|
362
|
+
previousTag: z.ZodNullable<z.ZodString>;
|
|
363
|
+
previousShippedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
364
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
365
|
+
id: z.ZodString;
|
|
366
|
+
kind: z.ZodEnum<{
|
|
367
|
+
test: "test";
|
|
368
|
+
docs: "docs";
|
|
369
|
+
fix: "fix";
|
|
370
|
+
refactor: "refactor";
|
|
371
|
+
feat: "feat";
|
|
372
|
+
chore: "chore";
|
|
373
|
+
hotfix: "hotfix";
|
|
374
|
+
perf: "perf";
|
|
375
|
+
revert: "revert";
|
|
376
|
+
breaking: "breaking";
|
|
377
|
+
}>;
|
|
378
|
+
impact: z.ZodEnum<{
|
|
379
|
+
major: "major";
|
|
380
|
+
minor: "minor";
|
|
381
|
+
patch: "patch";
|
|
382
|
+
}>;
|
|
383
|
+
userFacingSummary: z.ZodString;
|
|
384
|
+
evidenceAtoms: z.ZodArray<z.ZodString>;
|
|
385
|
+
ivtrPhaseAtPlan: z.ZodOptional<z.ZodString>;
|
|
386
|
+
epicAncestor: z.ZodString;
|
|
387
|
+
}, z.core.$strip>>;
|
|
388
|
+
changelog: z.ZodObject<{
|
|
389
|
+
features: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
390
|
+
fixes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
391
|
+
chores: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
392
|
+
breaking: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
393
|
+
}, z.core.$strip>;
|
|
394
|
+
gates: z.ZodArray<z.ZodObject<{
|
|
395
|
+
name: z.ZodEnum<{
|
|
396
|
+
test: "test";
|
|
397
|
+
lint: "lint";
|
|
398
|
+
build: "build";
|
|
399
|
+
typecheck: "typecheck";
|
|
400
|
+
audit: "audit";
|
|
401
|
+
"security-scan": "security-scan";
|
|
402
|
+
}>;
|
|
403
|
+
atom: z.ZodString;
|
|
404
|
+
status: z.ZodEnum<{
|
|
405
|
+
skipped: "skipped";
|
|
406
|
+
failed: "failed";
|
|
407
|
+
passed: "passed";
|
|
408
|
+
unresolved: "unresolved";
|
|
409
|
+
}>;
|
|
410
|
+
lastVerifiedAt: z.ZodISODateTime;
|
|
411
|
+
resolvedCommand: z.ZodOptional<z.ZodString>;
|
|
412
|
+
resolvedSource: z.ZodOptional<z.ZodEnum<{
|
|
413
|
+
"project-context": "project-context";
|
|
414
|
+
"language-default": "language-default";
|
|
415
|
+
"legacy-alias": "legacy-alias";
|
|
416
|
+
}>>;
|
|
417
|
+
}, z.core.$strip>>;
|
|
418
|
+
platformMatrix: z.ZodArray<z.ZodObject<{
|
|
419
|
+
platform: z.ZodEnum<{
|
|
420
|
+
any: "any";
|
|
421
|
+
"linux-x64": "linux-x64";
|
|
422
|
+
"linux-arm64": "linux-arm64";
|
|
423
|
+
"macos-x64": "macos-x64";
|
|
424
|
+
"macos-arm64": "macos-arm64";
|
|
425
|
+
"windows-x64": "windows-x64";
|
|
426
|
+
}>;
|
|
427
|
+
publisher: z.ZodEnum<{
|
|
428
|
+
binary: "binary";
|
|
429
|
+
cargo: "cargo";
|
|
430
|
+
npm: "npm";
|
|
431
|
+
docker: "docker";
|
|
432
|
+
pypi: "pypi";
|
|
433
|
+
"github-release": "github-release";
|
|
434
|
+
}>;
|
|
435
|
+
package: z.ZodString;
|
|
436
|
+
smoke: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
437
|
+
}, z.core.$strip>>;
|
|
438
|
+
preflightSummary: z.ZodObject<{
|
|
439
|
+
esbuildExternalsDrift: z.ZodBoolean;
|
|
440
|
+
lockfileDrift: z.ZodBoolean;
|
|
441
|
+
epicCompletenessClean: z.ZodBoolean;
|
|
442
|
+
doubleListingClean: z.ZodBoolean;
|
|
443
|
+
preflightWarnings: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
444
|
+
}, z.core.$strip>;
|
|
445
|
+
workflowRunUrl: z.ZodNullable<z.ZodString>;
|
|
446
|
+
prUrl: z.ZodNullable<z.ZodString>;
|
|
447
|
+
mergeCommitSha: z.ZodNullable<z.ZodString>;
|
|
448
|
+
status: z.ZodEnum<{
|
|
449
|
+
failed: "failed";
|
|
450
|
+
cancelled: "cancelled";
|
|
451
|
+
planned: "planned";
|
|
452
|
+
"pr-opened": "pr-opened";
|
|
453
|
+
"pr-merged": "pr-merged";
|
|
454
|
+
published: "published";
|
|
455
|
+
reconciled: "reconciled";
|
|
456
|
+
rolled_back: "rolled_back";
|
|
457
|
+
}>;
|
|
458
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
459
|
+
firstEverRelease: z.ZodOptional<z.ZodBoolean>;
|
|
460
|
+
unresolvedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
461
|
+
archetype: z.ZodOptional<z.ZodString>;
|
|
462
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
463
|
+
}, z.core.$strip>;
|
|
464
|
+
/** Inferred type for {@link ReleaseChannelSchema}. */
|
|
465
|
+
export type ReleaseChannel = z.infer<typeof ReleaseChannelSchema>;
|
|
466
|
+
/** Inferred type for {@link ReleaseSchemeSchema}. */
|
|
467
|
+
export type ReleaseScheme = z.infer<typeof ReleaseSchemeSchema>;
|
|
468
|
+
/** Inferred type for {@link ReleaseKindSchema}. */
|
|
469
|
+
export type ReleaseKind = z.infer<typeof ReleaseKindSchema>;
|
|
470
|
+
/** Inferred type for {@link ReleaseStatusSchema}. */
|
|
471
|
+
export type ReleaseStatus = z.infer<typeof ReleaseStatusSchema>;
|
|
472
|
+
/** Inferred type for {@link GateStatusSchema}. */
|
|
473
|
+
export type GateStatus = z.infer<typeof GateStatusSchema>;
|
|
474
|
+
/** Inferred type for {@link GateNameSchema}. */
|
|
475
|
+
export type GateName = z.infer<typeof GateNameSchema>;
|
|
476
|
+
/** Inferred type for {@link PlatformTupleSchema}. */
|
|
477
|
+
export type PlatformTuple = z.infer<typeof PlatformTupleSchema>;
|
|
478
|
+
/** Inferred type for {@link PublisherSchema}. */
|
|
479
|
+
export type Publisher = z.infer<typeof PublisherSchema>;
|
|
480
|
+
/** Inferred type for {@link TaskKindSchema}. */
|
|
481
|
+
export type TaskKind = z.infer<typeof TaskKindSchema>;
|
|
482
|
+
/** Inferred type for {@link ImpactSchema}. */
|
|
483
|
+
export type Impact = z.infer<typeof ImpactSchema>;
|
|
484
|
+
/** Inferred type for {@link ResolvedSourceSchema}. */
|
|
485
|
+
export type ResolvedSource = z.infer<typeof ResolvedSourceSchema>;
|
|
486
|
+
/** Inferred type for {@link ReleasePlanTaskSchema}. */
|
|
487
|
+
export type ReleasePlanTask = z.infer<typeof ReleasePlanTaskSchema>;
|
|
488
|
+
/** Inferred type for {@link ReleaseGateSchema}. */
|
|
489
|
+
export type ReleaseGate = z.infer<typeof ReleaseGateSchema>;
|
|
490
|
+
/** Inferred type for {@link ReleasePlatformMatrixEntrySchema}. */
|
|
491
|
+
export type ReleasePlatformMatrixEntry = z.infer<typeof ReleasePlatformMatrixEntrySchema>;
|
|
492
|
+
/** Inferred type for {@link ReleasePreflightSummarySchema}. */
|
|
493
|
+
export type ReleasePreflightSummary = z.infer<typeof ReleasePreflightSummarySchema>;
|
|
494
|
+
/** Inferred type for {@link ReleasePlanChangelogSchema}. */
|
|
495
|
+
export type ReleasePlanChangelog = z.infer<typeof ReleasePlanChangelogSchema>;
|
|
496
|
+
/** Inferred type for {@link ReleasePlanMetaSchema}. */
|
|
497
|
+
export type ReleasePlanMeta = z.infer<typeof ReleasePlanMetaSchema>;
|
|
498
|
+
/** Inferred type for the entire {@link ReleasePlanSchema} envelope. */
|
|
499
|
+
export type ReleasePlan = z.infer<typeof ReleasePlanSchema>;
|
|
500
|
+
/**
|
|
501
|
+
* Parse and validate a raw JSON value as a {@link ReleasePlan}.
|
|
502
|
+
*
|
|
503
|
+
* Throws `ZodError` on any structural mismatch with detailed `.issues[]`
|
|
504
|
+
* pinpointing every offending field path. Callers SHOULD surface those issues
|
|
505
|
+
* via the LAFS `error.details` field for operator triage.
|
|
506
|
+
*
|
|
507
|
+
* Use {@link safeParseReleasePlan} if you prefer the non-throwing variant.
|
|
508
|
+
*
|
|
509
|
+
* @param input — Untyped value loaded from disk / wire / database.
|
|
510
|
+
* @returns The validated, fully-typed plan object.
|
|
511
|
+
* @throws ZodError when validation fails.
|
|
512
|
+
*
|
|
513
|
+
* @example
|
|
514
|
+
* ```ts
|
|
515
|
+
* import { readFileSync } from 'node:fs';
|
|
516
|
+
* import { parseReleasePlan } from '@cleocode/contracts';
|
|
517
|
+
*
|
|
518
|
+
* const raw = JSON.parse(readFileSync('.cleo/release/v2026.6.0.plan.json', 'utf8'));
|
|
519
|
+
* const plan = parseReleasePlan(raw);
|
|
520
|
+
* console.log(plan.status); // type-narrowed to ReleaseStatus
|
|
521
|
+
* ```
|
|
522
|
+
*/
|
|
523
|
+
export declare function parseReleasePlan(input: unknown): ReleasePlan;
|
|
524
|
+
/**
|
|
525
|
+
* Safe variant of {@link parseReleasePlan} that returns a discriminated-union
|
|
526
|
+
* result instead of throwing. Useful when validating user-supplied or
|
|
527
|
+
* persisted plans where structured error reporting is required.
|
|
528
|
+
*
|
|
529
|
+
* @param input — Untyped value to validate.
|
|
530
|
+
* @returns Zod safe-parse result.
|
|
531
|
+
*/
|
|
532
|
+
export declare function safeParseReleasePlan(input: unknown): ReturnType<typeof ReleasePlanSchema.safeParse>;
|
|
533
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/release/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,UAAU,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,qDAAqD,CAAC;AAI1F;;;;;GAKG;AACH,eAAO,MAAM,eAAe,4CAA6C,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,cAAc,gDAAiD,CAAC;AAE7E;;;GAGG;AACH,eAAO,MAAM,YAAY,8CAA+C,CAAC;AAEzE;;;GAGG;AACH,eAAO,MAAM,cAAc,iHASjB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,WAAW,wDAAyD,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,SAAS,2EAA4E,CAAC;AAEnG;;;;GAIG;AACH,e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