Skip to content

feat(cli): browse historical security findings - #275

Open
mldangelo-oai wants to merge 52 commits into
mainfrom
mdangelo/codex/findings-history-discovery
Open

feat(cli): browse historical security findings#275
mldangelo-oai wants to merge 52 commits into
mainfrom
mdangelo/codex/findings-history-discovery

Conversation

@mldangelo-oai

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

Copy link
Copy Markdown
Collaborator

Summary

  • Add repository-scoped historical finding lists and details, including filters, pagination, and a latest-scan shortcut.
  • Keep checkout selection and ownership verification in the Python workbench; include verified linked worktrees from subdirectories even when local legacy history exists.
  • Match clones only when both registered checkouts have verified filesystem ownership, and isolate replaced or recycled ownership epochs using database insertion order even when the system clock moves backward.
  • Keep repository finding counts consistent with active-finding coverage and reject altered sealed artifacts instead of treating integrity failures as pruning.
  • Replace duplicate renderer and database edge-case matrices with focused CLI, ownership, integrity, linked-worktree, clone, pagination, and display coverage.

Verification

  • Complete SDK test suite: 1,023 passed, 11 skipped.
  • Focused findings, renderer, ownership-epoch, integrity, linked-worktree, clone, and scan-history regressions: 33 passed.
  • TypeScript, formatting, and Python syntax checks passed.

Release sequencing

This changes bundled plugin code. Merge it before the plugin-version bump in release #343 to include it in 0.1.10; if it lands afterward, the next release must increment both bundled plugin version declarations beyond 0.1.17.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 4, 2026
@mldangelo-oai
mldangelo-oai requested a review from Copilot August 4, 2026 07:23
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

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.

Pull request overview

This PR adds first-class CLI support for browsing historical scan findings, including repository-scoped and scan-scoped finding lists, a dedicated finding-details view, and improved scan-history rendering that makes follow-up actions (pagination, details, matching, comparison) more discoverable.

Changes:

  • Introduces codex-security findings list / findings show flows (plus findings defaulting to list) and enhances scans show to support a “latest completed scan” default.
  • Extends the TypeScript renderer to format saved-findings pages and full finding details (locations, evidence, remediation guidance, history links, pagination hints).
  • Expands the bundled Python workbench to support get-finding, richer scan-history scoping for moved/nested checkouts, and global findings indexing improvements (including secondary-location search).

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sdk/typescript/tests-ts/workbench-findings-index.test.ts Adds regression coverage for global findings indexing (scoping, filtering, coverage-read behavior, tamper/noncanonical handling, detail vs preview completeness).
sdk/typescript/tests-ts/scan-history-renderer.test.ts Adds renderer coverage for actionable findings/history output, pagination hints, triage precedence, and next-command suggestions.
sdk/typescript/tests-ts/runtime.test.ts Adds coverage ensuring large get-finding responses are allowed while oversize non-detail workbench responses fail safely without leaking content.
sdk/typescript/tests-ts/cli.test.ts Updates CLI manifest assertions for new findings commands and revised scans show signature.
sdk/typescript/tests-ts/cli-findings.test.ts Adds CLI tests for repository scoping, paging/filter validation, scan selection, and “latest scan” behavior.
sdk/typescript/src/scan-history-renderer.ts Implements new findings/finding render modes, checkout scoping helpers, and improved list/show guidance (pagination, matching, compare suggestions).
sdk/typescript/src/runtime.ts Adds separate workbench stdout limits for list-style commands vs get-finding, with safer maxBuffer error redaction.
sdk/typescript/src/cli.ts Adds findings list/show commands, defaults findings/scans to list, and supports scans show without an explicit scan ID (latest completed).
sdk/typescript/README.md Documents the new scan-history and findings browsing commands and how to page/filter results.
sdk/typescript/_bundled_plugin/scripts/workbench_scan_history.py Improves repository scoping to handle moved checkouts, nested boundaries, and reused paths more safely; includes currentTargetPath projection.
sdk/typescript/_bundled_plugin/scripts/workbench_native_indexes.py Adds multi-target support, legacy-path support, and secondary-location searching for global findings queries.
sdk/typescript/_bundled_plugin/scripts/workbench_db.py Adds get-finding, supports full-details finding serialization, and strips forged metadata fields from stored details while preserving authoritative triage.
sdk/typescript/_bundled_plugin/scripts/workbench_cli.py Extends the workbench CLI surface with get-finding and multi-valued --target-id/--target-path for global findings.
README.md Updates top-level docs to mention scans show latest behavior and the new findings browsing commands.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sdk/typescript/_bundled_plugin/scripts/workbench_scan_history.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/workbench_native_indexes.py Outdated

@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: 223ecf3e75

ℹ️ 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 Outdated
Comment thread sdk/typescript/src/scan-history-renderer.ts Outdated
Comment thread sdk/typescript/src/scan-history-renderer.ts Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 223ecf3e75

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai
mldangelo-oai requested a review from Copilot August 4, 2026 08:11
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

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

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

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: f0dc21af02

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head deb9c13. Check the single shared repository-scope resolver, legacy findings without filesystem identities, moved checkouts, and removal of duplicate TypeScript policy/tests.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: deb9c13126

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

Security review completed. No security issues were found in this pull request.

Reviewed commit: deb9c13126

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head 4308466. Verify repository ownership and scope are authoritative in the workbench, historical findings never cross checkout owners, repository listing does not read archived coverage, and CLI/rendering changes remain focused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 4308466ae7

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@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: 4308466ae7

ℹ️ 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 Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/workbench_native_indexes.py Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head ed6ea80. Verify linked worktrees remain visible from verified checkout subdirectories, repository open counts match active findings, historical findings never cross checkout owners, and ownership policy remains centralized in the workbench.

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: ed6ea80e68

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

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

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

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head 5414e60. Verify registered checkout replacement never exposes previous-owner findings or counts, local legacy rows do not block verified linked worktrees, separately verified clones retain normalized-origin matching, and read-only history does not advertise unsupported comparisons.

@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: 5414e605c6

ℹ️ 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_native_indexes.py
Comment thread sdk/typescript/src/scan-history-renderer.ts Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/workbench_native_indexes.py Outdated

@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 Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: 5414e605c6

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sdk/typescript/_bundled_plugin/scripts/workbench_scan_history.py
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head 74cf79a. Verify findings, repository counts, and scan history all isolate distinct checkout ownership epochs; same-owner legacy history remains visible; sealed-artifact tampering propagates; and legacy scans do not advertise unsupported matching.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head 0fc6ee8. Verify origin-based clone matching requires registered filesystem ownership on both sides, unregistered or spoofed clones cannot access saved history, ownership epochs stay isolated, and tampered sealed artifacts remain fail-closed.

@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


P2 Badge Validate both sealed scans before matching

When the earlier scan's sealed manifest, findings, or coverage artifact is modified after completion, explicit scans match BEFORE AFTER and cached scans compare BEFORE AFTER validate only the later scan here and continue using the earlier scan's saved finding details. Fresh evidence beyond the native-index tampering report is this explicit comparison path: bulk matching calls read_coverage for every selected scan, but pair matching never checks the before scan, so a tampered sealed scan can still participate in a comparison; verify both seals before returning matching inputs or cached results.

AGENTS.md reference: sdk/typescript/AGENTS.md:L19-L20

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

@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 Security Review


P2 Badge Security: Preserve SSH account identity when matching clones

Required condition: two registered, current-owner checkouts use different SSH accounts on the same host and the same home-relative path, such as victim@host:repo.git and attacker@host:repo.git. Line 140 discards the account, so these distinct repositories normalize identically; scans match --all then includes the victim repository's saved finding evidence in the attacker's matching request. Fresh evidence beyond the prior unregistered-clone report is this collision between two fully registered, ownership-verified targets. Retain the SSH account or require a stronger operator-approved repository identity.

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head b5770e0. Verify recycled device/inode identities cannot revive earlier ownership epochs in history, findings, counts, bulk matching, or explicit comparisons; origin matching requires verified owners on both sides; and sealed-artifact tampering remains fail-closed.

@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

if include_matching_inputs and backfill_finding_details is not None:
backfill_finding_details(connection, before)
backfill_finding_details(connection, after)
after_coverage = read_coverage(after)

P2 Badge Validate both sealed scans before comparing them

When the before scan's sealed manifest, findings, or coverage artifact is modified while the after scan remains intact, explicit scans match BEFORE AFTER and scans compare BEFORE AFTER validate only the after scan here. The before scan's database findings can therefore be sent for matching or used in a cached comparison, and save_scan_comparison() repeats the same after-only validation, so the operation succeeds instead of reporting the integrity failure. Validate both selected scans before backfilling findings, returning cached results, or saving matches.

AGENTS.md reference: sdk/typescript/AGENTS.md:L19-L20

ℹ️ 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 Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: b5770e0fad

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head 04fd585. Verify SQLite insertion-order ownership epochs isolate recycled device/inode identities under backward clock changes across findings, counts, history, linked worktrees, clone matching, and explicit comparisons.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 04fd585835

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

Security review completed. No security issues were found in this pull request.

Reviewed commit: 04fd585835

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

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.

5 participants