Validate dangling component-story references#40
Merged
Conversation
Add ThemeOntology validation that flags collection "Component Stories" entries pointing to stories not present in the ontology, mirroring the existing undefined-theme check. Wired into validate()/print_warnings. Bump version to 2.1.4. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #40 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 25 25
Lines 1601 1607 +6
=========================================
+ Hits 1601 1607 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
paul-sheridan
approved these changes
Jun 17, 2026
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.
What
Adds a new ontology validation that flags collection
Component Storiesentries referencing stories that don't exist in the ontology — the same class of issue as the existing "Undefined theme" check, but for collection membership.Why
The themeontology data has real cases of this: e.g. Marvel Cinematic Universe / Spider-Man list
movie: SpiderMan: No Way Home (2021), and TRIPOD films listsmovie: Unforgiven (1992)(which exists only without themovie:prefix) — none of which resolve to a story. Nothing currently surfaces these.How
TOImpl.validate_components()(into_base.py), mirroringvalidate_storythemes(): for each story, anyComponent Storiesname not inself.o.storyyields a warning.ThemeOntology.validate()(so it flows throughprint_warnings()and theto-validateCLI).tests/data/dangling-component.st.txt+TestValidation::test_component_warning.Tests
pytest --cov=totolo→ 112 passed, 100% coverage.