-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
433 lines (400 loc) · 17.1 KB
/
Copy pathindex.html
File metadata and controls
433 lines (400 loc) · 17.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AIRFX Data Flow — Utopia RFP Security Engine</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #0d1117;
color: #c9d1d9;
line-height: 1.6;
}
header {
padding: 2rem 1.5rem 1rem;
max-width: 1200px;
margin: 0 auto;
}
header h1 {
font-size: 1.6rem;
color: #e6edf3;
font-weight: 600;
}
header p {
color: #8b949e;
font-size: 0.95rem;
margin-top: 0.4rem;
}
.meta {
display: flex;
flex-wrap: wrap;
gap: 1rem;
margin-top: 1rem;
font-size: 0.82rem;
}
.meta-item {
background: #161b22;
border: 1px solid #30363d;
border-radius: 6px;
padding: 0.4rem 0.75rem;
}
.meta-item strong { color: #58a6ff; }
.diagram-wrapper {
position: relative;
max-width: 1200px;
margin: 1.5rem auto;
padding: 0 1rem;
}
.controls {
display: flex;
gap: 0.5rem;
margin-bottom: 0.75rem;
flex-wrap: wrap;
}
.controls button {
background: #21262d;
color: #c9d1d9;
border: 1px solid #30363d;
border-radius: 6px;
padding: 0.35rem 0.75rem;
font-size: 0.8rem;
cursor: pointer;
transition: background 0.15s;
}
.controls button:hover { background: #30363d; }
.diagram-container {
overflow: hidden;
border: 1px solid #30363d;
border-radius: 8px;
background: #0d1117;
cursor: grab;
touch-action: none;
position: relative;
min-height: 500px;
}
.diagram-container:active { cursor: grabbing; }
.diagram-inner {
transform-origin: 0 0;
transition: transform 0.1s ease-out;
padding: 2rem;
}
.annotations {
max-width: 1200px;
margin: 2rem auto;
padding: 0 1.5rem 3rem;
}
.annotations h2 {
font-size: 1.2rem;
color: #e6edf3;
margin-bottom: 1rem;
border-bottom: 1px solid #21262d;
padding-bottom: 0.5rem;
}
.annotation-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 1rem;
}
.annotation {
background: #161b22;
border: 1px solid #30363d;
border-radius: 8px;
padding: 1rem;
}
.annotation .step-num {
display: inline-block;
background: #1f6feb;
color: #fff;
border-radius: 50%;
width: 1.5rem;
height: 1.5rem;
text-align: center;
font-size: 0.8rem;
line-height: 1.5rem;
margin-right: 0.5rem;
flex-shrink: 0;
}
.annotation h3 {
font-size: 0.95rem;
color: #e6edf3;
display: flex;
align-items: center;
margin-bottom: 0.5rem;
}
.annotation p {
font-size: 0.85rem;
color: #8b949e;
}
.annotation .real-data {
margin-top: 0.5rem;
font-size: 0.78rem;
color: #58a6ff;
background: #0d1117;
padding: 0.4rem 0.6rem;
border-radius: 4px;
font-family: 'SF Mono', 'Fira Code', monospace;
word-break: break-word;
}
.badge-green { color: #3fb950; }
.badge-yellow { color: #d29922; }
.badge-red { color: #f85149; }
footer {
text-align: center;
padding: 2rem;
color: #484f58;
font-size: 0.78rem;
border-top: 1px solid #21262d;
}
@media (max-width: 600px) {
header h1 { font-size: 1.2rem; }
.annotation-grid { grid-template-columns: 1fr; }
.meta { flex-direction: column; gap: 0.5rem; }
}
</style>
</head>
<body>
<header>
<h1>AIRFX Data Flow</h1>
<p>End-to-end trace of how an RFP question moves through the Utopia security triage engine — from Salesforce record to flagged result, AI answer, and self-improving feedback loop.</p>
<div class="meta">
<div class="meta-item">Traced project: <strong>P-4299</strong></div>
<div class="meta-item">Products: <strong>Platform, Service Cloud, Gov Cloud+, GovSlack</strong></div>
<div class="meta-item">Country: <strong>US</strong></div>
<div class="meta-item">Questions: <strong>10</strong> — <span class="badge-green">5 Green</span> / <span class="badge-yellow">5 Yellow</span> / <span class="badge-red">0 Red</span></div>
<div class="meta-item">BRE rows: <strong>233 active</strong> (across 4 matrices) + <strong>376 disabled</strong> (2 matrices)</div>
</div>
</header>
<div class="diagram-wrapper">
<div class="controls">
<button onclick="zoomIn()">+ Zoom In</button>
<button onclick="zoomOut()">− Zoom Out</button>
<button onclick="resetView()">Reset View</button>
</div>
<div class="diagram-container" id="diagramContainer">
<div class="diagram-inner" id="diagramInner">
<pre class="mermaid">
flowchart TD
A["RFP question lands in Salesforce"] --> B["SE or agent triggers triage on the project"]
B --> C{"Does the project have\nproduct + country context?"}
C -- "Yes\n(e.g. Gov Cloud+, US)" --> D["Read deal context from the project record"]
C -- "No" --> D2["Warn: 'no context provided'\nTriage continues without product/country filters"]
D2 --> E
D --> E["Pass each question through the security pre-filter"]
E --> F{"Does it look like a\nsecurity or compliance question?"}
F -- "No — purely functional\n(e.g. 'export to PDF')" --> G["Flag as Green\nReason: functional/non-security"]
F -- "Yes — contains security signals\n(e.g. 'FISMA', 'encryption', 'PCI-DSS')" --> H["Enter the rules engine"]
H --> I["Load exception rules from\n6 Business Rule Engine matrices"]
I --> J["Check Dealbreaker keywords\n(294 patterns → Red)"]
J --> K["Check Review Flag keywords\n(126 patterns → Yellow)"]
K --> L["Check Country-specific rules\n(82 patterns → Red or Yellow)"]
L --> M["Check Product-specific rules\n(39 patterns → Red or Yellow)"]
M --> N["Check Compliance rules\n(60 patterns → Red or Yellow)"]
N --> O["Run Apex-only rules\n(numeric thresholds, regex, conditional logic)"]
O --> P{"Did any rule match?"}
P -- "Yes — first match wins" --> Q["Apply the flag from\nthe matched rule"]
P -- "No match" --> R["Flag as Yellow\nReason: no rule matched, needs human review"]
Q --> S{"What flag was assigned?"}
R --> S
S -- "Red — dealbreaker" --> T["Write Red flag + reason\nto the question record"]
S -- "Yellow — needs review" --> U["Write Yellow flag + reason\nto the question record"]
S -- "Green — safe to auto-answer" --> V["Write Green flag + reason\nto the question record"]
T --> W["Build triage summary for the SE\n(counts, deal-killer warnings, Red details)"]
U --> W
V --> W
U --> X["Queue AI answer generation\nfor Yellow questions"]
X --> Y["Build prompt context\n(certifications, product capabilities, compliance data)"]
Y --> Z["Call Data Cloud prompt template\nwith 4 knowledge retrievers"]
Z --> AA["Write AI-generated answer\nback to the question record"]
AA --> AB["SE reviews the AI answer"]
AB --> AC{"Does the SE agree\nwith the flag?"}
AC -- "Yes" --> AD["Done — answer accepted"]
AC -- "No — flag is wrong" --> AE["SE reports a missed flag\nvia agent action"]
AE --> AF["Engine re-evaluates the question\nand diagnoses the gap"]
AF --> AG{"What type of gap?"}
AG -- "Missing keyword\nin the rules" --> AH["Propose a new BRE row\nfor approval"]
AG -- "Engine logic issue" --> AI["Classify as Apex fix needed"]
AG -- "Engine was actually correct" --> AJ["Classify as 'engine correct'\nand notify the team"]
AH --> AK["Send diagnostic email\nto the 5-person review team"]
AI --> AK
AJ --> AK
AH --> AL["Reviewer approves\nthe new rule"]
AL --> AM["Insert new row into\nthe correct BRE matrix"]
AM --> AN["Re-triage affected questions\nwith the updated rules"]
style G fill:#238636,stroke:#2ea043,color:#fff
style T fill:#b62324,stroke:#f85149,color:#fff
style U fill:#9e6a03,stroke:#d29922,color:#fff
style V fill:#238636,stroke:#2ea043,color:#fff
style AD fill:#238636,stroke:#2ea043,color:#fff
style AK fill:#1f6feb,stroke:#58a6ff,color:#fff
</pre>
</div>
</div>
</div>
<div class="annotations">
<h2>How it works — step by step</h2>
<div class="annotation-grid">
<div class="annotation">
<h3><span class="step-num">1</span>Question arrives</h3>
<p>RFP questions are imported as individual records in Salesforce, each linked to a project. The project carries deal context — which products are being sold and which country.</p>
<div class="real-data">P-4299 has 10 questions (GPS-6608 through GPS-6617). Products: Platform, Service Cloud, Gov Cloud+, GovSlack. Country: US.</div>
</div>
<div class="annotation">
<h3><span class="step-num">2</span>Triage is triggered</h3>
<p>An SE asks the Agentforce agent to "triage project P-4299" or the system runs a batch job. Either way, all questions in the project enter the engine together.</p>
<div class="real-data">Agent action: "Triage and Route Project" — accepts project names like "P-4299" and resolves them to record IDs.</div>
</div>
<div class="annotation">
<h3><span class="step-num">3</span>Security pre-filter</h3>
<p>Before running expensive rule matching, each question is checked for security relevance. If it's obviously about functionality (reports, integrations, UI features), it skips the engine entirely and gets flagged Green.</p>
<div class="real-data">GPS-6608: "Allow all reports to be visualized, printed, and exported..." → Green. Functional term detected: "reports".</div>
</div>
<div class="annotation">
<h3><span class="step-num">4</span>Business Rule Engine lookup</h3>
<p>Questions that pass the pre-filter are checked against 6 rule matrices containing 609 total exception patterns. These matrices store keywords and patterns that map to Red (dealbreaker) or Yellow (needs review) flags. Currently 4 matrices are active (233 rows) and 2 are disabled (376 rows).</p>
<div class="real-data">Active: Review Flags (126), Content Routing (8), Product Rules (39), Compliance Rules (60). Disabled: Dealbreakers (294), Country Rules (82).</div>
</div>
<div class="annotation">
<h3><span class="step-num">5</span>Apex-only rules</h3>
<p>Some rules can't be expressed as simple keyword lookups — they need to extract numbers from text ("99.9% uptime"), combine multiple conditions ("GovCloud + FIPS"), or apply complex exclusion logic. These ~30 rules live permanently in Apex code.</p>
<div class="real-data">Examples: UPTIME (extracts % and checks ≥99.7%), RTO/RPO (extracts hours), FIPS_GOV vs FIPS_COMMERCIAL (product-conditional), DATA_RESIDENCY (country lookup).</div>
</div>
<div class="annotation">
<h3><span class="step-num">6</span>First match wins</h3>
<p>Rules are checked in priority order. The moment a question matches any rule, that rule's flag (Red or Yellow) is applied and no further rules are checked. If nothing matches, the question gets Yellow with "no rule matched — human review required."</p>
<div class="real-data">GPS-6617: "FISMA, NIST SP 800-53... FIPS PUB 200" → Yellow. No deterministic rule matched. GPS-6613: "PCI-DSS, FedRAMP, HITRUST" → Yellow. Same reason.</div>
</div>
<div class="annotation">
<h3><span class="step-num">7</span>AI answer generation</h3>
<p>Yellow-flagged questions get queued for AI answer generation. The system builds a prompt with the project's product context, relevant certifications, and compliance data, then calls a Data Cloud prompt template backed by 4 knowledge retrievers.</p>
<div class="real-data">GPS-6609 (ICP-Brasil compliance) received an AI answer citing AppExchange integrations, OmniStudio/DocuSign, and Salesforce's compliance framework.</div>
</div>
<div class="annotation">
<h3><span class="step-num">8</span>GovCloud filtering</h3>
<p>Because P-4299 includes "Gov Cloud+" in its products, the engine activates GovCloud-specific rules. Rules tagged as "commercial only" are skipped, and GovCloud-specific rules (like FIPS-140 validation, FedRAMP High scope) are applied.</p>
<div class="real-data">isGovCloudDeal("Core - Platform;Core - Service Cloud;Gov Cloud +;GovSlack") → true. Commercial-only rules skipped for this project.</div>
</div>
<div class="annotation">
<h3><span class="step-num">9</span>SE review + display</h3>
<p>The agent shows the SE a summary: how many questions were flagged Green/Yellow/Red, details on any Red flags, a preview of Yellow flags, and deal-killer warnings if Red flags exceed 40% or 70% of the project.</p>
<div class="real-data">P-4299 summary: 5 Green, 5 Yellow, 0 Red. No deal-killer warning. No-context warning not triggered (products and country both present).</div>
</div>
<div class="annotation">
<h3><span class="step-num">10</span>Self-improving flywheel</h3>
<p>If an SE disagrees with a flag, they report it. The engine re-runs the question, diagnoses why the flag was wrong (missing keyword? logic bug? actually correct?), proposes a fix, and emails the 5-person review team. If approved, the new rule is inserted into the BRE matrix and affected questions are re-triaged.</p>
<div class="real-data">Diagnosis types: ENGINE_CORRECT, KEYWORD_GAP, APEX_NUMERIC_RULE, FLAG_ERROR, NO_COVERAGE. Email goes to: rsmith2, groser, mrosa, gaurav.bhargava, sstclair.</div>
</div>
</div>
</div>
<footer>
AIRFX Data Flow — generated from live org data on P-4299 — April 2026
</footer>
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
mermaid.initialize({
startOnLoad: true,
theme: 'dark',
flowchart: {
useMaxWidth: false,
htmlLabels: true,
curve: 'basis',
nodeSpacing: 30,
rankSpacing: 40,
},
themeVariables: {
primaryColor: '#161b22',
primaryBorderColor: '#30363d',
primaryTextColor: '#c9d1d9',
lineColor: '#484f58',
secondaryColor: '#21262d',
tertiaryColor: '#0d1117',
fontFamily: '-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif',
fontSize: '13px',
}
});
// Pan and zoom
const container = document.getElementById('diagramContainer');
const inner = document.getElementById('diagramInner');
let scale = 1;
let translateX = 0;
let translateY = 0;
let isDragging = false;
let startX, startY;
function applyTransform() {
inner.style.transform = `translate(${translateX}px, ${translateY}px) scale(${scale})`;
}
container.addEventListener('pointerdown', (e) => {
isDragging = true;
startX = e.clientX - translateX;
startY = e.clientY - translateY;
container.setPointerCapture(e.pointerId);
});
container.addEventListener('pointermove', (e) => {
if (!isDragging) return;
translateX = e.clientX - startX;
translateY = e.clientY - startY;
inner.style.transition = 'none';
applyTransform();
});
container.addEventListener('pointerup', (e) => {
isDragging = false;
inner.style.transition = 'transform 0.1s ease-out';
container.releasePointerCapture(e.pointerId);
});
container.addEventListener('wheel', (e) => {
e.preventDefault();
const rect = container.getBoundingClientRect();
const mouseX = e.clientX - rect.left;
const mouseY = e.clientY - rect.top;
const prevScale = scale;
const delta = e.deltaY > 0 ? 0.9 : 1.1;
scale = Math.min(Math.max(scale * delta, 0.15), 3);
translateX = mouseX - (mouseX - translateX) * (scale / prevScale);
translateY = mouseY - (mouseY - translateY) * (scale / prevScale);
applyTransform();
}, { passive: false });
// Touch pinch-to-zoom
let lastTouchDist = null;
container.addEventListener('touchstart', (e) => {
if (e.touches.length === 2) {
lastTouchDist = Math.hypot(
e.touches[0].clientX - e.touches[1].clientX,
e.touches[0].clientY - e.touches[1].clientY
);
}
});
container.addEventListener('touchmove', (e) => {
if (e.touches.length === 2) {
e.preventDefault();
const dist = Math.hypot(
e.touches[0].clientX - e.touches[1].clientX,
e.touches[0].clientY - e.touches[1].clientY
);
if (lastTouchDist) {
const delta = dist / lastTouchDist;
scale = Math.min(Math.max(scale * delta, 0.15), 3);
applyTransform();
}
lastTouchDist = dist;
}
}, { passive: false });
container.addEventListener('touchend', () => { lastTouchDist = null; });
window.zoomIn = () => { scale = Math.min(scale * 1.2, 3); applyTransform(); };
window.zoomOut = () => { scale = Math.max(scale * 0.8, 0.15); applyTransform(); };
window.resetView = () => { scale = 1; translateX = 0; translateY = 0; applyTransform(); };
// Auto-fit on load
setTimeout(() => {
const svg = inner.querySelector('svg');
if (svg) {
const svgW = svg.getBoundingClientRect().width;
const containerW = container.getBoundingClientRect().width;
if (svgW > containerW) {
scale = (containerW - 40) / svgW;
applyTransform();
}
}
}, 1500);
</script>
</body>
</html>