Skip to content

feat: preserve cross-scan finding relationships - #574

Open
mldangelo-oai wants to merge 14 commits into
mainfrom
mdangelo/codex/scan-comparison-storage
Open

feat: preserve cross-scan finding relationships#574
mldangelo-oai wants to merge 14 commits into
mainfrom
mdangelo/codex/scan-comparison-storage

Conversation

@mldangelo-oai

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

Copy link
Copy Markdown
Collaborator

Summary

Preserve confirmed, uncertain, and related finding relationships across scan-history storage, matching, existing interactive history views, and component-scan artifacts. Keep #575 stacked on this independently usable foundation.

Changes

  • Add append-only migration 33 for finding-identity and reverse-comparison indexes while preserving existing migrations and scan history.
  • Validate and persist confirmed matches, uncertainty, and distinct related findings without collapsing independent issues.
  • Pass confirmed historical identities through pair, forced-pair, automatic, and all-scan matching; transitively unite overlapping saved and newly confirmed identities before later all-scan batches.
  • Require every occurrence sharing a stable or transitively confirmed finding identity to remain in one confirmed group across all matcher entrypoints while keeping independent component identities scoped to their component.
  • Display related finding titles, scan identities, and reasons in existing scan-history views, and retain related pairs in component findings artifacts.
  • Keep repository history scoped to its selected target and preserve stdin comparison transport compatibility with older custom plugins.
  • Advance both bundled-plugin identity markers to 0.1.39 so existing installations actually refresh changed workbench scripts.
  • Discover comparison-format support from an explicit, line-wrap-tolerant private-workbench capability rather than custom plugin versions; use the same existing help probe to independently detect stdin transport.
  • Use the supported Python resolver in the existing Windows scan-root alias test fixture.
  • Preserve package and publication behavior while retaining newer base-branch release updates in the conflict-free merge ref.

Testing

Validated on the exact proposed branch head:

  • Matching, property, CLI, renderer, component, workbench-history, publication-store, and Windows-fixture suites: 129 passed, 4 platform-specific skips, 0 failed.
  • Complete runtime suite, including an actual bundled Codex plugin upgrade from the previous 0.1.22 installation and legacy, previous, independently versioned, development, current, and narrow-terminal custom-plugin comparison compatibility: 134 passed, 11 platform-specific skips, 0 failed.
  • Cloud, Linear, publication-preflight, publisher, and publication CLI suites: 173 passed, 0 failed.
  • pnpm run types, pnpm run format, package build and packing, and git diff --check: passed.
  • Installed npm-package smoke: public import, NodeNext consumer types, CLI, all 113 bundled-plugin files, bundled Codex version, nested worker, and all 269 archive entries passed.
  • Added failing-first regressions for transitive confirmed identities between matching batches, forced pairs, and direct matcher inputs; visible related history; retained distinct component relationships; omitted or split same-identity matches; and independently versioned, custom-development, or line-wrapped plugin comparison capabilities.

Risk and rollout

Migration 33 creates two indexes under SQLite's normal write lock without rewriting saved comparisons or completed scan artifacts. The advanced plugin version refreshes existing managed installations before using updated bundled scripts.

No CLI commands, flags, accepted values, defaults, or machine-readable matching summary fields change. Existing history output and component findings artifacts include related relationships only when those relationships exist.

Merge this parent before stacked #575.

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.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 20, 2026
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, cd4b7a67c7c729fac3e4ccc1c33c963abe974374. This is the scan-history storage and compatibility portion of #567. The existing matcher remains in place on this branch.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: cd4b7a67c7

ℹ️ 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, cd4b7a67c7c729fac3e4ccc1c33c963abe974374. The code has not changed since the earlier review.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: cd4b7a67c7

ℹ️ 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-25T06:24:16.863038Z 710ab32 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.

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, 02a2e338f9f515a7a7d76d38a17e238bcbd32be0. 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. Already looking forward to the next diff.

Reviewed commit: 02a2e338f9

ℹ️ 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, aa2ed4119c0334b896cef05c426ec1b3a5fea86f. This additive update merges current main, including #573. The PR description has the fresh compatibility and full-suite QA results. Please check migration compatibility, confirmed-link reuse, uncertainty, and coverage handling.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: aa2ed4119c

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

ianw-oai
ianw-oai previously approved these changes Aug 21, 2026
Keep legacy repositories separate when preparing matching inputs, simplify finding alias bookkeeping, and retain the shared workbench stdin API. Use platform-aware Python probes and exercise comparison payloads larger than command-line limits.
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head 67d380ec17b191bbf31258d0fd6ef4873676de47 against main. This additive update preserves main's stdin and Python-resolution fixes, scopes legacy records without target IDs by repository, simplifies finding-alias bookkeeping, and exercises large comparison payloads. Please check relationship grouping, coverage and uncertainty, migration compatibility, and the transport fallback for older plugins.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 67d380ec17

ℹ️ 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 changed the title feat: preserve finding relationships in scan history feat: preserve cross-scan finding relationships Aug 21, 2026
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex security review

