public interface IPeAnalysisService
{
    /// <summary>
    /// Parses a PE image from the specified stream, optionally using a content-based cache.
    /// </summary>
    /// <param name="stream">The input stream containing the PE file bytes.</param>
    /// <param name="cancellationToken">A token used to cancel the operation.</param>
    /// <returns>An immutable <see cref="PeImageInfo"/> describing the parsed PE file.</returns>
    Task<PeImageInfo> GetOrParseAsync(Stream stream, CancellationToken cancellationToken = default);

    /// <summary>
    /// Parses, validates, and analyzes a PE image from the specified stream.
    /// </summary>
    /// <param name="stream">The input stream containing the PE file bytes.</param>
    /// <param name="cancellationToken">A token used to cancel the operation.</param>
    /// <returns>A complete <see cref="PeAnalysisResult"/> containing parse results, validation, and findings.</returns>
    Task<PeAnalysisResult> AnalyzeAsync(Stream stream, CancellationToken cancellationToken = default);
}