Skip to content

refactor: remove retired Deep Scan recovery routes - #1165

Merged
mldangelo-oai merged 2 commits into
mdangelo/codex/pr939-split-41-unused-result-helpersfrom
mdangelo/codex/pr939-split-42-retired-recovery
Oct 4, 2026
Merged

mldangelo-oai merged 2 commits into
mdangelo/codex/pr939-split-41-unused-result-helpersfrom
mdangelo/codex/pr939-split-42-retired-recovery

Conversation

@mldangelo-oai

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

Copy link
Copy Markdown
Collaborator

Part 42 of 46. Previous: #1164 · Next: #1166 · Stack index

Summary

Remove retired Deep Scan recovery and progress dispatch after the plugin entrypoint moves to the SDK, while retaining historical session accounting.

Changes

  • Delete unused checkpoint recovery and coordinator lookup routes and move the surviving draft/recovery helpers together.
  • Retain saved review counts and legacy worker-session associations when collecting historical scan usage, alongside the native child-scan associations.

Testing

Local checks for the implementation:

  • The historical worker-session accounting regression passed locally, retaining both parent and worker usage.

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

The preceding plugin switch already rejects unsupported unfinished scans. This removes unused legacy execution routes while preserving historical reports, review counts and measured parent/worker usage.

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:32:41.063231Z 63e4fb5 Draft marked ready
🔒 Security Review ⚠️ Failed 2026-10-04T17:32:46.627296Z 63e4fb5 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

🟢 Approval recommended

The removed routes have no remaining references, and retained behavior and compatibility handling remain covered.

Review effort: Balanced
Findings: None

What changed in this PR

Removes retired Deep Scan recovery and accounting paths after migration to the SDK.

Changes:

  • Deletes legacy recovery, publication, and worker-accounting code.
  • Preserves historical review counts and current recovery helpers.
  • Updates affected fixtures and context structures.
File Description
plugins/​codex-security/​tests/​workbench_test_support.py Removes a retired coordinator helper.
plugins/​codex-security/​tests/​test_workbench_scan_composition.py Updates the composition fixture.
plugins/​codex-security/​scripts/​workbench_scan_usage.py Removes legacy worker-thread accounting.
plugins/​codex-security/​scripts/​workbench_scan_history.py Deletes obsolete recovery routes.
plugins/​codex-security/​scripts/​workbench_saved_results.py Retains current helpers while removing legacy recovery logic.
plugins/​codex-security/​scripts/​workbench_db.py Removes obsolete saved-results dependencies.
plugins/​codex-security/​scripts/​workbench_composition.py Drops legacy run state while preserving review counts.
plugins/​codex-security/​scripts/​project_scan_artifacts.py Removes an unused coverage merge helper.

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 6c14f0c731

ℹ️ 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 force-pushed the mdangelo/codex/pr939-split-41-unused-result-helpers branch from e3495da to 768c85c Compare October 1, 2026 07:25
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-42-retired-recovery branch from 6c14f0c to 2060525 Compare October 1, 2026 07:25
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-41-unused-result-helpers branch from 768c85c to 57ce934 Compare October 1, 2026 07:39
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-42-retired-recovery branch from 2060525 to 5fdd7ca Compare October 1, 2026 07:39
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-41-unused-result-helpers branch from 57ce934 to ef0ec7d Compare October 1, 2026 17:10
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-42-retired-recovery branch from 5fdd7ca to 1566bb0 Compare October 1, 2026 17:10

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

Reviewed retirement of the old recovery routes at 1566bb0 against the active composition/recovery paths. The integrated recovery, migration, and compact-server checks pass. No new issue found in this cleanup increment; upstream findings remain tracked separately.

@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-41-unused-result-helpers branch from ef0ec7d to ccb5ac7 Compare October 1, 2026 18:37
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-42-retired-recovery branch 2 times, most recently from 611b0c6 to 98092da Compare October 1, 2026 20:29
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-41-unused-result-helpers branch from ccb5ac7 to 413d90e 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.

