Skip to content

refactor(sdk): simplify persisted finding workflows - #1210

Merged
mldangelo-oai merged 17 commits into
mainfrom
refactor/pr1185-followup-10-findings
Oct 4, 2026
Merged

mldangelo-oai merged 17 commits into
mainfrom
refactor/pr1185-followup-10-findings

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Persisted finding workflows and recovery tests repeat owner calls and data preparation. Consolidate those paths while retaining current recovery and validation behavior.

Changes

  • Reuse contract, workbench and finding-entry helpers with their live consumers.
  • Simplify comparison, classification, deduplication and saved-scan handling.
  • Retain current validation-evidence normalization and recovery probes; share fixture readers with their consumers.
  • Remove the internal findings-service forwarding class. Capture the initialized store and embedder once, preserve bound calls and validation-before-embedding, and update package inventory and documentation.

Testing

  • Fresh affected findings, persistence and recovery tests passed.
  • The five portable source checks passed. SDK changes passed types and normal formatting; MCP changes passed MCP typecheck and relevant formatting checks.
  • The combined integration tree is byte-identical to the previously validated combined tree: both full SDK runs (3,566 passed, 53 skipped each), 209 MCP checks and installed-package checks remain applicable. These full suites were not rerun for this history-only integration.
  • Three fresh native reviews and an independent verifier passed for this exact base/head. Hosted CI and Codex/Copilot reviews run on the updated head.

Risk and rollout

Persistence, validation and recovery semantics remain unchanged. The progress and findings patches both touch internal value/JSON helpers and the same dashboard test reduction; their combined version must retain both helper sets and apply the test reduction once.

Targets main, with dff04368 merged. The original refactor contribution is unchanged; conflicts from the landed parent PRs are resolved.

Direct follow-ups: #1211.

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.

codex added 2 commits October 3, 2026 19:14
Repository fixtures and hydration tools duplicate Git process setup. Share the existing invocation patterns with their actual consumers.
SDK entrypoints and tests repeat runtime, authentication and option setup. Share the setup at existing owners and introduce internal helpers with their first consumers.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 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-10-04T05:05:45.847237Z b32fd76 Manual request
🔒 Security Review ✅ Completed 2026-10-04T05:06:10.531806Z b32fd76 New commits
ℹ️ 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.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the current head a8a76ba.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: a8a76bab5d

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

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.

Copilot review overview

🔵 Needs a closer look

It broadly changes contract, persistence, recovery, and test infrastructure and remains dependent on the documented stacked-PR restacking process.

Review effort: Balanced
Findings: None

What changed in this PR

Consolidates persisted-finding, contract, recovery, and test-fixture workflows while preserving existing behavior.

Changes:

  • Adds shared runtime, finding-entry, JSONL, MCP, fixture, and test helpers.
  • Simplifies scan comparison, contract validation, deduplication, severity, and multiscan logic.
  • Refactors persistence and recovery tests to reuse common fixtures and mocks.
File Description
sdk/​typescript/​tests-ts/​support/​workflow-fixture.ts Reuses temporary-directory and scan-fixture helpers.
sdk/​typescript/​tests-ts/​support/​mcp-client.ts Adds a shared MCP test client.
sdk/​typescript/​tests-ts/​support/​json.ts Adds JSONL file reading.
sdk/​typescript/​tests-ts/​support/​deduplication.ts Adds an empty-neighborhood reviewer fixture.
sdk/​typescript/​tests-ts/​suggest-owners.test.ts Reuses managed temporary directories.
sdk/​typescript/​tests-ts/​scan-resume.test.ts Reuses shell, JSONL, fixture, and failure helpers.
sdk/​typescript/​tests-ts/​scan-recovery.test.ts Consolidates recovery fixture setup.
sdk/​typescript/​tests-ts/​scan-recipe.test.ts Reuses test fixtures and throwing helpers.
sdk/​typescript/​tests-ts/​scan-matching-e2e.test.ts Simplifies hashing and fixture setup.
sdk/​typescript/​tests-ts/​scan-comparison.test.ts Consolidates mocks and temporary directories.
sdk/​typescript/​tests-ts/​project-config.test.ts Reuses temporary-directory fixtures.
sdk/​typescript/​tests-ts/​plugin-finding-detail-contract.test.ts Reuses the MCP client helper.
sdk/​typescript/​tests-ts/​multiscan.test.ts Consolidates mocks, JSONL parsing, and fixtures.
sdk/​typescript/​tests-ts/​knowledge-base.test.ts Centralizes temporary-directory tracking.
sdk/​typescript/​tests-ts/​import-scan.test.ts Reuses cleanup and rejection helpers.
sdk/​typescript/​tests-ts/​findings-server.test.ts Simplifies provider mocks.
sdk/​typescript/​tests-ts/​findings-dashboard.test.ts Simplifies timer and promise fixtures.
sdk/​typescript/​tests-ts/​findings-client-retry.test.ts Consolidates response and retry mocks.
sdk/​typescript/​tests-ts/​finding-workflow.test.ts Simplifies rejected workflow operations.
sdk/​typescript/​tests-ts/​finding-workflow-integration.test.ts Shares finding-service and mock helpers.
sdk/​typescript/​tests-ts/​finding-embeddings.test.ts Simplifies provider-call assertions.
sdk/​typescript/​tests-ts/​finding-deduplication.test.ts Consolidates candidate and reviewer fixtures.
sdk/​typescript/​tests-ts/​finding-catalogue.test.ts Shares evidence request builders.
sdk/​typescript/​tests-ts/​feedback.test.ts Reuses a throwing fixture.
sdk/​typescript/​tests-ts/​dedupe-records.test.ts Replaces counters with mocks and shared errors.
sdk/​typescript/​tests-ts/​contract.test.ts Reuses directories and call-count mocks.
sdk/​typescript/​tests-ts/​codex-review.test.ts Shares JSONL, directory, and validation helpers.
sdk/​typescript/​tests-ts/​classify-severity.test.ts Centralizes policy fixture cleanup.
sdk/​typescript/​tests-ts/​classify-scan-severity.test.ts Reuses scan and directory fixtures.
sdk/​typescript/​src/​value.ts Adds a finding-to-map-entry helper.
sdk/​typescript/​src/​severity-store.ts Reuses workbench runtime setup.
sdk/​typescript/​src/​server/​sqlite-store.ts Reuses workbench runtime setup.
sdk/​typescript/​src/​scan-comparison.ts Simplifies options, evidence, and grouping logic.
sdk/​typescript/​src/​saved-scan.ts Reuses non-empty string validation.
sdk/​typescript/​src/​runtime.ts Adds shared workbench environment/runtime helpers.
sdk/​typescript/​src/​owner-evidence.ts Reuses missing-file handling.
sdk/​typescript/​src/​multiscan.ts Consolidates missing-file and attempt parsing logic.
sdk/​typescript/​src/​knowledge-base.ts Removes a redundant symlink branch.
sdk/​typescript/​src/​findings-import.ts Reuses the shared SHA-256 helper.
sdk/​typescript/​src/​finding-workflow.ts Reuses workbench environment construction.
sdk/​typescript/​src/​deduplication/​scan.ts Simplifies repository and environment preparation.
sdk/​typescript/​src/​deduplication/​records.ts Uses native set operations for attribution.
sdk/​typescript/​src/​deduplication/​checkpointed-review.ts Inlines configuration collection.
sdk/​typescript/​src/​contract.ts Consolidates normalization and validation helpers.
sdk/​typescript/​src/​classify-severity.ts Reuses finding map entries.
sdk/​typescript/​src/​classify-scan-severity.ts Reuses workbench environment construction.
sdk/​typescript/​scripts/​smoke-findings-service.ts Reuses JSONL parsing in smoke checks.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

codex added 2 commits October 3, 2026 20:31
Persisted finding workflows and recovery tests repeat owner calls and data preparation. Consolidate those paths while retaining current recovery and validation behavior.

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

Reviewed a8a76bab5dc1b0d76b80b9d10d780128b0f5da2e against its own base aa2b7867856b46440c6b671cb29f2f21a43b700d with exactly three independent high-reasoning full-diff reviews, including every test diff, plus root verification. No serious introduced code defect identified.

664 focused SDK tests passed (7 skipped); fresh native host build, plugin/SDK builds, types and formatting passed. A probe using the installed Codex SDK and a synthetic executable confirmed that absent and explicitly undefined Cyber feature values produce identical launch arguments; enabled values are retained.

Local validation was on macOS arm64. No model execution, local Windows run or full installed-package smoke. Reviewed sources remained unchanged. This review covers this exact head; it does not establish combined-stack validation against current main.

@mldangelo-oai
mldangelo-oai force-pushed the refactor/pr1185-followup-10-findings branch from a8a76ba to 3bfbd7e Compare October 3, 2026 21:09
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the current head 3bfbd7e.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 3bfbd7e6fd

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

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.

Copilot review overview

🔵 Needs a closer look

It broadly touches persistence, contract validation, recovery, and security-sensitive path handling while hosted checks and stack restacking remain pending.

Review effort: Balanced
Findings: None

codex and others added 10 commits October 3, 2026 21:34
# Conflicts:
#	sdk/typescript/src/security-policy.ts
#	sdk/typescript/tests-ts/api-policy.test.ts
#	sdk/typescript/tests-ts/api-post-scan.test.ts
#	sdk/typescript/tests-ts/component-scan.test.ts
#	sdk/typescript/tests-ts/security-policy.test.ts
# Conflicts:
#	sdk/typescript/tests-ts/multiscan.test.ts
# Conflicts:
#	sdk/typescript/tests-ts/support/shell.ts
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the current head 030d6b3.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 030d6b382f

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

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.

Copilot review overview

🟡 Changes recommended

Startup can route requests to a mutated store that was never initialized.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Comment thread sdk/typescript/src/server/server.ts

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

Reviewed exact head 030d6b382fb1a9c7a6a9d9aeb2d52a018e5742d5 against 33746cd2e1766cf658fffa72d8adf7a4c6422828. Exactly three fresh independent HIGH full-diff reviews, including every test diff, plus root verification are complete. No serious introduced product finding remains.

Approval is withheld while inherited installed-package/container checks fail on the cleanup assertion described in #1207 (package-behavior.mjs:202). This is a base fixture/cleanup-contract failure at this head, not a new finding in this PR contribution. Correct it upstream and rerun hosted checks.

Local validation: 669 SDK tests passed,7 skipped. Fresh macOS arm64 native host, plugin and SDK builds, types and formatting passed. Reviewed sources are unchanged. No model execution, local Windows run or full installed-package smoke. Source review is complete; merge readiness is not established.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the current head a54f8bc.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: a54f8bc546

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

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.

Copilot review overview

🔵 Needs a closer look

It spans persistence, contract validation, runtime setup, and recovery tests across 52 files, warranting final human review.

Review effort: Balanced
Findings: None

Resolved since last review (1)

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

Source review approved for a54f8bc546f959554daf6e0e504e40c4792535df against d519e01451b45a46ea2e9b6d3fd28489f8089d99.

Retained the three completed independent HIGH reasoning full-diff reviews, including every test diff, because this PR's own contribution is unchanged. Independently reconciled the current base and head snapshots and inherited changes in touched files. No additional full review pass was run for this restack, and no actionable introduced finding remains.

Validation is retained for the unchanged touched source: 669 distinct SDK tests passed and 7 were skipped. The suite was not rerun for this restack. The inherited package fixture was checked with the production tarball and existing exact-version dependencies; a clean installation remains unverified. This is not a new whole-tree validation claim.

Hosted CI was still pending at the latest check (2026-10-03T23:28:38.207458+00:00), with no failed jobs observed on this head. This source approval is not a statement that the PR is ready to merge. No model execution, local Windows validation, or full installed-package smoke test is claimed.

Base automatically changed from refactor/pr1185-followup-07-runtime to main October 4, 2026 04:38
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the current head b32fd76.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: b32fd76703

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

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.

Copilot review overview

🔵 Needs a closer look

Server dependencies are captured after asynchronous startup work, allowing an initialized store to be replaced by an uninitialized one.

Review effort: Balanced
Findings: None

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

Source review approved for b32fd7670343c50fa2129cfdfc6780cf69f826cc against dff043688e8e0d7cb9079525eec82ab61eed195f.

Retained exactly three independent HIGH full-diff review passes, including every test diff. Independently verified the actual GitHub three-dot diff, identical ordered contributions, all 52 touched paths at both base and head (bytes and modes), and the three historical report hashes. No actionable introduced source finding remains. No additional full source pass or local test was run for this restack; prior validation retains its original revision, execution time, and limitations.

Hosted CI was still unfinished at the separate 2026-10-04 05:14 UTC observation.

This is source approval, not a merge-readiness or combined-integration claim. No fresh model execution, local Windows validation, native rebuild, or clean installed-package smoke test is claimed.

@mldangelo-oai
mldangelo-oai merged commit 08fb643 into main Oct 4, 2026
66 of 68 checks passed
@mldangelo-oai
mldangelo-oai deleted the refactor/pr1185-followup-10-findings branch October 4, 2026 08:12
@github-actions github-actions Bot mentioned this pull request Oct 4, 2026
3 tasks done
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.

4 participants