@alterset/alterspec-client 0.17.0 → 0.19.0
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/assets/prompts/_shared.md +4 -0
- package/assets/prompts/spec-ask.md +5 -1
- package/assets/prompts/task-context.md +11 -1
- package/developer-guide.md +21 -1
- package/dist/cli.js +594 -158
- package/dist/cli.js.map +1 -1
- package/dist/work.d.ts +104 -11
- package/dist/work.js +25 -6
- package/dist/work.js.map +1 -1
- package/dist/work.schema.json +199 -0
- package/package.json +1 -1
package/dist/work.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
/**
|
|
4
4
|
* `work.json` in an export: the work every signed-off change implies, for an application that hands it to developers
|
|
5
5
|
* (the alterspec dispatcher). The one definition of the format. It imports nothing but zod, so the alterspec client
|
|
6
|
-
* can carry it as it is. Format
|
|
6
|
+
* can carry it as it is. Format 4 (alterspec 0.34.0) adds each change's optional `weight`; format 3 (0.33.0) adds each task's optional `weights`; format 2 (0.24.0) added
|
|
7
7
|
* each task's `items`; format 1 is the same without them. A reader of every format takes `AnyWorkSchema`.
|
|
8
8
|
*/
|
|
9
9
|
/** `BE` (the backend, API channels included) or the code of a channel with an experience of its own. */
|
|
@@ -52,11 +52,12 @@ declare const WorkChangeSchema: z.ZodObject<{
|
|
|
52
52
|
}, z.core.$strict>>;
|
|
53
53
|
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
54
54
|
}, z.core.$strict>>;
|
|
55
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
55
56
|
}, z.core.$strict>;
|
|
56
57
|
type WorkChange = z.infer<typeof WorkChangeSchema>;
|
|
57
|
-
declare const WORK_FORMAT =
|
|
58
|
+
declare const WORK_FORMAT = 4;
|
|
58
59
|
declare const WorkSchema: z.ZodObject<{
|
|
59
|
-
format: z.ZodLiteral<
|
|
60
|
+
format: z.ZodLiteral<4>;
|
|
60
61
|
alterspec: z.ZodString;
|
|
61
62
|
exported: z.ZodISODate;
|
|
62
63
|
baseline: z.ZodNullable<z.ZodObject<{
|
|
@@ -88,9 +89,66 @@ declare const WorkSchema: z.ZodObject<{
|
|
|
88
89
|
}, z.core.$strict>>;
|
|
89
90
|
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
90
91
|
}, z.core.$strict>>;
|
|
92
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
91
93
|
}, z.core.$strict>>;
|
|
92
94
|
}, z.core.$strict>;
|
|
93
95
|
type Work = z.infer<typeof WorkSchema>;
|
|
96
|
+
/** Format 3 (alterspec 0.33): the same without the change's `weight`. */
|
|
97
|
+
declare const WorkChangeV3Schema: z.ZodObject<{
|
|
98
|
+
id: z.ZodString;
|
|
99
|
+
signed_off: z.ZodISODate;
|
|
100
|
+
title: z.ZodString;
|
|
101
|
+
delta: z.ZodString;
|
|
102
|
+
depends_on: z.ZodArray<z.ZodString>;
|
|
103
|
+
level: z.ZodNumber;
|
|
104
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
105
|
+
track: z.ZodString;
|
|
106
|
+
objects: z.ZodArray<z.ZodString>;
|
|
107
|
+
items: z.ZodArray<z.ZodString>;
|
|
108
|
+
after: z.ZodArray<z.ZodObject<{
|
|
109
|
+
change: z.ZodString;
|
|
110
|
+
track: z.ZodString;
|
|
111
|
+
}, z.core.$strict>>;
|
|
112
|
+
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
113
|
+
}, z.core.$strict>>;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
type WorkChangeV3 = z.infer<typeof WorkChangeV3Schema>;
|
|
116
|
+
declare const WorkV3Schema: z.ZodObject<{
|
|
117
|
+
alterspec: z.ZodString;
|
|
118
|
+
exported: z.ZodISODate;
|
|
119
|
+
baseline: z.ZodNullable<z.ZodObject<{
|
|
120
|
+
date: z.ZodISODate;
|
|
121
|
+
built: z.ZodBoolean;
|
|
122
|
+
}, z.core.$strict>>;
|
|
123
|
+
tracks: z.ZodArray<z.ZodObject<{
|
|
124
|
+
code: z.ZodString;
|
|
125
|
+
kind: z.ZodEnum<{
|
|
126
|
+
backend: "backend";
|
|
127
|
+
ui: "ui";
|
|
128
|
+
}>;
|
|
129
|
+
channels: z.ZodArray<z.ZodString>;
|
|
130
|
+
}, z.core.$strict>>;
|
|
131
|
+
format: z.ZodLiteral<3>;
|
|
132
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
133
|
+
id: z.ZodString;
|
|
134
|
+
signed_off: z.ZodISODate;
|
|
135
|
+
title: z.ZodString;
|
|
136
|
+
delta: z.ZodString;
|
|
137
|
+
depends_on: z.ZodArray<z.ZodString>;
|
|
138
|
+
level: z.ZodNumber;
|
|
139
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
140
|
+
track: z.ZodString;
|
|
141
|
+
objects: z.ZodArray<z.ZodString>;
|
|
142
|
+
items: z.ZodArray<z.ZodString>;
|
|
143
|
+
after: z.ZodArray<z.ZodObject<{
|
|
144
|
+
change: z.ZodString;
|
|
145
|
+
track: z.ZodString;
|
|
146
|
+
}, z.core.$strict>>;
|
|
147
|
+
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
148
|
+
}, z.core.$strict>>;
|
|
149
|
+
}, z.core.$strict>>;
|
|
150
|
+
}, z.core.$strict>;
|
|
151
|
+
type WorkV3 = z.infer<typeof WorkV3Schema>;
|
|
94
152
|
/** Format 2 (alterspec 0.24 to 0.32): the same without `weights`. */
|
|
95
153
|
declare const WorkTaskV2Schema: z.ZodObject<{
|
|
96
154
|
track: z.ZodString;
|
|
@@ -120,8 +178,8 @@ declare const WorkV2Schema: z.ZodObject<{
|
|
|
120
178
|
format: z.ZodLiteral<2>;
|
|
121
179
|
changes: z.ZodArray<z.ZodObject<{
|
|
122
180
|
id: z.ZodString;
|
|
123
|
-
title: z.ZodString;
|
|
124
181
|
signed_off: z.ZodISODate;
|
|
182
|
+
title: z.ZodString;
|
|
125
183
|
delta: z.ZodString;
|
|
126
184
|
depends_on: z.ZodArray<z.ZodString>;
|
|
127
185
|
level: z.ZodNumber;
|
|
@@ -137,7 +195,7 @@ declare const WorkV2Schema: z.ZodObject<{
|
|
|
137
195
|
}, z.core.$strict>>;
|
|
138
196
|
}, z.core.$strict>;
|
|
139
197
|
type WorkV2 = z.infer<typeof WorkV2Schema>;
|
|
140
|
-
/** Format 1 (alterspec 0.23): the same without `items` and `
|
|
198
|
+
/** Format 1 (alterspec 0.23): the same without `items`, `weights` and the change's `weight`. */
|
|
141
199
|
declare const WorkTaskV1Schema: z.ZodObject<{
|
|
142
200
|
track: z.ZodString;
|
|
143
201
|
objects: z.ZodArray<z.ZodString>;
|
|
@@ -165,8 +223,8 @@ declare const WorkV1Schema: z.ZodObject<{
|
|
|
165
223
|
format: z.ZodLiteral<1>;
|
|
166
224
|
changes: z.ZodArray<z.ZodObject<{
|
|
167
225
|
id: z.ZodString;
|
|
168
|
-
title: z.ZodString;
|
|
169
226
|
signed_off: z.ZodISODate;
|
|
227
|
+
title: z.ZodString;
|
|
170
228
|
delta: z.ZodString;
|
|
171
229
|
depends_on: z.ZodArray<z.ZodString>;
|
|
172
230
|
level: z.ZodNumber;
|
|
@@ -200,8 +258,8 @@ declare const AnyWorkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
200
258
|
format: z.ZodLiteral<1>;
|
|
201
259
|
changes: z.ZodArray<z.ZodObject<{
|
|
202
260
|
id: z.ZodString;
|
|
203
|
-
title: z.ZodString;
|
|
204
261
|
signed_off: z.ZodISODate;
|
|
262
|
+
title: z.ZodString;
|
|
205
263
|
delta: z.ZodString;
|
|
206
264
|
depends_on: z.ZodArray<z.ZodString>;
|
|
207
265
|
level: z.ZodNumber;
|
|
@@ -232,8 +290,8 @@ declare const AnyWorkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
232
290
|
format: z.ZodLiteral<2>;
|
|
233
291
|
changes: z.ZodArray<z.ZodObject<{
|
|
234
292
|
id: z.ZodString;
|
|
235
|
-
title: z.ZodString;
|
|
236
293
|
signed_off: z.ZodISODate;
|
|
294
|
+
title: z.ZodString;
|
|
237
295
|
delta: z.ZodString;
|
|
238
296
|
depends_on: z.ZodArray<z.ZodString>;
|
|
239
297
|
level: z.ZodNumber;
|
|
@@ -248,7 +306,41 @@ declare const AnyWorkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
248
306
|
}, z.core.$strict>>;
|
|
249
307
|
}, z.core.$strict>>;
|
|
250
308
|
}, z.core.$strict>, z.ZodObject<{
|
|
309
|
+
alterspec: z.ZodString;
|
|
310
|
+
exported: z.ZodISODate;
|
|
311
|
+
baseline: z.ZodNullable<z.ZodObject<{
|
|
312
|
+
date: z.ZodISODate;
|
|
313
|
+
built: z.ZodBoolean;
|
|
314
|
+
}, z.core.$strict>>;
|
|
315
|
+
tracks: z.ZodArray<z.ZodObject<{
|
|
316
|
+
code: z.ZodString;
|
|
317
|
+
kind: z.ZodEnum<{
|
|
318
|
+
backend: "backend";
|
|
319
|
+
ui: "ui";
|
|
320
|
+
}>;
|
|
321
|
+
channels: z.ZodArray<z.ZodString>;
|
|
322
|
+
}, z.core.$strict>>;
|
|
251
323
|
format: z.ZodLiteral<3>;
|
|
324
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
325
|
+
id: z.ZodString;
|
|
326
|
+
signed_off: z.ZodISODate;
|
|
327
|
+
title: z.ZodString;
|
|
328
|
+
delta: z.ZodString;
|
|
329
|
+
depends_on: z.ZodArray<z.ZodString>;
|
|
330
|
+
level: z.ZodNumber;
|
|
331
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
332
|
+
track: z.ZodString;
|
|
333
|
+
objects: z.ZodArray<z.ZodString>;
|
|
334
|
+
items: z.ZodArray<z.ZodString>;
|
|
335
|
+
after: z.ZodArray<z.ZodObject<{
|
|
336
|
+
change: z.ZodString;
|
|
337
|
+
track: z.ZodString;
|
|
338
|
+
}, z.core.$strict>>;
|
|
339
|
+
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
340
|
+
}, z.core.$strict>>;
|
|
341
|
+
}, z.core.$strict>>;
|
|
342
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
343
|
+
format: z.ZodLiteral<4>;
|
|
252
344
|
alterspec: z.ZodString;
|
|
253
345
|
exported: z.ZodISODate;
|
|
254
346
|
baseline: z.ZodNullable<z.ZodObject<{
|
|
@@ -280,6 +372,7 @@ declare const AnyWorkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
280
372
|
}, z.core.$strict>>;
|
|
281
373
|
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
282
374
|
}, z.core.$strict>>;
|
|
375
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
283
376
|
}, z.core.$strict>>;
|
|
284
377
|
}, z.core.$strict>], "format">;
|
|
285
378
|
type AnyWork = z.infer<typeof AnyWorkSchema>;
|
|
@@ -290,11 +383,11 @@ declare class WorkError extends Error {
|
|
|
290
383
|
constructor(message: string, issues?: z.core.$ZodIssue[]);
|
|
291
384
|
}
|
|
292
385
|
/**
|
|
293
|
-
* Parses and validates the text of a `work.json` of format 1
|
|
294
|
-
* `items`, 3 may carry `weights`); throws a `WorkError` naming every field that is wrong.
|
|
386
|
+
* Parses and validates the text of a `work.json` of format 1 to 4 (tell them apart by `format`; 2 to 4 have
|
|
387
|
+
* `items`, 3 and 4 may carry `weights`, 4 a change's `weight`); throws a `WorkError` naming every field that is wrong.
|
|
295
388
|
*/
|
|
296
389
|
declare function parseWork(text: string): AnyWork;
|
|
297
390
|
/** The JSON Schema of `work.json` (either format), as alterspec installs it in `.alterspec/schemas/work.json`. */
|
|
298
391
|
declare function toWorkJsonSchema(): object;
|
|
299
392
|
|
|
300
|
-
export { type AnyWork, AnyWorkSchema, TrackCode, WORK_FORMAT, type Work, type WorkChange, WorkChangeSchema, WorkError, WorkSchema, type WorkTask, WorkTaskSchema, type WorkTaskV1, WorkTaskV1Schema, type WorkTaskV2, WorkTaskV2Schema, type WorkTrack, WorkTrackSchema, type WorkV1, WorkV1Schema, type WorkV2, WorkV2Schema, WorkWeight, parseWork, toWorkJsonSchema };
|
|
393
|
+
export { type AnyWork, AnyWorkSchema, TrackCode, WORK_FORMAT, type Work, type WorkChange, WorkChangeSchema, type WorkChangeV3, WorkChangeV3Schema, WorkError, WorkSchema, type WorkTask, WorkTaskSchema, type WorkTaskV1, WorkTaskV1Schema, type WorkTaskV2, WorkTaskV2Schema, type WorkTrack, WorkTrackSchema, type WorkV1, WorkV1Schema, type WorkV2, WorkV2Schema, type WorkV3, WorkV3Schema, WorkWeight, parseWork, toWorkJsonSchema };
|
package/dist/work.js
CHANGED
|
@@ -48,9 +48,16 @@ var WorkChangeSchema = z.object({
|
|
|
48
48
|
/** The change map's level. */
|
|
49
49
|
level: z.number().int().min(1),
|
|
50
50
|
/** One per track the change is on; empty = no work. */
|
|
51
|
-
tasks: z.array(WorkTaskSchema)
|
|
51
|
+
tasks: z.array(WorkTaskSchema),
|
|
52
|
+
/**
|
|
53
|
+
* The size of the whole change, 1–100 (format 4): reasoned at sign-off against alterspec's change rubric (a
|
|
54
|
+
* wording fix about 1–5, one capability's criteria 10–20, a new capability or flow 30–50, a new module or the
|
|
55
|
+
* application's foundation 80–100), never a sum of the item weights and never anyone's code. Absent: the change
|
|
56
|
+
* was signed off without one. For the lists; progress and ETA keep the item weights.
|
|
57
|
+
*/
|
|
58
|
+
weight: WorkWeight.optional()
|
|
52
59
|
}).strict();
|
|
53
|
-
var WORK_FORMAT =
|
|
60
|
+
var WORK_FORMAT = 4;
|
|
54
61
|
var WorkSchema = z.object({
|
|
55
62
|
format: z.literal(WORK_FORMAT),
|
|
56
63
|
/** The alterspec version that wrote the export. */
|
|
@@ -62,20 +69,30 @@ var WorkSchema = z.object({
|
|
|
62
69
|
/** Every change signed off after the baseline, in the change map's order. */
|
|
63
70
|
changes: z.array(WorkChangeSchema)
|
|
64
71
|
}).strict();
|
|
72
|
+
var WorkChangeV3Schema = WorkChangeSchema.omit({ weight: true }).strict();
|
|
73
|
+
var WorkV3Schema = WorkSchema.extend({
|
|
74
|
+
format: z.literal(3),
|
|
75
|
+
changes: z.array(WorkChangeV3Schema)
|
|
76
|
+
}).strict();
|
|
65
77
|
var WorkTaskV2Schema = WorkTaskSchema.omit({ weights: true });
|
|
66
78
|
var WorkV2Schema = WorkSchema.extend({
|
|
67
79
|
format: z.literal(2),
|
|
68
|
-
changes: z.array(
|
|
80
|
+
changes: z.array(WorkChangeV3Schema.extend({ tasks: z.array(WorkTaskV2Schema) }).strict())
|
|
69
81
|
}).strict();
|
|
70
82
|
var WorkTaskV1Schema = WorkTaskV2Schema.omit({ items: true });
|
|
71
83
|
var WorkV1Schema = WorkSchema.extend({
|
|
72
84
|
format: z.literal(1),
|
|
73
|
-
changes: z.array(
|
|
85
|
+
changes: z.array(WorkChangeV3Schema.extend({ tasks: z.array(WorkTaskV1Schema) }).strict())
|
|
74
86
|
}).strict();
|
|
75
|
-
var AnyWorkSchema = z.discriminatedUnion("format", [
|
|
87
|
+
var AnyWorkSchema = z.discriminatedUnion("format", [
|
|
88
|
+
WorkV1Schema,
|
|
89
|
+
WorkV2Schema,
|
|
90
|
+
WorkV3Schema,
|
|
91
|
+
WorkSchema
|
|
92
|
+
]);
|
|
76
93
|
|
|
77
94
|
// src/work.ts
|
|
78
|
-
var FORMATS = [1, 2, 3];
|
|
95
|
+
var FORMATS = [1, 2, 3, 4];
|
|
79
96
|
var WorkError = class extends Error {
|
|
80
97
|
constructor(message, issues = []) {
|
|
81
98
|
super(message);
|
|
@@ -116,6 +133,7 @@ export {
|
|
|
116
133
|
TrackCode,
|
|
117
134
|
WORK_FORMAT,
|
|
118
135
|
WorkChangeSchema,
|
|
136
|
+
WorkChangeV3Schema,
|
|
119
137
|
WorkError,
|
|
120
138
|
WorkSchema,
|
|
121
139
|
WorkTaskSchema,
|
|
@@ -124,6 +142,7 @@ export {
|
|
|
124
142
|
WorkTrackSchema,
|
|
125
143
|
WorkV1Schema,
|
|
126
144
|
WorkV2Schema,
|
|
145
|
+
WorkV3Schema,
|
|
127
146
|
WorkWeight,
|
|
128
147
|
parseWork,
|
|
129
148
|
toWorkJsonSchema
|
package/dist/work.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/work.ts","../../src/schemas/work.ts"],"sourcesContent":["import { z } from 'zod';\nimport { AnyWorkSchema, type AnyWork } from '../../src/schemas/work.js';\n\n/**\n * `@alterset/alterspec-client/work`: the format of `work.json` in an alterspec export, for the dispatcher and anyone\n * else who reads it. The schema is alterspec's own (`src/schemas/work.ts`), re-exported, never copied. Format 3 is\n * `WorkSchema`, format 2 `WorkV2Schema` (no `weights`), format 1 `WorkV1Schema` (no `items`); `parseWork` reads all.\n */\n\n/** The formats this client reads. */\nconst FORMATS = [1, 2, 3];\nexport * from '../../src/schemas/work.js';\n\n/** A `work.json` that is not JSON or not the format; `issues` holds zod's issues when it is JSON. */\nexport class WorkError extends Error {\n constructor(\n message: string,\n readonly issues: z.core.$ZodIssue[] = [],\n ) {\n super(message);\n this.name = 'WorkError';\n }\n}\n\n/** `changes[3].delta`: the issue's path as one would write it in JavaScript. */\nfunction pathText(path: readonly PropertyKey[]): string {\n let out = '';\n for (const p of path) out += typeof p === 'number' ? `[${p}]` : `${out ? '.' : ''}${String(p)}`;\n return out || '(root)';\n}\n\n/**\n * Parses and validates the text of a `work.json` of format 1, 2 or 3 (tell them apart by `format`; 2 and 3 have\n * `items`, 3 may carry `weights`); throws a `WorkError` naming every field that is wrong.\n */\nexport function parseWork(text: string): AnyWork {\n let data: unknown;\n try {\n data = JSON.parse(text);\n } catch (e) {\n throw new WorkError(`work.json is not JSON: ${(e as Error).message}`);\n }\n const format = (data as { format?: unknown } | null)?.format;\n if (typeof format === 'number' && !FORMATS.includes(format)) {\n throw new WorkError(`work.json has format ${format}; this client knows formats ${FORMATS.join(', ')}`);\n }\n const r = AnyWorkSchema.safeParse(data);\n if (r.success) return r.data;\n const lines = r.error.issues.map((i) => ` ${pathText(i.path)}: ${i.message}`);\n throw new WorkError(`work.json is not valid:\\n${lines.join('\\n')}`, r.error.issues);\n}\n\n/** The JSON Schema of `work.json` (either format), as alterspec installs it in `.alterspec/schemas/work.json`. */\nexport function toWorkJsonSchema(): object {\n return {\n title: 'alterspec work',\n ...z.toJSONSchema(AnyWorkSchema, { io: 'input', unrepresentable: 'any' }),\n };\n}\n","import { z } from 'zod';\n\n/**\n * `work.json` in an export: the work every signed-off change implies, for an application that hands it to developers\n * (the alterspec dispatcher). The one definition of the format. It imports nothing but zod, so the alterspec client\n * can carry it as it is. Format 3 (alterspec 0.33.0) adds each task's optional `weights`; format 2 (0.24.0) added\n * each task's `items`; format 1 is the same without them. A reader of every format takes `AnyWorkSchema`.\n */\n\n/** `BE` (the backend, API channels included) or the code of a channel with an experience of its own. */\nexport const TrackCode = z.string().regex(/^[A-Z]{2,5}$/, { message: 'must be BE or a channel code' });\nexport type TrackCode = z.infer<typeof TrackCode>;\n\n/**\n * The weight of a task item, 1–100: how much specified behaviour the item adds or changes, reasoned at sign-off\n * against alterspec's rubric (a typical acceptance criterion is about 10), never an estimate of anyone's code.\n */\nexport const WorkWeight = z.number().int().min(1).max(100);\nexport type WorkWeight = z.infer<typeof WorkWeight>;\n\nconst ChangeRef = z.string().regex(/^CHG-\\d{3,}$/);\nconst Day = z.iso.date();\n\nexport const WorkTrackSchema = z\n .object({\n code: TrackCode,\n kind: z.enum(['backend', 'ui']),\n /** The channel codes the track builds: the API channels for `BE`, the channels sharing the experience for a UI track. */\n channels: z.array(z.string()),\n })\n .strict();\nexport type WorkTrack = z.infer<typeof WorkTrackSchema>;\n\nexport const WorkTaskSchema = z\n .object({\n track: TrackCode,\n /** The keys of the objects in the change's delta that put it on the track. */\n objects: z.array(z.string()),\n /**\n * The task's checklist, derived from the delta: the acceptance criteria (`<CAP>-AC-NN`), screen actions\n * (`<SCR>.Ann`) and contract states (`<UX-SCR>#<state>`) the change adds or changes, and every other object as\n * its key; on `BE`, `<CHG>#data-change` when the proposal declares a one-time data change (alterspec 0.27.0).\n * Sorted, never empty.\n */\n items: z.array(z.string().min(1)).min(1),\n /**\n * The tasks this one waits for, resolved and reduced: the same change's `BE` task, and the track's tasks of the\n * changes it builds on that did the same work (an item of both, a line of a whole object this task edits again,\n * or an object this task names that entered the export with the earlier change).\n */\n after: z.array(z.object({ change: ChangeRef, track: TrackCode }).strict()),\n /**\n * The weight of each item (format 3): how much specified behaviour it adds or changes, 1–100, reasoned at the\n * change's sign-off against alterspec's rubric (a typical acceptance criterion about 10), never anyone's code.\n * An item the sign-off didn't weigh takes the median of the task's weighed items; a task of a change signed off\n * without weights has no `weights`, and a reader counts each of its items as 10. For weighing progress and ETA.\n */\n weights: z.record(z.string().min(1), WorkWeight).optional(),\n })\n .strict();\nexport type WorkTask = z.infer<typeof WorkTaskSchema>;\n\nexport const WorkChangeSchema = z\n .object({\n id: ChangeRef,\n title: z.string(),\n signed_off: Day,\n /** The hash of the change's `delta.json`; a signed-off change never changes. */\n delta: z.string().regex(/^[0-9a-f]{16}$/),\n depends_on: z.array(ChangeRef),\n /** The change map's level. */\n level: z.number().int().min(1),\n /** One per track the change is on; empty = no work. */\n tasks: z.array(WorkTaskSchema),\n })\n .strict();\nexport type WorkChange = z.infer<typeof WorkChangeSchema>;\n\nexport const WORK_FORMAT = 3;\n\nexport const WorkSchema = z\n .object({\n format: z.literal(WORK_FORMAT),\n /** The alterspec version that wrote the export. */\n alterspec: z.string(),\n exported: Day,\n /** Everything signed off before the changes began; `built`: the product as it runs (a reverse-spec), no work. */\n baseline: z.object({ date: Day, built: z.boolean() }).strict().nullable(),\n tracks: z.array(WorkTrackSchema),\n /** Every change signed off after the baseline, in the change map's order. */\n changes: z.array(WorkChangeSchema),\n })\n .strict();\nexport type Work = z.infer<typeof WorkSchema>;\n\n/** Format 2 (alterspec 0.24 to 0.32): the same without `weights`. */\nexport const WorkTaskV2Schema = WorkTaskSchema.omit({ weights: true });\nexport type WorkTaskV2 = z.infer<typeof WorkTaskV2Schema>;\n\nexport const WorkV2Schema = WorkSchema.extend({\n format: z.literal(2),\n changes: z.array(WorkChangeSchema.extend({ tasks: z.array(WorkTaskV2Schema) }).strict()),\n}).strict();\nexport type WorkV2 = z.infer<typeof WorkV2Schema>;\n\n/** Format 1 (alterspec 0.23): the same without `items` and `weights`. */\nexport const WorkTaskV1Schema = WorkTaskV2Schema.omit({ items: true });\nexport type WorkTaskV1 = z.infer<typeof WorkTaskV1Schema>;\n\nexport const WorkV1Schema = WorkSchema.extend({\n format: z.literal(1),\n changes: z.array(WorkChangeSchema.extend({ tasks: z.array(WorkTaskV1Schema) }).strict()),\n}).strict();\nexport type WorkV1 = z.infer<typeof WorkV1Schema>;\n\n/** Any format, told apart by `format`: what a reader of exports from several alterspec versions takes. */\nexport const AnyWorkSchema = z.discriminatedUnion('format', [WorkV1Schema, WorkV2Schema, WorkSchema]);\nexport type AnyWork = z.infer<typeof AnyWorkSchema>;\n"],"mappings":";AAAA,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAUX,IAAM,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,EAAE,SAAS,+BAA+B,CAAC;AAO9F,IAAM,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAGzD,IAAM,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc;AACjD,IAAM,MAAM,EAAE,IAAI,KAAK;AAEhB,IAAM,kBAAkB,EAC5B,OAAO;AAAA,EACN,MAAM;AAAA,EACN,MAAM,EAAE,KAAK,CAAC,WAAW,IAAI,CAAC;AAAA;AAAA,EAE9B,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC;AAC9B,CAAC,EACA,OAAO;AAGH,IAAM,iBAAiB,EAC3B,OAAO;AAAA,EACN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AAI;AACtC,MAAI,EAAE,QAAS,QAAO,EAAE;AACxB,QAAM,QAAQ,EAAE,MAAM,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE;AAC7E,QAAM,IAAI,UAAU;AAAA,EAA4B,MAAM,KAAK,IAAI,CAAC,IAAI,EAAE,MAAM,MAAM;AACpF;AAGO,SAAS,mBAA2B;AACzC,SAAO;AAAA,IACL,OAAO;AAAA,IACP,GAAGC,GAAE,aAAa,eAAe,EAAE,IAAI,SAAS,iBAAiB,MAAM,CAAC;AAAA,EAC1E;AACF;","names":["z","z"]}
|
|
1
|
+
{"version":3,"sources":["../src/work.ts","../../src/schemas/work.ts"],"sourcesContent":["import { z } from 'zod';\nimport { AnyWorkSchema, type AnyWork } from '../../src/schemas/work.js';\n\n/**\n * `@alterset/alterspec-client/work`: the format of `work.json` in an alterspec export, for the dispatcher and anyone\n * else who reads it. The schema is alterspec's own (`src/schemas/work.ts`), re-exported, never copied. Format 4 is\n * `WorkSchema`, format 3 `WorkV3Schema` (no change `weight`), format 2 `WorkV2Schema` (no `weights`), format 1\n * `WorkV1Schema` (no `items`); `parseWork` reads all.\n */\n\n/** The formats this client reads. */\nconst FORMATS = [1, 2, 3, 4];\nexport * from '../../src/schemas/work.js';\n\n/** A `work.json` that is not JSON or not the format; `issues` holds zod's issues when it is JSON. */\nexport class WorkError extends Error {\n constructor(\n message: string,\n readonly issues: z.core.$ZodIssue[] = [],\n ) {\n super(message);\n this.name = 'WorkError';\n }\n}\n\n/** `changes[3].delta`: the issue's path as one would write it in JavaScript. */\nfunction pathText(path: readonly PropertyKey[]): string {\n let out = '';\n for (const p of path) out += typeof p === 'number' ? `[${p}]` : `${out ? '.' : ''}${String(p)}`;\n return out || '(root)';\n}\n\n/**\n * Parses and validates the text of a `work.json` of format 1 to 4 (tell them apart by `format`; 2 to 4 have\n * `items`, 3 and 4 may carry `weights`, 4 a change's `weight`); throws a `WorkError` naming every field that is wrong.\n */\nexport function parseWork(text: string): AnyWork {\n let data: unknown;\n try {\n data = JSON.parse(text);\n } catch (e) {\n throw new WorkError(`work.json is not JSON: ${(e as Error).message}`);\n }\n const format = (data as { format?: unknown } | null)?.format;\n if (typeof format === 'number' && !FORMATS.includes(format)) {\n throw new WorkError(`work.json has format ${format}; this client knows formats ${FORMATS.join(', ')}`);\n }\n const r = AnyWorkSchema.safeParse(data);\n if (r.success) return r.data;\n const lines = r.error.issues.map((i) => ` ${pathText(i.path)}: ${i.message}`);\n throw new WorkError(`work.json is not valid:\\n${lines.join('\\n')}`, r.error.issues);\n}\n\n/** The JSON Schema of `work.json` (either format), as alterspec installs it in `.alterspec/schemas/work.json`. */\nexport function toWorkJsonSchema(): object {\n return {\n title: 'alterspec work',\n ...z.toJSONSchema(AnyWorkSchema, { io: 'input', unrepresentable: 'any' }),\n };\n}\n","import { z } from 'zod';\n\n/**\n * `work.json` in an export: the work every signed-off change implies, for an application that hands it to developers\n * (the alterspec dispatcher). The one definition of the format. It imports nothing but zod, so the alterspec client\n * can carry it as it is. Format 4 (alterspec 0.34.0) adds each change's optional `weight`; format 3 (0.33.0) adds each task's optional `weights`; format 2 (0.24.0) added\n * each task's `items`; format 1 is the same without them. A reader of every format takes `AnyWorkSchema`.\n */\n\n/** `BE` (the backend, API channels included) or the code of a channel with an experience of its own. */\nexport const TrackCode = z.string().regex(/^[A-Z]{2,5}$/, { message: 'must be BE or a channel code' });\nexport type TrackCode = z.infer<typeof TrackCode>;\n\n/**\n * The weight of a task item, 1–100: how much specified behaviour the item adds or changes, reasoned at sign-off\n * against alterspec's rubric (a typical acceptance criterion is about 10), never an estimate of anyone's code.\n */\nexport const WorkWeight = z.number().int().min(1).max(100);\nexport type WorkWeight = z.infer<typeof WorkWeight>;\n\nconst ChangeRef = z.string().regex(/^CHG-\\d{3,}$/);\nconst Day = z.iso.date();\n\nexport const WorkTrackSchema = z\n .object({\n code: TrackCode,\n kind: z.enum(['backend', 'ui']),\n /** The channel codes the track builds: the API channels for `BE`, the channels sharing the experience for a UI track. */\n channels: z.array(z.string()),\n })\n .strict();\nexport type WorkTrack = z.infer<typeof WorkTrackSchema>;\n\nexport const WorkTaskSchema = z\n .object({\n track: TrackCode,\n /** The keys of the objects in the change's delta that put it on the track. */\n objects: z.array(z.string()),\n /**\n * The task's checklist, derived from the delta: the acceptance criteria (`<CAP>-AC-NN`), screen actions\n * (`<SCR>.Ann`) and contract states (`<UX-SCR>#<state>`) the change adds or changes, and every other object as\n * its key; on `BE`, `<CHG>#data-change` when the proposal declares a one-time data change (alterspec 0.27.0).\n * Sorted, never empty.\n */\n items: z.array(z.string().min(1)).min(1),\n /**\n * The tasks this one waits for, resolved and reduced: the same change's `BE` task, and the track's tasks of the\n * changes it builds on that did the same work (an item of both, a line of a whole object this task edits again,\n * or an object this task names that entered the export with the earlier change).\n */\n after: z.array(z.object({ change: ChangeRef, track: TrackCode }).strict()),\n /**\n * The weight of each item (format 3): how much specified behaviour it adds or changes, 1–100, reasoned at the\n * change's sign-off against alterspec's rubric (a typical acceptance criterion about 10), never anyone's code.\n * An item the sign-off didn't weigh takes the median of the task's weighed items; a task of a change signed off\n * without weights has no `weights`, and a reader counts each of its items as 10. For weighing progress and ETA.\n */\n weights: z.record(z.string().min(1), WorkWeight).optional(),\n })\n .strict();\nexport type WorkTask = z.infer<typeof WorkTaskSchema>;\n\nexport const WorkChangeSchema = z\n .object({\n id: ChangeRef,\n title: z.string(),\n signed_off: Day,\n /** The hash of the change's `delta.json`; a signed-off change never changes. */\n delta: z.string().regex(/^[0-9a-f]{16}$/),\n depends_on: z.array(ChangeRef),\n /** The change map's level. */\n level: z.number().int().min(1),\n /** One per track the change is on; empty = no work. */\n tasks: z.array(WorkTaskSchema),\n /**\n * The size of the whole change, 1–100 (format 4): reasoned at sign-off against alterspec's change rubric (a\n * wording fix about 1–5, one capability's criteria 10–20, a new capability or flow 30–50, a new module or the\n * application's foundation 80–100), never a sum of the item weights and never anyone's code. Absent: the change\n * was signed off without one. For the lists; progress and ETA keep the item weights.\n */\n weight: WorkWeight.optional(),\n })\n .strict();\nexport type WorkChange = z.infer<typeof WorkChangeSchema>;\n\nexport const WORK_FORMAT = 4;\n\nexport const WorkSchema = z\n .object({\n format: z.literal(WORK_FORMAT),\n /** The alterspec version that wrote the export. */\n alterspec: z.string(),\n exported: Day,\n /** Everything signed off before the changes began; `built`: the product as it runs (a reverse-spec), no work. */\n baseline: z.object({ date: Day, built: z.boolean() }).strict().nullable(),\n tracks: z.array(WorkTrackSchema),\n /** Every change signed off after the baseline, in the change map's order. */\n changes: z.array(WorkChangeSchema),\n })\n .strict();\nexport type Work = z.infer<typeof WorkSchema>;\n\n/** Format 3 (alterspec 0.33): the same without the change's `weight`. */\nexport const WorkChangeV3Schema = WorkChangeSchema.omit({ weight: true }).strict();\nexport type WorkChangeV3 = z.infer<typeof WorkChangeV3Schema>;\n\nexport const WorkV3Schema = WorkSchema.extend({\n format: z.literal(3),\n changes: z.array(WorkChangeV3Schema),\n}).strict();\nexport type WorkV3 = z.infer<typeof WorkV3Schema>;\n\n/** Format 2 (alterspec 0.24 to 0.32): the same without `weights`. */\nexport const WorkTaskV2Schema = WorkTaskSchema.omit({ weights: true });\nexport type WorkTaskV2 = z.infer<typeof WorkTaskV2Schema>;\n\nexport const WorkV2Schema = WorkSchema.extend({\n format: z.literal(2),\n changes: z.array(WorkChangeV3Schema.extend({ tasks: z.array(WorkTaskV2Schema) }).strict()),\n}).strict();\nexport type WorkV2 = z.infer<typeof WorkV2Schema>;\n\n/** Format 1 (alterspec 0.23): the same without `items`, `weights` and the change's `weight`. */\nexport const WorkTaskV1Schema = WorkTaskV2Schema.omit({ items: true });\nexport type WorkTaskV1 = z.infer<typeof WorkTaskV1Schema>;\n\nexport const WorkV1Schema = WorkSchema.extend({\n format: z.literal(1),\n changes: z.array(WorkChangeV3Schema.extend({ tasks: z.array(WorkTaskV1Schema) }).strict()),\n}).strict();\nexport type WorkV1 = z.infer<typeof WorkV1Schema>;\n\n/** Any format, told apart by `format`: what a reader of exports from several alterspec versions takes. */\nexport const AnyWorkSchema = z.discriminatedUnion('format', [\n WorkV1Schema,\n WorkV2Schema,\n WorkV3Schema,\n WorkSchema,\n]);\nexport type AnyWork = z.infer<typeof AnyWorkSchema>;\n"],"mappings":";AAAA,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAUX,IAAM,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,EAAE,SAAS,+BAA+B,CAAC;AAO9F,IAAM,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAGzD,IAAM,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc;AACjD,IAAM,MAAM,EAAE,IAAI,KAAK;AAEhB,IAAM,kBAAkB,EAC5B,OAAO;AAAA,EACN,MAAM;AAAA,EACN,MAAM,EAAE,KAAK,CAAC,WAAW,IAAI,CAAC;AAAA;AAAA,EAE9B,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC;AAC9B,CAAC,EACA,OAAO;AAGH,IAAM,iBAAiB,EAC3B,OAAO;AAAA,EACN,OAAO;AAAA;AAAA,EAEP,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO3B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,WAAW,OAAO,UAAU,CAAC,EAAE,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOzE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,UAAU,EAAE,SAAS;AAC5D,CAAC,EACA,OAAO;AAGH,IAAM,mBAAmB,EAC7B,OAAO;AAAA,EACN,IAAI;AAAA,EACJ,OAAO,EA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AAE,MAAM,MAAM;AACpF;AAGO,SAAS,mBAA2B;AACzC,SAAO;AAAA,IACL,OAAO;AAAA,IACP,GAAGC,GAAE,aAAa,eAAe,EAAE,IAAI,SAAS,iBAAiB,MAAM,CAAC;AAAA,EAC1E;AACF;","names":["z","z"]}
|
package/dist/work.schema.json
CHANGED
|
@@ -550,6 +550,205 @@
|
|
|
550
550
|
"changes"
|
|
551
551
|
],
|
|
552
552
|
"additionalProperties": false
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
"type": "object",
|
|
556
|
+
"properties": {
|
|
557
|
+
"format": {
|
|
558
|
+
"type": "number",
|
|
559
|
+
"const": 4
|
|
560
|
+
},
|
|
561
|
+
"alterspec": {
|
|
562
|
+
"type": "string"
|
|
563
|
+
},
|
|
564
|
+
"exported": {
|
|
565
|
+
"type": "string",
|
|
566
|
+
"format": "date",
|
|
567
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
|
|
568
|
+
},
|
|
569
|
+
"baseline": {
|
|
570
|
+
"anyOf": [
|
|
571
|
+
{
|
|
572
|
+
"type": "object",
|
|
573
|
+
"properties": {
|
|
574
|
+
"date": {
|
|
575
|
+
"type": "string",
|
|
576
|
+
"format": "date",
|
|
577
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
|
|
578
|
+
},
|
|
579
|
+
"built": {
|
|
580
|
+
"type": "boolean"
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
"required": [
|
|
584
|
+
"date",
|
|
585
|
+
"built"
|
|
586
|
+
],
|
|
587
|
+
"additionalProperties": false
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"type": "null"
|
|
591
|
+
}
|
|
592
|
+
]
|
|
593
|
+
},
|
|
594
|
+
"tracks": {
|
|
595
|
+
"type": "array",
|
|
596
|
+
"items": {
|
|
597
|
+
"type": "object",
|
|
598
|
+
"properties": {
|
|
599
|
+
"code": {
|
|
600
|
+
"type": "string",
|
|
601
|
+
"pattern": "^[A-Z]{2,5}$"
|
|
602
|
+
},
|
|
603
|
+
"kind": {
|
|
604
|
+
"type": "string",
|
|
605
|
+
"enum": [
|
|
606
|
+
"backend",
|
|
607
|
+
"ui"
|
|
608
|
+
]
|
|
609
|
+
},
|
|
610
|
+
"channels": {
|
|
611
|
+
"type": "array",
|
|
612
|
+
"items": {
|
|
613
|
+
"type": "string"
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
"required": [
|
|
618
|
+
"code",
|
|
619
|
+
"kind",
|
|
620
|
+
"channels"
|
|
621
|
+
],
|
|
622
|
+
"additionalProperties": false
|
|
623
|
+
}
|
|
624
|
+
},
|
|
625
|
+
"changes": {
|
|
626
|
+
"type": "array",
|
|
627
|
+
"items": {
|
|
628
|
+
"type": "object",
|
|
629
|
+
"properties": {
|
|
630
|
+
"id": {
|
|
631
|
+
"type": "string",
|
|
632
|
+
"pattern": "^CHG-\\d{3,}$"
|
|
633
|
+
},
|
|
634
|
+
"title": {
|
|
635
|
+
"type": "string"
|
|
636
|
+
},
|
|
637
|
+
"signed_off": {
|
|
638
|
+
"type": "string",
|
|
639
|
+
"format": "date",
|
|
640
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
|
|
641
|
+
},
|
|
642
|
+
"delta": {
|
|
643
|
+
"type": "string",
|
|
644
|
+
"pattern": "^[0-9a-f]{16}$"
|
|
645
|
+
},
|
|
646
|
+
"depends_on": {
|
|
647
|
+
"type": "array",
|
|
648
|
+
"items": {
|
|
649
|
+
"type": "string",
|
|
650
|
+
"pattern": "^CHG-\\d{3,}$"
|
|
651
|
+
}
|
|
652
|
+
},
|
|
653
|
+
"level": {
|
|
654
|
+
"type": "integer",
|
|
655
|
+
"minimum": 1,
|
|
656
|
+
"maximum": 9007199254740991
|
|
657
|
+
},
|
|
658
|
+
"tasks": {
|
|
659
|
+
"type": "array",
|
|
660
|
+
"items": {
|
|
661
|
+
"type": "object",
|
|
662
|
+
"properties": {
|
|
663
|
+
"track": {
|
|
664
|
+
"type": "string",
|
|
665
|
+
"pattern": "^[A-Z]{2,5}$"
|
|
666
|
+
},
|
|
667
|
+
"objects": {
|
|
668
|
+
"type": "array",
|
|
669
|
+
"items": {
|
|
670
|
+
"type": "string"
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
"items": {
|
|
674
|
+
"minItems": 1,
|
|
675
|
+
"type": "array",
|
|
676
|
+
"items": {
|
|
677
|
+
"type": "string",
|
|
678
|
+
"minLength": 1
|
|
679
|
+
}
|
|
680
|
+
},
|
|
681
|
+
"after": {
|
|
682
|
+
"type": "array",
|
|
683
|
+
"items": {
|
|
684
|
+
"type": "object",
|
|
685
|
+
"properties": {
|
|
686
|
+
"change": {
|
|
687
|
+
"type": "string",
|
|
688
|
+
"pattern": "^CHG-\\d{3,}$"
|
|
689
|
+
},
|
|
690
|
+
"track": {
|
|
691
|
+
"type": "string",
|
|
692
|
+
"pattern": "^[A-Z]{2,5}$"
|
|
693
|
+
}
|
|
694
|
+
},
|
|
695
|
+
"required": [
|
|
696
|
+
"change",
|
|
697
|
+
"track"
|
|
698
|
+
],
|
|
699
|
+
"additionalProperties": false
|
|
700
|
+
}
|
|
701
|
+
},
|
|
702
|
+
"weights": {
|
|
703
|
+
"type": "object",
|
|
704
|
+
"propertyNames": {
|
|
705
|
+
"type": "string",
|
|
706
|
+
"minLength": 1
|
|
707
|
+
},
|
|
708
|
+
"additionalProperties": {
|
|
709
|
+
"type": "integer",
|
|
710
|
+
"minimum": 1,
|
|
711
|
+
"maximum": 100
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
"required": [
|
|
716
|
+
"track",
|
|
717
|
+
"objects",
|
|
718
|
+
"items",
|
|
719
|
+
"after"
|
|
720
|
+
],
|
|
721
|
+
"additionalProperties": false
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
"weight": {
|
|
725
|
+
"type": "integer",
|
|
726
|
+
"minimum": 1,
|
|
727
|
+
"maximum": 100
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
"required": [
|
|
731
|
+
"id",
|
|
732
|
+
"title",
|
|
733
|
+
"signed_off",
|
|
734
|
+
"delta",
|
|
735
|
+
"depends_on",
|
|
736
|
+
"level",
|
|
737
|
+
"tasks"
|
|
738
|
+
],
|
|
739
|
+
"additionalProperties": false
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
"required": [
|
|
744
|
+
"format",
|
|
745
|
+
"alterspec",
|
|
746
|
+
"exported",
|
|
747
|
+
"baseline",
|
|
748
|
+
"tracks",
|
|
749
|
+
"changes"
|
|
750
|
+
],
|
|
751
|
+
"additionalProperties": false
|
|
553
752
|
}
|
|
554
753
|
]
|
|
555
754
|
}
|
package/package.json
CHANGED