pi-daddy 0.19.0 → 0.20.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.
Files changed (125) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +105 -36
  3. package/contracts/ledger/v3/README.md +36 -0
  4. package/contracts/ledger/v3/fixtures/capability-decision.json +98 -0
  5. package/contracts/ledger/v3/fixtures/check-receipt.json +42 -0
  6. package/contracts/ledger/v3/fixtures/child-lifecycle.json +45 -0
  7. package/contracts/ledger/v3/fixtures/workflow-fact.json +41 -0
  8. package/contracts/ledger/v3/fixtures/workspace-lease.json +43 -0
  9. package/contracts/ledger/v3/ledger-event.schema.json +930 -0
  10. package/dist/check-runner.d.ts.map +1 -1
  11. package/dist/check-runner.js +14 -0
  12. package/dist/check-runner.js.map +1 -1
  13. package/dist/cli.js +0 -0
  14. package/dist/correlation.d.ts.map +1 -1
  15. package/dist/correlation.js +10 -0
  16. package/dist/correlation.js.map +1 -1
  17. package/dist/dashboard-cli.d.ts +18 -0
  18. package/dist/dashboard-cli.d.ts.map +1 -0
  19. package/dist/dashboard-cli.js +154 -0
  20. package/dist/dashboard-cli.js.map +1 -0
  21. package/dist/dashboard-handshake.d.ts +37 -0
  22. package/dist/dashboard-handshake.d.ts.map +1 -0
  23. package/dist/dashboard-handshake.js +127 -0
  24. package/dist/dashboard-handshake.js.map +1 -0
  25. package/dist/dashboard-herdr.d.ts +54 -0
  26. package/dist/dashboard-herdr.d.ts.map +1 -0
  27. package/dist/dashboard-herdr.js +286 -0
  28. package/dist/dashboard-herdr.js.map +1 -0
  29. package/dist/dashboard-projection.d.ts +73 -0
  30. package/dist/dashboard-projection.d.ts.map +1 -0
  31. package/dist/dashboard-projection.js +294 -0
  32. package/dist/dashboard-projection.js.map +1 -0
  33. package/dist/dashboard-render.d.ts +10 -0
  34. package/dist/dashboard-render.d.ts.map +1 -0
  35. package/dist/dashboard-render.js +208 -0
  36. package/dist/dashboard-render.js.map +1 -0
  37. package/dist/delegate-types.d.ts +6 -2
  38. package/dist/delegate-types.d.ts.map +1 -1
  39. package/dist/delegate-types.js.map +1 -1
  40. package/dist/delegate.d.ts.map +1 -1
  41. package/dist/delegate.js +4 -1
  42. package/dist/delegate.js.map +1 -1
  43. package/dist/execution-id.d.ts +6 -0
  44. package/dist/execution-id.d.ts.map +1 -0
  45. package/dist/execution-id.js +13 -0
  46. package/dist/execution-id.js.map +1 -0
  47. package/dist/index.d.ts +4 -1
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +4 -1
  50. package/dist/index.js.map +1 -1
  51. package/dist/ledger-events.d.ts +27 -4
  52. package/dist/ledger-events.d.ts.map +1 -1
  53. package/dist/ledger-events.js +30 -9
  54. package/dist/ledger-events.js.map +1 -1
  55. package/dist/ledger-identifiers.d.ts +7 -0
  56. package/dist/ledger-identifiers.d.ts.map +1 -0
  57. package/dist/ledger-identifiers.js +20 -0
  58. package/dist/ledger-identifiers.js.map +1 -0
  59. package/dist/ledger-report.d.ts +5 -2
  60. package/dist/ledger-report.d.ts.map +1 -1
  61. package/dist/ledger-report.js +38 -14
  62. package/dist/ledger-report.js.map +1 -1
  63. package/dist/ledger-v3-validation.d.ts +11 -0
  64. package/dist/ledger-v3-validation.d.ts.map +1 -0
  65. package/dist/ledger-v3-validation.js +265 -0
  66. package/dist/ledger-v3-validation.js.map +1 -0
  67. package/dist/ledger.d.ts +18 -5
  68. package/dist/ledger.d.ts.map +1 -1
  69. package/dist/ledger.js +29 -7
  70. package/dist/ledger.js.map +1 -1
  71. package/dist/propagation.d.ts +3 -1
  72. package/dist/propagation.d.ts.map +1 -1
  73. package/dist/propagation.js +3 -0
  74. package/dist/propagation.js.map +1 -1
  75. package/dist/run-child.d.ts +3 -1
  76. package/dist/run-child.d.ts.map +1 -1
  77. package/dist/run-child.js +30 -2
  78. package/dist/run-child.js.map +1 -1
  79. package/dist/run-herdr.d.ts +2 -0
  80. package/dist/run-herdr.d.ts.map +1 -1
  81. package/dist/run-herdr.js +8 -0
  82. package/dist/run-herdr.js.map +1 -1
  83. package/dist/workflow-fact-id.d.ts +4 -0
  84. package/dist/workflow-fact-id.d.ts.map +1 -0
  85. package/dist/workflow-fact-id.js +14 -0
  86. package/dist/workflow-fact-id.js.map +1 -0
  87. package/dist/workflow-facts.d.ts +34 -0
  88. package/dist/workflow-facts.d.ts.map +1 -0
  89. package/dist/workflow-facts.js +43 -0
  90. package/dist/workflow-facts.js.map +1 -0
  91. package/extensions/chain-ledger.ts +4 -0
  92. package/extensions/chain-plan.ts +98 -0
  93. package/extensions/delegate-chain.ts +63 -122
  94. package/extensions/delegation-ledger.ts +60 -0
  95. package/extensions/delegation.ts +13 -13
  96. package/extensions/execute-child.ts +85 -21
  97. package/extensions/execution-occurrence.ts +20 -0
  98. package/extensions/grants-command.ts +22 -3
  99. package/extensions/grants.ts +44 -0
  100. package/extensions/run-delegation.ts +36 -56
  101. package/extensions/session.ts +7 -2
  102. package/extensions/workspace-runtime.ts +10 -0
  103. package/herdr-plugin/herdr-plugin.toml +18 -0
  104. package/package.json +16 -4
  105. package/src/check-runner.ts +16 -0
  106. package/src/correlation.ts +11 -0
  107. package/src/dashboard-cli.ts +171 -0
  108. package/src/dashboard-handshake.ts +185 -0
  109. package/src/dashboard-herdr.ts +355 -0
  110. package/src/dashboard-projection.ts +390 -0
  111. package/src/dashboard-render.ts +254 -0
  112. package/src/delegate-types.ts +6 -2
  113. package/src/delegate.ts +4 -2
  114. package/src/execution-id.ts +18 -0
  115. package/src/index.ts +25 -0
  116. package/src/ledger-events.ts +54 -10
  117. package/src/ledger-identifiers.ts +21 -0
  118. package/src/ledger-report.ts +40 -19
  119. package/src/ledger-v3-validation.ts +266 -0
  120. package/src/ledger.ts +49 -10
  121. package/src/propagation.ts +3 -0
  122. package/src/run-child.ts +35 -3
  123. package/src/run-herdr.ts +9 -0
  124. package/src/workflow-fact-id.ts +16 -0
  125. package/src/workflow-facts.ts +65 -0
