Skip to content

fix: complete Deep Scans from saved child results - #1160

Merged
mldangelo-oai merged 1 commit into
mdangelo/codex/pr939-split-36-resume-settingsfrom
mdangelo/codex/pr939-split-37-committed-results
Oct 4, 2026
Merged

mldangelo-oai merged 1 commit into
mdangelo/codex/pr939-split-36-resume-settingsfrom
mdangelo/codex/pr939-split-37-committed-results

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Part 37 of 46. Previous: #1159 · Next: #1161 · Stack index

Summary

Complete Deep Scans from saved progress and recover unmerged child results when a parent reaches its run limit or stops finding new issues. Preserve accepted parent findings alongside recovered child evidence.

Changes

  • Check composition readiness and import pending drafts during completion. Reuse the indexed recovery merge so child-only results cannot replace accepted parent findings.
  • Keep legacy runner dispatch for the upcoming plugin switch; receipt corrections use the accounting behavior introduced earlier in the stack.
  • Use repository-relative Git paths for saved source excerpts and avoid treating a dirty working-tree scan as a committed source snapshot.

Testing

Local checks for the implementation and applicable stack boundary:

  • Current/pending draft tests at the local part 37 boundary: 54 passed, including accepted parent findings with an unmerged child.

Ruff, the SDK build and portable source checks passed after removing redundant comments from this intermediate boundary; the parsed Python code is unchanged.

Checks against the complete stack passed: SDK and MCP typechecks, formatting, Ruff, the SDK build, portable plugin compatibility and its tests, focused recovery/accounting tests, and local-artifact package smoke using exact cached dependencies. The package check was not a clean registry install. See this PR’s Checks tab for CI results for its current commit.

Risk and rollout

This changes completion and receipt bookkeeping while both runner paths remain present. Older unfinished native scans continue through the legacy dispatch until the plugin switch.

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.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@mldangelo-oai
mldangelo-oai requested a balanced review from Copilot October 1, 2026 06:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-04T17:34:02.268304Z 79b706e Draft marked ready
🔒 Security Review ⚠️ Failed 2026-10-04T17:34:07.334860Z 79b706e Draft marked ready
ℹ️ 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.

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The recovery path can silently discard valid findings present only in the committed parent draft.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Finalizes Deep Scan child results and reconciles session usage while retaining legacy compatibility.

Changes:

  • Recovers unmerged child findings and coverage during completion.
  • Reconciles measured usage with SDK cost receipts.
  • Updates source-excerpt safety and completion/recovery tests.
File Description
plugins/​codex-security/​tests/​workbench_test_support.py Adds private-directory test setup.
plugins/​codex-security/​tests/​test_workbench_scan_usage.py Expands child-session usage coverage.
plugins/​codex-security/​tests/​test_workbench_pending_drafts.py Tests interrupted draft recovery.
plugins/​codex-security/​tests/​test_workbench_db.py Tests working-tree excerpt behavior.
plugins/​codex-security/​tests/​test_workbench_current_draft.py Migrates completion tests to native checkpoints.
plugins/​codex-security/​tests/​test_workbench_completion_binding.py Updates Deep Scan completion fixtures.
plugins/​codex-security/​tests/​test_windows_scan_local_files.py Consolidates Windows missing-file tests.
plugins/​codex-security/​scripts/​workbench_source_excerpt.py Avoids excerpts that differ from scanned content.
plugins/​codex-security/​scripts/​workbench_scan_usage.py Preserves usage while merging costs.
plugins/​codex-security/​scripts/​workbench_publication.py Ensures local script imports resolve.
plugins/​codex-security/​scripts/​workbench_db.py Finalizes composed results and usage.
plugins/​codex-security/​scripts/​finalize_scan_contract.py Delegates Windows missing-file translation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

)
coverage["completeness"] = "partial"
saved_results.union_coverage(coverage, recovered["coverage"])
documents = current_manifest, {"findings": recovered["findings"]}, coverage

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reproduced at this PR's head 250c92c and at stack tip 835f0d1. A capped parent has a committed finding P, a distinct completed-but-unmerged child finding C, and no pending checkpoint markers. Calling prepare-scan-completion seals findings containing only C. P remains in the accepted draft history but disappears from the published result. The parent findings need to participate in the recovery union, just as parent coverage already does.

