Warn on unknown style names instead of silently defaulting - #388
Merged
Merged
Conversation
A style_settings() lookup for a non-empty style name that matches nothing (e.g. a job stamped before the style-hierarchy refactor split "BHOB-David Attenbot" into "David Attenbot" with parent "BHOB") silently fell back to whatever default_style currently is. Because channel_for_style() reads the channel off that fallback, this misrouted a Brief-History-of-Botkind film to the Stephen Spielbot YouTube channel when it finally auto-published, weeks after the refactor changed the style name it was stamped with. Add scripts/repair_stale_style_names.py to find and rewrite any job_config.json still carrying a pre-refactor compound style name, and log a warning whenever style_settings() has to fall back for an unrecognized (non-empty) name so this kind of drift is visible instead of silent. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.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
job_config.jsonfor a job rendered 2026-07-24 stampedstyle_name: "BHOB-David Attenbot"— the pre-hierarchy compound name. PR Style hierarchy: equality-is-inheritance for all fields, per-field parent hints #218 (2026-07-28) split styles into a bare child name (David Attenbot) plus aparentfield, but never migrated already-rendered jobs. When the job finally auto-published on 2026-09-11 (~7 weeks later),style_settings()couldn't match the stale name to any current style and silently fell back to whateverdefault_stylewas at that moment — routing the upload to Stephen Spielbot's channel instead of A Brief History of Botkind's, and later showing as "AI Music Video Network" oncedefault_stylewas changed again.style_settings()now logs a warning whenever a non-empty style name matches nothing, instead of silently substituting the default style — this class of drift (a stamped name outliving a rename) should be visible, not silent.scripts/repair_stale_style_names.py, a one-off repair tool that finds jobs still carrying a pre-refactor"{parent}-{child}"compound style name and rewrites them to the current bare name. Scanned all 54 jobs under~/videos; only the one film above was affected, and I've already applied the fix to itsjob_config.jsonon this machine.Test plan
.venv/bin/python3 -m pytest tests/ -k style— 238 passedscripts/repair_stale_style_names.py --dry-runagainst all jobs, confirmed exactly one match, then applied it for real and verifiedjob_config.jsonnow readsstyle_name: "David Attenbot"channel_for_style()now resolves the repaired job to A Brief History of Botkind's channel, and that a deliberately-unknown style name logs the new warning while still falling back safelyNote
The already-published video itself (
https://www.youtube.com/watch?v=6P0pLESBODI) is still live on the Stephen Spielbot channel — this PR fixes the underlying bug and the job's data, not that video. Let me know if you want it deleted from Stephen Spielbot and re-uploaded to A Brief History of Botkind.🤖 Generated with Claude Code