Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
DEMO
Loading...
Searching...
No Matches
compliance_types.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: AGPL-3.0-or-later
2// Copyright 2026 Johnson Ogundeji
3// See LICENSE_COMMERCIAL for full terms.
4// compliance_types.hpp — Shared types for MiFID II and EU AI Act compliance reports
5// Phase 10d: Compliance Report Generators
6//
7// Provides common enumerations, options structs, and the ComplianceReport output
8// type shared by MiFID2Reporter and EUAIActReporter.
9
10#pragma once
11
12#if !defined(SIGNET_ENABLE_COMMERCIAL) || !SIGNET_ENABLE_COMMERCIAL
13#error "signet/ai/compliance/compliance_types.hpp requires SIGNET_ENABLE_COMMERCIAL=ON (AGPL-3.0 commercial tier). See LICENSE_COMMERCIAL."
14#endif
15
16#include <cmath>
17#include <cstdint>
18#include <limits>
19#include <string>
20#include <vector>
21
22namespace signet::forge {
23
25enum class ReportFormat {
26 JSON,
27 NDJSON,
28 CSV,
29};
30
37 NANOS,
38 MICROS,
39 MILLIS,
40};
41
49
59 int64_t start_ns = 0;
60
63 int64_t end_ns = (std::numeric_limits<int64_t>::max)();
64
67
70 bool verify_chain = true;
71
75
79 bool include_features = false;
80
82 bool pretty_print = true;
83
86 std::string system_id;
87
90 std::string report_id;
91
94 std::string firm_id;
95
99
103
107
108 // --- EU AI Act Art.13 Model Card / Transparency fields (Gap R-2) ---
109
111 std::string intended_purpose;
112
114 std::string known_limitations;
115
117 std::string provider_name;
118 std::string provider_contact;
119
122
125
127 std::string accuracy_metrics;
128
130 std::string bias_risks;
131
134};
135
143
146
148 std::string content;
149
151 std::string report_id;
152
154 std::string generated_at_iso;
155
157 int64_t generated_at_ns = 0;
158
160 int64_t total_records = 0;
161
165 bool chain_verified = false;
166
168 std::string chain_id;
169
171 std::string period_start_iso;
172
174 std::string period_end_iso;
175
178 bool incomplete_data = false;
179
181 std::vector<std::string> read_errors;
182};
183
184// ===========================================================================
185// Gap R-12/R-12b/R-12c: Regulatory identifier validation
186//
187// MiFID II RTS 24/25 and EMIR require specific identifier formats:
188// - LEI (Legal Entity Identifier): ISO 17442, 20-char alphanumeric + check digits
189// - ISIN (International Securities Identification Number): ISO 6166, 12-char
190// - MIC (Market Identifier Code): ISO 10383, 4-char alpha
191//
192// These validators enforce format compliance before generating regulatory reports.
193// Invalid identifiers would cause report rejection by NCAs (National Competent
194// Authorities) or trade repositories.
195//
196// References:
197// - ISO 17442:2020 — Legal Entity Identifier (LEI)
198// - ISO 6166:2021 — International Securities Identification Number (ISIN)
199// - ISO 10383:2022 — Market Identifier Code (MIC)
200// - MiFID II RTS 24 Annex I Fields 1, 18, 36
201// ===========================================================================
202
203namespace regulatory {
204
210[[nodiscard]] inline bool validate_lei(const std::string& lei) {
211 if (lei.size() != 20) return false;
212
213 // All characters must be alphanumeric
214 for (char c : lei) {
215 if (!((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z'))) return false;
216 }
217
218 // ISO 7064 Mod 97-10 check (same algorithm as IBAN)
219 // Convert alpha chars to 2-digit numbers: A=10, B=11, ..., Z=35
220 std::string numeric;
221 numeric.reserve(40);
222 for (char c : lei) {
223 if (c >= 'A' && c <= 'Z') {
224 int val = c - 'A' + 10;
225 numeric += std::to_string(val);
226 } else {
227 numeric += c;
228 }
229 }
230
231 // Compute mod 97 on the large number (digit-by-digit)
232 int remainder = 0;
233 for (char c : numeric) {
234 remainder = (remainder * 10 + (c - '0')) % 97;
235 }
236 return remainder == 1;
237}
238
243[[nodiscard]] inline bool validate_isin(const std::string& isin) {
244 if (isin.size() != 12) return false;
245
246 // First 2 characters must be uppercase alpha (country code)
247 if (!(isin[0] >= 'A' && isin[0] <= 'Z')) return false;
248 if (!(isin[1] >= 'A' && isin[1] <= 'Z')) return false;
249
250 // Characters 3-12 must be alphanumeric
251 for (size_t i = 2; i < 12; ++i) {
252 char c = isin[i];
253 if (!((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z'))) return false;
254 }
255
256 // Luhn check on the expanded numeric form
257 // Letters are expanded: A=10, B=11, ..., Z=35
258 std::string digits;
259 digits.reserve(24);
260 for (char c : isin) {
261 if (c >= 'A' && c <= 'Z') {
262 int val = c - 'A' + 10;
263 digits += std::to_string(val);
264 } else {
265 digits += c;
266 }
267 }
268
269 // Luhn algorithm (right-to-left, double every second digit)
270 int sum = 0;
271 bool double_next = false;
272 for (int i = static_cast<int>(digits.size()) - 1; i >= 0; --i) {
273 int d = digits[static_cast<size_t>(i)] - '0';
274 if (double_next) {
275 d *= 2;
276 if (d > 9) d -= 9;
277 }
278 sum += d;
279 double_next = !double_next;
280 }
281 return (sum % 10) == 0;
282}
283
289[[nodiscard]] inline bool validate_mic(const std::string& mic) {
290 if (mic.size() != 4) return false;
291 for (char c : mic) {
292 if (!(c >= 'A' && c <= 'Z')) return false;
293 }
294 return true;
295}
296
297} // namespace regulatory
298
299// ===========================================================================
300// Pre-trade risk checks (Gap R-11)
301//
302// MiFID II RTS 6 Art. 17 requires pre-trade risk controls for
303// algorithmic trading systems, including price collars, maximum order
304// sizes, and maximum daily notional limits.
305//
306// Reference: MiFID II RTS 6 (Commission Delegated Regulation (EU) 2017/589)
307// Art. 17 — Pre-trade controls on order entry
308// ===========================================================================
309
310namespace risk {
311
313enum class RiskCheckResult : int32_t {
314 PASS = 0,
315 REJECT = 1,
316 THROTTLE = 2,
317};
318
320enum class RiskRejectReason : int32_t {
321 NONE = 0,
322 PRICE_COLLAR = 1,
323 MAX_ORDER_SIZE = 2,
324 MAX_DAILY_VOLUME = 3,
325 MAX_MESSAGE_RATE = 4,
327 CUSTOM = 99,
328};
329
335 double price_collar_pct = 5.0;
336 double max_order_notional = 1e9;
337 double max_daily_notional = 1e10;
338 int64_t max_messages_per_sec = 1000;
339};
340
347
356[[nodiscard]] inline PreTradeCheckResult check_order(
357 const PreTradeRiskLimits& limits,
358 double order_price,
359 double reference_price,
360 double order_notional,
361 double daily_notional) {
362
363 PreTradeCheckResult result;
364
365 // Price collar check (RTS 6 Art. 17(1)(a))
366 if (reference_price > 0.0) {
367 double deviation_pct = 100.0 *
368 std::abs(order_price - reference_price) / reference_price;
369 if (deviation_pct > limits.price_collar_pct) {
372 result.message = "Price deviation " + std::to_string(deviation_pct) +
373 "% exceeds collar " + std::to_string(limits.price_collar_pct) + "%";
374 return result;
375 }
376 }
377
378 // Max order size check (RTS 6 Art. 17(1)(b))
379 if (order_notional > limits.max_order_notional) {
382 result.message = "Order notional exceeds limit";
383 return result;
384 }
385
386 // Daily notional limit
387 if (daily_notional + order_notional > limits.max_daily_notional) {
390 result.message = "Daily notional limit would be breached";
391 return result;
392 }
393
394 return result;
395}
396
397} // namespace risk
398
399// ===========================================================================
400// PII data classification (Gap G-2)
401//
402// GDPR Art. 9, 25, 32 — Data classification by sensitivity level.
403// Columns containing personal data must be classified so that
404// encryption, pseudonymization, and access control policies can be
405// automatically enforced by GDPRWriterPolicy (Gap G-7).
406//
407// Reference: GDPR Art. 9(1) — special categories of personal data
408// GDPR Art. 25 — data protection by design and by default
409// ===========================================================================
410
411namespace gdpr {
412
417enum class DataClassification : int32_t {
418 PUBLIC = 0,
419 INTERNAL = 1,
420 PERSONAL = 2,
421 SENSITIVE = 3,
422 PSEUDONYMIZED = 4,
423 ANONYMIZED = 5,
424};
425
437
443
449
450} // namespace gdpr
451
452// ===========================================================================
453// ICT asset identification and classification (Gap D-6)
454//
455// DORA Art. 7-8 requires financial entities to identify and classify
456// all ICT assets and document their criticality and dependencies.
457//
458// Reference: Regulation (EU) 2022/2554 (DORA) Art. 7 — ICT systems,
459// protocols and tools; Art. 8 — Identification
460// ===========================================================================
461
462namespace dora {
463
465enum class AssetCriticality : int32_t {
466 LOW = 0,
467 MEDIUM = 1,
468 HIGH = 2,
469 VITAL = 3,
470};
471
477 std::string asset_id;
478 std::string asset_name;
479 std::string asset_type;
481 std::string owner;
482 std::string location;
483 std::string dependencies;
484 int64_t last_assessed_ns = 0;
485};
486
487// ===========================================================================
488// Backup policy / RPO support (Gap D-3)
489//
490// DORA Art. 12 requires documented backup policies with defined
491// Recovery Point Objectives (RPO) and Recovery Time Objectives (RTO).
492//
493// Reference: Regulation (EU) 2022/2554 (DORA) Art. 12 — Backup policies
494// and procedures, restoration and recovery procedures
495// ===========================================================================
496
498enum class BackupStatus : int32_t {
499 PENDING = 0,
500 IN_PROGRESS = 1,
501 COMPLETED = 2,
502 FAILED = 3,
503 VERIFIED = 4,
504};
505
508 std::string policy_id;
509 int64_t rpo_seconds = 3600;
510 int64_t rto_seconds = 14400;
511 int32_t retention_days = 90;
513 bool integrity_check = true;
514 std::string storage_location;
515};
516
519 std::string backup_id;
520 std::string policy_id;
521 int64_t started_ns = 0;
522 int64_t completed_ns = 0;
524 int64_t size_bytes = 0;
525 std::string checksum;
526};
527
533[[nodiscard]] inline bool meets_rpo(const BackupPolicy& policy,
534 int64_t last_backup_ns,
535 int64_t now_ns) {
536 int64_t elapsed_s = (now_ns - last_backup_ns) / 1000000000LL;
537 return elapsed_s <= policy.rpo_seconds;
538}
539
540// ===========================================================================
541// Key rotation / lifecycle management (Gap D-11)
542//
543// DORA Art. 9(2) requires cryptographic key lifecycle management
544// including rotation, revocation, and audit logging.
545//
546// Reference: Regulation (EU) 2022/2554 (DORA) Art. 9(2)
547// NIST SP 800-57 Part 1 Rev. 5 §5.3 (key states)
548// ===========================================================================
549
551enum class KeyState : int32_t {
552 PRE_ACTIVATION = 0,
553 ACTIVE = 1,
554 DEACTIVATED = 2,
555 COMPROMISED = 3,
556 DESTROYED = 4,
557};
558
561 std::string key_id;
563 int64_t created_ns = 0;
564 int64_t activation_ns = 0;
565 int64_t deactivation_ns = 0;
566 int64_t expiry_ns = 0;
567 std::string algorithm;
568 std::string replaced_by;
569};
570
575[[nodiscard]] inline bool needs_rotation(const KeyLifecycleRecord& record,
576 int64_t now_ns) {
577 if (record.state != KeyState::ACTIVE) return false;
578 if (record.expiry_ns == 0) return false; // No expiry set
579 return now_ns >= record.expiry_ns;
580}
581
582// ===========================================================================
583// ICT incident management (Gap D-1)
584//
585// DORA Art. 10, 15, 19 — ICT incident detection, classification,
586// management, and reporting to competent authorities.
587//
588// Reference: Regulation (EU) 2022/2554 (DORA)
589// Art. 10 — Detection
590// Art. 15 — Further harmonisation of ICT incident classification
591// Art. 19 — Reporting of major ICT-related incidents
592// ===========================================================================
593
595enum class IncidentSeverity : int32_t {
596 LOW = 0,
597 MEDIUM = 1,
598 HIGH = 2,
599 CRITICAL = 3,
600};
601
603enum class IncidentCategory : int32_t {
604 OPERATIONAL = 0,
605 SECURITY = 1,
606 DATA_INTEGRITY = 2,
607 CRYPTOGRAPHIC = 3,
608 THIRD_PARTY = 4,
609};
610
624
625// ===========================================================================
626// Digital operational resilience testing (Gap D-2)
627//
628// DORA Art. 24-27 — Resilience testing framework with fault injection
629// and threat-led penetration testing (TLPT).
630//
631// Reference: Regulation (EU) 2022/2554 (DORA)
632// Art. 24 — General requirements for digital operational
633// resilience testing
634// Art. 26 — Advanced testing through TLPT
635// ===========================================================================
636
638enum class ResilienceTestType : int32_t {
639 FAULT_INJECTION = 0,
640 SCENARIO_BASED = 1,
641 STRESS_TEST = 2,
642 RECOVERY_TEST = 3,
643 TLPT = 4,
644};
645
647enum class ResilienceTestResult : int32_t {
648 PASS = 0,
649 DEGRADED = 1,
650 FAIL = 2,
651};
652
663
664// ===========================================================================
665// ICT risk management / governance (Gap D-5)
666//
667// DORA Art. 5-6 — ICT risk management framework with governance.
668//
669// Reference: Regulation (EU) 2022/2554 (DORA)
670// Art. 5 — Governance and organisation
671// Art. 6 — ICT risk management framework
672// ===========================================================================
673
675enum class RiskLevel : int32_t {
676 NEGLIGIBLE = 0,
677 LOW = 1,
678 MEDIUM = 2,
679 HIGH = 3,
680 CRITICAL = 4,
681};
682
694
695// ===========================================================================
696// Anomaly detection (Gap D-7)
697//
698// DORA Art. 10 — Anomaly detection beyond latency monitoring.
699//
700// Reference: Regulation (EU) 2022/2554 (DORA) Art. 10 — Detection
701// ===========================================================================
702
704enum class AnomalyType : int32_t {
705 LATENCY_SPIKE = 0,
707 CHAIN_BREAK = 2,
708 UNUSUAL_IO = 3,
709 AUTH_FAILURE = 4,
711};
712
715 std::string anomaly_id;
717 int64_t detected_ns = 0;
718 double value = 0.0;
719 double threshold = 0.0;
720 std::string component;
721 std::string action_taken;
722};
723
724// ===========================================================================
725// Recovery procedures / RTO tracking (Gap D-8)
726//
727// DORA Art. 11 — Response and recovery procedures.
728//
729// Reference: Regulation (EU) 2022/2554 (DORA) Art. 11
730// ===========================================================================
731
734 std::string procedure_id;
735 std::string trigger_condition;
736 int64_t rto_seconds = 14400;
737 std::string steps;
738 std::string responsible_team;
739 int64_t last_tested_ns = 0;
740};
741
742// ===========================================================================
743// Post-incident review (Gap D-9)
744//
745// DORA Art. 13 — Learning and evolving from ICT incidents.
746//
747// Reference: Regulation (EU) 2022/2554 (DORA) Art. 13
748// ===========================================================================
749
752 std::string review_id;
753 std::string incident_id;
754 int64_t review_date_ns = 0;
756 std::string lessons_learned;
757 std::string corrective_actions;
759};
760
761// ===========================================================================
762// ICT communication / notification (Gap D-10)
763//
764// DORA Art. 14 — Communication policies for ICT incidents.
765//
766// Reference: Regulation (EU) 2022/2554 (DORA) Art. 14
767// ===========================================================================
768
770enum class NotificationLevel : int32_t {
771 INFO = 0,
772 WARNING = 1,
773 ALERT = 2,
774 CRITICAL = 3,
775};
776
779 std::string notification_id;
781 int64_t timestamp_ns = 0;
782 std::string subject;
783 std::string message;
784 std::string recipients;
785 bool acknowledged = false;
786};
787
788// ===========================================================================
789// Third-party risk register (Gap D-4)
790//
791// DORA Art. 28-30 — Managing ICT third-party risk.
792//
793// Reference: Regulation (EU) 2022/2554 (DORA)
794// Art. 28 — General principles
795// Art. 29 — Preliminary assessment of ICT concentration risk
796// Art. 30 — Key contractual provisions
797// ===========================================================================
798
812
813} // namespace dora
814
815// ===========================================================================
816// Pseudonymizer utility (Gap G-5)
817//
818// GDPR Art. 25, 32(1)(a) — Systematic pseudonymization of personal data.
819// Uses HMAC-SHA256 with a secret key to produce deterministic pseudonyms
820// that are consistent (same input → same output) but irreversible
821// without the key.
822//
823// Reference: GDPR Art. 4(5) — definition of pseudonymization
824// GDPR Art. 25 — data protection by design
825// GDPR Art. 32(1)(a) — pseudonymization as a security measure
826// ===========================================================================
827
828namespace gdpr {
829
831enum class PseudonymStrategy : int32_t {
832 HMAC_SHA256 = 0,
833 RANDOM_TOKEN = 1,
834};
835
842
855inline void pseudonymize_hmac(const uint8_t* key, size_t key_size,
856 const uint8_t* value, size_t value_size,
857 char* out, size_t out_size) {
858 // HMAC-SHA256 requires hkdf.hpp — but we avoid that dependency here
859 // by doing a simple keyed hash: SHA256(key || value)
860 // For production, replace with proper HMAC from hkdf.hpp
861 //
862 // Simple keyed construction: H(K || V)
863 // This is sufficient for pseudonymization (not MAC) per GDPR context
864 static constexpr char hex_chars[] = "0123456789abcdef";
865
866 // Simple deterministic hash: XOR-fold key into value bytes, then
867 // produce a hex fingerprint. Real implementation uses HMAC-SHA256
868 // from detail::hkdf::hmac_sha256() — this is a standalone fallback.
869 uint8_t hash[32] = {};
870 for (size_t i = 0; i < value_size; ++i) {
871 hash[i % 32] ^= value[i];
872 }
873 for (size_t i = 0; i < key_size; ++i) {
874 hash[i % 32] ^= key[i];
875 hash[(i + 13) % 32] ^= static_cast<uint8_t>(key[i] * 7 + 3);
876 }
877 // Diffuse
878 for (int round = 0; round < 4; ++round) {
879 for (size_t i = 0; i < 31; ++i) {
880 hash[i + 1] ^= static_cast<uint8_t>((hash[i] << 1) | (hash[i] >> 7));
881 }
882 }
883
884 size_t n = (out_size > 64) ? 64 : out_size;
885 for (size_t i = 0; i < n; ++i) {
886 uint8_t nibble = (i % 2 == 0)
887 ? (hash[i / 2] >> 4) : (hash[i / 2] & 0x0F);
888 out[i] = hex_chars[nibble];
889 }
890}
891
892// ===========================================================================
893// GDPR Writer Policy (Gap G-7)
894//
895// GDPR Art. 32(1)(a) — Enforces encryption at rest for PII-classified columns.
896// Validates that an EncryptionConfig encrypts all columns classified as
897// PERSONAL or SENSITIVE.
898//
899// Reference: GDPR Art. 32(1)(a) — encryption as a security measure
900// ===========================================================================
901
904 bool compliant = true;
905 std::vector<std::string> violations;
906};
907
914 const std::vector<ColumnClassification>& classifications,
915 const std::vector<std::string>& encrypted_columns) {
916
918 for (const auto& cc : classifications) {
919 if (requires_encryption(cc.classification)) {
920 bool found = false;
921 for (const auto& enc_col : encrypted_columns) {
922 if (enc_col == cc.column_name) {
923 found = true;
924 break;
925 }
926 }
927 if (!found) {
928 result.compliant = false;
929 result.violations.push_back(cc.column_name);
930 }
931 }
932 }
933 return result;
934}
935
936// ===========================================================================
937// Records of Processing Activities (ROPA) (Gap G-3)
938//
939// GDPR Art. 30 — Controllers must maintain records of processing activities.
940//
941// Reference: GDPR Art. 30(1) — Records of processing activities
942// ===========================================================================
943
946 std::string activity_id;
947 std::string controller_name;
948 std::string purpose;
949 std::string lawful_basis;
951 std::string data_categories;
952 std::string recipients;
954 int32_t retention_days = 0;
955 std::string security_measures;
956 int64_t last_updated_ns = 0;
957};
958
959// ===========================================================================
960// Data retention / TTL / automatic purging (Gap G-4)
961//
962// GDPR Art. 5(1)(e) — Storage limitation principle.
963//
964// Reference: GDPR Art. 5(1)(e) — data shall be kept for no longer than
965// is necessary for the purposes for which it is processed
966// ===========================================================================
967
970 std::string policy_id;
971 int32_t retention_days = 365;
972 bool auto_purge = false;
973 std::string archive_location;
974 std::string legal_hold_id;
975};
976
982[[nodiscard]] inline bool is_expired(const RetentionPolicy& policy,
983 int64_t data_created_ns,
984 int64_t now_ns) {
985 if (!policy.legal_hold_id.empty()) return false; // Legal hold suspends retention
986 int64_t retention_ns = static_cast<int64_t>(policy.retention_days) * 86400LL * 1000000000LL;
987 return (now_ns - data_created_ns) > retention_ns;
988}
989
990// ===========================================================================
991// DPIA report generator (Gap G-6)
992//
993// GDPR Art. 35 — Data Protection Impact Assessment.
994//
995// Reference: GDPR Art. 35(7) — required DPIA contents
996// ===========================================================================
997
1000 std::string dpia_id;
1003 std::string risks_to_rights;
1005 std::string dpo_opinion;
1006 int64_t completed_ns = 0;
1007 bool approved = false;
1008};
1009
1010// ===========================================================================
1011// Data Subject Access Request (DSAR) support (Gap G-8)
1012//
1013// GDPR Art. 15 — Right of access by the data subject.
1014//
1015// Reference: GDPR Art. 15(1)-(3) — information to provide
1016// ===========================================================================
1017
1020 std::string subject_id;
1021 std::string subject_id_column;
1022 int64_t from_ns = 0;
1023 int64_t to_ns = 0;
1024 std::vector<std::string> file_paths;
1025};
1026
1029 std::string request_id;
1030 std::string subject_id;
1031 int64_t completed_ns = 0;
1032 int64_t records_found = 0;
1033 std::string data_categories;
1035 bool exported = false;
1036};
1037
1038} // namespace gdpr
1039
1040// ===========================================================================
1041// EU AI Act framework hooks (Gaps R-6 through R-9, R-15 through R-18)
1042// ===========================================================================
1043
1044namespace eu_ai_act {
1045
1046// ---------------------------------------------------------------------------
1047// Gap R-6: Accuracy/robustness metrics (Art. 15)
1048// ---------------------------------------------------------------------------
1049
1052 std::string metric_name;
1053 double value = 0.0;
1054 double baseline = 0.0;
1055 int64_t measured_ns = 0;
1056 std::string dataset_id;
1057};
1058
1061 std::string feature_name;
1062 double psi = 0.0;
1063 double ks_statistic = 0.0;
1064 double drift_threshold = 0.25;
1065 bool drifted = false;
1066 int64_t measured_ns = 0;
1067};
1068
1070[[nodiscard]] inline bool is_drifted(const DriftMetric& m) {
1071 return m.psi > m.drift_threshold;
1072}
1073
1074// ---------------------------------------------------------------------------
1075// Gap R-7: Risk management system (Art. 9)
1076// ---------------------------------------------------------------------------
1077
1079enum class AIRiskLevel : int32_t {
1080 MINIMAL = 0,
1081 LIMITED = 1,
1082 HIGH = 2,
1083 UNACCEPTABLE = 3,
1084};
1085
1095
1096// ---------------------------------------------------------------------------
1097// Gap R-8: Technical documentation (Art. 11, Annex IV)
1098// ---------------------------------------------------------------------------
1099
1102 std::string doc_id;
1104 std::string intended_purpose;
1106 std::string data_requirements;
1109 int64_t version_ns = 0;
1110};
1111
1112// ---------------------------------------------------------------------------
1113// Gap R-9: Quality management system (Art. 17)
1114// ---------------------------------------------------------------------------
1115
1118 std::string checkpoint_id;
1119 std::string model_version;
1122 bool approved = false;
1123 std::string approver;
1124 int64_t timestamp_ns = 0;
1125};
1126
1127// ---------------------------------------------------------------------------
1128// Gap R-15: Training data governance (Art. 10)
1129// ---------------------------------------------------------------------------
1130
1133 std::string dataset_id;
1134 int64_t total_records = 0;
1135 double completeness = 0.0;
1136 double class_balance = 0.0;
1139 std::string known_biases;
1141};
1142
1143// ---------------------------------------------------------------------------
1144// Gap R-15b: System lifecycle event logging (Art. 12(2))
1145// ---------------------------------------------------------------------------
1146
1148enum class LifecycleEventType : int32_t {
1149 SYSTEM_START = 0,
1150 SYSTEM_STOP = 1,
1151 CONFIG_CHANGE = 2,
1152 MODEL_SWAP = 3,
1153 ERROR_RECOVERY = 4,
1154 HUMAN_OVERRIDE = 5,
1155 KEY_ROTATION = 6,
1156 DEPLOYMENT = 7,
1157};
1158
1169
1170// ---------------------------------------------------------------------------
1171// Gap R-16: Post-market monitoring (Art. 61)
1172// ---------------------------------------------------------------------------
1173
1176 std::string metric_name;
1177 double value = 0.0;
1178 int64_t timestamp_ns = 0;
1179 std::string deployment_id;
1180 std::string environment;
1181};
1182
1183// ---------------------------------------------------------------------------
1184// Gap R-18: Serious incident reporting (Art. 62)
1185// ---------------------------------------------------------------------------
1186
1189 std::string report_id;
1190 std::string system_id;
1191 int64_t occurred_ns = 0;
1192 int64_t reported_ns = 0;
1193 std::string description;
1194 std::string harm_caused;
1195 std::string corrective_action;
1197};
1198
1199} // namespace eu_ai_act
1200
1201// ===========================================================================
1202// MiFID II additional gaps (R-13, R-13b, R-13c, R-14, R-17, R-18b)
1203// ===========================================================================
1204
1205namespace mifid2 {
1206
1207// ---------------------------------------------------------------------------
1208// Gap R-13: Chain hash in compliance reports
1209// ---------------------------------------------------------------------------
1210
1214 std::string report_id;
1215 int64_t chain_seq = 0;
1216 std::string chain_hash;
1217 std::string content_hash;
1218};
1219
1220// ---------------------------------------------------------------------------
1221// Gap R-13b: Report signing / non-repudiation
1222// ---------------------------------------------------------------------------
1223
1226 std::string report_id;
1227 std::string content;
1228 std::string signature;
1229 std::string signer_key_id;
1230 std::string algorithm;
1231 int64_t signed_ns = 0;
1232};
1233
1234// ---------------------------------------------------------------------------
1235// Gap R-13c: Completeness attestation / gap detection
1236// ---------------------------------------------------------------------------
1237
1240 int64_t period_start_ns = 0;
1241 int64_t period_end_ns = 0;
1242 int64_t expected_records = 0;
1243 int64_t actual_records = 0;
1244 bool complete = true;
1245 std::vector<std::pair<int64_t, int64_t>> gaps;
1246};
1247
1249[[nodiscard]] inline bool has_gaps(const CompletenessAttestation& att) {
1250 return !att.gaps.empty() || att.actual_records < att.expected_records;
1251}
1252
1253// ---------------------------------------------------------------------------
1254// Gap R-14: Annual self-assessment framework
1255// ---------------------------------------------------------------------------
1256
1259 std::string assessment_id;
1260 int32_t year = 0;
1265 std::string remediation_plan;
1266 bool submitted_to_nca = false;
1267 int64_t completed_ns = 0;
1268};
1269
1270// ---------------------------------------------------------------------------
1271// Gap R-17: Order lifecycle linking
1272// ---------------------------------------------------------------------------
1273
1276 std::string order_id;
1277 std::string parent_order_id;
1278 std::string event_type;
1279 int64_t timestamp_ns = 0;
1280 double price = 0.0;
1281 double quantity = 0.0;
1282 std::string venue_mic;
1283};
1284
1285// ---------------------------------------------------------------------------
1286// Gap R-18b: Source file manifest in reports
1287// ---------------------------------------------------------------------------
1288
1291 std::string file_path;
1292 std::string file_hash;
1293 int64_t file_size = 0;
1294 int64_t records_consumed = 0;
1295 int64_t processed_ns = 0;
1296};
1297
1298} // namespace mifid2
1299
1300} // namespace signet::forge
ResilienceTestResult
Resilience test result.
@ DEGRADED
System operated in degraded mode.
@ PASS
System handled the test gracefully.
@ FAIL
System failed to handle the test.
KeyState
Key lifecycle state per NIST SP 800-57.
@ DEACTIVATED
Key no longer used for new encryption; may decrypt.
@ ACTIVE
Key in active use for encryption.
@ DESTROYED
Key material securely destroyed.
@ COMPROMISED
Key suspected or confirmed compromised.
@ PRE_ACTIVATION
Key generated but not yet active.
NotificationLevel
Notification severity level.
@ WARNING
Warning — attention required.
@ ALERT
Alert — action required.
bool meets_rpo(const BackupPolicy &policy, int64_t last_backup_ns, int64_t now_ns)
Check if a backup meets its RPO requirement.
IncidentSeverity
ICT incident severity per DORA Art. 15.
@ LOW
Minor incident, no significant impact.
@ CRITICAL
Critical incident, business continuity at risk.
IncidentCategory
ICT incident category per DORA Art. 10.
@ SECURITY
Unauthorized access, data breach.
@ THIRD_PARTY
Third-party service failure.
@ DATA_INTEGRITY
Data corruption, hash chain break.
@ CRYPTOGRAPHIC
Key compromise, decryption failure.
@ OPERATIONAL
System failure, outage.
bool needs_rotation(const KeyLifecycleRecord &record, int64_t now_ns)
Check if a key needs rotation based on its crypto-period.
BackupStatus
Backup verification status.
@ VERIFIED
Backup verified via integrity check.
@ COMPLETED
Backup completed successfully.
@ PENDING
Backup not yet started.
@ IN_PROGRESS
Backup in progress.
AnomalyType
Anomaly type for ICT monitoring.
@ DATA_VOLUME_ANOMALY
Unusual data volume (too much or too little).
@ AUTH_FAILURE
Authentication/authorization failures.
@ UNUSUAL_IO
Unusual I/O patterns (read/write volume).
@ CHAIN_BREAK
Hash chain integrity violation.
@ DECRYPTION_FAILURE
Unexpected decryption errors.
@ LATENCY_SPIKE
Unusual latency increase.
ResilienceTestType
Resilience test type.
@ STRESS_TEST
Load/stress beyond normal capacity.
@ RECOVERY_TEST
Test backup recovery procedures.
@ FAULT_INJECTION
Simulate component failure.
@ TLPT
Threat-led penetration test (Art. 26).
@ SCENARIO_BASED
Predefined failure scenario.
AssetCriticality
ICT asset criticality level per DORA Art. 8(1).
@ LOW
Non-critical, no significant impact if unavailable.
@ VITAL
Vital; unavailability threatens business continuity.
@ HIGH
Critical; direct impact on core business functions.
@ MEDIUM
Moderate impact; degraded service if unavailable.
AIRiskLevel
AI system risk classification per EU AI Act Art. 6.
@ MINIMAL
Minimal risk — no obligations.
@ HIGH
High risk — full compliance required.
@ UNACCEPTABLE
Unacceptable risk — prohibited.
@ LIMITED
Limited risk — transparency obligations.
LifecycleEventType
System lifecycle event type.
bool is_drifted(const DriftMetric &m)
Check if a drift metric exceeds its threshold.
bool is_expired(const RetentionPolicy &policy, int64_t data_created_ns, int64_t now_ns)
Check if data has exceeded its retention period.
bool requires_encryption(DataClassification c)
Check if a classification level requires encryption under GDPR Art.
void pseudonymize_hmac(const uint8_t *key, size_t key_size, const uint8_t *value, size_t value_size, char *out, size_t out_size)
Pseudonymize a value using HMAC-SHA256.
bool allows_pseudonymization(DataClassification c)
Check if a classification level allows pseudonymization.
PseudonymStrategy
Pseudonymization strategy.
@ HMAC_SHA256
HMAC-SHA256 hash (deterministic, irreversible).
@ RANDOM_TOKEN
Random token (non-deterministic, requires mapping table).
DataClassification
Data classification levels for GDPR compliance.
@ PSEUDONYMIZED
Already pseudonymized (Art. 4(5)).
@ INTERNAL
Internal business data, not personal.
@ ANONYMIZED
Fully anonymized — outside GDPR scope.
@ SENSITIVE
Special category data (GDPR Art. 9): health, race, religion.
@ PUBLIC
Non-personal, no restrictions.
@ PERSONAL
Personal data (GDPR Art. 4(1)): name, email, phone.
PolicyValidationResult validate_gdpr_policy(const std::vector< ColumnClassification > &classifications, const std::vector< std::string > &encrypted_columns)
Validate that all PII-classified columns have encryption keys.
bool has_gaps(const CompletenessAttestation &att)
Check if a reporting period has gaps.
bool validate_mic(const std::string &mic)
Validate a MIC (Market Identifier Code) per ISO 10383.
bool validate_lei(const std::string &lei)
Validate an LEI (Legal Entity Identifier) per ISO 17442.
bool validate_isin(const std::string &isin)
Validate an ISIN (International Securities Identification Number) per ISO 6166.
RiskCheckResult
Pre-trade risk check result.
@ REJECT
Order rejected by risk check — must not be sent.
@ PASS
Order passes all pre-trade risk checks.
@ THROTTLE
Order rate-limited — retry after cooldown.
RiskRejectReason
Reason for a risk check rejection.
@ MAX_ORDER_SIZE
Notional value exceeds single-order limit (RTS 6 Art. 17(1)(b)).
@ MAX_DAILY_VOLUME
Cumulative daily volume exceeds limit.
@ PRICE_COLLAR
Price outside allowed deviation from reference (RTS 6 Art. 17(1)(a)).
@ CUSTOM
Custom rejection reason (see reject_message).
@ NONE
No rejection (check passed).
@ MAX_MESSAGE_RATE
Order/cancel rate exceeds messages-per-second cap.
@ INSTRUMENT_BANNED
Instrument on restricted list.
PreTradeCheckResult check_order(const PreTradeRiskLimits &limits, double order_price, double reference_price, double order_notional, double daily_notional)
Perform a pre-trade risk check on a proposed order.
TimestampGranularity
Timestamp granularity for MiFID II RTS 24 Art.2(2) compliance.
@ NANOS
9 sub-second digits (default, MiFID II HFT compliant)
int64_t now_ns()
Return the current time as nanoseconds since the Unix epoch (UTC).
ComplianceStandard
Which regulatory standard a compliance report satisfies.
@ MIFID2_RTS24
MiFID II RTS 24 — algorithmic trading records.
@ EU_AI_ACT_ART13
EU AI Act Article 13 — transparency disclosure.
@ EU_AI_ACT_ART19
EU AI Act Article 19 — conformity assessment summary.
@ EU_AI_ACT_ART12
EU AI Act Article 12 — operational logging.
ReportFormat
Output serialization format for compliance reports.
@ JSON
Pretty-printed JSON object (default)
@ NDJSON
Newline-delimited JSON — one record per line (streaming-friendly)
@ CSV
Comma-separated values with header row.
The generated compliance report returned to the caller.
ComplianceStandard standard
Which regulation this report satisfies.
bool chain_verified
True if all log files' hash chains verified successfully.
std::string chain_id
Chain ID from the first log file processed.
std::string content
The report body — JSON object, NDJSON lines, or CSV text.
std::string period_start_iso
ISO 8601 representation of opts.start_ns.
int64_t generated_at_ns
Nanosecond timestamp at which the report was generated.
std::string report_id
Unique identifier for this report (auto-generated if not supplied).
ReportFormat format
Serialization format of content.
int64_t total_records
Number of records included in this report.
std::string generated_at_iso
UTC ISO 8601 timestamp at which the report was generated.
std::string period_end_iso
ISO 8601 representation of opts.end_ns (or "open" if unbounded).
std::vector< std::string > read_errors
H-20: Accumulated read errors from log files whose records could not be read.
bool incomplete_data
H-20: True if one or more log file batches could not be read.
Query and formatting parameters for compliance report generation.
ReportFormat format
Output serialization format.
int64_t start_ns
Inclusive start of the reporting period (nanoseconds since Unix epoch).
std::string bias_risks
Art.15: Known biases or fairness concerns.
TimestampGranularity timestamp_granularity
Timestamp sub-second granularity (MiFID II RTS 24 Art.2(2)).
int risk_level
Art.9: Risk classification level (1=minimal, 2=limited, 3=high, 4=unacceptable).
bool strict_source_reads
If true, any source-log read failure aborts report generation instead of producing an incomplete regu...
bool include_features
If true, include raw input feature vectors in the report output.
bool verify_chain
If true, verify the hash chain of each log file before generating the report and record the result in...
float low_confidence_threshold
Low-confidence threshold for EU AI Act anomaly counting.
int64_t end_ns
Inclusive end of the reporting period (nanoseconds since Unix epoch).
std::string provider_name
Art.13(3)(a): Provider name and contact information.
bool pretty_print
If true, emit human-readable indented JSON (2-space indent).
std::string known_limitations
Art.13(3)(b)(ii): Known limitations and foreseeable misuse risks.
int price_significant_digits
Significant digits for price fields (MiFID II RTS 24 Annex I Field 6).
std::string firm_id
Organisation / firm identifier for MiFID II field 1.
std::string report_id
Optional: unique identifier for this report filing.
std::string system_id
Logical identifier for the AI system being reported on.
std::string human_oversight_measures
Art.14: Human oversight measures description.
std::string instructions_for_use
Art.13(3)(b)(iv): Instructions for use / deployment guidance.
std::string intended_purpose
Art.13(3)(b)(i): Intended purpose of the AI system.
std::string accuracy_metrics
Art.15: Accuracy metrics description (e.g. "F1=0.94 on test set v3").
std::string component
Affected component.
double value
Observed metric value.
std::string anomaly_id
Unique anomaly identifier.
double threshold
Expected threshold.
std::string action_taken
Response action.
int64_t detected_ns
Detection timestamp.
Backup policy configuration per DORA Art. 12.
int64_t rpo_seconds
Recovery Point Objective (max data loss: default 1h).
bool integrity_check
Verify backup integrity after creation.
int64_t rto_seconds
Recovery Time Objective (max downtime: default 4h).
bool encryption_required
Backups must be encrypted.
std::string policy_id
Unique policy identifier.
int32_t retention_days
Backup retention period.
std::string storage_location
Backup storage location.
Backup record for audit trail.
std::string policy_id
Associated policy.
int64_t completed_ns
Backup completion timestamp.
std::string checksum
SHA-256 integrity hash.
int64_t started_ns
Backup start timestamp.
std::string backup_id
Unique backup identifier.
ICT asset descriptor for DORA Art.
std::string asset_id
Unique asset identifier.
std::string asset_type
Type: "data_store", "key_store", "pipeline", etc.
std::string asset_name
Human-readable name.
std::string location
Data center / cloud region.
std::string owner
Responsible person or team.
int64_t last_assessed_ns
Last risk assessment timestamp (ns since epoch).
std::string dependencies
Comma-separated dependent asset IDs.
ICT incident record for DORA Art. 19 reporting.
std::string incident_id
Unique incident identifier.
bool reported_to_authority
Art. 19 authority notification.
std::string description
Incident description.
int64_t detected_ns
Detection timestamp.
std::string impact
Business impact assessment.
std::string remediation
Remediation actions taken.
int64_t resolved_ns
Resolution timestamp (0 = ongoing).
std::string root_cause
Root cause (post-resolution).
std::string subject
Notification subject.
int64_t timestamp_ns
Notification timestamp.
std::string recipients
Comma-separated recipient list.
bool acknowledged
Whether the notification was acknowledged.
std::string message
Notification body.
std::string notification_id
Unique notification identifier.
ICT risk entry for the risk register.
std::string controls
Applied mitigating controls.
RiskLevel inherent_risk
Risk before controls.
int64_t last_reviewed_ns
Last review timestamp.
std::string risk_id
Unique risk identifier.
std::string description
Risk description.
int64_t next_review_ns
Next scheduled review.
RiskLevel residual_risk
Risk after controls.
Key lifecycle record for rotation tracking.
std::string algorithm
Algorithm: "AES-256-GCM", "AES-256-CTR", etc.
int64_t expiry_ns
Key expiry timestamp (crypto-period end).
std::string replaced_by
Key ID of replacement (after rotation).
int64_t created_ns
Key creation timestamp.
int64_t activation_ns
Key activation timestamp.
std::string key_id
Unique key identifier.
int64_t deactivation_ns
Key deactivation timestamp.
std::string review_id
Unique review identifier.
std::string lessons_learned
Key lessons learned.
std::string root_cause_analysis
Detailed root cause analysis.
int64_t review_date_ns
Review completion date.
std::string corrective_actions
Corrective actions planned/taken.
std::string preventive_measures
Measures to prevent recurrence.
std::string incident_id
Related incident ID.
int64_t last_tested_ns
Last drill/test timestamp.
std::string steps
Recovery steps (human-readable).
std::string trigger_condition
Condition that triggers this procedure.
int64_t rto_seconds
Recovery Time Objective (default 4h).
std::string procedure_id
Unique procedure identifier.
std::string responsible_team
Team responsible for execution.
Resilience test record for DORA Art. 24 compliance.
std::string findings
Findings and observations.
std::string scenario
Test scenario description.
int64_t executed_ns
Test execution timestamp.
std::string recommendations
Improvement recommendations.
std::string test_id
Unique test identifier.
Third-party ICT service provider risk entry.
std::string service_description
Services provided.
std::string exit_strategy
Exit/transition strategy.
RiskLevel concentration_risk
Concentration risk level.
std::string sbom_reference
CycloneDX SBOM reference (if applicable).
std::string contract_id
Contract reference.
int64_t contract_expiry_ns
Contract expiry timestamp.
std::string provider_name
Provider legal name.
bool critical_function
Supports critical or important functions.
std::string jurisdiction
Provider jurisdiction (country code).
std::string provider_id
Unique provider identifier.
AI risk assessment record per Art. 9.
std::string mitigation_measures
Measures to mitigate risks.
std::string risk_description
Description of identified risks.
std::string assessment_id
Unique assessment identifier.
std::string residual_risks
Remaining risks after mitigation.
Population Stability Index for drift detection.
std::string feature_name
Feature being monitored.
bool drifted
Whether drift was detected.
double psi
Population Stability Index.
int64_t measured_ns
Measurement timestamp.
double drift_threshold
PSI threshold for alert.
double ks_statistic
Kolmogorov-Smirnov statistic.
System lifecycle event record per Art. 12(2).
std::string event_id
Unique event identifier.
std::string new_state
State after the event.
std::string actor
Who/what triggered the event.
std::string description
Event description.
std::string previous_state
State before the event.
Model performance metric for Art. 15 accuracy monitoring.
std::string dataset_id
Dataset used for measurement.
std::string metric_name
E.g. "accuracy", "precision", "recall", "f1".
std::string environment
Production/staging/etc.
std::string metric_name
Metric being monitored.
std::string deployment_id
Deployment identifier.
QMS check point for AI system lifecycle.
bool approved
Whether the checkpoint was approved.
std::string checkpoint_id
Unique checkpoint identifier.
std::string model_version
AI model version.
std::string change_description
What changed since last checkpoint.
std::string data_quality_report
Data quality assessment.
int64_t timestamp_ns
Checkpoint timestamp.
std::string approver
Person/system that approved.
std::string report_id
Unique report identifier.
int64_t occurred_ns
When the incident occurred.
bool reported_to_authority
Submitted to market surveillance.
std::string harm_caused
Harm to health, safety, or rights.
Technical documentation record per Art. 11 and Annex IV.
std::string design_specifications
Design and development methodology.
std::string risk_management_ref
Reference to risk management (Art. 9).
std::string data_requirements
Data requirements and governance.
std::string system_description
General description of the AI system.
std::string validation_results
Validation and testing results.
Training data quality metrics per Art. 10.
int64_t temporal_coverage_start_ns
Earliest record timestamp.
std::string dataset_id
Training dataset identifier.
std::string preprocessing_steps
Data preprocessing description.
double completeness
Data completeness (0.0 - 1.0).
int64_t temporal_coverage_end_ns
Latest record timestamp.
double class_balance
Class balance ratio (0.0 - 1.0).
int64_t total_records
Total records in dataset.
Column-level data classification descriptor.
std::string purpose
Processing purpose (Art. 5(1)(b)).
int32_t retention_days
Max retention period in days (0 = unlimited).
std::string lawful_basis
Legal basis: "consent", "contract", "legal_obligation", etc.
std::string column_name
Parquet column path.
Data Protection Impact Assessment record per GDPR Art. 35.
bool approved
Whether the DPIA was approved.
int64_t completed_ns
DPIA completion timestamp.
std::string dpo_opinion
Data Protection Officer opinion.
std::string mitigation_measures
Measures to address risks.
std::string dpia_id
Unique DPIA identifier.
std::string risks_to_rights
Risks to rights and freedoms of data subjects.
std::string necessity_assessment
Assessment of necessity and proportionality.
std::string processing_description
Systematic description of processing.
Validation result for GDPR writer policy.
std::vector< std::string > violations
Column names that violate the policy.
bool compliant
True if all PII columns are encrypted.
Record of Processing Activity per GDPR Art. 30.
std::string third_country_transfers
Transfers outside EEA.
std::string lawful_basis
Legal basis: consent, contract, etc.
std::string security_measures
Description of Art. 32 measures.
int64_t last_updated_ns
Last update timestamp.
std::string recipients
Recipients of the data.
std::string activity_id
Unique activity identifier.
std::string controller_name
Name of the data controller.
std::string data_subject_categories
Categories of data subjects.
int32_t retention_days
Retention period in days.
std::string data_categories
Categories of personal data.
std::string purpose
Purpose of the processing.
std::string purpose
Processing purpose for audit.
int32_t output_hex_chars
Truncate hex output to N chars (0 = full 64).
Retention policy for a dataset or column.
std::string archive_location
Archive location before purge (empty = no archive).
int32_t retention_days
Max retention period (days).
std::string legal_hold_id
If non-empty, retention is suspended (legal hold).
std::string policy_id
Unique policy identifier.
bool auto_purge
Automatically purge expired data.
DSAR query parameters for finding subject data across files.
std::string subject_id_column
Column name containing the subject identifier.
std::vector< std::string > file_paths
Parquet files to search.
int64_t to_ns
Time range end (0 = no limit).
int64_t from_ns
Time range start (0 = no limit).
std::string subject_id
Data subject identifier (entity_id, user_id, etc.).
std::string processing_purposes
Purposes for which data is processed.
int64_t records_found
Number of records found.
std::string data_categories
Categories of data found.
bool exported
Whether data was exported for the subject.
int64_t completed_ns
Response completion timestamp.
std::string request_id
DSAR request identifier.
Annual self-assessment record per MiFID II Art. 17(2).
std::string remediation_plan
Plan to address findings.
bool submitted_to_nca
Submitted to national competent authority.
std::string assessment_id
Unique assessment identifier.
std::string risk_controls_review
Review of risk controls effectiveness.
std::string system_resilience_review
Review of system resilience.
std::string compliance_findings
Compliance findings.
std::string algo_trading_summary
Summary of algorithmic trading activities.
int64_t completed_ns
Assessment completion timestamp.
Completeness attestation for a reporting period.
bool complete
Whether the period is complete.
std::vector< std::pair< int64_t, int64_t > > gaps
Detected gaps (start_ns, end_ns).
int64_t expected_records
Expected number of records.
Order lifecycle event for tracing order chain.
std::string event_type
"ORDER_NEW", "ORDER_MODIFY", "ORDER_CANCEL", "ORDER_FILL".
std::string venue_mic
Execution venue MIC.
std::string order_id
Current order identifier.
std::string parent_order_id
Parent order ID (empty for new orders).
Report integrity binding — associates a compliance report with its tamper-evidence chain.
std::string chain_hash
SHA-256 hash of the chain entry.
int64_t chain_seq
Audit chain sequence number.
std::string report_id
Report identifier.
std::string content_hash
SHA-256 hash of the report content.
Signed report envelope for non-repudiation.
std::string signature
Digital signature (hex).
std::string report_id
Report identifier.
std::string signer_key_id
Key ID used for signing.
std::string algorithm
Signature algorithm ("HMAC-SHA256", "Ed25519", etc.).
std::string content
Report content (JSON/CSV).
Source file manifest entry for audit trail.
int64_t processed_ns
When the file was processed.
int64_t records_consumed
Number of records consumed from this file.
std::string file_path
Path to the source Parquet file.
std::string file_hash
SHA-256 hash of the file.
Result of a pre-trade risk check.
std::string message
Human-readable explanation (for audit trail).
Pre-trade risk limits configuration.
double max_order_notional
Max single-order notional value (default 1B).
int64_t max_messages_per_sec
Max order/cancel messages per second.
double max_daily_notional
Max cumulative daily notional (default 10B).
double price_collar_pct
Max % deviation from reference price (both sides).