Please security-review exact head 6ad300c against main. Focus on stored relationship validation, legacy repository scoping, stdin transport, credential isolation, and custom-plugin compatibility.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head 6ad300c against main. Focus on relationship grouping, coverage and uncertainty semantics, migration compatibility, current matcher input isolation, and the fallback for older custom plugins.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 6ad300c882

ℹ️ 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 current head d7bca7f46e0ff0a8bf1f32080000364d927aef17.

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

ℹ️ 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/cli.ts Outdated
ianw-oai
ianw-oai previously approved these changes Aug 23, 2026

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

Critical review

Reviewed head d7bca7f46e0ff0a8bf1f32080000364d927aef17, with #575 treated as its explicit matcher follow-up.

Recommendation: keep the storage/invariant work, but fix bundle upgrade behavior before shipping this stack. Preserving confirmed identity separately from uncertainty and relatedness is necessary; collapsing those concepts can make an unresolved finding appear fixed.

[P2] Existing installs keep the old bundled workbench

This PR changes bundled database/history/schema helpers but leaves both plugin version markers at 0.1.22. bootstrapPlugin only restages when the version changes.

I reproduced this with the real local Codex installer in a fresh temporary home: bootstrap the current-main 0.1.22 bundle, then bootstrap this PR's bundle. The second operation still reported 0.1.22; both the staged and installed workbench_scan_history.py hashes remained identical to main, while this PR's source hash differed. Fresh-source CLI tests do not cover that installed-payload path.

Assign one fresh synchronized bundle version to the final #574/#575 payload and add a predecessor-cache upgrade regression. A new content-hash cache mechanism is unnecessary; the existing version contract is sufficient if advanced correctly.

Necessity and simplification

The database validates the complete comparison before replacing saved rows, keeps related pairs distinct from confirmed groups, and checks coverage across every prior grouped occurrence before calling an issue resolved. Batched relation lookups and indexed traversal of selected finding components are preferable to per-finding database scans. The migration adds indexes without rewriting history.

The current CLI still strips knownFindingGroups when invoking the old matcher, and that matcher does not produce related. This is a real limitation of this base by itself, but #575 explicitly wires the full path. Describe this PR as storage preparation, not the complete end-user matching feature; do not force matcher implementation into the storage review merely to resolve the older comment. Conversely, do not advertise the whole feature if only the base lands.

Verification

Ran history, CLI-workbench, and publication-store suites: 42 passed, 0 failed, plus the real local cache-upgrade reproduction. Linux, Bun 1.3.14 / Node 22.13.1 with cached dependencies. No model call, live publication, or native Windows run was performed.

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

ℹ️ 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/_bundled_plugin/scripts/workbench_scan_history.py
Comment thread sdk/typescript/_bundled_plugin/scripts/workbench_db.py
Comment thread sdk/typescript/src/scan-comparison.ts
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review
@codex security review

Please review exact head a79de11, including confirmed finding identities, independently related findings, append-only history migration, managed plugin upgrades, and component-scan artifacts.

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

ℹ️ 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
Comment thread sdk/typescript/src/runtime.ts Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review
@codex security review

Please review exact head 49aeb31, including confirmed finding identities, independent component findings, versioned custom-plugin comparison compatibility, append-only history migration, and managed plugin upgrades.

@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: 49aeb31796

ℹ️ 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/cli.ts Outdated
Comment thread sdk/typescript/src/scan-comparison.ts Outdated
Comment thread sdk/typescript/src/runtime.ts Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review
@codex security review

Please review exact head 2c87c8a, including transitive confirmed finding identities, mandatory stable-identity matches, independent component findings, previous and development custom-plugin compatibility, append-only history migration, and managed plugin upgrades.

@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: 2c87c8a476

ℹ️ 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/cli.ts Outdated
Comment thread sdk/typescript/src/runtime.ts Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review
@codex security review

Please review exact head 4a3ef77, including transitive confirmed finding identities and forced matching, mandatory stable-identity matches, independent component findings, explicitly advertised custom-plugin comparison capabilities, append-only history migration, and managed plugin upgrades.

@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

WITH RECURSIVE linked_occurrences(occurrence_id) AS (
SELECT ?
UNION
SELECT CASE
WHEN matches.before_occurrence_id = linked.occurrence_id

P2 Badge Return every transitive linked finding

For a confirmed chain A↔B↔C, this new recursive traversal correctly includes all three scans when computing knownScanIds, but the matches returned by the function still come from the preceding one-hop query, so finding_matches(A) contains only B. Consequently scans show --show-linked-findings, whose help promises findings linked across previous scans, omits C even though the same result advertises C as part of the finding's confirmed history. Project the recursive component into the returned linked findings as well as the endpoint metadata.

AGENTS.md reference: sdk/typescript/AGENTS.md:L16-L16

ℹ️ 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/runtime.ts Outdated
Comment thread sdk/typescript/src/scan-comparison.ts Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review
@codex security review

Please review exact head 710ab32, including canonical transitive confirmed finding identities across matcher entrypoints and forced matching, mandatory stable-identity matches, independent component findings, line-wrap-tolerant explicit custom-plugin comparison capabilities, append-only history migration, and managed plugin upgrades.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 710ab321fe

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

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants