Skip to content

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

Open
mldangelo-oai wants to merge 7 commits into
mdangelo/codex/optional-diff-scan-artifactsfrom
mdangelo/codex/fail-stale-scan-targets
Open

fix: fail stale-target scans closed in CI#273
mldangelo-oai wants to merge 7 commits into
mdangelo/codex/optional-diff-scan-artifactsfrom
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 on lines +1415 to 1416
target_warnings: list[str] = []
warning = scan_target_warning(scan)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Carry prepared target warnings into final classification

When the target differs during prepare-scan-completion but is restored before the subsequent complete-scan call, the first call persists the warning in completion_warnings_json, while this list is recreated empty and populated only from the target's current state. The SDK therefore emits the persisted warning without { kind: "target_changed" }, causing the CLI to return success even though the scan observed target drift and may contain stale results. Persist the target-warning classification across preparation or propagate the prepare result into final completion.

Useful? React with 👍 / 👎.

@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

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ 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

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the exact updated head 4c364d425b477db7be24160c70126d081fc501c3. This additive update ships the exact generated MCP runtime from the same original upstream commit and preserves the atomic base-to-head diff. Prepared target-drift warnings now retain their fail-closed classification across final completion, with a regression test.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 4c364d425b

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

Copy link
Copy Markdown

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

Reviewed commit: 4c364d425b

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 91afd9620e89192c270b2af5400eca3e64b27d58. Inherits the regression-tested prompt/headless rejoin fix and safe URL delegation; the generated MCP runtime matches this original upstream stage and retains the bounded headless user-context argument.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 91afd9620e

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

Copy link
Copy Markdown

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

Reviewed commit: 91afd9620e

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 69e04094918157b68a6f177fed0d0ada929faea3. 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 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 on lines 1458 to +1463
warning = scan_target_warning(scan)
if warning is not None and warning not in warnings:
warnings.append(warning)
if warning is not None:
if warning not in target_warnings:
target_warnings.append(warning)
if warning not in warnings:
warnings.append(warning)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Recheck the target after finalization writes

If the checkout changes after this second check but before completion is committed, the drift is never classified: _write_prepared_scan_finalization, usage collection, artifact hashing, finding indexing, and the database transaction all still run afterward. A concurrent checkout or working-tree update during that window therefore produces a completed scan with no targetWarnings, allowing the CLI to exit successfully even though its results no longer represent the current target. Perform the final target check after the expensive publication work and immediately before committing completion.

Useful? React with 👍 / 👎.

@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".

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant