Repository navigation
perf(sdk): reuse prepared paths and findings across planning batches - #2977
mldangelo-oai wants to merge 1 commit into
Conversation
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks—no material issues found in this merge-safety review. Shared indexes preserve directory coverage, ordered finding history and transitive identity links. Deduplication still requires every nomination and the final pair review to approve, and all per-scan conflicts are checked before the first batch write.
Validation: 357 focused tests passed across seven CLI, catalogue, component-planning, deduplication and comparison suites; three Windows-specific cases were skipped. Fresh SDK/plugin builds, types and formatting passed; exact-head hosted CI has 54 successes and two conditional skips. Tests used synthetic model/provider responses on Linux. Native Windows/macOS, live services and independent performance benchmarks were not exercised.
Summary
Component planning repeatedly walked the same directories, and scan matching repeatedly read the same historical IDs. Preparing those lookups once reduces work on large inventories and scan histories.
Changes
Component planning shares directory counts across prompts, compaction, splitting, and validation. It searches outward from the midpoint for a directory boundary. Deduplication queues final pair review after every nomination approves.
The matcher resolves overlapping identity links in the catalogue, presents each issue’s latest occurrence, and expands its ordered history in results. A shared index routes results to each historical scan. Evidence paging measures JSON escapes and continuation offsets incrementally. The patch removes 149 net lines.
Testing
On this commit, 486 SDK tests with 41,087 assertions passed on Linux, with 3 skips. The run also passed SDK and plugin builds, type checks, and formatting.
To exercise transitive identity reuse and rejection of missing scan data before saving, run
cd sdk/typescript && bun test --timeout 30000 --seed 12345 tests-ts/cli-workbench.test.ts.In earlier synthetic probes, directory visits fell from 131,992 to 71,992 across 12,000 paths, and historical ID reads fell from 561,600 to 4,680 across 120 scans of 40 records each. The single-scan probe added about 0.36 ms. Windows-only environment and path cases were skipped on Linux.
Risk and rollout
Automatic and all-history matching check for per-scan conflicts before saving. A later write failure leaves earlier comparisons saved. Untyped SDK callers passing an empty
MaporSetin place of a findings array may now receive an empty result.Public disclosure review