peaks-loop 4.0.0-beta.2 → 4.0.0-beta.4
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/CHANGELOG.md +81 -0
- package/README-en.md +16 -3
- package/README.md +16 -3
- package/dist/src/cli/commands/asset-commands.d.ts +45 -0
- package/dist/src/cli/commands/asset-commands.js +404 -0
- package/dist/src/cli/commands/bee-commands.d.ts +26 -0
- package/dist/src/cli/commands/bee-commands.js +169 -0
- package/dist/src/cli/commands/evolution-commands.d.ts +27 -0
- package/dist/src/cli/commands/evolution-commands.js +393 -0
- package/dist/src/cli/commands/loop-commands.d.ts +19 -13
- package/dist/src/cli/commands/loop-commands.js +147 -13
- package/dist/src/cli/commands/sediment-commands.js +9 -0
- package/dist/src/cli/commands/skill-loop-engineering-readiness-commands.d.ts +67 -0
- package/dist/src/cli/commands/skill-loop-engineering-readiness-commands.js +173 -0
- package/dist/src/cli/program.js +17 -0
- package/dist/src/services/crystallization/crystallization-service.d.ts +239 -0
- package/dist/src/services/crystallization/crystallization-service.js +397 -0
- package/dist/src/services/crystallization/crystallization-store.d.ts +75 -0
- package/dist/src/services/crystallization/crystallization-store.js +193 -0
- package/dist/src/services/crystallization/crystallization-types.d.ts +313 -0
- package/dist/src/services/crystallization/crystallization-types.js +299 -0
- package/dist/src/services/crystallization/evidence-brief-builder.d.ts +237 -0
- package/dist/src/services/crystallization/evidence-brief-builder.js +240 -0
- package/dist/src/services/evolution/evolution-service.d.ts +137 -0
- package/dist/src/services/evolution/evolution-service.js +281 -0
- package/dist/src/services/evolution/evolution-store.d.ts +57 -0
- package/dist/src/services/evolution/evolution-store.js +232 -0
- package/dist/src/services/evolution/evolution-types.d.ts +706 -0
- package/dist/src/services/evolution/evolution-types.js +286 -0
- package/dist/src/services/evolution/independent-evaluator-runner.d.ts +90 -0
- package/dist/src/services/evolution/independent-evaluator-runner.js +106 -0
- package/dist/src/services/evolution/regression-skeptic-runner.d.ts +64 -0
- package/dist/src/services/evolution/regression-skeptic-runner.js +113 -0
- package/dist/src/services/loop/loop-bee-relation-service.d.ts +107 -0
- package/dist/src/services/loop/loop-bee-relation-service.js +211 -0
- package/dist/src/services/loop/loop-bee-relation-store.d.ts +53 -0
- package/dist/src/services/loop/loop-bee-relation-store.js +130 -0
- package/dist/src/services/loop/loop-bee-relation-types.d.ts +118 -0
- package/dist/src/services/loop/loop-bee-relation-types.js +114 -0
- package/dist/src/services/loop/loop-release-service.d.ts +46 -0
- package/dist/src/services/loop/loop-release-service.js +66 -0
- package/dist/src/services/loop/loop-release-store.d.ts +55 -0
- package/dist/src/services/loop/loop-release-store.js +134 -0
- package/dist/src/services/loop/loop-release-types.d.ts +250 -0
- package/dist/src/services/loop/loop-release-types.js +162 -0
- package/dist/src/services/share/bundle-reader.d.ts +100 -0
- package/dist/src/services/share/bundle-reader.js +434 -0
- package/dist/src/services/share/bundle-types.d.ts +392 -0
- package/dist/src/services/share/bundle-types.js +318 -0
- package/dist/src/services/share/bundle-writer.d.ts +97 -0
- package/dist/src/services/share/bundle-writer.js +429 -0
- package/dist/src/services/share/run-state-contract.d.ts +133 -0
- package/dist/src/services/share/run-state-contract.js +138 -0
- package/dist/src/services/skillhub/release-import.js +7 -2
- package/dist/src/services/skillhub/release-retain.js +6 -1
- package/dist/src/services/skillhub/sqlite-store.js +17 -1
- package/dist/src/services/skillhub/types.d.ts +10 -0
- package/dist/src/services/standards/loop-engineering-lint.d.ts +38 -0
- package/dist/src/services/standards/loop-engineering-lint.js +101 -0
- package/dist/src/services/standards/loop-engineering-readiness-lint.d.ts +111 -0
- package/dist/src/services/standards/loop-engineering-readiness-lint.js +248 -0
- package/dist/src/shared/version.d.ts +1 -1
- package/dist/src/shared/version.js +1 -1
- package/examples/video-demo/README.md +57 -0
- package/examples/video-demo/out/en-closing-960.png +0 -0
- package/examples/video-demo/out/zh-closing-960.png +0 -0
- package/examples/video-demo/preview/peaks-loop-demo-en.mp4 +0 -0
- package/examples/video-demo/preview/peaks-loop-demo.mp4 +0 -0
- package/package.json +6 -2
- package/skills/peaks-code/SKILL.md +13 -0
- package/skills/peaks-content/SKILL.md +272 -0
- package/skills/peaks-issue-fix-orchestrator/SKILL.md +307 -0
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* peaks.bundle/1 — share-bundle format contract (spec §7A.2).
|
|
3
|
+
*
|
|
4
|
+
* M7 / spec §7A.2 / §10 RL-9.
|
|
5
|
+
*
|
|
6
|
+
* A bundle is a self-describing tar.gz whose root manifest
|
|
7
|
+
* (manifest.json) declares the format constant, the major/minor
|
|
8
|
+
* format version, the schema_version of every contained asset, the
|
|
9
|
+
* assets themselves (loop_release + related bee_release rows), the
|
|
10
|
+
* relation rows, and the evidence briefs that back the assets. The
|
|
11
|
+
* bundle excludes private run_state, `.peaks/memory/personal/`, and
|
|
12
|
+
* raw `state.db` rows.
|
|
13
|
+
*
|
|
14
|
+
* Hard rules enforced at THIS layer:
|
|
15
|
+
*
|
|
16
|
+
* - The literal constant `format_constant = "peaks.bundle/1"` is
|
|
17
|
+
* set inside the manifest at write time. The CLI is the only
|
|
18
|
+
* writer; a future format change is signaled by bumping the
|
|
19
|
+
* major field and shipping a new writer.
|
|
20
|
+
* - `format_version_major = 1` is required for any current
|
|
21
|
+
* receiver. A major-version mismatch is a HARD block at read
|
|
22
|
+
* time (the reader throws and refuses to import).
|
|
23
|
+
* - `format_version_minor` is informational; a major-compatible
|
|
24
|
+
* minor bump emits a non-fatal warning at read time.
|
|
25
|
+
* - `schema_versions` carries the canonical asset schema literal
|
|
26
|
+
* for each emitted asset: `peaks.loop/1`, `peaks.bee/1`, plus
|
|
27
|
+
* the cross-cutting `peaks.loop-bee-relation/1` and
|
|
28
|
+
* `peaks.crystallization/1`. The reader uses the values to
|
|
29
|
+
* inform a version-mismatch warning.
|
|
30
|
+
*
|
|
31
|
+
* The schema is intentionally permissive on the manifests (the
|
|
32
|
+
* manifest sub-objects are typed as `unknown` so each asset kind
|
|
33
|
+
* can validate with its own Zod schema at the service layer); the
|
|
34
|
+
* hard invariants (format constant, format_version_major, the
|
|
35
|
+
* schema_versions keys, and the inclusion/exclusion rules) are
|
|
36
|
+
* enforced here at the format boundary.
|
|
37
|
+
*
|
|
38
|
+
* On-the-wire shape (the rendered `manifest.json`):
|
|
39
|
+
*
|
|
40
|
+
* {
|
|
41
|
+
* "format_constant": "peaks.bundle/1",
|
|
42
|
+
* "format_version_major": 1,
|
|
43
|
+
* "format_version_minor": 0,
|
|
44
|
+
* "schema_versions": {
|
|
45
|
+
* "loop": "peaks.loop/1",
|
|
46
|
+
* "bee": "peaks.bee/1",
|
|
47
|
+
* "loop_bee_relation": "peaks.loop-bee-relation/1",
|
|
48
|
+
* "crystallization": "peaks.crystallization/1"
|
|
49
|
+
* },
|
|
50
|
+
* "kind": "loop" | "bee",
|
|
51
|
+
* "loop_release": <LoopRelease row or omitted for bee kind>,
|
|
52
|
+
* "bee_release": <BeeRelease row or omitted for loop kind>,
|
|
53
|
+
* "related_bee_releases": Array<BeeRelease row>,
|
|
54
|
+
* "loop_bee_relations": Array<LoopBeeRelation row>,
|
|
55
|
+
* "evidence_briefs": Array<CrystallizationEvent row>,
|
|
56
|
+
* "exclusion_manifest": { "private_run_state": "excluded",
|
|
57
|
+
* "personal_memory": "excluded",
|
|
58
|
+
* "state_db_rows": "excluded" }
|
|
59
|
+
* }
|
|
60
|
+
*
|
|
61
|
+
* Excludes (spec §7A.2 hard rules): private run_state, anything
|
|
62
|
+
* under `.peaks/memory/personal/`, raw `state.db` rows.
|
|
63
|
+
*/
|
|
64
|
+
import { z } from "zod";
|
|
65
|
+
/**
|
|
66
|
+
* The on-the-wire format constant, pinned to the literal
|
|
67
|
+
* `"peaks.bundle/1"`. The CLI is the only writer — see `bundle-writer.ts`.
|
|
68
|
+
* A future format change requires a major-version bump + a new writer.
|
|
69
|
+
*/
|
|
70
|
+
export declare const PEAKS_BUNDLE_FORMAT_CONSTANT: "peaks.bundle/1";
|
|
71
|
+
/**
|
|
72
|
+
* The required `format_version_major` for any current receiver.
|
|
73
|
+
* Bumped only on a breaking schema change. The reader throws when
|
|
74
|
+
* the manifest declares any value other than `1`.
|
|
75
|
+
*/
|
|
76
|
+
export declare const PEAKS_BUNDLE_FORMAT_VERSION_MAJOR: 1;
|
|
77
|
+
/**
|
|
78
|
+
* Default `format_version_minor`. Major-compatible minor bumps emit
|
|
79
|
+
* a soft warning at read time; they never block.
|
|
80
|
+
*/
|
|
81
|
+
export declare const PEAKS_BUNDLE_DEFAULT_MINOR_VERSION: 0;
|
|
82
|
+
/**
|
|
83
|
+
* The cross-cutting schema literals a bundle is allowed to declare.
|
|
84
|
+
* Each value must match the canonical Zod `literal(...)` literal in
|
|
85
|
+
* the corresponding type module. Used for the
|
|
86
|
+
* `SchemaVersionsMapping` enumeration below.
|
|
87
|
+
*/
|
|
88
|
+
export declare const PEAKS_BUNDLE_SCHEMA_VERSIONS: {
|
|
89
|
+
readonly loop: "peaks.loop/1";
|
|
90
|
+
readonly bee: "peaks.bee/1";
|
|
91
|
+
readonly loop_bee_relation: "peaks.loop-bee-relation/1";
|
|
92
|
+
readonly crystallization: "peaks.crystallization/1";
|
|
93
|
+
};
|
|
94
|
+
export type PeaksBundleSchemaVersionKey = keyof typeof PEAKS_BUNDLE_SCHEMA_VERSIONS;
|
|
95
|
+
/**
|
|
96
|
+
* Schema-versions mapping. The writer writes the canonical literal
|
|
97
|
+
* for each asset kind it includes; the reader checks every key for
|
|
98
|
+
* presence (and that the value matches the canonical literal).
|
|
99
|
+
*
|
|
100
|
+
* `.strict()` refuses unknown keys; `.refine(...)` enforces that
|
|
101
|
+
* each value matches its canonical literal.
|
|
102
|
+
*/
|
|
103
|
+
export declare const SchemaVersionsMappingSchema: z.ZodObject<{
|
|
104
|
+
loop: z.ZodLiteral<"peaks.loop/1">;
|
|
105
|
+
bee: z.ZodLiteral<"peaks.bee/1">;
|
|
106
|
+
loop_bee_relation: z.ZodLiteral<"peaks.loop-bee-relation/1">;
|
|
107
|
+
crystallization: z.ZodLiteral<"peaks.crystallization/1">;
|
|
108
|
+
}, "strict", z.ZodTypeAny, {
|
|
109
|
+
bee: "peaks.bee/1";
|
|
110
|
+
loop: "peaks.loop/1";
|
|
111
|
+
loop_bee_relation: "peaks.loop-bee-relation/1";
|
|
112
|
+
crystallization: "peaks.crystallization/1";
|
|
113
|
+
}, {
|
|
114
|
+
bee: "peaks.bee/1";
|
|
115
|
+
loop: "peaks.loop/1";
|
|
116
|
+
loop_bee_relation: "peaks.loop-bee-relation/1";
|
|
117
|
+
crystallization: "peaks.crystallization/1";
|
|
118
|
+
}>;
|
|
119
|
+
export type SchemaVersionsMapping = z.infer<typeof SchemaVersionsMappingSchema>;
|
|
120
|
+
/**
|
|
121
|
+
* The bundle explicitly excludes private run-state, the user's
|
|
122
|
+
* personal memory directory, and raw `state.db` rows. The
|
|
123
|
+
* `ExclusionManifestSchema` is what the writer stamps into the
|
|
124
|
+
* manifest; the reader uses it as a self-declaration (the writer is
|
|
125
|
+
* the only place that can leak those payloads, but the read-time
|
|
126
|
+
* stamp lets the receiver confirm the source understood the
|
|
127
|
+
* exclusion rules).
|
|
128
|
+
*/
|
|
129
|
+
export declare const ExclusionManifestSchema: z.ZodObject<{
|
|
130
|
+
private_run_state: z.ZodLiteral<"excluded">;
|
|
131
|
+
personal_memory: z.ZodLiteral<"excluded">;
|
|
132
|
+
state_db_rows: z.ZodLiteral<"excluded">;
|
|
133
|
+
}, "strict", z.ZodTypeAny, {
|
|
134
|
+
private_run_state: "excluded";
|
|
135
|
+
personal_memory: "excluded";
|
|
136
|
+
state_db_rows: "excluded";
|
|
137
|
+
}, {
|
|
138
|
+
private_run_state: "excluded";
|
|
139
|
+
personal_memory: "excluded";
|
|
140
|
+
state_db_rows: "excluded";
|
|
141
|
+
}>;
|
|
142
|
+
export type ExclusionManifest = z.infer<typeof ExclusionManifestSchema>;
|
|
143
|
+
/**
|
|
144
|
+
* Bundle kind. A bundle is anchored on exactly one asset: either a
|
|
145
|
+
* `loop_release` (and its main bee + supporting bees) or a single
|
|
146
|
+
* `bee_release` (loop-scoped relations may follow but are not
|
|
147
|
+
* required).
|
|
148
|
+
*/
|
|
149
|
+
export declare const PEAKS_BUNDLE_KINDS: readonly ["loop", "bee"];
|
|
150
|
+
export type PeaksBundleKind = (typeof PEAKS_BUNDLE_KINDS)[number];
|
|
151
|
+
/**
|
|
152
|
+
* The full manifest schema. The asset sub-objects are typed as
|
|
153
|
+
* `unknown` here; each service layer validates them with the
|
|
154
|
+
* appropriate per-kind Zod schema (LoopReleaseSchema,
|
|
155
|
+
* BeeReleaseRow, LoopBeeRelationSchema, CrystallizationEventSchema).
|
|
156
|
+
*
|
|
157
|
+
* The hard invariants are enforced HERE:
|
|
158
|
+
* - `format_constant = "peaks.bundle/1"` literal.
|
|
159
|
+
* - `format_version_major = 1` literal (HARD block at read time
|
|
160
|
+
* on mismatch — enforced in `bundle-reader.ts`).
|
|
161
|
+
* - `schema_versions` carries every required key with the
|
|
162
|
+
* canonical literal.
|
|
163
|
+
* - `exclusion_manifest` declares the three hard excludes.
|
|
164
|
+
*/
|
|
165
|
+
export declare const BundleManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
166
|
+
/**
|
|
167
|
+
* The format constant. Pinned to `"peaks.bundle/1"`. A future
|
|
168
|
+
* format change is a major bump + a new constant value.
|
|
169
|
+
*/
|
|
170
|
+
format_constant: z.ZodLiteral<"peaks.bundle/1">;
|
|
171
|
+
/**
|
|
172
|
+
* Major version. The reader requires `1`; anything else is a
|
|
173
|
+
* HARD block. Enforced at the read boundary, not here.
|
|
174
|
+
*/
|
|
175
|
+
format_version_major: z.ZodLiteral<1>;
|
|
176
|
+
/**
|
|
177
|
+
* Minor version. Defaults to `0`. Major-compatible bumps are a
|
|
178
|
+
* non-fatal warn at read time.
|
|
179
|
+
*/
|
|
180
|
+
format_version_minor: z.ZodDefault<z.ZodNumber>;
|
|
181
|
+
/**
|
|
182
|
+
* Schema-version mapping. Every required key MUST be present
|
|
183
|
+
* with its canonical literal; unknown keys are rejected by
|
|
184
|
+
* `.strict()`.
|
|
185
|
+
*/
|
|
186
|
+
schema_versions: z.ZodObject<{
|
|
187
|
+
loop: z.ZodLiteral<"peaks.loop/1">;
|
|
188
|
+
bee: z.ZodLiteral<"peaks.bee/1">;
|
|
189
|
+
loop_bee_relation: z.ZodLiteral<"peaks.loop-bee-relation/1">;
|
|
190
|
+
crystallization: z.ZodLiteral<"peaks.crystallization/1">;
|
|
191
|
+
}, "strict", z.ZodTypeAny, {
|
|
192
|
+
bee: "peaks.bee/1";
|
|
193
|
+
loop: "peaks.loop/1";
|
|
194
|
+
loop_bee_relation: "peaks.loop-bee-relation/1";
|
|
195
|
+
crystallization: "peaks.crystallization/1";
|
|
196
|
+
}, {
|
|
197
|
+
bee: "peaks.bee/1";
|
|
198
|
+
loop: "peaks.loop/1";
|
|
199
|
+
loop_bee_relation: "peaks.loop-bee-relation/1";
|
|
200
|
+
crystallization: "peaks.crystallization/1";
|
|
201
|
+
}>;
|
|
202
|
+
/**
|
|
203
|
+
* Anchor kind. Decides whether `loop_release` or `bee_release`
|
|
204
|
+
* is required below.
|
|
205
|
+
*/
|
|
206
|
+
kind: z.ZodEnum<["loop", "bee"]>;
|
|
207
|
+
/**
|
|
208
|
+
* The loop_release row. Required when `kind === "loop"`,
|
|
209
|
+
* omitted (or absent) when `kind === "bee"`. The writer leaves
|
|
210
|
+
* it `undefined` for `bee` bundles; the JSON shape is allowed
|
|
211
|
+
* to omit it.
|
|
212
|
+
*/
|
|
213
|
+
loop_release: z.ZodOptional<z.ZodUnknown>;
|
|
214
|
+
/**
|
|
215
|
+
* The bee_release row. Required when `kind === "bee"`,
|
|
216
|
+
* optional for `kind === "loop"` (a loop bundle may include a
|
|
217
|
+
* main bee inline). When present, the reader uses the service
|
|
218
|
+
* layer to re-validate the row shape.
|
|
219
|
+
*/
|
|
220
|
+
bee_release: z.ZodOptional<z.ZodUnknown>;
|
|
221
|
+
/**
|
|
222
|
+
* Related bee_release rows for the loop kind (main + supporting
|
|
223
|
+
* + candidate + retired). Empty for `kind === "bee"`.
|
|
224
|
+
*/
|
|
225
|
+
related_bee_releases: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
|
|
226
|
+
/**
|
|
227
|
+
* Loop↔bee relation rows from `loop_bee_relation`. Always
|
|
228
|
+
* present (possibly empty).
|
|
229
|
+
*/
|
|
230
|
+
loop_bee_relations: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
|
|
231
|
+
/**
|
|
232
|
+
* Evidence briefs (crystallization_event rows) that back the
|
|
233
|
+
* bundle's assets. The receiver uses them to render the
|
|
234
|
+
* post-import crystallization prompt + a brief for any
|
|
235
|
+
* subsequent independent evaluation.
|
|
236
|
+
*/
|
|
237
|
+
evidence_briefs: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
|
|
238
|
+
/**
|
|
239
|
+
* Exclusion manifest — explicit declarations of the three
|
|
240
|
+
* hard excludes per spec §7A.2.
|
|
241
|
+
*/
|
|
242
|
+
exclusion_manifest: z.ZodObject<{
|
|
243
|
+
private_run_state: z.ZodLiteral<"excluded">;
|
|
244
|
+
personal_memory: z.ZodLiteral<"excluded">;
|
|
245
|
+
state_db_rows: z.ZodLiteral<"excluded">;
|
|
246
|
+
}, "strict", z.ZodTypeAny, {
|
|
247
|
+
private_run_state: "excluded";
|
|
248
|
+
personal_memory: "excluded";
|
|
249
|
+
state_db_rows: "excluded";
|
|
250
|
+
}, {
|
|
251
|
+
private_run_state: "excluded";
|
|
252
|
+
personal_memory: "excluded";
|
|
253
|
+
state_db_rows: "excluded";
|
|
254
|
+
}>;
|
|
255
|
+
}, "strict", z.ZodTypeAny, {
|
|
256
|
+
kind: "bee" | "loop";
|
|
257
|
+
format_constant: "peaks.bundle/1";
|
|
258
|
+
format_version_major: 1;
|
|
259
|
+
format_version_minor: number;
|
|
260
|
+
schema_versions: {
|
|
261
|
+
bee: "peaks.bee/1";
|
|
262
|
+
loop: "peaks.loop/1";
|
|
263
|
+
loop_bee_relation: "peaks.loop-bee-relation/1";
|
|
264
|
+
crystallization: "peaks.crystallization/1";
|
|
265
|
+
};
|
|
266
|
+
related_bee_releases: unknown[];
|
|
267
|
+
loop_bee_relations: unknown[];
|
|
268
|
+
evidence_briefs: unknown[];
|
|
269
|
+
exclusion_manifest: {
|
|
270
|
+
private_run_state: "excluded";
|
|
271
|
+
personal_memory: "excluded";
|
|
272
|
+
state_db_rows: "excluded";
|
|
273
|
+
};
|
|
274
|
+
loop_release?: unknown;
|
|
275
|
+
bee_release?: unknown;
|
|
276
|
+
}, {
|
|
277
|
+
kind: "bee" | "loop";
|
|
278
|
+
format_constant: "peaks.bundle/1";
|
|
279
|
+
format_version_major: 1;
|
|
280
|
+
schema_versions: {
|
|
281
|
+
bee: "peaks.bee/1";
|
|
282
|
+
loop: "peaks.loop/1";
|
|
283
|
+
loop_bee_relation: "peaks.loop-bee-relation/1";
|
|
284
|
+
crystallization: "peaks.crystallization/1";
|
|
285
|
+
};
|
|
286
|
+
exclusion_manifest: {
|
|
287
|
+
private_run_state: "excluded";
|
|
288
|
+
personal_memory: "excluded";
|
|
289
|
+
state_db_rows: "excluded";
|
|
290
|
+
};
|
|
291
|
+
format_version_minor?: number | undefined;
|
|
292
|
+
loop_release?: unknown;
|
|
293
|
+
bee_release?: unknown;
|
|
294
|
+
related_bee_releases?: unknown[] | undefined;
|
|
295
|
+
loop_bee_relations?: unknown[] | undefined;
|
|
296
|
+
evidence_briefs?: unknown[] | undefined;
|
|
297
|
+
}>, {
|
|
298
|
+
kind: "bee" | "loop";
|
|
299
|
+
format_constant: "peaks.bundle/1";
|
|
300
|
+
format_version_major: 1;
|
|
301
|
+
format_version_minor: number;
|
|
302
|
+
schema_versions: {
|
|
303
|
+
bee: "peaks.bee/1";
|
|
304
|
+
loop: "peaks.loop/1";
|
|
305
|
+
loop_bee_relation: "peaks.loop-bee-relation/1";
|
|
306
|
+
crystallization: "peaks.crystallization/1";
|
|
307
|
+
};
|
|
308
|
+
related_bee_releases: unknown[];
|
|
309
|
+
loop_bee_relations: unknown[];
|
|
310
|
+
evidence_briefs: unknown[];
|
|
311
|
+
exclusion_manifest: {
|
|
312
|
+
private_run_state: "excluded";
|
|
313
|
+
personal_memory: "excluded";
|
|
314
|
+
state_db_rows: "excluded";
|
|
315
|
+
};
|
|
316
|
+
loop_release?: unknown;
|
|
317
|
+
bee_release?: unknown;
|
|
318
|
+
}, {
|
|
319
|
+
kind: "bee" | "loop";
|
|
320
|
+
format_constant: "peaks.bundle/1";
|
|
321
|
+
format_version_major: 1;
|
|
322
|
+
schema_versions: {
|
|
323
|
+
bee: "peaks.bee/1";
|
|
324
|
+
loop: "peaks.loop/1";
|
|
325
|
+
loop_bee_relation: "peaks.loop-bee-relation/1";
|
|
326
|
+
crystallization: "peaks.crystallization/1";
|
|
327
|
+
};
|
|
328
|
+
exclusion_manifest: {
|
|
329
|
+
private_run_state: "excluded";
|
|
330
|
+
personal_memory: "excluded";
|
|
331
|
+
state_db_rows: "excluded";
|
|
332
|
+
};
|
|
333
|
+
format_version_minor?: number | undefined;
|
|
334
|
+
loop_release?: unknown;
|
|
335
|
+
bee_release?: unknown;
|
|
336
|
+
related_bee_releases?: unknown[] | undefined;
|
|
337
|
+
loop_bee_relations?: unknown[] | undefined;
|
|
338
|
+
evidence_briefs?: unknown[] | undefined;
|
|
339
|
+
}>;
|
|
340
|
+
export type BundleManifest = z.infer<typeof BundleManifestSchema>;
|
|
341
|
+
/**
|
|
342
|
+
* Strict-parse an unknown value as a BundleManifest. Throws
|
|
343
|
+
* `z.ZodError` on any failure — including:
|
|
344
|
+
* - format_constant !== "peaks.bundle/1"
|
|
345
|
+
* - format_version_major !== 1
|
|
346
|
+
* - schema_versions missing or carrying non-canonical literals
|
|
347
|
+
* - exclusion_manifest missing any of the three hard excludes
|
|
348
|
+
* - kind / anchor-mismatch (loop kind without loop_release, etc.)
|
|
349
|
+
*
|
|
350
|
+
* Note: a major-version mismatch on its own is NOT a Zod failure
|
|
351
|
+
* (the literal is enforced at the schema boundary so it is), but
|
|
352
|
+
* the `bundle-reader.ts` HARD block on major mismatch is layered on
|
|
353
|
+
* top of this parse for defense in depth (it lets the CLI emit its
|
|
354
|
+
* own specific error code without catching Zod errors).
|
|
355
|
+
*/
|
|
356
|
+
export declare function parseBundleManifest(input: unknown): BundleManifest;
|
|
357
|
+
/**
|
|
358
|
+
* Safe-parse twin of `parseBundleManifest` — returns a Result-like
|
|
359
|
+
* envelope. Used by the CLI layer so a manifest-validation failure
|
|
360
|
+
* can be rendered as a structured error code rather than a thrown
|
|
361
|
+
* `ZodError`.
|
|
362
|
+
*/
|
|
363
|
+
export declare function safeParseBundleManifest(input: unknown): {
|
|
364
|
+
ok: true;
|
|
365
|
+
manifest: BundleManifest;
|
|
366
|
+
} | {
|
|
367
|
+
ok: false;
|
|
368
|
+
code: "BUNDLE_FORMAT_CONSTANT_MISMATCH" | "BUNDLE_MAJOR_VERSION_MISMATCH" | "BUNDLE_SCHEMA_VERSIONS_MISMATCH" | "BUNDLE_EXCLUSION_MANIFEST_MISSING" | "BUNDLE_KIND_ANCHOR_MISMATCH";
|
|
369
|
+
findings: Array<{
|
|
370
|
+
path: string;
|
|
371
|
+
message: string;
|
|
372
|
+
}>;
|
|
373
|
+
};
|
|
374
|
+
/**
|
|
375
|
+
* Error code string consts. Centralised here so the writer + reader
|
|
376
|
+
* share a single source of truth for error codes; the CLI layer
|
|
377
|
+
* only needs to render them.
|
|
378
|
+
*/
|
|
379
|
+
export declare const SHARE_BUNDLE_ERROR_CODES: {
|
|
380
|
+
/** Major-version mismatch at read time — HARD block. */
|
|
381
|
+
readonly MAJOR_VERSION_MISMATCH: "SHARE_BUNDLE_MAJOR_VERSION_MISMATCH";
|
|
382
|
+
/** Schema-version mapping is missing or carries non-canonical literals. */
|
|
383
|
+
readonly SCHEMA_VERSIONS_MISMATCH: "SHARE_BUNDLE_SCHEMA_VERSIONS_MISMATCH";
|
|
384
|
+
/** Format constant is not the pinned "peaks.bundle/1". */
|
|
385
|
+
readonly FORMAT_CONSTANT_MISMATCH: "SHARE_BUNDLE_FORMAT_CONSTANT_MISMATCH";
|
|
386
|
+
/** Source release has `shareable === false` — HARD block at write time. */
|
|
387
|
+
readonly NOT_SHAREABLE: "SHARE_BUNDLE_NOT_SHAREABLE";
|
|
388
|
+
/** Receiver asked to land as `stable` (forbidden — bundles always land as candidate). */
|
|
389
|
+
readonly IMPORT_TO_STABLE_FORBIDDEN: "SHARE_BUNDLE_IMPORT_TO_STABLE_FORBIDDEN";
|
|
390
|
+
/** Bundle tarball is malformed (missing manifest, bad payload). */
|
|
391
|
+
readonly BUNDLE_MALFORMED: "SHARE_BUNDLE_MALFORMED";
|
|
392
|
+
};
|