Skip to content

Explain analysis hash changes in queue verification - #985

Open
AbandonedCart wants to merge 5 commits into
12.0from
reasoning
Open

AbandonedCart wants to merge 5 commits into
12.0from
reasoning

Conversation

@AbandonedCart

@AbandonedCart AbandonedCart commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Explain analysis hash mismatches in queue verification logs to clarify why items are re-analyzed.

New Features:

  • Add human-readable explanations for analysis hash mismatches, including analyzer action and Chromaprint availability changes.

Enhancements:

  • Include the detected hash-mismatch reason in queue verification logs.

Tests:

  • Add coverage for analyzer action, Chromaprint availability, combined changes, and fallback hash-mismatch explanations.

@sourcery-ai

sourcery-ai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Queue verification now explains analysis hash mismatches when they can be attributed to analyzer action or Chromaprint availability changes, otherwise emitting an explicit limitation-aware fallback; tests validate each outcome and logs include the explanation.

Sequence diagram for analysis hash mismatch explanation

sequenceDiagram
    participant QueueVerifier
    participant ConfigHasher
    participant Logger

    QueueVerifier->>ConfigHasher: ExplainAnalysisHashChange(config, mode, action, ffmpegValid, storedHash)
    ConfigHasher->>ConfigHasher: Analysis(config, mode, previousAction, ffmpegValid)
    alt stored hash matches alternate analyzer action
        ConfigHasher-->>QueueVerifier: analyzer action changed from previousAction to action
    else stored hash matches alternate Chromaprint availability
        ConfigHasher->>ConfigHasher: Analysis(config, mode, action, !ffmpegValid)
        ConfigHasher-->>QueueVerifier: Chromaprint availability changed
    else no known alternate hash matches
        ConfigHasher-->>QueueVerifier: limitation-aware fallback reason
    end
    QueueVerifier->>Logger: LogSeasonConfigHashChanged(..., reason)
Loading

File-Level Changes

Change Details Files
Add human-readable diagnosis for analysis configuration hash mismatches while acknowledging that most prior input values are unavailable.
  • Recompute hashes across alternate analyzer actions to identify action changes.
  • Recompute the hash with inverted Chromaprint availability for affected analysis modes.
  • Return a documented fallback when no specific cause can be inferred.
  • Cover analyzer action, Chromaprint availability, and unknown-setting scenarios with unit tests.
IntroSkipper/Helper/ConfigHasher.cs
IntroSkipper.Tests/TestAnalysisConfigHash.cs
Include the inferred hash-change reason in queue verification logs.
  • Pass the current analysis state and stored hash to the explanation helper.
  • Extend the structured log message with a reason field while retaining hash and Chromaprint context.
IntroSkipper/Manager/QueueVerifier.cs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="IntroSkipper/Helper/ConfigHasher.cs" line_range="115-117" />
<code_context>
+                continue;
+            }
+
+            if (Analysis(config, mode, previousAction, ffmpegValid) == storedHash)
+            {
+                reasons.Add($"analyzer action changed from {previousAction} to {action}");
+            }
+        }
</code_context>
<issue_to_address>
**nitpick (bug_risk):** When both the analyzer action and Chromaprint availability changed since the stored analysis, neither alternate hash tested by `ExplainAnalysisHashChange` matches: it checks the old action with the current availability and the current action with the old availability, but never checks the combination of both previous values. It therefore returns the generic fallback instead of identifying either known change.

**Triggers:** When a stored hash was produced with, for example, `AnalyzerAction.Chapter` and `ffmpegValid: false`, while the current state uses `AnalyzerAction.Default` and `ffmpegValid: true`.

**Suggested fix:** Also recalculate the cross-product of alternate analyzer actions and the alternate Chromaprint availability, or report each matching dimension independently while testing the combined previous state.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread IntroSkipper/Helper/ConfigHasher.cs Outdated
@kilo-code-bot

kilo-code-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • IntroSkipper/Manager/QueueVerifier.cs
Previous Review Summaries (3 snapshots, latest commit 191aaf1)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 191aaf1)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • IntroSkipper.Tests/TestAnalysisConfigHash.cs
  • IntroSkipper/Helper/ConfigHasher.cs
  • IntroSkipper/Manager/QueueVerifier.cs

Previous review (commit 2b1f7f6)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
IntroSkipper/Manager/QueueVerifier.cs 246 Hash mismatch logs incorrectly attribute every cause to changed analysis settings, despite hashes also including analyzer action, Chromaprint availability, and analyzer-version inputs.
Files Reviewed (3 files)
  • IntroSkipper.Tests/TestAnalysisConfigHash.cs - 0 issues
  • IntroSkipper/Helper/ConfigHasher.cs - 0 issues
  • IntroSkipper/Manager/QueueVerifier.cs - 1 issue

Fix these issues in Kilo Cloud

Previous review (commit 4ebbb86)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
IntroSkipper/Helper/ConfigHasher.cs 117 Hash-change explanation misses simultaneous analyzer-action and Chromaprint-availability changes and falls back to the generic reason.
Files Reviewed (3 files)
  • IntroSkipper.Tests/TestAnalysisConfigHash.cs - 0 issues
  • IntroSkipper/Helper/ConfigHasher.cs - 1 issue
  • IntroSkipper/Manager/QueueVerifier.cs - 0 issues

Fix these issues in Kilo Cloud


Reviewed by gpt-5.6-luna · Input: 0 · Output: 0 · Cached: 0

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

Comment thread IntroSkipper/Manager/QueueVerifier.cs Outdated
private static partial void LogSeasonQueuedForAnalysis(ILogger logger, AnalysisMode mode, int count, int total, string name, int season, AnalysisReason reason);

[LoggerMessage(Level = LogLevel.Information, Message = "[Mode: {Mode}] Queuing {Count} of {Total} items in {Name} season {Season} for analysis: analysis configuration hash changed from \"{StoredHash}\" to \"{ExpectedHash}\" (chromaprint available: {ChromaprintAvailable})")]
[LoggerMessage(Level = LogLevel.Information, Message = "[Mode: {Mode}] Queuing {Count} of {Total} items in {Name} season {Season} for analysis: analysis configuration hash changed from \"{StoredHash}\" to \"{ExpectedHash}\" (reason: one or more analysis settings changed; chromaprint available: {ChromaprintAvailable})")]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[WARNING]: The hardcoded reason is inaccurate for several causes of this hash mismatch. ConfigHasher.Analysis includes analyzer action, Chromaprint availability for some modes, and analyzer-version tokens in addition to configurable settings, so a change in any of those values is logged as one or more analysis settings changed. This makes the new diagnostic misleading; use wording that covers all hashed inputs or retain the explicit cause-specific explanation.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant