Conversation
…e IDs EPISODE_ID_PATTERN in scripts/lib/data-quality.ts was not updated when PR #435 added optional trailing TMDB numeric suffix support to isValidEpisodeId() in src/utils/metadata-validation.ts. This caused validateEpisodeId() (and generateQualityReport(), used by scripts/generate-star-trek-data.ts --validate) to flag 861 of 916 episode IDs in the live dataset as invalid, since real IDs like tos_s1_e01_253 include a trailing TMDB suffix that the stale regex did not permit. Update EPISODE_ID_PATTERN to accept the same optional trailing _\d+ suffix, and add regression tests covering suffixed IDs.
This was referenced Jul 22, 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
EPISODE_ID_PATTERNinscripts/lib/data-quality.tsdidn't accept the optional trailing TMDB numeric suffix (e.g._253intos_s1_e01_253) that real episode IDs insrc/data/star-trek-data.tsuse.Why
PR #435 added trailing-suffix support to
isValidEpisodeId()insrc/utils/metadata-validation.ts, but the siblingEPISODE_ID_PATTERN/validateEpisodeId()inscripts/lib/data-quality.tswas never updated to match. SincevalidateEpisodeId()requires both functions to pass, this causedgenerateQualityReport()(used byscripts/generate-star-trek-data.ts --validate) to flag 861 of 916 real episode IDs as invalid — a false-positive rate that would make the data-generation quality report useless for real curation work.Discovered during scheduled autohealing (category 3, code-aware convention checks) while validating ID pattern compliance across the dataset.
Fix
EPISODE_ID_PATTERNto allow an optional trailing_\d+suffix, matching the already-canonical pattern insrc/utils/metadata-validation.ts.tos_s1_e01_253,ds9_s2_e10_4567) totest/scripts/data-quality.test.tsto prevent this drift from recurring.Verification
pnpm lint— 0 errors (44 pre-existing warnings, unrelated)pnpm exec tsc --noEmit— cleanpnpm test— 1299/1299 passing (was 1298; +1 new test)pnpm build— successfulgenerateQualityReport()invocation:invalidEpisodeIdsdropped from 861 to 0🤖 Opened by Fro Bot daily autohealing run.