All three independent reviewers identified the same historical-accounting regression. Root verification reproduced it using the actual base/head composition loader, usage collector, SQLite session discovery, and rollout parser: the same scan changes from 110 tokens across two sessions to 10 tokens across one, and both receipts are labeled complete. Historical sealed results and interrupted sealed completion remain supported, so removing old execution machinery must not erase their worker associations.

All 79 composition tests passed; the plugin build and required Ruff check passed. AST comparison confirms that retained Python functions otherwise keep their behavior apart from the composition loader and thread selection. No repository files were changed.

Comment on lines -214 to -216
SELECT DISTINCT sdk_thread_id
FROM deep_scan_workers
WHERE scan_id = ? AND sdk_thread_id IS NOT NULL

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.

[P2] Retain historical worker sessions when removing the old runner

Older Deep Scans recorded their independent SDK session IDs only in deep_scan_workers, not scan_execution_threads or child scan rows. Removing this lookup drops those sessions from both usage collection and saved execution-thread metadata. Using the actual revision-specific composition and usage modules with an owner session of 10 tokens and a legacy worker of 100, the base reports 110 tokens/two sessions; this head reports 10 tokens/one session with coverage still complete. Preserve or migrate these associations for supported historical results and interrupted sealed completion.

@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-42-retired-recovery branch from 98092da to 86aa193 Compare October 1, 2026 23:44
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-41-unused-result-helpers branch from 413d90e to 42b4e95 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 re-review passes and root reconciliation are complete for this restacked head.

The real composition/accounting probe retains 110 input tokens across both historical worker threads at the restacked base, this head and the integrated tip.

Approval is for this change. Integrated-tip validation passed 1,357 SDK tests (31 skipped), 105 MCP tests (2 skipped), portable checks, types/builds and installed-package smoke. Other stack findings and known CI fixture failures still prevent the stack from being mergeable.

@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-42-retired-recovery branch from 86aa193 to 098811d Compare October 2, 2026 00:36
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-41-unused-result-helpers branch from 42b4e95 to 10ce572 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 098811d4e36cf3297e161943d3e03506c2c90cf3. The patch is unchanged from the prior three-pass review. I reconciled the inherited changes in touched files and retained the prior verified findings and tests.

No serious outstanding finding identified in this patch; prior conclusions remain consistent with the unchanged change or the current re-review.

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. Latest workflow runs for this unchanged head were verified successful at 2026-10-02 01:26 UTC. Earlier failed or canceled job records are superseded; this CI status correction does not alter the review decision.

@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-41-unused-result-helpers branch from 10ce572 to 4a6f0eb Compare October 2, 2026 01:37
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-42-retired-recovery branch from 098811d to 0ca998d Compare October 2, 2026 01:37
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-41-unused-result-helpers branch from 4a6f0eb to f30ab3b Compare October 2, 2026 01:56
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-42-retired-recovery branch from 0ca998d to 8818d1e 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 8818d1ea40b2.

No actionable introduced finding survives the independent reviews and root reconciliation of this exact patch, touched-file changes, and current integration checks.

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-42-retired-recovery branch from 8818d1e to e9666ca 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 e9666ca1ff7a.

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-42-retired-recovery branch from e9666ca to 7bf154b Compare October 2, 2026 03:52
@mldangelo-oai
mldangelo-oai force-pushed the mdangelo/codex/pr939-split-41-unused-result-helpers branch from 23fbdf0 to 0aa1b39 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.

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

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

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.

Consolidate approved Deep Scan changes into the parent topic branch.
@mldangelo-oai
mldangelo-oai marked this pull request as ready for review October 4, 2026 17:32
@mldangelo-oai
mldangelo-oai merged commit a61565a into mdangelo/codex/pr939-split-41-unused-result-helpers Oct 4, 2026
1 check passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/pr939-split-42-retired-recovery branch October 4, 2026 17:32
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