arvo-api 0.6.0

The types of Arvo's engine API, generated from its protobuf contract. Messages only, no transport, so it builds for WebAssembly.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
// This file is @generated by prost-build.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Strategy {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub label: ::prost::alloc::string::String,
    /// The resolution it runs at, e.g. "1d" or "5m".
    #[prost(string, tag = "3")]
    pub interval: ::prost::alloc::string::String,
    /// What the rule claims about how prices behave.
    #[prost(string, tag = "4")]
    pub premise: ::prost::alloc::string::String,
    /// True when the rule ranks instruments against each other and needs a set.
    #[prost(bool, tag = "5")]
    pub ranks_a_set: bool,
    /// Backtests one study runs: what a front end's progress indicator promises.
    #[prost(uint32, tag = "6")]
    pub backtests: u32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Strategies {
    #[prost(message, repeated, tag = "1")]
    pub strategies: ::prost::alloc::vec::Vec<Strategy>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FindingSummary {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// What was run, e.g. "study", "walk-forward" or "panel".
    #[prost(string, tag = "2")]
    pub kind: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub subject: ::prost::alloc::string::String,
    /// "Supported", "NotSupported" or "Inconclusive".
    #[prost(string, tag = "4")]
    pub verdict: ::prost::alloc::string::String,
    /// RFC 3339.
    #[prost(string, tag = "5")]
    pub recorded_at: ::prost::alloc::string::String,
    /// The agent or script that ran it; empty for a person.
    #[prost(string, tag = "6")]
    pub author: ::prost::alloc::string::String,
    /// Which rule or ruleset ran, by the name the picker shows. A ruleset is
    /// the file `rulesets/<name>.json` in the project.
    #[prost(string, tag = "7")]
    pub strategy: ::prost::alloc::string::String,
    /// The engine build that produced it (#189): the git commit, with `-dirty`
    /// when the tree had uncommitted changes, or `unknown` for a build made
    /// outside a checkout.
    #[prost(string, tag = "8")]
    pub code_commit: ::prost::alloc::string::String,
    /// The ruleset document's content hash at run time, when the strategy was
    /// a ruleset rather than a shipped rule; empty otherwise. A finding whose
    /// hash no longer matches the file is stale: the rule it measured is not
    /// the rule the file now holds.
    #[prost(string, tag = "9")]
    pub ruleset_hash: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Findings {
    #[prost(message, repeated, tag = "1")]
    pub findings: ::prost::alloc::vec::Vec<FindingSummary>,
    /// Records in the evidence store that could not be read.
    #[prost(uint32, tag = "2")]
    pub unreadable: u32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FindingId {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FindingIds {
    #[prost(string, repeated, tag = "1")]
    pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Advice {
    /// "blocking", "warning" or "note".
    #[prost(string, tag = "1")]
    pub severity: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub finding: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub action: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub evidence: ::prost::alloc::string::String,
}
/// One finding: the verdict and how far it may be read, before any number.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Finding {
    #[prost(message, optional, tag = "1")]
    pub summary: ::core::option::Option<FindingSummary>,
    /// A plain instruction on how far the verdict may be read. Read first.
    #[prost(string, tag = "2")]
    pub read_this_first: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "3")]
    pub reasons: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(message, repeated, tag = "4")]
    pub advice: ::prost::alloc::vec::Vec<Advice>,
    /// The numbers, which differ by kind: the search and the out-of-sample
    /// metrics for a study, the stitched record for a walk-forward, the pooled
    /// outcome for a panel. JSON, so a new number is not a new message.
    #[prost(string, tag = "5")]
    pub detail_json: ::prost::alloc::string::String,
    /// Files kept with the finding (#157).
    #[prost(message, repeated, tag = "6")]
    pub attachments: ::prost::alloc::vec::Vec<Attachment>,
}
/// One file kept with a finding: bytes stored once by content hash, listed
/// on the record.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Attachment {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub media_type: ::prost::alloc::string::String,
    /// blake3 of the bytes, hex.
    #[prost(string, tag = "3")]
    pub hash: ::prost::alloc::string::String,
    #[prost(uint64, tag = "4")]
    pub bytes: u64,
    /// RFC 3339.
    #[prost(string, tag = "5")]
    pub added_at: ::prost::alloc::string::String,
}
/// A file to keep with a finding the caller already recorded or ran.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AttachRequest {
    #[prost(string, tag = "1")]
    pub finding_id: ::prost::alloc::string::String,
    /// As the author names it: `report.md`, `equity.png`.
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    /// `text/markdown`, `image/png`; empty means application/octet-stream.
    #[prost(string, tag = "3")]
    pub media_type: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "4")]
    pub data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Attachments {
    #[prost(message, repeated, tag = "1")]
    pub attachments: ::prost::alloc::vec::Vec<Attachment>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AttachmentRef {
    #[prost(string, tag = "1")]
    pub finding_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub hash: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RunRequest {
    #[prost(string, tag = "1")]
    pub instrument: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub strategy: ::prost::alloc::string::String,
    /// Who is running this, e.g. "script:momentum-scan". Required: a run is
    /// saved as this author's and deflated against everything the author has
    /// run, so a script iterating until something passes does not make it pass.
    #[prost(string, tag = "3")]
    pub author: ::prost::alloc::string::String,
    /// Where in the author's code the call was made, as "path:line", so the
    /// workbench can put the finding's caveats against that line. Optional.
    #[prost(string, tag = "4")]
    pub origin: ::prost::alloc::string::String,
}
/// Bars, or the regimes read off them, over a window of the library (#195).
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BarsRequest {
    #[prost(string, tag = "1")]
    pub instrument: ::prost::alloc::string::String,
    /// "1day" when absent; "5minute" and the other minute steps where the
    /// library holds them.
    #[prost(string, optional, tag = "2")]
    pub interval: ::core::option::Option<::prost::alloc::string::String>,
    /// YYYY-MM-DD, inclusive. The library's whole range when absent.
    #[prost(string, optional, tag = "3")]
    pub from: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "4")]
    pub to: ::core::option::Option<::prost::alloc::string::String>,
    /// At most this many bars, from the end of the window. 60 when absent;
    /// never more than 2000. `StreamBars` ignores it and answers the whole
    /// window in messages of at most 2000 bars.
    #[prost(uint32, optional, tag = "5")]
    pub last: ::core::option::Option<u32>,
}
/// One indicator over a window of bars, as a rule would declare it.
///
/// The chart draws what a rule would see, so the declaration is the rule
/// language's own: the `indicators` entry of a rule file, as JSON, e.g.
/// `{"kind":"EMA","input":"close","period":20}` or
/// `{"kind":"MACD","fast":12,"slow":26,"signal":9,"line":"histogram"}`.
/// A period may name a parameter; `params` supplies it.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IndicatorRequest {
    #[prost(message, optional, tag = "1")]
    pub bars: ::core::option::Option<BarsRequest>,
    #[prost(string, tag = "2")]
    pub indicator: ::prost::alloc::string::String,
    #[prost(map = "string, double", tag = "3")]
    pub params: ::std::collections::HashMap<::prost::alloc::string::String, f64>,
}
/// The leaderboard's filter (#226). Empty is every finding.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RankRequest {
    /// The rule's name, as the finding recorded it.
    #[prost(string, optional, tag = "1")]
    pub rule: ::core::option::Option<::prost::alloc::string::String>,
    /// SYMBOL.VENUE.
    #[prost(string, optional, tag = "2")]
    pub instrument: ::core::option::Option<::prost::alloc::string::String>,
}
/// The review after the close (#217), by day.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReviewRequest {
    /// YYYY-MM-DD, UTC. Today when absent.
    #[prost(string, optional, tag = "1")]
    pub day: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StudyRequest {
    #[prost(string, tag = "1")]
    pub instrument: ::prost::alloc::string::String,
    /// A rule or ruleset name; the default rule when absent.
    #[prost(string, optional, tag = "2")]
    pub strategy: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BookRequest {
    #[prost(string, repeated, tag = "1")]
    pub instruments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "2")]
    pub strategy: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(uint32, optional, tag = "3")]
    pub max_concurrent_positions: ::core::option::Option<u32>,
    #[prost(uint32, optional, tag = "4")]
    pub max_per_sector: ::core::option::Option<u32>,
}
/// A panel over a universe (#227): a file under the project's universes/.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PanelRequest {
    #[prost(string, tag = "1")]
    pub universe: ::prost::alloc::string::String,
    /// The default rule when absent.
    #[prost(string, optional, tag = "2")]
    pub strategy: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SharedExperiment {
    /// The file's text, as the person pasted or opened it.
    #[prost(string, tag = "1")]
    pub text: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub instrument: ::prost::alloc::string::String,
}
/// One point of an equity curve. `at` is `YYYY-MM-DDTHH:MM:SS` or a date.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Point {
    #[prost(string, tag = "1")]
    pub at: ::prost::alloc::string::String,
    #[prost(double, tag = "2")]
    pub equity: f64,
}
/// One trade in a ledger: a round trip, or a position still open at the end
/// (empty `closed`, no `exit`).
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LedgerTrade {
    /// `SYMBOL.VENUE`; empty when it is the experiment's own instrument.
    #[prost(string, tag = "1")]
    pub instrument: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub opened: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub closed: ::prost::alloc::string::String,
    /// "long" or "short"; empty means long.
    #[prost(string, tag = "4")]
    pub direction: ::prost::alloc::string::String,
    #[prost(double, tag = "5")]
    pub quantity: f64,
    #[prost(double, tag = "6")]
    pub entry: f64,
    #[prost(double, optional, tag = "7")]
    pub exit: ::core::option::Option<f64>,
    #[prost(double, tag = "8")]
    pub pnl: f64,
    #[prost(double, tag = "9")]
    pub commission: f64,
    /// "signal", "stop", "halted", "expired" or "still_open"; empty means signal.
    #[prost(string, tag = "10")]
    pub exit_reason: ::prost::alloc::string::String,
    /// What the rule saw at entry (#190): the condition that fired, the value it
    /// was judged on, the regime it saw, and the quantity it asked the gate for.
    /// Absent on a trade recorded before the journal or opened by no rule.
    #[prost(string, optional, tag = "11")]
    pub rule: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(double, optional, tag = "12")]
    pub signal: ::core::option::Option<f64>,
    #[prost(string, optional, tag = "13")]
    pub regime: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(double, optional, tag = "14")]
    pub asked: ::core::option::Option<f64>,
}
/// Evidence an engine Arvo did not run computed (ADR-0026). What a run
/// produces, before anyone concludes anything from it; Arvo computes the
/// verdict. There is no field for a verdict, a metric or a p-value.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReportRequest {
    /// As RunRequest: who is recording this, and where in their code.
    #[prost(string, tag = "1")]
    pub author: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub origin: ::prost::alloc::string::String,
    /// The hypothesis: an id, and the claim in prose.
    #[prost(string, tag = "3")]
    pub hypothesis_id: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub claim: ::prost::alloc::string::String,
    /// The experiment as data.
    #[prost(string, tag = "5")]
    pub instrument: ::prost::alloc::string::String,
    /// ISO dates, inclusive.
    #[prost(string, tag = "6")]
    pub from: ::prost::alloc::string::String,
    #[prost(string, tag = "7")]
    pub to: ::prost::alloc::string::String,
    /// As arvo_data spells it: "1day", "5minute".
    #[prost(string, tag = "8")]
    pub interval: ::prost::alloc::string::String,
    /// The engine's own dataset: an id, and a content hash of what it read.
    #[prost(string, tag = "9")]
    pub dataset_id: ::prost::alloc::string::String,
    #[prost(string, tag = "10")]
    pub dataset_version: ::prost::alloc::string::String,
    /// "split" (the default) or "total_return".
    #[prost(string, tag = "11")]
    pub adjustment: ::prost::alloc::string::String,
    /// The engine's own strategy name, and its parameters.
    #[prost(string, tag = "12")]
    pub strategy: ::prost::alloc::string::String,
    #[prost(map = "string, double", tag = "13")]
    pub params: ::std::collections::HashMap<::prost::alloc::string::String, f64>,
    /// The cost model the run assumed.
    #[prost(double, tag = "14")]
    pub commission_bps: f64,
    #[prost(double, tag = "15")]
    pub slippage_bps: f64,
    #[prost(double, tag = "16")]
    pub per_fill: f64,
    /// The risk model, as far as the run assumed one.
    #[prost(double, optional, tag = "17")]
    pub stop_atr_multiple: ::core::option::Option<f64>,
    /// Zero means the curve's first point.
    #[prost(double, tag = "18")]
    pub starting_cash: f64,
    /// What computed this, by name and version.
    #[prost(string, tag = "19")]
    pub engine: ::prost::alloc::string::String,
    /// The evidence.
    #[prost(message, repeated, tag = "20")]
    pub strategy_curve: ::prost::alloc::vec::Vec<Point>,
    #[prost(message, repeated, tag = "21")]
    pub ledger: ::prost::alloc::vec::Vec<LedgerTrade>,
    /// Buy-and-hold over the same window and capital. Without it the finding
    /// is Inconclusive: a return with nothing to beat is not a result.
    #[prost(message, repeated, tag = "22")]
    pub benchmark_curve: ::prost::alloc::vec::Vec<Point>,
    /// How many trials the author's whole search has run (ADR-0014).
    #[prost(uint32, optional, tag = "23")]
    pub trials: ::core::option::Option<u32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReportFigure {
    #[prost(string, tag = "1")]
    pub finding_id: ::prost::alloc::string::String,
    /// The equity chart the front end captured, base64 PNG. Absent is a report
    /// with no figure, not an error: only a window can draw one.
    #[prost(string, optional, tag = "2")]
    pub figure: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradeExport {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The rows as the front end has them, in the order it is showing them. The
    /// engine does not derive these from the finding, because the sort order is
    /// the view's, and an export that silently differed from the table above it
    /// would be worse than none.
    #[prost(message, repeated, tag = "2")]
    pub rows: ::prost::alloc::vec::Vec<TradeRow>,
}
/// One round trip, as a trades table shows it and a CSV export writes it.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradeRow {
    /// Which instrument the round trip was in. Empty on an ordinary study,
    /// whose subject line already says; on a book it is the difference between
    /// a usable export and trades from three instruments with no way to tell
    /// them apart.
    #[prost(string, tag = "1")]
    pub instrument: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub opened: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub closed: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub direction: ::prost::alloc::string::String,
    #[prost(double, tag = "5")]
    pub quantity: f64,
    #[prost(double, tag = "6")]
    pub entry: f64,
    #[prost(double, optional, tag = "7")]
    pub exit: ::core::option::Option<f64>,
    #[prost(double, tag = "8")]
    pub pnl: f64,
    #[prost(double, tag = "9")]
    pub commission: f64,
    #[prost(double, optional, tag = "10")]
    pub held_days: ::core::option::Option<f64>,
    #[prost(string, tag = "11")]
    pub exit_reason: ::prost::alloc::string::String,
    /// What the rule saw at entry (#190): the condition that fired, the value it
    /// was judged on, the regime it saw, and the quantity it asked the gate for.
    /// Absent on a trade recorded before the journal or opened by no rule.
    #[prost(string, optional, tag = "12")]
    pub rule: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(double, optional, tag = "13")]
    pub signal: ::core::option::Option<f64>,
    #[prost(string, optional, tag = "14")]
    pub regime: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(double, optional, tag = "15")]
    pub asked: ::core::option::Option<f64>,
}
/// A ruleset parameter: one value fixes it, several search it.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Param {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(double, repeated, tag = "2")]
    pub values: ::prost::alloc::vec::Vec<f64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Fixed {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(double, tag = "2")]
    pub value: f64,
}
/// One file under `<project>`/rulesets/, as the picker sees it.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Ruleset {
    #[prost(string, tag = "1")]
    pub path: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub label: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub rule: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub interval: ::prost::alloc::string::String,
    #[prost(uint32, tag = "6")]
    pub searches: u32,
    /// Why it cannot be run, when it cannot.
    #[prost(string, optional, tag = "7")]
    pub problem: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Rulesets {
    #[prost(message, repeated, tag = "1")]
    pub rulesets: ::prost::alloc::vec::Vec<Ruleset>,
}
/// One file under `<project>`/rules/: a rule written as data (#225), as the
/// picker sees it.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RuleFile {
    #[prost(string, tag = "1")]
    pub path: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub label: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub premise: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub interval: ::prost::alloc::string::String,
    /// The indicators it declares, by name.
    #[prost(string, repeated, tag = "6")]
    pub indicators: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Defaults for the numbers a ruleset's grid may vary.
    #[prost(message, repeated, tag = "7")]
    pub params: ::prost::alloc::vec::Vec<Fixed>,
    /// The entry and exit conditions, read back as a sentence.
    #[prost(string, tag = "8")]
    pub entry: ::prost::alloc::string::String,
    #[prost(string, tag = "9")]
    pub exit: ::prost::alloc::string::String,
    /// The definition's content hash: what a finding on it is stamped with.
    #[prost(string, tag = "10")]
    pub version: ::prost::alloc::string::String,
    /// Why it cannot run, when it cannot. The rest of the fields are then empty.
    #[prost(string, optional, tag = "11")]
    pub problem: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RuleFiles {
    #[prost(message, repeated, tag = "1")]
    pub rules: ::prost::alloc::vec::Vec<RuleFile>,
}
/// A Pine v5 strategy to read as a rule (#228).
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PineScript {
    /// The script's text, as pasted or opened.
    #[prost(string, tag = "1")]
    pub text: ::prost::alloc::string::String,
    /// The resolution the rule will run at: Pine takes it from the chart, so
    /// it is not in the script. "1day" when absent.
    #[prost(string, optional, tag = "2")]
    pub interval: ::core::option::Option<::prost::alloc::string::String>,
}
/// What a script became (#228). Nothing is written: pass `rule` to WriteRule
/// to keep it, so reading a script and keeping it stay separate decisions.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PineTranslation {
    /// The rule it describes, as JSON: the shape WriteRule takes.
    #[prost(string, tag = "1")]
    pub rule: ::prost::alloc::string::String,
    /// Lines read and set aside because they change nothing the rule trades,
    /// each with why. Never silently dropped.
    #[prost(string, repeated, tag = "2")]
    pub ignored: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// The rule's name and what it reads, for a person who will not read JSON.
    #[prost(string, tag = "3")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub entry: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub exit: ::prost::alloc::string::String,
}
/// A rule as data (#225), as written: indicators by their TA-Lib names and
/// conditions in JSON Logic. The engine parses and checks it, so this carries
/// the file's text rather than a message per operator — a condition is a tree
/// of arbitrary depth and the protos would be a second grammar to keep in
/// step with the first.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RuleText {
    /// The definition's JSON, as a person or an agent wrote it.
    #[prost(string, tag = "1")]
    pub json: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RulesetPath {
    #[prost(string, tag = "1")]
    pub path: ::prost::alloc::string::String,
}
/// A grid ruleset's parts, for a form.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RulesetForm {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub rule: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub label: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub premise: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "5")]
    pub params: ::prost::alloc::vec::Vec<Param>,
}
/// A rule this build implements, with the search it ships.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Rule {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub label: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub premise: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub interval: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "5")]
    pub fixed: ::prost::alloc::vec::Vec<Fixed>,
    #[prost(message, repeated, tag = "6")]
    pub axes: ::prost::alloc::vec::Vec<Param>,
    #[prost(bool, tag = "7")]
    pub ranks_a_set: bool,
    #[prost(bool, tag = "8")]
    pub trades_options: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Rules {
    #[prost(message, repeated, tag = "1")]
    pub rules: ::prost::alloc::vec::Vec<Rule>,
}
/// The project's risk file (.arvo/risk.json), as read for the next study.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RiskModel {
    #[prost(string, tag = "1")]
    pub path: ::prost::alloc::string::String,
    #[prost(bool, tag = "2")]
    pub exists: bool,
    /// The model in force, as JSON: the file's when it reads, the shipped one
    /// when it does not.
    #[prost(string, tag = "3")]
    pub model_json: ::prost::alloc::string::String,
    /// Why the file was refused, when it was.
    #[prost(string, optional, tag = "4")]
    pub error: ::core::option::Option<::prost::alloc::string::String>,
}
/// The dividend bias, measured.
///
/// On split-adjusted prices no dividend is paid to anything in a backtest.
/// Both sides forgo them — but the benchmark held through every ex-date and a
/// rule in the market some of the time did not, so the margin between them is
/// overstated in the strategy's favour, and \[`Self::corrected_excess`\] takes it
/// off. On total-return prices the distributions are already in the returns and
/// the same measurement describes what the margin is made of instead.
/// A study's result after tax. See `arvo_research::tax` for what is modelled.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AfterTaxView {
    #[prost(double, tag = "1")]
    pub strategy_return: f64,
    #[prost(double, tag = "2")]
    pub benchmark_return: f64,
    /// `strategy_return - benchmark_return`: the margin a taxable account
    /// would actually have kept.
    #[prost(double, tag = "3")]
    pub excess: f64,
    #[prost(double, tag = "4")]
    pub strategy_tax: f64,
    #[prost(double, tag = "5")]
    pub benchmark_tax: f64,
    #[prost(double, tag = "6")]
    pub short_term_rate: f64,
    #[prost(double, tag = "7")]
    pub long_term_rate: f64,
}
/// What one account holding every member of a panel would have done.
///
/// The panel's pooled figures average its members. This combines them, which
/// is a different number in the place that matters: falls that did not
/// coincide hurt a book less than they hurt its average member.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BookView {
    #[prost(message, optional, tag = "1")]
    pub metrics: ::core::option::Option<MetricsView>,
    /// Mean member drawdown less the book's. Positive is diversification;
    /// zero or below means the members fell together and the panel was one bet.
    #[prost(double, tag = "2")]
    pub diversification: f64,
}
/// How much of a panel's apparent breadth is real.
///
/// The pooled statistics read as evidence in proportion to the instrument
/// count — three that agree feel like three times the confidence of one. They
/// are not, if the three moved together.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BreadthView {
    #[prost(string, repeated, tag = "1")]
    pub instruments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Square and symmetric. `None` where a pair had too little overlap to
    /// say — which is different from a correlation of zero.
    #[prost(message, repeated, tag = "2")]
    pub correlations: ::prost::alloc::vec::Vec<CorrelationRow>,
    #[prost(double, optional, tag = "3")]
    pub mean_correlation: ::core::option::Option<f64>,
    /// How many independent instruments the panel behaves like.
    #[prost(double, optional, tag = "4")]
    pub effective: ::core::option::Option<f64>,
    /// How much the pooled average's certainty is overstated by counting
    /// instruments instead of independent ones.
    #[prost(double, optional, tag = "5")]
    pub overstatement: ::core::option::Option<f64>,
}
/// One finding in a side-by-side comparison.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ComparisonRowView {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub subject: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub kind: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub strategy_name: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub verdict: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub recorded_at: ::prost::alloc::string::String,
    #[prost(double, tag = "7")]
    pub total_return: f64,
    #[prost(double, tag = "8")]
    pub excess_return: f64,
    #[prost(double, optional, tag = "9")]
    pub sharpe: ::core::option::Option<f64>,
    #[prost(double, tag = "10")]
    pub max_drawdown: f64,
    #[prost(uint32, tag = "11")]
    pub trades: u32,
    #[prost(double, optional, tag = "12")]
    pub win_rate: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "13")]
    pub profit_factor: ::core::option::Option<f64>,
    /// Whether the data behind it has changed since it was recorded.
    #[prost(bool, optional, tag = "14")]
    pub stale: ::core::option::Option<bool>,
}
/// Several findings, read against each other.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ComparisonView {
    #[prost(message, repeated, tag = "1")]
    pub rows: ::prost::alloc::vec::Vec<ComparisonRowView>,
    #[prost(message, repeated, tag = "2")]
    pub curves: ::prost::alloc::vec::Vec<NamedCurveView>,
    /// The best out-of-sample Sharpe among them, and the score the best of a
    /// comparison this size would be expected to reach with no skill at all.
    ///
    /// The point of the whole screen. Comparing six strategies and keeping the
    /// best one is a search of size six, and until now nothing counted it:
    /// each finding deflated the grid *inside* it and none of them knew about
    /// the other five.
    #[prost(double, optional, tag = "3")]
    pub best_sharpe: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "4")]
    pub expected_best_under_null: ::core::option::Option<f64>,
    #[prost(bool, tag = "5")]
    pub survived_deflation: bool,
    /// What is worth saying about the comparison itself.
    #[prost(string, repeated, tag = "6")]
    pub notes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// One row of a correlation matrix. A cell with no value is a pair with too
/// little overlap to say anything about, which is not the same as zero.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CorrelationRow {
    #[prost(message, repeated, tag = "1")]
    pub cells: ::prost::alloc::vec::Vec<OptionalDouble>,
}
/// One point on a curve, in the shape a chart library wants: an ISO date and
/// a value.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CurvePoint {
    /// Seconds since the epoch, not a date string.
    ///
    /// A date was enough while every curve was daily and is not once two
    /// points can share a day: the chart keys points by time, so an intraday
    /// series collapsed to dates loses every point but the last of each day.
    /// The previous version did exactly that, deliberately and with a comment
    /// saying so — this is what removing the limitation instead looks like.
    #[prost(int64, tag = "1")]
    pub time: i64,
    #[prost(double, tag = "2")]
    pub value: f64,
}
/// Where a replay first stopped matching the record.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DivergenceView {
    #[prost(string, tag = "1")]
    pub what: ::prost::alloc::string::String,
    #[prost(uint32, optional, tag = "2")]
    pub at: ::core::option::Option<u32>,
    #[prost(string, optional, tag = "3")]
    pub when: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(double, tag = "4")]
    pub recorded: f64,
    #[prost(double, tag = "5")]
    pub replayed: f64,
    /// Gap relative to the recorded value, so a report can separate a
    /// rounding difference from a different answer.
    #[prost(double, tag = "6")]
    pub relative: f64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DividendGapView {
    /// Distributions that went ex inside the window.
    ///
    /// Zero is a real answer and a good one: these instruments pay nothing, so
    /// the margin needs no correction.
    #[prost(uint32, tag = "1")]
    pub events: u32,
    #[prost(double, tag = "2")]
    pub strategy_income: f64,
    #[prost(double, tag = "3")]
    pub benchmark_income: f64,
    /// The gap as a fraction of starting capital, in the same units as the
    /// excess return it comes off.
    #[prost(double, tag = "4")]
    pub overstatement: f64,
    /// The excess return with the gap taken out, where taking it out means
    /// anything.
    ///
    /// `None` on a total-return dataset: the distributions are already in the
    /// excess return there, so subtracting the gap again would report a margin
    /// smaller than the account earned. The rest of this view still holds —
    /// only the subtraction stops being valid.
    #[prost(double, optional, tag = "5")]
    pub corrected_excess: ::core::option::Option<f64>,
    /// False when some instrument the run held has no distribution series, in
    /// which case the figure is a floor rather than the answer.
    #[prost(bool, tag = "6")]
    pub complete: bool,
    #[prost(uint32, tag = "7")]
    pub covered: u32,
    #[prost(uint32, tag = "8")]
    pub instruments: u32,
}
/// One fold of a walk-forward, flattened for display.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FoldView {
    #[prost(string, tag = "1")]
    pub chose_on: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub judged_on: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "3")]
    pub params: ::prost::alloc::vec::Vec<NamedNumber>,
    #[prost(double, tag = "4")]
    pub strategy_return: f64,
    #[prost(double, tag = "5")]
    pub benchmark_return: f64,
    #[prost(uint32, tag = "6")]
    pub trades: u32,
    /// Whether this fold's winner beat what a no-skill search of that size
    /// would produce. Per fold, because a procedure that selects noise in most
    /// periods has not been shown to select.
    #[prost(bool, tag = "7")]
    pub survived_deflation: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HistoryEntryView {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub kind: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub subject: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub verdict: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub recorded_at: ::prost::alloc::string::String,
    /// True when the data this was produced from no longer matches disk, or
    /// the ruleset it ran has changed since. `None` when the data it
    /// referenced can no longer be found at all.
    #[prost(bool, optional, tag = "6")]
    pub stale: ::core::option::Option<bool>,
    /// The agent that ran it, or `None` for a person. `default` for a view
    /// built before agents could run research.
    #[prost(string, optional, tag = "7")]
    pub agent: ::core::option::Option<::prost::alloc::string::String>,
    /// Where the agent's code asked for it, as `path:line`, when it said.
    #[prost(string, optional, tag = "8")]
    pub origin: ::core::option::Option<::prost::alloc::string::String>,
    /// The size of the search an agent's finding was held to.
    #[prost(uint32, optional, tag = "9")]
    pub trials: ::core::option::Option<u32>,
    /// How many files are kept with it (#157).
    #[prost(uint32, tag = "10")]
    pub attachments: u32,
    /// What produced it (#189): the engine build, and for a ruleset the
    /// document's hash at run time. Two findings from different versions of
    /// one ruleset are told apart by this.
    #[prost(string, tag = "11")]
    pub code_commit: ::prost::alloc::string::String,
    #[prost(string, tag = "12")]
    pub ruleset_hash: ::prost::alloc::string::String,
    /// Why `stale` is set: `data`, `ruleset`, or `data and ruleset`. Empty
    /// when fresh, and when the data is gone altogether.
    #[prost(string, tag = "13")]
    pub stale_reason: ::prost::alloc::string::String,
}
/// What the workbench shows before anything has been run.
/// Everything in research memory, and what could not be read of it.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HistoryView {
    #[prost(message, repeated, tag = "1")]
    pub entries: ::prost::alloc::vec::Vec<HistoryEntryView>,
    #[prost(message, repeated, tag = "2")]
    pub unreadable: ::prost::alloc::vec::Vec<UnreadableView>,
}
/// What one member of a book actually contributed.
///
/// A book reports one return for several instruments, and the single most
/// useful question about it is which of them produced that return. The panel
/// answers the same question by running members separately; a book cannot,
/// because the members interfere — so it has to be read out of the ledger.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberView {
    #[prost(string, tag = "1")]
    pub instrument: ::prost::alloc::string::String,
    #[prost(uint32, tag = "2")]
    pub trades: u32,
    /// Realised profit, net of what the venue charged.
    #[prost(double, tag = "3")]
    pub pnl: f64,
    /// This member's share of the book's total realised profit.
    ///
    /// `None` when the book realised nothing at all, rather than a share of
    /// zero — which would read as a measurement.
    #[prost(double, optional, tag = "4")]
    pub share: ::core::option::Option<f64>,
    /// True when the member never opened a position.
    ///
    /// The failure mode a shared account introduces: an instrument that was
    /// asked for, funded by nothing, and silently absent from every number.
    #[prost(bool, tag = "5")]
    pub silent: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MetricsView {
    #[prost(double, tag = "1")]
    pub total_return: f64,
    #[prost(double, tag = "2")]
    pub cagr: f64,
    #[prost(double, tag = "3")]
    pub max_drawdown: f64,
    #[prost(double, tag = "4")]
    pub volatility: f64,
    #[prost(double, optional, tag = "5")]
    pub sharpe: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "6")]
    pub sortino: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "7")]
    pub calmar: ::core::option::Option<f64>,
    /// Probability the true Sharpe is above zero, given the sample.
    ///
    /// The second number a Sharpe needs. 1.2 from forty returns and 1.2 from
    /// four thousand print identically and are not the same finding.
    #[prost(double, optional, tag = "8")]
    pub psr: ::core::option::Option<f64>,
    #[prost(uint32, tag = "9")]
    pub trades: u32,
}
/// One month of the strategy's return, for the heatmap.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MonthlyReturnView {
    #[prost(int32, tag = "1")]
    pub year: i32,
    #[prost(uint32, tag = "2")]
    pub month: u32,
    #[prost(double, tag = "3")]
    pub value: f64,
}
/// A named equity curve, for drawing several on one chart.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NamedCurveView {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "2")]
    pub points: ::prost::alloc::vec::Vec<CurvePoint>,
}
/// What a front end renders.
///
/// These are the shapes the engine answers with. They are here rather than
/// in a Rust crate both sides link so that the contract has no language in
/// it: a front end in any language generates these and reads a finding
/// natively (#127).
///
/// Generated once from the desktop's Rust, then maintained here. Field numbers are
/// the contract; add, never renumber.
/// A parameter and its value, in the order a run chose them. Ordered, so a
/// repeated field rather than a map.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NamedNumber {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(double, tag = "2")]
    pub value: f64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct OptionalDouble {
    #[prost(double, optional, tag = "1")]
    pub value: ::core::option::Option<f64>,
}
/// One instrument's out-of-sample outcome under the panel's configuration.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutcomeView {
    #[prost(string, tag = "1")]
    pub instrument: ::prost::alloc::string::String,
    #[prost(double, tag = "2")]
    pub strategy_return: f64,
    #[prost(double, tag = "3")]
    pub benchmark_return: f64,
    #[prost(double, tag = "4")]
    pub excess_return: f64,
    #[prost(double, tag = "5")]
    pub max_drawdown: f64,
    #[prost(uint32, tag = "6")]
    pub trades: u32,
}
/// A panel study, flattened for display.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PanelView {
    /// The stored finding this view came from, so the window can ask for
    /// something to be done to the record it is showing — a report composed
    /// from it, a file kept with it. Empty for a view that was never
    /// recorded. `default` because every view built before this had none.
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub verdict: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "3")]
    pub reasons: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(message, repeated, tag = "4")]
    pub recommendations: ::prost::alloc::vec::Vec<RecommendationView>,
    #[prost(uint32, tag = "5")]
    pub instruments: u32,
    #[prost(uint32, tag = "6")]
    pub total_trades: u32,
    #[prost(double, tag = "7")]
    pub mean_excess_return: f64,
    #[prost(uint32, tag = "8")]
    pub beat_benchmark: u32,
    #[prost(double, tag = "9")]
    pub mean_max_drawdown: f64,
    #[prost(message, optional, tag = "10")]
    pub breadth: ::core::option::Option<BreadthView>,
    #[prost(message, optional, tag = "11")]
    pub book: ::core::option::Option<BookView>,
    #[prost(double, tag = "12")]
    pub worst_max_drawdown: f64,
    #[prost(uint32, tag = "13")]
    pub trials: u32,
    #[prost(double, tag = "14")]
    pub best_sharpe: f64,
    #[prost(double, optional, tag = "15")]
    pub expected_best_under_null: ::core::option::Option<f64>,
    #[prost(bool, tag = "16")]
    pub survived_deflation: bool,
    #[prost(string, tag = "17")]
    pub in_sample: ::prost::alloc::string::String,
    #[prost(string, tag = "18")]
    pub out_of_sample: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "19")]
    pub selected_params: ::prost::alloc::vec::Vec<NamedNumber>,
    #[prost(message, repeated, tag = "20")]
    pub per_instrument: ::prost::alloc::vec::Vec<OutcomeView>,
    #[prost(string, repeated, tag = "21")]
    pub failures: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, tag = "22")]
    pub dataset_version: ::prost::alloc::string::String,
    #[prost(string, tag = "23")]
    pub strategy_name: ::prost::alloc::string::String,
    #[prost(double, tag = "24")]
    pub starting_cash: f64,
    #[prost(double, tag = "25")]
    pub commission_bps: f64,
    #[prost(double, tag = "26")]
    pub slippage_bps: f64,
    #[prost(string, tag = "27")]
    pub engine: ::prost::alloc::string::String,
    /// The universe this panel ran over (#227); empty for the whole library.
    #[prost(string, tag = "28")]
    pub universe: ::prost::alloc::string::String,
    /// What to keep in mind about it: the reason it was chosen, its size as a
    /// search, that membership is today's, members left out for want of data.
    #[prost(string, repeated, tag = "29")]
    pub notes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// One thing to do about a finding, flattened for display.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RecommendationView {
    #[prost(string, tag = "1")]
    pub severity: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub finding: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub action: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub evidence: ::prost::alloc::string::String,
}
/// A stored finding, reopened.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RecordView {
    #[prost(oneof = "record_view::Of", tags = "1, 2, 3, 4")]
    pub of: ::core::option::Option<record_view::Of>,
}
/// Nested message and enum types in `RecordView`.
pub mod record_view {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Of {
        #[prost(message, tag = "1")]
        Study(super::StudyView),
        #[prost(message, tag = "2")]
        Panel(super::PanelView),
        #[prost(message, tag = "3")]
        Walkforward(super::WalkForwardView),
        #[prost(message, tag = "4")]
        Reported(super::ReportedView),
    }
}
/// What came back from re-running a stored finding.
///
/// A finding whose numbers cannot be regenerated is not evidence, so this is
/// the check the whole evidence store rests on.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplayView {
    /// `reproduced`, `data-changed`, `engine-changed`, `diverged`,
    /// `not-replayable` or `failed`. A slug so the window can style it
    /// without parsing prose.
    #[prost(string, tag = "1")]
    pub outcome: ::prost::alloc::string::String,
    /// Whether the finding still stands. Only a clean reproduction counts:
    /// changed data or a changed engine leaves the claim untested, which is
    /// not the same as confirmed.
    #[prost(bool, tag = "2")]
    pub holds: bool,
    #[prost(string, tag = "3")]
    pub detail: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "4")]
    pub divergence: ::core::option::Option<DivergenceView>,
}
/// A finding an engine Arvo did not run computed, judged by Arvo
/// (ADR-0026). Shown as what it is: the numbers and the verdict, and where
/// the data lives.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReportedView {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub hypothesis: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub claim: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub instrument: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub engine: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub from: ::prost::alloc::string::String,
    #[prost(string, tag = "7")]
    pub to: ::prost::alloc::string::String,
    #[prost(string, tag = "8")]
    pub interval: ::prost::alloc::string::String,
    /// `id@version`: the engine's own dataset, not in Arvo's library.
    #[prost(string, tag = "9")]
    pub dataset: ::prost::alloc::string::String,
    #[prost(string, tag = "10")]
    pub strategy: ::prost::alloc::string::String,
    #[prost(string, tag = "11")]
    pub verdict: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "12")]
    pub reasons: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(uint32, tag = "13")]
    pub trades: u32,
    #[prost(uint32, optional, tag = "14")]
    pub trials: ::core::option::Option<u32>,
    /// Absent when there was no benchmark to judge against.
    #[prost(double, optional, tag = "15")]
    pub total_return: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "16")]
    pub excess_return: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "17")]
    pub sharpe: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "18")]
    pub max_drawdown: ::core::option::Option<f64>,
    #[prost(string, tag = "19")]
    pub recorded_at: ::prost::alloc::string::String,
    #[prost(string, tag = "20")]
    pub author: ::prost::alloc::string::String,
    /// The files kept with it: a report, a figure, the trades (#157).
    #[prost(message, repeated, tag = "21")]
    pub attachments: ::prost::alloc::vec::Vec<Attachment>,
}
/// How much one parameter moved across the folds.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StabilityView {
    #[prost(string, tag = "1")]
    pub axis: ::prost::alloc::string::String,
    #[prost(uint32, tag = "2")]
    pub distinct: u32,
    #[prost(double, tag = "3")]
    pub modal: f64,
    #[prost(double, tag = "4")]
    pub modal_share: f64,
}
/// The full result of a study, flattened for display.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StudyView {
    /// The stored finding this view came from, so the window can ask for
    /// something to be done to the record it is showing — a report composed
    /// from it, a file kept with it. Empty for a view that was never
    /// recorded. `default` because every view built before this had none.
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub instrument: ::prost::alloc::string::String,
    /// Every instrument the run held, head first.
    ///
    /// One entry is an ordinary study. More than one is a book: the same rule
    /// on several instruments settling against a single account, where a
    /// position one member takes is capital another cannot have.
    ///
    /// `default` because this is a persisted format — a finding recorded
    /// before a run could hold more than one loads as what it was.
    #[prost(string, repeated, tag = "3")]
    pub instruments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// What each member of a book contributed. Empty for a single study.
    #[prost(message, repeated, tag = "4")]
    pub members: ::prost::alloc::vec::Vec<MemberView>,
    #[prost(string, tag = "5")]
    pub verdict: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "6")]
    pub reasons: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(uint32, tag = "7")]
    pub trials: u32,
    /// Configurations tried elsewhere before a shared experiment arrived,
    /// counted into the bar. `default`: a view built before sharing had none.
    #[prost(uint32, tag = "8")]
    pub prior_trials: u32,
    #[prost(double, tag = "9")]
    pub best_sharpe: f64,
    #[prost(double, optional, tag = "10")]
    pub expected_best_under_null: ::core::option::Option<f64>,
    #[prost(bool, tag = "11")]
    pub survived_deflation: bool,
    /// Every configuration the search tried, not only the one it picked.
    #[prost(message, optional, tag = "12")]
    pub surface: ::core::option::Option<SurfaceView>,
    #[prost(string, tag = "13")]
    pub in_sample: ::prost::alloc::string::String,
    #[prost(string, tag = "14")]
    pub out_of_sample: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "15")]
    pub selected_params: ::prost::alloc::vec::Vec<NamedNumber>,
    #[prost(message, optional, tag = "16")]
    pub strategy: ::core::option::Option<MetricsView>,
    #[prost(message, optional, tag = "17")]
    pub benchmark: ::core::option::Option<MetricsView>,
    /// Uncorrected. \[`Self::dividend_gap`\] sits beside it rather than being
    /// folded in: a number silently adjusted by something the reader cannot see
    /// is what this platform exists to stop.
    #[prost(double, tag = "18")]
    pub excess_return: f64,
    /// How much of that margin is the dividend bias rather than skill.
    ///
    /// `None` means it was never measured — no distribution series is held for
    /// these instruments. The bias is real either way; only its size is
    /// unknown, and `recommendations` says so.
    #[prost(message, optional, tag = "19")]
    pub dividend_gap: ::core::option::Option<DividendGapView>,
    /// Both sides after capital-gains tax at stated rates, sold at the end
    /// (#26). Beside the excess return for the same reason as the dividend
    /// gap. `None` when the curves are too short to tax.
    #[prost(message, optional, tag = "20")]
    pub after_tax: ::core::option::Option<AfterTaxView>,
    /// The two curves behind the numbers. A table says a strategy returned
    /// less than the market; a chart says whether it did so steadily or lost
    /// it all in one month, and those are different findings.
    #[prost(message, repeated, tag = "21")]
    pub strategy_curve: ::prost::alloc::vec::Vec<CurvePoint>,
    #[prost(message, repeated, tag = "22")]
    pub benchmark_curve: ::prost::alloc::vec::Vec<CurvePoint>,
    /// The instrument's own bars over the judged period, with every entry and
    /// exit marked on them.
    ///
    /// The view that shows what the rule *did* rather than what it added up
    /// to. A summary cannot say the entries all landed on three days, or that
    /// every winner came out of one gap; this says it at a glance.
    #[prost(message, repeated, tag = "23")]
    pub price: ::prost::alloc::vec::Vec<CandlePoint>,
    #[prost(message, repeated, tag = "24")]
    pub markers: ::prost::alloc::vec::Vec<TradeMarkerView>,
    /// The rest of a book's instruments, each with its own bars and its own
    /// trades. Empty for a single study.
    ///
    /// The head instrument is deliberately *not* repeated here — it is already
    /// \[`Self::price`\] and \[`Self::markers`\] above. The shape mirrors
    /// `Experiment.alongside`, which is head plus the rest for the same reason:
    /// carrying the head twice would put a third of a three-member book's
    /// candles on the wire for nothing.
    #[prost(message, repeated, tag = "25")]
    pub alongside_charts: ::prost::alloc::vec::Vec<InstrumentChartView>,
    /// Depth below the running peak, as a percentage.
    #[prost(message, repeated, tag = "26")]
    pub underwater: ::prost::alloc::vec::Vec<CurvePoint>,
    /// What is wrong with the bars this was produced from.
    #[prost(message, repeated, tag = "27")]
    pub data_findings: ::prost::alloc::vec::Vec<
        super::super::market::v1::DataFindingView,
    >,
    /// Every round trip, so nobody has to take the summary on trust.
    #[prost(message, repeated, tag = "28")]
    pub trades: ::prost::alloc::vec::Vec<TradeRowView>,
    /// Month-by-month, so a total return can be read as steady or as one
    /// lucky quarter. Derived from the same curve, not a second measurement.
    #[prost(message, repeated, tag = "29")]
    pub monthly: ::prost::alloc::vec::Vec<MonthlyReturnView>,
    /// The round trips behind the return, and what they cost.
    #[prost(message, optional, tag = "30")]
    pub trades_detail: ::core::option::Option<TradesView>,
    /// What to do about this finding, most stopping first.
    ///
    /// Derived on read rather than stored, so a finding pulled out of memory
    /// is read against today's rules rather than the ones in force when it
    /// was recorded.
    #[prost(message, repeated, tag = "31")]
    pub recommendations: ::prost::alloc::vec::Vec<RecommendationView>,
    /// The dataset this result was produced from, as a content hash. Compared
    /// against the live one to decide whether the result is still current.
    #[prost(string, tag = "32")]
    pub dataset_version: ::prost::alloc::string::String,
    #[prost(string, tag = "33")]
    pub strategy_name: ::prost::alloc::string::String,
    #[prost(double, tag = "34")]
    pub starting_cash: f64,
    #[prost(double, tag = "35")]
    pub commission_bps: f64,
    #[prost(double, tag = "36")]
    pub slippage_bps: f64,
    #[prost(string, tag = "37")]
    pub engine: ::prost::alloc::string::String,
}
/// One configuration's cell on the search surface.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SurfaceCell {
    #[prost(double, tag = "1")]
    pub x: f64,
    #[prost(double, tag = "2")]
    pub y: f64,
    #[prost(double, tag = "3")]
    pub sharpe: f64,
    /// Whether this is the configuration that was chosen.
    #[prost(bool, tag = "4")]
    pub selected: bool,
    /// Whether it beat what a no-skill search of this size would produce.
    ///
    /// The distinction the whole chart is drawn around. A cell below the bar
    /// is not a weak result, it is *not a result* — a score a coin-flipping
    /// search of the same size would have been expected to reach anyway.
    #[prost(bool, tag = "5")]
    pub above_null: bool,
}
/// The in-sample score of every configuration the search tried.
///
/// # Why this exists at all
///
/// Reporting only the winner shows two completely different situations
/// identically: a broad region of configurations that all scored well, which
/// suggests something real and robust to the exact parameters; and one bright
/// cell surrounded by nothing, which is what fitting noise looks like from
/// above. The verdict machinery already deflates for the *size* of the search;
/// this is the part a person has to look at.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SurfaceView {
    /// The two axes drawn, by name.
    #[prost(string, tag = "1")]
    pub x_axis: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub y_axis: ::prost::alloc::string::String,
    #[prost(double, repeated, tag = "3")]
    pub x_values: ::prost::alloc::vec::Vec<f64>,
    #[prost(double, repeated, tag = "4")]
    pub y_values: ::prost::alloc::vec::Vec<f64>,
    #[prost(message, repeated, tag = "5")]
    pub cells: ::prost::alloc::vec::Vec<SurfaceCell>,
    /// The bar a cell has to clear to be worth anything. `None` when there
    /// were too few trials to say.
    #[prost(double, optional, tag = "6")]
    pub null_bar: ::core::option::Option<f64>,
    #[prost(double, tag = "7")]
    pub best: f64,
    /// Axes not drawn, because a surface has two dimensions and a grid may
    /// have more. Named so nobody reads the chart as the whole search.
    #[prost(string, repeated, tag = "8")]
    pub collapsed: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Where a trade happened, to be drawn on the price.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TradeMarkerView {
    #[prost(int64, tag = "1")]
    pub time: i64,
    /// `entry` or `exit`; the chart decides shape and side from it.
    #[prost(string, tag = "2")]
    pub kind: ::prost::alloc::string::String,
    /// `stop` or `signal` for an exit, so a stop-out is visually distinct
    /// from a rule that chose to leave. Empty for an entry.
    #[prost(string, tag = "3")]
    pub reason: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub label: ::prost::alloc::string::String,
}
/// One round trip, as a table row.
///
/// Every field the ledger holds, because the point of a table is that nobody
/// has to decide in advance which column someone will want to sort by. The
/// aggregate statistics above it answer "how did it do"; this answers "what
/// did it actually do", and those are different questions with different
/// failure modes — an expectancy of +£300 built from one +£9,000 trade and
/// nineteen losses is a fact only the rows show.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradeRowView {
    /// Which instrument this round trip was in.
    ///
    /// Empty for a run recorded before the ledger named instruments, and for
    /// an ordinary single-instrument study where the subject line already
    /// says it. Only a book shows the column.
    #[prost(string, tag = "1")]
    pub instrument: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub opened: ::prost::alloc::string::String,
    /// Empty while the position is still open at the end of the run.
    #[prost(string, tag = "3")]
    pub closed: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub direction: ::prost::alloc::string::String,
    #[prost(double, tag = "5")]
    pub quantity: f64,
    #[prost(double, tag = "6")]
    pub entry: f64,
    /// `None` while still open, so the table shows a gap rather than a price
    /// nobody traded at.
    #[prost(double, optional, tag = "7")]
    pub exit: ::core::option::Option<f64>,
    #[prost(double, tag = "8")]
    pub pnl: f64,
    #[prost(double, tag = "9")]
    pub commission: f64,
    /// Days held. Fractional, because an intraday trade held forty minutes is
    /// not "0 days" — it is 0.03, and rounding it away would make every
    /// intraday ledger look like a column of zeroes.
    #[prost(double, optional, tag = "10")]
    pub held_days: ::core::option::Option<f64>,
    /// `signal`, `stop`, or `open`.
    #[prost(string, tag = "11")]
    pub exit_reason: ::prost::alloc::string::String,
    /// What the rule saw at entry (#190): the condition that fired, the value it
    /// was judged on, the regime it saw, and the quantity it asked the gate for.
    /// Absent on a trade recorded before the journal or opened by no rule.
    #[prost(string, optional, tag = "12")]
    pub rule: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(double, optional, tag = "13")]
    pub signal: ::core::option::Option<f64>,
    #[prost(string, optional, tag = "14")]
    pub regime: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(double, optional, tag = "15")]
    pub asked: ::core::option::Option<f64>,
}
/// What the round trips looked like, flattened for display.
///
/// Beside the metrics rather than inside them: metrics come from the equity
/// curve and these come from the ledger, and keeping the two apart is what
/// makes it obvious which is which when they say different things.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TradesView {
    #[prost(uint32, tag = "1")]
    pub closed: u32,
    #[prost(uint32, tag = "2")]
    pub still_open: u32,
    #[prost(double, optional, tag = "3")]
    pub win_rate: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "4")]
    pub profit_factor: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "5")]
    pub expectancy: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "6")]
    pub average_win: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "7")]
    pub average_loss: ::core::option::Option<f64>,
    /// Mean holding period in days, which is the unit a reader thinks in and
    /// the one that decides short- versus long-term tax treatment.
    #[prost(double, optional, tag = "8")]
    pub average_holding_days: ::core::option::Option<f64>,
    /// Every fee and commission the venue charged, in account currency.
    ///
    /// Fees only — slippage is charged inside the fill prices and is already
    /// reflected in the return, not here. Naming this `fees` rather than
    /// `cost` is the whole point: a reader who took it for the total cost of
    /// trading would be short by the spread assumption on every round trip.
    #[prost(double, tag = "9")]
    pub fees_paid: f64,
    /// Fees as a fraction of starting capital, so they can be read against
    /// the return directly.
    #[prost(double, tag = "10")]
    pub fees_fraction: f64,
    #[prost(uint32, tag = "11")]
    pub signal_exits: u32,
    #[prost(uint32, tag = "12")]
    pub stop_exits: u32,
}
/// A finding that could not be read, and why.
///
/// Shown rather than logged. Four findings were once lost to a field rename
/// and the only trace was a warning nobody had reason to look at — a research
/// store that quietly forgets things is worse than one that says it has.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UnreadableView {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub reason: ::prost::alloc::string::String,
}
/// A walk-forward run, flattened for display.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WalkForwardView {
    /// The stored finding this view came from, so the window can ask for
    /// something to be done to the record it is showing — a report composed
    /// from it, a file kept with it. Empty for a view that was never
    /// recorded. `default` because every view built before this had none.
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub instrument: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub verdict: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "4")]
    pub reasons: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(message, repeated, tag = "5")]
    pub recommendations: ::prost::alloc::vec::Vec<RecommendationView>,
    #[prost(message, repeated, tag = "6")]
    pub folds: ::prost::alloc::vec::Vec<FoldView>,
    #[prost(uint32, tag = "7")]
    pub folds_surviving_deflation: u32,
    /// Folds in which the selected configuration never opened a position — the
    /// symptom of a step too short for the rule's warm-up.
    #[prost(uint32, tag = "8")]
    pub folds_without_trades: u32,
    /// How the selection moved. The thing only a rolling procedure can show.
    #[prost(message, repeated, tag = "9")]
    pub stability: ::prost::alloc::vec::Vec<StabilityView>,
    #[prost(message, optional, tag = "10")]
    pub strategy: ::core::option::Option<MetricsView>,
    #[prost(message, optional, tag = "11")]
    pub benchmark: ::core::option::Option<MetricsView>,
    #[prost(double, tag = "12")]
    pub excess_return: f64,
    #[prost(message, repeated, tag = "13")]
    pub strategy_curve: ::prost::alloc::vec::Vec<CurvePoint>,
    #[prost(message, repeated, tag = "14")]
    pub benchmark_curve: ::prost::alloc::vec::Vec<CurvePoint>,
    #[prost(message, repeated, tag = "15")]
    pub price: ::prost::alloc::vec::Vec<CandlePoint>,
    #[prost(message, repeated, tag = "16")]
    pub markers: ::prost::alloc::vec::Vec<TradeMarkerView>,
    #[prost(message, repeated, tag = "17")]
    pub underwater: ::prost::alloc::vec::Vec<CurvePoint>,
    /// What is wrong with the bars this was produced from.
    #[prost(message, repeated, tag = "18")]
    pub data_findings: ::prost::alloc::vec::Vec<
        super::super::market::v1::DataFindingView,
    >,
    #[prost(message, repeated, tag = "19")]
    pub trades: ::prost::alloc::vec::Vec<TradeRowView>,
    #[prost(message, optional, tag = "20")]
    pub trades_detail: ::core::option::Option<TradesView>,
    #[prost(int64, tag = "21")]
    pub in_sample_days: i64,
    #[prost(int64, tag = "22")]
    pub step_days: i64,
    #[prost(bool, tag = "23")]
    pub anchored: bool,
    #[prost(string, tag = "24")]
    pub dataset_version: ::prost::alloc::string::String,
    #[prost(string, tag = "25")]
    pub strategy_name: ::prost::alloc::string::String,
    #[prost(double, tag = "26")]
    pub starting_cash: f64,
    #[prost(double, tag = "27")]
    pub commission_bps: f64,
    #[prost(double, tag = "28")]
    pub slippage_bps: f64,
    #[prost(string, tag = "29")]
    pub engine: ::prost::alloc::string::String,
}
/// One bar, as the chart wants it.
/// The review after the close (#217): what the day's sessions did, read back
/// off their records, as a person reads it.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReviewView {
    #[prost(string, tag = "1")]
    pub day: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub markdown: ::prost::alloc::string::String,
    /// Where it is written under the project, so it can be opened.
    #[prost(string, tag = "3")]
    pub path: ::prost::alloc::string::String,
    /// Whether this call wrote it, or read one written before.
    #[prost(bool, tag = "4")]
    pub written_now: bool,
    /// The same review as JSON (#229): every session's fills with the price
    /// each was decided at, its round trips, its refusals with their times, and
    /// the stretches it was frozen or halted. What a chart of the day draws.
    #[prost(string, tag = "5")]
    pub json: ::prost::alloc::string::String,
}
/// One bar of the library, as the research tier reads it (#195).
///
/// Times are UTC. `at` is the open as `YYYY-MM-DDTHH:MM:SS` with no zone, and
/// `time` is the same instant as seconds since the epoch, which is what a chart
/// keys by. A daily bar opens at 00:00 UTC of its date. To show the bar in
/// exchange time, apply `BarsView.zone`.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BarView {
    /// When the bar opened.
    #[prost(string, tag = "1")]
    pub at: ::prost::alloc::string::String,
    #[prost(double, tag = "2")]
    pub open: f64,
    #[prost(double, tag = "3")]
    pub high: f64,
    #[prost(double, tag = "4")]
    pub low: f64,
    #[prost(double, tag = "5")]
    pub close: f64,
    #[prost(double, tag = "6")]
    pub volume: f64,
    /// The open as seconds since the epoch, UTC. The same instant as `at`,
    /// in the shape `CandlePoint.time` already has, so one decoder serves both.
    #[prost(int64, tag = "7")]
    pub time: i64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BarsView {
    #[prost(string, tag = "1")]
    pub instrument: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub interval: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "3")]
    pub bars: ::prost::alloc::vec::Vec<BarView>,
    /// The IANA zone the instrument's sessions are stated in, e.g.
    /// `America/New_York`. Times on the bars stay UTC; this is what a chart
    /// converts with to draw session boundaries and label the axis.
    #[prost(string, tag = "4")]
    pub zone: ::prost::alloc::string::String,
}
/// The regime each bar closed in: "trending up", "trending down" or
/// "ranging", absent until the lookback has filled. Labelled after the fact
/// over the closes, so it says what the market was doing and not what a rule
/// could have known at the time.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RegimePointView {
    #[prost(string, tag = "1")]
    pub at: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub regime: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RegimeView {
    #[prost(string, tag = "1")]
    pub instrument: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub interval: ::prost::alloc::string::String,
    /// Bars each label looks back over.
    #[prost(uint32, tag = "3")]
    pub lookback: u32,
    /// The last bar's regime, when it has one.
    #[prost(string, optional, tag = "4")]
    pub current: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(message, repeated, tag = "5")]
    pub points: ::prost::alloc::vec::Vec<RegimePointView>,
    /// How many of the returned bars were in each regime.
    #[prost(map = "string, uint32", tag = "6")]
    pub shares: ::std::collections::HashMap<::prost::alloc::string::String, u32>,
}
/// One bar as a chart draws it: the open as seconds since the epoch, UTC,
/// and the five numbers. The same bar as `BarView`, keyed by `time`.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CandlePoint {
    #[prost(int64, tag = "1")]
    pub time: i64,
    #[prost(double, tag = "2")]
    pub open: f64,
    #[prost(double, tag = "3")]
    pub high: f64,
    #[prost(double, tag = "4")]
    pub low: f64,
    #[prost(double, tag = "5")]
    pub close: f64,
    /// Absent (zero) in views recorded before it existed; a volume pane
    /// treats zero as nothing to draw.
    #[prost(double, tag = "6")]
    pub volume: f64,
}
/// One instrument's bars with its own trades marked on them.
///
/// A book holds several, and each chart must show only the round trips that
/// happened in *its* instrument. Plotting the whole ledger on one member's
/// prices puts entries on days that instrument never traded.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InstrumentChartView {
    #[prost(string, tag = "1")]
    pub instrument: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "2")]
    pub price: ::prost::alloc::vec::Vec<CandlePoint>,
    #[prost(message, repeated, tag = "3")]
    pub markers: ::prost::alloc::vec::Vec<TradeMarkerView>,
}
/// A finding's caveat, against the script line that produced the finding:
/// what the Problems panel lists with source "Arvo" (ADR-0021).
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ResearchProblemView {
    /// Relative to the project folder.
    #[prost(string, tag = "1")]
    pub path: ::prost::alloc::string::String,
    #[prost(uint32, tag = "2")]
    pub line: u32,
    /// `error`, `warning` or `info`.
    #[prost(string, tag = "3")]
    pub severity: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub message: ::prost::alloc::string::String,
    /// The finding it comes from, to open.
    #[prost(string, tag = "5")]
    pub finding: ::prost::alloc::string::String,
}
/// The Problems panel's rows.
///
/// A list, as a message: an RPC returns one message, never a bare repeated
/// field, so a call that answers with a list needs a name for the list.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProblemsView {
    #[prost(message, repeated, tag = "1")]
    pub problems: ::prost::alloc::vec::Vec<ResearchProblemView>,
}
/// One finding on the leaderboard (#226).
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RankingRowView {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub subject: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub kind: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub rule: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub interval: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub verdict: ::prost::alloc::string::String,
    /// The verdict under the conservative cost tier, or empty when the run
    /// was not asked: a result refused on its own terms is not.
    #[prost(string, tag = "7")]
    pub conservative_verdict: ::prost::alloc::string::String,
    /// Mean profit per closed out-of-sample trade: under the conservative tier
    /// when it was measured, otherwise under the stated costs.
    #[prost(double, tag = "8")]
    pub expectancy: f64,
    /// "conservative" or "stated": which costs the expectancy is under.
    #[prost(string, tag = "9")]
    pub expectancy_costs: ::prost::alloc::string::String,
    /// Read it; it is never the order.
    #[prost(double, tag = "10")]
    pub total_return: f64,
    #[prost(double, tag = "11")]
    pub max_drawdown: f64,
    #[prost(uint32, tag = "12")]
    pub trades: u32,
    /// The regimes the out-of-sample trades opened in, distinct.
    #[prost(string, repeated, tag = "13")]
    pub regimes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// How many configurations the search tried, when the finding says.
    #[prost(uint32, optional, tag = "14")]
    pub search: ::core::option::Option<u32>,
    #[prost(string, tag = "15")]
    pub recorded_at: ::prost::alloc::string::String,
    #[prost(bool, optional, tag = "16")]
    pub stale: ::core::option::Option<bool>,
}
/// The leaderboard (#226): findings in one order and only one. Supported
/// under the conservative tier first, by that expectancy; then Supported
/// under the stated costs where the conservative tier was never measured;
/// then everything else, whatever its number. Ties by drawdown, then trades.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Ranking {
    #[prost(message, repeated, tag = "1")]
    pub rows: ::prost::alloc::vec::Vec<RankingRowView>,
    /// Findings that could not be read, and why.
    #[prost(string, repeated, tag = "2")]
    pub notes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}