Repository navigation
fix(bulk-scan): repair retained checkouts and regenerate reports - #2332
mldangelo-oai wants to merge 46 commits into
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
…epair-retained-campaign-checkouts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94ba9b688b
ℹ️ 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".
alandelong-oai
left a comment
There was a problem hiding this comment.
The existing interpreter recovery finding still applies. A Node control confirms that an accepted jump/../python path selects tools/python, but recovery normalizes it to python; restoring that wrong path leaves the interpreter unavailable. Preserving the physical spelling restores the correct tracked alias. No duplicate inline comment.
Builds, types, formatting and portable checks pass. Bounded Git/Python controls cover path repair, unrelated edits and sealed-report identity. Campaign tests stop at the environment’s existing output-owner check; full campaign, Windows and native enforcement runs are not claimed.
alandelong-oai
left a comment
There was a problem hiding this comment.
The existing interpreter recovery finding remains; production code is unchanged. The test update correctly compares restored bytes with that same checkout before deletion. No duplicate inline comment.
Formatting passes. Both changed cases stop at the existing output-owner check before repair. Earlier build, type, portable and bounded Git/Python results transfer with verified identical production and dependencies; no fresh full campaign or Windows run is claimed.
…epair-retained-campaign-checkouts
alandelong-oai
left a comment
There was a problem hiding this comment.
The existing interpreter recovery finding remains. The feature and affected production code are unchanged by this base update; no duplicate inline comment.
Prior focused repair checks and their directory-ownership limitation retain their original scope. Reviewed the incoming advisory and mutation-toolchain changes using source-equivalent shared checks. No fresh full campaign or platform run is claimed.
alandelong-oai
left a comment
There was a problem hiding this comment.
The existing interpreter recovery finding remains. Current Node/Python and Git controls reproduce the wrong repair path after the configured interpreter is removed; preserving physical path traversal restores it. No duplicate inline comment.
The parent update preserves the feature edits. Current frozen installs, plugin/SDK builds, types, formatting, and portable checks passed. The direct repair controls passed; prior campaign tests remain limited by the directory-ownership guard. No fresh full campaign or Windows run is claimed.
alandelong-oai
left a comment
There was a problem hiding this comment.
The existing interpreter-recovery issue remains. This update also inherits the parent’s request-digest mismatch: telemetry correlation changes the saved identity, so unchanged scans fail reuse/recovery checks. Both findings are linked without duplicate inline comments.
Current builds and typechecks pass after the assertion fix. Portable and Node/Python/Git repair checks passed on identical production source; paired digest/consumer controls confirm the inherited issue. Full campaign and Windows execution remain unverified.
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for the update. The parent’s request-digest mismatch is repaired. The existing interpreter-recovery issue remains: an accepted symlink/.. path is flattened before recovery, so it restores the wrong path. Current Node/Python/Git controls reproduce this; no duplicate inline comment.
Current builds, typechecks, formatting and portable checks pass. The parent’s eight digest scenarios and 32 workflow-binding comparisons also apply to identical code here. Full campaign and Windows execution remain unverified; maintained campaign tests encountered the directory-ownership guard.
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for the fixture fix. The existing interpreter-recovery issue still needs attention: recovery flattens an accepted symlink/.. path and restores the wrong file. Fresh Node/Python/Git controls reproduce this for absolute and home-relative paths; preserving physical traversal restores the interpreter.
This owner-level merge-safety pass found no additional issue. Three CSV parsing/registration controls, typechecks, formatting and portable checks pass. Prior build evidence applies to identical production and dependency inputs. Full campaign and Windows execution remain unverified; the previously observed directory-ownership limitation was not bypassed.
There was a problem hiding this comment.
🟡 Changes recommended
Recovery can restore replacement content while still reporting the pinned SHA, and switching a retained checkout can fail on or overwrite unrelated local changes.
2 open issues
What changed in this PR
Extends the saved-result validation in #466 with retained-checkout repair and report regeneration, allowing bulk scans to reuse validated results without repeating analysis.
Changes:
- Adds recovery of missing tracked paths from the pinned revision, using local objects before fetching.
- Regenerates unsealed reports with the selected schemas and Python interpreter while preserving sealed reports.
- Expands recovery regression coverage and documents resume behavior.
| File | Description |
|---|---|
| sdk/typescript/tests-ts/runtime.test.ts | Tests Python selection and environment preservation. |
| sdk/typescript/tests-ts/plugin-report-limits.test.ts | Tests report-only generation and sealed-report preservation. |
| sdk/typescript/tests-ts/multiscan.test.ts | Adds checkout, scope, interpreter, and recovery regression cases. |
| sdk/typescript/tests-ts/multiscan-recovery.test.ts | Tests report regeneration, cancellation, and cleanup failures. |
| sdk/typescript/tests-ts/multiscan-checkout.test.ts | Updates expectations for reuse after missing-report recovery. |
| sdk/typescript/tests-ts/multiscan-authority.test.ts | Tests sealed-report reuse and retained Git configuration isolation. |
| sdk/typescript/tests-ts/contract.test.ts | Tests sealed-report identification and file aliases. |
| sdk/typescript/src/runtime.ts | Returns the selected Python command with its environment. |
| sdk/typescript/src/multiscan.ts | Integrates retained-checkout repair and report regeneration. |
| sdk/typescript/src/contract.ts | Adds sealed-report detection. |
| sdk/typescript/docs/cli.md | Documents report replacement and checkout recovery. |
| plugins/codex-security/scripts/report_projection.py | Adds sealed-report alias detection and shared CSV helpers. |
| plugins/codex-security/scripts/finalize_scan_contract.py | Adds report-only generation and permits additional fingerprint fields. |
Review effort: Balanced
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for the update. This owner-level merge-safety pass confirms three existing findings remain: interpreter recovery restores the wrong file after flattening a symlink/parent path; Git replacement objects can supply different bytes under the pinned commit; and switching the retained checkout can conflict with or rewrite unrelated work. Current Node/Python/Git controls reproduce all three. Please address the existing inline threads before merging.
Builds, types, formatting, and portable checks passed. Three focused Bun cases passed; two stopped at local ownership or enclosing-checkout protections. Full campaign and Windows execution remain unverified.
alandelong-oai
left a comment
There was a problem hiding this comment.
The existing interpreter recovery, Git replacement-object, and retained checkout switching findings remain on dc79eea. Six fresh current-source controls reproduce them and verify healthy scoped restoration. This update changes only the inherited Windows campaign fixture; all 13 PR feature files remain byte-identical. Existing inline comments are not duplicated.
Fresh builds, types, formatting and portable checks pass, including nine source-checker and three focused report/Python cases. The two documented local ownership/protected-root failures were excluded rather than repeated. The changed Windows cases remain unverified: exact-head Source CI run 42339895890 was queued at inspection. No full campaign, native-policy or Windows execution is claimed.
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Resolve configured paths with the same platform rules used by scan target normalization. Follow any missing tracked links from the pinned Git tree before applying a parent component or selecting files for restoration. Exercise the public SDK under Node with a surviving, missing, repeated, or obstructed link and verify that unrelated deletions and the completed receipt are preserved.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7407733f87
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0d949dc45
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 223f84063f
ℹ️ 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".
…ations Use median suite durations from the two previous successful macOS reports. The shard containing both campaign suites exceeded its 20-minute job limit after integration with main.


