Repository navigation
fix: complete Deep Scans from saved child results - #1160
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
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
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
💡 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 |
There was a problem hiding this comment.
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 👍 / 👎.
f8c60e3 to
5c19ce6
Compare
0555db1 to
c491057
Compare
5c19ce6 to
60bd798
Compare
c491057 to
ec4ca94
Compare
60bd798 to
250c92c
Compare
faizan-oai
left a comment
There was a problem hiding this comment.
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.
ec4ca94 to
d91bbf0
Compare
5f2b0d2 to
8551f5b
Compare
d91bbf0 to
4258cde
Compare
alandelong-oai
left a comment
There was a problem hiding this comment.
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.
4258cde to
f2a9a7a
Compare
8551f5b to
5f0dc79
Compare
alandelong-oai
left a comment
There was a problem hiding this comment.
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.
5f0dc79 to
2093a5c
Compare
f2a9a7a to
12cb54c
Compare
alandelong-oai
left a comment
There was a problem hiding this comment.
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.
2093a5c to
6ba3a24
Compare
5e37560 to
ccb3db5
Compare
6ba3a24 to
34d985a
Compare
alandelong-oai
left a comment
There was a problem hiding this comment.
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.
34d985a to
cd4352e
Compare
alandelong-oai
left a comment
There was a problem hiding this comment.
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.
cd4352e to
79b706e
Compare
252f40a to
3d6f054
Compare
alandelong-oai
left a comment
There was a problem hiding this comment.
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.
1e46ef9
into
mdangelo/codex/pr939-split-36-resume-settings

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
Testing
Local checks for the implementation and applicable stack boundary:
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