@@ -0,0 +1,930 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/mojomanyana/pi-daddy/contracts/ledger/v3/ledger-event.schema.json",
4
+ "title": "pi-daddy ledgerVersion 3 event",
5
+ "description": "One JSON object per JSONL line. Version 3 adds unique execution identity and explicit parent execution identity; legacy and v2 lines are intentionally outside this schema.",
6
+ "oneOf": [
7
+ {
8
+ "$ref": "#/$defs/capabilityDecision"
9
+ },
10
+ {
11
+ "$ref": "#/$defs/workspaceLease"
12
+ },
13
+ {
14
+ "$ref": "#/$defs/childLifecycle"
15
+ },
16
+ {
17
+ "$ref": "#/$defs/checkReceipt"
18
+ },
19
+ {
20
+ "$ref": "#/$defs/workflowFact"
21
+ }
22
+ ],
23
+ "$defs": {
24
+ "timestamp": {
25
+ "type": "string",
26
+ "format": "date-time",
27
+ "pattern": ":[0-5][0-9](?:\\.[0-9]+)?(?:[Zz]|[+-][0-9]{2}:[0-9]{2})$"
28
+ },
29
+ "correlation": {
30
+ "type": "object",
31
+ "description": "Opaque, non-authoritative controller metadata. String and aggregate byte limits are additionally enforced by the runtime and cannot be represented exactly in JSON Schema.",
32
+ "properties": {
33
+ "schema_version": {
34
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
35
+ },
36
+ "run_id": {
37
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
38
+ },
39
+ "task_id": {
40
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
41
+ },
42
+ "workspace_id": {
43
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
44
+ },
45
+ "context_id": {
46
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
47
+ },
48
+ "phase": {
49
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
50
+ },
51
+ "assurance": {
52
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
53
+ },
54
+ "assurance_effective": {
55
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
56
+ },
57
+ "policy_label": {
58
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
59
+ },
60
+ "assurance_source": {
61
+ "$ref": "#/$defs/ledgerCorrelationIdentifier"
62
+ },
63
+ "assurance_scope": {
64
+ "oneOf": [
65
+ {
66
+ "type": "object"
67
+ },
68
+ {
69
+ "type": "array"
70
+ },
71
+ {
72
+ "type": "string"
73
+ },
74
+ {
75
+ "type": "number"
76
+ },
77
+ {
78
+ "type": "boolean"
79
+ }
80
+ ]
81
+ },
82
+ "activated_at": {
83
+ "type": "string",
84
+ "maxLength": 512
85
+ },
86
+ "plan_digest": {
87
+ "type": "string",
88
+ "maxLength": 512
89
+ },
90
+ "definition_digest": {
91
+ "type": "string",
92
+ "maxLength": 512
93
+ },
94
+ "task_digest": {
95
+ "type": "string",
96
+ "maxLength": 512
97
+ },
98
+ "base_sha": {
99
+ "type": "string",
100
+ "maxLength": 512
101
+ },
102
+ "head_sha": {
103
+ "type": "string",
104
+ "maxLength": 512
105
+ },
106
+ "tree_sha": {
107
+ "type": "string",
108
+ "maxLength": 512
109
+ },
110
+ "event_seq": {
111
+ "type": "number"
112
+ },
113
+ "last_change_seq": {
114
+ "type": "number"
115
+ },
116
+ "last_authority_seq": {
117
+ "type": "number"
118
+ },
119
+ "check_receipt_id": {
120
+ "type": "string",
121
+ "maxLength": 512
122
+ }
123
+ },
124
+ "additionalProperties": false
125
+ },
126
+ "ledgerDisplayIdentifier": {
127
+ "type": "string",
128
+ "pattern": "^[A-Za-z0-9@*][A-Za-z0-9@*._:/-]{0,511}$"
129
+ },
130
+ "ledgerCorrelationIdentifier": {
131
+ "type": "string",
132
+ "pattern": "^[A-Za-z0-9@*][A-Za-z0-9@*._:/-]{0,127}$"
133
+ },
134
+ "ledgerCapabilityIdentifier": {
135
+ "type": "string",
136
+ "pattern": "^(tool|skill|agent|workspace|ext):[A-Za-z0-9@*][A-Za-z0-9@*._/-]{0,255}$"
137
+ },
138
+ "refusalCode": {
139
+ "type": "string",
140
+ "enum": [
141
+ "CAPABILITY_ESCALATION",
142
+ "GRANT_ID_MALFORMED",
143
+ "DEFINITION_NOT_AUTHORIZED",
144
+ "UNDECLARED_TOOLS",
145
+ "UNKNOWN_TOOL",
146
+ "GATED_UNAPPROVED",
147
+ "APPROVAL_EXPIRED",
148
+ "APPROVAL_SCOPE_MISMATCH",
149
+ "APPROVAL_FLOW_FAILED",
150
+ "DEPTH_EXCEEDED",
151
+ "FANOUT_EXCEEDED",
152
+ "EXECUTOR_UNAVAILABLE",
153
+ "CHILD_TIMED_OUT",
154
+ "CHILD_CANCELLED",
155
+ "CHILD_EXIT_NONZERO",
156
+ "TASK_MISSING",
157
+ "UNKNOWN_DEFINITION",
158
+ "CEILING_PATTERNS_UNRESOLVED",
159
+ "NARROWING_VIOLATED",
160
+ "DEFINITION_UNREADABLE",
161
+ "CORRELATION_TOO_LARGE",
162
+ "CORRELATION_INVALID",
163
+ "LEDGER_WRITE_FAILED",
164
+ "FANOUT_FAILED",
165
+ "WORKSPACE_NOT_REGISTERED",
166
+ "WORKSPACE_NOT_AUTHORIZED",
167
+ "WORKSPACE_WRITE_CONFLICT",
168
+ "WORKSPACE_LEASE_STALE",
169
+ "CHECK_NOT_CONFIGURED",
170
+ "CHECK_CONFIGURATION_INVALID",
171
+ "CHECK_IDENTITY_UNAVAILABLE",
172
+ "CHECK_IDENTITY_MISMATCH"
173
+ ]
174
+ },
175
+ "refusal": {
176
+ "type": "object",
177
+ "properties": {
178
+ "code": {
179
+ "$ref": "#/$defs/refusalCode"
180
+ },
181
+ "message": {
182
+ "type": "string"
183
+ },
184
+ "details": {
185
+ "type": "object",
186
+ "additionalProperties": {
187
+ "type": [
188
+ "string",
189
+ "number",
190
+ "boolean",
191
+ "null"
192
+ ]
193
+ }
194
+ }
195
+ },
196
+ "required": [
197
+ "code",
198
+ "message"
199
+ ],
200
+ "additionalProperties": false
201
+ },
202
+ "approvalSource": {
203
+ "type": "string",
204
+ "enum": [
205
+ "prompt",
206
+ "session",
207
+ "persisted",
208
+ "inherited"
209
+ ]
210
+ },
211
+ "approvalScope": {
212
+ "type": "string",
213
+ "enum": [
214
+ "once",
215
+ "session",
216
+ "always"
217
+ ]
218
+ },
219
+ "approvalUse": {
220
+ "type": "object",
221
+ "properties": {
222
+ "max": {
223
+ "type": "integer",
224
+ "minimum": 0
225
+ },
226
+ "remaining": {
227
+ "type": "integer",
228
+ "minimum": 0
229
+ }
230
+ },
231
+ "required": [
232
+ "max",
233
+ "remaining"
234
+ ],
235
+ "additionalProperties": false
236
+ },
237
+ "definitionDigest": {
238
+ "type": "object",
239
+ "properties": {
240
+ "name": {
241
+ "type": "string"
242
+ },
243
+ "source": {
244
+ "type": "string"
245
+ },
246
+ "sha256": {
247
+ "type": "string",
248
+ "pattern": "^[a-fA-F0-9]{64}$"
249
+ }
250
+ },
251
+ "required": [
252
+ "name",
253
+ "source",
254
+ "sha256"
255
+ ],
256
+ "additionalProperties": false
257
+ },
258
+ "capabilityDecision": {
259
+ "type": "object",
260
+ "properties": {
261
+ "ledgerVersion": {
262
+ "const": 3
263
+ },
264
+ "event": {
265
+ "const": "capability_decision"
266
+ },
267
+ "ts": {
268
+ "$ref": "#/$defs/timestamp"
269
+ },
270
+ "parentId": {
271
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
272
+ },
273
+ "childId": {
274
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
275
+ },
276
+ "depth": {
277
+ "type": "integer",
278
+ "minimum": 0
279
+ },
280
+ "agentType": {
281
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
282
+ },
283
+ "requested": {
284
+ "type": "array",
285
+ "items": {
286
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
287
+ }
288
+ },
289
+ "parentGrant": {
290
+ "type": "array",
291
+ "items": {
292
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
293
+ }
294
+ },
295
+ "effective": {
296
+ "type": "array",
297
+ "items": {
298
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
299
+ }
300
+ },
301
+ "denied": {
302
+ "type": "array",
303
+ "items": {
304
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
305
+ }
306
+ },
307
+ "clipped": {
308
+ "type": "array",
309
+ "items": {
310
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
311
+ }
312
+ },
313
+ "gatedBlocked": {
314
+ "type": "array",
315
+ "items": {
316
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
317
+ }
318
+ },
319
+ "blocked": {
320
+ "type": "boolean"
321
+ },
322
+ "reason": {
323
+ "type": "string"
324
+ },
325
+ "approved": {
326
+ "type": "array",
327
+ "items": {
328
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
329
+ }
330
+ },
331
+ "approvalSource": {
332
+ "$ref": "#/$defs/approvalSource"
333
+ },
334
+ "approvalSources": {
335
+ "type": "object",
336
+ "propertyNames": {
337
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
338
+ },
339
+ "additionalProperties": {
340
+ "$ref": "#/$defs/approvalSource"
341
+ }
342
+ },
343
+ "approvalScopes": {
344
+ "type": "object",
345
+ "propertyNames": {
346
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
347
+ },
348
+ "additionalProperties": {
349
+ "$ref": "#/$defs/approvalScope"
350
+ }
351
+ },
352
+ "approvalExpiresAt": {
353
+ "type": "object",
354
+ "propertyNames": {
355
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
356
+ },
357
+ "additionalProperties": {
358
+ "$ref": "#/$defs/timestamp"
359
+ }
360
+ },
361
+ "approvalUses": {
362
+ "type": "object",
363
+ "propertyNames": {
364
+ "$ref": "#/$defs/ledgerCapabilityIdentifier"
365
+ },
366
+ "additionalProperties": {
367
+ "$ref": "#/$defs/approvalUse"
368
+ }
369
+ },
370
+ "approvalScope": {
371
+ "$ref": "#/$defs/approvalScope"
372
+ },
373
+ "humanDenied": {
374
+ "const": true
375
+ },
376
+ "gateOutcome": {
377
+ "type": "string",
378
+ "enum": [
379
+ "declined",
380
+ "dismissed",
381
+ "no-ui",
382
+ "error"
383
+ ]
384
+ },
385
+ "definitionDigest": {
386
+ "$ref": "#/$defs/definitionDigest"
387
+ },
388
+ "executor": {
389
+ "type": "string",
390
+ "enum": [
391
+ "process",
392
+ "herdr"
393
+ ]
394
+ },
395
+ "taskFrom": {
396
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
397
+ },
398
+ "taskDigest": {
399
+ "type": "string",
400
+ "pattern": "^[a-fA-F0-9]{64}$"
401
+ },
402
+ "correlation": {
403
+ "$ref": "#/$defs/correlation"
404
+ },
405
+ "refusal": {
406
+ "$ref": "#/$defs/refusal"
407
+ },
408
+ "executionId": {
409
+ "$ref": "#/$defs/executionId"
410
+ },
411
+ "parentExecutionId": {
412
+ "oneOf": [
413
+ {
414
+ "$ref": "#/$defs/executionId"
415
+ },
416
+ {
417
+ "type": "null"
418
+ }
419
+ ]
420
+ },
421
+ "taskFromExecutionId": {
422
+ "$ref": "#/$defs/executionId"
423
+ }
424
+ },
425
+ "required": [
426
+ "ledgerVersion",
427
+ "event",
428
+ "ts",
429
+ "executionId",
430
+ "parentExecutionId",
431
+ "parentId",
432
+ "childId",
433
+ "depth",
434
+ "requested",
435
+ "parentGrant",
436
+ "effective",
437
+ "denied",
438
+ "clipped",
439
+ "gatedBlocked",
440
+ "blocked",
441
+ "executor",
442
+ "taskDigest"
443
+ ],
444
+ "additionalProperties": false
445
+ },
446
+ "workspaceLease": {
447
+ "type": "object",
448
+ "properties": {
449
+ "ledgerVersion": {
450
+ "const": 3
451
+ },
452
+ "event": {
453
+ "const": "workspace_lease"
454
+ },
455
+ "ts": {
456
+ "$ref": "#/$defs/timestamp"
457
+ },
458
+ "childId": {
459
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
460
+ },
461
+ "workspaceId": {
462
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
463
+ },
464
+ "root": {
465
+ "type": "string",
466
+ "minLength": 1
467
+ },
468
+ "access": {
469
+ "type": "string",
470
+ "enum": [
471
+ "read",
472
+ "write"
473
+ ]
474
+ },
475
+ "outcome": {
476
+ "type": "string",
477
+ "enum": [
478
+ "acquired",
479
+ "uncontended",
480
+ "refused",
481
+ "released",
482
+ "released-unrecorded",
483
+ "lost",
484
+ "retained",
485
+ "timeout",
486
+ "recovered"
487
+ ]
488
+ },
489
+ "recovered": {
490
+ "oneOf": [
491
+ {
492
+ "type": "boolean"
493
+ },
494
+ {
495
+ "const": "unknown"
496
+ }
497
+ ]
498
+ },
499
+ "releaseReason": {
500
+ "type": "string"
501
+ },
502
+ "refusal": {
503
+ "$ref": "#/$defs/refusal"
504
+ },
505
+ "correlation": {
506
+ "$ref": "#/$defs/correlation"
507
+ },
508
+ "executionId": {
509
+ "$ref": "#/$defs/executionId"
510
+ },
511
+ "parentExecutionId": {
512
+ "oneOf": [
513
+ {
514
+ "$ref": "#/$defs/executionId"
515
+ },
516
+ {
517
+ "type": "null"
518
+ }
519
+ ]
520
+ }
521
+ },
522
+ "required": [
523
+ "ledgerVersion",
524
+ "event",
525
+ "ts",
526
+ "executionId",
527
+ "parentExecutionId",
528
+ "childId",
529
+ "workspaceId",
530
+ "root",
531
+ "access",
532
+ "outcome"
533
+ ],
534
+ "additionalProperties": false
535
+ },
536
+ "childLifecycle": {
537
+ "type": "object",
538
+ "properties": {
539
+ "ledgerVersion": {
540
+ "const": 3
541
+ },
542
+ "event": {
543
+ "const": "child_lifecycle"
544
+ },
545
+ "ts": {
546
+ "$ref": "#/$defs/timestamp"
547
+ },
548
+ "childId": {
549
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
550
+ },
551
+ "state": {
552
+ "type": "string",
553
+ "enum": [
554
+ "starting",
555
+ "running",
556
+ "completed",
557
+ "failed"
558
+ ]
559
+ },
560
+ "executor": {
561
+ "type": "string",
562
+ "enum": [
563
+ "process",
564
+ "herdr"
565
+ ]
566
+ },
567
+ "exitCode": {
568
+ "type": [
569
+ "integer",
570
+ "null"
571
+ ]
572
+ },
573
+ "signal": {
574
+ "oneOf": [
575
+ {
576
+ "type": "string",
577
+ "enum": [
578
+ "SIGABRT",
579
+ "SIGALRM",
580
+ "SIGBUS",
581
+ "SIGCHLD",
582
+ "SIGCONT",
583
+ "SIGFPE",
584
+ "SIGHUP",
585
+ "SIGILL",
586
+ "SIGINT",
587
+ "SIGIO",
588
+ "SIGIOT",
589
+ "SIGKILL",
590
+ "SIGPIPE",
591
+ "SIGPOLL",
592
+ "SIGPROF",
593
+ "SIGPWR",
594
+ "SIGQUIT",
595
+ "SIGSEGV",
596
+ "SIGSTKFLT",
597
+ "SIGSTOP",
598
+ "SIGSYS",
599
+ "SIGTERM",
600
+ "SIGTRAP",
601
+ "SIGTSTP",
602
+ "SIGTTIN",
603
+ "SIGTTOU",
604
+ "SIGUNUSED",
605
+ "SIGURG",
606
+ "SIGUSR1",
607
+ "SIGUSR2",
608
+ "SIGVTALRM",
609
+ "SIGWINCH",
610
+ "SIGXCPU",
611
+ "SIGXFSZ",
612
+ "SIGBREAK",
613
+ "SIGLOST",
614
+ "SIGINFO"
615
+ ]
616
+ },
617
+ {
618
+ "type": "null"
619
+ }
620
+ ]
621
+ },
622
+ "timedOut": {
623
+ "const": true
624
+ },
625
+ "aborted": {
626
+ "const": true
627
+ },
628
+ "truncated": {
629
+ "const": true
630
+ },
631
+ "reason": {
632
+ "type": "string"
633
+ },
634
+ "correlation": {
635
+ "$ref": "#/$defs/correlation"
636
+ },
637
+ "executionId": {
638
+ "$ref": "#/$defs/executionId"
639
+ },
640
+ "parentExecutionId": {
641
+ "oneOf": [
642
+ {
643
+ "$ref": "#/$defs/executionId"
644
+ },
645
+ {
646
+ "type": "null"
647
+ }
648
+ ]
649
+ },
650
+ "deadlineAt": {
651
+ "$ref": "#/$defs/timestamp"
652
+ },
653
+ "herdrPaneId": {
654
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
655
+ },
656
+ "herdrAgentName": {
657
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
658
+ }
659
+ },
660
+ "required": [
661
+ "ledgerVersion",
662
+ "event",
663
+ "ts",
664
+ "executionId",
665
+ "parentExecutionId",
666
+ "childId",
667
+ "state",
668
+ "executor"
669
+ ],
670
+ "additionalProperties": false,
671
+ "allOf": [
672
+ {
673
+ "if": {
674
+ "properties": {
675
+ "state": {
676
+ "enum": [
677
+ "starting",
678
+ "running"
679
+ ]
680
+ }
681
+ },
682
+ "required": [
683
+ "state"
684
+ ]
685
+ },
686
+ "then": {
687
+ "required": [
688
+ "deadlineAt"
689
+ ]
690
+ }
691
+ },
692
+ {
693
+ "if": {
694
+ "anyOf": [
695
+ {
696
+ "required": [
697
+ "herdrPaneId"
698
+ ]
699
+ },
700
+ {
701
+ "required": [
702
+ "herdrAgentName"
703
+ ]
704
+ }
705
+ ]
706
+ },
707
+ "then": {
708
+ "required": [
709
+ "herdrPaneId",
710
+ "herdrAgentName"
711
+ ],
712
+ "properties": {
713
+ "executor": {
714
+ "const": "herdr"
715
+ }
716
+ }
717
+ }
718
+ }
719
+ ]
720
+ },
721
+ "checkReceipt": {
722
+ "type": "object",
723
+ "properties": {
724
+ "ledgerVersion": {
725
+ "const": 3
726
+ },
727
+ "event": {
728
+ "const": "check_receipt"
729
+ },
730
+ "ts": {
731
+ "$ref": "#/$defs/timestamp"
732
+ },
733
+ "childId": {
734
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
735
+ },
736
+ "receiptId": {
737
+ "type": "string",
738
+ "pattern": "^[a-fA-F0-9]{64}$"
739
+ },
740
+ "workspaceId": {
741
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
742
+ },
743
+ "checkId": {
744
+ "$ref": "#/$defs/ledgerDisplayIdentifier"
745
+ },
746
+ "treeSha": {
747
+ "type": "string",
748
+ "minLength": 1
749
+ },
750
+ "correlation": {
751
+ "$ref": "#/$defs/correlation"
752
+ },
753
+ "executionId": {
754
+ "$ref": "#/$defs/executionId"
755
+ },
756
+ "parentExecutionId": {
757
+ "oneOf": [
758
+ {
759
+ "$ref": "#/$defs/executionId"
760
+ },
761
+ {
762
+ "type": "null"
763
+ }
764
+ ]
765
+ }
766
+ },
767
+ "required": [
768
+ "ledgerVersion",
769
+ "event",
770
+ "ts",
771
+ "executionId",
772
+ "parentExecutionId",
773
+ "childId",
774
+ "receiptId",
775
+ "workspaceId",
776
+ "checkId",
777
+ "treeSha"
778
+ ],
779
+ "additionalProperties": false
780
+ },
781
+ "executionId": {
782
+ "type": "string",
783
+ "pattern": "^exec:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
784
+ },
785
+ "workflowFact": {
786
+ "type": "object",
787
+ "properties": {
788
+ "ledgerVersion": {
789
+ "const": 3
790
+ },
791
+ "event": {
792
+ "const": "workflow_fact"
793
+ },
794
+ "ts": {
795
+ "$ref": "#/$defs/timestamp"
796
+ },
797
+ "factId": {
798
+ "type": "string",
799
+ "pattern": "^fact:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
800
+ },
801
+ "source": {
802
+ "type": "string",
803
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$"
804
+ },
805
+ "provenance": {
806
+ "enum": [
807
+ "planned",
808
+ "observed",
809
+ "controller_validated"
810
+ ]
811
+ },
812
+ "kind": {
813
+ "enum": [
814
+ "workflow_phase",
815
+ "inline_skill",
816
+ "transition"
817
+ ]
818
+ },
819
+ "subject": {
820
+ "type": "string",
821
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$"
822
+ },
823
+ "state": {
824
+ "enum": [
825
+ "pending",
826
+ "observed",
827
+ "started",
828
+ "completed",
829
+ "blocked"
830
+ ]
831
+ },
832
+ "correlation": {
833
+ "allOf": [
834
+ {
835
+ "$ref": "#/$defs/correlation"
836
+ },
837
+ {
838
+ "type": "object",
839
+ "properties": {
840
+ "run_id": {
841
+ "type": "string",
842
+ "minLength": 1
843
+ }
844
+ },
845
+ "required": [
846
+ "run_id"
847
+ ]
848
+ }
849
+ ]
850
+ }
851
+ },
852
+ "required": [
853
+ "ledgerVersion",
854
+ "event",
855
+ "ts",
856
+ "factId",
857
+ "source",
858
+ "provenance",
859
+ "kind",
860
+ "subject",
861
+ "state",
862
+ "correlation"
863
+ ],
864
+ "additionalProperties": false,
865
+ "allOf": [
866
+ {
867
+ "if": {
868
+ "properties": {
869
+ "provenance": {
870
+ "const": "planned"
871
+ }
872
+ },
873
+ "required": [
874
+ "provenance"
875
+ ]
876
+ },
877
+ "then": {
878
+ "properties": {
879
+ "state": {
880
+ "const": "pending"
881
+ }
882
+ }
883
+ }
884
+ },
885
+ {
886
+ "if": {
887
+ "properties": {
888
+ "provenance": {
889
+ "const": "observed"
890
+ }
891
+ },
892
+ "required": [
893
+ "provenance"
894
+ ]
895
+ },
896
+ "then": {
897
+ "properties": {
898
+ "state": {
899
+ "const": "observed"
900
+ }
901
+ }
902
+ }
903
+ },
904
+ {
905
+ "if": {
906
+ "properties": {
907
+ "provenance": {
908
+ "const": "controller_validated"
909
+ }
910
+ },
911
+ "required": [
912
+ "provenance"
913
+ ]
914
+ },
915
+ "then": {
916
+ "properties": {
917
+ "state": {
918
+ "enum": [
919
+ "started",
920
+ "completed",
921
+ "blocked"
922
+ ]
923
+ }
924
+ }
925
+ }
926
+ }
927
+ ]
928
+ }
929
+ }
930
+ }