@alterset/alterspec-client 0.19.1 → 0.23.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/README.md +1 -0
- package/assets/prompts/_shared.md +24 -7
- package/assets/prompts/agents/spec-answerer.md +3 -1
- package/assets/prompts/spec-ask.md +2 -1
- package/assets/prompts/task-context.md +4 -2
- package/assets/skills/alterspec-spec-ask/SKILL.md +1 -1
- package/developer-guide.md +21 -4
- package/dist/cli.js +141 -42
- package/dist/cli.js.map +1 -1
- package/dist/work.d.ts +274 -13
- package/dist/work.js +65 -13
- package/dist/work.js.map +1 -1
- package/dist/work.schema.json +466 -0
- package/package.json +1 -1
package/dist/work.d.ts
CHANGED
|
@@ -3,18 +3,42 @@ 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 6 (alterspec 0.41.0) weighs each item per track and allows 0 (nothing to build
|
|
7
|
+
* on that track). Format 5 (alterspec 0.38.0) adds the words a person reads: each task's optional `title`,
|
|
8
|
+
* `summary` and `labels`, and the objects' `names`. 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
9
|
* each task's `items`; format 1 is the same without them. A reader of every format takes `AnyWorkSchema`.
|
|
8
10
|
*/
|
|
9
11
|
/** `BE` (the backend, API channels included) or the code of a channel with an experience of its own. */
|
|
10
12
|
declare const TrackCode: z.ZodString;
|
|
11
13
|
type TrackCode = z.infer<typeof TrackCode>;
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
15
|
+
* A weight from 1 to 100: the size of a whole change, and (to format 5) of a task item, reasoned at sign-off
|
|
14
16
|
* against alterspec's rubric (a typical acceptance criterion is about 10), never an estimate of anyone's code.
|
|
15
17
|
*/
|
|
16
18
|
declare const WorkWeight: z.ZodNumber;
|
|
17
19
|
type WorkWeight = z.infer<typeof WorkWeight>;
|
|
20
|
+
/**
|
|
21
|
+
* The weight of a task item on one track, 0–100 (format 6): how much of the behaviour the item specifies that
|
|
22
|
+
* track builds. 0: the track has nothing to build for it (a behaviour only another channel shows, a mockup file);
|
|
23
|
+
* the item stays on the checklist to be read.
|
|
24
|
+
*/
|
|
25
|
+
declare const ItemWeight: z.ZodNumber;
|
|
26
|
+
type ItemWeight = z.infer<typeof ItemWeight>;
|
|
27
|
+
/** The longest title, summary and label (characters). */
|
|
28
|
+
declare const WORD_CAPS: {
|
|
29
|
+
readonly title: 100;
|
|
30
|
+
readonly summary: 400;
|
|
31
|
+
readonly label: 100;
|
|
32
|
+
readonly name: 100;
|
|
33
|
+
};
|
|
34
|
+
/** What a track builds in a change, for a list (format 5). */
|
|
35
|
+
declare const WorkTitle: z.ZodString;
|
|
36
|
+
/** The same in two or three plain sentences. */
|
|
37
|
+
declare const WorkSummary: z.ZodString;
|
|
38
|
+
/** What one checklist item is, apart from its siblings. */
|
|
39
|
+
declare const WorkLabel: z.ZodString;
|
|
40
|
+
/** An object's own title in the spec. */
|
|
41
|
+
declare const WorkName: z.ZodString;
|
|
18
42
|
declare const WorkTrackSchema: z.ZodObject<{
|
|
19
43
|
code: z.ZodString;
|
|
20
44
|
kind: z.ZodEnum<{
|
|
@@ -33,6 +57,9 @@ declare const WorkTaskSchema: z.ZodObject<{
|
|
|
33
57
|
track: z.ZodString;
|
|
34
58
|
}, z.core.$strict>>;
|
|
35
59
|
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
60
|
+
title: z.ZodOptional<z.ZodString>;
|
|
61
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
62
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
36
63
|
}, z.core.$strict>;
|
|
37
64
|
type WorkTask = z.infer<typeof WorkTaskSchema>;
|
|
38
65
|
declare const WorkChangeSchema: z.ZodObject<{
|
|
@@ -51,13 +78,16 @@ declare const WorkChangeSchema: z.ZodObject<{
|
|
|
51
78
|
track: z.ZodString;
|
|
52
79
|
}, z.core.$strict>>;
|
|
53
80
|
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
81
|
+
title: z.ZodOptional<z.ZodString>;
|
|
82
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
83
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
54
84
|
}, z.core.$strict>>;
|
|
55
85
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
56
86
|
}, z.core.$strict>;
|
|
57
87
|
type WorkChange = z.infer<typeof WorkChangeSchema>;
|
|
58
|
-
declare const WORK_FORMAT =
|
|
88
|
+
declare const WORK_FORMAT = 6;
|
|
59
89
|
declare const WorkSchema: z.ZodObject<{
|
|
60
|
-
format: z.ZodLiteral<
|
|
90
|
+
format: z.ZodLiteral<6>;
|
|
61
91
|
alterspec: z.ZodString;
|
|
62
92
|
exported: z.ZodISODate;
|
|
63
93
|
baseline: z.ZodNullable<z.ZodObject<{
|
|
@@ -88,11 +118,163 @@ declare const WorkSchema: z.ZodObject<{
|
|
|
88
118
|
track: z.ZodString;
|
|
89
119
|
}, z.core.$strict>>;
|
|
90
120
|
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
121
|
+
title: z.ZodOptional<z.ZodString>;
|
|
122
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
123
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
91
124
|
}, z.core.$strict>>;
|
|
92
125
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
93
126
|
}, z.core.$strict>>;
|
|
127
|
+
names: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
94
128
|
}, z.core.$strict>;
|
|
95
129
|
type Work = z.infer<typeof WorkSchema>;
|
|
130
|
+
/** Format 5 (alterspec 0.38 to 0.40): the same with one weight per item for every track, 1–100. */
|
|
131
|
+
declare const WorkTaskV5Schema: z.ZodObject<{
|
|
132
|
+
track: z.ZodString;
|
|
133
|
+
objects: z.ZodArray<z.ZodString>;
|
|
134
|
+
items: z.ZodArray<z.ZodString>;
|
|
135
|
+
after: z.ZodArray<z.ZodObject<{
|
|
136
|
+
change: z.ZodString;
|
|
137
|
+
track: z.ZodString;
|
|
138
|
+
}, z.core.$strict>>;
|
|
139
|
+
title: z.ZodOptional<z.ZodString>;
|
|
140
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
141
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
142
|
+
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
143
|
+
}, z.core.$strict>;
|
|
144
|
+
type WorkTaskV5 = z.infer<typeof WorkTaskV5Schema>;
|
|
145
|
+
declare const WorkChangeV5Schema: z.ZodObject<{
|
|
146
|
+
id: z.ZodString;
|
|
147
|
+
title: z.ZodString;
|
|
148
|
+
signed_off: z.ZodISODate;
|
|
149
|
+
delta: z.ZodString;
|
|
150
|
+
depends_on: z.ZodArray<z.ZodString>;
|
|
151
|
+
level: z.ZodNumber;
|
|
152
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
154
|
+
track: z.ZodString;
|
|
155
|
+
objects: z.ZodArray<z.ZodString>;
|
|
156
|
+
items: z.ZodArray<z.ZodString>;
|
|
157
|
+
after: z.ZodArray<z.ZodObject<{
|
|
158
|
+
change: z.ZodString;
|
|
159
|
+
track: z.ZodString;
|
|
160
|
+
}, z.core.$strict>>;
|
|
161
|
+
title: z.ZodOptional<z.ZodString>;
|
|
162
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
163
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
164
|
+
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
165
|
+
}, z.core.$strict>>;
|
|
166
|
+
}, z.core.$strict>;
|
|
167
|
+
type WorkChangeV5 = z.infer<typeof WorkChangeV5Schema>;
|
|
168
|
+
declare const WorkV5Schema: z.ZodObject<{
|
|
169
|
+
alterspec: z.ZodString;
|
|
170
|
+
exported: z.ZodISODate;
|
|
171
|
+
baseline: z.ZodNullable<z.ZodObject<{
|
|
172
|
+
date: z.ZodISODate;
|
|
173
|
+
built: z.ZodBoolean;
|
|
174
|
+
}, z.core.$strict>>;
|
|
175
|
+
tracks: z.ZodArray<z.ZodObject<{
|
|
176
|
+
code: z.ZodString;
|
|
177
|
+
kind: z.ZodEnum<{
|
|
178
|
+
backend: "backend";
|
|
179
|
+
ui: "ui";
|
|
180
|
+
}>;
|
|
181
|
+
channels: z.ZodArray<z.ZodString>;
|
|
182
|
+
}, z.core.$strict>>;
|
|
183
|
+
names: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
184
|
+
format: z.ZodLiteral<5>;
|
|
185
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
186
|
+
id: z.ZodString;
|
|
187
|
+
title: z.ZodString;
|
|
188
|
+
signed_off: z.ZodISODate;
|
|
189
|
+
delta: z.ZodString;
|
|
190
|
+
depends_on: z.ZodArray<z.ZodString>;
|
|
191
|
+
level: z.ZodNumber;
|
|
192
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
194
|
+
track: z.ZodString;
|
|
195
|
+
objects: z.ZodArray<z.ZodString>;
|
|
196
|
+
items: z.ZodArray<z.ZodString>;
|
|
197
|
+
after: z.ZodArray<z.ZodObject<{
|
|
198
|
+
change: z.ZodString;
|
|
199
|
+
track: z.ZodString;
|
|
200
|
+
}, z.core.$strict>>;
|
|
201
|
+
title: z.ZodOptional<z.ZodString>;
|
|
202
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
203
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
204
|
+
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
205
|
+
}, z.core.$strict>>;
|
|
206
|
+
}, z.core.$strict>>;
|
|
207
|
+
}, z.core.$strict>;
|
|
208
|
+
type WorkV5 = z.infer<typeof WorkV5Schema>;
|
|
209
|
+
/** Format 4 (alterspec 0.34 to 0.37): the same without the tasks' `title`, `summary` and `labels` and without `names`. */
|
|
210
|
+
declare const WorkTaskV4Schema: z.ZodObject<{
|
|
211
|
+
track: z.ZodString;
|
|
212
|
+
objects: z.ZodArray<z.ZodString>;
|
|
213
|
+
items: z.ZodArray<z.ZodString>;
|
|
214
|
+
after: z.ZodArray<z.ZodObject<{
|
|
215
|
+
change: z.ZodString;
|
|
216
|
+
track: z.ZodString;
|
|
217
|
+
}, z.core.$strict>>;
|
|
218
|
+
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
219
|
+
}, z.core.$strict>;
|
|
220
|
+
type WorkTaskV4 = z.infer<typeof WorkTaskV4Schema>;
|
|
221
|
+
declare const WorkChangeV4Schema: z.ZodObject<{
|
|
222
|
+
id: z.ZodString;
|
|
223
|
+
title: z.ZodString;
|
|
224
|
+
signed_off: z.ZodISODate;
|
|
225
|
+
delta: z.ZodString;
|
|
226
|
+
depends_on: z.ZodArray<z.ZodString>;
|
|
227
|
+
level: z.ZodNumber;
|
|
228
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
229
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
230
|
+
track: z.ZodString;
|
|
231
|
+
objects: z.ZodArray<z.ZodString>;
|
|
232
|
+
items: z.ZodArray<z.ZodString>;
|
|
233
|
+
after: z.ZodArray<z.ZodObject<{
|
|
234
|
+
change: z.ZodString;
|
|
235
|
+
track: z.ZodString;
|
|
236
|
+
}, z.core.$strict>>;
|
|
237
|
+
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
238
|
+
}, z.core.$strict>>;
|
|
239
|
+
}, z.core.$strict>;
|
|
240
|
+
type WorkChangeV4 = z.infer<typeof WorkChangeV4Schema>;
|
|
241
|
+
declare const WorkV4Schema: z.ZodObject<{
|
|
242
|
+
exported: z.ZodISODate;
|
|
243
|
+
alterspec: z.ZodString;
|
|
244
|
+
baseline: z.ZodNullable<z.ZodObject<{
|
|
245
|
+
date: z.ZodISODate;
|
|
246
|
+
built: z.ZodBoolean;
|
|
247
|
+
}, z.core.$strict>>;
|
|
248
|
+
tracks: z.ZodArray<z.ZodObject<{
|
|
249
|
+
code: z.ZodString;
|
|
250
|
+
kind: z.ZodEnum<{
|
|
251
|
+
backend: "backend";
|
|
252
|
+
ui: "ui";
|
|
253
|
+
}>;
|
|
254
|
+
channels: z.ZodArray<z.ZodString>;
|
|
255
|
+
}, z.core.$strict>>;
|
|
256
|
+
format: z.ZodLiteral<4>;
|
|
257
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
258
|
+
id: z.ZodString;
|
|
259
|
+
title: z.ZodString;
|
|
260
|
+
signed_off: z.ZodISODate;
|
|
261
|
+
delta: z.ZodString;
|
|
262
|
+
depends_on: z.ZodArray<z.ZodString>;
|
|
263
|
+
level: z.ZodNumber;
|
|
264
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
265
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
266
|
+
track: z.ZodString;
|
|
267
|
+
objects: z.ZodArray<z.ZodString>;
|
|
268
|
+
items: z.ZodArray<z.ZodString>;
|
|
269
|
+
after: z.ZodArray<z.ZodObject<{
|
|
270
|
+
change: z.ZodString;
|
|
271
|
+
track: z.ZodString;
|
|
272
|
+
}, z.core.$strict>>;
|
|
273
|
+
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
274
|
+
}, z.core.$strict>>;
|
|
275
|
+
}, z.core.$strict>>;
|
|
276
|
+
}, z.core.$strict>;
|
|
277
|
+
type WorkV4 = z.infer<typeof WorkV4Schema>;
|
|
96
278
|
/** Format 3 (alterspec 0.33): the same without the change's `weight`. */
|
|
97
279
|
declare const WorkChangeV3Schema: z.ZodObject<{
|
|
98
280
|
id: z.ZodString;
|
|
@@ -114,8 +296,8 @@ declare const WorkChangeV3Schema: z.ZodObject<{
|
|
|
114
296
|
}, z.core.$strict>;
|
|
115
297
|
type WorkChangeV3 = z.infer<typeof WorkChangeV3Schema>;
|
|
116
298
|
declare const WorkV3Schema: z.ZodObject<{
|
|
117
|
-
alterspec: z.ZodString;
|
|
118
299
|
exported: z.ZodISODate;
|
|
300
|
+
alterspec: z.ZodString;
|
|
119
301
|
baseline: z.ZodNullable<z.ZodObject<{
|
|
120
302
|
date: z.ZodISODate;
|
|
121
303
|
built: z.ZodBoolean;
|
|
@@ -161,8 +343,8 @@ declare const WorkTaskV2Schema: z.ZodObject<{
|
|
|
161
343
|
}, z.core.$strict>;
|
|
162
344
|
type WorkTaskV2 = z.infer<typeof WorkTaskV2Schema>;
|
|
163
345
|
declare const WorkV2Schema: z.ZodObject<{
|
|
164
|
-
alterspec: z.ZodString;
|
|
165
346
|
exported: z.ZodISODate;
|
|
347
|
+
alterspec: z.ZodString;
|
|
166
348
|
baseline: z.ZodNullable<z.ZodObject<{
|
|
167
349
|
date: z.ZodISODate;
|
|
168
350
|
built: z.ZodBoolean;
|
|
@@ -206,8 +388,8 @@ declare const WorkTaskV1Schema: z.ZodObject<{
|
|
|
206
388
|
}, z.core.$strict>;
|
|
207
389
|
type WorkTaskV1 = z.infer<typeof WorkTaskV1Schema>;
|
|
208
390
|
declare const WorkV1Schema: z.ZodObject<{
|
|
209
|
-
alterspec: z.ZodString;
|
|
210
391
|
exported: z.ZodISODate;
|
|
392
|
+
alterspec: z.ZodString;
|
|
211
393
|
baseline: z.ZodNullable<z.ZodObject<{
|
|
212
394
|
date: z.ZodISODate;
|
|
213
395
|
built: z.ZodBoolean;
|
|
@@ -241,8 +423,8 @@ declare const WorkV1Schema: z.ZodObject<{
|
|
|
241
423
|
type WorkV1 = z.infer<typeof WorkV1Schema>;
|
|
242
424
|
/** Any format, told apart by `format`: what a reader of exports from several alterspec versions takes. */
|
|
243
425
|
declare const AnyWorkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
244
|
-
alterspec: z.ZodString;
|
|
245
426
|
exported: z.ZodISODate;
|
|
427
|
+
alterspec: z.ZodString;
|
|
246
428
|
baseline: z.ZodNullable<z.ZodObject<{
|
|
247
429
|
date: z.ZodISODate;
|
|
248
430
|
built: z.ZodBoolean;
|
|
@@ -273,8 +455,8 @@ declare const AnyWorkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
273
455
|
}, z.core.$strict>>;
|
|
274
456
|
}, z.core.$strict>>;
|
|
275
457
|
}, z.core.$strict>, z.ZodObject<{
|
|
276
|
-
alterspec: z.ZodString;
|
|
277
458
|
exported: z.ZodISODate;
|
|
459
|
+
alterspec: z.ZodString;
|
|
278
460
|
baseline: z.ZodNullable<z.ZodObject<{
|
|
279
461
|
date: z.ZodISODate;
|
|
280
462
|
built: z.ZodBoolean;
|
|
@@ -306,8 +488,8 @@ declare const AnyWorkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
306
488
|
}, z.core.$strict>>;
|
|
307
489
|
}, z.core.$strict>>;
|
|
308
490
|
}, z.core.$strict>, z.ZodObject<{
|
|
309
|
-
alterspec: z.ZodString;
|
|
310
491
|
exported: z.ZodISODate;
|
|
492
|
+
alterspec: z.ZodString;
|
|
311
493
|
baseline: z.ZodNullable<z.ZodObject<{
|
|
312
494
|
date: z.ZodISODate;
|
|
313
495
|
built: z.ZodBoolean;
|
|
@@ -340,7 +522,81 @@ declare const AnyWorkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
340
522
|
}, z.core.$strict>>;
|
|
341
523
|
}, z.core.$strict>>;
|
|
342
524
|
}, z.core.$strict>, z.ZodObject<{
|
|
525
|
+
exported: z.ZodISODate;
|
|
526
|
+
alterspec: z.ZodString;
|
|
527
|
+
baseline: z.ZodNullable<z.ZodObject<{
|
|
528
|
+
date: z.ZodISODate;
|
|
529
|
+
built: z.ZodBoolean;
|
|
530
|
+
}, z.core.$strict>>;
|
|
531
|
+
tracks: z.ZodArray<z.ZodObject<{
|
|
532
|
+
code: z.ZodString;
|
|
533
|
+
kind: z.ZodEnum<{
|
|
534
|
+
backend: "backend";
|
|
535
|
+
ui: "ui";
|
|
536
|
+
}>;
|
|
537
|
+
channels: z.ZodArray<z.ZodString>;
|
|
538
|
+
}, z.core.$strict>>;
|
|
343
539
|
format: z.ZodLiteral<4>;
|
|
540
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
541
|
+
id: z.ZodString;
|
|
542
|
+
title: z.ZodString;
|
|
543
|
+
signed_off: z.ZodISODate;
|
|
544
|
+
delta: z.ZodString;
|
|
545
|
+
depends_on: z.ZodArray<z.ZodString>;
|
|
546
|
+
level: z.ZodNumber;
|
|
547
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
548
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
549
|
+
track: z.ZodString;
|
|
550
|
+
objects: z.ZodArray<z.ZodString>;
|
|
551
|
+
items: z.ZodArray<z.ZodString>;
|
|
552
|
+
after: z.ZodArray<z.ZodObject<{
|
|
553
|
+
change: z.ZodString;
|
|
554
|
+
track: z.ZodString;
|
|
555
|
+
}, z.core.$strict>>;
|
|
556
|
+
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
557
|
+
}, z.core.$strict>>;
|
|
558
|
+
}, z.core.$strict>>;
|
|
559
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
560
|
+
alterspec: z.ZodString;
|
|
561
|
+
exported: z.ZodISODate;
|
|
562
|
+
baseline: z.ZodNullable<z.ZodObject<{
|
|
563
|
+
date: z.ZodISODate;
|
|
564
|
+
built: z.ZodBoolean;
|
|
565
|
+
}, z.core.$strict>>;
|
|
566
|
+
tracks: z.ZodArray<z.ZodObject<{
|
|
567
|
+
code: z.ZodString;
|
|
568
|
+
kind: z.ZodEnum<{
|
|
569
|
+
backend: "backend";
|
|
570
|
+
ui: "ui";
|
|
571
|
+
}>;
|
|
572
|
+
channels: z.ZodArray<z.ZodString>;
|
|
573
|
+
}, z.core.$strict>>;
|
|
574
|
+
names: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
575
|
+
format: z.ZodLiteral<5>;
|
|
576
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
577
|
+
id: z.ZodString;
|
|
578
|
+
title: z.ZodString;
|
|
579
|
+
signed_off: z.ZodISODate;
|
|
580
|
+
delta: z.ZodString;
|
|
581
|
+
depends_on: z.ZodArray<z.ZodString>;
|
|
582
|
+
level: z.ZodNumber;
|
|
583
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
584
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
585
|
+
track: z.ZodString;
|
|
586
|
+
objects: z.ZodArray<z.ZodString>;
|
|
587
|
+
items: z.ZodArray<z.ZodString>;
|
|
588
|
+
after: z.ZodArray<z.ZodObject<{
|
|
589
|
+
change: z.ZodString;
|
|
590
|
+
track: z.ZodString;
|
|
591
|
+
}, z.core.$strict>>;
|
|
592
|
+
title: z.ZodOptional<z.ZodString>;
|
|
593
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
594
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
595
|
+
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
596
|
+
}, z.core.$strict>>;
|
|
597
|
+
}, z.core.$strict>>;
|
|
598
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
599
|
+
format: z.ZodLiteral<6>;
|
|
344
600
|
alterspec: z.ZodString;
|
|
345
601
|
exported: z.ZodISODate;
|
|
346
602
|
baseline: z.ZodNullable<z.ZodObject<{
|
|
@@ -371,9 +627,13 @@ declare const AnyWorkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
371
627
|
track: z.ZodString;
|
|
372
628
|
}, z.core.$strict>>;
|
|
373
629
|
weights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
630
|
+
title: z.ZodOptional<z.ZodString>;
|
|
631
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
632
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
374
633
|
}, z.core.$strict>>;
|
|
375
634
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
376
635
|
}, z.core.$strict>>;
|
|
636
|
+
names: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
377
637
|
}, z.core.$strict>], "format">;
|
|
378
638
|
type AnyWork = z.infer<typeof AnyWorkSchema>;
|
|
379
639
|
|
|
@@ -383,11 +643,12 @@ declare class WorkError extends Error {
|
|
|
383
643
|
constructor(message: string, issues?: z.core.$ZodIssue[]);
|
|
384
644
|
}
|
|
385
645
|
/**
|
|
386
|
-
* Parses and validates the text of a `work.json` of format 1 to
|
|
387
|
-
* `items`, 3
|
|
646
|
+
* Parses and validates the text of a `work.json` of format 1 to 6 (tell them apart by `format`; from 2 on they have
|
|
647
|
+
* `items`, from 3 on they may carry `weights`, from 4 on a change's `weight`, and 5 the words a person reads: a
|
|
648
|
+
* task's `title`, `summary` and `labels`, and the objects' `names`; in 6 an item's weight is its track's, and may be 0); throws a `WorkError` naming every field that is wrong.
|
|
388
649
|
*/
|
|
389
650
|
declare function parseWork(text: string): AnyWork;
|
|
390
651
|
/** The JSON Schema of `work.json` (either format), as alterspec installs it in `.alterspec/schemas/work.json`. */
|
|
391
652
|
declare function toWorkJsonSchema(): object;
|
|
392
653
|
|
|
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 };
|
|
654
|
+
export { type AnyWork, AnyWorkSchema, ItemWeight, TrackCode, WORD_CAPS, WORK_FORMAT, type Work, type WorkChange, WorkChangeSchema, type WorkChangeV3, WorkChangeV3Schema, type WorkChangeV4, WorkChangeV4Schema, type WorkChangeV5, WorkChangeV5Schema, WorkError, WorkLabel, WorkName, WorkSchema, WorkSummary, type WorkTask, WorkTaskSchema, type WorkTaskV1, WorkTaskV1Schema, type WorkTaskV2, WorkTaskV2Schema, type WorkTaskV4, WorkTaskV4Schema, type WorkTaskV5, WorkTaskV5Schema, WorkTitle, type WorkTrack, WorkTrackSchema, type WorkV1, WorkV1Schema, type WorkV2, WorkV2Schema, type WorkV3, WorkV3Schema, type WorkV4, WorkV4Schema, type WorkV5, WorkV5Schema, WorkWeight, parseWork, toWorkJsonSchema };
|
package/dist/work.js
CHANGED
|
@@ -5,6 +5,13 @@ import { z as z2 } from "zod";
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
var TrackCode = z.string().regex(/^[A-Z]{2,5}$/, { message: "must be BE or a channel code" });
|
|
7
7
|
var WorkWeight = z.number().int().min(1).max(100);
|
|
8
|
+
var ItemWeight = z.number().int().min(0).max(100);
|
|
9
|
+
var WORD_CAPS = { title: 100, summary: 400, label: 100, name: 100 };
|
|
10
|
+
var words = (max) => z.string().max(max, { message: `at most ${max} characters` }).regex(/^\S(?:[^\n\r]*\S)?$/, { message: "one line of text, without spaces around it" });
|
|
11
|
+
var WorkTitle = words(WORD_CAPS.title);
|
|
12
|
+
var WorkSummary = words(WORD_CAPS.summary);
|
|
13
|
+
var WorkLabel = words(WORD_CAPS.label);
|
|
14
|
+
var WorkName = words(WORD_CAPS.name);
|
|
8
15
|
var ChangeRef = z.string().regex(/^CHG-\d{3,}$/);
|
|
9
16
|
var Day = z.iso.date();
|
|
10
17
|
var WorkTrackSchema = z.object({
|
|
@@ -31,12 +38,27 @@ var WorkTaskSchema = z.object({
|
|
|
31
38
|
*/
|
|
32
39
|
after: z.array(z.object({ change: ChangeRef, track: TrackCode }).strict()),
|
|
33
40
|
/**
|
|
34
|
-
* The weight of each item (format 3
|
|
35
|
-
* change's sign-off against alterspec's rubric
|
|
36
|
-
*
|
|
37
|
-
*
|
|
41
|
+
* The weight of each item on this track (format 3; per track and 0–100 from format 6): how much of the
|
|
42
|
+
* behaviour the item specifies this track builds, reasoned at the change's sign-off against alterspec's rubric
|
|
43
|
+
* (a typical acceptance criterion about 10), never anyone's code. 0: nothing to build on this track; the item
|
|
44
|
+
* is read, not built, and counts in no progress. A task whose weights are all 0 has no work and is not handed
|
|
45
|
+
* out. An item the sign-off didn't weigh takes the median of the task's weighed items above 0; a task of a
|
|
46
|
+
* change signed off without weights has no `weights`, and a reader counts each of its items as 10.
|
|
38
47
|
*/
|
|
39
|
-
weights: z.record(z.string().min(1),
|
|
48
|
+
weights: z.record(z.string().min(1), ItemWeight).optional(),
|
|
49
|
+
/**
|
|
50
|
+
* What this track builds in this change, for a person reading a list (format 5): reasoned at the change's
|
|
51
|
+
* sign-off, in the product's words, naming no ID. Absent: the change was signed off without one.
|
|
52
|
+
*/
|
|
53
|
+
title: WorkTitle.optional(),
|
|
54
|
+
/** The same in two or three plain sentences (format 5). */
|
|
55
|
+
summary: WorkSummary.optional(),
|
|
56
|
+
/**
|
|
57
|
+
* What each item is (format 5), by item, naming only the task's own items and not necessarily all: reasoned at
|
|
58
|
+
* sign-off where the spec has no word for the item (an acceptance criterion), composed at export from the spec
|
|
59
|
+
* where it has (a screen's action, a contract's state, a part of an object, a whole object). For reading only.
|
|
60
|
+
*/
|
|
61
|
+
labels: z.record(z.string().min(1), WorkLabel).optional()
|
|
40
62
|
}).strict();
|
|
41
63
|
var WorkChangeSchema = z.object({
|
|
42
64
|
id: ChangeRef,
|
|
@@ -57,7 +79,7 @@ var WorkChangeSchema = z.object({
|
|
|
57
79
|
*/
|
|
58
80
|
weight: WorkWeight.optional()
|
|
59
81
|
}).strict();
|
|
60
|
-
var WORK_FORMAT =
|
|
82
|
+
var WORK_FORMAT = 6;
|
|
61
83
|
var WorkSchema = z.object({
|
|
62
84
|
format: z.literal(WORK_FORMAT),
|
|
63
85
|
/** The alterspec version that wrote the export. */
|
|
@@ -67,20 +89,36 @@ var WorkSchema = z.object({
|
|
|
67
89
|
baseline: z.object({ date: Day, built: z.boolean() }).strict().nullable(),
|
|
68
90
|
tracks: z.array(WorkTrackSchema),
|
|
69
91
|
/** Every change signed off after the baseline, in the change map's order. */
|
|
70
|
-
changes: z.array(WorkChangeSchema)
|
|
92
|
+
changes: z.array(WorkChangeSchema),
|
|
93
|
+
/**
|
|
94
|
+
* The title of every object a task's `objects` names, by key, as the spec holds it now (format 5); an object
|
|
95
|
+
* the spec no longer holds, and a file, has no entry. Absent when no object has one.
|
|
96
|
+
*/
|
|
97
|
+
names: z.record(z.string().min(1), WorkName).optional()
|
|
98
|
+
}).strict();
|
|
99
|
+
var WorkTaskV5Schema = WorkTaskSchema.extend({
|
|
100
|
+
weights: z.record(z.string().min(1), WorkWeight).optional()
|
|
101
|
+
}).strict();
|
|
102
|
+
var WorkChangeV5Schema = WorkChangeSchema.extend({ tasks: z.array(WorkTaskV5Schema) }).strict();
|
|
103
|
+
var WorkV5Schema = WorkSchema.extend({
|
|
104
|
+
format: z.literal(5),
|
|
105
|
+
changes: z.array(WorkChangeV5Schema)
|
|
71
106
|
}).strict();
|
|
72
|
-
var
|
|
73
|
-
var
|
|
107
|
+
var WorkTaskV4Schema = WorkTaskV5Schema.omit({ title: true, summary: true, labels: true }).strict();
|
|
108
|
+
var WorkChangeV4Schema = WorkChangeV5Schema.extend({ tasks: z.array(WorkTaskV4Schema) }).strict();
|
|
109
|
+
var WorkV4Schema = WorkV5Schema.omit({ names: true }).extend({ format: z.literal(4), changes: z.array(WorkChangeV4Schema) }).strict();
|
|
110
|
+
var WorkChangeV3Schema = WorkChangeV4Schema.omit({ weight: true }).strict();
|
|
111
|
+
var WorkV3Schema = WorkV4Schema.extend({
|
|
74
112
|
format: z.literal(3),
|
|
75
113
|
changes: z.array(WorkChangeV3Schema)
|
|
76
114
|
}).strict();
|
|
77
|
-
var WorkTaskV2Schema =
|
|
78
|
-
var WorkV2Schema =
|
|
115
|
+
var WorkTaskV2Schema = WorkTaskV4Schema.omit({ weights: true });
|
|
116
|
+
var WorkV2Schema = WorkV4Schema.extend({
|
|
79
117
|
format: z.literal(2),
|
|
80
118
|
changes: z.array(WorkChangeV3Schema.extend({ tasks: z.array(WorkTaskV2Schema) }).strict())
|
|
81
119
|
}).strict();
|
|
82
120
|
var WorkTaskV1Schema = WorkTaskV2Schema.omit({ items: true });
|
|
83
|
-
var WorkV1Schema =
|
|
121
|
+
var WorkV1Schema = WorkV4Schema.extend({
|
|
84
122
|
format: z.literal(1),
|
|
85
123
|
changes: z.array(WorkChangeV3Schema.extend({ tasks: z.array(WorkTaskV1Schema) }).strict())
|
|
86
124
|
}).strict();
|
|
@@ -88,11 +126,13 @@ var AnyWorkSchema = z.discriminatedUnion("format", [
|
|
|
88
126
|
WorkV1Schema,
|
|
89
127
|
WorkV2Schema,
|
|
90
128
|
WorkV3Schema,
|
|
129
|
+
WorkV4Schema,
|
|
130
|
+
WorkV5Schema,
|
|
91
131
|
WorkSchema
|
|
92
132
|
]);
|
|
93
133
|
|
|
94
134
|
// src/work.ts
|
|
95
|
-
var FORMATS = [1, 2, 3, 4];
|
|
135
|
+
var FORMATS = [1, 2, 3, 4, 5, 6];
|
|
96
136
|
var WorkError = class extends Error {
|
|
97
137
|
constructor(message, issues = []) {
|
|
98
138
|
super(message);
|
|
@@ -130,19 +170,31 @@ function toWorkJsonSchema() {
|
|
|
130
170
|
}
|
|
131
171
|
export {
|
|
132
172
|
AnyWorkSchema,
|
|
173
|
+
ItemWeight,
|
|
133
174
|
TrackCode,
|
|
175
|
+
WORD_CAPS,
|
|
134
176
|
WORK_FORMAT,
|
|
135
177
|
WorkChangeSchema,
|
|
136
178
|
WorkChangeV3Schema,
|
|
179
|
+
WorkChangeV4Schema,
|
|
180
|
+
WorkChangeV5Schema,
|
|
137
181
|
WorkError,
|
|
182
|
+
WorkLabel,
|
|
183
|
+
WorkName,
|
|
138
184
|
WorkSchema,
|
|
185
|
+
WorkSummary,
|
|
139
186
|
WorkTaskSchema,
|
|
140
187
|
WorkTaskV1Schema,
|
|
141
188
|
WorkTaskV2Schema,
|
|
189
|
+
WorkTaskV4Schema,
|
|
190
|
+
WorkTaskV5Schema,
|
|
191
|
+
WorkTitle,
|
|
142
192
|
WorkTrackSchema,
|
|
143
193
|
WorkV1Schema,
|
|
144
194
|
WorkV2Schema,
|
|
145
195
|
WorkV3Schema,
|
|
196
|
+
WorkV4Schema,
|
|
197
|
+
WorkV5Schema,
|
|
146
198
|
WorkWeight,
|
|
147
199
|
parseWork,
|
|
148
200
|
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 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,O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BAA+B,QAAQ,KAAK,IAAI,CAAC,EAAE;AAAA,EACvG;AACA,QAAM,IAAI,cAAc,UAAU,IAAI;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 6 is\n * `WorkSchema`, format 5 `WorkV5Schema` (one weight per item for every track, never 0), format 4 `WorkV4Schema` (no titles, summaries, labels or names), 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, 5, 6];\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 6 (tell them apart by `format`; from 2 on they have\n * `items`, from 3 on they may carry `weights`, from 4 on a change's `weight`, and 5 the words a person reads: a\n * task's `title`, `summary` and `labels`, and the objects' `names`; in 6 an item's weight is its track's, and may be 0); 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 6 (alterspec 0.41.0) weighs each item per track and allows 0 (nothing to build\n * on that track). Format 5 (alterspec 0.38.0) adds the words a person reads: each task's optional `title`,\n * `summary` and `labels`, and the objects' `names`. 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 * A weight from 1 to 100: the size of a whole change, and (to format 5) of a task item, 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\n/**\n * The weight of a task item on one track, 0–100 (format 6): how much of the behaviour the item specifies that\n * track builds. 0: the track has nothing to build for it (a behaviour only another channel shows, a mockup file);\n * the item stays on the checklist to be read.\n */\nexport const ItemWeight = z.number().int().min(0).max(100);\nexport type ItemWeight = z.infer<typeof ItemWeight>;\n\n/** The longest title, summary and label (characters). */\nexport const WORD_CAPS = { title: 100, summary: 400, label: 100, name: 100 } as const;\n\n/** A word a person reads: plain text of one line, trimmed, never empty, at most `max` characters. */\nconst words = (max: number) =>\n z\n .string()\n .max(max, { message: `at most ${max} characters` })\n .regex(/^\\S(?:[^\\n\\r]*\\S)?$/, { message: 'one line of text, without spaces around it' });\n\n/** What a track builds in a change, for a list (format 5). */\nexport const WorkTitle = words(WORD_CAPS.title);\n/** The same in two or three plain sentences. */\nexport const WorkSummary = words(WORD_CAPS.summary);\n/** What one checklist item is, apart from its siblings. */\nexport const WorkLabel = words(WORD_CAPS.label);\n/** An object's own title in the spec. */\nexport const WorkName = words(WORD_CAPS.name);\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 on this track (format 3; per track and 0–100 from format 6): how much of the\n * behaviour the item specifies this track builds, reasoned at the change's sign-off against alterspec's rubric\n * (a typical acceptance criterion about 10), never anyone's code. 0: nothing to build on this track; the item\n * is read, not built, and counts in no progress. A task whose weights are all 0 has no work and is not handed\n * out. An item the sign-off didn't weigh takes the median of the task's weighed items above 0; a task of a\n * change signed off without weights has no `weights`, and a reader counts each of its items as 10.\n */\n weights: z.record(z.string().min(1), ItemWeight).optional(),\n /**\n * What this track builds in this change, for a person reading a list (format 5): reasoned at the change's\n * sign-off, in the product's words, naming no ID. Absent: the change was signed off without one.\n */\n title: WorkTitle.optional(),\n /** The same in two or three plain sentences (format 5). */\n summary: WorkSummary.optional(),\n /**\n * What each item is (format 5), by item, naming only the task's own items and not necessarily all: reasoned at\n * sign-off where the spec has no word for the item (an acceptance criterion), composed at export from the spec\n * where it has (a screen's action, a contract's state, a part of an object, a whole object). For reading only.\n */\n labels: z.record(z.string().min(1), WorkLabel).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 = 6;\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 * The title of every object a task's `objects` names, by key, as the spec holds it now (format 5); an object\n * the spec no longer holds, and a file, has no entry. Absent when no object has one.\n */\n names: z.record(z.string().min(1), WorkName).optional(),\n })\n .strict();\nexport type Work = z.infer<typeof WorkSchema>;\n\n/** Format 5 (alterspec 0.38 to 0.40): the same with one weight per item for every track, 1–100. */\nexport const WorkTaskV5Schema = WorkTaskSchema.extend({\n weights: z.record(z.string().min(1), WorkWeight).optional(),\n}).strict();\nexport type WorkTaskV5 = z.infer<typeof WorkTaskV5Schema>;\n\nexport const WorkChangeV5Schema = WorkChangeSchema.extend({ tasks: z.array(WorkTaskV5Schema) }).strict();\nexport type WorkChangeV5 = z.infer<typeof WorkChangeV5Schema>;\n\nexport const WorkV5Schema = WorkSchema.extend({\n format: z.literal(5),\n changes: z.array(WorkChangeV5Schema),\n}).strict();\nexport type WorkV5 = z.infer<typeof WorkV5Schema>;\n\n/** Format 4 (alterspec 0.34 to 0.37): the same without the tasks' `title`, `summary` and `labels` and without `names`. */\nexport const WorkTaskV4Schema = WorkTaskV5Schema.omit({ title: true, summary: true, labels: true }).strict();\nexport type WorkTaskV4 = z.infer<typeof WorkTaskV4Schema>;\n\nexport const WorkChangeV4Schema = WorkChangeV5Schema.extend({ tasks: z.array(WorkTaskV4Schema) }).strict();\nexport type WorkChangeV4 = z.infer<typeof WorkChangeV4Schema>;\n\nexport const WorkV4Schema = WorkV5Schema.omit({ names: true })\n .extend({ format: z.literal(4), changes: z.array(WorkChangeV4Schema) })\n .strict();\nexport type WorkV4 = z.infer<typeof WorkV4Schema>;\n\n/** Format 3 (alterspec 0.33): the same without the change's `weight`. */\nexport const WorkChangeV3Schema = WorkChangeV4Schema.omit({ weight: true }).strict();\nexport type WorkChangeV3 = z.infer<typeof WorkChangeV3Schema>;\n\nexport const WorkV3Schema = WorkV4Schema.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 = WorkTaskV4Schema.omit({ weights: true });\nexport type WorkTaskV2 = z.infer<typeof WorkTaskV2Schema>;\n\nexport const WorkV2Schema = WorkV4Schema.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 = WorkV4Schema.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 WorkV4Schema,\n WorkV5Schema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