Summary
A verified bulk scan can regenerate a missing or edited report without repeating the scan. Recovery also restores missing tracked paths needed to read the saved scope or invoke the selected report interpreter. This PR is stacked on #466.
Changes
try/finallyso the packaged CLI starts on the supported Node 22.13.0 runtime.~/src. Recover a missing tracked directory link from the pinned revision and preserve unrelated deletions.Testing
Current validation at
5ea35cdc: build, types, formatting, runtime preflight, three host controls and 95 runtime configuration controls passed on Linux. All 99 focused recovery tests passed (611 assertions). Both full SDK orders passed: seed 12345, followed by types and formatting, then the default coverage order. Each full order had 13,502 passes, 176 skips, one todo and zero failures across 346 files. JUnit and LCOV reports were produced; all 1,797 tracked inputs remained unchanged. Three fresh native reviews and independent verification completed cleanly. The new archive passed all five selected Linux installed-package checks.Selected deterministic evaluation checks are qualified: the affected dependency CLI contracts and all 37 Standard time-budget cases passed on Node 24.15.0. Seven unchanged standalone owners retain their original hosted execution on the parent branch, with their consumed source inputs matched to this head.
The preceding draft passed 15 focused real Git controls, including disabled symlinks, explicit command-setting precedence, conditional host credentials and filters, full and shallow retained history, and missing-HEAD success, failure and cancellation. The final run of 99 tests also passed with the final cleanup simplification and adjacent recovery behavior. Credential controls use native credential lookup with synthetic helpers and local Git fetches; they do not claim authenticated HTTP coverage. Earlier exact-production controls demonstrated all three Git regressions, and their failures remain recorded at their execution heads.
The owning set also covers physical paths, literal CSV scopes, selected interpreter aliases, callback accounting, cancellation, raw filenames, staged deletions, filesystem spelling distinctions and legacy receipt reuse. Unicode controls ran on a normalization-sensitive Linux filesystem; no macOS execution is claimed. Real controls distinguish representable original filename spellings from an overlong lowercase probe and avoid a write to a read-only parent when existing directory identities resolve the names. The literal CSV scope and CLI interpreter regressions fail against their preceding production code and pass after correction.
The five ordered portable source checks passed on unchanged consumed inputs. Full Python (4,309 passed, 152 skipped, 434 passing subtests) and the canonical MCP build/test (2,004 passed, 38 skipped) ran at
0a2393dfand apply to identical plugin, generated, tool and dependency inputs. The fresh5ea35cdcarchive passed the canonical installed-package check serially on Node 22.13.0, 24.0.0, 24.22.3, 26.0.0 and 26.13.1, including its nested installed smoke. Its content inspection also passed. The checker removed its temporary installed dependency trees, so those transient trees were not retained. Earlier package successes remain attributed to their original commits. Historical validation below retains its original execution references.At
2ac52f63on Linux, 18 focused SDK tests passed after integrating #466 and reusing the existing parent-path resolver. They covered physical paths, interpreter aliases with trailing spaces, staged deletions, report regeneration, receipt validation and configured exclusions. The plugin build and five portable source checks also passed during integration.Verified that scoped restoration through a private pinned index preserves an unrelated staged deletion and staged edit with a missing HEAD. The tests also cover sparse entries and a non-executable name earlier on the interpreter search path. All nine interpreter alias cases passed at
5c3f1969e.bcd3d029and1e267d64with seed 12345 on Linux (335 passed, five platform skips). An earlier run exposed three obsolete fixtures. The corrected fixtures exercise the protected executable boundary and create the replacement scan in a separate checkout.bcd3d029and1e267d64and installed each in a clean directory. On Node 22.13.0, bothcodex-security --helpand--versionexited 2 withUnexpected identifier 'repair'before the fix. Both exited 0 after the fix. The installed CLI printed its help and version 0.10.0. The repository’s full installed-package check passed on Node 22.13.0 with deep retry enabled, including the bundled plugin, SDK lifecycle and nested worker.1e267d64, traced successful and failed Git restores. Both removed the private Git directory, and the failure still reached the caller. SDK and MCP type checks, formatting and all five portable checks passed.805d0558, 22 focused Linux tests passed with one Windows-only skip. The incomplete-attempt regression recorded two failed retries on the previous head. With the fix, redirecting the recovery root or the task parent preserved the ledger, Git HEAD and local file. SDK and MCP types, formatting, and the five portable checks passed. The npm-installed CLI passed--helpand--versionon Node 22.13.0. The full installed-package check also passed with deep retry enabled.7407733f, all 10 focused physical-path cases passed under Node on Linux. Two publicbulk-scan --recoverruns used a populated local Git repository and a previously sealed Standard scan. With the directory link present or deleted, both restored the selected file, preserved the unrelated deletion, Git index and receipt, and made zero new model requests. Both cases previously failed on805d0558after restoring the unrelated file.288f02be, both inventory cases and all 10 physical-path cases passed on Linux. Both public recovery cases, SDK and MCP type checks, formatting, and the five portable source checks also passed.a0d949dc, recovery checks the directory before writing. All 12 focused cases and three public CLI cases passed on Linux. The obstructed CLI case returnedENOTDIRwith the obstruction intact, both files still deleted, and the receipt unchanged.Risk and rollout
Fetching missing objects requires access to the pinned revision. Regenerating an unsealed report replaces edits to that report. The original sealed data and any already sealed report remain available. This change targets the #466 branch.
Public disclosure review