Repository navigation
Add default-on PIT traversal for semantic searches - #156
Open
afoote-mitre wants to merge 10 commits into
Open
afoote-mitre wants to merge 10 commits into
afoote-mitre wants to merge 10 commits into
Conversation
afoote-mitre
force-pushed
the
af/pit-search
branch
from
October 8, 2026 13:37
97cbdf5 to
e9e8f51
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add default-on, internal point-in-time (PIT) traversal for semantic
POST /searchrequests. Instead of stopping after the first 10,000 candidates, the API evaluates successive batches through one snapshot and returns exact totals only after traversal completes.This applies to
cpeName,virtualMatchString, CVSS vector filters, SSVC filters, and positiveknownExploitedsearches with date boundaries. Existing filter matching and scope rules are reused. Direct searches and/webSearchdo not use PIT.Why These Changes Were Needed
search_afterutils/searchPitTraversal.js:44,utils/searchQueryBuilder.js:87,controllers/searchController.js:138utils/searchPitTraversal.js:19,utils/searchProvider.js:216cve-corefields. Cleanup has an independent timeout of at most five seconds; late creation IDs are cleaned up, and cleanup failures produce a fixed warning without replacing the search result.utils/searchProvider.js:144,utils/searchProvider.js:177,utils/searchProvider.js:245utils/searchResponseValidator.js:101,utils/searchResponseValidator.js:122,controllers/searchController.jsutils/searchDeadline.js:36,utils/searchProvider.js:169,utils/searchPitTraversal.jsSearchPitEnabled=falserestores the bounded path; invalid configured boolean values still disable PIT. Batch size and lifetime use bounded numeric configuration.utils/featureFlags.js:24,utils/constants.js,config/default.jsonc,config/custom-environment-variables.jsonc,.env.exampleutils/searchResponseBuilder.js:39,routes/index.js,routes/swagger.js,api-docs/openapi.json,README.md:349,test/postman/buildCollection.js,test/postman/CVE-Search-API.postman_collection.json,test/postman/README.mdutils/searchPitTraversal.test.js,utils/searchProvider.test.js,utils/searchResponseValidator.test.js,utils/searchQueryBuilder.test.js,utils/searchDeadline.test.js,utils/searchResponseBuilder.test.js,utils/featureFlags.test.js,controllers/searchController.test.js,routes/search.integration.test.js,config/runtime-config.test.js,api-docs/openapi.test.jsCompatibility and Rollout
totalResultsandtotalPagescan exceed the accessible page window.504 SEARCH_TIMEOUT, missing/expired contexts use503 SEARCH_UNAVAILABLE, and malformed/incomplete responses use502 UPSTREAM_SEARCH_ERROR. Cleanup has its own bounded wait.SearchPitEnabled=true,SearchPitBatchSize=1000, andSearchPitKeepAliveMs=60000. Existing explicit overrides remain honored. Configuration changes require restart or redeployment.SearchPitEnabled=falsefollowed by restart or redeployment. This restores the 10,000-candidate cap and warnings; there is no automatic fallback after a PIT error.