@crvouga/atlas 0.8.0 → 0.10.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 (60) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/core/src/lint.js +6 -2
  3. package/dist/core/src/spec/types.d.ts +4 -1
  4. package/dist/playwright-reporter/src/evidence.d.ts +122 -0
  5. package/dist/playwright-reporter/src/evidence.js +327 -0
  6. package/dist/playwright-reporter/src/index.d.ts +114 -0
  7. package/dist/playwright-reporter/src/index.js +312 -0
  8. package/dist/reports/src/compose.js +7 -14
  9. package/dist/reports/src/recorded-specs.d.ts +33 -0
  10. package/dist/reports/src/recorded-specs.js +42 -0
  11. package/dist/reports/src/report-index.d.ts +6 -0
  12. package/dist/reports/src/report-index.js +14 -2
  13. package/dist/reports/src/test-catalog.d.ts +386 -0
  14. package/dist/reports/src/test-catalog.js +655 -0
  15. package/dist/schema/src/api.d.ts +585 -0
  16. package/dist/schema/src/api.js +105 -0
  17. package/dist/schema/src/spec.d.ts +2 -1
  18. package/dist/schema/src/spec.js +5 -2
  19. package/dist/server/src/app.js +82 -4
  20. package/dist/server/src/llms.js +14 -0
  21. package/dist/server/src/openapi.d.ts +1 -1
  22. package/dist/server/src/openapi.js +60 -3
  23. package/docs/agents.md +1 -0
  24. package/docs/integrating.md +1 -0
  25. package/docs/reference/core.md +7 -2
  26. package/docs/reference/http-api.md +134 -2
  27. package/docs/reference/playwright-reporter.md +332 -0
  28. package/docs/reference/reports.md +632 -0
  29. package/docs/reference/schema.md +58 -1
  30. package/docs/rich-evidence.md +198 -0
  31. package/docs/server.md +41 -0
  32. package/docs/statecharts.md +2 -1
  33. package/llms-full.txt +380 -3
  34. package/llms.txt +2 -0
  35. package/package.json +6 -1
  36. package/packages/schema/schemas/report-run.schema.json +251 -0
  37. package/packages/schema/schemas/report-runs.schema.json +177 -0
  38. package/packages/schema/schemas/state-node.schema.json +7 -0
  39. package/packages/schema/schemas/test-catalog.schema.json +1177 -0
  40. package/packages/schema/schemas/test-history.schema.json +696 -0
  41. package/packages/server/openapi.json +8676 -5351
  42. package/packages/visualizer/src/app/AppShell.tsx +7 -3
  43. package/packages/visualizer/src/app/router.tsx +26 -3
  44. package/packages/visualizer/src/components/Header.tsx +2 -2
  45. package/packages/visualizer/src/evidence/evidence-context.tsx +10 -1
  46. package/packages/visualizer/src/explorer/Explorer.tsx +433 -0
  47. package/packages/visualizer/src/explorer/ExplorerIndex.tsx +120 -0
  48. package/packages/visualizer/src/explorer/RunsView.tsx +164 -0
  49. package/packages/visualizer/src/explorer/TestDetail.tsx +214 -0
  50. package/packages/visualizer/src/explorer/catalog.tsx +274 -0
  51. package/packages/visualizer/src/explorer/explorer.module.css +1238 -0
  52. package/packages/visualizer/src/explorer/groups.test.ts +87 -0
  53. package/packages/visualizer/src/explorer/groups.ts +126 -0
  54. package/packages/visualizer/src/explorer/navigate.ts +36 -0
  55. package/packages/visualizer/src/explorer/parts.tsx +59 -0
  56. package/packages/visualizer/src/explorer/search.ts +97 -0
  57. package/packages/visualizer/src/find/Finder.tsx +2 -0
  58. package/packages/visualizer/src/find/corpus.ts +13 -6
  59. package/packages/visualizer/src/find/rank.ts +2 -0
  60. package/packages/visualizer/src/evidence/project-home.tsx +0 -45
@@ -798,3 +798,588 @@ export declare const ReportEventSchema: z.ZodObject<{
798
798
  }, z.core.$loose>;
799
799
  /** The data of the `ping` event: sent every `heartbeatSeconds`, so a quiet server is told apart from a dead connection. */
800
800
  export declare const PingEventSchema: z.ZodObject<{}, z.core.$loose>;
