Skip to content

fix: fail stale-target scans closed in CI - #273

Merged
mldangelo-oai merged 59 commits into
mainfrom
mdangelo/codex/fail-stale-scan-targets
Aug 4, 2026
Merged

fix: fail stale-target scans closed in CI#273
mldangelo-oai merged 59 commits into
mainfrom
mdangelo/codex/fail-stale-scan-targets

Conversation

@mldangelo-oai

Copy link
Copy Markdown
Collaborator

Summary

  • Classify genuine scan-target drift separately from unrelated recovery warnings and surface typed target-change details to SDK observers.
  • Return exit code 2 for stale-target scans and include sanitized target warnings in machine-readable CLI output.
  • Existing fix(scan): surface run warnings in structured scan results #220 exposes warnings but intentionally keeps stale-target scans successful; this change closes that separate CI safety gap.

Stack

  • Intentionally stacked on mdangelo/codex/optional-diff-scan-artifacts so this review contains only its atomic upstream change.
  • Prerequisite for the pending 0.1.6 release in release: bump Codex Security to 0.1.6 #244; package version is unchanged.

Verification

  • Parsed every bundled workbench Python module.
  • Verified all 105 declared plugin payload files exist.
  • Initialized a fresh private workbench SQLite database successfully.
  • Passed Prettier for all 6 changed formatted files.
  • Passed focused SDK/CLI stale-target, warning, recovery, and target tests.
  • Passed the complete TypeScript typecheck.
  • The complete reconstructed sync passed 775 tests (5 platform/integration skips) and the installed-package smoke test.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the exact current head 938578c9bc258785490f276d9755f9d6f9fe87a8 and only this atomic PR's declared base-to-head diff.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 938578c9bc

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/_bundled_plugin/scripts/workbench_db.py
@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 938578c9bc

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the exact updated head 6778d7989f0a426ad7963c6dc5c808fe95ed6c9e. The additive follow-up preserves stale-target fail-closed behavior while avoiding a merge conflict with the independently open live scan progress PR #261.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 6778d7989f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 69e0409491

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/_bundled_plugin/scripts/workbench_db.py
@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 69e0409491

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the exact updated head d9b1104ae6bb4c414a902c136adcd733dcd0ff95. Inherits regression-tested resumable finalization, accurate cached-token totals, distinct canonical finding identities, complete ignored-file coverage, safe context delegation, and preserved prompt/headless scan identity; the generated runtime remains matched to this original atomic upstream stage.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: d9b1104ae6

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

kmbroai
kmbroai previously approved these changes Aug 4, 2026
ianw-oai
ianw-oai previously approved these changes Aug 4, 2026
Base automatically changed from mdangelo/codex/optional-diff-scan-artifacts to main August 4, 2026 20:12
@mldangelo-oai
mldangelo-oai dismissed stale reviews from ianw-oai and kmbroai August 4, 2026 20:12

The base branch was changed.

@github-actions github-actions Bot added the bug Something isn't working label Aug 4, 2026
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 0db2ba3612

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mldangelo-oai
mldangelo-oai merged commit 343be87 into main Aug 4, 2026
15 checks passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/fail-stale-scan-targets branch August 4, 2026 20:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: 0db2ba3612

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sdk/typescript/src/api.ts
Comment on lines +926 to +928
targetWarnings.has(warning)
? { kind: "target_changed" }
: undefined,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Security: Fail bulk scans on target drift

The SDK now marks target drift only via the optional onWarning callback, then still returns a successful ScanResult. The normal scan command converts that callback into exit 2, but bulk-scan calls security.run() without any warning observer and only fails on incomplete coverage (sdk/typescript/src/multiscan.ts:183-194). A stale-target scan with complete coverage is therefore recorded as completed in bulk/CI workflows. Surface target drift on ScanResult or throw a typed error so bulk-scan can fail/retry it.

Useful? React with 👍 / 👎.

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.

3 participants