proschi 0.2.0 → 0.3.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
  }
@@ -560,6 +611,611 @@
560
611
  "loc"
561
612
  ],
562
613
  "additionalProperties": false
614
+ },
615
+ "selector": {
616
+ "description": "A node id, an exact tech stack, or every node of a kind (`any cache`).",
617
+ "oneOf": [
618
+ {
619
+ "type": "object",
620
+ "properties": {
621
+ "node": {
622
+ "type": "string"
623
+ }
624
+ },
625
+ "required": [
626
+ "node"
627
+ ],
628
+ "additionalProperties": false
629
+ },
630
+ {
631
+ "type": "object",
632
+ "properties": {
633
+ "tech": {
634
+ "type": "string"
635
+ }
636
+ },
637
+ "required": [
638
+ "tech"
639
+ ],
640
+ "additionalProperties": false
641
+ },
642
+ {
643
+ "type": "object",
644
+ "properties": {
645
+ "kind": {
646
+ "enum": [
647
+ "client",
648
+ "edge",
649
+ "service",
650
+ "function",
651
+ "cache",
652
+ "database",
653
+ "search",
654
+ "analytics",
655
+ "queue",
656
+ "storage",
657
+ "external",
658
+ "other"
659
+ ]
660
+ }
661
+ },
662
+ "required": [
663
+ "kind"
664
+ ],
665
+ "additionalProperties": false
666
+ }
667
+ ]
668
+ },
669
+ "traffic": {
670
+ "type": "object",
671
+ "properties": {
672
+ "useCase": {
673
+ "type": "string"
674
+ },
675
+ "rps": {
676
+ "type": "number",
677
+ "minimum": 0,
678
+ "description": "Requests per second."
679
+ },
680
+ "mix": {
681
+ "type": "array",
682
+ "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.",
683
+ "items": {
684
+ "type": "object",
685
+ "properties": {
686
+ "scenario": {
687
+ "type": "string",
688
+ "description": "Full scenario name, e.g. `A › B`."
689
+ },
690
+ "share": {
691
+ "type": "number",
692
+ "minimum": 0,
693
+ "maximum": 1
694
+ }
695
+ },
696
+ "required": [
697
+ "scenario",
698
+ "share"
699
+ ],
700
+ "additionalProperties": false
701
+ }
702
+ },
703
+ "loc": {
704
+ "$ref": "#/$defs/loc"
705
+ }
706
+ },
707
+ "required": [
708
+ "useCase",
709
+ "rps",
710
+ "loc"
711
+ ],
712
+ "additionalProperties": false
713
+ },
714
+ "requirement": {
715
+ "oneOf": [
716
+ {
717
+ "type": "object",
718
+ "properties": {
719
+ "kind": {
720
+ "const": "latency"
721
+ },
722
+ "percentile": {
723
+ "enum": [
724
+ 50,
725
+ 90,
726
+ 95,
727
+ 99,
728
+ 99.9
729
+ ]
730
+ },
731
+ "useCase": {
732
+ "type": "string",
733
+ "description": "Left out: every use case with traffic."
734
+ },
735
+ "maxMs": {
736
+ "type": "number"
737
+ },
738
+ "loc": {
739
+ "$ref": "#/$defs/loc"
740
+ }
741
+ },
742
+ "required": [
743
+ "kind",
744
+ "percentile",
745
+ "maxMs",
746
+ "loc"
747
+ ],
748
+ "additionalProperties": false
749
+ },
750
+ {
751
+ "type": "object",
752
+ "properties": {
753
+ "kind": {
754
+ "const": "availability"
755
+ },
756
+ "useCase": {
757
+ "type": "string"
758
+ },
759
+ "minPercent": {
760
+ "type": "number",
761
+ "minimum": 0,
762
+ "maximum": 100
763
+ },
764
+ "loc": {
765
+ "$ref": "#/$defs/loc"
766
+ }
767
+ },
768
+ "required": [
769
+ "kind",
770
+ "minPercent",
771
+ "loc"
772
+ ],
773
+ "additionalProperties": false
774
+ },
775
+ {
776
+ "type": "object",
777
+ "properties": {
778
+ "kind": {
779
+ "const": "durable"
780
+ },
781
+ "useCase": {
782
+ "type": "string"
783
+ },
784
+ "loc": {
785
+ "$ref": "#/$defs/loc"
786
+ }
787
+ },
788
+ "required": [
789
+ "kind",
790
+ "useCase",
791
+ "loc"
792
+ ],
793
+ "additionalProperties": false
794
+ },
795
+ {
796
+ "type": "object",
797
+ "properties": {
798
+ "kind": {
799
+ "const": "survive"
800
+ },
801
+ "target": {
802
+ "oneOf": [
803
+ {
804
+ "const": "any"
805
+ },
806
+ {
807
+ "$ref": "#/$defs/selector"
808
+ }
809
+ ]
810
+ },
811
+ "loc": {
812
+ "$ref": "#/$defs/loc"
813
+ }
814
+ },
815
+ "required": [
816
+ "kind",
817
+ "target",
818
+ "loc"
819
+ ],
820
+ "additionalProperties": false
821
+ },
822
+ {
823
+ "type": "object",
824
+ "properties": {
825
+ "kind": {
826
+ "const": "cost"
827
+ },
828
+ "maxUsdPerMonth": {
829
+ "type": "number"
830
+ },
831
+ "loc": {
832
+ "$ref": "#/$defs/loc"
833
+ }
834
+ },
835
+ "required": [
836
+ "kind",
837
+ "maxUsdPerMonth",
838
+ "loc"
839
+ ],
840
+ "additionalProperties": false
841
+ }
842
+ ]
843
+ },
844
+ "capacity": {
845
+ "type": "object",
846
+ "properties": {
847
+ "node": {
848
+ "type": "string"
849
+ },
850
+ "rps": {
851
+ "type": "number",
852
+ "description": "Requests per second per replica."
853
+ },
854
+ "latencyMs": {
855
+ "type": "number"
856
+ },
857
+ "availability": {
858
+ "type": "number",
859
+ "minimum": 0,
860
+ "maximum": 100
861
+ },
862
+ "costUsd": {
863
+ "type": "number",
864
+ "description": "Monthly cost per replica in USD."
865
+ },
866
+ "durable": {
867
+ "type": "boolean",
868
+ "description": "`durable` (true) or `volatile` (false)."
869
+ },
870
+ "loc": {
871
+ "$ref": "#/$defs/loc"
872
+ }
873
+ },
874
+ "required": [
875
+ "node",
876
+ "loc"
877
+ ],
878
+ "additionalProperties": false
879
+ },
880
+ "entity": {
881
+ "type": "object",
882
+ "properties": {
883
+ "name": {
884
+ "type": "string"
885
+ },
886
+ "store": {
887
+ "type": "string",
888
+ "description": "Id of the node the entity lives in."
889
+ },
890
+ "description": {
891
+ "type": "string"
892
+ },
893
+ "fields": {
894
+ "type": "array",
895
+ "items": {
896
+ "type": "object",
897
+ "properties": {
898
+ "name": {
899
+ "type": "string"
900
+ },
901
+ "type": {
902
+ "type": "string"
903
+ },
904
+ "flags": {
905
+ "type": "array",
906
+ "items": {
907
+ "enum": [
908
+ "key",
909
+ "index",
910
+ "unique",
911
+ "optional"
912
+ ]
913
+ }
914
+ }
915
+ },
916
+ "required": [
917
+ "name",
918
+ "type",
919
+ "flags"
920
+ ],
921
+ "additionalProperties": false
922
+ }
923
+ },
924
+ "loc": {
925
+ "$ref": "#/$defs/loc"
926
+ }
927
+ },
928
+ "required": [
929
+ "name",
930
+ "fields",
931
+ "loc"
932
+ ],
933
+ "additionalProperties": false
934
+ },
935
+ "decision": {
936
+ "type": "object",
937
+ "properties": {
938
+ "title": {
939
+ "type": "string"
940
+ },
941
+ "because": {
942
+ "type": "string"
943
+ },
944
+ "rejected": {
945
+ "type": "array",
946
+ "items": {
947
+ "type": "object",
948
+ "properties": {
949
+ "option": {
950
+ "type": "string"
951
+ },
952
+ "reason": {
953
+ "type": "string"
954
+ }
955
+ },
956
+ "required": [
957
+ "option",
958
+ "reason"
959
+ ],
960
+ "additionalProperties": false
961
+ }
962
+ },
963
+ "loc": {
964
+ "$ref": "#/$defs/loc"
965
+ }
966
+ },
967
+ "required": [
968
+ "title",
969
+ "rejected",
970
+ "loc"
971
+ ],
972
+ "additionalProperties": false
973
+ },
974
+ "test": {
975
+ "type": "object",
976
+ "properties": {
977
+ "name": {
978
+ "type": "string"
979
+ },
980
+ "assertions": {
981
+ "type": "array",
982
+ "items": {
983
+ "$ref": "#/$defs/assertion"
984
+ }
985
+ },
986
+ "loc": {
987
+ "$ref": "#/$defs/loc"
988
+ }
989
+ },
990
+ "required": [
991
+ "name",
992
+ "assertions",
993
+ "loc"
994
+ ],
995
+ "additionalProperties": false
996
+ },
997
+ "assertion": {
998
+ "description": "One assertion line of a test.",
999
+ "oneOf": [
1000
+ {
1001
+ "type": "object",
1002
+ "properties": {
1003
+ "kind": {
1004
+ "const": "calls"
1005
+ },
1006
+ "useCase": {
1007
+ "type": "string"
1008
+ },
1009
+ "scenario": {
1010
+ "type": "string"
1011
+ },
1012
+ "target": {
1013
+ "$ref": "#/$defs/selector"
1014
+ },
1015
+ "quantifier": {
1016
+ "enum": [
1017
+ "some",
1018
+ "every",
1019
+ "never"
1020
+ ]
1021
+ },
1022
+ "loc": {
1023
+ "$ref": "#/$defs/loc"
1024
+ }
1025
+ },
1026
+ "required": [
1027
+ "kind",
1028
+ "useCase",
1029
+ "target",
1030
+ "quantifier",
1031
+ "loc"
1032
+ ],
1033
+ "additionalProperties": false
1034
+ },
1035
+ {
1036
+ "type": "object",
1037
+ "properties": {
1038
+ "kind": {
1039
+ "const": "before"
1040
+ },
1041
+ "useCase": {
1042
+ "type": "string"
1043
+ },
1044
+ "scenario": {
1045
+ "type": "string"
1046
+ },
1047
+ "first": {
1048
+ "$ref": "#/$defs/selector"
1049
+ },
1050
+ "then": {
1051
+ "$ref": "#/$defs/selector"
1052
+ },
1053
+ "loc": {
1054
+ "$ref": "#/$defs/loc"
1055
+ }
1056
+ },
1057
+ "required": [
1058
+ "kind",
1059
+ "useCase",
1060
+ "first",
1061
+ "then",
1062
+ "loc"
1063
+ ],
1064
+ "additionalProperties": false
1065
+ },
1066
+ {
1067
+ "type": "object",
1068
+ "properties": {
1069
+ "kind": {
1070
+ "const": "writesBeforeResponding"
1071
+ },
1072
+ "useCase": {
1073
+ "type": "string"
1074
+ },
1075
+ "scenario": {
1076
+ "type": "string"
1077
+ },
1078
+ "target": {
1079
+ "$ref": "#/$defs/selector"
1080
+ },
1081
+ "loc": {
1082
+ "$ref": "#/$defs/loc"
1083
+ }
1084
+ },
1085
+ "required": [
1086
+ "kind",
1087
+ "useCase",
1088
+ "target",
1089
+ "loc"
1090
+ ],
1091
+ "additionalProperties": false
1092
+ },
1093
+ {
1094
+ "type": "object",
1095
+ "properties": {
1096
+ "kind": {
1097
+ "const": "responds"
1098
+ },
1099
+ "useCase": {
1100
+ "type": "string"
1101
+ },
1102
+ "scenario": {
1103
+ "type": "string"
1104
+ },
1105
+ "status": {
1106
+ "type": "string",
1107
+ "pattern": "^[1-5](\\d\\d|xx)$"
1108
+ },
1109
+ "loc": {
1110
+ "$ref": "#/$defs/loc"
1111
+ }
1112
+ },
1113
+ "required": [
1114
+ "kind",
1115
+ "useCase",
1116
+ "status",
1117
+ "loc"
1118
+ ],
1119
+ "additionalProperties": false
1120
+ },
1121
+ {
1122
+ "type": "object",
1123
+ "properties": {
1124
+ "kind": {
1125
+ "const": "hasScenario"
1126
+ },
1127
+ "useCase": {
1128
+ "type": "string"
1129
+ },
1130
+ "scenario": {
1131
+ "type": "string"
1132
+ },
1133
+ "loc": {
1134
+ "$ref": "#/$defs/loc"
1135
+ }
1136
+ },
1137
+ "required": [
1138
+ "kind",
1139
+ "useCase",
1140
+ "scenario",
1141
+ "loc"
1142
+ ],
1143
+ "additionalProperties": false
1144
+ },
1145
+ {
1146
+ "type": "object",
1147
+ "properties": {
1148
+ "kind": {
1149
+ "const": "handlesFailure"
1150
+ },
1151
+ "useCase": {
1152
+ "type": "string"
1153
+ },
1154
+ "target": {
1155
+ "$ref": "#/$defs/selector"
1156
+ },
1157
+ "loc": {
1158
+ "$ref": "#/$defs/loc"
1159
+ }
1160
+ },
1161
+ "required": [
1162
+ "kind",
1163
+ "useCase",
1164
+ "target",
1165
+ "loc"
1166
+ ],
1167
+ "additionalProperties": false
1168
+ },
1169
+ {
1170
+ "type": "object",
1171
+ "properties": {
1172
+ "kind": {
1173
+ "const": "noPath"
1174
+ },
1175
+ "from": {
1176
+ "$ref": "#/$defs/selector"
1177
+ },
1178
+ "to": {
1179
+ "$ref": "#/$defs/selector"
1180
+ },
1181
+ "loc": {
1182
+ "$ref": "#/$defs/loc"
1183
+ }
1184
+ },
1185
+ "required": [
1186
+ "kind",
1187
+ "from",
1188
+ "to",
1189
+ "loc"
1190
+ ],
1191
+ "additionalProperties": false
1192
+ },
1193
+ {
1194
+ "type": "object",
1195
+ "properties": {
1196
+ "kind": {
1197
+ "const": "replicas"
1198
+ },
1199
+ "target": {
1200
+ "$ref": "#/$defs/selector"
1201
+ },
1202
+ "min": {
1203
+ "type": "integer",
1204
+ "minimum": 1
1205
+ },
1206
+ "loc": {
1207
+ "$ref": "#/$defs/loc"
1208
+ }
1209
+ },
1210
+ "required": [
1211
+ "kind",
1212
+ "target",
1213
+ "min",
1214
+ "loc"
1215
+ ],
1216
+ "additionalProperties": false
1217
+ }
1218
+ ]
563
1219
  }
564
1220
  }
565
1221
  }