@toolproof-npm/schema 0.1.80 → 0.1.82

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.
@@ -374,6 +374,46 @@
374
374
  "$anchor": "ForStepIdentity",
375
375
  "pattern": "^FORSTEP-.+$"
376
376
  },
377
+ "GraphEndRunEvent": {
378
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
379
+ "allOf": [
380
+ {
381
+ "$ref": "#/$defs/RunEventBase"
382
+ },
383
+ {
384
+ "type": "object",
385
+ "properties": {
386
+ "kind": {
387
+ "const": "graph_end"
388
+ }
389
+ }
390
+ }
391
+ ],
392
+ "$anchor": "GraphEndRunEvent"
393
+ },
394
+ "GraphStartRunEvent": {
395
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
396
+ "allOf": [
397
+ {
398
+ "$ref": "#/$defs/RunEventBase"
399
+ },
400
+ {
401
+ "type": "object",
402
+ "properties": {
403
+ "kind": {
404
+ "const": "graph_start"
405
+ },
406
+ "strategyRunSeed": {
407
+ "$ref": "#/$defs/StrategyRun"
408
+ }
409
+ },
410
+ "required": [
411
+ "strategyRunSeed"
412
+ ]
413
+ }
414
+ ],
415
+ "$anchor": "GraphStartRunEvent"
416
+ },
377
417
  "IdentityProp": {
378
418
  "$schema": "https://json-schema.org/draft/2020-12/schema",
379
419
  "type": "object",
@@ -585,6 +625,23 @@
585
625
  "additionalProperties": false,
586
626
  "$anchor": "IdentitySchemaRef"
587
627
  },
628
+ "InterruptRunEvent": {
629
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
630
+ "allOf": [
631
+ {
632
+ "$ref": "#/$defs/RunEventBase"
633
+ },
634
+ {
635
+ "type": "object",
636
+ "properties": {
637
+ "kind": {
638
+ "const": "interrupt"
639
+ }
640
+ }
641
+ }
642
+ ],
643
+ "$anchor": "InterruptRunEvent"
644
+ },
588
645
  "Job": {
589
646
  "$schema": "https://json-schema.org/draft/2020-12/schema",
590
647
  "type": "object",
@@ -1279,6 +1336,207 @@
1279
1336
  ],
1280
1337
  "$anchor": "RolesWrapper"
1281
1338
  },
