Repository navigation
feat(findings): retain unresolved candidates in scan results - #1132
mldangelo-oai wants to merge 257 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9df75abdbd
ℹ️ 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: 3d5aef666d
ℹ️ 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".
|
@codex review Please review the current head for correctness, candidate terminology, and concrete ways to simplify the implementation while preserving behavior. In particular, examine candidate identity, checkpoint/recovery behavior, and duplicated candidate-resolution logic. This is a review request only. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Reports omit the saved candidate evidence and locations promised for follow-up.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds tracking and recovery for saved unconfirmed scan candidates across the SDK, CLI, reports, history, and Deep/Diff workflows.
Changes:
- Exposes unconfirmed candidate counts and details through SDK, JSON, CLI, reports, and history.
- Preserves candidate identity and evidence across validation, aggregation, checkpoints, and recovery.
- Adds schemas, documentation, and extensive regression coverage.
| File | Description |
|---|---|
sdk/typescript/tests-ts/result.test.ts |
Tests candidate counting and resolution. |
sdk/typescript/tests-ts/custom-validation.test.ts |
Tests deferred custom-validation candidates. |
sdk/typescript/tests-ts/cli.test.ts |
Updates CLI summary expectations. |
sdk/typescript/tests-ts/cli-workbench.test.ts |
Tests CLI and JSON candidate output. |
sdk/typescript/tests-ts/cli-fixtures.ts |
Adds finding provenance to fixtures. |
sdk/typescript/src/result.ts |
Exposes unresolved candidate data. |
sdk/typescript/src/models.ts |
Adds candidate coverage fields. |
sdk/typescript/src/custom-validation.ts |
Preserves deferred candidate identity and details. |
sdk/typescript/src/cli.ts |
Prints the unconfirmed count. |
sdk/typescript/README.md |
Documents counting semantics. |
plugins/codex-security/tests/test_workbench_standard_deep_results.py |
Expands Deep recovery coverage. |
plugins/codex-security/tests/test_workbench_progress.py |
Tests progress candidate counts. |
plugins/codex-security/tests/test_workbench_owner_metadata.py |
Tests ownership metadata preservation. |
plugins/codex-security/tests/test_workbench_native_index_queries.py |
Tests history artifact reads. |
plugins/codex-security/tests/test_workbench_legacy_candidate_recovery.py |
Tests legacy candidate recovery. |
plugins/codex-security/tests/test_workbench_diff_saved_results.py |
Tests stopped Diff reconciliation. |
plugins/codex-security/tests/test_workbench_db.py |
Updates persisted progress expectations. |
plugins/codex-security/tests/test_report_projection.py |
Tests report candidate projection. |
plugins/codex-security/scripts/workbench_scan_history.py |
Derives history candidate counts. |
plugins/codex-security/scripts/workbench_saved_results.py |
Reconciles candidates during recovery. |
plugins/codex-security/scripts/workbench_db.py |
Adds candidate progress output. |
plugins/codex-security/scripts/report_projection.py |
Adds candidates to reports. |
plugins/codex-security/schemas/tools/scan-draft.schema.json |
Extends draft candidate schema. |
plugins/codex-security/schemas/coverage.schema.json |
Extends canonical coverage schema. |
plugins/codex-security/references/final-report.md |
Documents candidate persistence rules. |
plugins/codex-security/mcp-app/tests/test_deep_scan_coordinator.mjs |
Tests resumed Deep publication. |
plugins/codex-security/mcp-app/tests/test_deep_scan_artifact_validation.mjs |
Tests Deep candidate reconciliation. |
plugins/codex-security/mcp-app/tests/test_compact_artifact_server.mjs |
Tests deferred compact Diff candidates. |
plugins/codex-security/mcp-app/tests/test_artifact_scan_draft.mjs |
Tests interrupted draft recovery. |
plugins/codex-security/mcp-app/tests/test_artifact_diff_candidates.mjs |
Covers Diff candidate lifecycle behavior. |
plugins/codex-security/mcp-app/tests/test_artifact_deep_reducer.mjs |
Tests reducer candidate retention. |
plugins/codex-security/mcp-app/tests/test_artifact_deep_reducer_pages.mjs |
Tests reducer projection boundaries. |
plugins/codex-security/mcp-app/src/deep-scan/coordinator.ts |
Publishes reconciled Deep coverage. |
plugins/codex-security/mcp-app/src/deep-scan/artifact-validation.ts |
Reconciles Deep candidate state. |
plugins/codex-security/mcp-app/src/artifact-scan-draft.ts |
Preserves candidate-linked follow-ups. |
plugins/codex-security/mcp-app/src/artifact-diff-candidates.ts |
Implements Diff candidate retention. |
plugins/codex-security/mcp-app/src/artifact-deep-reducer.ts |
Supplies candidate state to reducers. |
plugins/codex-security/mcp-app/src/artifact-deep-reducer-pages.ts |
Excludes host-owned state from prompts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d5aef666d
ℹ️ 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".
|
@codex review Please review the updated head for correctness, unresolved-candidate terminology, and concrete simplifications. Check candidate selection, saved evidence and locations, generated versus authored decisions, and checkpoint/recovery behavior. This is a fresh review request for the current head. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c75f599a0
ℹ️ 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".
|
@codex review Please review the updated PR at the current head, including the CLI summary change. The existing findings breakdown is preserved, with |
alandelong-oai
left a comment
There was a problem hiding this comment.
Owner-level merge-safety review of 543aa6a: one remaining owner-fallback caller omits another worker's candidate from saved draft/live review state; see inline.
The existing diagnostic relay setup failure also remains. The paired temporary-directory control reproduces it on byte-identical runner inputs; please fall back to inherited stderr when optional setup fails.
Fresh builds, type checks, formatting and required portable checks pass. Current-head controls reproduce the candidate omission. Full end-to-end verification remains limited by trusted-owner fixture admission; no full platform-suite pass is claimed.
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for fixing both retained issues. Blank canonical ownership now falls back to the legacy worker identity, preserving distinct candidates; unavailable optional diagnostic storage no longer prevents a shard from running. No material unresolved findings remain in this owner-level merge-safety review.
Current checks passed: 211 candidate-publication cases, 39 shard-runner cases, and six actual draft-writer controls covering absent, blank and populated canonical owners in Standard and Diff. Builds, types, formatting and all five portable checks (nine checker tests) passed. Earlier 665 Python tests plus 175 subtests, 115 SDK tests and 38 MCP tests retain their preceding execution head over unchanged inputs. No full current repository suite, live-provider or native Windows/macOS pass is claimed.
mldangelo-oai
left a comment
There was a problem hiding this comment.
I’d hold this head for two recovery cases I reproduced.
- After a final draft confirms worker A’s candidate
shared, a later partial draft from worker B can lose its deferred row forshared. Changing only B’s candidate ID preserves the row. This happens in Standard, Diff, and Deep. The terminal-outcome filter inpreserveScanDraftcompares the raw candidate ID, even though IDs are local to each worker. The regression test should retain B’s row on replay and still suppress A’s stale row. - With a legacy budget-deferred row containing
paths: [{}],complete-budget-exhausted-scanraisesTypeErrorand leaves the saved scan running. On main, the same command identifiescoverage.deferred[0].paths[0]and marks the scan failed. Letting the existing validator handle the malformed path preserves that failure state.
Match retained terminal decisions to the worker that produced each candidate. Use the same candidate identity rules in the workbench and SDK, and let budget recovery validate historical path and exclusion metadata.
(cherry picked from commit 5ce7e7c)
|
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". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 281b4bf933
ℹ️ 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".

