heron-ai 0.2.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/bin/heron.js +31 -2
  2. package/dist/bin/heron.js.map +1 -1
  3. package/dist/src/analysis/analyzer.d.ts +1 -1
  4. package/dist/src/analysis/analyzer.d.ts.map +1 -1
  5. package/dist/src/analysis/analyzer.js +120 -6
  6. package/dist/src/analysis/analyzer.js.map +1 -1
  7. package/dist/src/analysis/risk-scorer.d.ts +32 -0
  8. package/dist/src/analysis/risk-scorer.d.ts.map +1 -1
  9. package/dist/src/analysis/risk-scorer.js +134 -0
  10. package/dist/src/analysis/risk-scorer.js.map +1 -1
  11. package/dist/src/commands/diff.d.ts +17 -0
  12. package/dist/src/commands/diff.d.ts.map +1 -0
  13. package/dist/src/commands/diff.js +63 -0
  14. package/dist/src/commands/diff.js.map +1 -0
  15. package/dist/src/compliance/control-mappings.d.ts +21 -0
  16. package/dist/src/compliance/control-mappings.d.ts.map +1 -0
  17. package/dist/src/compliance/control-mappings.js +182 -0
  18. package/dist/src/compliance/control-mappings.js.map +1 -0
  19. package/dist/src/compliance/frameworks.d.ts +24 -0
  20. package/dist/src/compliance/frameworks.d.ts.map +1 -0
  21. package/dist/src/compliance/frameworks.js +55 -0
  22. package/dist/src/compliance/frameworks.js.map +1 -0
  23. package/dist/src/compliance/index.d.ts +9 -0
  24. package/dist/src/compliance/index.d.ts.map +1 -0
  25. package/dist/src/compliance/index.js +8 -0
  26. package/dist/src/compliance/index.js.map +1 -0
  27. package/dist/src/compliance/mapper.d.ts +126 -0
  28. package/dist/src/compliance/mapper.d.ts.map +1 -0
  29. package/dist/src/compliance/mapper.js +443 -0
  30. package/dist/src/compliance/mapper.js.map +1 -0
  31. package/dist/src/compliance/types.d.ts +120 -0
  32. package/dist/src/compliance/types.d.ts.map +1 -0
  33. package/dist/src/compliance/types.js +99 -0
  34. package/dist/src/compliance/types.js.map +1 -0
  35. package/dist/src/diff/differ.d.ts +9 -0
  36. package/dist/src/diff/differ.d.ts.map +1 -0
  37. package/dist/src/diff/differ.js +52 -0
  38. package/dist/src/diff/differ.js.map +1 -0
  39. package/dist/src/interview/interviewer.d.ts +2 -0
  40. package/dist/src/interview/interviewer.d.ts.map +1 -1
  41. package/dist/src/interview/interviewer.js.map +1 -1
  42. package/dist/src/interview/protocol.d.ts.map +1 -1
  43. package/dist/src/interview/protocol.js +28 -5
  44. package/dist/src/interview/protocol.js.map +1 -1
  45. package/dist/src/interview/questions.d.ts.map +1 -1
  46. package/dist/src/interview/questions.js +55 -0
  47. package/dist/src/interview/questions.js.map +1 -1
  48. package/dist/src/llm/client.d.ts +26 -1
  49. package/dist/src/llm/client.d.ts.map +1 -1
  50. package/dist/src/llm/client.js +108 -15
  51. package/dist/src/llm/client.js.map +1 -1
  52. package/dist/src/llm/prompts.d.ts +27 -1
  53. package/dist/src/llm/prompts.d.ts.map +1 -1
  54. package/dist/src/llm/prompts.js +133 -1
  55. package/dist/src/llm/prompts.js.map +1 -1
  56. package/dist/src/report/generator.d.ts +1 -7
  57. package/dist/src/report/generator.d.ts.map +1 -1
  58. package/dist/src/report/generator.js +47 -236
  59. package/dist/src/report/generator.js.map +1 -1
  60. package/dist/src/report/templates.d.ts +2 -1
  61. package/dist/src/report/templates.d.ts.map +1 -1
  62. package/dist/src/report/templates.js +436 -84
  63. package/dist/src/report/templates.js.map +1 -1
  64. package/dist/src/report/types.d.ts +34 -19
  65. package/dist/src/report/types.d.ts.map +1 -1
  66. package/dist/src/report/types.js +8 -4
  67. package/dist/src/report/types.js.map +1 -1
  68. package/dist/src/server/index.d.ts +1 -1
  69. package/dist/src/server/index.d.ts.map +1 -1
  70. package/dist/src/server/index.js +212 -55
  71. package/dist/src/server/index.js.map +1 -1
  72. package/dist/src/server/sessions.d.ts +10 -0
  73. package/dist/src/server/sessions.d.ts.map +1 -1
  74. package/dist/src/server/sessions.js +73 -9
  75. package/dist/src/server/sessions.js.map +1 -1
  76. package/dist/src/util/provided.d.ts +49 -0
  77. package/dist/src/util/provided.d.ts.map +1 -0
  78. package/dist/src/util/provided.js +83 -0
  79. package/dist/src/util/provided.js.map +1 -0
  80. package/dist/src/util/systems.d.ts +15 -0
  81. package/dist/src/util/systems.d.ts.map +1 -0
  82. package/dist/src/util/systems.js +41 -0
  83. package/dist/src/util/systems.js.map +1 -0
  84. package/package.json +1 -1
  85. package/skills/heron-audit/bin/heron-update-check +13 -4
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Finding → framework-control mapping table.
3
+ *
4
+ * One entry per finding type. Each entry lists the controls that finding
5
+ * activates across every registered framework.
6
+ *
7
+ * Scope (2026-04-24): EU AI Act, GDPR, ISO/IEC 42001, AIUC-1, NIST AI RMF.
8
+ * EU AI Act controls tagged `annexIII: true` fire only when the system is
9
+ * classified as high-risk (previously lived in a separate
10
+ * `eu-ai-act-high-risk` framework entry that has now been merged into
11
+ * `eu-ai-act`). AIUC-1 controls may additionally carry `gatedBy` for
12
+ * architecture-specific signal filtering.
13
+ *
14
+ * Mappings are INDICATIVE — they surface which framework clauses a finding
15
+ * typically activates, not a certification that the controls are satisfied.
16
+ */
17
+ import type { ControlMapping, FindingType, FrameworkControl } from './types.js';
18
+ export declare const CONTROL_MAPPINGS: Record<FindingType, ControlMapping>;
19
+ export declare function getMapping(findingType: FindingType): ControlMapping;
20
+ export declare function controlsFor(findingType: FindingType, frameworkId: FrameworkControl['frameworkId']): FrameworkControl[];
21
+ //# sourceMappingURL=control-mappings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-mappings.d.ts","sourceRoot":"","sources":["../../../src/compliance/control-mappings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAahF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,CAuKhE,CAAC;AAIF,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,cAAc,CAEnE;AAED,wBAAgB,WAAW,CACzB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAC3C,gBAAgB,EAAE,CAIpB"}
@@ -0,0 +1,182 @@
1
+ /**
2
+ * Finding → framework-control mapping table.
3
+ *
4
+ * One entry per finding type. Each entry lists the controls that finding
5
+ * activates across every registered framework.
6
+ *
7
+ * Scope (2026-04-24): EU AI Act, GDPR, ISO/IEC 42001, AIUC-1, NIST AI RMF.
8
+ * EU AI Act controls tagged `annexIII: true` fire only when the system is
9
+ * classified as high-risk (previously lived in a separate
10
+ * `eu-ai-act-high-risk` framework entry that has now been merged into
11
+ * `eu-ai-act`). AIUC-1 controls may additionally carry `gatedBy` for
12
+ * architecture-specific signal filtering.
13
+ *
14
+ * Mappings are INDICATIVE — they surface which framework clauses a finding
15
+ * typically activates, not a certification that the controls are satisfied.
16
+ */
17
+ // ─── Tiny builder to keep the data table readable ──────────────────────────
18
+ const c = (frameworkId, controlId, note, opts) => ({ frameworkId, controlId, note, ...opts });
19
+ // ─── Mappings by finding type ──────────────────────────────────────────────
20
+ export const CONTROL_MAPPINGS = {
21
+ 'excessive-access': {
22
+ findingType: 'excessive-access',
23
+ category: 'privacy',
24
+ summary: 'Agent has been granted scopes or resource access beyond what its stated purpose requires (least-privilege violation).',
25
+ controls: [
26
+ c('iso-42001', 'A.6.2.6', 'Access controls for AI system resources.'),
27
+ c('iso-42001', 'A.6.2.5', 'Restrict AI system resource interactions.'),
28
+ c('iso-42001', 'A.9.2', 'Internal audit of AI management system.'),
29
+ c('eu-ai-act', 'Art. 9(2)(a)', 'Risk management — identification and analysis (high-risk baseline reference).'),
30
+ c('eu-ai-act', 'Art. 15(4-5)', 'Accuracy and robustness — resilience to misuse (baseline reference).'),
31
+ c('gdpr', 'Art. 25', 'Data protection by design and by default.'),
32
+ // ── AIUC-1 (Q2-2026) ──
33
+ c('aiuc-1', 'A003.3', 'Agent has its own non-human identity separate from the invoking user.'),
34
+ c('aiuc-1', 'A003.4', 'Agent scopes bounded by least-privilege for its stated task.'),
35
+ c('aiuc-1', 'B007', 'User-level access privileges enforced for every agent action.'),
36
+ c('aiuc-1', 'B008.2', 'MCP / A2A interfaces require authentication, encrypted transport, and integrity protection.', { gatedBy: ['hasMCPOrA2A'] }),
37
+ // ── NIST AI RMF (voluntary) ──
38
+ c('nist-ai-rmf', 'MAP 3.2', 'Map context of use — identify access scope.'),
39
+ c('nist-ai-rmf', 'GOVERN 6.1', 'Policies for organizational risk governance.'),
40
+ c('nist-ai-rmf', 'MEASURE 2.7', 'Evaluate AI system trustworthiness metrics.'),
41
+ c('nist-ai-rmf', 'MANAGE 1.2', 'Treat and respond to identified risks.'),
42
+ ],
43
+ },
44
+ 'write-risk': {
45
+ findingType: 'write-risk',
46
+ category: 'consumer-protection',
47
+ summary: 'Agent performs write operations — especially irreversible or unapproved ones — that can affect users or downstream systems.',
48
+ controls: [
49
+ c('iso-42001', 'A.6.2.4', 'Controls for AI system operational changes.'),
50
+ c('iso-42001', 'A.6.2.8', 'Logging and monitoring of AI system actions.'),
51
+ c('iso-42001', 'A.5.3', 'Roles and responsibilities for AI operations.'),
52
+ c('eu-ai-act', 'Art. 14(4)(d)', 'Human oversight — override/stop function (baseline).'),
53
+ c('eu-ai-act', 'Art. 9(6)-(7)', 'Risk management testing before deployment (baseline reference).'),
54
+ // ── AIUC-1 (Q2-2026) ──
55
+ c('aiuc-1', 'B006', 'Unauthorized agent actions blocked at the tool/effect boundary.'),
56
+ c('aiuc-1', 'D003', 'Restrict unsafe tool-calls: allowlist tools, validate arguments, refuse destructive ops without approval.'),
57
+ c('aiuc-1', 'E015.2', 'Log every sub-agent and tool-call invocation with inputs, outputs, and principal.', { gatedBy: ['hasSubAgents'] }),
58
+ c('aiuc-1', 'F001', 'Prevent cyber misuse: stop the agent from being used to harvest credentials, exfiltrate data, or launch attacks.'),
59
+ // ── NIST AI RMF (voluntary) ──
60
+ c('nist-ai-rmf', 'MAP 3.5', 'Map risks from AI-induced actions and side-effects.'),
61
+ c('nist-ai-rmf', 'MANAGE 2.4', 'Manage residual risk from AI system operations.'),
62
+ c('nist-ai-rmf', 'GOVERN 1.7', 'Processes for escalating AI-driven actions.'),
63
+ ],
64
+ },
65
+ 'sensitive-data': {
66
+ findingType: 'sensitive-data',
67
+ category: 'privacy',
68
+ summary: 'Agent processes personal, health, financial, or otherwise sensitive data — activates data-protection statutes.',
69
+ controls: [
70
+ c('iso-42001', 'A.7.4', 'Data quality and integrity for AI systems.'),
71
+ c('iso-42001', 'A.7.5', 'Sensitive data handling procedures.'),
72
+ c('iso-42001', 'A.5.4', 'Privacy impact considerations in AI lifecycle.'),
73
+ // ── EU AI Act baseline (Art. 50 transparency) ──
74
+ c('eu-ai-act', 'Art. 50(1)', 'Transparency — inform affected persons.'),
75
+ // ── EU AI Act Annex III (high-risk data governance) ──
76
+ c('eu-ai-act', 'Art. 10(1-5)', 'Data governance for high-risk AI systems — training/validation/test sets.', { annexIII: true }),
77
+ c('eu-ai-act', 'Art. 13', 'Transparency and provision of information (high-risk).', { annexIII: true }),
78
+ c('eu-ai-act', 'Art. 15', 'Accuracy, robustness, cybersecurity (high-risk).', { annexIII: true }),
79
+ c('gdpr', 'Art. 6', 'Lawful basis for processing.'),
80
+ c('gdpr', 'Art. 35', 'DPIA for high-risk processing.'),
81
+ c('gdpr', 'Art. 33', '72-hour breach notification.'),
82
+ // ── AIUC-1 (Q2-2026) ──
83
+ c('aiuc-1', 'A001', 'Input data policy: document lawful basis, sources, and allowed uses.'),
84
+ c('aiuc-1', 'A002', 'Output data policy: govern retention, downstream sharing, and deletion.'),
85
+ c('aiuc-1', 'A005', "Cross-customer isolation: one customer's data never leaks into another's session, cache, logs, or fine-tune set.", { gatedBy: ['hasCrossCustomer'] }),
86
+ c('aiuc-1', 'A006', 'PII leakage prevention: redaction and output filtering for personal data.'),
87
+ // ── NIST AI RMF (voluntary) ──
88
+ c('nist-ai-rmf', 'MEASURE 2.10', 'Privacy risk — measure and document impacts.'),
89
+ c('nist-ai-rmf', 'GOVERN 1.1', 'Policies for AI risk management established.'),
90
+ c('nist-ai-rmf', 'MAP 5.1', 'Likelihood and impact of privacy harms mapped.'),
91
+ ],
92
+ },
93
+ 'scope-creep': {
94
+ findingType: 'scope-creep',
95
+ category: 'consumer-protection',
96
+ summary: 'Agent\'s requested permissions exceed what is needed for the stated purpose — a precursor to unintended use.',
97
+ controls: [
98
+ c('iso-42001', 'A.6.2.6', 'Access controls — restrict scope to purpose.'),
99
+ c('iso-42001', 'A.5.2', 'AI policy covers purpose limitation.'),
100
+ c('eu-ai-act', 'Art. 9(1)', 'Risk management system — continuous obligation (baseline).'),
101
+ c('eu-ai-act', 'Art. 72', 'Post-market monitoring plan (baseline reference).'),
102
+ c('eu-ai-act', 'Art. 11', 'Technical documentation (baseline reference).'),
103
+ c('gdpr', 'Art. 5(1)(b)', 'Purpose limitation.'),
104
+ // ── NIST AI RMF (voluntary) ──
105
+ c('nist-ai-rmf', 'MEASURE 2.4', 'Measure scientific merit and scope of AI system.'),
106
+ c('nist-ai-rmf', 'MEASURE 3.1', 'Measure effectiveness of risk response.'),
107
+ c('nist-ai-rmf', 'MAP 1.6', 'Map intended and potential unintended uses.'),
108
+ ],
109
+ },
110
+ 'regulatory-flags': {
111
+ findingType: 'regulatory-flags',
112
+ category: 'sector-specific',
113
+ summary: 'Agent operates in a regulated domain (employment, credit, insurance, health, housing, education, legal) that triggers domain-specific obligations.',
114
+ controls: [
115
+ c('iso-42001', 'A.5.2', 'AI policy addresses sector-specific obligations.'),
116
+ c('iso-42001', 'A.9.3', 'Management review includes regulatory findings.'),
117
+ // ── EU AI Act baseline ──
118
+ c('eu-ai-act', 'Art. 12', 'Record-keeping for regulated contexts (baseline).'),
119
+ // ── EU AI Act Annex III (high-risk regulated domains) ──
120
+ c('eu-ai-act', 'Art. 6(2) + Annex III', 'High-risk classification — regulated sector reference.', { annexIII: true }),
121
+ c('eu-ai-act', 'Art. 43', 'Conformity assessment for high-risk systems.', { annexIII: true }),
122
+ c('eu-ai-act', 'Art. 49', 'EU database registration (high-risk).', { annexIII: true }),
123
+ c('eu-ai-act', 'Art. 9', 'Risk management system (high-risk).', { annexIII: true }),
124
+ c('eu-ai-act', 'Art. 11', 'Technical documentation (high-risk).', { annexIII: true }),
125
+ c('eu-ai-act', 'Art. 12', 'Record-keeping obligations (high-risk).', { annexIII: true }),
126
+ // ── NIST AI RMF (voluntary) ──
127
+ c('nist-ai-rmf', 'GOVERN 1.1', 'Policies for AI risk management established.'),
128
+ c('nist-ai-rmf', 'MAP 4.1', 'Map organizational risk tolerance to AI risks.'),
129
+ c('nist-ai-rmf', 'GOVERN 3.2', 'Processes for regulatory compliance tracking.'),
130
+ ],
131
+ },
132
+ 'risk-score': {
133
+ findingType: 'risk-score',
134
+ category: 'consumer-protection',
135
+ summary: 'Overall composite risk-score methodology — anchors the headline rating to published risk-management frameworks.',
136
+ controls: [
137
+ c('iso-42001', 'Clause 6.1', 'Actions to address risks and opportunities.'),
138
+ c('eu-ai-act', 'Art. 9(2)(b)', 'Risk management — estimation and evaluation (baseline).'),
139
+ c('eu-ai-act', 'Art. 9(8)', 'Risk management system documented and up-to-date (baseline).'),
140
+ // ── NIST AI RMF (voluntary) — anchors the composite score methodology ──
141
+ c('nist-ai-rmf', 'MANAGE 1.2', 'Treat and respond to identified risks.'),
142
+ c('nist-ai-rmf', 'MEASURE 1.1', 'Identify and document AI risk measurement methods.'),
143
+ ],
144
+ },
145
+ 'decisions-about-people': {
146
+ findingType: 'decisions-about-people',
147
+ category: 'consumer-protection',
148
+ summary: 'Agent makes or materially influences automated decisions affecting individuals (employment, credit, access, etc.).',
149
+ controls: [
150
+ c('iso-42001', 'A.9.3', 'Management review includes decision-impact findings.'),
151
+ // ── EU AI Act baseline (transparency + baseline oversight) ──
152
+ c('eu-ai-act', 'Art. 50(1)', 'Transparency — inform affected persons.'),
153
+ c('eu-ai-act', 'Art. 14(4)(d)', 'Human oversight — baseline override/stop function.'),
154
+ // ── EU AI Act Annex III (full high-risk obligations) ──
155
+ c('eu-ai-act', 'Art. 6(2) + Annex III', 'High-risk classification reference.', { annexIII: true }),
156
+ c('eu-ai-act', 'Art. 9', 'Risk management system (high-risk).', { annexIII: true }),
157
+ c('eu-ai-act', 'Art. 10', 'Data governance (high-risk).', { annexIII: true }),
158
+ c('eu-ai-act', 'Art. 14', 'Human oversight — full high-risk obligations.', { annexIII: true }),
159
+ c('eu-ai-act', 'Art. 27', 'FRIA — deployers (public bodies).', { annexIII: true }),
160
+ c('eu-ai-act', 'Art. 43', 'Conformity assessment.', { annexIII: true }),
161
+ c('eu-ai-act', 'Art. 49', 'EU database registration.', { annexIII: true }),
162
+ c('eu-ai-act', 'Art. 72', 'Post-market monitoring.', { annexIII: true }),
163
+ c('gdpr', 'Art. 22', 'Right not to be subject to solely automated decisions.'),
164
+ // ── AIUC-1 (Q2-2026) ──
165
+ c('aiuc-1', 'C007', 'Human-in-the-loop review for consequential decisions.'),
166
+ c('aiuc-1', 'C009', 'Real-time override: operator can halt or reverse agent decisions live.'),
167
+ c('aiuc-1', 'E004', 'Assigned accountability: a named owner is responsible for agent behaviour.'),
168
+ c('aiuc-1', 'E016', 'AI disclosure: inform affected persons that an AI agent is involved.'),
169
+ // ── NIST AI RMF (voluntary) ──
170
+ c('nist-ai-rmf', 'GOVERN 1.1', 'Policies for AI risk management established.'),
171
+ c('nist-ai-rmf', 'MAP 4.1', 'Map organizational risk tolerance to AI risks.'),
172
+ ],
173
+ },
174
+ };
175
+ // ─── Convenience accessors ──────────────────────────────────────────────────
176
+ export function getMapping(findingType) {
177
+ return CONTROL_MAPPINGS[findingType];
178
+ }
179
+ export function controlsFor(findingType, frameworkId) {
180
+ return CONTROL_MAPPINGS[findingType].controls.filter((ctrl) => ctrl.frameworkId === frameworkId);
181
+ }
182
+ //# sourceMappingURL=control-mappings.js.map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;AACvC,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,WAAwB,EACxB,WAA4C;IAE5C,OAAO,gBAAgB,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAClD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,KAAK,WAAW,CAC3C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Framework metadata registry.
3
+ *
4
+ * Separation of concerns:
5
+ * - frameworks.ts — WHAT each framework is (name, tier, jurisdiction).
6
+ * - control-mappings.ts — WHICH controls a given finding activates.
7
+ *
8
+ * Scope (2026-04-24): 5 frameworks — 2 mandatory (EU AI Act, GDPR) + 3
9
+ * voluntary (ISO/IEC 42001, AIUC-1, NIST AI RMF). EU AI Act is a single
10
+ * entry; high-risk (Annex III) status is a classification stored per-audit
11
+ * rather than a separate framework.
12
+ */
13
+ import type { Framework, FrameworkId, Jurisdiction } from './types.js';
14
+ export declare const FRAMEWORKS: Record<FrameworkId, Framework>;
15
+ export declare function getFramework(id: FrameworkId): Framework;
16
+ export declare function listMandatoryFrameworks(): Framework[];
17
+ export declare function listVoluntaryFrameworks(): Framework[];
18
+ /**
19
+ * Return frameworks that are mandatory in the given jurisdiction. Used by the
20
+ * jurisdictional appendix renderer to show, e.g., "Frameworks that apply to
21
+ * EU-domiciled processing".
22
+ */
23
+ export declare function frameworksFor(jurisdiction: Jurisdiction): Framework[];
24
+ //# sourceMappingURL=frameworks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frameworks.d.ts","sourceRoot":"","sources":["../../../src/compliance/frameworks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAyBvE,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAmCrD,CAAC;AAIF,wBAAgB,YAAY,CAAC,EAAE,EAAE,WAAW,GAAG,SAAS,CAEvD;AAED,wBAAgB,uBAAuB,IAAI,SAAS,EAAE,CAErD;AAED,wBAAgB,uBAAuB,IAAI,SAAS,EAAE,CAErD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,YAAY,GAAG,SAAS,EAAE,CAIrE"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Framework metadata registry.
3
+ *
4
+ * Separation of concerns:
5
+ * - frameworks.ts — WHAT each framework is (name, tier, jurisdiction).
6
+ * - control-mappings.ts — WHICH controls a given finding activates.
7
+ *
8
+ * Scope (2026-04-24): 5 frameworks — 2 mandatory (EU AI Act, GDPR) + 3
9
+ * voluntary (ISO/IEC 42001, AIUC-1, NIST AI RMF). EU AI Act is a single
10
+ * entry; high-risk (Annex III) status is a classification stored per-audit
11
+ * rather than a separate framework.
12
+ */
13
+ // ─── Builder helpers ────────────────────────────────────────────────────────
14
+ function mandatory(id, name, mandatoryIn, extras = { primarySource: '' }) {
15
+ return { id, name, tier: 'mandatory', mandatoryIn, ...extras };
16
+ }
17
+ function voluntary(id, name, primarySource, summary, scopeNote) {
18
+ return { id, name, tier: 'voluntary', mandatoryIn: [], primarySource, summary, scopeNote };
19
+ }
20
+ // ─── Registry ───────────────────────────────────────────────────────────────
21
+ export const FRAMEWORKS = {
22
+ // ── Mandatory, EU-wide ───────────────────────────────────────────────────
23
+ 'eu-ai-act': mandatory('eu-ai-act', 'EU AI Act', ['EU'], {
24
+ primarySource: 'https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=OJ:L_202401689',
25
+ summary: 'Regulation (EU) 2024/1689. Applies to providers, deployers, importers, distributors, and product manufacturers where the AI system is placed on the EU market or its output is used in the EU. Risk-tiered obligations: prohibited practices (Art. 5), high-risk (Art. 6 + Annex III — Art. 9-15, 27, 43, 49, 72), limited-risk transparency (Art. 50), minimal-risk.',
26
+ scopeNote: 'Prohibited practices (Art. 5) in force since 2025-02-02. GPAI obligations since 2025-08-02. High-risk Annex III obligations and Art. 50 transparency effective 2026-08-02. Art. 6(3) exemption requires one of 4 enumerated conditions AND no material influence on decision outcomes; profiling of natural persons is ALWAYS high-risk across ALL Annex III categories (Art. 6(3) final paragraph). Classification for a given audit is surfaced as a scope label in the report.',
27
+ }),
28
+ gdpr: mandatory('gdpr', 'GDPR', ['EU'], {
29
+ primarySource: 'https://eur-lex.europa.eu/eli/reg/2016/679/oj',
30
+ summary: 'Regulation (EU) 2016/679. Lawful basis, DPIA, data-subject rights.',
31
+ }),
32
+ // ── Voluntary / best-practice ────────────────────────────────────────────
33
+ 'iso-42001': voluntary('iso-42001', 'ISO/IEC 42001', 'https://www.iso.org/standard/81230.html', 'AI management system standard. Annex A controls (A.5–A.9).'),
34
+ 'aiuc-1': voluntary('aiuc-1', 'AIUC-1', 'https://www.aiuc-1.com/', 'Agent-native compliance standard. Six domains: A Data & Privacy, B Security, C Safety, D Reliability, E Accountability, F Society.', 'Quarterly releases (Jan/Apr/Jul/Oct 15). Pinned to 2026-04-15 (Q2-2026) release.'),
35
+ 'nist-ai-rmf': voluntary('nist-ai-rmf', 'NIST AI RMF', 'https://www.nist.gov/itl/ai-risk-management-framework', 'US-origin voluntary AI risk-management framework. Four functions: GOVERN (org policies + accountability), MAP (context + risk identification), MEASURE (analyze + track risks), MANAGE (prioritize + respond).', 'AI RMF 1.0 (January 2023) + Generative AI Profile NIST-AI-600-1 (July 2024). Widely cited by US federal agencies (OMB M-24-10) and enterprise procurement.'),
36
+ };
37
+ // ─── Convenience accessors ──────────────────────────────────────────────────
38
+ export function getFramework(id) {
39
+ return FRAMEWORKS[id];
40
+ }
41
+ export function listMandatoryFrameworks() {
42
+ return Object.values(FRAMEWORKS).filter((f) => f.tier === 'mandatory');
43
+ }
44
+ export function listVoluntaryFrameworks() {
45
+ return Object.values(FRAMEWORKS).filter((f) => f.tier === 'voluntary');
46
+ }
47
+ /**
48
+ * Return frameworks that are mandatory in the given jurisdiction. Used by the
49
+ * jurisdictional appendix renderer to show, e.g., "Frameworks that apply to
50
+ * EU-domiciled processing".
51
+ */
52
+ export function frameworksFor(jurisdiction) {
53
+ return Object.values(FRAMEWORKS).filter((f) => f.mandatoryIn.includes(jurisdiction));
54
+ }
55
+ //# sourceMappingURL=frameworks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frameworks.js","sourceRoot":"","sources":["../../../src/compliance/frameworks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,+EAA+E;AAE/E,SAAS,SAAS,CAChB,EAAe,EACf,IAAY,EACZ,WAA2B,EAC3B,SAA0E,EAAE,aAAa,EAAE,EAAE,EAAE;IAE/F,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,CAAC;AACjE,CAAC;AAED,SAAS,SAAS,CAChB,EAAe,EACf,IAAY,EACZ,aAAqB,EACrB,OAAgB,EAChB,SAAkB;IAElB,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAC7F,CAAC;AAED,+EAA+E;AAE/E,MAAM,CAAC,MAAM,UAAU,GAAmC;IACxD,4EAA4E;IAC5E,WAAW,EAAE,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,CAAC,IAAI,CAAC,EAAE;QACvD,aAAa,EAAE,oEAAoE;QACnF,OAAO,EACL,uWAAuW;QACzW,SAAS,EACP,mdAAmd;KACtd,CAAC;IACF,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;QACtC,aAAa,EAAE,+CAA+C;QAC9D,OAAO,EAAE,oEAAoE;KAC9E,CAAC;IAEF,4EAA4E;IAC5E,WAAW,EAAE,SAAS,CACpB,WAAW,EACX,eAAe,EACf,yCAAyC,EACzC,4DAA4D,CAC7D;IACD,QAAQ,EAAE,SAAS,CACjB,QAAQ,EACR,QAAQ,EACR,yBAAyB,EACzB,oIAAoI,EACpI,kFAAkF,CACnF;IACD,aAAa,EAAE,SAAS,CACtB,aAAa,EACb,aAAa,EACb,uDAAuD,EACvD,gNAAgN,EAChN,4JAA4J,CAC7J;CACF,CAAC;AAEF,+EAA+E;AAE/E,MAAM,UAAU,YAAY,CAAC,EAAe;IAC1C,OAAO,UAAU,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;AACzE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,YAA0B;IACtD,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAC5C,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,CACrC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Barrel — re-exports the public surface of the AAP-31 compliance module.
3
+ */
4
+ export * from './types.js';
5
+ export { FRAMEWORKS, getFramework, listMandatoryFrameworks, listVoluntaryFrameworks, frameworksFor, } from './frameworks.js';
6
+ export { CONTROL_MAPPINGS, getMapping, controlsFor } from './control-mappings.js';
7
+ export { classifyDecisionImpact, detectSignals, mapFindingsToRiskCategories, } from './mapper.js';
8
+ export type { CategorizedBucket, CategorizedCompliance, ComplianceSignals, DecisionImpact, FlagSeverity, MapperInput, TypedRegulatoryFlag, } from './mapper.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/compliance/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,UAAU,EACV,YAAY,EACZ,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,WAAW,EACX,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Barrel — re-exports the public surface of the AAP-31 compliance module.
3
+ */
4
+ export * from './types.js';
5
+ export { FRAMEWORKS, getFramework, listMandatoryFrameworks, listVoluntaryFrameworks, frameworksFor, } from './frameworks.js';
6
+ export { CONTROL_MAPPINGS, getMapping, controlsFor } from './control-mappings.js';
7
+ export { classifyDecisionImpact, detectSignals, mapFindingsToRiskCategories, } from './mapper.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/compliance/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,UAAU,EACV,YAAY,EACZ,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,2BAA2B,GAC5B,MAAM,aAAa,CAAC"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Maps raw audit signals (systems, transcript, decision metadata) onto the
3
+ * framework-control bundles defined in `./control-mappings.ts`.
4
+ *
5
+ * Output shape: `CategorizedCompliance`, grouped by mandatoriness
6
+ * (mandatory vs voluntary) and risk category (privacy / IP /
7
+ * consumer-protection / sector-specific). The report template renders
8
+ * this directly.
9
+ *
10
+ * Post-AAP-42 scope (2026-04-23):
11
+ * - Framework gating is simpler — only 3 frameworks (EU AI Act, GDPR,
12
+ * ISO/IEC 42001). All fire whenever the finding fires; no
13
+ * jurisdiction-specific statutes to narrow-scope.
14
+ * - EU AI Act controls tagged `annexIII: true` are gated per-control by
15
+ * the detected Annex III signals (biometrics, education, employment,
16
+ * essential services, law enforcement). This replaces the prior
17
+ * two-framework split (`eu-ai-act` + `eu-ai-act-high-risk`).
18
+ * - The overall EU AI Act classification is computed once per audit and
19
+ * attached to the `CategorizedCompliance` output so the report can show
20
+ * a single "EU AI Act — High-Risk (Annex III §3 Education)" label
21
+ * instead of two separate framework blocks.
22
+ */
23
+ import type { QAPair, RegulatoryFlag, SystemAssessment } from '../report/types.js';
24
+ import type { EUAIActClassification, FindingType, FrameworkId, FrameworkTier, Jurisdiction, RiskCategory } from './types.js';
25
+ export type DecisionImpact = 'high' | 'medium' | 'unclear' | 'none';
26
+ export declare function classifyDecisionImpact(decidesAboutPeople: boolean, details?: string): DecisionImpact;
27
+ export interface ComplianceSignals {
28
+ hasSensitivePII: boolean;
29
+ hasPublicPII: boolean;
30
+ hasPII: boolean;
31
+ hasHealth: boolean;
32
+ hasEmploymentDecisions: boolean;
33
+ hasWriteOps: boolean;
34
+ hasIrreversibleWrites: boolean;
35
+ hasExcessivePerms: boolean;
36
+ hasScopeCreep: boolean;
37
+ hasOrgBlast: boolean;
38
+ hasOrgBlastWithWrites: boolean;
39
+ decisionImpact: DecisionImpact;
40
+ businessSystems: SystemAssessment[];
41
+ hasBiometricSignal: boolean;
42
+ isEducationAssessmentContext: boolean;
43
+ isLawEnforcementContext: boolean;
44
+ hasEssentialServicesSignal: boolean;
45
+ /** True if automated decisions affect people (regardless of impact tier). */
46
+ hasDecisionsAboutPeople: boolean;
47
+ /** Data likely crosses EU borders (transcript mentions transfer/US-based processor). */
48
+ hasInternationalTransfer: boolean;
49
+ /** Agent uses third-party SaaS processors (triggers Art. 28 DPA obligation). */
50
+ hasExternalProcessors: boolean;
51
+ /** Heuristic: >=3 business systems OR >=1 org-wide blast radius system. */
52
+ hasLargeScaleProcessing: boolean;
53
+ hasMCPOrA2A: boolean;
54
+ hasSubAgents: boolean;
55
+ hasCrossCustomer: boolean;
56
+ }
57
+ export declare function detectSignals(systems: SystemAssessment[], transcript: QAPair[], decidesAboutPeople: boolean, decisionMakingDetails?: string): ComplianceSignals;
58
+ export interface EUAIActClassificationResult {
59
+ classification: EUAIActClassification;
60
+ /** Human-readable category labels that triggered the classification (Annex III §1, §3, etc.). */
61
+ annexIIICategories: string[];
62
+ }
63
+ /**
64
+ * Compute the EU AI Act classification for the audit based on detected signals.
65
+ *
66
+ * This replaces the prior two-framework-entry model where high-risk was a
67
+ * separate framework ID. Now it is a scope label on the single `eu-ai-act`
68
+ * framework entry. Called once per audit and attached to the output.
69
+ *
70
+ * Prohibited / minimal tiers are out-of-scope for v1 signal detection; we
71
+ * surface `high-risk` if any Annex III signal matches, otherwise `limited`
72
+ * (which maps to Art. 50 transparency obligations only).
73
+ */
74
+ export declare function classifyEUAIAct(signals: ComplianceSignals): EUAIActClassificationResult;
75
+ export type FlagSeverity = 'info' | 'warning' | 'action-required' | 'clarification-needed';
76
+ export interface TypedRegulatoryFlag extends RegulatoryFlag {
77
+ frameworkId: FrameworkId;
78
+ /** All controls from this framework activated by the triggering finding. */
79
+ controlIds: string[];
80
+ category: RiskCategory;
81
+ tier: FrameworkTier;
82
+ mandatoryIn: Jurisdiction[];
83
+ scopeNote?: string;
84
+ triggeredBy: FindingType;
85
+ /**
86
+ * EU AI Act only: the classification label relevant to this flag
87
+ * (e.g. "high-risk" if this flag was activated by Annex III gating).
88
+ * Undefined for non-EU-AI-Act flags.
89
+ */
90
+ euAiActClassification?: EUAIActClassification;
91
+ }
92
+ export interface CategorizedBucket {
93
+ privacy: TypedRegulatoryFlag[];
94
+ ip: TypedRegulatoryFlag[];
95
+ 'consumer-protection': TypedRegulatoryFlag[];
96
+ 'sector-specific': TypedRegulatoryFlag[];
97
+ }
98
+ export interface CategorizedCompliance {
99
+ mappingVersion: string;
100
+ mandatory: CategorizedBucket;
101
+ voluntary: CategorizedBucket;
102
+ /** Frameworks actually activated — drives the jurisdictional appendix. */
103
+ frameworksActivated: FrameworkId[];
104
+ /** Flat list for backward-compat consumers. */
105
+ all: TypedRegulatoryFlag[];
106
+ /**
107
+ * EU AI Act classification for this audit, with the Annex III categories
108
+ * (if any) that triggered the high-risk tier. Always present — drives the
109
+ * single-entry EU AI Act display (replaces the old two-entry split).
110
+ */
111
+ euAiActClassification: EUAIActClassificationResult;
112
+ /**
113
+ * AAP-43 P1: detected signals exposed so renderers can gate conditional
114
+ * content (e.g. GDPR obligations table rows, regulatory overall status).
115
+ * Read-only snapshot of the signals that produced the flags above.
116
+ */
117
+ signals: ComplianceSignals;
118
+ }
119
+ export interface MapperInput {
120
+ systems: SystemAssessment[];
121
+ transcript: QAPair[];
122
+ makesDecisionsAboutPeople?: boolean;
123
+ decisionMakingDetails?: string;
124
+ }
125
+ export declare function mapFindingsToRiskCategories(input: MapperInput): CategorizedCompliance;
126
+ //# sourceMappingURL=mapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../src/compliance/mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EACV,MAAM,EACN,cAAc,EACd,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAEV,qBAAqB,EACrB,WAAW,EAGX,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACb,M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