Commit 2b2d87c
authored
fix: allow completion when no draft manifest exists yet (#83)
Fresh recipe-driven scans fail at completion with:
Could not save the Codex Security scan: scan-manifest.json:
expected a regular file inside the scan directory.
`workbench_db.complete_scan` reads `scan-manifest.json` with
`required=True` when `scan.recipe_json is not None`, but on a first
completion of a fresh scan there is no prior draft on disk yet — the
draft is authored later by `_write_prepared_scan_finalization`. The
read therefore always raises before the write can happen, and every
retry still throws before writing anything, so `scan_dir` stays empty
and models are billed with no artifacts produced.
Make the pre-write read optional. When a prior manifest is present
(resumed / re-completed scans), preserve the sealed timestamps as
before; otherwise skip that step and let the downstream finalizer
write the draft.
Verified against `pnpm run lint` (tsc --noEmit) and the full
`bun test` suite on the public SDK: 367 pass, 23 expected skips,
0 fail.
Refs #731 parent be60e8f commit 2b2d87c
1 file changed
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1414 | 1414 | | |
1415 | 1415 | | |
1416 | 1416 | | |
1417 | | - | |
1418 | | - | |
1419 | | - | |
1420 | | - | |
1421 | | - | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
1422 | 1429 | | |
1423 | 1430 | | |
1424 | 1431 | | |
| |||
0 commit comments