Skip to content

fix(deep-scan): preserve cost-stopped results across retries - #2686

Open
mldangelo-oai wants to merge 14 commits into
mainfrom
fix/reconcile-deep-scan-cost-stop
Open

mldangelo-oai wants to merge 14 commits into
mainfrom
fix/reconcile-deep-scan-cost-stop

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A Deep Scan that exhausts its configured cost limit after discovery now reports a stopped outcome. The manifest records failed, SARIF records executionSuccessful: false, and the CLI emits scan.failed with cost_limit_exceeded and exits 2. Validated findings and deferred candidates remain available. Fixes #2415.

Changes

This continues #2492 and preserves its contributor commits, including the authoritative parent-checkpoint fix. Its fork branch does not permit maintainer edits. This branch includes a normal merge of main at 173483d7.

Before publishing the prepared seal, the workbench records the intended manifest, prior draft digest, selected checkpoint, cost and warning in its private state. A fresh fallback or a later resume verifies those inputs and indexes the original findings after an interrupted SQLite write. A budget stop can also retain a validated finding from an explicitly incomplete draft.

The existing workbench command dispatches the cost stop. The saved-result module records and validates its recovery receipt. The branch also includes the shared test-only inventory fixture correction from #2678.

Testing

  • Reproduced on main with fresh and resumed synthetic CLI scans. Both returned 0 with a completed manifest and successful SARIF after discovery. The same cases on this branch returned 2 with a failed manifest and unsuccessful SARIF.
  • Eight Linux CLI scenarios passed with 75 assertions using real SQLite, the packaged plugin and synthetic model events. With a terminal write fault, fresh fallback restored the index. Retrying a resumed scan after clearing the fault retained the same finding in the workbench, on disk and in SARIF. The retry started zero model turns and preserved the original manifest bytes.
  • Seven focused Python regression cases passed, including process termination immediately before the manifest write, exact seal recovery and rejection of changed drafts or checkpoints.
  • The five portable plugin checks passed, including all nine compatibility tests. SDK and MCP types, SDK formatting, the 193-file plugin build, the two affected inventory tests and git diff --check passed.

Risk and rollout

Automation that previously treated a post-discovery cost stop as success will now receive exit 2. The recovery receipt covers newly prepared results and needs no database migration. Previously sealed scans retain their original status. Local runtime verification used Linux and synthetic model events.

When integrating #2669, retain both reasons to replace a review checkpoint: an explicit cost stop and conversion of authoritative unsealed legacy coverage. Ordinary existing checkpoints and frozen legacy recovery sources retain their existing selection. #2623 addresses bulk recovery of completed seals separately.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

Aditya-linux and others added 6 commits November 10, 2026 00:03
…mit-status

# Conflicts:
#	plugins/codex-security/scripts/workbench_db.py
Save the prepared manifest and selected review checkpoint before sealing a cost-limited scan. If SQLite cannot record the terminal result, verify the retained artifacts and finish indexing the same findings on retry. Allow an explicitly incomplete parent draft to retain its validated findings when the budget stops validation.
@github-actions github-actions Bot added the bug Something isn't working label Nov 15, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T15:46:24.712209Z b8cb188 New commits
🔒 Security Review ✅ Completed 2026-11-20T15:48:23.262345Z b8cb188 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deep Scan: a --max-cost stop after discovery is sealed as scan.status: completed (SARIF executionSuccessful: true, exit 0)

2 participants