@openai/codex-security 0.7.0 → 0.8.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/README.md +10 -4
- package/_bundled_plugin/examples/completed-scan/findings.json +34 -34
- package/_bundled_plugin/examples/completed-scan/report.md +22 -31
- package/_bundled_plugin/examples/completed-scan/scan-manifest.json +27 -29
- package/_bundled_plugin/examples/{completed-scan → legacy-completed-scan}/coverage.json +1 -0
- package/_bundled_plugin/examples/legacy-completed-scan/findings.json +57 -0
- package/_bundled_plugin/examples/legacy-completed-scan/report.md +98 -0
- package/_bundled_plugin/examples/legacy-completed-scan/scan-manifest.json +43 -0
- package/_bundled_plugin/mcp/helpers.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/helpers.mjs.br.part-001 +0 -0
- package/_bundled_plugin/mcp/native/win32-arm64/windows.node +0 -0
- package/_bundled_plugin/mcp/native/win32-x64/windows.node +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-002 +0 -0
- package/_bundled_plugin/references/core-scan.md +2 -2
- package/_bundled_plugin/references/final-report.md +16 -6
- package/_bundled_plugin/references/scan-artifacts.md +5 -5
- package/_bundled_plugin/references/scan-contract.md +10 -12
- package/_bundled_plugin/references/threat-model.md +1 -1
- package/_bundled_plugin/schemas/scan-manifest.schema.json +36 -11
- package/_bundled_plugin/schemas/tools/scan-draft.schema.json +5 -5
- package/_bundled_plugin/scripts/deep_scan_workbench.py +1 -1
- package/_bundled_plugin/scripts/finalize_scan_contract.py +60 -19
- package/_bundled_plugin/scripts/report_projection.py +5 -2
- package/_bundled_plugin/scripts/review_state.py +68 -0
- package/_bundled_plugin/scripts/validate_scan_contract.py +1 -2
- package/_bundled_plugin/scripts/workbench/retained_coverage.py +49 -37
- package/_bundled_plugin/scripts/workbench/retained_records.py +7 -7
- package/_bundled_plugin/scripts/workbench/saved_coverage.py +15 -15
- package/_bundled_plugin/scripts/workbench/saved_sources.py +24 -6
- package/_bundled_plugin/scripts/workbench_constants.py +0 -1
- package/_bundled_plugin/scripts/workbench_coverage_receipts.py +4 -4
- package/_bundled_plugin/scripts/workbench_db.py +5 -150
- package/_bundled_plugin/scripts/workbench_saved_results.py +169 -4
- package/_bundled_plugin/scripts/workbench_scan_history.py +12 -7
- package/_bundled_plugin/skills/publish-findings/SKILL.md +5 -1
- package/_bundled_plugin/skills/security-diff-scan/SKILL.md +1 -1
- package/_bundled_plugin/skills/security-scan/SKILL.md +6 -6
- package/_bundled_plugin/skills/track-findings/SKILL.md +1 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +19 -17
- package/dist/api.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +28 -17
- package/dist/cli.js.map +1 -1
- package/dist/cloud-publish.d.ts.map +1 -1
- package/dist/cloud-publish.js +2 -23
- package/dist/cloud-publish.js.map +1 -1
- package/dist/contract.d.ts +3 -2
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +28 -14
- package/dist/contract.js.map +1 -1
- package/dist/custom-publish.js +2 -2
- package/dist/custom-publish.js.map +1 -1
- package/dist/custom-validation-prompt.js +5 -5
- package/dist/custom-validation-prompt.js.map +1 -1
- package/dist/custom-validation.d.ts.map +1 -1
- package/dist/custom-validation.js +17 -15
- package/dist/custom-validation.js.map +1 -1
- package/dist/deduplication/codex-review.d.ts.map +1 -1
- package/dist/deduplication/codex-review.js +2 -2
- package/dist/deduplication/codex-review.js.map +1 -1
- package/dist/deduplication/deduplication-prompts.d.ts +1 -0
- package/dist/deduplication/deduplication-prompts.d.ts.map +1 -1
- package/dist/deduplication/deduplication-prompts.js +3 -0
- package/dist/deduplication/deduplication-prompts.js.map +1 -1
- package/dist/deduplication/records-protocol.d.ts.map +1 -1
- package/dist/deduplication/records-protocol.js +21 -1
- package/dist/deduplication/records-protocol.js.map +1 -1
- package/dist/deduplication/scan.d.ts.map +1 -1
- package/dist/deduplication/scan.js +2 -2
- package/dist/deduplication/scan.js.map +1 -1
- package/dist/external-findings-local.d.ts +1 -0
- package/dist/external-findings-local.d.ts.map +1 -1
- package/dist/external-findings-local.js +6 -2
- package/dist/external-findings-local.js.map +1 -1
- package/dist/external-findings-publish.d.ts +1 -0
- package/dist/external-findings-publish.d.ts.map +1 -1
- package/dist/external-findings-publish.js +53 -25
- package/dist/external-findings-publish.js.map +1 -1
- package/dist/external-findings-read.d.ts +1 -0
- package/dist/external-findings-read.d.ts.map +1 -1
- package/dist/external-findings-read.js +10 -0
- package/dist/external-findings-read.js.map +1 -1
- package/dist/external-findings.d.ts +2 -0
- package/dist/external-findings.d.ts.map +1 -1
- package/dist/external-findings.js.map +1 -1
- package/dist/external-import-contract.d.ts +4 -0
- package/dist/external-import-contract.d.ts.map +1 -1
- package/dist/external-import-contract.js +34 -10
- package/dist/external-import-contract.js.map +1 -1
- package/dist/finding-workflow.d.ts +2 -0
- package/dist/finding-workflow.d.ts.map +1 -1
- package/dist/finding-workflow.js +3 -0
- package/dist/finding-workflow.js.map +1 -1
- package/dist/host-protocol.d.ts +1 -1
- package/dist/host-protocol.d.ts.map +1 -1
- package/dist/host-protocol.js +2 -2
- package/dist/host-protocol.js.map +1 -1
- package/dist/hosted-scan.d.ts.map +1 -1
- package/dist/hosted-scan.js +0 -1
- package/dist/hosted-scan.js.map +1 -1
- package/dist/import-scan.js +16 -16
- package/dist/import-scan.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/knowledge-base.js +3 -0
- package/dist/knowledge-base.js.map +1 -1
- package/dist/mock-scan.d.ts +1 -2
- package/dist/mock-scan.d.ts.map +1 -1
- package/dist/mock-scan.js +12 -17
- package/dist/mock-scan.js.map +1 -1
- package/dist/models.d.ts +9 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js.map +1 -1
- package/dist/multiscan.d.ts.map +1 -1
- package/dist/multiscan.js +1 -6
- package/dist/multiscan.js.map +1 -1
- package/dist/native-json-findings.d.ts +30 -0
- package/dist/native-json-findings.d.ts.map +1 -0
- package/dist/native-json-findings.js +114 -0
- package/dist/native-json-findings.js.map +1 -0
- package/dist/opengrep-findings.d.ts +10 -0
- package/dist/opengrep-findings.d.ts.map +1 -0
- package/dist/opengrep-findings.js +198 -0
- package/dist/opengrep-findings.js.map +1 -0
- package/dist/patch-tui.d.ts.map +1 -1
- package/dist/patch-tui.js +2 -0
- package/dist/patch-tui.js.map +1 -1
- package/dist/publication.js +1 -2
- package/dist/publication.js.map +1 -1
- package/dist/record.d.ts +1 -0
- package/dist/record.d.ts.map +1 -1
- package/dist/record.js +10 -0
- package/dist/record.js.map +1 -1
- package/dist/result.d.ts +5 -3
- package/dist/result.d.ts.map +1 -1
- package/dist/result.js +9 -6
- package/dist/result.js.map +1 -1
- package/dist/scan-history-renderer.js +1 -1
- package/dist/scan-history-renderer.js.map +1 -1
- package/dist/security-policy.d.ts.map +1 -1
- package/dist/security-policy.js +16 -2
- package/dist/security-policy.js.map +1 -1
- package/dist/semgrep-findings.d.ts.map +1 -1
- package/dist/semgrep-findings.js +15 -82
- package/dist/semgrep-findings.js.map +1 -1
- package/docs/cli.md +16 -3
- package/docs/dedupe-records.md +15 -1
- package/package.json +3 -3
|
@@ -51,10 +51,8 @@ from finalize_scan_contract import (
|
|
|
51
51
|
_prepare_scan_finalization,
|
|
52
52
|
_write_prepared_scan_finalization,
|
|
53
53
|
finalize_scan,
|
|
54
|
-
finding_candidate_id,
|
|
55
54
|
manifest_is_sealed,
|
|
56
55
|
open_scan_local_file_descriptor,
|
|
57
|
-
write_scan_local_bytes,
|
|
58
56
|
)
|
|
59
57
|
from finding_preview import bounded_finding_details
|
|
60
58
|
from workbench import handoff
|
|
@@ -1355,151 +1353,9 @@ def budget_exhausted_candidates(scan: sqlite3.Row, scan_dir: Path) -> list[dict[
|
|
|
1355
1353
|
|
|
1356
1354
|
|
|
1357
1355
|
def budget_exhausted_draft(
|
|
1358
|
-
scan: sqlite3.Row,
|
|
1359
|
-
scan_dir: Path,
|
|
1360
|
-
candidates: list[dict[str, Any]],
|
|
1361
|
-
warning: str,
|
|
1356
|
+
scan: sqlite3.Row, scan_dir: Path, candidates: list[dict[str, Any]], warning: str
|
|
1362
1357
|
) -> None:
|
|
1363
|
-
|
|
1364
|
-
for name in ("scan-manifest.json", "findings.json", "coverage.json"):
|
|
1365
|
-
path = artifact_path(scan_dir, name, required=False)
|
|
1366
|
-
if path is not None:
|
|
1367
|
-
documents[name] = read_json_object(path)
|
|
1368
|
-
if documents and len(documents) != 3:
|
|
1369
|
-
raise SystemExit("Budget-exhausted scan contains an incomplete canonical scan draft.")
|
|
1370
|
-
|
|
1371
|
-
if documents:
|
|
1372
|
-
manifest = documents["scan-manifest.json"]
|
|
1373
|
-
findings = documents["findings.json"]
|
|
1374
|
-
coverage = documents["coverage.json"]
|
|
1375
|
-
if not isinstance(manifest.get("scan"), dict) or not isinstance(
|
|
1376
|
-
findings.get("findings"), list
|
|
1377
|
-
):
|
|
1378
|
-
raise SystemExit("Budget-exhausted scan contains an invalid canonical scan draft.")
|
|
1379
|
-
for key in ("surfaces", "explicitExclusions", "deferred"):
|
|
1380
|
-
if not isinstance(coverage.get(key), list):
|
|
1381
|
-
raise SystemExit("Budget-exhausted scan contains invalid canonical coverage.")
|
|
1382
|
-
if manifest_is_sealed(manifest["scan"]):
|
|
1383
|
-
raise SystemExit("Budget-exhausted scan cannot replace an already sealed scan draft.")
|
|
1384
|
-
else:
|
|
1385
|
-
contract = scan_contract(scan)
|
|
1386
|
-
target_contract = contract["target"]
|
|
1387
|
-
target: dict[str, Any] = {
|
|
1388
|
-
"kind": target_contract["allowedKinds"][0],
|
|
1389
|
-
"targetId": target_contract["targetId"],
|
|
1390
|
-
"displayName": target_contract["displayName"],
|
|
1391
|
-
}
|
|
1392
|
-
if scan["target_revision"] != "unversioned":
|
|
1393
|
-
target["revision"] = scan["target_revision"]
|
|
1394
|
-
if "requiredSnapshotDigest" in target_contract:
|
|
1395
|
-
target["snapshotDigest"] = target_contract["requiredSnapshotDigest"]
|
|
1396
|
-
manifest = {
|
|
1397
|
-
"scan": {
|
|
1398
|
-
"target": target,
|
|
1399
|
-
"scope": {"limitations": [warning]},
|
|
1400
|
-
}
|
|
1401
|
-
}
|
|
1402
|
-
findings = {"findings": []}
|
|
1403
|
-
coverage = {
|
|
1404
|
-
"inventoryStrategy": (
|
|
1405
|
-
"scoped_path" if expected_coverage_mode(scan) == "scoped_path" else "repository"
|
|
1406
|
-
),
|
|
1407
|
-
"surfaces": [],
|
|
1408
|
-
"explicitExclusions": [],
|
|
1409
|
-
"deferred": [],
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
findings_by_candidate = {
|
|
1413
|
-
candidate_id
|
|
1414
|
-
for finding in findings["findings"]
|
|
1415
|
-
if isinstance(finding, dict)
|
|
1416
|
-
and isinstance(candidate_id := finding_candidate_id(finding), str)
|
|
1417
|
-
}
|
|
1418
|
-
existing_deferred = {
|
|
1419
|
-
item.get("candidateId", item.get("id"))
|
|
1420
|
-
for item in coverage["deferred"]
|
|
1421
|
-
if isinstance(item, dict) and isinstance(item.get("candidateId", item.get("id")), str)
|
|
1422
|
-
}
|
|
1423
|
-
existing_surfaces = {
|
|
1424
|
-
item.get("id")
|
|
1425
|
-
for item in coverage["surfaces"]
|
|
1426
|
-
if isinstance(item, dict) and isinstance(item.get("id"), str)
|
|
1427
|
-
}
|
|
1428
|
-
for candidate in candidates:
|
|
1429
|
-
candidate_id = candidate["candidate_id"]
|
|
1430
|
-
if candidate_id in findings_by_candidate or candidate_id in existing_deferred:
|
|
1431
|
-
continue
|
|
1432
|
-
paths = list(dict.fromkeys(location["path"] for location in candidate["locations"]))
|
|
1433
|
-
surface_id = f"candidate-{candidate_id}"
|
|
1434
|
-
validation = candidate.get("validation")
|
|
1435
|
-
validation = validation.get("disposition") if isinstance(validation, dict) else None
|
|
1436
|
-
attack = candidate.get("attack_path")
|
|
1437
|
-
attack = attack.get("decision") if isinstance(attack, dict) else None
|
|
1438
|
-
disposition = (
|
|
1439
|
-
"needs_follow_up"
|
|
1440
|
-
if validation == "deferred" or attack == "deferred"
|
|
1441
|
-
else "not_applicable"
|
|
1442
|
-
if validation == "not_applicable"
|
|
1443
|
-
else "rejected"
|
|
1444
|
-
if validation == "suppressed" or attack == "ignore"
|
|
1445
|
-
else "needs_follow_up"
|
|
1446
|
-
)
|
|
1447
|
-
if surface_id not in existing_surfaces:
|
|
1448
|
-
coverage["surfaces"].append(
|
|
1449
|
-
{
|
|
1450
|
-
"id": surface_id,
|
|
1451
|
-
"label": candidate["summary"],
|
|
1452
|
-
"disposition": disposition,
|
|
1453
|
-
"notes": candidate["evidence"],
|
|
1454
|
-
"receiptRefs": [],
|
|
1455
|
-
}
|
|
1456
|
-
)
|
|
1457
|
-
existing_surfaces.add(surface_id)
|
|
1458
|
-
if disposition != "needs_follow_up":
|
|
1459
|
-
continue
|
|
1460
|
-
coverage["deferred"].append(
|
|
1461
|
-
{
|
|
1462
|
-
"id": candidate_id,
|
|
1463
|
-
"candidateId": candidate_id,
|
|
1464
|
-
"reason": (
|
|
1465
|
-
"Validation was deferred because the scan reached its cost limit: "
|
|
1466
|
-
f"{candidate['summary']}. Evidence: {candidate['evidence']}"
|
|
1467
|
-
),
|
|
1468
|
-
"paths": paths,
|
|
1469
|
-
"surfaceIds": [surface_id],
|
|
1470
|
-
}
|
|
1471
|
-
)
|
|
1472
|
-
if not any(
|
|
1473
|
-
isinstance(item, dict)
|
|
1474
|
-
and isinstance(reason := item.get("reason"), str)
|
|
1475
|
-
and (
|
|
1476
|
-
reason == "Validation was deferred because the scan reached its cost limit."
|
|
1477
|
-
or reason.startswith(
|
|
1478
|
-
"Validation was deferred because the scan reached its cost limit: "
|
|
1479
|
-
)
|
|
1480
|
-
)
|
|
1481
|
-
for item in coverage["deferred"]
|
|
1482
|
-
):
|
|
1483
|
-
coverage["deferred"].append(
|
|
1484
|
-
{
|
|
1485
|
-
"id": "scan-cost-limit",
|
|
1486
|
-
"reason": "Validation was deferred because the scan reached its cost limit.",
|
|
1487
|
-
}
|
|
1488
|
-
)
|
|
1489
|
-
coverage.pop("completeness", None)
|
|
1490
|
-
for name, payload in (
|
|
1491
|
-
("findings.json", findings),
|
|
1492
|
-
("coverage.json", coverage),
|
|
1493
|
-
("scan-manifest.json", manifest),
|
|
1494
|
-
):
|
|
1495
|
-
try:
|
|
1496
|
-
write_scan_local_bytes(
|
|
1497
|
-
scan_dir,
|
|
1498
|
-
name,
|
|
1499
|
-
(json.dumps(payload, allow_nan=False, indent=2, sort_keys=True) + "\n").encode(),
|
|
1500
|
-
)
|
|
1501
|
-
except (ContractError, OSError, TypeError, ValueError) as exc:
|
|
1502
|
-
raise SystemExit(f"Budget-exhausted scan draft could not be saved: {exc}") from exc
|
|
1358
|
+
saved_results.budget_exhausted_draft(sys.modules[__name__], scan, scan_dir, candidates, warning)
|
|
1503
1359
|
|
|
1504
1360
|
|
|
1505
1361
|
def complete_scan_locked(
|
|
@@ -1552,7 +1408,6 @@ def complete_scan_locked(
|
|
|
1552
1408
|
for file_name in (
|
|
1553
1409
|
ARTIFACTS["manifest"],
|
|
1554
1410
|
ARTIFACTS["findings"],
|
|
1555
|
-
ARTIFACTS["coverage"],
|
|
1556
1411
|
):
|
|
1557
1412
|
try:
|
|
1558
1413
|
(scan_dir / file_name).lstat()
|
|
@@ -1613,9 +1468,9 @@ def complete_scan_locked(
|
|
|
1613
1468
|
)
|
|
1614
1469
|
warnings.extend(warning for warning in prepared.warnings if warning not in warnings)
|
|
1615
1470
|
add_warning()
|
|
1616
|
-
if
|
|
1617
|
-
#
|
|
1618
|
-
#
|
|
1471
|
+
if warnings != json.loads(scan["completion_warnings_json"]):
|
|
1472
|
+
# Persist all observed warnings before output writes can fail, so
|
|
1473
|
+
# stopped-result publication and retries retain those diagnostics.
|
|
1619
1474
|
with connection:
|
|
1620
1475
|
connection.execute(
|
|
1621
1476
|
"UPDATE scans SET completion_warnings_json = ? WHERE id = ? AND status = 'running'",
|
|
@@ -38,6 +38,7 @@ from finalize_scan_contract import (
|
|
|
38
38
|
write_threat_model_projection_if_possible,
|
|
39
39
|
)
|
|
40
40
|
from finalize_scan_contract import finding_candidate_id as finding_candidate_id
|
|
41
|
+
from review_state import checkpoint_review_state, review_state, review_summary, uses_legacy_review
|
|
41
42
|
from workbench.retained_coverage import (
|
|
42
43
|
_append_previous_finding as _append_previous_finding,
|
|
43
44
|
)
|
|
@@ -606,6 +607,7 @@ def preserve_deep_deadline_draft(
|
|
|
606
607
|
manifest, findings, coverage = prepared.manifest, prepared.findings, prepared.coverage
|
|
607
608
|
manifest["scan"].pop("sealedAt", None)
|
|
608
609
|
manifest["scan"].pop("artifacts", None)
|
|
610
|
+
manifest["scan"]["reviewState"] = checkpoint_review_state(coverage)
|
|
609
611
|
checkpoint = _parent_scan_draft(scan["id"], manifest["scan"], findings, coverage)
|
|
610
612
|
contents = _encoded(checkpoint)
|
|
611
613
|
name = f"{hashlib.sha256(contents).hexdigest()}.json"
|
|
@@ -617,7 +619,7 @@ def preserve_deep_deadline_draft(
|
|
|
617
619
|
write_scan_local_bytes(scan_dir, "checkpoint-head.json", _encoded({"checkpoint": name}))
|
|
618
620
|
for filename, document in (
|
|
619
621
|
("findings.json", findings),
|
|
620
|
-
("coverage.json", coverage),
|
|
622
|
+
*([("coverage.json", coverage)] if "coverageRef" in manifest["scan"] else []),
|
|
621
623
|
("scan-manifest.json", manifest),
|
|
622
624
|
):
|
|
623
625
|
write_scan_local_bytes(scan_dir, filename, _encoded(document))
|
|
@@ -1102,12 +1104,20 @@ def write_scan_draft(db: Any, connection: Any, args: Any) -> dict[str, Any]:
|
|
|
1102
1104
|
draft = _read_scan_local_json(scan_dir, relative, "Staged scan draft")
|
|
1103
1105
|
accepted_input = copy.deepcopy(draft)
|
|
1104
1106
|
accepted_checkpoint = None
|
|
1105
|
-
manifest, findings, coverage =
|
|
1107
|
+
manifest, findings, coverage = (
|
|
1108
|
+
draft["manifest"],
|
|
1109
|
+
draft["findings"],
|
|
1110
|
+
draft.get("reviewState", draft.get("coverage")),
|
|
1111
|
+
)
|
|
1112
|
+
manifest["scan"]["reviewState"] = checkpoint_review_state(coverage)
|
|
1113
|
+
manifest["scan"].pop("coverageRef", None)
|
|
1106
1114
|
binding = db.workbench_completion_binding(scan, db.now())
|
|
1107
1115
|
# Save scan IDs without sealing the draft.
|
|
1108
1116
|
_populate_unsealed_manifest_envelope(manifest, manifest["scan"], binding)
|
|
1109
1117
|
_populate_unsealed_artifact_envelope(manifest, findings, coverage, binding)
|
|
1110
1118
|
_validate_completion_binding(manifest, findings, coverage, binding)
|
|
1119
|
+
manifest["scan"]["mode"] = coverage["mode"]
|
|
1120
|
+
manifest["scan"]["review"] = review_summary(coverage)
|
|
1111
1121
|
projected = _parent_scan_draft(scan_id, manifest["scan"], findings, coverage)
|
|
1112
1122
|
admitted_input = None
|
|
1113
1123
|
checkpoint = manifest["scan"]
|
|
@@ -1202,12 +1212,12 @@ def write_scan_draft(db: Any, connection: Any, args: Any) -> dict[str, Any]:
|
|
|
1202
1212
|
filename: (json.dumps(document, allow_nan=False, indent=2) + "\n").encode()
|
|
1203
1213
|
for filename, document in (
|
|
1204
1214
|
("findings.json", findings),
|
|
1205
|
-
("coverage.json", coverage),
|
|
1206
1215
|
("scan-manifest.json", manifest),
|
|
1207
1216
|
)
|
|
1208
1217
|
}
|
|
1209
1218
|
for filename, contents in documents.items():
|
|
1210
1219
|
write_scan_local_bytes(scan_dir, filename, contents)
|
|
1220
|
+
_remove_scan_local_file_if_exists(scan_dir, "coverage.json")
|
|
1211
1221
|
if scan["mode"] == "deep" and manifest["scan"].get("complete") is not False:
|
|
1212
1222
|
# Select the accepted final publication before releasing the write lock.
|
|
1213
1223
|
with connection:
|
|
@@ -1286,7 +1296,7 @@ def _scan_draft_contents_digest(documents: dict[str, bytes | None]) -> str:
|
|
|
1286
1296
|
for filename in ("scan-manifest.json", "findings.json", "coverage.json"):
|
|
1287
1297
|
digest.update(filename.encode())
|
|
1288
1298
|
digest.update(b"\0")
|
|
1289
|
-
contents = documents
|
|
1299
|
+
contents = documents.get(filename)
|
|
1290
1300
|
if contents is None:
|
|
1291
1301
|
digest.update(b"missing\0")
|
|
1292
1302
|
else:
|
|
@@ -1402,3 +1412,158 @@ def preserve_stopped_results_after_transition(db: Any, connection: Any, scan_id:
|
|
|
1402
1412
|
|
|
1403
1413
|
if __name__ == "__main__":
|
|
1404
1414
|
argparse.ArgumentParser(description=__doc__).parse_args()
|
|
1415
|
+
|
|
1416
|
+
|
|
1417
|
+
def budget_exhausted_draft(
|
|
1418
|
+
db: Any,
|
|
1419
|
+
scan: sqlite3.Row,
|
|
1420
|
+
scan_dir: Path,
|
|
1421
|
+
candidates: list[dict[str, Any]],
|
|
1422
|
+
warning: str,
|
|
1423
|
+
) -> None:
|
|
1424
|
+
documents: dict[str, dict[str, Any]] = {}
|
|
1425
|
+
for name in ("scan-manifest.json", "findings.json"):
|
|
1426
|
+
path = db.artifact_path(scan_dir, name, required=False)
|
|
1427
|
+
if path is not None:
|
|
1428
|
+
documents[name] = db.read_json_object(path)
|
|
1429
|
+
if documents and len(documents) != 2:
|
|
1430
|
+
raise SystemExit("Budget-exhausted scan contains an incomplete canonical scan draft.")
|
|
1431
|
+
|
|
1432
|
+
if documents:
|
|
1433
|
+
manifest = documents["scan-manifest.json"]
|
|
1434
|
+
findings = documents["findings.json"]
|
|
1435
|
+
coverage = (
|
|
1436
|
+
db.read_json_object(db.artifact_path(scan_dir, "coverage.json", required=True))
|
|
1437
|
+
if uses_legacy_review(manifest["scan"])
|
|
1438
|
+
else review_state(manifest["scan"])
|
|
1439
|
+
)
|
|
1440
|
+
if not isinstance(manifest.get("scan"), dict) or not isinstance(
|
|
1441
|
+
findings.get("findings"), list
|
|
1442
|
+
):
|
|
1443
|
+
raise SystemExit("Budget-exhausted scan contains an invalid canonical scan draft.")
|
|
1444
|
+
for key in ("surfaces", "explicitExclusions", "deferred"):
|
|
1445
|
+
if not isinstance(coverage.get(key), list):
|
|
1446
|
+
raise SystemExit("Budget-exhausted scan contains invalid canonical coverage.")
|
|
1447
|
+
if manifest_is_sealed(manifest["scan"]):
|
|
1448
|
+
raise SystemExit("Budget-exhausted scan cannot replace an already sealed scan draft.")
|
|
1449
|
+
else:
|
|
1450
|
+
contract = db.scan_contract(scan)
|
|
1451
|
+
target_contract = contract["target"]
|
|
1452
|
+
target: dict[str, Any] = {
|
|
1453
|
+
"kind": target_contract["allowedKinds"][0],
|
|
1454
|
+
"targetId": target_contract["targetId"],
|
|
1455
|
+
"displayName": target_contract["displayName"],
|
|
1456
|
+
}
|
|
1457
|
+
if scan["target_revision"] != "unversioned":
|
|
1458
|
+
target["revision"] = scan["target_revision"]
|
|
1459
|
+
if "requiredSnapshotDigest" in target_contract:
|
|
1460
|
+
target["snapshotDigest"] = target_contract["requiredSnapshotDigest"]
|
|
1461
|
+
manifest = {
|
|
1462
|
+
"scan": {
|
|
1463
|
+
"target": target,
|
|
1464
|
+
"scope": {"limitations": [warning]},
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
findings = {"findings": []}
|
|
1468
|
+
coverage = {
|
|
1469
|
+
"inventoryStrategy": (
|
|
1470
|
+
"scoped_path" if db.expected_coverage_mode(scan) == "scoped_path" else "repository"
|
|
1471
|
+
),
|
|
1472
|
+
"surfaces": [],
|
|
1473
|
+
"explicitExclusions": [],
|
|
1474
|
+
"deferred": [],
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
findings_by_candidate = {
|
|
1478
|
+
candidate_id
|
|
1479
|
+
for finding in findings["findings"]
|
|
1480
|
+
if isinstance(finding, dict)
|
|
1481
|
+
and isinstance(candidate_id := finding_candidate_id(finding), str)
|
|
1482
|
+
}
|
|
1483
|
+
existing_deferred = {
|
|
1484
|
+
item.get("candidateId", item.get("id"))
|
|
1485
|
+
for item in coverage["deferred"]
|
|
1486
|
+
if isinstance(item, dict) and isinstance(item.get("candidateId", item.get("id")), str)
|
|
1487
|
+
}
|
|
1488
|
+
existing_surfaces = {
|
|
1489
|
+
item.get("id")
|
|
1490
|
+
for item in coverage["surfaces"]
|
|
1491
|
+
if isinstance(item, dict) and isinstance(item.get("id"), str)
|
|
1492
|
+
}
|
|
1493
|
+
for candidate in candidates:
|
|
1494
|
+
candidate_id = candidate["candidate_id"]
|
|
1495
|
+
if candidate_id in findings_by_candidate or candidate_id in existing_deferred:
|
|
1496
|
+
continue
|
|
1497
|
+
paths = list(dict.fromkeys(location["path"] for location in candidate["locations"]))
|
|
1498
|
+
surface_id = f"candidate-{candidate_id}"
|
|
1499
|
+
validation = candidate.get("validation")
|
|
1500
|
+
validation = validation.get("disposition") if isinstance(validation, dict) else None
|
|
1501
|
+
attack = candidate.get("attack_path")
|
|
1502
|
+
attack = attack.get("decision") if isinstance(attack, dict) else None
|
|
1503
|
+
disposition = (
|
|
1504
|
+
"needs_follow_up"
|
|
1505
|
+
if validation == "deferred" or attack == "deferred"
|
|
1506
|
+
else "not_applicable"
|
|
1507
|
+
if validation == "not_applicable"
|
|
1508
|
+
else "rejected"
|
|
1509
|
+
if validation == "suppressed" or attack == "ignore"
|
|
1510
|
+
else "needs_follow_up"
|
|
1511
|
+
)
|
|
1512
|
+
if surface_id not in existing_surfaces:
|
|
1513
|
+
coverage["surfaces"].append(
|
|
1514
|
+
{
|
|
1515
|
+
"id": surface_id,
|
|
1516
|
+
"label": candidate["summary"],
|
|
1517
|
+
"disposition": disposition,
|
|
1518
|
+
"notes": candidate["evidence"],
|
|
1519
|
+
"receiptRefs": [],
|
|
1520
|
+
}
|
|
1521
|
+
)
|
|
1522
|
+
existing_surfaces.add(surface_id)
|
|
1523
|
+
if disposition != "needs_follow_up":
|
|
1524
|
+
continue
|
|
1525
|
+
coverage["deferred"].append(
|
|
1526
|
+
{
|
|
1527
|
+
"id": candidate_id,
|
|
1528
|
+
"candidateId": candidate_id,
|
|
1529
|
+
"reason": (
|
|
1530
|
+
"Validation was deferred because the scan reached its cost limit: "
|
|
1531
|
+
f"{candidate['summary']}. Evidence: {candidate['evidence']}"
|
|
1532
|
+
),
|
|
1533
|
+
"paths": paths,
|
|
1534
|
+
"surfaceIds": [surface_id],
|
|
1535
|
+
}
|
|
1536
|
+
)
|
|
1537
|
+
if not any(
|
|
1538
|
+
isinstance(item, dict)
|
|
1539
|
+
and isinstance(reason := item.get("reason"), str)
|
|
1540
|
+
and (
|
|
1541
|
+
reason == "Validation was deferred because the scan reached its cost limit."
|
|
1542
|
+
or reason.startswith(
|
|
1543
|
+
"Validation was deferred because the scan reached its cost limit: "
|
|
1544
|
+
)
|
|
1545
|
+
)
|
|
1546
|
+
for item in coverage["deferred"]
|
|
1547
|
+
):
|
|
1548
|
+
coverage["deferred"].append(
|
|
1549
|
+
{
|
|
1550
|
+
"id": "scan-cost-limit",
|
|
1551
|
+
"reason": "Validation was deferred because the scan reached its cost limit.",
|
|
1552
|
+
}
|
|
1553
|
+
)
|
|
1554
|
+
coverage.pop("completeness", None)
|
|
1555
|
+
manifest["scan"].pop("coverageRef", None)
|
|
1556
|
+
manifest["scan"]["mode"] = db.expected_coverage_mode(scan)
|
|
1557
|
+
manifest["scan"]["reviewState"] = checkpoint_review_state(coverage)
|
|
1558
|
+
for name, payload in (
|
|
1559
|
+
("findings.json", findings),
|
|
1560
|
+
("scan-manifest.json", manifest),
|
|
1561
|
+
):
|
|
1562
|
+
try:
|
|
1563
|
+
write_scan_local_bytes(
|
|
1564
|
+
scan_dir,
|
|
1565
|
+
name,
|
|
1566
|
+
(json.dumps(payload, allow_nan=False, indent=2, sort_keys=True) + "\n").encode(),
|
|
1567
|
+
)
|
|
1568
|
+
except (ContractError, OSError, TypeError, ValueError) as exc:
|
|
1569
|
+
raise SystemExit(f"Budget-exhausted scan draft could not be saved: {exc}") from exc
|
|
@@ -23,6 +23,7 @@ from finalize_scan_contract import (
|
|
|
23
23
|
manifest_is_sealed,
|
|
24
24
|
)
|
|
25
25
|
from report_projection import SEVERITY_ORDER
|
|
26
|
+
from review_state import review_state
|
|
26
27
|
from workbench_constants import ARTIFACTS, FINDINGS_PAGE_MAX
|
|
27
28
|
from workbench_scan_start import scan_target_identity
|
|
28
29
|
from workbench_scan_usage import stored_scan_cost_fields
|
|
@@ -147,7 +148,7 @@ def coverage_summary_for_history(
|
|
|
147
148
|
wb: Any, scan: sqlite3.Row, canonical_scan_directory: Callable[[Path], Path]
|
|
148
149
|
) -> dict[str, Any]:
|
|
149
150
|
scan_dir = canonical_scan_directory(Path(scan["scan_dir"]))
|
|
150
|
-
coverage_ref =
|
|
151
|
+
coverage_ref = "coverage.json"
|
|
151
152
|
try:
|
|
152
153
|
if scan["seal_manifest_digest"] is None:
|
|
153
154
|
# Older workbench rows can have valid seals without a pinned digest.
|
|
@@ -157,7 +158,7 @@ def coverage_summary_for_history(
|
|
|
157
158
|
raise ContractError("coverage.mode: must match the workbench scan")
|
|
158
159
|
else:
|
|
159
160
|
# Completion already validated the full scan. History only needs the
|
|
160
|
-
# pinned manifest and
|
|
161
|
+
# pinned manifest and any legacy coverage artifact, not findings or receipts.
|
|
161
162
|
manifest, manifest_bytes = _read_scan_local_json_bytes(
|
|
162
163
|
scan_dir, ARTIFACTS["manifest"], ARTIFACTS["manifest"]
|
|
163
164
|
)
|
|
@@ -167,11 +168,15 @@ def coverage_summary_for_history(
|
|
|
167
168
|
):
|
|
168
169
|
raise ContractError("The sealed scan manifest changed after completion.")
|
|
169
170
|
sealed_scan = manifest["scan"]
|
|
170
|
-
if (
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
if sealed_scan["id"] != scan["id"] or not sealed_scan.get("sealedAt"):
|
|
172
|
+
raise ContractError("The sealed coverage does not belong to this scan.")
|
|
173
|
+
if "coverageRef" not in sealed_scan:
|
|
174
|
+
coverage = review_state(sealed_scan)
|
|
175
|
+
return {
|
|
176
|
+
key: coverage[key]
|
|
177
|
+
for key in ("mode", "includePaths", "excludePaths", "explicitExclusions")
|
|
178
|
+
}
|
|
179
|
+
if sealed_scan["coverageRef"] != coverage_ref:
|
|
175
180
|
raise ContractError("The sealed coverage does not belong to this scan.")
|
|
176
181
|
coverage, coverage_bytes = _read_scan_local_json_bytes(
|
|
177
182
|
scan_dir, coverage_ref, coverage_ref
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: publish-findings
|
|
3
|
-
description:
|
|
3
|
+
description: Requires explicit opt-in with CODEX_SECURITY_ENABLE_EXTERNAL_IMPORTS=1. Preview and import supported findings from Snyk Open Source, Semgrep Code, OpenGrep, Endor Labs, GitHub, or Wiz into the local workbench or Codex Security Cloud. Use each provider's documented native JSON, SARIF, plugin bundle, JSONL or CSV format, including gzip-compressed reports.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Publish external findings
|
|
@@ -80,6 +80,10 @@ Import the native report with `--provider semgrep`, a stable organization/projec
|
|
|
80
80
|
|
|
81
81
|
Keep supplied fingerprints. Reimporting the same fingerprint after code moves updates the existing source record with the new range. If the fingerprint is absent or `requires login`, the fallback uses rule, literal path and range: movement creates a second retained record, and the earlier record remains stored. Do not infer a merge or deletion. Read the persisted evidence with `codex-security findings imported /path/to/project --format json` before assessment. Source rule, CWE, snippets, traces and status are vendor evidence, not Codex assessments. Do not infer a report revision from the current checkout. Resolve scan errors and review all exclusions before uploading; do not remove error metadata to force acceptance.
|
|
82
82
|
|
|
83
|
+
## OpenGrep
|
|
84
|
+
|
|
85
|
+
Import native OpenGrep JSON with `--provider opengrep`, `--source-repository-url`, and a stable OpenGrep-specific `--source-key`. Preview the destination and scan diagnostics before importing. Local and Cloud imports use the Semgrep provider and retain OpenGrep as the scanner origin.
|
|
86
|
+
|
|
83
87
|
## GitHub alerts and advisories
|
|
84
88
|
|
|
85
89
|
Acquire code-scanning findings with `codex-security import github OWNER/REPO --format json` and save its complete JSON output for local import or Cloud publication. This existing collector completes pagination, fetches alert details, and retains the selected ref's instance. In Codex, use the official [GitHub Codex plugin](https://github.com/openai/plugins/tree/main/plugins/github) for discovery and selecting alerts, then pass that selection to the collector. Its GitHub MCP server paginates each list call separately. Do not ask the user to download JSON from a website or reconstruct an import envelope from MCP summaries; raw MCP/API responses are not accepted by `--provider github`.
|
|
@@ -29,7 +29,7 @@ Use `cancel_codex_security_scan` only when the user explicitly cancels. Reserve
|
|
|
29
29
|
2. Prepare the changed-file list with `prepare_codex_security_review_items` and read all pages from `list_codex_security_review_items`. Review supporting unchanged files only as needed to explain changed behavior.
|
|
30
30
|
3. Run `$finding-discovery` in compact diff mode across that inventory. Divide independent assignments among available workers and review unassigned files yourself. Keep independently vulnerable instances addressable and record all candidates once with `record_codex_security_discovery_candidates`. Do not create ranked worklists, per-finding ledgers, or discovery reports.
|
|
31
31
|
4. If candidates exist, run `$validation` once, then `$attack-path-analysis` once for candidates marked `reportable` or `deferred`. Preserve locations, evidence, affected instances, and unresolved questions.
|
|
32
|
-
5. Read `../../references/final-report.md` for the finding,
|
|
32
|
+
5. Read `../../references/final-report.md` for the finding, review-state, and completion contract. Save `complete: false` semantic checkpoints through `record_codex_security_scan_draft` as decisions arrive, preserving unresolved candidates and original evidence in `reviewState.deferred`. After review settles, submit `complete: true` with the retained model, findings, and review state. Reuse saved surface IDs; close finished generic tasks with `reviewState.resolvedDeferred: [{ id, reason }]` using their saved IDs. Detailed write-ups and hardening plans are optional requested outputs.
|
|
33
33
|
6. Call `complete_codex_security_scan` once, then read `get_codex_security_completed_scan`, except when the SDK owns completion. Finalization creates `report.md` and SARIF. Return the generated report, actual coverage limitations, measured token usage when available, and Codex review comments for confirmed findings.
|
|
34
34
|
|
|
35
35
|
Every changed file and candidate must be accounted for as reviewed, resolved, or explicitly unfinished; do not turn an incomplete review into a no-findings claim.
|
|
@@ -20,17 +20,17 @@ SDK hosts supply their own progress instructions. Use actual deduplicated review
|
|
|
20
20
|
## Workflow
|
|
21
21
|
|
|
22
22
|
1. Resolve the authorized target, scope, scan directory, and source context. Preserve the supplied threat model, applicable inherited `SECURITY.md` guidance, and optional `CODEX_SECURITY_KNOWLEDGE_BASE`. When `CODEX_SECURITY_TARGET_PATHS_FILE` is supplied, use the SDK's exact `make-repo-scope-input` command to resolve every requested file and non-ignored directory descendant before review. If the host does not supply the command, run `<plugin_dir>/scripts/launch_codex_security_mcp --helper make-repo-scope-input --repo <repo_root> --scopes-file "$CODEX_SECURITY_TARGET_PATHS_FILE" --out <scan_dir>/scoped-source-input.jsonl` or use the [PowerShell command](#windows-scoped-input) on Windows. Pass the resulting inventory to the core audit without widening scope; do not print, modify, or evaluate the scope file.
|
|
23
|
-
2. Read `../../references/core-scan.md` and perform the audit within the resolved scope and configured limits. Retain its semantic `scope`, `threatModel`, `findings`, and `
|
|
24
|
-
3. Save semantic checkpoints throughout the audit as described below. For an SDK-owned scan with a bound semantic draft tool, save the first `complete: false` checkpoint as soon as the threat model is available, then checkpoint new findings and decisions and submit `complete: true` when review finishes. Without that tool, retain the model in an early unsealed canonical draft and update `scan-manifest.json
|
|
25
|
-
4. Verify
|
|
23
|
+
2. Read `../../references/core-scan.md` and perform the audit within the resolved scope and configured limits. Retain its semantic `scope`, `threatModel`, `findings`, and `reviewState`, including source evidence, validation, attack paths, calibrated severity/confidence, and unresolved work.
|
|
24
|
+
3. Save semantic checkpoints throughout the audit as described below. For an SDK-owned scan with a bound semantic draft tool, save the first `complete: false` checkpoint as soon as the threat model is available, then checkpoint new findings and decisions and submit `complete: true` when review finishes. Without that tool, retain the model in an early unsealed canonical draft and update `scan-manifest.json` and `findings.json` using `../../references/scan-contract.md` and the SDK's exact identity and directory. Omit `scan.sealedAt` and `scan.artifacts`. Put review bookkeeping in `scan.reviewState` and set `scan.mode` to `scoped_path` for requested scopes or `repository` otherwise. On SDK file-authored paths, run the supplied scope-binding command when a target-paths file is present.
|
|
25
|
+
4. Verify both canonical JSON files exist. Return control for an SDK-owned scan; the SDK owns finalization and report generation. For other host-backed scans, call `complete_codex_security_scan({ scanId, handoffClaimToken? })` once and return after it succeeds and `report.md` exists. If completion fails, surface its exact error and preserve the scan for continuation. Do not hand-author reports or reread complete canonical findings unless requested. Report complete measured token usage only; leave pending usage to the host and identify unavailable counts.
|
|
26
26
|
|
|
27
27
|
Keep discovery, validation, and attack-path reasoning within this Standard workflow. Do not invoke separate phase skills, Deep-only tools, ranking phases, or per-file/per-candidate ledgers. Once assigned review and concrete follow-ups are settled, finish the configured audit with honest limitations rather than waiting for unspecified worker updates.
|
|
28
28
|
|
|
29
29
|
## Semantic Checkpoints
|
|
30
30
|
|
|
31
|
-
For a host-backed scan, use `record_codex_security_scan_draft({ scanId, complete, handoffClaimToken?, scope?, threatModel, findings,
|
|
31
|
+
For a host-backed scan, use `record_codex_security_scan_draft({ scanId, complete, handoffClaimToken?, scope?, threatModel, findings, reviewState })`. Save a `complete: false` checkpoint as soon as the threat model is available, with no findings when none exist yet. Checkpoint new findings and decisions, then submit an accepted `complete: true` draft when review finishes. Let the host derive authoritative metadata and identities.
|
|
32
32
|
|
|
33
|
-
Preserve saved surface IDs and unfinished candidates; close completed generic tasks using `
|
|
33
|
+
Preserve saved surface IDs and unfinished candidates; close completed generic tasks using `reviewState.resolvedDeferred: [{ id, reason }]` with their saved IDs. Follow `../../references/final-report.md` for rejected drafts and interrupted writes, preserving the same scan.
|
|
34
34
|
|
|
35
35
|
## Windows Scope Binding
|
|
36
36
|
|
|
@@ -40,7 +40,7 @@ Use the SDK-supplied command when available. For another explicitly permitted fi
|
|
|
40
40
|
$env:scopePluginRoot = Convert-Path -LiteralPath '<plugin_dir>' -ErrorAction Stop
|
|
41
41
|
$env:scopeScanDir = Convert-Path -LiteralPath '<scan_dir>' -ErrorAction Stop
|
|
42
42
|
$env:scopeTargetPaths = Convert-Path -LiteralPath $env:CODEX_SECURITY_TARGET_PATHS_FILE -ErrorAction Stop
|
|
43
|
-
cmd.exe /d /v:off /s /c '""%scopePluginRoot%\scripts\launch_codex_security_mcp.cmd" --helper bind-repo-scopes --scopes-file "%scopeTargetPaths%" --manifest "%scopeScanDir%\scan-manifest.json"
|
|
43
|
+
cmd.exe /d /v:off /s /c '""%scopePluginRoot%\scripts\launch_codex_security_mcp.cmd" --helper bind-repo-scopes --scopes-file "%scopeTargetPaths%" --manifest "%scopeScanDir%\scan-manifest.json""'
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
These are temporary shell variables. Resolve paths against PowerShell's current location, including UNC shares. Missing paths stop the command. CMD expands these references once, preserving literal `%` and `!` in paths.
|
|
@@ -89,7 +89,7 @@ A successful provider response establishes an accepted write. Immediately call `
|
|
|
89
89
|
|
|
90
90
|
After recording an accepted write, read the returned object through the same transport when possible to check identity and changed fields, allowing provider formatting that preserves meaning and links. Record the same receipt again with `readback: {status: "verified"}` or `{status: "failed", error}`; omit readback when no read was attempted. A current read confirming reuse can be recorded as verified immediately. Keep accepted writes and read failures distinct. An unreadable issue does not authorize another create.
|
|
91
91
|
|
|
92
|
-
For CLI issue writes, put the approved body in a mode-`0600` temporary file outside the repository and scan bundle, arrange cleanup on every exit, and pass it to one `gh issue create` or `gh issue edit`. Never print the file. Capture the issue
|
|
92
|
+
For CLI issue writes, put the approved body in a mode-`0600` temporary file outside the repository and scan bundle, arrange cleanup on every exit, and pass it to one `gh issue create` or `gh issue edit`. Never print the file. Capture the returned issue URL as `issue_url` and read it with `gh issue view "$issue_url" --json number,url,title,body`. Append the JSON fields for any other metadata in the approved write, such as `labels` or `assignees`. Use the advisory reference for JSON file creation and required readback.
|
|
93
93
|
|
|
94
94
|
If a mutation fails or times out and may have succeeded, reconcile through exact reads or binding searches before any retry. Stop if the result remains uncertain. After an interrupted batch, reconcile receipts and current reads for completed items, then validate and check duplicates for the remaining items. Keep approval when the remaining writes and destination are unchanged.
|
|
95
95
|
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src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