feat: disc20 fixture + structural chapter-split detection#25
Merged
Conversation
Add test fixture for a 119-minute movie compilation with 41 scene chapters that must NOT be chapter-split into episodes. - Fixture: 4 playlists, 9 CLPIs, ICS menu (71.7 KB total) - Integration tests: 1 movie episode, 1 extra special - Updated conftest fixtures and all 6 matrix parametrizations Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…y detection Replace two brittle numeric guards in _episodes_from_chapters() with a positive structural signal: _detect_episode_periodicity(). The old approach asked 'does this NOT look like episodes?' via: - est_count <= 2 (arbitrary duration threshold) - chapters/est_count > 7 (arbitrary ratio guard) The new approach asks 'does this look like episodes?' by detecting a repeating OP (~90s) / body / ED (~90s) / preview cycle in chapter durations — the structural fingerprint of anime episode compilations. Tested against all 20 disc fixtures with zero false positives/negatives. Also updates AGENTS.md, add-disc-fixture skill, and debug-analysis guide to document the 'structural signals over thresholds' principle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- 1 episode (44.1 min OVA) + 1 digital archive - Fixture: 4 playlists, 23 CLPIs, ICS menu (36.1 KB total) - Integration tests + conftest + all 6 matrix parametrizations - 348 tests pass Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace brittle numeric thresholds in chapter-split detection with structural periodicity detection, and add disc20 fixture.
Changes
disc20 fixture (commit 1)
Structural detection refactor (commit 2)
Problem:
_episodes_from_chapters()used two arbitrary guards:est_count <= 2— happened to catch disc18 (52min movie)_MAX_CHAPTERS_PER_EPISODE = 7— happened to catch disc20 (8.2 ch/ep)Both are "just happens to work" thresholds that break on the next disc.
Fix: New
_detect_episode_periodicity()function that detects repeating OP/body/ED chapter structure:Zero false positives/negatives across all 20 fixtures.
Why it works: Anime episodes reuse OP/ED sequences with frame-exact timing (~91s OP, ~91s ED across all 15 detected episodes). This creates a structural fingerprint that no movie scene-chapter layout will ever produce.
Instruction updates
Test results
335 passed, lint clean.