Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
364daa7
fix: retain unfinished checkpoints at Deep Scan deadlines
mldangelo-oai Oct 17, 2026
5d2ff41
fix: retain valid deadline checkpoint artifacts
mldangelo-oai Oct 17, 2026
f16400a
fix: isolate deadline recovery from canonical validation
mldangelo-oai Oct 17, 2026
bc404ea
fix: preserve deadline coverage and replay identity
mldangelo-oai Oct 17, 2026
4438db8
fix: stabilize recovered deadline coverage
mldangelo-oai Oct 17, 2026
48ba186
fix: preserve deadline checkpoint contracts and source links
mldangelo-oai Oct 17, 2026
1bab58f
fix: preserve recovered coverage links and outcome validation
mldangelo-oai Oct 17, 2026
d8a1a25
Merge main into deadline checkpoint retention
mldangelo-oai Oct 20, 2026
b3dc44f
Merge remote-tracking branch 'origin/main' into mdangelo/codex/pr-ref…
mldangelo-oai Oct 20, 2026
4116036
Merge remote-tracking branch 'origin/main' into mdangelo/codex/pr-ref…
mldangelo-oai Oct 20, 2026
ada1ff7
fix(deep-scan): preserve retained surface link identity
mldangelo-oai Oct 20, 2026
900c35b
Merge main owner suggestions
mldangelo-oai Oct 20, 2026
5ca8c67
chore(deep-scan): merge main and remove unused recovery helper
mldangelo-oai Oct 22, 2026
5acaa8a
Merge main into PR branch
mldangelo-oai Oct 22, 2026
ffe80c4
fix(deep-scan): preserve tasks that share the deadline marker ID
mldangelo-oai Oct 22, 2026
225c470
test: close native configuration fixture before preflight reply
mldangelo-oai Oct 22, 2026
80cf6e2
Merge main into PR branch
mldangelo-oai Oct 23, 2026
fb3f3d1
Merge latest main into PR branch
mldangelo-oai Oct 23, 2026
155729c
Merge latest main smoke timeout fixes into PR branch
mldangelo-oai Oct 23, 2026
1ef4ecb
refactor(imports): separate report readers from source providers
mldangelo-oai Oct 23, 2026
cf05a3a
Merge main into PR branch
mldangelo-oai Oct 23, 2026
5ad5821
chore: merge main while preserving deadline recovery
mldangelo-oai Oct 23, 2026
3713481
Merge main into import reader routing refactor
mldangelo-oai Oct 23, 2026
ba8e23e
Merge checkpoint retention repair into import reader routing
mldangelo-oai Oct 23, 2026
c1a945f
chore: merge main output helper extraction
mldangelo-oai Oct 23, 2026
d5ebdbf
chore: merge main saved-result helper consolidation
mldangelo-oai Oct 23, 2026
40ef060
Merge main checkpoint recovery updates into import reader routing
mldangelo-oai Oct 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugins/codex-security/plugin-files.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"scripts/workbench/runtime_toml.py",
"scripts/workbench/saved_coverage.py",
"scripts/workbench/saved_outputs.py",
"scripts/workbench/saved_sources.py",
"scripts/workbench/storage.py",
"scripts/workbench_cli.py",
"scripts/workbench_constants.py",
Expand All @@ -95,6 +96,7 @@
"scripts/workbench_publication.py",
"scripts/workbench_remediation.py",
"scripts/workbench_saved_results.py",
"scripts/workbench/retained_coverage.py",
"scripts/workbench_scan_history.py",
"scripts/workbench_scan_start.py",
"scripts/workbench_scan_usage.py",
Expand Down
12 changes: 8 additions & 4 deletions plugins/codex-security/scripts/deep_scan_workbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -1747,9 +1747,9 @@ def finish_deep_scan_locked(
""",
(scan_id,),
).fetchone()
discovery_deadline = args.terminal_reason == "capped" and deep_scan_deadline_reached(run)
zero_discovery_deadline = (
args.terminal_reason == "capped"
and deep_scan_deadline_reached(run)
discovery_deadline
and run["completion_sequence"] == 0
and (
standard_scan_manifest
Expand Down Expand Up @@ -1781,9 +1781,13 @@ def finish_deep_scan_locked(
kind="file",
)
promotion = promote_staged_file(staged_manifest_path, manifest_path)
if zero_discovery_deadline:
if zero_discovery_deadline or (discovery_deadline and standard_scan_manifest):
deadline_publication = saved_results.preserve_deep_deadline_draft(
dependencies(), connection, scan, allow_empty=not standard_scan_manifest
dependencies(),
connection,
scan,
preserve_reduction=not zero_discovery_deadline,
allow_empty=not standard_scan_manifest,
)
timestamp = dependencies().now()
connection.execute(
Expand Down
39 changes: 35 additions & 4 deletions plugins/codex-security/scripts/finalize_scan_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,7 @@ def _recover_unsealed_findings(
f"Skipped malformed {auxiliary} for finding {index + 1}: {exc}."
)
_validate_schema_node(finding, finding_schema, context, schema)
_require_safe_json_value(finding, context)
if current_contract:
_validate_current_findings({"findings": [finding]}, schema_dir)
except ContractError as exc:
Expand Down Expand Up @@ -1268,9 +1269,12 @@ def _recover_unsealed_coverage(
scan_dir: Path,
warnings: list[str],
discarded_findings: list[str],
) -> None:
*,
worker_draft: bool = False,
) -> set[str]:
schema = _read_json(schema_dir / "coverage.schema.json")
properties = _require_dict(schema, "properties", "coverage.schema")
discarded_fields: set[str] = set()
if (
coverage.get("mode") == "deep_repository"
and coverage.get("inventoryStrategy") != "repository"
Expand All @@ -1280,16 +1284,24 @@ def _recover_unsealed_coverage(

surface_ids: set[str] = set()
receipt_paths: dict[str, str] = {}
for field, label in (
fields = [
("surfaces", "coverage surface"),
("explicitExclusions", "coverage exclusion"),
("deferred", "deferred coverage item"),
):
]
if worker_draft:
if "openQuestions" in coverage:
_normalize_unsealed_open_questions(coverage)
fields.append(("openQuestions", "coverage open question"))
if "resolvedDeferred" in coverage:
fields.append(("resolvedDeferred", "resolved deferred item"))
for field, label in fields:
array_schema = _require_dict(properties, field, "coverage.schema.properties")
item_schema = _require_dict(array_schema, "items", f"coverage.schema.properties.{field}")
items = coverage.get(field)
if not isinstance(items, list):
warnings.append(f"Skipped malformed {label} records: expected an array.")
discarded_fields.add(field)
coverage[field] = []
continue

Expand All @@ -1302,7 +1314,9 @@ def _recover_unsealed_coverage(
if field == "surfaces":
surface_receipt_paths = dict(receipt_paths)
surface_id = _require_str(item, "id", context)
if surface_id in surface_ids:
if worker_draft:
_require_str(item, "label", context)
if surface_id in surface_ids and not worker_draft:
raise ContractError(f"{context}.id: duplicate surface id")
disposition = item.get("disposition")
surface_recovered = False
Expand Down Expand Up @@ -1352,12 +1366,18 @@ def _recover_unsealed_coverage(
item["receiptRefs"] = recovered_receipts
if surface_recovered:
item["disposition"] = "needs_follow_up"
discarded_fields.add(field)

if field == "deferred":
_validate_deferred_paths(item, context)
_validate_schema_node(item, item_schema, context)
if field == "resolvedDeferred":
_validate_resolved_deferred({"resolvedDeferred": [item]})
if worker_draft:
_require_safe_json_value(item, context)
except ContractError as exc:
warnings.append(f"Skipped malformed {label} {index + 1}: {exc}.")
discarded_fields.add(field)
continue

if field == "surfaces":
Expand All @@ -1369,6 +1389,13 @@ def _recover_unsealed_coverage(

if discarded_findings:
for surface in coverage["surfaces"]:
if (
worker_draft
and surface.get("candidateId")
and surface["disposition"] in {"rejected", "not_applicable"}
):
# A valid explicit outcome can still resolve that worker's history.
continue
surface["disposition"] = "needs_follow_up"
coverage["deferred"].extend(
{"id": f"discarded-finding-{index}", "reason": warning}
Expand All @@ -1383,9 +1410,13 @@ def _recover_unsealed_coverage(
"coverage.resolvedDeferred",
)
_validate_resolved_deferred(coverage)
if worker_draft:
_require_safe_json_value(coverage["resolvedDeferred"], "coverage.resolvedDeferred")
except ContractError as exc:
coverage.pop("resolvedDeferred")
warnings.append(f"Skipped malformed resolved deferred work: {exc}.")
discarded_fields.add("resolvedDeferred")
return discarded_fields


def _recover_unsealed_hardening(
Expand Down
Loading
Loading