Add DeltaStore exchange v1 support
Browse files
app.js
CHANGED
|
@@ -198,11 +198,22 @@ async function loadBenchmark() {
|
|
| 198 |
|
| 199 |
function downloadReport() {
|
| 200 |
if (!state.scanReport) return;
|
| 201 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
const url = URL.createObjectURL(blob);
|
| 203 |
const link = document.createElement("a");
|
| 204 |
link.href = url;
|
| 205 |
-
link.download = `${state.scanReport.session.id}.atlas-report.json`;
|
| 206 |
link.click();
|
| 207 |
URL.revokeObjectURL(url);
|
| 208 |
}
|
|
|
|
| 198 |
|
| 199 |
function downloadReport() {
|
| 200 |
if (!state.scanReport) return;
|
| 201 |
+
const isDeltaStore = state.scanFormat === "DeltaStore Trace Exchange v1";
|
| 202 |
+
const payload = isDeltaStore ? {
|
| 203 |
+
trace_id: state.scanReport.session.id,
|
| 204 |
+
taxonomy_version: "agent-failure-atlas/v1",
|
| 205 |
+
findings: state.scanReport.findings.map((finding) => ({
|
| 206 |
+
finding_id: finding.id, trace_id: state.scanReport.session.id, taxonomy_version: finding.taxonomy_version ?? "agent-failure-atlas/v1",
|
| 207 |
+
rule_id: finding.rule_id ?? finding.detector, category: finding.category, severity: finding.severity,
|
| 208 |
+
evidence_event_ids: finding.evidence_event_ids ?? [], branch_id: finding.branch_id ?? null,
|
| 209 |
+
checkpoint_id: finding.checkpoint_id ?? null, message: finding.description, detector_metadata: { detector: finding.detector },
|
| 210 |
+
})),
|
| 211 |
+
} : state.scanReport;
|
| 212 |
+
const blob = new Blob([JSON.stringify(payload, null, 2)], { type: "application/json" });
|
| 213 |
const url = URL.createObjectURL(blob);
|
| 214 |
const link = document.createElement("a");
|
| 215 |
link.href = url;
|
| 216 |
+
link.download = `${state.scanReport.session.id}.${isDeltaStore ? "atlas-findings" : "atlas-report"}.json`;
|
| 217 |
link.click();
|
| 218 |
URL.revokeObjectURL(url);
|
| 219 |
}
|