make --upstream_sync sync gap analysis progressively (#534)#755
make --upstream_sync sync gap analysis progressively (#534)#755PRAteek-singHWY wants to merge 7 commits intoOWASP:mainfrom
Conversation
|
Hi @Pa04rth @northdpole , This PR follows the progressive upstream-sync direction discussed in It keeps the existing core graph sync flow, then opportunistically backfills available upstream map-analysis results and weak-link subresults into the local cache, while skipping already-cached pairs and preserving the current on-demand fallback behavior for anything not prefetched. I also tightened the behavior and validation around this flow to keep the sync bounded and more predictable during normal local use. If this direction needs to be adjusted to better match the intended long-term approach for upstream sync and gap analysis, I’d be happy to refine it further based on your guidance. Tagging @Pa04rth as well for visibility. |
…alysis method shadowing (OWASP#534)
2351c6c to
e871da8
Compare
Fixes #534
Summary
This PR extends
make upstream-syncso it can progressively backfill gap-analysis results from upstream into the local cache, instead of requiring a large standalone local dataset up front.After syncing the core CRE graph, it:
/map_analysisresults per standard pairresultextra > 0This keeps the current on-demand local fallback behavior intact for pairs that are not prefilled.
Why
Issue
#534highlights that local gap-analysis data is too large and impractical to use reliably in normal local development.The goal here is to make local gap analysis progressively usable after upstream sync by caching only the map-analysis data that is actually available from upstream, instead of expecting a monolithic full download first.
Behavior notes
resultare stored locallyjob_id, that pair is skipped and remains available through the existing on-demand local pathextra > 0CRE_UPSTREAM_SYNC_MAX_MAP_ANALYSIS_PAIRS=0still allows full sync when explicitly desiredValidation
Screenshots
Example used in the screenshots below:
SAMMcompared againstASVSBefore: On-Demand Gap Analysis
Before progressive upstream backfill, requesting
SAMMvsASVSreturns ajob_id, meaning the result is not yet prefetched locally and falls back to background/on-demand computation.Before UI: Waiting For On-Demand Gap Analysis
This screenshot shows the
SAMMvsASVSmap-analysis view before progressive upstream backfill is available locally. The analysis has been requested, but the result is still pending and the UI remains in its loading state.After UI: Cached Local Gap Analysis
After sync, the same
SAMMvsASVSpair is available directly in the Map Analysis UI from the local cache.Notes For Maintainers
This PR is intentionally focused on progressive cache backfill during upstream sync.
It does not replace the existing local on-demand computation path, and it does not assume that every upstream pair is immediately available.
A few implementation choices are intentional here:
upstream-syncbecause#534specifically asks for opportunistic upstream loading during syncresultpayloads are cached locally; incomplete upstream responses are skippedCRE_UPSTREAM_SYNC_MAX_MAP_ANALYSIS_PAIRS=0still allows full sync when explicitly desired