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.
- package/dist/bin/heron.js +31 -2
- package/dist/bin/heron.js.map +1 -1
- package/dist/src/analysis/analyzer.d.ts +1 -1
- package/dist/src/analysis/analyzer.d.ts.map +1 -1
- package/dist/src/analysis/analyzer.js +120 -6
- package/dist/src/analysis/analyzer.js.map +1 -1
- package/dist/src/analysis/risk-scorer.d.ts +32 -0
- package/dist/src/analysis/risk-scorer.d.ts.map +1 -1
- package/dist/src/analysis/risk-scorer.js +134 -0
- package/dist/src/analysis/risk-scorer.js.map +1 -1
- package/dist/src/commands/diff.d.ts +17 -0
- package/dist/src/commands/diff.d.ts.map +1 -0
- package/dist/src/commands/diff.js +63 -0
- package/dist/src/commands/diff.js.map +1 -0
- package/dist/src/compliance/control-mappings.d.ts +21 -0
- package/dist/src/compliance/control-mappings.d.ts.map +1 -0
- package/dist/src/compliance/control-mappings.js +182 -0
- package/dist/src/compliance/control-mappings.js.map +1 -0
- package/dist/src/compliance/frameworks.d.ts +24 -0
- package/dist/src/compliance/frameworks.d.ts.map +1 -0
- package/dist/src/compliance/frameworks.js +55 -0
- package/dist/src/compliance/frameworks.js.map +1 -0
- package/dist/src/compliance/index.d.ts +9 -0
- package/dist/src/compliance/index.d.ts.map +1 -0
- package/dist/src/compliance/index.js +8 -0
- package/dist/src/compliance/index.js.map +1 -0
- package/dist/src/compliance/mapper.d.ts +126 -0
- package/dist/src/compliance/mapper.d.ts.map +1 -0
- package/dist/src/compliance/mapper.js +443 -0
- package/dist/src/compliance/mapper.js.map +1 -0
- package/dist/src/compliance/types.d.ts +120 -0
- package/dist/src/compliance/types.d.ts.map +1 -0
- package/dist/src/compliance/types.js +99 -0
- package/dist/src/compliance/types.js.map +1 -0
- package/dist/src/diff/differ.d.ts +9 -0
- package/dist/src/diff/differ.d.ts.map +1 -0
- package/dist/src/diff/differ.js +52 -0
- package/dist/src/diff/differ.js.map +1 -0
- package/dist/src/interview/interviewer.d.ts +2 -0
- package/dist/src/interview/interviewer.d.ts.map +1 -1
- package/dist/src/interview/interviewer.js.map +1 -1
- package/dist/src/interview/protocol.d.ts.map +1 -1
- package/dist/src/interview/protocol.js +28 -5
- package/dist/src/interview/protocol.js.map +1 -1
- package/dist/src/interview/questions.d.ts.map +1 -1
- package/dist/src/interview/questions.js +55 -0
- package/dist/src/interview/questions.js.map +1 -1
- package/dist/src/llm/client.d.ts +26 -1
- package/dist/src/llm/client.d.ts.map +1 -1
- package/dist/src/llm/client.js +108 -15
- package/dist/src/llm/client.js.map +1 -1
- package/dist/src/llm/prompts.d.ts +27 -1
- package/dist/src/llm/prompts.d.ts.map +1 -1
- package/dist/src/llm/prompts.js +133 -1
- package/dist/src/llm/prompts.js.map +1 -1
- package/dist/src/report/generator.d.ts +1 -7
- package/dist/src/report/generator.d.ts.map +1 -1
- package/dist/src/report/generator.js +47 -236
- package/dist/src/report/generator.js.map +1 -1
- package/dist/src/report/templates.d.ts +2 -1
- package/dist/src/report/templates.d.ts.map +1 -1
- package/dist/src/report/templates.js +436 -84
- package/dist/src/report/templates.js.map +1 -1
- package/dist/src/report/types.d.ts +34 -19
- package/dist/src/report/types.d.ts.map +1 -1
- package/dist/src/report/types.js +8 -4
- package/dist/src/report/types.js.map +1 -1
- package/dist/src/server/index.d.ts +1 -1
- package/dist/src/server/index.d.ts.map +1 -1
- package/dist/src/server/index.js +212 -55
- package/dist/src/server/index.js.map +1 -1
- package/dist/src/server/sessions.d.ts +10 -0
- package/dist/src/server/sessions.d.ts.map +1 -1
- package/dist/src/server/sessions.js +73 -9
- package/dist/src/server/sessions.js.map +1 -1
- package/dist/src/util/provided.d.ts +49 -0
- package/dist/src/util/provided.d.ts.map +1 -0
- package/dist/src/util/provided.js +83 -0
- package/dist/src/util/provided.js.map +1 -0
- package/dist/src/util/systems.d.ts +15 -0
- package/dist/src/util/systems.d.ts.map +1 -0
- package/dist/src/util/systems.js +41 -0
- package/dist/src/util/systems.js.map +1 -0
- package/package.json +1 -1
- package/skills/heron-audit/bin/heron-update-check +13 -4
|
@@ -0,0 +1,443 @@
|
|
|
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 { CONTROL_MAPPINGS } from './control-mappings.js';
|
|
24
|
+
import { FRAMEWORKS } from './frameworks.js';
|
|
25
|
+
import { MAPPING_VERSION } from './types.js';
|
|
26
|
+
import { isBusinessSystem } from '../util/systems.js';
|
|
27
|
+
export function classifyDecisionImpact(decidesAboutPeople, details) {
|
|
28
|
+
if (!decidesAboutPeople)
|
|
29
|
+
return 'none';
|
|
30
|
+
if (!details || details === 'NOT PROVIDED' || details.trim().length < 10)
|
|
31
|
+
return 'unclear';
|
|
32
|
+
const text = details.toLowerCase();
|
|
33
|
+
const highImpact = /\b(hir(e|ing)|recruit|screen.?candidate|reject|deny|approv(e|al|ing).*(loan|credit|mortgage|claim|application)|terminat|fir(e|ing)|credit.?scor|insurance.?claim|diagnos|prescri|legal.?decision|sentenc|parole|bail|evict|expel|suspend|disqualif|ban\b|block.?user|delist)\b/i;
|
|
34
|
+
if (highImpact.test(text))
|
|
35
|
+
return 'high';
|
|
36
|
+
const mediumImpact = /\b(scor(e|ing)|rank|filter|recommend|prioriti[sz]|moderate|flag|qualif(y|ied)|match|sort|categori[sz]|segment|lead|prospect|outreach|target|personali[sz])\b/i;
|
|
37
|
+
if (mediumImpact.test(text))
|
|
38
|
+
return 'medium';
|
|
39
|
+
return 'unclear';
|
|
40
|
+
}
|
|
41
|
+
// EU AI Act Annex III §1 — biometric identification/categorisation/emotion recognition.
|
|
42
|
+
const BIOMETRIC_PATTERN = new RegExp('\\b(' + [
|
|
43
|
+
'biometric|facial.?recognition|face.?recognit',
|
|
44
|
+
'voiceprint|voice.?biometric|speaker.?recognit',
|
|
45
|
+
'fingerprint|iris|retina|gait',
|
|
46
|
+
'emotion.?recognition|affect.?detect',
|
|
47
|
+
'liveness|anti.?spoof',
|
|
48
|
+
].join('|') + ')\\b', 'i');
|
|
49
|
+
// EU AI Act Annex III §3 — education/vocational training assessment.
|
|
50
|
+
const EDUCATION_ASSESSMENT_PATTERN = new RegExp('\\b(' + [
|
|
51
|
+
'student.?evaluation|grading|exam.?scoring|exam.?proctor',
|
|
52
|
+
'admission|enrollment|school.?assignment',
|
|
53
|
+
'academic.?assessment|learning.?assessment',
|
|
54
|
+
'vocational.?training|apprenticeship',
|
|
55
|
+
].join('|') + ')\\b', 'i');
|
|
56
|
+
// EU AI Act Annex III §6 — law enforcement.
|
|
57
|
+
const LAW_ENFORCEMENT_PATTERN = new RegExp('\\b(' + [
|
|
58
|
+
'law.?enforcement|police|prosecut',
|
|
59
|
+
'criminal.?investigation|criminal.?justice',
|
|
60
|
+
'border|immigration|asylum',
|
|
61
|
+
'parole|recidivism|sentenc',
|
|
62
|
+
'predictive.?policing',
|
|
63
|
+
].join('|') + ')\\b', 'i');
|
|
64
|
+
// EU AI Act Annex III §5 — access to essential public/private services.
|
|
65
|
+
// §5(a) public assistance benefits eligibility, §5(b) credit scoring/creditworthiness,
|
|
66
|
+
// §5(c) emergency service dispatch, §5(d) health/life insurance risk assessment.
|
|
67
|
+
const ESSENTIAL_SERVICES_PATTERN = new RegExp('(?:' + [
|
|
68
|
+
'\\bcredit(?:\\s*scor|worthiness|\\s*rating)', // §5(b) credit scoring / creditworthiness
|
|
69
|
+
'\\b(?:benefit|eligib|welfare|social\\s*service|public\\s*assistance)\\b',
|
|
70
|
+
'\\b(?:emergency|911|triage|dispatch)\\b',
|
|
71
|
+
'\\b(?:life\\s*insur|health\\s*insur|insur(?:ance)?\\s*pric|insur(?:ance)?\\s*risk|underwrit)',
|
|
72
|
+
].join('|') + ')', 'i');
|
|
73
|
+
// isBusinessSystem lives in src/util/systems.ts (shared across report, analyzer, mapper).
|
|
74
|
+
export function detectSignals(systems, transcript, decidesAboutPeople, decisionMakingDetails) {
|
|
75
|
+
const allText = transcript.map((qa) => qa.answer.toLowerCase()).join(' ');
|
|
76
|
+
const hasSensitivePII = /\b(ssn|passport|social.?security|date.?of.?birth|dob|bank.?account|credit.?card|driver.?licen[sc]e|tax.?id|national.?id)\b/i.test(allText);
|
|
77
|
+
const hasPublicPII = /\b(pii|personal|email|name|phone|address|linkedin|profile|title|company)\b/i.test(allText);
|
|
78
|
+
const hasPII = hasSensitivePII || hasPublicPII;
|
|
79
|
+
const hasMedicalTerms = /\b(medical|patient|hipaa|diagnosis|prescription|clinical|ehr|emr|phi\b|protected.?health)\b/i.test(allText);
|
|
80
|
+
const hasHealthInContext = /\b(health)\b/i.test(allText) &&
|
|
81
|
+
!/health.?check|health.?endpoint|health.?status|health.?ping|health(y|ier)/i.test(allText) &&
|
|
82
|
+
/\b(data|record|information|system|care|provider)\b/i.test(allText);
|
|
83
|
+
const hasHealth = hasMedicalTerms || hasHealthInContext;
|
|
84
|
+
// AAP-43 P1 #4: employment-decision signal must be gated on the explicit
|
|
85
|
+
// `decidesAboutPeople` interview flag. A regex-only match on transcript
|
|
86
|
+
// words like "employer" or "candidate" fired Annex III §4 on agents that
|
|
87
|
+
// never made employment decisions (e.g. curriculum-generation agents).
|
|
88
|
+
//
|
|
89
|
+
// AAP-43 post-merge fix (2026-04-24): the gate still fails on a common
|
|
90
|
+
// shape — the LinkedIn ICP agent answers Q13 with negations like
|
|
91
|
+
// "does not involve hiring, credit scoring..." — the keyword is present
|
|
92
|
+
// but its meaning is negated. Two guards:
|
|
93
|
+
// 1. Trust `decisionMakingDetails` first (the LLM-extracted summary
|
|
94
|
+
// field). If it is provided and does NOT match the regex, do not
|
|
95
|
+
// fall back to `allText`; the structured field already represents
|
|
96
|
+
// the agent's self-classification.
|
|
97
|
+
// 2. If we must use `allText`, scrub negation windows (`does not
|
|
98
|
+
// involve <keyword>`, `not a <keyword>`, `never <keyword>`) before
|
|
99
|
+
// matching.
|
|
100
|
+
const employmentRegex = /\b(hir(e|ing)?|recruit(er|ing)?|employ(ee|er|ment)?|candidates?|resumes?|applicants?)\b/i;
|
|
101
|
+
// Negation-stripping regex: scrub a short window (up to 3 filler words)
|
|
102
|
+
// between the negation cue and the employment keyword. Covers:
|
|
103
|
+
// - "does not involve hiring"
|
|
104
|
+
// - "did not include any candidates"
|
|
105
|
+
// - "is not a hiring agent"
|
|
106
|
+
// - "is not an employment-screening tool"
|
|
107
|
+
// - "not used for recruiting"
|
|
108
|
+
// - "never hires"
|
|
109
|
+
// - "this agent is not about hiring"
|
|
110
|
+
const EMPLOYMENT_KW = '(?:hir(?:e|ing)?|recruit(?:er|ing)?|employ(?:ee|er|ment)?|candidates?|resumes?|applicants?)';
|
|
111
|
+
const FILL = '(?:\\w+(?:[- ]\\w+){0,2}\\s+){0,3}';
|
|
112
|
+
const negationStrippingRegex = new RegExp([
|
|
113
|
+
// auxiliary + not + (optional filler up to 3 words) + keyword
|
|
114
|
+
`\\b(?:does|do|did|is|are|was|were|has|have|had|doesn't|don't|didn't|isn't|aren't|wasn't|weren't|hasn't|haven't|hadn't)\\s+not\\s+${FILL}${EMPLOYMENT_KW}`,
|
|
115
|
+
// "no" or "never" + up to 3 words + keyword
|
|
116
|
+
`\\b(?:no|never)\\s+${FILL}${EMPLOYMENT_KW}`,
|
|
117
|
+
// bare "not" + up to 3 words + keyword ("not a hiring", "not about hiring")
|
|
118
|
+
`\\bnot\\s+${FILL}${EMPLOYMENT_KW}`,
|
|
119
|
+
].join('|'), 'gi');
|
|
120
|
+
const detailsHasEmployment = typeof decisionMakingDetails === 'string' &&
|
|
121
|
+
decisionMakingDetails.length > 0 &&
|
|
122
|
+
employmentRegex.test(decisionMakingDetails.replace(negationStrippingRegex, ' '));
|
|
123
|
+
const detailsExplicitlyNonEmployment = typeof decisionMakingDetails === 'string' &&
|
|
124
|
+
decisionMakingDetails.length > 10 &&
|
|
125
|
+
!employmentRegex.test(decisionMakingDetails.replace(negationStrippingRegex, ' '));
|
|
126
|
+
const allTextScrubbed = allText.replace(negationStrippingRegex, ' ');
|
|
127
|
+
const hasEmploymentDecisions = decidesAboutPeople && (detailsHasEmployment ||
|
|
128
|
+
(!detailsExplicitlyNonEmployment && employmentRegex.test(allTextScrubbed)));
|
|
129
|
+
const combinedText = (decisionMakingDetails ?? '') + ' ' + allText;
|
|
130
|
+
const hasBiometricSignal = BIOMETRIC_PATTERN.test(allText);
|
|
131
|
+
const isEducationAssessmentContext = EDUCATION_ASSESSMENT_PATTERN.test(combinedText);
|
|
132
|
+
const isLawEnforcementContext = LAW_ENFORCEMENT_PATTERN.test(combinedText);
|
|
133
|
+
const hasEssentialServicesSignal = ESSENTIAL_SERVICES_PATTERN.test(combinedText);
|
|
134
|
+
// ── AIUC-1 architecture signals (AAP-44) ──────────────────────────────
|
|
135
|
+
// Sourced from transcript text (answers to Q11–15). Used for per-control
|
|
136
|
+
// `gatedBy` filtering so that AIUC-1 controls only render when the
|
|
137
|
+
// corresponding architecture is actually in play.
|
|
138
|
+
const hasMCPOrA2A = /\bmcp\b|model\s+context\s+protocol|\ba2a\b|agent-to-agent|agent\s+to\s+agent/i.test(allText);
|
|
139
|
+
const hasSubAgents = /\bsub-?agent|chain(?:ed|s|ing)?\s+tool|spawn(?:s|ed|ing)?\s+(?:a\s+)?(?:sub-?)?agent|delegate[sd]?\s+to\s+(?:another\s+)?agent|tool\s+orchestrat/i.test(allText);
|
|
140
|
+
const hasCrossCustomer = /\bmulti-?tenant|multi-?customer|shared\s+deployment|multiple\s+customers|multiple\s+tenants|cross-?tenant|cross-?customer/i.test(allText);
|
|
141
|
+
const businessSystems = systems.filter(isBusinessSystem);
|
|
142
|
+
const hasWriteOps = businessSystems.some((s) => s.writeOperations.length > 0);
|
|
143
|
+
const hasIrreversibleWrites = businessSystems.some((s) => s.writeOperations.some((w) => !w.reversible));
|
|
144
|
+
const hasExcessivePerms = businessSystems.some((s) => s.scopesDelta.length > 0);
|
|
145
|
+
const hasScopeCreep = businessSystems.some((s) => s.scopesNeeded.length > 0 &&
|
|
146
|
+
s.scopesRequested.length > s.scopesNeeded.length);
|
|
147
|
+
const hasOrgBlast = businessSystems.some((s) => s.blastRadius === 'org-wide' || s.blastRadius === 'cross-tenant');
|
|
148
|
+
const hasOrgBlastWithWrites = hasOrgBlast && hasWriteOps;
|
|
149
|
+
const decisionImpact = classifyDecisionImpact(decidesAboutPeople, decisionMakingDetails);
|
|
150
|
+
// AAP-43 P1 #3: conditional GDPR signals
|
|
151
|
+
const hasDecisionsAboutPeople = decidesAboutPeople && decisionImpact !== 'none';
|
|
152
|
+
const transferRegex = /\b(transfer(s|red|ring)?|cross.?border|international(ly)?|outside.?(the.?)?(eu|eea)|US.?based.?(service|provider|processor)|third.?country)\b/i;
|
|
153
|
+
const hasInternationalTransfer = transferRegex.test(allText) ||
|
|
154
|
+
// Any business system that is a well-known US-based SaaS → likely cross-border.
|
|
155
|
+
businessSystems.some((s) => /\b(google|apify|openai|anthropic|telegram|slack|stripe|hubspot|salesforce|vercel|aws|azure|gcp|github|linear)\b/i.test(s.systemId));
|
|
156
|
+
const hasExternalProcessors = businessSystems.length > 0;
|
|
157
|
+
const hasLargeScaleProcessing = businessSystems.length >= 3 ||
|
|
158
|
+
businessSystems.some((s) => s.blastRadius === 'org-wide' || s.blastRadius === 'cross-tenant');
|
|
159
|
+
return {
|
|
160
|
+
hasSensitivePII,
|
|
161
|
+
hasPublicPII,
|
|
162
|
+
hasPII,
|
|
163
|
+
hasHealth,
|
|
164
|
+
hasEmploymentDecisions,
|
|
165
|
+
hasWriteOps,
|
|
166
|
+
hasIrreversibleWrites,
|
|
167
|
+
hasExcessivePerms,
|
|
168
|
+
hasScopeCreep,
|
|
169
|
+
hasOrgBlast,
|
|
170
|
+
hasOrgBlastWithWrites,
|
|
171
|
+
decisionImpact,
|
|
172
|
+
businessSystems,
|
|
173
|
+
hasBiometricSignal,
|
|
174
|
+
isEducationAssessmentContext,
|
|
175
|
+
isLawEnforcementContext,
|
|
176
|
+
hasEssentialServicesSignal,
|
|
177
|
+
hasDecisionsAboutPeople,
|
|
178
|
+
hasInternationalTransfer,
|
|
179
|
+
hasExternalProcessors,
|
|
180
|
+
hasLargeScaleProcessing,
|
|
181
|
+
hasMCPOrA2A,
|
|
182
|
+
hasSubAgents,
|
|
183
|
+
hasCrossCustomer,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
// ─── EU AI Act classification ───────────────────────────────────────────────
|
|
187
|
+
/**
|
|
188
|
+
* Return true if at least one Annex III category signal matches for the given
|
|
189
|
+
* finding type. Used both to gate individual `annexIII: true` controls and to
|
|
190
|
+
* compute the overall EU AI Act classification for the audit.
|
|
191
|
+
*/
|
|
192
|
+
function isAnnexIIIApplicableForFinding(findingType, signals) {
|
|
193
|
+
// §1 — biometrics: tied to sensitive-data
|
|
194
|
+
if (findingType === 'sensitive-data' &&
|
|
195
|
+
signals.hasSensitivePII &&
|
|
196
|
+
signals.hasBiometricSignal) {
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
// §3 — education/training assessment: tied to decisions-about-people + regulatory-flags
|
|
200
|
+
if ((findingType === 'decisions-about-people' ||
|
|
201
|
+
findingType === 'regulatory-flags') &&
|
|
202
|
+
signals.isEducationAssessmentContext) {
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
// §4 — employment decisions: tied to decisions-about-people
|
|
206
|
+
if (findingType === 'decisions-about-people' &&
|
|
207
|
+
signals.hasEmploymentDecisions &&
|
|
208
|
+
signals.decisionImpact !== 'none') {
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
211
|
+
// §5 — access to essential services: tied to high-impact decisions
|
|
212
|
+
if (findingType === 'decisions-about-people' &&
|
|
213
|
+
signals.hasEssentialServicesSignal &&
|
|
214
|
+
signals.decisionImpact === 'high') {
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
// §6 — law enforcement: tied to decisions-about-people + regulatory-flags
|
|
218
|
+
if ((findingType === 'decisions-about-people' ||
|
|
219
|
+
findingType === 'regulatory-flags') &&
|
|
220
|
+
signals.isLawEnforcementContext) {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Compute the EU AI Act classification for the audit based on detected signals.
|
|
227
|
+
*
|
|
228
|
+
* This replaces the prior two-framework-entry model where high-risk was a
|
|
229
|
+
* separate framework ID. Now it is a scope label on the single `eu-ai-act`
|
|
230
|
+
* framework entry. Called once per audit and attached to the output.
|
|
231
|
+
*
|
|
232
|
+
* Prohibited / minimal tiers are out-of-scope for v1 signal detection; we
|
|
233
|
+
* surface `high-risk` if any Annex III signal matches, otherwise `limited`
|
|
234
|
+
* (which maps to Art. 50 transparency obligations only).
|
|
235
|
+
*/
|
|
236
|
+
export function classifyEUAIAct(signals) {
|
|
237
|
+
const categories = [];
|
|
238
|
+
if (signals.hasBiometricSignal && signals.hasSensitivePII)
|
|
239
|
+
categories.push('§1 biometric');
|
|
240
|
+
if (signals.isEducationAssessmentContext)
|
|
241
|
+
categories.push('§3 education');
|
|
242
|
+
if (signals.hasEmploymentDecisions && signals.decisionImpact !== 'none')
|
|
243
|
+
categories.push('§4 employment');
|
|
244
|
+
if (signals.hasEssentialServicesSignal && signals.decisionImpact === 'high')
|
|
245
|
+
categories.push('§5 essential services');
|
|
246
|
+
if (signals.isLawEnforcementContext)
|
|
247
|
+
categories.push('§6 law enforcement');
|
|
248
|
+
if (categories.length > 0) {
|
|
249
|
+
return { classification: 'high-risk', annexIIICategories: categories };
|
|
250
|
+
}
|
|
251
|
+
// No Annex III signals — fall back to limited-risk (Art. 50 transparency only).
|
|
252
|
+
return { classification: 'limited', annexIIICategories: [] };
|
|
253
|
+
}
|
|
254
|
+
function emptyBucket() {
|
|
255
|
+
return {
|
|
256
|
+
privacy: [],
|
|
257
|
+
ip: [],
|
|
258
|
+
'consumer-protection': [],
|
|
259
|
+
'sector-specific': [],
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
// ─── Jurisdictional disclaimer appender ────────────────────────────────────
|
|
263
|
+
function disclaimerFor(frameworkId, baseDescription) {
|
|
264
|
+
switch (frameworkId) {
|
|
265
|
+
case 'gdpr':
|
|
266
|
+
return `${baseDescription} Applies if offering goods/services to EU data subjects or monitoring EU-based behaviour (Art. 3(2)).`;
|
|
267
|
+
case 'eu-ai-act':
|
|
268
|
+
return `${baseDescription} Applies if placing AI on the EU market, if you are an EU-established deployer, or if outputs are used in the EU.`;
|
|
269
|
+
case 'iso-42001':
|
|
270
|
+
return baseDescription;
|
|
271
|
+
default:
|
|
272
|
+
return baseDescription;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
// ─── Per-finding description builder ───────────────────────────────────────
|
|
276
|
+
function describeFinding(findingType, framework, controlIds, signals, decisionDetails) {
|
|
277
|
+
const ids = controlIds.join(', ');
|
|
278
|
+
switch (findingType) {
|
|
279
|
+
case 'excessive-access':
|
|
280
|
+
return {
|
|
281
|
+
severity: 'warning',
|
|
282
|
+
description: `Agent holds permissions beyond stated need. Activates ${framework.name} controls (${ids}). Narrow scopes to the minimum required.`,
|
|
283
|
+
};
|
|
284
|
+
case 'scope-creep':
|
|
285
|
+
return {
|
|
286
|
+
severity: 'warning',
|
|
287
|
+
description: `Requested scopes exceed stated needs across one or more systems. Activates ${framework.name} controls (${ids}). Review purpose-limitation and change-management process.`,
|
|
288
|
+
};
|
|
289
|
+
case 'sensitive-data': {
|
|
290
|
+
const sev = signals.hasSensitivePII
|
|
291
|
+
? 'action-required'
|
|
292
|
+
: 'info';
|
|
293
|
+
const qualifier = signals.hasSensitivePII
|
|
294
|
+
? 'sensitive personal data (government IDs, financial identifiers)'
|
|
295
|
+
: 'personal data';
|
|
296
|
+
return {
|
|
297
|
+
severity: sev,
|
|
298
|
+
description: `Agent processes ${qualifier}. Activates ${framework.name} controls (${ids}). Ensure lawful basis, data minimization, and breach-readiness.`,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
case 'write-risk': {
|
|
302
|
+
const sev = signals.hasIrreversibleWrites || signals.hasOrgBlastWithWrites
|
|
303
|
+
? 'warning'
|
|
304
|
+
: 'info';
|
|
305
|
+
const qualifier = signals.hasIrreversibleWrites
|
|
306
|
+
? 'Irreversible write operations detected. '
|
|
307
|
+
: signals.hasOrgBlastWithWrites
|
|
308
|
+
? 'Org-wide blast radius with write access. '
|
|
309
|
+
: 'Write operations detected. ';
|
|
310
|
+
return {
|
|
311
|
+
severity: sev,
|
|
312
|
+
description: `${qualifier}Activates ${framework.name} controls (${ids}). Require approval, monitoring, and rollback paths for high-impact operations.`,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
case 'regulatory-flags':
|
|
316
|
+
return {
|
|
317
|
+
severity: 'clarification-needed',
|
|
318
|
+
description: `Agent may operate in a regulated domain (employment, credit, insurance, health, housing, education, legal). Activates ${framework.name} controls (${ids}). Clarify the agent's domain to determine obligations.`,
|
|
319
|
+
};
|
|
320
|
+
case 'risk-score':
|
|
321
|
+
return {
|
|
322
|
+
severity: 'info',
|
|
323
|
+
description: `Overall risk rating is anchored to ${framework.name} risk-management controls (${ids}). See Methodology.`,
|
|
324
|
+
};
|
|
325
|
+
case 'decisions-about-people': {
|
|
326
|
+
const impact = signals.decisionImpact;
|
|
327
|
+
if (impact === 'high') {
|
|
328
|
+
const employment = /\b(hir(e|ing)?|recruit(er|ing)?|employ(ee|er|ment)?|candidates?|resumes?|applicants?)\b/i.test(decisionDetails ?? '');
|
|
329
|
+
return {
|
|
330
|
+
severity: 'action-required',
|
|
331
|
+
description: `High-impact automated decisions about people${employment ? ' (employment context)' : ''}. Activates ${framework.name} controls (${ids}). Requires human oversight, contestability, and explanation of logic.`,
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
if (impact === 'medium') {
|
|
335
|
+
return {
|
|
336
|
+
severity: 'info',
|
|
337
|
+
description: `Agent influences outcomes for people (scoring/ranking/recommending) without binding legal effects. Activates ${framework.name} controls (${ids}). Maintain transparency and data-subject rights.`,
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
if (impact === 'unclear') {
|
|
341
|
+
return {
|
|
342
|
+
severity: 'clarification-needed',
|
|
343
|
+
description: `Agent reports making decisions about people but impact level is unclear. Activates ${framework.name} controls (${ids}). Clarify whether decisions have legal/significant effects.`,
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
return {
|
|
347
|
+
severity: 'info',
|
|
348
|
+
description: `No decisions about people detected. ${framework.name} controls (${ids}) listed for reference.`,
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
// ─── Finding gating (is the finding active at all?) ────────────────────────
|
|
354
|
+
function isFindingActive(findingType, signals) {
|
|
355
|
+
switch (findingType) {
|
|
356
|
+
case 'excessive-access':
|
|
357
|
+
return signals.hasExcessivePerms;
|
|
358
|
+
case 'write-risk':
|
|
359
|
+
return signals.hasWriteOps;
|
|
360
|
+
case 'sensitive-data':
|
|
361
|
+
return signals.hasPII || signals.hasHealth;
|
|
362
|
+
case 'scope-creep':
|
|
363
|
+
return signals.hasScopeCreep || signals.hasExcessivePerms;
|
|
364
|
+
case 'regulatory-flags':
|
|
365
|
+
return signals.hasHealth || signals.decisionImpact !== 'none';
|
|
366
|
+
case 'risk-score':
|
|
367
|
+
return true;
|
|
368
|
+
case 'decisions-about-people':
|
|
369
|
+
return true;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
export function mapFindingsToRiskCategories(input) {
|
|
373
|
+
const signals = detectSignals(input.systems, input.transcript, input.makesDecisionsAboutPeople === true, input.decisionMakingDetails);
|
|
374
|
+
const euAiActClassification = classifyEUAIAct(signals);
|
|
375
|
+
const mandatory = emptyBucket();
|
|
376
|
+
const voluntary = emptyBucket();
|
|
377
|
+
const all = [];
|
|
378
|
+
const activated = new Set();
|
|
379
|
+
for (const mapping of Object.values(CONTROL_MAPPINGS)) {
|
|
380
|
+
if (!isFindingActive(mapping.findingType, signals))
|
|
381
|
+
continue;
|
|
382
|
+
// Per-control gating:
|
|
383
|
+
// - drop EU AI Act controls tagged annexIII=true when the Annex III
|
|
384
|
+
// signal set does not fire for this finding type.
|
|
385
|
+
// - drop controls tagged gatedBy=[...] when none of the named signals
|
|
386
|
+
// are truthy (AIUC-1 architecture gating: MCP, sub-agents, multi-customer).
|
|
387
|
+
const annexIIIOn = isAnnexIIIApplicableForFinding(mapping.findingType, signals);
|
|
388
|
+
const applicableControls = mapping.controls.filter((ctrl) => {
|
|
389
|
+
if (ctrl.frameworkId === 'eu-ai-act' && ctrl.annexIII === true) {
|
|
390
|
+
if (!annexIIIOn)
|
|
391
|
+
return false;
|
|
392
|
+
}
|
|
393
|
+
if (ctrl.gatedBy && ctrl.gatedBy.length > 0) {
|
|
394
|
+
const sigBag = signals;
|
|
395
|
+
const anyOn = ctrl.gatedBy.some((sig) => sigBag[sig] === true);
|
|
396
|
+
if (!anyOn)
|
|
397
|
+
return false;
|
|
398
|
+
}
|
|
399
|
+
return true;
|
|
400
|
+
});
|
|
401
|
+
// Group remaining controls by framework — one flag per framework per finding.
|
|
402
|
+
const byFramework = new Map();
|
|
403
|
+
for (const ctrl of applicableControls) {
|
|
404
|
+
const arr = byFramework.get(ctrl.frameworkId) ?? [];
|
|
405
|
+
arr.push(ctrl);
|
|
406
|
+
byFramework.set(ctrl.frameworkId, arr);
|
|
407
|
+
}
|
|
408
|
+
for (const [frameworkId, controls] of byFramework) {
|
|
409
|
+
const framework = FRAMEWORKS[frameworkId];
|
|
410
|
+
const controlIds = controls.map((c) => c.controlId);
|
|
411
|
+
const { severity, description: baseDescription } = describeFinding(mapping.findingType, framework, controlIds, signals, input.decisionMakingDetails);
|
|
412
|
+
const description = disclaimerFor(frameworkId, baseDescription);
|
|
413
|
+
const controlsLabel = controlIds.join(', ');
|
|
414
|
+
const flag = {
|
|
415
|
+
framework: `${framework.name} — ${controlsLabel}`,
|
|
416
|
+
severity,
|
|
417
|
+
description,
|
|
418
|
+
frameworkId: framework.id,
|
|
419
|
+
controlIds,
|
|
420
|
+
category: mapping.category,
|
|
421
|
+
tier: framework.tier,
|
|
422
|
+
mandatoryIn: framework.mandatoryIn,
|
|
423
|
+
scopeNote: framework.scopeNote,
|
|
424
|
+
triggeredBy: mapping.findingType,
|
|
425
|
+
euAiActClassification: framework.id === 'eu-ai-act' ? euAiActClassification.classification : undefined,
|
|
426
|
+
};
|
|
427
|
+
all.push(flag);
|
|
428
|
+
activated.add(framework.id);
|
|
429
|
+
const bucket = framework.tier === 'mandatory' ? mandatory : voluntary;
|
|
430
|
+
bucket[mapping.category].push(flag);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return {
|
|
434
|
+
mappingVersion: MAPPING_VERSION,
|
|
435
|
+
mandatory,
|
|
436
|
+
voluntary,
|
|
437
|
+
frameworksActivated: [...activated],
|
|
438
|
+
all,
|
|
439
|
+
euAiActClassification,
|
|
440
|
+
signals,
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
//# sourceMappingURL=mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapper.js","sourceRoot":"","sources":["../../../src/compliance/mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAOH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAY7C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,MAAM,UAAU,sBAAsB,CACpC,kBAA2B,EAC3B,OAAgB;IAEhB,IAAI,CAAC,kBAAkB;QAAE,OAAO,MAAM,CAAC;IACvC,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,cAAc,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,EAAE;QACtE,OAAO,SAAS,CAAC;IAEnB,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAEnC,MAAM,UAAU,GACd,iRAAiR,CAAC;IACpR,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC;IAEzC,MAAM,YAAY,GAChB,+JAA+J,CAAC;IAClK,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IAE7C,OAAO,SAAS,CAAC;AACnB,CAAC;AAyCD,wFAAwF;AACxF,MAAM,iBAAiB,GAAG,IAAI,MAAM,CAClC,MAAM,GAAG;IACP,8CAA8C;IAC9C,+CAA+C;IAC/C,8BAA8B;IAC9B,qCAAqC;IACrC,sBAAsB;CACvB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,EACpB,GAAG,CACJ,CAAC;AAEF,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AAC,IAAI,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED,OAAO;QACL,cAAc,EAAE,eAAe;QAC/B,SAAS;QACT,SAAS;QACT,mBAAmB,EAAE,CAAC,GAAG,SAAS,CAAC;QACnC,GAAG;QACH,qBAAqB;QACrB,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed primitives for framework-anchored risk scoring.
|
|
3
|
+
*
|
|
4
|
+
* Structure:
|
|
5
|
+
* types.ts — pure types + enums + MAPPING_VERSION
|
|
6
|
+
* frameworks.ts — framework metadata registry
|
|
7
|
+
* control-mappings.ts — finding → controls table
|
|
8
|
+
* mapper.ts — signal detection + finding → flag projection
|
|
9
|
+
*
|
|
10
|
+
* Scope (post-scope-cut 2026-04-23; + AIUC-1 added 2026-04-24; + NIST AI RMF
|
|
11
|
+
* restored 2026-04-24):
|
|
12
|
+
* - EU AI Act (consolidated — single entry with Annex III classification scope)
|
|
13
|
+
* - GDPR
|
|
14
|
+
* - ISO/IEC 42001 (currently full standard; Annex-A-only subset planned)
|
|
15
|
+
* - AIUC-1 (agent-native standard, pinned to Q2-2026 release 2026-04-15)
|
|
16
|
+
* - NIST AI RMF (US-origin voluntary risk-management framework; GOVERN/MAP/MEASURE/MANAGE)
|
|
17
|
+
*
|
|
18
|
+
* Dropped from OSS v1 (kept in git history for restoration):
|
|
19
|
+
* - UK GDPR / DPA 2018
|
|
20
|
+
* - Colorado AI Act (SB 24-205)
|
|
21
|
+
* - HIPAA
|
|
22
|
+
* - CCPA / CPRA
|
|
23
|
+
* - ISO/IEC 23894
|
|
24
|
+
* - SOC 2
|
|
25
|
+
* - eu-ai-act-high-risk (merged into eu-ai-act with per-control annexIII tag)
|
|
26
|
+
*
|
|
27
|
+
* Rationale: see Linear AAP-42 (scope cut) + AAP-44 (AIUC-1). NIST AI RMF was
|
|
28
|
+
* cut in AAP-42 but restored on user demand — it is the most widely-referenced
|
|
29
|
+
* voluntary AI risk-management framework in US enterprise procurement.
|
|
30
|
+
* Jurisdiction-specific statutes and general AI management frameworks move
|
|
31
|
+
* to the paid/cloud tier.
|
|
32
|
+
*
|
|
33
|
+
* Mappings are INDICATIVE — they surface which framework clauses a finding
|
|
34
|
+
* typically activates, not a certification that the controls are satisfied.
|
|
35
|
+
*/
|
|
36
|
+
export declare const RISK_CATEGORIES: readonly ["privacy", "ip", "consumer-protection", "sector-specific"];
|
|
37
|
+
export type RiskCategory = (typeof RISK_CATEGORIES)[number];
|
|
38
|
+
export declare const FRAMEWORK_TIERS: readonly ["mandatory", "voluntary"];
|
|
39
|
+
export type FrameworkTier = (typeof FRAMEWORK_TIERS)[number];
|
|
40
|
+
/**
|
|
41
|
+
* OSS v1 framework set. See file header for scope rationale.
|
|
42
|
+
*/
|
|
43
|
+
export declare const FRAMEWORK_IDS: readonly ["eu-ai-act", "gdpr", "iso-42001", "aiuc-1", "nist-ai-rmf"];
|
|
44
|
+
export type FrameworkId = (typeof FRAMEWORK_IDS)[number];
|
|
45
|
+
export declare const JURISDICTIONS: readonly ["EU", "UK", "US", "global"];
|
|
46
|
+
export type Jurisdiction = (typeof JURISDICTIONS)[number];
|
|
47
|
+
export interface Framework {
|
|
48
|
+
id: FrameworkId;
|
|
49
|
+
name: string;
|
|
50
|
+
tier: FrameworkTier;
|
|
51
|
+
/**
|
|
52
|
+
* Jurisdictions where the framework is legally mandatory.
|
|
53
|
+
* Voluntary frameworks use an empty array.
|
|
54
|
+
*/
|
|
55
|
+
mandatoryIn: Jurisdiction[];
|
|
56
|
+
/** Optional clarification on the jurisdictional scope. */
|
|
57
|
+
scopeNote?: string;
|
|
58
|
+
/** Optional short blurb rendered in the jurisdictional appendix. */
|
|
59
|
+
summary?: string;
|
|
60
|
+
/** Primary source URL: statutory text, regulatory page, or official standard. Required for audit trail. */
|
|
61
|
+
primarySource: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* EU AI Act risk classification for the audited agent.
|
|
65
|
+
*
|
|
66
|
+
* Replaces the prior two-entry split (`eu-ai-act` + `eu-ai-act-high-risk`):
|
|
67
|
+
* now a single framework entry carries a classification computed from the
|
|
68
|
+
* detected signals, and individual controls opt in or out of the high-risk
|
|
69
|
+
* tier via the `annexIII` flag on FrameworkControl.
|
|
70
|
+
*/
|
|
71
|
+
export declare const EU_AI_ACT_CLASSIFICATIONS: readonly ["prohibited", "high-risk", "limited", "minimal", "unclassified"];
|
|
72
|
+
export type EUAIActClassification = (typeof EU_AI_ACT_CLASSIFICATIONS)[number];
|
|
73
|
+
export declare const FINDING_TYPES: readonly ["excessive-access", "write-risk", "sensitive-data", "scope-creep", "regulatory-flags", "risk-score", "decisions-about-people"];
|
|
74
|
+
export type FindingType = (typeof FINDING_TYPES)[number];
|
|
75
|
+
export interface FrameworkControl {
|
|
76
|
+
frameworkId: FrameworkId;
|
|
77
|
+
/** The specific control, clause, or article ID (e.g. "Art. 9(2)(a)", "A.6.2.6"). */
|
|
78
|
+
controlId: string;
|
|
79
|
+
/** Optional human-readable description of the control. */
|
|
80
|
+
note?: string;
|
|
81
|
+
/**
|
|
82
|
+
* EU AI Act only: set to true for controls that apply ONLY when the system
|
|
83
|
+
* is classified as high-risk under Annex III. Ignored by other frameworks.
|
|
84
|
+
*
|
|
85
|
+
* Consolidated here from the prior `eu-ai-act-high-risk` framework entry.
|
|
86
|
+
*/
|
|
87
|
+
annexIII?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Optional per-control signal gating. If provided, the control is rendered
|
|
90
|
+
* only when at least one of the named ComplianceSignals is truthy. Used for
|
|
91
|
+
* AIUC-1 controls that only apply in specific architectures (e.g. MCP,
|
|
92
|
+
* multi-customer, sub-agents). Keys are field names of ComplianceSignals;
|
|
93
|
+
* validation is runtime (in mapper.ts) to avoid a circular type import.
|
|
94
|
+
*/
|
|
95
|
+
gatedBy?: string[];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Per-finding-type mapping bundle.
|
|
99
|
+
*/
|
|
100
|
+
export interface ControlMapping {
|
|
101
|
+
findingType: FindingType;
|
|
102
|
+
category: RiskCategory;
|
|
103
|
+
/** Short human-readable summary of what triggers this finding type. */
|
|
104
|
+
summary: string;
|
|
105
|
+
controls: FrameworkControl[];
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Version tag for the control-mapping dataset. Bump when the mapping table
|
|
109
|
+
* is materially updated so downstream consumers can detect staleness.
|
|
110
|
+
*
|
|
111
|
+
* History:
|
|
112
|
+
* aap-30.2026-04-09 — initial AAP-30 mapping (ISO 23894, NIST AI RMF, EU AI Act, GDPR, SOC 2)
|
|
113
|
+
* aap-31.2026-04-15 — AAP-31 restored jurisdiction-specific frameworks (Colorado AI Act, HIPAA, CCPA/CPRA, UK GDPR/DPA 2018)
|
|
114
|
+
* aap-42.2026-04-23 — AAP-42 scope cut: dropped 7 jurisdiction-specific / voluntary frameworks; consolidated EU AI Act split into single entry with Annex III classification
|
|
115
|
+
* aap-43.2026-04-24 — AAP-43 audit-quality pass: determinism, NOT_PROVIDED scrub, conditional GDPR, Annex III employment gating, overall-status label, adversarial probing
|
|
116
|
+
* aap-44.2026-04-24 — AAP-44 added AIUC-1 (Q2-2026 release, pinned to 2026-04-15); 16 controls across 4 finding-types; 3 new architecture signals (hasMCPOrA2A, hasSubAgents, hasCrossCustomer); per-control gatedBy filter
|
|
117
|
+
* nist-restore.2026-04-24 — Restored NIST AI RMF as voluntary framework (widely-referenced US-origin AI risk-management framework); GOVERN/MAP/MEASURE/MANAGE controls across 6 finding-types
|
|
118
|
+
*/
|
|
119
|
+
export declare const MAPPING_VERSION: "nist-restore.2026-04-24";
|
|
120
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/compliance/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAI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