1339
+ "RunEvent": {
1340
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1341
+ "oneOf": [
1342
+ {
1343
+ "$ref": "#/$defs/GraphStartRunEvent"
1344
+ },
1345
+ {
1346
+ "$ref": "#/$defs/TickRunEvent"
1347
+ },
1348
+ {
1349
+ "$ref": "#/$defs/InterruptRunEvent"
1350
+ },
1351
+ {
1352
+ "$ref": "#/$defs/GraphEndRunEvent"
1353
+ }
1354
+ ],
1355
+ "$anchor": "RunEvent"
1356
+ },
1357
+ "RunEventBase": {
1358
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1359
+ "type": "object",
1360
+ "properties": {
1361
+ "counters": {
1362
+ "$ref": "#/$defs/RunEventCounters"
1363
+ },
1364
+ "createdAt": {
1365
+ "$ref": "#/$defs/Timestamp"
1366
+ },
1367
+ "eventSeq": {
1368
+ "type": "integer"
1369
+ },
1370
+ "kind": {
1371
+ "$ref": "#/$defs/RunEventKind"
1372
+ },
1373
+ "nodeName": {
1374
+ "type": "string"
1375
+ },
1376
+ "stepMetaData": {
1377
+ "$ref": "#/$defs/RunEventStepMetaData"
1378
+ },
1379
+ "strategyRunRef": {
1380
+ "$ref": "#/$defs/StrategyRunIdentity"
1381
+ },
1382
+ "strategyThreadRef": {
1383
+ "$ref": "#/$defs/StrategyThreadIdentity"
1384
+ },
1385
+ "updates": {
1386
+ "$ref": "#/$defs/RunEventUpdates"
1387
+ }
1388
+ },
1389
+ "required": [
1390
+ "kind",
1391
+ "strategyRunRef",
1392
+ "strategyThreadRef",
1393
+ "createdAt",
1394
+ "nodeName",
1395
+ "eventSeq"
1396
+ ],
1397
+ "$anchor": "RunEventBase"
1398
+ },
1399
+ "RunEventCounters": {
1400
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1401
+ "type": "object",
1402
+ "properties": {
1403
+ "iterationCounterAfter": {
1404
+ "type": "integer"
1405
+ },
1406
+ "stepCounterAfter": {
1407
+ "type": "integer"
1408
+ }
1409
+ },
1410
+ "$anchor": "RunEventCounters"
1411
+ },
1412
+ "RunEventKind": {
1413
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1414
+ "type": "string",
1415
+ "$anchor": "RunEventKind",
1416
+ "enum": [
1417
+ "graph_start",
1418
+ "tick",
1419
+ "interrupt",
1420
+ "graph_end"
1421
+ ]
1422
+ },
1423
+ "RunEventStepKind": {
1424
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1425
+ "type": "string",
1426
+ "$anchor": "RunEventStepKind",
1427
+ "enum": [
1428
+ "work",
1429
+ "branch",
1430
+ "while",
1431
+ "for"
1432
+ ]
1433
+ },
1434
+ "RunEventStepMetaData": {
1435
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1436
+ "type": "object",
1437
+ "properties": {
1438
+ "executionRef": {
1439
+ "$ref": "#/$defs/ExecutionIdentity"
1440
+ },
1441
+ "jobRef": {
1442
+ "$ref": "#/$defs/JobIdentity"
1443
+ },
1444
+ "stepKind": {
1445
+ "$ref": "#/$defs/RunEventStepKind"
1446
+ },
1447
+ "stepRef": {
1448
+ "oneOf": [
1449
+ {
1450
+ "$ref": "#/$defs/WorkStepIdentity"
1451
+ },
1452
+ {
1453
+ "$ref": "#/$defs/BranchStepIdentity"
1454
+ },
1455
+ {
1456
+ "$ref": "#/$defs/WhileStepIdentity"
1457
+ },
1458
+ {
1459
+ "$ref": "#/$defs/ForStepIdentity"
1460
+ }
1461
+ ]
1462
+ },
1463
+ "threadStepIndex": {
1464
+ "type": "integer"
1465
+ }
1466
+ },
1467
+ "required": [
1468
+ "stepRef",
1469
+ "stepKind",
1470
+ "threadStepIndex"
1471
+ ],
1472
+ "$anchor": "RunEventStepMetaData"
1473
+ },
1474
+ "RunEventUpdates": {
1475
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1476
+ "type": "object",
1477
+ "allOf": [
1478
+ {
1479
+ "$ref": "#/$defs/StrategyStateDelta"
1480
+ }
1481
+ ],
1482
+ "properties": {
1483
+ "interruptData": {
1484
+ "type": [
1485
+ "object",
1486
+ "null"
1487
+ ],
1488
+ "$comment": "Kept permissive; the engine may evolve interrupt payloads."
1489
+ },
1490
+ "stepsMutation": {
1491
+ "type": "object",
1492
+ "properties": {
1493
+ "insertAt": {
1494
+ "type": "integer"
1495
+ },
1496
+ "inserted": {
1497
+ "type": "array",
1498
+ "items": {
1499
+ "$ref": "#/$defs/Step"
1500
+ }
1501
+ }
1502
+ },
1503
+ "required": [
1504
+ "insertAt",
1505
+ "inserted"
1506
+ ]
1507
+ }
1508
+ },
1509
+ "$anchor": "RunEventUpdates"
1510
+ },
1511
+ "RunRecording": {
1512
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1513
+ "type": "object",
1514
+ "properties": {
1515
+ "recordedAt": {
1516
+ "$comment": "Optional recording timestamp.",
1517
+ "$ref": "#/$defs/Timestamp"
1518
+ },
1519
+ "runEvents": {
1520
+ "type": "array",
1521
+ "items": {
1522
+ "$ref": "#/$defs/RunEvent"
1523
+ }
1524
+ },
1525
+ "strategyRunRef": {
1526
+ "$comment": "Optional; derived from the first event but useful for indexing.",
1527
+ "$ref": "#/$defs/StrategyRunIdentity"
1528
+ },
1529
+ "strategyThreadRef": {
1530
+ "$comment": "Optional; derived from the first event but useful for indexing.",
1531
+ "$ref": "#/$defs/StrategyThreadIdentity"
1532
+ }
1533
+ },
1534
+ "required": [
1535
+ "runEvents"
1536
+ ],
1537
+ "unevaluatedProperties": false,
1538
+ "$anchor": "RunRecording"
1539
+ },
1282
1540
  "StatefulStrategy": {
1283
1541
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1284
1542
  "type": "object",
@@ -1346,7 +1604,6 @@
1346
1604
  "required": [
1347
1605
  "statelessStrategy"
1348
1606
  ],
1349
- "unevaluatedProperties": false,
1350
1607
  "$anchor": "StatelessStrategyWrapper"
1351
1608
  },
