proschi 0.2.0 → 0.4.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.
@@ -138,6 +138,52 @@
138
138
  "items": {
139
139
  "$ref": "#/$defs/useCase"
140
140
  }
141
+ },
142
+ "summary": {
143
+ "type": "string",
144
+ "description": "Second string of `title`: the system summary."
145
+ },
146
+ "traffic": {
147
+ "type": "array",
148
+ "items": {
149
+ "$ref": "#/$defs/traffic"
150
+ },
151
+ "description": "`traffic { … }` lines, one per use case."
152
+ },
153
+ "requirements": {
154
+ "type": "array",
155
+ "items": {
156
+ "$ref": "#/$defs/requirement"
157
+ },
158
+ "description": "`requirements { … }` lines."
159
+ },
160
+ "capacity": {
161
+ "type": "array",
162
+ "items": {
163
+ "$ref": "#/$defs/capacity"
164
+ },
165
+ "description": "`capacity { … }` lines: per-replica overrides of the default profiles."
166
+ },
167
+ "entities": {
168
+ "type": "array",
169
+ "items": {
170
+ "$ref": "#/$defs/entity"
171
+ },
172
+ "description": "`entity` blocks: the data model."
173
+ },
174
+ "decisions": {
175
+ "type": "array",
176
+ "items": {
177
+ "$ref": "#/$defs/decision"
178
+ },
179
+ "description": "`decision` statements."
180
+ },
181
+ "tests": {
182
+ "type": "array",
183
+ "items": {
184
+ "$ref": "#/$defs/test"
185
+ },
186
+ "description": "`test` blocks of flow assertions."
141
187
  }
142
188
  },
143
189
  "required": [
@@ -323,6 +369,11 @@
323
369
  "type": "boolean",
324
370
  "description": "Created because a connection or step referenced an undeclared id."
325
371
  },
372
+ "replicas": {
373
+ "type": "integer",
374
+ "minimum": 1,
375
+ "description": "`x3`: number of replicas; absent means 1."
376
+ },
326
377
  "loc": {
327
378
  "$ref": "#/$defs/loc"
328
379
  }
@@ -542,6 +593,23 @@
542
593
  "responseLoc": {
543
594
  "$ref": "#/$defs/loc",
544
595
  "description": "The `-->` line that answered the request."
596
+ },
597
+ "multiplier": {
598
+ "type": "integer",
599
+ "minimum": 1,
600
+ "description": "`x200` at the start of the label: the step happens this many times per request (fan-out). Absent means 1."
601
+ },
602
+ "sizeBytes": {
603
+ "type": "integer",
604
+ "minimum": 1,
605
+ "description": "`~2MB` at the start of the label: payload size in bytes (decimal units)."
606
+ },
607
+ "access": {
608
+ "enum": [
609
+ "read",
610
+ "write"
611
+ ],
612
+ "description": "From the HTTP method, or the first word of the label (INSERT, SET, PUBLISH, … write); every request step has one."
545
613
  }
546
614
  },