Summary
An interrupted review can retain a candidate in a checkpoint, but main's sealed result and CLI summary do not tell the reader which candidates still need evidence. Preserve those proof gaps through publication, recovery and reassessment, and expose them separately from confirmed findings.
Changes
Testing
510e56cab, 122 focused MCP tests and 136 sealed-contract SDK tests passed, including recovery, publication and tracking with colliding identifiers. The five portable plugin checks, type checks and plugin build also passed.f47615b1. An isolated regression on a legacy fixture verified two distinct proof gaps, one candidate and one count. Atf0a35457, five focused SDK candidate tests, type checking and changed-source formatting passed again.f0a35457, all 274 tests in the two modules that dynamically import the restored SDK helper passed.618fea6b, all 26 exclusion and receipt regression cases passed. Nine of those cases failed atf0a35457. The three separate tests for a pending candidate surviving another worker’s finding also failed atf0a35457and passed with the fix.envexecutable name so a multicall binary selects the intended utility. The patch comes from test(sdk): preserve the env utility name in inventory fixtures #2678 and keeps both wrapper assertions. On Debian, the inventory module passed 159 tests with 21 platform skips. Ubuntu failureRisk and rollout
The API additions require no new command or flag. Most of the approximately 30,000 added lines are tests and fixtures. The maintenance cost lies in keeping TypeScript, Python and the persisted artifact formats in agreement about identity, ownership, sealed evidence and reopening. Changes to one reader need coverage of existing artifacts and cross-language consumers. The bounded tests above do not establish full Windows or macOS behavior.
Public disclosure review
Reviewed the updated branch, title, text, changes, commit messages and public discussion. Historical discussion contains preexisting task links. Archived raw logs and binary attachments have not been exhaustively reviewed; the full-artifact attestations remain open.