1352
1609
  "Step": {
@@ -1461,6 +1718,11 @@
1461
1718
  "StrategyRunUpdate": {
1462
1719
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1463
1720
  "type": "object",
1721
+ "allOf": [
1722
+ {
1723
+ "$ref": "#/$defs/StrategyStateDelta"
1724
+ }
1725
+ ],
1464
1726
  "properties": {
1465
1727
  "strategyRun": {
1466
1728
  "$comment": "Optional embedded snapshot; strategyRunRef remains the canonical pointer.",
@@ -1468,7 +1730,30 @@
1468
1730
  },
1469
1731
  "strategyRunRef": {
1470
1732
  "$ref": "#/$defs/StrategyRunIdentity"
1471
- },
1733
+ }
1734
+ },
1735
+ "required": [
1736
+ "strategyRunRef",
1737
+ "strategyStateUpdate"
1738
+ ],
1739
+ "unevaluatedProperties": false,
1740
+ "$anchor": "StrategyRunUpdate"
1741
+ },
1742
+ "StrategyState": {
1743
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1744
+ "type": "object",
1745
+ "additionalProperties": {
1746
+ "$ref": "#/$defs/ExecutionSocket"
1747
+ },
1748
+ "$anchor": "StrategyState",
1749
+ "propertyNames": {
1750
+ "$ref": "#/$defs/ExecutionIdentity"
1751
+ }
1752
+ },
1753
+ "StrategyStateDelta": {
1754
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1755
+ "type": "object",
1756
+ "properties": {
1472
1757
  "strategyStateUpdate": {
1473
1758
  "type": "object",
1474
1759
  "additionalProperties": {
@@ -1490,23 +1775,8 @@
1490
1775
  }
1491
1776
  }
1492
1777
  },
1493
- "required": [
1494
- "strategyRunRef",
1495
- "strategyStateUpdate"
1496
- ],
1497
- "unevaluatedProperties": false,
1498
- "$anchor": "StrategyRunUpdate"
1499
- },
1500
- "StrategyState": {
1501
- "$schema": "https://json-schema.org/draft/2020-12/schema",
1502
- "type": "object",
1503
- "additionalProperties": {
1504
- "$ref": "#/$defs/ExecutionSocket"
1505
- },
1506
- "$anchor": "StrategyState",
1507
- "propertyNames": {
1508
- "$ref": "#/$defs/ExecutionIdentity"
1509
- }
1778
+ "$anchor": "StrategyStateDelta",
1779
+ "$comment": "Shared delta payload for strategy state updates; used both as standalone updates and embedded within run events."
1510
1780
  },
1511
1781
  "StrategyStateWrapper": {
1512
1782
  "$schema": "https://json-schema.org/draft/2020-12/schema",
@@ -1519,7 +1789,6 @@
1519
1789
  "required": [
1520
1790
  "strategyState"
1521
1791
  ],
1522
- "unevaluatedProperties": false,
1523
1792
  "$anchor": "StrategyStateWrapper"
1524
1793
  },
1525
1794
  "StrategyThreadIdentity": {
@@ -1554,9 +1823,25 @@
1554
1823
  "required": [
1555
1824
  "strategyThreadMap"
1556
1825
  ],
1557
- "unevaluatedProperties": false,
1558
1826
  "$anchor": "StrategyThreadMapWrapper"
1559
1827
  },
1828
+ "TickRunEvent": {
1829
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1830
+ "allOf": [
1831
+ {
1832
+ "$ref": "#/$defs/RunEventBase"
1833
+ },
1834
+ {
1835
+ "type": "object",
1836
+ "properties": {
1837
+ "kind": {
1838
+ "const": "tick"
1839
+ }
1840
+ }
1841
+ }
1842
+ ],
1843
+ "$anchor": "TickRunEvent"
1844
+ },
1560
1845
  "Timestamp": {
1561
1846
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1562
1847
  "type": "object",
@@ -0,0 +1,2 @@
1
+ import schema from './RunRecording.json';
2
+ export default schema;
@@ -0,0 +1,2 @@
1
+ import schema from './RunRecording.json' with { type: 'json' };
2
+ export default schema;