547
615
  "required": [
@@ -557,9 +625,799 @@
557
625
  "executionType",
558
626
  "isParallel",
559
627
  "isConditional",
628
+ "access",
629
+ "loc"
630
+ ],
631
+ "additionalProperties": false
632
+ },
633
+ "selector": {
634
+ "description": "A node id, an exact tech stack, every node of a kind (`any cache`), every data store of a consistency (`any strong store`), or a union (`X or Y`).",
635
+ "oneOf": [
636
+ {
637
+ "type": "object",
638
+ "properties": {
639
+ "node": {
640
+ "type": "string"
641
+ }
642
+ },
643
+ "required": [
644
+ "node"
645
+ ],
646
+ "additionalProperties": false
647
+ },
648
+ {
649
+ "type": "object",
650
+ "properties": {
651
+ "tech": {
652
+ "type": "string"
653
+ }
654
+ },
655
+ "required": [
656
+ "tech"
657
+ ],
658
+ "additionalProperties": false
659
+ },
660
+ {
661
+ "type": "object",
662
+ "properties": {
663
+ "kind": {
664
+ "enum": [
665
+ "client",
666
+ "edge",
667
+ "cdn",
668
+ "loadbalancer",
669
+ "gateway",
670
+ "dns",
671
+ "service",
672
+ "function",
673
+ "cache",
674
+ "database",
675
+ "search",
676
+ "analytics",
677
+ "queue",
678
+ "storage",
679
+ "external",
680
+ "other"
681
+ ]
682
+ }
683
+ },
684
+ "required": [
685
+ "kind"
686
+ ],
687
+ "additionalProperties": false
688
+ },
689
+ {
690
+ "type": "object",
691
+ "properties": {
692
+ "consistency": {
693
+ "enum": [
694
+ "strong",
695
+ "eventual"
696
+ ]
697
+ }
698
+ },
699
+ "required": [
700
+ "consistency"
701
+ ],
702
+ "additionalProperties": false
703
+ },
704
+ {
705
+ "type": "object",
706
+ "properties": {
707
+ "anyOf": {
708
+ "type": "array",
709
+ "items": {
710
+ "$ref": "#/$defs/selector"
711
+ },
712
+ "minItems": 2
713
+ }
714
+ },
715
+ "required": [
716
+ "anyOf"
717
+ ],
718
+ "additionalProperties": false
719
+ }
720
+ ]
721
+ },
722
+ "traffic": {
723
+ "type": "object",
724
+ "properties": {
725
+ "useCase": {
726
+ "type": "string"
727
+ },
728
+ "rps": {
729
+ "type": "number",
730
+ "minimum": 0,
731
+ "description": "Requests per second."
732
+ },
733
+ "mix": {
734
+ "type": "array",
735
+ "description": "Shares of the use case traffic per scenario, as fractions that add up to 1. Without a mix, all traffic goes to the first scenario.",
736
+ "items": {
737
+ "type": "object",
738
+ "properties": {
739
+ "scenario": {
740
+ "type": "string",
741
+ "description": "Full scenario name, e.g. `A › B`."
742
+ },
743
+ "share": {
744
+ "type": "number",
745
+ "minimum": 0,
746
+ "maximum": 1
747
+ }
748
+ },
749
+ "required": [
750
+ "scenario",
751
+ "share"
752
+ ],
753
+ "additionalProperties": false
754
+ }
755
+ },
756
+ "loc": {
757
+ "$ref": "#/$defs/loc"
758
+ }
759
+ },
760
+ "required": [
761
+ "useCase",
762
+ "rps",
560
763
  "loc"
561
764
  ],
562
765
  "additionalProperties": false
766
+ },
767
+ "requirement": {
768
+ "oneOf": [
769
+ {
770
+ "type": "object",
771
+ "properties": {
772
+ "kind": {
773
+ "const": "latency"
774
+ },
775
+ "percentile": {
776
+ "enum": [
777
+ 50,
778
+ 90,
779
+ 95,
780
+ 99,
781
+ 99.9
782
+ ]
783
+ },
784
+ "useCase": {
785
+ "type": "string",
786
+ "description": "Left out: every use case with traffic."
787
+ },
788
+ "scenario": {
789
+ "type": "string",
790
+ "description": "`scenario \"S\"`: the latency of one scenario of the use case."
791
+ },
792
+ "maxMs": {
793
+ "type": "number"
794
+ },
795
+ "loc": {
796
+ "$ref": "#/$defs/loc"
797
+ }
798
+ },
799
+ "required": [
800
+ "kind",
801
+ "percentile",
802
+ "maxMs",
803
+ "loc"
804
+ ],
805
+ "additionalProperties": false
806
+ },
807
+ {
808
+ "type": "object",
809
+ "properties": {
810
+ "kind": {
811
+ "const": "availability"
812
+ },
813
+ "useCase": {
814
+ "type": "string"
815
+ },
816
+ "minPercent": {
817
+ "type": "number",
818
+ "minimum": 0,
819
+ "maximum": 100
820
+ },
821
+ "loc": {
822
+ "$ref": "#/$defs/loc"
823
+ }
824
+ },
825
+ "required": [
826
+ "kind",
827
+ "minPercent",
828
+ "loc"
829
+ ],
830
+ "additionalProperties": false
831
+ },
832
+ {
833
+ "type": "object",
834
+ "properties": {
835
+ "kind": {
836
+ "const": "durable"
837
+ },
838
+ "useCase": {
839
+ "type": "string"
840
+ },
841
+ "loc": {
842
+ "$ref": "#/$defs/loc"
843
+ }
844
+ },
845
+ "required": [
846
+ "kind",
847
+ "useCase",
848
+ "loc"
849
+ ],
850
+ "additionalProperties": false
851
+ },
852
+ {
853
+ "type": "object",
854
+ "properties": {
855
+ "kind": {
856
+ "const": "survive"
857
+ },
858
+ "target": {
859
+ "oneOf": [
860
+ {
861
+ "const": "any"
862
+ },
863
+ {
864
+ "$ref": "#/$defs/selector"
865
+ }
866
+ ]
867
+ },
868
+ "loc": {
869
+ "$ref": "#/$defs/loc"
870
+ }
871
+ },
872
+ "required": [
873
+ "kind",
874
+ "target",
875
+ "loc"
876
+ ],
877
+ "additionalProperties": false
878
+ },
879
+ {
880
+ "type": "object",
881
+ "properties": {
882
+ "kind": {
883
+ "const": "cost"
884
+ },
885
+ "maxUsdPerMonth": {
886
+ "type": "number"
887
+ },
888
+ "loc": {
889
+ "$ref": "#/$defs/loc"
890
+ }
891
+ },
892
+ "required": [
893
+ "kind",
894
+ "maxUsdPerMonth",
895
+ "loc"
896
+ ],
897
+ "additionalProperties": false
898
+ }
899
+ ]
900
+ },
901
+ "capacity": {
902
+ "type": "object",
903
+ "properties": {
904
+ "node": {
905
+ "type": "string"
906
+ },
907
+ "rps": {
908
+ "type": "number",
909
+ "description": "Requests per second per replica."
910
+ },
911
+ "latencyMs": {
912
+ "type": "number"
913
+ },
914
+ "availability": {
915
+ "type": "number",
916
+ "minimum": 0,
917
+ "maximum": 100
918
+ },
919
+ "costUsd": {
920
+ "type": "number",
921
+ "description": "Monthly cost per replica in USD."
922
+ },
923
+ "durable": {
924
+ "type": "boolean",
925
+ "description": "`durable` (true) or `volatile` (false)."
926
+ },
927
+ "readRps": {
928
+ "type": "number",
929
+ "description": "`reads`: read requests per second per replica."
930
+ },
931
+ "writeRps": {
932
+ "type": "number",
933
+ "description": "`writes`: write requests per second per replica."
934
+ },
935
+ "shards": {
936
+ "type": "integer",
937
+ "minimum": 1,
938
+ "description": "Write capacity of single-primary stores scales with shards."
939
+ },
940
+ "consistency": {
941
+ "enum": [
942
+ "strong",
943
+ "eventual"
944
+ ]
945
+ },
946
+ "bandwidthMBps": {
947
+ "type": "number",
948
+ "exclusiveMinimum": 0,
949
+ "description": "`bandwidth`: megabytes per second per replica."
950
+ },
951
+ "egressUsdPerGb": {
952
+ "type": "number",
953
+ "minimum": 0,
954
+ "description": "`egress`: price of data leaving the node, in USD per GB."
955
+ },
956
+ "loc": {
957
+ "$ref": "#/$defs/loc"
958
+ }
959
+ },
960
+ "required": [
961
+ "node",
962
+ "loc"
963
+ ],
964
+ "additionalProperties": false
965
+ },
966
+ "entity": {
967
+ "type": "object",
968
+ "properties": {
969
+ "name": {
970
+ "type": "string"
971
+ },
972
+ "store": {
973
+ "type": "string",
974
+ "description": "Id of the node the entity lives in."
975
+ },
976
+ "description": {
977
+ "type": "string"
978
+ },
979
+ "fields": {
980
+ "type": "array",
981
+ "items": {
982
+ "type": "object",
983
+ "properties": {
984
+ "name": {
985
+ "type": "string"
986
+ },
987
+ "type": {
988
+ "type": "string"
989
+ },
990
+ "flags": {
991
+ "type": "array",
992
+ "items": {
993
+ "enum": [
994
+ "key",
995
+ "index",
996
+ "unique",
997
+ "optional"
998
+ ]
999
+ }
1000
+ }
1001
+ },
1002
+ "required": [
1003
+ "name",
1004
+ "type",
1005
+ "flags"
1006
+ ],
1007
+ "additionalProperties": false
1008
+ }
1009
+ },
1010
+ "loc": {
1011
+ "$ref": "#/$defs/loc"
1012
+ }
1013
+ },
1014
+ "required": [
1015
+ "name",
1016
+ "fields",
1017
+ "loc"
1018
+ ],
1019
+ "additionalProperties": false
1020
+ },
1021
+ "decision": {
1022
+ "type": "object",
1023
+ "properties": {
1024
+ "title": {
1025
+ "type": "string"
1026
+ },
1027
+ "because": {
1028
+ "type": "string"
1029
+ },
1030
+ "rejected": {
1031
+ "type": "array",
1032
+ "items": {
1033
+ "type": "object",
1034
+ "properties": {
1035
+ "option": {
1036
+ "type": "string"
1037
+ },
1038
+ "reason": {
1039
+ "type": "string"
1040
+ }
1041
+ },
1042
+ "required": [
1043
+ "option",
1044
+ "reason"
1045
+ ],
1046
+ "additionalProperties": false
1047
+ }
1048
+ },
1049
+ "loc": {
1050
+ "$ref": "#/$defs/loc"
1051
+ }
1052
+ },
1053
+ "required": [
1054
+ "title",
1055
+ "rejected",
1056
+ "loc"
1057
+ ],
1058
+ "additionalProperties": false
1059
+ },
1060
+ "test": {
1061
+ "type": "object",
1062
+ "properties": {
1063
+ "name": {
1064
+ "type": "string"
1065
+ },
1066
+ "assertions": {
1067
+ "type": "array",
1068
+ "items": {
1069
+ "$ref": "#/$defs/assertion"
1070
+ }
1071
+ },
1072
+ "loc": {
1073
+ "$ref": "#/$defs/loc"
1074
+ }
1075
+ },
1076
+ "required": [
1077
+ "name",
1078
+ "assertions",
1079
+ "loc"
1080
+ ],
1081
+ "additionalProperties": false
1082
+ },
1083
+ "assertion": {
1084
+ "description": "One assertion line of a test.",
1085
+ "oneOf": [
1086
+ {
1087
+ "type": "object",
1088
+ "properties": {
1089
+ "kind": {
1090
+ "const": "calls"
1091
+ },
1092
+ "useCase": {
1093
+ "type": "string"
1094
+ },
1095
+ "scenario": {
1096
+ "type": "string"
1097
+ },
1098
+ "target": {
1099
+ "$ref": "#/$defs/selector"
1100
+ },
1101
+ "quantifier": {
1102
+ "enum": [
1103
+ "some",
1104
+ "every",
1105
+ "never"
1106
+ ]
1107
+ },
1108
+ "loc": {
1109
+ "$ref": "#/$defs/loc"
1110
+ }
1111
+ },
1112
+ "required": [
1113
+ "kind",
1114
+ "useCase",
1115
+ "target",
1116
+ "quantifier",
1117
+ "loc"
1118
+ ],
1119
+ "additionalProperties": false
1120
+ },
1121
+ {
1122
+ "type": "object",
1123
+ "properties": {
1124
+ "kind": {
1125
+ "const": "before"
1126
+ },
1127
+ "useCase": {
1128
+ "type": "string"
1129
+ },
1130
+ "scenario": {
1131
+ "type": "string"
1132
+ },
1133
+ "first": {
1134
+ "$ref": "#/$defs/selector"
1135
+ },
1136
+ "then": {
1137
+ "$ref": "#/$defs/selector"
1138
+ },
1139
+ "loc": {
1140
+ "$ref": "#/$defs/loc"
1141
+ }
1142
+ },
1143
+ "required": [
1144
+ "kind",
1145
+ "useCase",
1146
+ "first",
1147
+ "then",
1148
+ "loc"
1149
+ ],
1150
+ "additionalProperties": false
1151
+ },
1152
+ {
1153
+ "type": "object",
1154
+ "properties": {
1155
+ "kind": {
1156
+ "const": "writesBeforeResponding"
1157
+ },
1158
+ "useCase": {
1159
+ "type": "string"
1160
+ },
1161
+ "scenario": {
1162
+ "type": "string"
1163
+ },
1164
+ "target": {
1165
+ "$ref": "#/$defs/selector"
1166
+ },
1167
+ "loc": {
1168
+ "$ref": "#/$defs/loc"
1169
+ }
1170
+ },
1171
+ "required": [
1172
+ "kind",
1173
+ "useCase",
1174
+ "target",
1175
+ "loc"
1176
+ ],
1177
+ "additionalProperties": false
1178
+ },
1179
+ {
1180
+ "type": "object",
1181
+ "properties": {
1182
+ "kind": {
1183
+ "const": "responds"
1184
+ },
1185
+ "useCase": {
1186
+ "type": "string"
1187
+ },
1188
+ "scenario": {
1189
+ "type": "string"
1190
+ },
1191
+ "status": {
1192
+ "type": "string",
1193
+ "pattern": "^[1-5](\\d\\d|xx)$"
1194
+ },
1195
+ "loc": {
1196
+ "$ref": "#/$defs/loc"
1197
+ }
1198
+ },
1199
+ "required": [
1200
+ "kind",
1201
+ "useCase",
1202
+ "status",
1203
+ "loc"
1204
+ ],
1205
+ "additionalProperties": false
1206
+ },
1207
+ {
1208
+ "type": "object",
1209
+ "properties": {
1210
+ "kind": {
1211
+ "const": "hasScenario"
1212
+ },
1213
+ "useCase": {
1214
+ "type": "string"
1215
+ },
1216
+ "scenario": {
1217
+ "type": "string"
1218
+ },
1219
+ "loc": {
1220
+ "$ref": "#/$defs/loc"
1221
+ }
1222
+ },
1223
+ "required": [
1224
+ "kind",
1225
+ "useCase",
1226
+ "scenario",
1227
+ "loc"
1228
+ ],
1229
+ "additionalProperties": false
1230
+ },
1231
+ {
1232
+ "type": "object",
1233
+ "properties": {
1234
+ "kind": {
1235
+ "const": "handlesFailure"
1236
+ },
1237
+ "useCase": {
1238
+ "type": "string"
1239
+ },
1240
+ "target": {
1241
+ "$ref": "#/$defs/selector"
1242
+ },
1243
+ "loc": {
1244
+ "$ref": "#/$defs/loc"
1245
+ }
1246
+ },
1247
+ "required": [
1248
+ "kind",
1249
+ "useCase",
1250
+ "target",
1251
+ "loc"
1252
+ ],
1253
+ "additionalProperties": false
1254
+ },
1255
+ {
1256
+ "type": "object",
1257
+ "properties": {
1258
+ "kind": {
1259
+ "const": "noPath"
1260
+ },
1261
+ "from": {
1262
+ "$ref": "#/$defs/selector"
1263
+ },
1264
+ "to": {
1265
+ "$ref": "#/$defs/selector"
1266
+ },
1267
+ "loc": {
1268
+ "$ref": "#/$defs/loc"
1269
+ }
1270
+ },
1271
+ "required": [
1272
+ "kind",
1273
+ "from",
1274
+ "to",
1275
+ "loc"
1276
+ ],
1277
+ "additionalProperties": false
1278
+ },
1279
+ {
1280
+ "type": "object",
1281
+ "properties": {
1282
+ "kind": {
1283
+ "const": "replicas"
1284
+ },
1285
+ "target": {
1286
+ "$ref": "#/$defs/selector"
1287
+ },
1288
+ "min": {
1289
+ "type": "integer",
1290
+ "minimum": 1
1291
+ },
1292
+ "loc": {
1293
+ "$ref": "#/$defs/loc"
1294
+ }
1295
+ },
1296
+ "required": [
1297
+ "kind",
1298
+ "target",
1299
+ "min",
1300
+ "loc"
1301
+ ],
1302
+ "additionalProperties": false
1303
+ },
1304
+ {
1305
+ "type": "object",
1306
+ "properties": {
1307
+ "kind": {
1308
+ "const": "neverWaits"
1309
+ },
1310
+ "useCase": {
1311
+ "type": "string"
1312
+ },
1313
+ "scenario": {
1314
+ "type": "string"
1315
+ },
1316
+ "target": {
1317
+ "$ref": "#/$defs/selector"
1318
+ },
1319
+ "loc": {
1320
+ "$ref": "#/$defs/loc"
1321
+ }
1322
+ },
1323
+ "required": [
1324
+ "kind",
1325
+ "useCase",
1326
+ "target",
1327
+ "loc"
1328
+ ],
1329
+ "additionalProperties": false
1330
+ },
1331
+ {
1332
+ "type": "object",
1333
+ "properties": {
1334
+ "kind": {
1335
+ "const": "after"
1336
+ },
1337
+ "useCase": {
1338
+ "type": "string"
1339
+ },
1340
+ "scenario": {
1341
+ "type": "string"
1342
+ },
1343
+ "target": {
1344
+ "$ref": "#/$defs/selector"
1345
+ },
1346
+ "after": {
1347
+ "$ref": "#/$defs/selector"
1348
+ },
1349
+ "loc": {
1350
+ "$ref": "#/$defs/loc"
1351
+ }
1352
+ },
1353
+ "required": [
1354
+ "kind",
1355
+ "useCase",
1356
+ "target",
1357
+ "after",
1358
+ "loc"
1359
+ ],
1360
+ "additionalProperties": false
1361
+ },
1362
+ {
1363
+ "type": "object",
1364
+ "properties": {
1365
+ "kind": {
1366
+ "const": "senderCalls"
1367
+ },
1368
+ "useCase": {
1369
+ "type": "string"
1370
+ },
1371
+ "from": {
1372
+ "$ref": "#/$defs/selector"
1373
+ },
1374
+ "to": {
1375
+ "$ref": "#/$defs/selector"
1376
+ },
1377
+ "quantifier": {
1378
+ "enum": [
1379
+ "some",
1380
+ "never"
1381
+ ]
1382
+ },
1383
+ "loc": {
1384
+ "$ref": "#/$defs/loc"
1385
+ }
1386
+ },
1387
+ "required": [
1388
+ "kind",
1389
+ "from",
1390
+ "to",
1391
+ "quantifier",
1392
+ "loc"
1393
+ ],
1394
+ "additionalProperties": false
1395
+ },
1396
+ {
1397
+ "type": "object",
1398
+ "properties": {
1399
+ "kind": {
1400
+ "const": "startsAt"
1401
+ },
1402
+ "useCase": {
1403
+ "type": "string"
1404
+ },
1405
+ "target": {
1406
+ "$ref": "#/$defs/selector"
1407
+ },
1408
+ "loc": {
1409
+ "$ref": "#/$defs/loc"
1410
+ }
1411
+ },
1412
+ "required": [
1413
+ "kind",
1414
+ "useCase",
1415
+ "target",
1416
+ "loc"
1417
+ ],
1418
+ "additionalProperties": false
1419
+ }
1420
+ ]
563
1421
  }
564
1422
  }
565
1423
  }