namespace StellaOps.Scanner.Reachability; /// /// Contract for language-specific static lifters that extract callgraph edges /// and symbol definitions for reachability analysis. /// /// /// Implementers must produce deterministic output: stable ordering, no randomness, /// and normalized symbol IDs using helpers. /// public interface IReachabilityLifter { /// /// Language identifier (e.g., "java", "dotnet", "node"). /// Must match constants. /// string Language { get; } /// /// Lifts static callgraph information from analyzed artifacts. /// /// Analysis context with filesystem access. /// Builder to emit nodes and edges. /// Cancellation token. /// Task that completes when lifting is done. ValueTask LiftAsync(ReachabilityLifterContext context, ReachabilityGraphBuilder builder, CancellationToken cancellationToken); } /// /// Context provided to reachability lifters during analysis. /// public sealed class ReachabilityLifterContext { /// /// Root path of the analysis target (workspace, container layer, etc.). /// public required string RootPath { get; init; } /// /// Analysis ID for CAS namespacing. /// public required string AnalysisId { get; init; } /// /// Optional layer digest for container analysis. /// public string? LayerDigest { get; init; } /// /// Optional entrypoint hint from image config. /// public string? Entrypoint { get; init; } /// /// Additional options for lifter behavior. /// public ReachabilityLifterOptions Options { get; init; } = ReachabilityLifterOptions.Default; } /// /// Options controlling reachability lifter behavior. /// public sealed class ReachabilityLifterOptions { /// /// Default options for production use. /// public static ReachabilityLifterOptions Default { get; } = new(); /// /// Include edges with low confidence (dynamic/reflection patterns). /// public bool IncludeLowConfidenceEdges { get; init; } = true; /// /// Include framework/runtime symbols in the graph. /// public bool IncludeFrameworkSymbols { get; init; } = true; /// /// Maximum depth for transitive edge discovery. /// public int MaxTransitiveDepth { get; init; } = 10; }