@grc-claw/compliance-orchestrator 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts ADDED
@@ -0,0 +1,208 @@
1
+ export type FrameworkCode =
2
+ | 'iso27001' | 'nist-csf' | 'soc2' | 'iso42001' | 'eu-ai-act'
3
+ | 'dora' | 'nis2' | 'hipaa' | 'pci-dss' | 'fedramp' | 'cmmc'
4
+ | 'gdpr' | 'lgpd' | 'pipl' | 'tisax' | 'popia';
5
+
6
+ export interface ControlNode {
7
+ id: string;
8
+ framework: FrameworkCode;
9
+ code: string;
10
+ title: string;
11
+ description: string;
12
+ family: string;
13
+ severity: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
14
+ dependencies: string[];
15
+ evidenceRequirements: EvidenceRequirement[];
16
+ testLogic?: TestLogic;
17
+ remediation?: RemediationTemplate;
18
+ }
19
+
20
+ export interface EvidenceRequirement {
21
+ type: 'screenshot' | 'log' | 'config' | 'certificate' | 'policy' | 'attestation' | 'scan' | 'automated' | 'document';
22
+ source: string;
23
+ freshness: string;
24
+ cryptographic?: boolean;
25
+ }
26
+
27
+ export interface TestLogic {
28
+ type: 'rego' | 'sql' | 'typescript' | 'yaml' | 'external';
29
+ code: string;
30
+ inputs: Record<string, string>;
31
+ expectedOutput: unknown;
32
+ }
33
+
34
+ export interface RemediationTemplate {
35
+ type: 'terraform' | 'aws-cli' | 'azure-cli' | 'gcp-cli' | 'kubernetes' | 'manual' | 'script';
36
+ code: string;
37
+ rollbackCode?: string;
38
+ estimatedTime: string;
39
+ riskLevel: 'low' | 'medium' | 'high';
40
+ }
41
+
42
+ export interface CrosswalkEntry {
43
+ sourceFramework: FrameworkCode;
44
+ sourceControl: string;
45
+ targetFramework: FrameworkCode;
46
+ targetControl: string;
47
+ relationship: 'equivalent' | 'stronger' | 'weaker' | 'subset' | 'superset';
48
+ confidence: number;
49
+ }
50
+
51
+ export interface RegulationAST {
52
+ id: string;
53
+ framework: FrameworkCode;
54
+ version: string;
55
+ compiledAt: string;
56
+ controls: ASTControlNode[];
57
+ crosswalks: CrosswalkEntry[];
58
+ metadata: RegulationMetadata;
59
+ }
60
+
61
+ export interface ASTControlNode {
62
+ id: string;
63
+ code: string;
64
+ title: string;
65
+ severity?: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
66
+ ast: PolicyAST;
67
+ crossRefs: string[];
68
+ evidenceChain: EvidenceChain;
69
+ }
70
+
71
+ export interface PolicyAST {
72
+ type: 'conjunction' | 'disjunction' | 'implication' | 'negation' | 'atom';
73
+ operator?: string;
74
+ children?: PolicyAST[];
75
+ atom?: PolicyAtom;
76
+ }
77
+
78
+ export interface PolicyAtom {
79
+ subject: string;
80
+ predicate: string;
81
+ object: string;
82
+ constraints: Record<string, unknown>;
83
+ }
84
+
85
+ export interface EvidenceChain {
86
+ required: EvidenceRequirement[];
87
+ collected: CollectedEvidence[];
88
+ validUntil: string;
89
+ }
90
+
91
+ export interface CollectedEvidence {
92
+ id: string;
93
+ controlId: string;
94
+ type: string;
95
+ source: string;
96
+ hash: string;
97
+ timestamp: string;
98
+ valid: boolean;
99
+ verifiedBy?: string;
100
+ }
101
+
102
+ export interface RegulationMetadata {
103
+ title: string;
104
+ issuer: string;
105
+ publishedAt: string;
106
+ effectiveAt: string;
107
+ totalControls: number;
108
+ families: string[];
109
+ }
110
+
111
+ export interface ComplianceState {
112
+ orgId: string;
113
+ timestamp: string;
114
+ framework: FrameworkCode;
115
+ overallScore: number;
116
+ controlStatuses: ControlStatus[];
117
+ drift: DriftEvent[];
118
+ risks: RiskAssessment[];
119
+ }
120
+
121
+ export interface ControlStatus {
122
+ controlId: string;
123
+ status: 'compliant' | 'non-compliant' | 'partial' | 'not-applicable' | 'not-tested';
124
+ lastVerified: string;
125
+ evidenceCount: number;
126
+ score: number;
127
+ issues: ControlIssue[];
128
+ }
129
+
130
+ export interface ControlIssue {
131
+ id: string;
132
+ severity: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
133
+ description: string;
134
+ detectedAt: string;
135
+ remediation?: RemediationTemplate;
136
+ }
137
+
138
+ export interface DriftEvent {
139
+ id: string;
140
+ controlId: string;
141
+ detectedAt: string;
142
+ type: 'configuration' | 'policy' | 'evidence' | 'access' | 'network';
143
+ before: unknown;
144
+ after: unknown;
145
+ severity: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
146
+ autoRemediated: boolean;
147
+ remediationId?: string;
148
+ }
149
+
150
+ export interface RiskAssessment {
151
+ controlId: string;
152
+ riskScore: number;
153
+ blastRadius: number;
154
+ likelihood: number;
155
+ impact: number;
156
+ factors: string[];
157
+ }
158
+
159
+ export interface CompliancePlan {
160
+ id: string;
161
+ orgId: string;
162
+ framework: FrameworkCode;
163
+ createdAt: string;
164
+ actions: PlanAction[];
165
+ estimatedCost: number;
166
+ estimatedDuration: string;
167
+ }
168
+
169
+ export interface PlanAction {
170
+ id: string;
171
+ controlId: string;
172
+ action: 'create' | 'update' | 'delete' | 'verify' | 'remediate';
173
+ resource: string;
174
+ before?: unknown;
175
+ after?: unknown;
176
+ evidenceRequired: string[];
177
+ sla: string;
178
+ owner?: string;
179
+ }
180
+
181
+ export interface ComplianceAudit {
182
+ id: string;
183
+ orgId: string;
184
+ framework: FrameworkCode;
185
+ startedAt: string;
186
+ completedAt?: string;
187
+ controls: AuditControlResult[];
188
+ summary: AuditSummary;
189
+ }
190
+
191
+ export interface AuditControlResult {
192
+ controlId: string;
193
+ status: 'pass' | 'fail' | 'skip' | 'error';
194
+ evidence: CollectedEvidence[];
195
+ issues: ControlIssue[];
196
+ duration: number;
197
+ }
198
+
199
+ export interface AuditSummary {
200
+ totalControls: number;
201
+ passed: number;
202
+ failed: number;
203
+ skipped: number;
204
+ errors: number;
205
+ complianceScore: number;
206
+ criticalFindings: number;
207
+ highFindings: number;
208
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "lib": ["ES2022"],
7
+ "outDir": "./dist",
8
+ "rootDir": "./src",
9
+ "strict": true,
10
+ "esModuleInterop": true,
11
+ "skipLibCheck": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "declaration": true,
14
+ "declarationMap": true,
15
+ "sourceMap": true,
16
+ "resolveJsonModule": true,
17
+ "allowSyntheticDefaultImports": true
18
+ },
19
+ "include": ["src/**/*"],
20
+ "exclude": ["node_modules", "dist"]
21
+ }
@@ -0,0 +1 @@
1
+ {"root":["./src/index.ts","./src/test.ts","./src/types.ts","./src/compiler/RegulationASTCompiler.ts","./src/graph/UnifiedComplianceGraph.ts","./src/reasoner/NeuroSymbolicReasoner.ts"],"version":"5.9.3"}