@exaudeus/workrail 3.61.0 → 3.63.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/dist/cli-worktrain.js +3 -0
- package/dist/config/config-file.js +1 -0
- package/dist/console-ui/assets/{index-DZpicVbF.js → index--iTwSwxZ.js} +1 -1
- package/dist/console-ui/index.html +1 -1
- package/dist/daemon/stats-summary.d.ts +1 -0
- package/dist/daemon/stats-summary.js +165 -0
- package/dist/daemon/workflow-runner.js +2 -0
- package/dist/manifest.json +25 -17
- package/dist/v2/durable-core/schemas/export-bundle/index.d.ts +192 -192
- package/dist/v2/durable-core/schemas/session/events.d.ts +51 -51
- package/dist/v2/durable-core/schemas/session/events.js +1 -1
- package/docs/authoring-v2.md +51 -0
- package/docs/authoring.md +22 -0
- package/package.json +1 -1
- package/spec/authoring-spec.json +28 -1
|
@@ -17,7 +17,7 @@ export declare const DomainEventEnvelopeV1Schema: z.ZodObject<{
|
|
|
17
17
|
nodeId?: string | undefined;
|
|
18
18
|
}>>;
|
|
19
19
|
data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
|
|
20
|
-
timestampMs: z.
|
|
20
|
+
timestampMs: z.ZodNumber;
|
|
21
21
|
}, "strip", z.ZodTypeAny, {
|
|
22
22
|
kind: string;
|
|
23
23
|
v: 1;
|
|
@@ -25,12 +25,12 @@ export declare const DomainEventEnvelopeV1Schema: z.ZodObject<{
|
|
|
25
25
|
eventIndex: number;
|
|
26
26
|
eventId: string;
|
|
27
27
|
dedupeKey: string;
|
|
28
|
+
timestampMs: number;
|
|
28
29
|
scope?: {
|
|
29
30
|
runId?: string | undefined;
|
|
30
31
|
nodeId?: string | undefined;
|
|
31
32
|
} | undefined;
|
|
32
33
|
data?: unknown;
|
|
33
|
-
timestampMs?: number | undefined;
|
|
34
34
|
}, {
|
|
35
35
|
kind: string;
|
|
36
36
|
v: 1;
|
|
@@ -38,12 +38,12 @@ export declare const DomainEventEnvelopeV1Schema: z.ZodObject<{
|
|
|
38
38
|
eventIndex: number;
|
|
39
39
|
eventId: string;
|
|
40
40
|
dedupeKey: string;
|
|
41
|
+
timestampMs: number;
|
|
41
42
|
scope?: {
|
|
42
43
|
runId?: string | undefined;
|
|
43
44
|
nodeId?: string | undefined;
|
|
44
45
|
} | undefined;
|
|
45
46
|
data?: unknown;
|
|
46
|
-
timestampMs?: number | undefined;
|
|
47
47
|
}>;
|
|
48
48
|
export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
49
49
|
v: z.ZodLiteral<1>;
|
|
@@ -61,7 +61,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
61
61
|
runId?: string | undefined;
|
|
62
62
|
nodeId?: string | undefined;
|
|
63
63
|
}>>;
|
|
64
|
-
timestampMs: z.
|
|
64
|
+
timestampMs: z.ZodNumber;
|
|
65
65
|
} & {
|
|
66
66
|
kind: z.ZodLiteral<"session_created">;
|
|
67
67
|
data: z.ZodObject<{
|
|
@@ -81,11 +81,11 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
81
81
|
data: {
|
|
82
82
|
parentSessionId?: string | undefined;
|
|
83
83
|
};
|
|
84
|
+
timestampMs: number;
|
|
84
85
|
scope?: {
|
|
85
86
|
runId?: string | undefined;
|
|
86
87
|
nodeId?: string | undefined;
|
|
87
88
|
} | undefined;
|
|
88
|
-
timestampMs?: number | undefined;
|
|
89
89
|
}, {
|
|
90
90
|
kind: "session_created";
|
|
91
91
|
v: 1;
|
|
@@ -96,18 +96,18 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
96
96
|
data: {
|
|
97
97
|
parentSessionId?: string | undefined;
|
|
98
98
|
};
|
|
99
|
+
timestampMs: number;
|
|
99
100
|
scope?: {
|
|
100
101
|
runId?: string | undefined;
|
|
101
102
|
nodeId?: string | undefined;
|
|
102
103
|
} | undefined;
|
|
103
|
-
timestampMs?: number | undefined;
|
|
104
104
|
}>, z.ZodObject<{
|
|
105
105
|
v: z.ZodLiteral<1>;
|
|
106
106
|
eventId: z.ZodString;
|
|
107
107
|
eventIndex: z.ZodNumber;
|
|
108
108
|
sessionId: z.ZodString;
|
|
109
109
|
dedupeKey: z.ZodString;
|
|
110
|
-
timestampMs: z.
|
|
110
|
+
timestampMs: z.ZodNumber;
|
|
111
111
|
} & {
|
|
112
112
|
kind: z.ZodLiteral<"observation_recorded">;
|
|
113
113
|
scope: z.ZodUndefined;
|
|
@@ -208,8 +208,8 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
208
208
|
key: "git_branch" | "git_head_sha" | "repo_root_hash" | "repo_root";
|
|
209
209
|
confidence: "low" | "med" | "high";
|
|
210
210
|
};
|
|
211
|
+
timestampMs: number;
|
|
211
212
|
scope?: undefined;
|
|
212
|
-
timestampMs?: number | undefined;
|
|
213
213
|
}, {
|
|
214
214
|
kind: "observation_recorded";
|
|
215
215
|
v: 1;
|
|
@@ -234,15 +234,15 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
234
234
|
key: "git_branch" | "git_head_sha" | "repo_root_hash" | "repo_root";
|
|
235
235
|
confidence: "low" | "med" | "high";
|
|
236
236
|
};
|
|
237
|
+
timestampMs: number;
|
|
237
238
|
scope?: undefined;
|
|
238
|
-
timestampMs?: number | undefined;
|
|
239
239
|
}>, z.ZodObject<{
|
|
240
240
|
v: z.ZodLiteral<1>;
|
|
241
241
|
eventId: z.ZodString;
|
|
242
242
|
eventIndex: z.ZodNumber;
|
|
243
243
|
sessionId: z.ZodString;
|
|
244
244
|
dedupeKey: z.ZodString;
|
|
245
|
-
timestampMs: z.
|
|
245
|
+
timestampMs: z.ZodNumber;
|
|
246
246
|
} & {
|
|
247
247
|
kind: z.ZodLiteral<"run_started">;
|
|
248
248
|
scope: z.ZodObject<{
|
|
@@ -284,7 +284,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
284
284
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
285
285
|
workflowSourceRef: string;
|
|
286
286
|
};
|
|
287
|
-
timestampMs
|
|
287
|
+
timestampMs: number;
|
|
288
288
|
}, {
|
|
289
289
|
kind: "run_started";
|
|
290
290
|
v: 1;
|
|
@@ -301,14 +301,14 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
301
301
|
workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
|
|
302
302
|
workflowSourceRef: string;
|
|
303
303
|
};
|
|
304
|
-
timestampMs
|
|
304
|
+
timestampMs: number;
|
|
305
305
|
}>, z.ZodObject<{
|
|
306
306
|
v: z.ZodLiteral<1>;
|
|
307
307
|
eventId: z.ZodString;
|
|
308
308
|
eventIndex: z.ZodNumber;
|
|
309
309
|
sessionId: z.ZodString;
|
|
310
310
|
dedupeKey: z.ZodString;
|
|
311
|
-
timestampMs: z.
|
|
311
|
+
timestampMs: z.ZodNumber;
|
|
312
312
|
} & {
|
|
313
313
|
kind: z.ZodLiteral<"node_created">;
|
|
314
314
|
scope: z.ZodObject<{
|
|
@@ -354,7 +354,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
354
354
|
parentNodeId: string | null;
|
|
355
355
|
workflowHash: never;
|
|
356
356
|
};
|
|
357
|
-
timestampMs
|
|
357
|
+
timestampMs: number;
|
|
358
358
|
}, {
|
|
359
359
|
kind: "node_created";
|
|
360
360
|
v: 1;
|
|
@@ -372,14 +372,14 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
372
372
|
parentNodeId: string | null;
|
|
373
373
|
workflowHash: string;
|
|
374
374
|
};
|
|
375
|
-
timestampMs
|
|
375
|
+
timestampMs: number;
|
|
376
376
|
}>, z.ZodObject<{
|
|
377
377
|
v: z.ZodLiteral<1>;
|
|
378
378
|
eventId: z.ZodString;
|
|
379
379
|
eventIndex: z.ZodNumber;
|
|
380
380
|
sessionId: z.ZodString;
|
|
381
381
|
dedupeKey: z.ZodString;
|
|
382
|
-
timestampMs: z.
|
|
382
|
+
timestampMs: z.ZodNumber;
|
|
383
383
|
} & {
|
|
384
384
|
kind: z.ZodLiteral<"edge_created">;
|
|
385
385
|
scope: z.ZodObject<{
|
|
@@ -455,7 +455,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
455
455
|
eventId: string;
|
|
456
456
|
};
|
|
457
457
|
};
|
|
458
|
-
timestampMs
|
|
458
|
+
timestampMs: number;
|
|
459
459
|
}, {
|
|
460
460
|
kind: "edge_created";
|
|
461
461
|
v: 1;
|
|
@@ -475,14 +475,14 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
475
475
|
eventId: string;
|
|
476
476
|
};
|
|
477
477
|
};
|
|
478
|
-
timestampMs
|
|
478
|
+
timestampMs: number;
|
|
479
479
|
}>, z.ZodObject<{
|
|
480
480
|
v: z.ZodLiteral<1>;
|
|
481
481
|
eventId: z.ZodString;
|
|
482
482
|
eventIndex: z.ZodNumber;
|
|
483
483
|
sessionId: z.ZodString;
|
|
484
484
|
dedupeKey: z.ZodString;
|
|
485
|
-
timestampMs: z.
|
|
485
|
+
timestampMs: z.ZodNumber;
|
|
486
486
|
} & {
|
|
487
487
|
kind: z.ZodLiteral<"advance_recorded">;
|
|
488
488
|
scope: z.ZodObject<{
|
|
@@ -836,7 +836,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
836
836
|
toNodeId: string;
|
|
837
837
|
};
|
|
838
838
|
};
|
|
839
|
-
timestampMs
|
|
839
|
+
timestampMs: number;
|
|
840
840
|
}, {
|
|
841
841
|
kind: "advance_recorded";
|
|
842
842
|
v: 1;
|
|
@@ -880,14 +880,14 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
880
880
|
toNodeId: string;
|
|
881
881
|
};
|
|
882
882
|
};
|
|
883
|
-
timestampMs
|
|
883
|
+
timestampMs: number;
|
|
884
884
|
}>, z.ZodObject<{
|
|
885
885
|
v: z.ZodLiteral<1>;
|
|
886
886
|
eventId: z.ZodString;
|
|
887
887
|
eventIndex: z.ZodNumber;
|
|
888
888
|
sessionId: z.ZodString;
|
|
889
889
|
dedupeKey: z.ZodString;
|
|
890
|
-
timestampMs: z.
|
|
890
|
+
timestampMs: z.ZodNumber;
|
|
891
891
|
} & {
|
|
892
892
|
kind: z.ZodLiteral<"validation_performed">;
|
|
893
893
|
scope: z.ZodObject<{
|
|
@@ -965,7 +965,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
965
965
|
suggestions: readonly string[];
|
|
966
966
|
};
|
|
967
967
|
};
|
|
968
|
-
timestampMs
|
|
968
|
+
timestampMs: number;
|
|
969
969
|
}, {
|
|
970
970
|
kind: "validation_performed";
|
|
971
971
|
v: 1;
|
|
@@ -987,14 +987,14 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
987
987
|
suggestions: readonly string[];
|
|
988
988
|
};
|
|
989
989
|
};
|
|
990
|
-
timestampMs
|
|
990
|
+
timestampMs: number;
|
|
991
991
|
}>, z.ZodObject<{
|
|
992
992
|
v: z.ZodLiteral<1>;
|
|
993
993
|
eventId: z.ZodString;
|
|
994
994
|
eventIndex: z.ZodNumber;
|
|
995
995
|
sessionId: z.ZodString;
|
|
996
996
|
dedupeKey: z.ZodString;
|
|
997
|
-
timestampMs: z.
|
|
997
|
+
timestampMs: z.ZodNumber;
|
|
998
998
|
} & {
|
|
999
999
|
kind: z.ZodLiteral<"node_output_appended">;
|
|
1000
1000
|
scope: z.ZodObject<{
|
|
@@ -1122,7 +1122,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1122
1122
|
};
|
|
1123
1123
|
supersedesOutputId?: string | undefined;
|
|
1124
1124
|
};
|
|
1125
|
-
timestampMs
|
|
1125
|
+
timestampMs: number;
|
|
1126
1126
|
}, {
|
|
1127
1127
|
kind: "node_output_appended";
|
|
1128
1128
|
v: 1;
|
|
@@ -1149,14 +1149,14 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1149
1149
|
};
|
|
1150
1150
|
supersedesOutputId?: string | undefined;
|
|
1151
1151
|
};
|
|
1152
|
-
timestampMs
|
|
1152
|
+
timestampMs: number;
|
|
1153
1153
|
}>, z.ZodObject<{
|
|
1154
1154
|
v: z.ZodLiteral<1>;
|
|
1155
1155
|
eventId: z.ZodString;
|
|
1156
1156
|
eventIndex: z.ZodNumber;
|
|
1157
1157
|
sessionId: z.ZodString;
|
|
1158
1158
|
dedupeKey: z.ZodString;
|
|
1159
|
-
timestampMs: z.
|
|
1159
|
+
timestampMs: z.ZodNumber;
|
|
1160
1160
|
} & {
|
|
1161
1161
|
kind: z.ZodLiteral<"assessment_recorded">;
|
|
1162
1162
|
scope: z.ZodObject<{
|
|
@@ -1240,7 +1240,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1240
1240
|
}[];
|
|
1241
1241
|
summary?: string | undefined;
|
|
1242
1242
|
};
|
|
1243
|
-
timestampMs
|
|
1243
|
+
timestampMs: number;
|
|
1244
1244
|
}, {
|
|
1245
1245
|
kind: "assessment_recorded";
|
|
1246
1246
|
v: 1;
|
|
@@ -1265,14 +1265,14 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1265
1265
|
}[];
|
|
1266
1266
|
summary?: string | undefined;
|
|
1267
1267
|
};
|
|
1268
|
-
timestampMs
|
|
1268
|
+
timestampMs: number;
|
|
1269
1269
|
}>, z.ZodObject<{
|
|
1270
1270
|
v: z.ZodLiteral<1>;
|
|
1271
1271
|
eventId: z.ZodString;
|
|
1272
1272
|
eventIndex: z.ZodNumber;
|
|
1273
1273
|
sessionId: z.ZodString;
|
|
1274
1274
|
dedupeKey: z.ZodString;
|
|
1275
|
-
timestampMs: z.
|
|
1275
|
+
timestampMs: z.ZodNumber;
|
|
1276
1276
|
} & {
|
|
1277
1277
|
kind: z.ZodLiteral<"assessment_consequence_applied">;
|
|
1278
1278
|
scope: z.ZodObject<{
|
|
@@ -1354,7 +1354,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1354
1354
|
guidance: string;
|
|
1355
1355
|
};
|
|
1356
1356
|
};
|
|
1357
|
-
timestampMs
|
|
1357
|
+
timestampMs: number;
|
|
1358
1358
|
}, {
|
|
1359
1359
|
kind: "assessment_consequence_applied";
|
|
1360
1360
|
v: 1;
|
|
@@ -1378,14 +1378,14 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1378
1378
|
guidance: string;
|
|
1379
1379
|
};
|
|
1380
1380
|
};
|
|
1381
|
-
timestampMs
|
|
1381
|
+
timestampMs: number;
|
|
1382
1382
|
}>, z.ZodObject<{
|
|
1383
1383
|
v: z.ZodLiteral<1>;
|
|
1384
1384
|
eventId: z.ZodString;
|
|
1385
1385
|
eventIndex: z.ZodNumber;
|
|
1386
1386
|
sessionId: z.ZodString;
|
|
1387
1387
|
dedupeKey: z.ZodString;
|
|
1388
|
-
timestampMs: z.
|
|
1388
|
+
timestampMs: z.ZodNumber;
|
|
1389
1389
|
} & {
|
|
1390
1390
|
kind: z.ZodLiteral<"preferences_changed">;
|
|
1391
1391
|
scope: z.ZodObject<{
|
|
@@ -1513,7 +1513,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1513
1513
|
riskPolicy: "conservative" | "balanced" | "aggressive";
|
|
1514
1514
|
};
|
|
1515
1515
|
};
|
|
1516
|
-
timestampMs
|
|
1516
|
+
timestampMs: number;
|
|
1517
1517
|
}, {
|
|
1518
1518
|
kind: "preferences_changed";
|
|
1519
1519
|
v: 1;
|
|
@@ -1540,14 +1540,14 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1540
1540
|
riskPolicy: "conservative" | "balanced" | "aggressive";
|
|
1541
1541
|
};
|
|
1542
1542
|
};
|
|
1543
|
-
timestampMs
|
|
1543
|
+
timestampMs: number;
|
|
1544
1544
|
}>, z.ZodObject<{
|
|
1545
1545
|
v: z.ZodLiteral<1>;
|
|
1546
1546
|
eventId: z.ZodString;
|
|
1547
1547
|
eventIndex: z.ZodNumber;
|
|
1548
1548
|
sessionId: z.ZodString;
|
|
1549
1549
|
dedupeKey: z.ZodString;
|
|
1550
|
-
timestampMs: z.
|
|
1550
|
+
timestampMs: z.ZodNumber;
|
|
1551
1551
|
} & {
|
|
1552
1552
|
kind: z.ZodLiteral<"capability_observed">;
|
|
1553
1553
|
scope: z.ZodObject<{
|
|
@@ -1809,7 +1809,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1809
1809
|
enforcementGrade: "weak";
|
|
1810
1810
|
};
|
|
1811
1811
|
};
|
|
1812
|
-
timestampMs
|
|
1812
|
+
timestampMs: number;
|
|
1813
1813
|
}, {
|
|
1814
1814
|
kind: "capability_observed";
|
|
1815
1815
|
v: 1;
|
|
@@ -1850,14 +1850,14 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
1850
1850
|
enforcementGrade: "weak";
|
|
1851
1851
|
};
|
|
1852
1852
|
};
|
|
1853
|
-
timestampMs
|
|
1853
|
+
timestampMs: number;
|
|
1854
1854
|
}>, z.ZodObject<{
|
|
1855
1855
|
v: z.ZodLiteral<1>;
|
|
1856
1856
|
eventId: z.ZodString;
|
|
1857
1857
|
eventIndex: z.ZodNumber;
|
|
1858
1858
|
sessionId: z.ZodString;
|
|
1859
1859
|
dedupeKey: z.ZodString;
|
|
1860
|
-
timestampMs: z.
|
|
1860
|
+
timestampMs: z.ZodNumber;
|
|
1861
1861
|
} & {
|
|
1862
1862
|
kind: z.ZodLiteral<"gap_recorded">;
|
|
1863
1863
|
scope: z.ZodObject<{
|
|
@@ -2049,7 +2049,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
2049
2049
|
outputId: string;
|
|
2050
2050
|
})[] | undefined;
|
|
2051
2051
|
};
|
|
2052
|
-
timestampMs
|
|
2052
|
+
timestampMs: number;
|
|
2053
2053
|
}, {
|
|
2054
2054
|
kind: "gap_recorded";
|
|
2055
2055
|
v: 1;
|
|
@@ -2092,14 +2092,14 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
2092
2092
|
outputId: string;
|
|
2093
2093
|
})[] | undefined;
|
|
2094
2094
|
};
|
|
2095
|
-
timestampMs
|
|
2095
|
+
timestampMs: number;
|
|
2096
2096
|
}>, z.ZodObject<{
|
|
2097
2097
|
v: z.ZodLiteral<1>;
|
|
2098
2098
|
eventId: z.ZodString;
|
|
2099
2099
|
eventIndex: z.ZodNumber;
|
|
2100
2100
|
sessionId: z.ZodString;
|
|
2101
2101
|
dedupeKey: z.ZodString;
|
|
2102
|
-
timestampMs: z.
|
|
2102
|
+
timestampMs: z.ZodNumber;
|
|
2103
2103
|
} & {
|
|
2104
2104
|
kind: z.ZodLiteral<"context_set">;
|
|
2105
2105
|
scope: z.ZodObject<{
|
|
@@ -2137,7 +2137,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
2137
2137
|
contextId: string;
|
|
2138
2138
|
context?: unknown;
|
|
2139
2139
|
};
|
|
2140
|
-
timestampMs
|
|
2140
|
+
timestampMs: number;
|
|
2141
2141
|
}, {
|
|
2142
2142
|
kind: "context_set";
|
|
2143
2143
|
v: 1;
|
|
@@ -2153,14 +2153,14 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
2153
2153
|
contextId: string;
|
|
2154
2154
|
context?: unknown;
|
|
2155
2155
|
};
|
|
2156
|
-
timestampMs
|
|
2156
|
+
timestampMs: number;
|
|
2157
2157
|
}>, z.ZodObject<{
|
|
2158
2158
|
v: z.ZodLiteral<1>;
|
|
2159
2159
|
eventId: z.ZodString;
|
|
2160
2160
|
eventIndex: z.ZodNumber;
|
|
2161
2161
|
sessionId: z.ZodString;
|
|
2162
2162
|
dedupeKey: z.ZodString;
|
|
2163
|
-
timestampMs: z.
|
|
2163
|
+
timestampMs: z.ZodNumber;
|
|
2164
2164
|
} & {
|
|
2165
2165
|
kind: z.ZodLiteral<"divergence_recorded">;
|
|
2166
2166
|
scope: z.ZodObject<{
|
|
@@ -2206,7 +2206,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
2206
2206
|
divergenceId: string;
|
|
2207
2207
|
relatedStepId?: string | undefined;
|
|
2208
2208
|
};
|
|
2209
|
-
timestampMs
|
|
2209
|
+
timestampMs: number;
|
|
2210
2210
|
}, {
|
|
2211
2211
|
kind: "divergence_recorded";
|
|
2212
2212
|
v: 1;
|
|
@@ -2224,14 +2224,14 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
2224
2224
|
divergenceId: string;
|
|
2225
2225
|
relatedStepId?: string | undefined;
|
|
2226
2226
|
};
|
|
2227
|
-
timestampMs
|
|
2227
|
+
timestampMs: number;
|
|
2228
2228
|
}>, z.ZodObject<{
|
|
2229
2229
|
v: z.ZodLiteral<1>;
|
|
2230
2230
|
eventId: z.ZodString;
|
|
2231
2231
|
eventIndex: z.ZodNumber;
|
|
2232
2232
|
sessionId: z.ZodString;
|
|
2233
2233
|
dedupeKey: z.ZodString;
|
|
2234
|
-
timestampMs: z.
|
|
2234
|
+
timestampMs: z.ZodNumber;
|
|
2235
2235
|
} & {
|
|
2236
2236
|
kind: z.ZodLiteral<"decision_trace_appended">;
|
|
2237
2237
|
scope: z.ZodObject<{
|
|
@@ -2427,7 +2427,7 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
2427
2427
|
}[];
|
|
2428
2428
|
traceId: string;
|
|
2429
2429
|
};
|
|
2430
|
-
timestampMs
|
|
2430
|
+
timestampMs: number;
|
|
2431
2431
|
}, {
|
|
2432
2432
|
kind: "decision_trace_appended";
|
|
2433
2433
|
v: 1;
|
|
@@ -2459,6 +2459,6 @@ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.Zod
|
|
|
2459
2459
|
}[];
|
|
2460
2460
|
traceId: string;
|
|
2461
2461
|
};
|
|
2462
|
-
timestampMs
|
|
2462
|
+
timestampMs: number;
|
|
2463
2463
|
}>]>;
|
|
2464
2464
|
export type DomainEventV1 = z.infer<typeof DomainEventV1Schema>;
|
|
@@ -36,7 +36,7 @@ exports.DomainEventEnvelopeV1Schema = zod_1.z.object({
|
|
|
36
36
|
})
|
|
37
37
|
.optional(),
|
|
38
38
|
data: json_zod_js_1.JsonValueSchema,
|
|
39
|
-
timestampMs: zod_1.z.number().int().positive()
|
|
39
|
+
timestampMs: zod_1.z.number().int().positive(),
|
|
40
40
|
});
|
|
41
41
|
const WorkflowSourceKindSchema = zod_1.z.enum(['bundled', 'user', 'project', 'remote', 'plugin']);
|
|
42
42
|
const RunStartedDataV1Schema = zod_1.z.object({
|
package/docs/authoring-v2.md
CHANGED
|
@@ -217,6 +217,57 @@ Important implementation detail:
|
|
|
217
217
|
- The default durable output is a short recap in `output.notesMarkdown` (recorded by the agent when advancing or checkpointing).
|
|
218
218
|
- Structured artifacts are **optional** and must never be required for a workflow to be usable.
|
|
219
219
|
|
|
220
|
+
### Session analytics context keys (`metrics_*`)
|
|
221
|
+
|
|
222
|
+
The `projectSessionMetricsV2` projection (planned -- not yet implemented) reads a set of `metrics_*` context keys to build session attribution data. These keys are not validated by the engine -- nothing will fail if they are absent or malformed. But absent or wrong data produces permanently incorrect analytics with no error or warning.
|
|
223
|
+
|
|
224
|
+
Set these keys in your step's `Capture:` footer.
|
|
225
|
+
|
|
226
|
+
**SHA accumulation rule (critical)**
|
|
227
|
+
|
|
228
|
+
`context_set` uses shallow merge: each key is replaced, not merged. If you set `metrics_commit_shas: ["abc123"]` at step 5 and then set `metrics_commit_shas: ["def456"]` at step 9, the value at step 9 is `["def456"]` -- `abc123` is permanently gone.
|
|
229
|
+
|
|
230
|
+
Every step that adds commits must send the **full accumulated list** -- read the current value from context, append new SHAs, and send the complete list.
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
Example (correct): metrics_commit_shas: ["abc123", "def456", "ghi789"]
|
|
234
|
+
Example (wrong): metrics_commit_shas: ["ghi789"] -- loses abc123 and def456
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Commit step `Capture:` footer** (copy this into every step that creates commits):
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
Capture (every time you commit code):
|
|
241
|
+
- `metrics_commit_shas`: full accumulated list of ALL commit SHAs this session (read
|
|
242
|
+
current value from context, append new SHAs, send complete list)
|
|
243
|
+
|
|
244
|
+
WARNING: context uses shallow merge -- sending only the new SHAs will overwrite and
|
|
245
|
+
permanently lose earlier ones. Always send the full accumulated list.
|
|
246
|
+
|
|
247
|
+
Example (correct): metrics_commit_shas: ["abc123", "def456", "ghi789"]
|
|
248
|
+
Example (wrong): metrics_commit_shas: ["ghi789"] -- loses abc123 and def456
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Final handoff `Capture:` footer** (copy this into your final step):
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
Capture (at final handoff only):
|
|
255
|
+
- `metrics_outcome`: one of 'success' | 'partial' | 'abandoned' | 'error'
|
|
256
|
+
- success: all acceptance criteria met, PR opened or merged
|
|
257
|
+
- partial: some criteria met but scope was reduced or items deferred
|
|
258
|
+
- abandoned: session stopped before meaningful completion
|
|
259
|
+
- error: session failed due to an unrecoverable error
|
|
260
|
+
- `metrics_pr_numbers`: array of integer PR numbers created or updated (e.g. [123, 456])
|
|
261
|
+
- Must be integers, not URLs or strings
|
|
262
|
+
- `metrics_files_changed`: integer count of files modified across all commits
|
|
263
|
+
- `metrics_lines_added`: integer count of lines added across all commits
|
|
264
|
+
- `metrics_lines_removed`: integer count of lines removed across all commits
|
|
265
|
+
- `metrics_commit_shas`: final complete accumulated list of ALL commit SHAs this session
|
|
266
|
+
(same accumulation rule as commit steps -- full list, not just final-step SHAs)
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Note: adding these keys to existing workflow JSON files (`coding-task-workflow-agentic.json` and others) is a separate follow-on PR. The templates above let you add them to new or custom workflows now.
|
|
270
|
+
|
|
220
271
|
### Assessment-gate authoring (v1)
|
|
221
272
|
|
|
222
273
|
Assessment gates are now a shipped authoring/runtime feature, but the first slice is intentionally narrow.
|
package/docs/authoring.md
CHANGED
|
@@ -710,6 +710,28 @@ Canonical current rules for authoring good WorkRail workflows. workflow.schema.j
|
|
|
710
710
|
- Saying a workflow is valid because the file parses even though registry resolution or runtime compilation can still fail
|
|
711
711
|
|
|
712
712
|
|
|
713
|
+
## Context key conventions
|
|
714
|
+
### metrics-context-accumulation
|
|
715
|
+
- **Level**: recommended
|
|
716
|
+
- **Status**: active
|
|
717
|
+
- **Scope**: step.context-capture
|
|
718
|
+
- **Rule**: When a step captures metrics_commit_shas, send the FULL accumulated SHA list every time -- not just the SHAs from the current step. context_set uses shallow merge: each key is replaced, not merged. Sending a partial list silently loses earlier SHAs.
|
|
719
|
+
- **Why**: mergeContext uses shallow merge: metrics_commit_shas: ['abc'] at step 5 followed by ['def'] at step 9 permanently loses 'abc'. Flat keys require accumulation discipline to produce correct analytics attribution.
|
|
720
|
+
- **Enforced by**: advisory
|
|
721
|
+
|
|
722
|
+
**Checks**
|
|
723
|
+
- Any step that adds new commits must first read the current metrics_commit_shas from context, append the new SHAs, and send the complete accumulated list.
|
|
724
|
+
- metrics_outcome must be set only at final handoff steps, not at intermediate commit steps.
|
|
725
|
+
- metrics_pr_numbers must be an array of integers (PR numbers), not URLs or strings.
|
|
726
|
+
- Use flat top-level keys (metrics_commit_shas, not context.metrics.commit_shas) to exploit per-key merge semantics.
|
|
727
|
+
- When starting to track mid-session, capture what you have and accumulate forward from that point.
|
|
728
|
+
|
|
729
|
+
**Anti-patterns**
|
|
730
|
+
- Sending only the current step's commits: metrics_commit_shas: ['def456'] when 'abc123' was set at an earlier step
|
|
731
|
+
- Using a nested key context.metrics.commit_shas instead of the flat key metrics_commit_shas
|
|
732
|
+
- Setting metrics_outcome at intermediate steps before the session outcome is known
|
|
733
|
+
|
|
734
|
+
|
|
713
735
|
## Artifacts and planning surfaces
|
|
714
736
|
### artifact-canonicality
|
|
715
737
|
- **Level**: recommended
|
package/package.json
CHANGED
package/spec/authoring-spec.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"version": 3,
|
|
4
4
|
"title": "WorkRail Authoring Rules",
|
|
5
5
|
"purpose": "Canonical current rules for authoring good WorkRail workflows. workflow.schema.json remains the source of truth for legal structure.",
|
|
6
|
-
"lastReviewed": "2026-04-
|
|
6
|
+
"lastReviewed": "2026-04-22",
|
|
7
7
|
"principles": [
|
|
8
8
|
"Schema defines what is valid. These rules define what is good.",
|
|
9
9
|
"Prefer current authoring rules over design rationale or historical notes.",
|
|
@@ -1361,6 +1361,33 @@
|
|
|
1361
1361
|
}
|
|
1362
1362
|
]
|
|
1363
1363
|
},
|
|
1364
|
+
{
|
|
1365
|
+
"id": "context-capture",
|
|
1366
|
+
"title": "Context key conventions",
|
|
1367
|
+
"rules": [
|
|
1368
|
+
{
|
|
1369
|
+
"id": "metrics-context-accumulation",
|
|
1370
|
+
"status": "active",
|
|
1371
|
+
"level": "recommended",
|
|
1372
|
+
"scope": ["step.context-capture"],
|
|
1373
|
+
"rule": "When a step captures metrics_commit_shas, send the FULL accumulated SHA list every time -- not just the SHAs from the current step. context_set uses shallow merge: each key is replaced, not merged. Sending a partial list silently loses earlier SHAs.",
|
|
1374
|
+
"why": "mergeContext uses shallow merge: metrics_commit_shas: ['abc'] at step 5 followed by ['def'] at step 9 permanently loses 'abc'. Flat keys require accumulation discipline to produce correct analytics attribution.",
|
|
1375
|
+
"enforcement": ["advisory"],
|
|
1376
|
+
"checks": [
|
|
1377
|
+
"Any step that adds new commits must first read the current metrics_commit_shas from context, append the new SHAs, and send the complete accumulated list.",
|
|
1378
|
+
"metrics_outcome must be set only at final handoff steps, not at intermediate commit steps.",
|
|
1379
|
+
"metrics_pr_numbers must be an array of integers (PR numbers), not URLs or strings.",
|
|
1380
|
+
"Use flat top-level keys (metrics_commit_shas, not context.metrics.commit_shas) to exploit per-key merge semantics.",
|
|
1381
|
+
"When starting to track mid-session, capture what you have and accumulate forward from that point."
|
|
1382
|
+
],
|
|
1383
|
+
"antiPatterns": [
|
|
1384
|
+
"Sending only the current step's commits: metrics_commit_shas: ['def456'] when 'abc123' was set at an earlier step",
|
|
1385
|
+
"Using a nested key context.metrics.commit_shas instead of the flat key metrics_commit_shas",
|
|
1386
|
+
"Setting metrics_outcome at intermediate steps before the session outcome is known"
|
|
1387
|
+
]
|
|
1388
|
+
}
|
|
1389
|
+
]
|
|
1390
|
+
},
|
|
1364
1391
|
{
|
|
1365
1392
|
"id": "artifacts",
|
|
1366
1393
|
"title": "Artifacts and planning surfaces",
|