@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: f8c60e36e9

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

)
coverage["completeness"] = "partial"
saved_results.union_coverage(coverage, recovered["coverage"])
documents = current_manifest, {"findings": recovered["findings"]}, coverage

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 Preserve parent findings when recovering child results

When a capped or saturated checkpoint has an unmerged pass, recovered contains only the checkpoint aggregate and recoverable child findings, but this assignment replaces every finding from the committed or canonical parent draft. Unless a pending checkpoint marker happens to exist, the following conditional skips merge_saved_results, so parent-only findings are permanently omitted from the sealed findings and report; merge the recovered findings with the parent findings instead of overwriting them.

AGENTS.md reference: AGENTS.md:L42-L42

Useful? React with 👍 / 👎.

@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-37-committed-results branch from f8c60e3 to 5c19ce6 Compare October 1, 2026 07:25
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-36-resume-settings branch 2 times, most recently from 0555db1 to c491057 Compare October 1, 2026 07:39
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-37-committed-results branch from 5c19ce6 to 60bd798 Compare October 1, 2026 07:39
@mldangelo-oai mldangelo-oai changed the title fix: finalize child scan results and reconcile usage fix: complete Deep Scans from saved child results Oct 1, 2026
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-36-resume-settings branch from c491057 to ec4ca94 Compare October 1, 2026 17:10
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-37-committed-results branch from 60bd798 to 250c92c Compare October 1, 2026 17:10
@faizan-oai faizan-oai mentioned this pull request Oct 1, 2026
3 tasks done

@faizan-oai faizan-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Holding approval: capped/saturated child recovery drops parent-only findings. Reproduced both at this PR's own head (250c92c) and at the current tip: commit a parent finding, retain a distinct unmerged child finding, ensure no pending markers remain, then prepare completion. The sealed output contains only the child finding; the accepted parent finding disappears. Details added to the existing thread.

@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-36-resume-settings branch from ec4ca94 to d91bbf0 Compare October 1, 2026 18:37
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-37-committed-results branch 2 times, most recently from 5f2b0d2 to 8551f5b Compare October 1, 2026 20:29
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-36-resume-settings branch from d91bbf0 to 4258cde Compare October 1, 2026 20:29

@alandelong-oai alandelong-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.

Reviewed this completion change with three independent passes and root verification. The P1 in the existing parent-finding comments remains reproducible: completing a capped parent with an accepted parent finding and a distinct unmerged child finding seals a report containing only the child finding. I reproduced this with both committed scan drafts and ordinary exported drafts. Parent findings must participate in the recovery merge before this is safe to approve.

Validation: 350 Python tests passed with four native Windows skips across seven touched test files; 37 SDK tests passed across the Deep workbench and report-limit suites. The bundled plugin build passed. No repository files were changed.

@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-36-resume-settings branch from 4258cde to f2a9a7a Compare October 1, 2026 23:44
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-37-committed-results branch from 8551f5b to 5f0dc79 Compare October 1, 2026 23:44

@alandelong-oai alandelong-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.

Three independent restack passes and root verification are complete. The prior parent-finding loss is fixed: both the committed-parent and file-authored-parent probes now preserve distinct Parent and Child findings. The Windows missing-file candidate was excluded because the native handle wrapper already translates missing-path errors, as the touched boundary tests require.

Approval remains withheld for the source-excerpt fixture failures caused by this change. The reader now indexes diff_target_kind/diff_target_value, but three parameterized scan dictionaries in test_workbench_db.py omit those fields, producing 19 failures. Update the fixtures to represent the stored scan shape. These failures reproduce in current tip CI and the local touched-test run; they do not show that real migrated scan records lack those columns.

CI evidence: https://github.com/openai/codex-security/actions/runs/36942572466/job/110637912722

@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-37-committed-results branch from 5f0dc79 to 2093a5c Compare October 2, 2026 00:36
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-36-resume-settings branch from f2a9a7a to 12cb54c Compare October 2, 2026 00:36

@alandelong-oai alandelong-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.

Re-reviewed the real PR diff at 2093a5c801323ad106c68c36b3a4fa9cd3965092. Three independent high-reasoning passes covered the complete changed patch and tests; root source checks and focused reproductions informed this decision.

