Skip to content

feat(findings): browse and manage saved finding history - #275

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

mldangelo-oai wants to merge 226 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

Browse saved findings by repository or scan and inspect the occurrence that a triage or remediation decision concerns. The default repository view shows open findings. Operators can request closed findings, page through history, and use findings show OCCURRENCE_ID for details.

Changes

When an operator dismisses a finding after two occurrences have been matched, future scan feedback cites the occurrence the operator selected. Retrying the same selection preserves its decision history. SDK matching uses the existing unfiltered repository query so previously compatible selected plugins can return open and closed findings.

  • Merge main at 173483d7c658be7a512c93d9559bf01a05d5b196. Use its persisted repository generations and checkout cache for history. A verified linked worktree can share evidence, a replacement checkout cannot inherit its predecessor's actions, and old targetless scans remain comparable at an unclaimed path.
  • Keep a registered repository visible when a replacement has no scans. Use the reviewed occurrence for false-positive feedback, including when unrelated findings share a stable ID. Keep repository history scoped to its saved generation and check current ownership for occurrence actions.
  • Preserve finding filters, detailed locations and artifact paths, the imported-evidence command, and selected plugin-source refresh. The default page size is 20. SSH home-relative origins retain account identity, and supported public Git service aliases compare across SSH and HTTPS.
  • Record the first completion or retained stopped result once, including when a scan started before a triage decision. Repeated publication keeps that boundary. Fixed and false-positive findings can reopen on new evidence. A won't-fix decision stays closed.
  • Move the existing preview chronology, decision, and admission receipts to 73–75 after main's repository identity and external-source migrations. Both workbench runtimes apply the shared SQL migrations. Presentation uses main’s chronological ordering. Comparison snapshots use the later result’s admission boundary. The first-publication boundary governs reopening. Python retains responsibility for the repository-dependent migrations.

Testing

On Linux, I ran 86 Python history, admission and feedback cases during integration with main. After consolidating the history readers, seven linked-checkout and schema cases and six SDK index and renderer cases passed. At d9345646, all 15 selected migration cases and the five portable source checks passed, including the file-size check for the migration suite.

At 8b4c016a, 16 populated SQLite upgrade cases passed on Linux across #275, #2263 and #2675. Twelve began at release npm-v0.10.0 and four exercised the older 5d073ba8 finding-history layout. Python-first and Node-first opens retained the stopped phase, decision, admission boundary, and original receipt timestamps. Three CLI regressions, the 76 Node database checks, and the five portable plugin checks passed. Source CI at 8b4c016a

At 83beee59, both inventory entry points passed the wrapper-interpreter regression on Linux, and the five portable plugin checks passed. This head includes the Ubuntu 26.04 test fixture from #2678. On the previous head the native Windows MCP registration case completed in 1.21 seconds. Source CI at 83beee59

On 3cc8dc90, eight targeted workbench cases passed on Linux, including a matched pair dismissed after the match was saved. The SDK regression exercised both pages of the matching query and the open-findings query. All 23 CLI findings tests, SDK types and formatting, and the five portable plugin checks passed. Source CI for this revision

Earlier qualification follows. The linked Windows and macOS jobs tested an earlier revision.

  • On the earlier Linux revision, the complete saved-scan bootstrap suite passed 71 cases with two platform skips. An explicit scan ID resumed a pending group write with trusted Git unavailable. Replacing the Git directory, initializing a nested checkout, or redirecting the common directory prevented source access. Four deduplication and workflow suites passed 107 cases. Classification and publication passed 125 cases. The five portable checks and the 194-file plugin build passed.
  • Windows CI reproduced failures for both stored native IDs and legacy full IDs. The owner check now uses the pinned native identity verification used by resume. Five portable cases covered those formats, narrower stat IDs, and replacements sharing the same narrow ID. The corrected Windows plugin contract suite at 93cda04a passed 621 cases and 40 subtests.
  • Reproduced a lost targetless pair on main and the original PR. The updated query returned both scans and one pair while excluding the previous owner after registration. The complete scan-history and admission suites passed 200 cases and all 127 history regressions passed together. Focused selections included replacement repository status, out-of-order completion, and checked-out directory remounts.
  • Upgraded a populated database from the original preview using Node twice, Python twice, and Node twice again. Receipt timestamps, admission sequence, saved decision and foreign keys survived. The MCP database and external-finding suites passed 86 tests. The rebuilt SDK history, renderer, CLI and repository-finding suites passed 142 tests. The SDK resume suite passed 57 tests with two platform skips.

Risk and rollout

Both this branch and #2675 at 787f3741 can reopen the other’s populated database. The first version-74 receipt retains its name and timestamp. If #2675 opened an older compact finding-history database, the migration archives the displaced compact binding receipt before restoring the released entries. A merged source tree still needs a single canonical history. #2263 depends on #275. The distinct #919/#907 Deep and #2671 reviewed-finding receipts need their own tested mappings when integrating those families.

One presentation decision remains. If a linked worktree is replaced, repository history on the surviving worktree can retain a closed matched group while the surviving occurrence's detail shows it open. History follows the saved repository generation. Detail and actions verify current checkout ownership. Confirm how the CLI should distinguish these views.

Existing decisions without an admission boundary retain their historical fallback. Offline reads use recorded evidence where ownership can be established. Checkout-dependent actions still verify the owner. Earlier qualification on this branch applies to its respective commits.

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.

This update uses synthetic fixtures. Previously published bot comments include restricted report links. Historical linked artifacts remain outside this attestation.

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

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

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

Reviewed commit: 223ecf3e75

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

chatgpt-codex-connector Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

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

Reviewed commit: f0dc21af02

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

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

Copy link
Copy Markdown
Collaborator Author

I rechecked the outstanding history review findings at 3cc8dc90. The focused Linux run passed 18 cases, and the terminal history and repository-alias SDK tests passed.

  • Future false-positive feedback stays in the matched group and cites the occurrence the operator reviewed, including when the group was matched before dismissal. Retrying the same decision preserves its history. Feedback thread · Fix
  • Legacy bulk matching retains an unclaimed targetless pair and excludes a previously owned path after registration. A registered replacement with no scans remains visible and appears under the unscanned filter. Bulk matching · Repository listing · Status filter
  • Terminal history retains interrupted scans, their IDs, last activity and resume guidance. The comparison test also covers a scan that starts earlier but admits its result after a dismissal. Its snapshot uses admission order. Terminal history · Comparison cutoff

The Bitbucket Cloud transport example now matches across HTTPS and SSH. For an unrecognized SSH server, a home-relative SCP path can depend on the login account. The current implementation preserves that distinction. I left the all-host normalization request open for the code owner. Transport thread

@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: 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".

This branch has not been deployed

No deployments
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.

8 participants