Files
git.stella-ops.org/src/Scheduler/__Libraries/StellaOps.Scheduler.ImpactIndex/IImpactIndex.cs
master 8355e2ff75
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
feat: Add initial implementation of Vulnerability Resolver Jobs
- Created project for StellaOps.Scanner.Analyzers.Native.Tests with necessary dependencies.
- Documented roles and guidelines in AGENTS.md for Scheduler module.
- Implemented IResolverJobService interface and InMemoryResolverJobService for handling resolver jobs.
- Added ResolverBacklogNotifier and ResolverBacklogService for monitoring job metrics.
- Developed API endpoints for managing resolver jobs and retrieving metrics.
- Defined models for resolver job requests and responses.
- Integrated dependency injection for resolver job services.
- Implemented ImpactIndexSnapshot for persisting impact index data.
- Introduced SignalsScoringOptions for configurable scoring weights in reachability scoring.
- Added unit tests for ReachabilityScoringService and RuntimeFactsIngestionService.
- Created dotnet-filter.sh script to handle command-line arguments for dotnet.
- Established nuget-prime project for managing package downloads.
2025-11-18 07:52:15 +02:00

68 lines
2.7 KiB
C#

using StellaOps.Scheduler.Models;
namespace StellaOps.Scheduler.ImpactIndex;
/// <summary>
/// Provides read access to the scheduler impact index.
/// </summary>
public interface IImpactIndex
{
/// <summary>
/// Resolves the impacted image set for the provided package URLs.
/// </summary>
/// <param name="purls">Package URLs to look up.</param>
/// <param name="usageOnly">When true, restricts results to components marked as runtime/entrypoint usage.</param>
/// <param name="selector">Selector scoping the query.</param>
/// <param name="cancellationToken">Cancellation token.</param>
ValueTask<ImpactSet> ResolveByPurlsAsync(
IEnumerable<string> purls,
bool usageOnly,
Selector selector,
CancellationToken cancellationToken = default);
/// <summary>
/// Resolves impacted images by vulnerability identifiers if the index has the mapping available.
/// </summary>
/// <param name="vulnerabilityIds">Vulnerability identifiers to look up.</param>
/// <param name="usageOnly">When true, restricts results to components marked as runtime/entrypoint usage.</param>
/// <param name="selector">Selector scoping the query.</param>
/// <param name="cancellationToken">Cancellation token.</param>
ValueTask<ImpactSet> ResolveByVulnerabilitiesAsync(
IEnumerable<string> vulnerabilityIds,
bool usageOnly,
Selector selector,
CancellationToken cancellationToken = default);
/// <summary>
/// Resolves all tracked images for the provided selector.
/// </summary>
/// <param name="selector">Selector scoping the query.</param>
/// <param name="usageOnly">When true, restricts results to images with entrypoint usage.</param>
/// <param name="cancellationToken">Cancellation token.</param>
ValueTask<ImpactSet> ResolveAllAsync(
Selector selector,
bool usageOnly,
CancellationToken cancellationToken = default);
/// <summary>
/// Removes an image digest and its component mappings from the index.
/// Used when an image is deleted or aged out.
/// </summary>
ValueTask RemoveAsync(
string imageDigest,
CancellationToken cancellationToken = default);
/// <summary>
/// Creates a compacted snapshot of the index for persistence (e.g., RocksDB/Redis).
/// </summary>
ValueTask<ImpactIndexSnapshot> CreateSnapshotAsync(
CancellationToken cancellationToken = default);
/// <summary>
/// Restores index state from a previously persisted snapshot.
/// </summary>
ValueTask RestoreSnapshotAsync(
ImpactIndexSnapshot snapshot,
CancellationToken cancellationToken = default);
}