The parent-result fix remains intact. The source-excerpt fixtures now supply diff_target_kind; all 20 exact-head source-excerpt tests pass. A new own-head CI failure remains: workbench_db.py grows from 149,762 to 150,193 bytes, exceeding the existing 150,000-byte source limit. The plugin source contracts job fails on this exact head after Ruff passes. Please move enough code out or simplify it at this boundary; later shrinking at the stack tip does not clear the check here.

Source-contract failure: https://github.com/openai/codex-security/actions/runs/36947000897/job/110651402732

Validation across touched paths at branch tip 06e75cfe: 1,356 SDK tests, 867 Python tests plus 100 subtests, and 108 MCP tests passed; builds, types, portable checks and installed-package checks passed. These are integration checks at the branch tip, not a claim that every intermediate PR or its CI is clean. Current CI still contains failed, canceled, or pending checks; this review does not establish merge readiness.

@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-37-committed-results branch from 2093a5c to 6ba3a24 Compare October 2, 2026 01:37
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-36-resume-settings branch 2 times, most recently from 5e37560 to ccb3db5 Compare October 2, 2026 01:56
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-37-committed-results branch from 6ba3a24 to 34d985a Compare October 2, 2026 01:56

@alandelong-oai alandelong-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.

Retained the three independent passes for the identical patch and reconciled inherited touched-file changes at 34d985a28480.

The runtime and source-excerpt fixes remain verified. The own-head workbench_db.py is now 149,954 bytes, below the required 150,000-byte limit. The tentative Windows missing-file candidate was excluded because the real backend translates it correctly; the removed mock bypassed that behavior. No serious introduced finding remains.

Current tip 355ec321 passed 75 report-projection tests, portable source checks, SDK build:ci and plugin build. The immediately preceding tip fec36f1d passed 1,360 SDK tests, 873 Python tests plus 100 subtests, 109 MCP tests, builds/types and the clean 600-entry installed-package check. Only report_projection.py and its test changed between those tips; SDK/MCP runtime files are byte-identical. Both descend from main 008a8b4d. These are integration checks, separate from own-head probes. No native Windows local run.

No serious outstanding finding introduced by this PR. Code review approval does not establish CI or merge readiness.

@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-37-committed-results branch from 34d985a to cd4352e Compare October 2, 2026 02:47

@alandelong-oai alandelong-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.

Retained the three independent passes for the verified identical patch and reconciled inherited touched-file changes at cd4352e38f47.

No actionable introduced finding survives the independent reviews and root reconciliation of this exact patch and inherited changes in touched files.

Integrated tip 6ef8cbb8, based on 008a8b4d, passed 1,388 SDK tests, 879 Python tests plus 100 subtests, 109 MCP tests, portable checks, builds and the clean 600-entry installed-package check. These are branch-tip integration checks, separate from own-head probes; no local Windows execution was performed.

No serious outstanding finding introduced by this PR. Code approval is separate from CI and merge readiness.

@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-37-committed-results branch from cd4352e to 79b706e Compare October 2, 2026 03:52
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-36-resume-settings branch from 252f40a to 3d6f054 Compare October 2, 2026 03:52

@alandelong-oai alandelong-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.

Completed three independent full-diff passes and root verification at 79b706ef6590.

No actionable introduced finding survives the three independent passes and root verification. workbench_db.py at this own head is 149,995 bytes, below the 150,000-byte source limit. Runtime preservation and current tip checks pass.

Branch tip 3e0083d9, based on 008a8b4d, passed 1,392 SDK tests, 881 Python tests plus 100 subtests, 109 MCP tests, builds, portable source checks and the 600-entry installed-package check. These are tip checks, separate from own-head probes. No local Windows run was performed. The tip excludes the dependency update merged separately in #1184; combined validation remains outstanding.

No serious outstanding finding introduced by this PR. Code approval is separate from CI and merge readiness.

@mldangelo-oai
mldangelo-oai marked this pull request as ready for review October 4, 2026 17:33
@mldangelo-oai
mldangelo-oai merged commit 1e46ef9 into mdangelo/codex/pr939-split-36-resume-settings Oct 4, 2026
50 of 64 checks passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/pr939-split-37-committed-results branch October 4, 2026 17:33
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.

5 participants