2.5 KiB
2.5 KiB
Reachability Caching with Incremental Updates
Module
Scanner
Status
IMPLEMENTED
Description
Postgres-backed reachability cache with incremental updates, graph delta computation, impact set calculation, and state flip detection for efficient cache invalidation.
Implementation Details
- Reachability Cache:
src/Scanner/__Libraries/StellaOps.Scanner.Reachability/Cache/IReachabilityCache.cs-IReachabilityCacheinterface for cached reachability resultssrc/Scanner/__Libraries/StellaOps.Scanner.Reachability/Cache/PostgresReachabilityCache.cs-PostgresReachabilityCachePostgreSQL-backed cache for reachability analysis results
- Incremental Updates:
src/Scanner/__Libraries/StellaOps.Scanner.Reachability/Cache/IncrementalReachabilityService.cs-IncrementalReachabilityServiceperforms incremental reachability updates based on graph deltas
- Graph Delta Computation:
src/Scanner/__Libraries/StellaOps.Scanner.Reachability/Cache/IGraphDeltaComputer.cs-IGraphDeltaComputerinterface for computing graph changessrc/Scanner/__Libraries/StellaOps.Scanner.Reachability/Cache/GraphDeltaComputer.cs-GraphDeltaComputercomputes added/removed/modified nodes and edges between graph versions
- Impact Set Calculation:
src/Scanner/__Libraries/StellaOps.Scanner.Reachability/Cache/ImpactSetCalculator.cs-ImpactSetCalculatordetermines which reachability paths are affected by graph changes
- State Flip Detection:
src/Scanner/__Libraries/StellaOps.Scanner.Reachability/Cache/StateFlipDetector.cs-StateFlipDetectordetects reachability state changes (reachable->unreachable or vice versa) for cache invalidation
- PR Reachability Gate:
src/Scanner/__Libraries/StellaOps.Scanner.Reachability/Cache/PrReachabilityGate.cs-PrReachabilityGateprovides PR-level reachability gating using cached results
E2E Test Plan
- Scan an image, verify reachability results are cached in PostgreSQL, then rescan and verify cache hits avoid recomputation
- Modify one dependency in the image and verify incremental update only recomputes affected paths
- Verify graph delta computation correctly identifies added, removed, and modified nodes and edges
- Verify impact set calculation determines exactly which reachability paths need re-evaluation
- Verify state flip detection correctly identifies findings that changed from reachable to unreachable (or vice versa)
- Verify the PR reachability gate uses cached results to quickly evaluate PR-level reachability changes