801
+ /** One recorded result of a test in the test catalog: when, where, how it went and how long it took, and where it came from. */
802
+ export declare const TestResultEntrySchema: z.ZodObject<{
803
+ at: z.ZodNumber;
804
+ status: z.ZodEnum<{
805
+ passed: "passed";
806
+ failed: "failed";
807
+ running: "running";
808
+ "not-run": "not-run";
809
+ }>;
810
+ durationMs: z.ZodNullable<z.ZodNumber>;
811
+ environment: z.ZodNullable<z.ZodString>;
812
+ producer: z.ZodString;
813
+ kind: z.ZodString;
814
+ parameters: z.ZodRecord<z.ZodString, z.ZodString>;
815
+ branch: z.ZodNullable<z.ZodString>;
816
+ sha: z.ZodNullable<z.ZodString>;
817
+ runUrl: z.ZodNullable<z.ZodString>;
818
+ run: z.ZodString;
819
+ layer: z.ZodString;
820
+ backend: z.ZodString;
821
+ detail: z.ZodString;
822
+ evidence: z.ZodOptional<z.ZodObject<{
823
+ attachments: z.ZodNumber;
824
+ steps: z.ZodNumber;
825
+ annotations: z.ZodNumber;
826
+ attempts: z.ZodNumber;
827
+ links: z.ZodNumber;
828
+ tags: z.ZodArray<z.ZodString>;
829
+ labels: z.ZodRecord<z.ZodString, z.ZodString>;
830
+ roles: z.ZodArray<z.ZodString>;
831
+ }, z.core.$loose>>;
832
+ }, z.core.$loose>;
833
+ /** One test of the catalog: what it is, its current result per environment, and how it has gone over its recorded history. */
834
+ export declare const TestSummarySchema: z.ZodObject<{
835
+ key: z.ZodString;
836
+ id: z.ZodString;
837
+ title: z.ZodString;
838
+ specPath: z.ZodNullable<z.ZodString>;
839
+ spec: z.ZodNullable<z.ZodObject<{
840
+ path: z.ZodString;
841
+ title: z.ZodString;
842
+ domain: z.ZodString;
843
+ kind: z.ZodString;
844
+ }, z.core.$loose>>;
845
+ status: z.ZodEnum<{
846
+ passed: "passed";
847
+ failed: "failed";
848
+ running: "running";
849
+ "not-run": "not-run";
850
+ }>;
851
+ environments: z.ZodArray<z.ZodString>;
852
+ producers: z.ZodArray<z.ZodString>;
853
+ outcomes: z.ZodArray<z.ZodObject<{
854
+ at: z.ZodNumber;
855
+ status: z.ZodEnum<{
856
+ passed: "passed";
857
+ failed: "failed";
858
+ running: "running";
859
+ "not-run": "not-run";
860
+ }>;
861
+ durationMs: z.ZodNullable<z.ZodNumber>;
862
+ environment: z.ZodNullable<z.ZodString>;
863
+ producer: z.ZodString;
864
+ kind: z.ZodString;
865
+ parameters: z.ZodRecord<z.ZodString, z.ZodString>;
866
+ branch: z.ZodNullable<z.ZodString>;
867
+ sha: z.ZodNullable<z.ZodString>;
868
+ runUrl: z.ZodNullable<z.ZodString>;
869
+ run: z.ZodString;
870
+ layer: z.ZodString;
871
+ backend: z.ZodString;
872
+ detail: z.ZodString;
873
+ evidence: z.ZodOptional<z.ZodObject<{
874
+ attachments: z.ZodNumber;
875
+ steps: z.ZodNumber;
876
+ annotations: z.ZodNumber;
877
+ attempts: z.ZodNumber;
878
+ links: z.ZodNumber;
879
+ tags: z.ZodArray<z.ZodString>;
880
+ labels: z.ZodRecord<z.ZodString, z.ZodString>;
881
+ roles: z.ZodArray<z.ZodString>;
882
+ }, z.core.$loose>>;
883
+ }, z.core.$loose>>;
884
+ stats: z.ZodObject<{
885
+ results: z.ZodNumber;
886
+ passed: z.ZodNumber;
887
+ failed: z.ZodNumber;
888
+ passRate: z.ZodNullable<z.ZodNumber>;
889
+ flaky: z.ZodBoolean;
890
+ flakyReason: z.ZodString;
891
+ flips: z.ZodNumber;
892
+ durations: z.ZodNullable<z.ZodObject<{
893
+ count: z.ZodNumber;
894
+ totalMs: z.ZodNumber;
895
+ avgMs: z.ZodNumber;
896
+ p50Ms: z.ZodNumber;
897
+ p95Ms: z.ZodNumber;
898
+ minMs: z.ZodNumber;
899
+ maxMs: z.ZodNumber;
900
+ lastMs: z.ZodNumber;
901
+ }, z.core.$loose>>;
902
+ firstSeenMs: z.ZodNullable<z.ZodNumber>;
903
+ lastSeenMs: z.ZodNullable<z.ZodNumber>;
904
+ lastPassedAtMs: z.ZodNullable<z.ZodNumber>;
905
+ lastFailedAtMs: z.ZodNullable<z.ZodNumber>;
906
+ runs: z.ZodNumber;
907
+ branches: z.ZodArray<z.ZodString>;
908
+ }, z.core.$loose>;
909
+ tags: z.ZodArray<z.ZodString>;
910
+ labels: z.ZodRecord<z.ZodString, z.ZodString>;
911
+ evidence: z.ZodObject<{
912
+ attachments: z.ZodNumber;
913
+ steps: z.ZodNumber;
914
+ attempts: z.ZodNumber;
915
+ roles: z.ZodArray<z.ZodString>;
916
+ }, z.core.$loose>;
917
+ lastRecordedAtMs: z.ZodNumber;
918
+ live: z.ZodBoolean;
919
+ }, z.core.$loose>;
920
+ /**
921
+ * `GET /api/reports/tests`: every test of the report with a summary, insights and facets. The summary and facets cover
922
+ * every test; `tests` is the page of those the query matched.
923
+ */
924
+ export declare const TestCatalogSchema: z.ZodObject<{
925
+ schemaVersion: z.ZodLiteral<1>;
926
+ version: z.ZodString;
927
+ generatedAtMs: z.ZodNumber;
928
+ summary: z.ZodObject<{
929
+ tests: z.ZodNumber;
930
+ counts: z.ZodRecord<z.ZodEnum<{
931
+ passed: "passed";
932
+ failed: "failed";
933
+ running: "running";
934
+ "not-run": "not-run";
935
+ }>, z.ZodNumber>;
936
+ outcomes: z.ZodNumber;
937
+ flaky: z.ZodNumber;
938
+ durations: z.ZodNullable<z.ZodObject<{
939
+ count: z.ZodNumber;
940
+ totalMs: z.ZodNumber;
941
+ avgMs: z.ZodNumber;
942
+ p50Ms: z.ZodNumber;
943
+ p95Ms: z.ZodNumber;
944
+ minMs: z.ZodNumber;
945
+ maxMs: z.ZodNumber;
946
+ lastMs: z.ZodNumber;
947
+ }, z.core.$loose>>;
948
+ measured: z.ZodNumber;
949
+ withAttachments: z.ZodNumber;
950
+ environments: z.ZodArray<z.ZodObject<{
951
+ name: z.ZodString;
952
+ tests: z.ZodNumber;
953
+ counts: z.ZodRecord<z.ZodEnum<{
954
+ passed: "passed";
955
+ failed: "failed";
956
+ running: "running";
957
+ "not-run": "not-run";
958
+ }>, z.ZodNumber>;
959
+ avgMs: z.ZodNullable<z.ZodNumber>;
960
+ }, z.core.$loose>>;
961
+ producers: z.ZodArray<z.ZodObject<{
962
+ name: z.ZodString;
963
+ tests: z.ZodNumber;
964
+ counts: z.ZodRecord<z.ZodEnum<{
965
+ passed: "passed";
966
+ failed: "failed";
967
+ running: "running";
968
+ "not-run": "not-run";
969
+ }>, z.ZodNumber>;
970
+ avgMs: z.ZodNullable<z.ZodNumber>;
971
+ }, z.core.$loose>>;
972
+ domains: z.ZodArray<z.ZodObject<{
973
+ name: z.ZodString;
974
+ tests: z.ZodNumber;
975
+ counts: z.ZodRecord<z.ZodEnum<{
976
+ passed: "passed";
977
+ failed: "failed";
978
+ running: "running";
979
+ "not-run": "not-run";
980
+ }>, z.ZodNumber>;
981
+ avgMs: z.ZodNullable<z.ZodNumber>;
982
+ }, z.core.$loose>>;
983
+ slowest: z.ZodArray<z.ZodObject<{
984
+ key: z.ZodString;
985
+ title: z.ZodString;
986
+ specPath: z.ZodNullable<z.ZodString>;
987
+ status: z.ZodEnum<{
988
+ passed: "passed";
989
+ failed: "failed";
990
+ running: "running";
991
+ "not-run": "not-run";
992
+ }>;
993
+ value: z.ZodNumber;
994
+ }, z.core.$loose>>;
995
+ flakiest: z.ZodArray<z.ZodObject<{
996
+ key: z.ZodString;
997
+ title: z.ZodString;
998
+ specPath: z.ZodNullable<z.ZodString>;
999
+ status: z.ZodEnum<{
1000
+ passed: "passed";
1001
+ failed: "failed";
1002
+ running: "running";
1003
+ "not-run": "not-run";
1004
+ }>;
1005
+ value: z.ZodNumber;
1006
+ }, z.core.$loose>>;
1007
+ failing: z.ZodArray<z.ZodObject<{
1008
+ key: z.ZodString;
1009
+ title: z.ZodString;
1010
+ specPath: z.ZodNullable<z.ZodString>;
1011
+ status: z.ZodEnum<{
1012
+ passed: "passed";
1013
+ failed: "failed";
1014
+ running: "running";
1015
+ "not-run": "not-run";
1016
+ }>;
1017
+ value: z.ZodNumber;
1018
+ }, z.core.$loose>>;
1019
+ runs: z.ZodNumber;
1020
+ lastRecordedAtMs: z.ZodNullable<z.ZodNumber>;
1021
+ history: z.ZodBoolean;
1022
+ }, z.core.$loose>;
1023
+ facets: z.ZodObject<{
1024
+ statuses: z.ZodArray<z.ZodObject<{
1025
+ value: z.ZodString;
1026
+ count: z.ZodNumber;
1027
+ }, z.core.$loose>>;
1028
+ environments: z.ZodArray<z.ZodObject<{
1029
+ value: z.ZodString;
1030
+ count: z.ZodNumber;
1031
+ }, z.core.$loose>>;
1032
+ producers: z.ZodArray<z.ZodObject<{
1033
+ value: z.ZodString;
1034
+ count: z.ZodNumber;
1035
+ }, z.core.$loose>>;
1036
+ domains: z.ZodArray<z.ZodObject<{
1037
+ value: z.ZodString;
1038
+ count: z.ZodNumber;
1039
+ }, z.core.$loose>>;
1040
+ specs: z.ZodArray<z.ZodObject<{
1041
+ path: z.ZodString;
1042
+ title: z.ZodString;
1043
+ domain: z.ZodString;
1044
+ kind: z.ZodString;
1045
+ tests: z.ZodNumber;
1046
+ counts: z.ZodRecord<z.ZodEnum<{
1047
+ passed: "passed";
1048
+ failed: "failed";
1049
+ running: "running";
1050
+ "not-run": "not-run";
1051
+ }>, z.ZodNumber>;
1052
+ }, z.core.$loose>>;
1053
+ tags: z.ZodArray<z.ZodObject<{
1054
+ value: z.ZodString;
1055
+ count: z.ZodNumber;
1056
+ }, z.core.$loose>>;
1057
+ branches: z.ZodArray<z.ZodObject<{
1058
+ value: z.ZodString;
1059
+ count: z.ZodNumber;
1060
+ }, z.core.$loose>>;
1061
+ labels: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
1062
+ value: z.ZodString;
1063
+ count: z.ZodNumber;
1064
+ }, z.core.$loose>>>;
1065
+ }, z.core.$loose>;
1066
+ total: z.ZodNumber;
1067
+ offset: z.ZodNumber;
1068
+ limit: z.ZodNumber;
1069
+ tests: z.ZodArray<z.ZodObject<{
1070
+ key: z.ZodString;
1071
+ id: z.ZodString;
1072
+ title: z.ZodString;
1073
+ specPath: z.ZodNullable<z.ZodString>;
1074
+ spec: z.ZodNullable<z.ZodObject<{
1075
+ path: z.ZodString;
1076
+ title: z.ZodString;
1077
+ domain: z.ZodString;
1078
+ kind: z.ZodString;
1079
+ }, z.core.$loose>>;
1080
+ status: z.ZodEnum<{
1081
+ passed: "passed";
1082
+ failed: "failed";
1083
+ running: "running";
1084
+ "not-run": "not-run";
1085
+ }>;
1086
+ environments: z.ZodArray<z.ZodString>;
1087
+ producers: z.ZodArray<z.ZodString>;
1088
+ outcomes: z.ZodArray<z.ZodObject<{
1089
+ at: z.ZodNumber;
1090
+ status: z.ZodEnum<{
1091
+ passed: "passed";
1092
+ failed: "failed";
1093
+ running: "running";
1094
+ "not-run": "not-run";
1095
+ }>;
1096
+ durationMs: z.ZodNullable<z.ZodNumber>;
1097
+ environment: z.ZodNullable<z.ZodString>;
1098
+ producer: z.ZodString;
1099
+ kind: z.ZodString;
1100
+ parameters: z.ZodRecord<z.ZodString, z.ZodString>;
1101
+ branch: z.ZodNullable<z.ZodString>;
1102
+ sha: z.ZodNullable<z.ZodString>;
1103
+ runUrl: z.ZodNullable<z.ZodString>;
1104
+ run: z.ZodString;
1105
+ layer: z.ZodString;
1106
+ backend: z.ZodString;
1107
+ detail: z.ZodString;
1108
+ evidence: z.ZodOptional<z.ZodObject<{
1109
+ attachments: z.ZodNumber;
1110
+ steps: z.ZodNumber;
1111
+ annotations: z.ZodNumber;
1112
+ attempts: z.ZodNumber;
1113
+ links: z.ZodNumber;
1114
+ tags: z.ZodArray<z.ZodString>;
1115
+ labels: z.ZodRecord<z.ZodString, z.ZodString>;
1116
+ roles: z.ZodArray<z.ZodString>;
1117
+ }, z.core.$loose>>;
1118
+ }, z.core.$loose>>;
1119
+ stats: z.ZodObject<{
1120
+ results: z.ZodNumber;
1121
+ passed: z.ZodNumber;
1122
+ failed: z.ZodNumber;
1123
+ passRate: z.ZodNullable<z.ZodNumber>;
1124
+ flaky: z.ZodBoolean;
1125
+ flakyReason: z.ZodString;
1126
+ flips: z.ZodNumber;
1127
+ durations: z.ZodNullable<z.ZodObject<{
1128
+ count: z.ZodNumber;
1129
+ totalMs: z.ZodNumber;
1130
+ avgMs: z.ZodNumber;
1131
+ p50Ms: z.ZodNumber;
1132
+ p95Ms: z.ZodNumber;
1133
+ minMs: z.ZodNumber;
1134
+ maxMs: z.ZodNumber;
1135
+ lastMs: z.ZodNumber;
1136
+ }, z.core.$loose>>;
1137
+ firstSeenMs: z.ZodNullable<z.ZodNumber>;
1138
+ lastSeenMs: z.ZodNullable<z.ZodNumber>;
1139
+ lastPassedAtMs: z.ZodNullable<z.ZodNumber>;
1140
+ lastFailedAtMs: z.ZodNullable<z.ZodNumber>;
1141
+ runs: z.ZodNumber;
1142
+ branches: z.ZodArray<z.ZodString>;
1143
+ }, z.core.$loose>;
1144
+ tags: z.ZodArray<z.ZodString>;
1145
+ labels: z.ZodRecord<z.ZodString, z.ZodString>;
1146
+ evidence: z.ZodObject<{
1147
+ attachments: z.ZodNumber;
1148
+ steps: z.ZodNumber;
1149
+ attempts: z.ZodNumber;
1150
+ roles: z.ZodArray<z.ZodString>;
1151
+ }, z.core.$loose>;
1152
+ lastRecordedAtMs: z.ZodNumber;
1153
+ live: z.ZodBoolean;
1154
+ }, z.core.$loose>>;
1155
+ }, z.core.$loose>;
1156
+ /** `GET /api/reports/tests/history`: one test and every result recorded for it (at most 100), newest first. */
1157
+ export declare const TestHistorySchema: z.ZodObject<{
1158
+ schemaVersion: z.ZodLiteral<1>;
1159
+ version: z.ZodString;
1160
+ test: z.ZodObject<{
1161
+ key: z.ZodString;
1162
+ id: z.ZodString;
1163
+ title: z.ZodString;
1164
+ specPath: z.ZodNullable<z.ZodString>;
1165
+ spec: z.ZodNullable<z.ZodObject<{
1166
+ path: z.ZodString;
1167
+ title: z.ZodString;
1168
+ domain: z.ZodString;
1169
+ kind: z.ZodString;
1170
+ }, z.core.$loose>>;
1171
+ status: z.ZodEnum<{
1172
+ passed: "passed";
1173
+ failed: "failed";
1174
+ running: "running";
1175
+ "not-run": "not-run";
1176
+ }>;
1177
+ environments: z.ZodArray<z.ZodString>;
1178
+ producers: z.ZodArray<z.ZodString>;
1179
+ outcomes: z.ZodArray<z.ZodObject<{
1180
+ at: z.ZodNumber;
1181
+ status: z.ZodEnum<{
1182
+ passed: "passed";
1183
+ failed: "failed";
1184
+ running: "running";
1185
+ "not-run": "not-run";
1186
+ }>;
1187
+ durationMs: z.ZodNullable<z.ZodNumber>;
1188
+ environment: z.ZodNullable<z.ZodString>;
1189
+ producer: z.ZodString;
1190
+ kind: z.ZodString;
1191
+ parameters: z.ZodRecord<z.ZodString, z.ZodString>;
1192
+ branch: z.ZodNullable<z.ZodString>;
1193
+ sha: z.ZodNullable<z.ZodString>;
1194
+ runUrl: z.ZodNullable<z.ZodString>;
1195
+ run: z.ZodString;
1196
+ layer: z.ZodString;
1197
+ backend: z.ZodString;
1198
+ detail: z.ZodString;
1199
+ evidence: z.ZodOptional<z.ZodObject<{
1200
+ attachments: z.ZodNumber;
1201
+ steps: z.ZodNumber;
1202
+ annotations: z.ZodNumber;
1203
+ attempts: z.ZodNumber;
1204
+ links: z.ZodNumber;
1205
+ tags: z.ZodArray<z.ZodString>;
1206
+ labels: z.ZodRecord<z.ZodString, z.ZodString>;
1207
+ roles: z.ZodArray<z.ZodString>;
1208
+ }, z.core.$loose>>;
1209
+ }, z.core.$loose>>;
1210
+ stats: z.ZodObject<{
1211
+ results: z.ZodNumber;
1212
+ passed: z.ZodNumber;
1213
+ failed: z.ZodNumber;
1214
+ passRate: z.ZodNullable<z.ZodNumber>;
1215
+ flaky: z.ZodBoolean;
1216
+ flakyReason: z.ZodString;
1217
+ flips: z.ZodNumber;
1218
+ durations: z.ZodNullable<z.ZodObject<{
1219
+ count: z.ZodNumber;
1220
+ totalMs: z.ZodNumber;
1221
+ avgMs: z.ZodNumber;
1222
+ p50Ms: z.ZodNumber;
1223
+ p95Ms: z.ZodNumber;
1224
+ minMs: z.ZodNumber;
1225
+ maxMs: z.ZodNumber;
1226
+ lastMs: z.ZodNumber;
1227
+ }, z.core.$loose>>;
1228
+ firstSeenMs: z.ZodNullable<z.ZodNumber>;
1229
+ lastSeenMs: z.ZodNullable<z.ZodNumber>;
1230
+ lastPassedAtMs: z.ZodNullable<z.ZodNumber>;
1231
+ lastFailedAtMs: z.ZodNullable<z.ZodNumber>;
1232
+ runs: z.ZodNumber;
1233
+ branches: z.ZodArray<z.ZodString>;
1234
+ }, z.core.$loose>;
1235
+ tags: z.ZodArray<z.ZodString>;
1236
+ labels: z.ZodRecord<z.ZodString, z.ZodString>;
1237
+ evidence: z.ZodObject<{
1238
+ attachments: z.ZodNumber;
1239
+ steps: z.ZodNumber;
1240
+ attempts: z.ZodNumber;
1241
+ roles: z.ZodArray<z.ZodString>;
1242
+ }, z.core.$loose>;
1243
+ lastRecordedAtMs: z.ZodNumber;
1244
+ live: z.ZodBoolean;
1245
+ }, z.core.$loose>;
1246
+ history: z.ZodArray<z.ZodObject<{
1247
+ at: z.ZodNumber;
1248
+ status: z.ZodEnum<{
1249
+ passed: "passed";
1250
+ failed: "failed";
1251
+ running: "running";
1252
+ "not-run": "not-run";
1253
+ }>;
1254
+ durationMs: z.ZodNullable<z.ZodNumber>;
1255
+ environment: z.ZodNullable<z.ZodString>;
1256
+ producer: z.ZodString;
1257
+ kind: z.ZodString;
1258
+ parameters: z.ZodRecord<z.ZodString, z.ZodString>;
1259
+ branch: z.ZodNullable<z.ZodString>;
1260
+ sha: z.ZodNullable<z.ZodString>;
1261
+ runUrl: z.ZodNullable<z.ZodString>;
1262
+ run: z.ZodString;
1263
+ layer: z.ZodString;
1264
+ backend: z.ZodString;
1265
+ detail: z.ZodString;
1266
+ evidence: z.ZodOptional<z.ZodObject<{
1267
+ attachments: z.ZodNumber;
1268
+ steps: z.ZodNumber;
1269
+ annotations: z.ZodNumber;
1270
+ attempts: z.ZodNumber;
1271
+ links: z.ZodNumber;
1272
+ tags: z.ZodArray<z.ZodString>;
1273
+ labels: z.ZodRecord<z.ZodString, z.ZodString>;
1274
+ roles: z.ZodArray<z.ZodString>;
1275
+ }, z.core.$loose>>;
1276
+ }, z.core.$loose>>;
1277
+ }, z.core.$loose>;
1278
+ /** A run: the layers that share a run URL (else a branch and commit), with what they recorded. */
1279
+ export declare const ReportRunSchema: z.ZodObject<{
1280
+ key: z.ZodString;
1281
+ runUrl: z.ZodNullable<z.ZodString>;
1282
+ branch: z.ZodNullable<z.ZodString>;
1283
+ sha: z.ZodNullable<z.ZodString>;
1284
+ startedAtMs: z.ZodNumber;
1285
+ endedAtMs: z.ZodNumber;
1286
+ spanMs: z.ZodNumber;
1287
+ producers: z.ZodArray<z.ZodString>;
1288
+ environments: z.ZodArray<z.ZodString>;
1289
+ layers: z.ZodNumber;
1290
+ tests: z.ZodNumber;
1291
+ counts: z.ZodRecord<z.ZodEnum<{
1292
+ passed: "passed";
1293
+ failed: "failed";
1294
+ running: "running";
1295
+ "not-run": "not-run";
1296
+ }>, z.ZodNumber>;
1297
+ totalDurationMs: z.ZodNullable<z.ZodNumber>;
1298
+ failing: z.ZodArray<z.ZodObject<{
1299
+ key: z.ZodString;
1300
+ title: z.ZodString;
1301
+ environment: z.ZodNullable<z.ZodString>;
1302
+ detail: z.ZodString;
1303
+ }, z.core.$loose>>;
1304
+ }, z.core.$loose>;
1305
+ /** `GET /api/reports/runs`: runs, newest first. */
1306
+ export declare const RunListSchema: z.ZodObject<{
1307
+ schemaVersion: z.ZodLiteral<1>;
1308
+ version: z.ZodString;
1309
+ total: z.ZodNumber;
1310
+ runs: z.ZodArray<z.ZodObject<{
1311
+ key: z.ZodString;
1312
+ runUrl: z.ZodNullable<z.ZodString>;
1313
+ branch: z.ZodNullable<z.ZodString>;
1314
+ sha: z.ZodNullable<z.ZodString>;
1315
+ startedAtMs: z.ZodNumber;
1316
+ endedAtMs: z.ZodNumber;
1317
+ spanMs: z.ZodNumber;
1318
+ producers: z.ZodArray<z.ZodString>;
1319
+ environments: z.ZodArray<z.ZodString>;
1320
+ layers: z.ZodNumber;
1321
+ tests: z.ZodNumber;
1322
+ counts: z.ZodRecord<z.ZodEnum<{
1323
+ passed: "passed";
1324
+ failed: "failed";
1325
+ running: "running";
1326
+ "not-run": "not-run";
1327
+ }>, z.ZodNumber>;
1328
+ totalDurationMs: z.ZodNullable<z.ZodNumber>;
1329
+ failing: z.ZodArray<z.ZodObject<{
1330
+ key: z.ZodString;
1331
+ title: z.ZodString;
1332
+ environment: z.ZodNullable<z.ZodString>;
1333
+ detail: z.ZodString;
1334
+ }, z.core.$loose>>;
1335
+ }, z.core.$loose>>;
1336
+ }, z.core.$loose>;
1337
+ /** `GET /api/reports/runs/detail`: one run and its last result for every test, environment and producer it recorded. */
1338
+ export declare const RunDetailSchema: z.ZodObject<{
1339
+ schemaVersion: z.ZodLiteral<1>;
1340
+ version: z.ZodString;
1341
+ run: z.ZodObject<{
1342
+ key: z.ZodString;
1343
+ runUrl: z.ZodNullable<z.ZodString>;
1344
+ branch: z.ZodNullable<z.ZodString>;
1345
+ sha: z.ZodNullable<z.ZodString>;
1346
+ startedAtMs: z.ZodNumber;
1347
+ endedAtMs: z.ZodNumber;
1348
+ spanMs: z.ZodNumber;
1349
+ producers: z.ZodArray<z.ZodString>;
1350
+ environments: z.ZodArray<z.ZodString>;
1351
+ layers: z.ZodNumber;
1352
+ tests: z.ZodNumber;
1353
+ counts: z.ZodRecord<z.ZodEnum<{
1354
+ passed: "passed";
1355
+ failed: "failed";
1356
+ running: "running";
1357
+ "not-run": "not-run";
1358
+ }>, z.ZodNumber>;
1359
+ totalDurationMs: z.ZodNullable<z.ZodNumber>;
1360
+ failing: z.ZodArray<z.ZodObject<{
1361
+ key: z.ZodString;
1362
+ title: z.ZodString;
1363
+ environment: z.ZodNullable<z.ZodString>;
1364
+ detail: z.ZodString;
1365
+ }, z.core.$loose>>;
1366
+ }, z.core.$loose>;
1367
+ results: z.ZodArray<z.ZodObject<{
1368
+ key: z.ZodString;
1369
+ id: z.ZodString;
1370
+ title: z.ZodString;
1371
+ specPath: z.ZodNullable<z.ZodString>;
1372
+ environment: z.ZodNullable<z.ZodString>;
1373
+ producer: z.ZodString;
1374
+ status: z.ZodEnum<{
1375
+ passed: "passed";
1376
+ failed: "failed";
1377
+ running: "running";
1378
+ "not-run": "not-run";
1379
+ }>;
1380
+ durationMs: z.ZodNullable<z.ZodNumber>;
1381
+ at: z.ZodNumber;
1382
+ layer: z.ZodString;
1383
+ detail: z.ZodString;
1384
+ }, z.core.$loose>>;
1385
+ }, z.core.$loose>;
@@ -199,3 +199,108 @@ export const ReportEventSchema = z.looseObject({
199
199
  });
200
200
  /** The data of the `ping` event: sent every `heartbeatSeconds`, so a quiet server is told apart from a dead connection. */
201
201
  export const PingEventSchema = z.looseObject({});
202
+ const StatusCountsSchema = z.record(EvidenceStatusSchema, z.number().int().nonnegative());
203
+ /** One recorded result of a test in the test catalog: when, where, how it went and how long it took, and where it came from. */
204
+ export const TestResultEntrySchema = z.looseObject({
205
+ at: z.number().describe('When it was recorded, epoch milliseconds'),
206
+ status: EvidenceStatusSchema,
207
+ durationMs: z.number().nullable().describe('How long it took, or null when the producer did not measure it'),
208
+ environment: z.string().nullable().describe('The client it checked, such as `desktop-web` or `ios`'),
209
+ producer: z.string(),
210
+ kind: z.string(),
211
+ parameters: z.record(z.string(), z.string()),
212
+ branch: z.string().nullable(),
213
+ sha: z.string().nullable(),
214
+ runUrl: z.string().nullable(),
215
+ run: z.string().describe('The key of the run it belongs to, as `GET /api/reports/runs` lists it'),
216
+ layer: z.string().describe('The id of the layer that recorded it'),
217
+ backend: z.string(),
218
+ detail: z.string().describe('Why it has its status, at most 500 characters'),
219
+ evidence: EvidenceSummarySchema.optional()
220
+ });
221
+ const DurationStatsSchema = z.looseObject({
222
+ count: z.number().int().nonnegative(), totalMs: z.number(), avgMs: z.number(), p50Ms: z.number(), p95Ms: z.number(), minMs: z.number(), maxMs: z.number(), lastMs: z.number()
223
+ });
224
+ const CatalogSpecSchema = z.looseObject({ path: z.string(), title: z.string(), domain: z.string(), kind: z.string() });
225
+ /** One test of the catalog: what it is, its current result per environment, and how it has gone over its recorded history. */
226
+ export const TestSummarySchema = z.looseObject({
227
+ key: z.string().describe('The test\'s identity, `JSON.stringify([specPath, id])`. Pass it to `/api/reports/tests/history?key=`'),
228
+ id: z.string(),
229
+ title: z.string(),
230
+ specPath: z.string().nullable(),
231
+ spec: CatalogSpecSchema.nullable().describe('The spec it belongs to: recorded by its layers, published in a spec set, or derived from the path'),
232
+ status: EvidenceStatusSchema.describe('The worst current result across environments: failed, then running, then not-run, then passed'),
233
+ environments: z.array(z.string()),
234
+ producers: z.array(z.string()),
235
+ outcomes: z.array(TestResultEntrySchema).describe('The current result per producer, environment and parameter set, newest first'),
236
+ stats: z.looseObject({
237
+ results: z.number().int().nonnegative(), passed: z.number().int().nonnegative(), failed: z.number().int().nonnegative(),
238
+ passRate: z.number().nullable().describe('passed / (passed + failed), or null with no completed result'),
239
+ flaky: z.boolean(), flakyReason: z.string(), flips: z.number().int().nonnegative(),
240
+ durations: DurationStatsSchema.nullable(),
241
+ firstSeenMs: z.number().nullable(), lastSeenMs: z.number().nullable(), lastPassedAtMs: z.number().nullable(), lastFailedAtMs: z.number().nullable(),
242
+ runs: z.number().int().nonnegative(), branches: z.array(z.string())
243
+ }),
244
+ tags: z.array(z.string()),
245
+ labels: z.record(z.string(), z.string()),
246
+ evidence: z.looseObject({ attachments: z.number().int().nonnegative(), steps: z.number().int().nonnegative(), attempts: z.number().int().nonnegative(), roles: z.array(z.string()) }),
247
+ lastRecordedAtMs: z.number(),
248
+ live: z.boolean()
249
+ });
250
+ const TestRefSchema = z.looseObject({ key: z.string(), title: z.string(), specPath: z.string().nullable(), status: EvidenceStatusSchema, value: z.number() });
251
+ const CatalogGroupSchema = z.looseObject({ name: z.string(), tests: z.number().int().nonnegative(), counts: StatusCountsSchema, avgMs: z.number().nullable() });
252
+ const FacetValueSchema = z.looseObject({ value: z.string(), count: z.number().int().nonnegative() });
253
+ /**
254
+ * `GET /api/reports/tests`: every test of the report with a summary, insights and facets. The summary and facets cover
255
+ * every test; `tests` is the page of those the query matched.
256
+ */
257
+ export const TestCatalogSchema = z.looseObject({
258
+ schemaVersion: z.literal(1),
259
+ version: z.string().describe('Changes whenever the report or its history does'),
260
+ generatedAtMs: z.number(),
261
+ summary: z.looseObject({
262
+ tests: z.number().int().nonnegative(), counts: StatusCountsSchema, outcomes: z.number().int().nonnegative(), flaky: z.number().int().nonnegative(),
263
+ durations: DurationStatsSchema.nullable(), measured: z.number().int().nonnegative(), withAttachments: z.number().int().nonnegative(),
264
+ environments: z.array(CatalogGroupSchema), producers: z.array(CatalogGroupSchema), domains: z.array(CatalogGroupSchema),
265
+ slowest: z.array(TestRefSchema), flakiest: z.array(TestRefSchema), failing: z.array(TestRefSchema),
266
+ runs: z.number().int().nonnegative(), lastRecordedAtMs: z.number().nullable(), history: z.boolean()
267
+ }),
268
+ facets: z.looseObject({
269
+ statuses: z.array(FacetValueSchema), environments: z.array(FacetValueSchema), producers: z.array(FacetValueSchema), domains: z.array(FacetValueSchema),
270
+ specs: z.array(CatalogSpecSchema.extend({ tests: z.number().int().nonnegative(), counts: StatusCountsSchema })),
271
+ tags: z.array(FacetValueSchema), branches: z.array(FacetValueSchema), labels: z.record(z.string(), z.array(FacetValueSchema))
272
+ }),
273
+ total: z.number().int().nonnegative().describe('Tests the query matched, before offset and limit'),
274
+ offset: z.number().int().nonnegative(),
275
+ limit: z.number().int().nonnegative(),
276
+ tests: z.array(TestSummarySchema)
277
+ });
278
+ /** `GET /api/reports/tests/history`: one test and every result recorded for it (at most 100), newest first. */
279
+ export const TestHistorySchema = z.looseObject({
280
+ schemaVersion: z.literal(1),
281
+ version: z.string(),
282
+ test: TestSummarySchema,
283
+ history: z.array(TestResultEntrySchema)
284
+ });
285
+ /** A run: the layers that share a run URL (else a branch and commit), with what they recorded. */
286
+ export const ReportRunSchema = z.looseObject({
287
+ key: z.string().describe('The run URL, or `branch@sha`. Pass it to `/api/reports/runs/detail?key=` or `/api/reports/tests?run=`'),
288
+ runUrl: z.string().nullable(), branch: z.string().nullable(), sha: z.string().nullable(),
289
+ startedAtMs: z.number(), endedAtMs: z.number(), spanMs: z.number(),
290
+ producers: z.array(z.string()), environments: z.array(z.string()),
291
+ layers: z.number().int().nonnegative(), tests: z.number().int().nonnegative(), counts: StatusCountsSchema,
292
+ totalDurationMs: z.number().nullable(),
293
+ failing: z.array(z.looseObject({ key: z.string(), title: z.string(), environment: z.string().nullable(), detail: z.string() }))
294
+ });
295
+ /** `GET /api/reports/runs`: runs, newest first. */
296
+ export const RunListSchema = z.looseObject({ schemaVersion: z.literal(1), version: z.string(), total: z.number().int().nonnegative(), runs: z.array(ReportRunSchema) });
297
+ /** `GET /api/reports/runs/detail`: one run and its last result for every test, environment and producer it recorded. */
298
+ export const RunDetailSchema = z.looseObject({
299
+ schemaVersion: z.literal(1),
300
+ version: z.string(),
301
+ run: ReportRunSchema,
302
+ results: z.array(z.looseObject({
303
+ key: z.string(), id: z.string(), title: z.string(), specPath: z.string().nullable(), environment: z.string().nullable(), producer: z.string(),
304
+ status: EvidenceStatusSchema, durationMs: z.number().nullable(), at: z.number(), layer: z.string(), detail: z.string()
305
+ }))
306
+ });