Skip to content

fix(bulk-scan): preserve outcomes when checkout cleanup fails - #1433

Merged
mldangelo-oai merged 6 commits into
openai:mainfrom
bharathvemula:BharathVemula/fix-211-preserve-multiscan-receipts
Oct 16, 2026
Merged

mldangelo-oai merged 6 commits into
openai:mainfrom
bharathvemula:BharathVemula/fix-211-preserve-multiscan-receipts

Conversation

@bharathvemula

@bharathvemula bharathvemula commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Keep a bulk scan's outcome when removing its temporary checkout fails. A cleanup error must not erase a successful result or replace the original scan failure.

Fixes #211.

Changes

  • Separate scan failures from checkout cleanup failures. Ordinary scans retain both diagnostics without changing the scan's status or stopping later tasks.
  • Save successful recovery receipts before removing their checkouts. Report recovery cleanup errors through progress rather than adding an optional second ledger write.
  • Record which completed checkout may need cleanup, and retry only that checkout when reusing a completed scan. Preserve legacy/unmarked checkouts and older interrupted attempts.
  • Validate recovery cleanup paths and cover cleanup failures, retries, interrupted cleanup, receipt reuse, invalid attempts, and linked recovery parents.
  • Rebase onto current main while retaining the original contribution.

Testing

  • Reproduced the original issue with a real scan of a synthetic repository: the scan completed, but a genuine filesystem permission error during cleanup escaped and left no receipt.
  • Repeated the real scan with the fix: completion and the cleanup diagnostic were saved. After restoring permissions, reuse removed the leftover checkout without another scan.
  • Verified marked and legacy receipt reuse against genuine sealed scan output in fresh processes, and checked preservation of unrelated directories.
  • bun test --timeout 30000 tests-ts/multiscan.test.ts: 106 passed, 1 platform-specific skip. The new partial-write regression fails before the fix and passes afterward.
  • pnpm run types, pnpm run build:ci, pnpm run format, and git diff --check: passed.

Risk and rollout

No CLI flags, defaults, or configuration changes. Cleanup intent is additive internal receipt metadata; existing receipts remain reusable, but unmarked checkouts are not removed automatically. Failed recovery attempts and completed scan artifacts remain intact. Recovery cleanup errors appear in progress output; the already-durable completion receipt is not rewritten.

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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Note

You have reached your Codex usage limits for security reviews. Please try again later.

@github-actions github-actions Bot added the bug Something isn't working label Oct 8, 2026
@mldangelo-oai mldangelo-oai changed the title fix(multiscan): preserve outcomes when checkout cleanup fails fix(bulk-scan): preserve outcomes when checkout cleanup fails Oct 8, 2026
@mldangelo-oai mldangelo-oai added area:bulk-scan Multi-repository discovery, campaigns, receipts, and campaign resume. and removed area:bulk-scan Multi-repository discovery, campaigns, receipts, and campaign resume. labels Oct 8, 2026
@mldangelo-oai
mldangelo-oai force-pushed the BharathVemula/fix-211-preserve-multiscan-receipts branch from 8451fd5 to f15f21f Compare October 16, 2026 18:07

@mldangelo-oai mldangelo-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this—checkout cleanup shouldn't erase a scan result. I reproduced the missing receipt with a real scan and verified that the fix preserves outcomes and reuses completed work without rescanning. The recovery edge cases now have regression coverage, and both the seeded/random SDK suites and cross-platform CI are green. Looks good to merge.

@mldangelo-oai
mldangelo-oai merged commit cdce5d6 into openai:main Oct 16, 2026
59 checks passed
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.

multiscan cleanup failure masks the scan outcome and skips the repository receipt

2 participants