Skip to content

feat: match repeated findings across scans - #575

Open
mldangelo-oai wants to merge 6 commits into
mdangelo/codex/scan-comparison-storagefrom
mdangelo/codex/match-repeated-findings
Open

feat: match repeated findings across scans#575
mldangelo-oai wants to merge 6 commits into
mdangelo/codex/scan-comparison-storagefrom
mdangelo/codex/match-repeated-findings

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replace the all-findings-at-once matcher behind the existing scans match and scans compare commands. Complete finding reports can exceed Codex's per-message character limit. The new matcher starts with compact records for known issues and requests full evidence when needed.

This is the matcher and SDK part of #567, stacked on #574. It uses the existing Codex authentication and adds no public CLI commands, flags, accepted values, or defaults.

Changes

  • Group stable finding IDs and previously confirmed duplicates in code. Send one compact catalogue record per known issue, preserving differences between earlier descriptions. Expand returned matches back to the original occurrence IDs.
  • Page catalogue records and requested evidence within the upstream message limit. Read all omitted evidence before accepting any final decision. Reject unknown IDs, conflicting decisions, and requests that make no progress.
  • Keep uncertain matches and related-but-independent findings separate. Process history chronologically, reuse confirmed work, and preserve saved comparisons on cancellation.
  • Compare every finding in each selected historical scan before saving an automatic scan-pair result. The catalogue now owns deduplication instead of a second latest-occurrence map, so uncertainty is not lost for omitted occurrences.
  • Make single-pair --force ignore earlier semantic groups while retaining stable identities. Preserve main's failed-history output behavior, including --full-output, alongside the matching cancellation handler.
  • Export matchScanFindings and its public input, result, progress, and cancellation types. Cost-limited scans retain the existing allowance of at most one automatic matching call; additional work is deferred to scans match --all.

Testing

At 1b1e546213d1a041e3daf03985f24d24b8ade8a8, with main at 7828456bcb3ef13ed26f36143532cfdab54d3483:

  • Focused catalogue, comparison, CLI, sealed-history end-to-end, storage, and renderer tests: 259 passed, 3 platform skips.
  • Full SDK suite with seeds 12345 and 2895725777: 1,555 passed, 29 platform skips on each completed run.
  • The new forced-recompute, complete-scan-input, and full-output regressions failed before their fixes and pass afterward.
  • Type checks, formatting, build, package inspection, installed SDK/CLI/type smoke tests, and git diff --check passed. The package check used a private npm cache after the default cache was not writable.
  • Built scans match and scans compare help and command schemas are byte-for-byte unchanged from the synchronized storage branch.
  • The built CLI returns exit 2 and no success envelope for failed match and compare commands against a disposable history.
  • A live ChatGPT-auth check using the configured scan model reduced 1,807,200 characters of synthetic reports to one 561-character catalogue record. One model call matched all 12 original occurrences and kept an independent finding separate. This is a smoke test, not an accuracy evaluation.
  • Exact-head GitHub CI passed after a failed-job-only rerun of two Windows shards. Their initial failures occurred while starting unchanged Python probes. Codex review found no major issues at this head.

The first full local SDK run with seed 12345 was stopped after 30-second timeouts in deep-scan/recovery tests and the sealed-history test. All five affected tests then passed in isolation with the normal timeout; the four unchanged tests also passed on the synchronized #574 baseline. The complete retry with the same seed passed.

To repeat the focused QA from sdk/typescript:

pnpm install --frozen-lockfile
bun test --timeout 30000 tests-ts/finding-catalogue.test.ts tests-ts/scan-comparison.test.ts tests-ts/cli-workbench.test.ts tests-ts/scan-matching-e2e.test.ts tests-ts/workbench-scan-history.test.ts tests-ts/scan-history-renderer.test.ts tests-ts/cli.test.ts

The repeatable tests use synthetic findings and temporary sealed scans. They cover large and Unicode evidence, all final matching outcomes, saved-link reuse, forced matching, cancellation, invalid results, and unchanged scan artifacts.

Risk and rollout

#573 has merged. Merge #574 first. After its squash merge, merge the resulting main into this branch, change this PR's base to main, and rerun the exact-head checks and review. The branch updates are additive.

A wrong confirmed match can affect later comparisons. Existing caches are not rewritten on upgrade; use scans match --all --force to revisit an earlier partial or incorrect result. Review consequential model judgments. Paging avoids the per-message limit but does not provide unlimited context or establish matching accuracy. Full evidence remains in host memory, and persisted scan-pair results still grow quadratically with the number of scans.

Automatic matching may need more context now that each saved pair is complete. With --max-cost or maxCostUsd, that work is deferred instead of saving a partial comparison or making additional automatic calls. The scan total still excludes the existing one-call matching allowance.

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

Please review the current head, 5875cb27239e4a310be1bc3cd4c58b67275b5319, against #574. This is the matcher and existing CLI/SDK integration split from #567. The storage contract is reviewed separately in #574.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 5875cb2723

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

Copy link
Copy Markdown
Collaborator Author

@codex review

The description now includes the final QA results and merge order. Please review the current head, 5875cb27239e4a310be1bc3cd4c58b67275b5319. The code has not changed since the earlier review.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 5875cb2723

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 20, 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 Completed 2026-08-21T00:04:47.441568Z 1b1e546 Manual request
ℹ️ 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.

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

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

Comment thread sdk/typescript/src/scan-comparison.ts

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, c3d4a5661b31870dd2960432f3390f491af5d9ee. The PR description includes the latest cleanup and QA results.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: c3d4a5661b

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

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, c8b75fc305061c6fa0a39e842f111a0d9c9707e4. This also fixes the omitted-evidence case raised in the previous review and adds tests for all four final outcomes.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: c8b75fc305

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

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, 1b1e546213d1a041e3daf03985f24d24b8ade8a8, against #574. This additive update merges current main, preserves failed-history output semantics, recomputes forced single-pair matches without old semantic groups, and compares complete selected scans before caching automatic results. The PR description includes the regressions, package checks, synthetic live QA, and the remaining full-suite checks.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 1b1e546213

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

Copy link
Copy Markdown
Collaborator Author

@codex review

The description now includes the completed full-suite runs, installed-package and synthetic live QA, and the green exact-head CI result. Please review the current head, 1b1e546213d1a041e3daf03985f24d24b8ade8a8, against #574. The code has not changed since the previous review.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 1b1e546213

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

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.

1 participant