Repository navigation
weave_to_episode: refuse a missing member instead of persisting a shifted timeline (#98) - #101
Merged
Merged
Conversation
…tead of persisting a shifted timeline (#98) The persisted timeline was built over the members found in the graph while ordered_member_ids kept the full list; consumers pair them by position, so one missing member shifted every later one. execute now raises, sharing one helper with the reconstruction path. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…othing (#98) Co-Authored-By: Claude Sonnet 5.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.
Fixes #98.
WeaveToEpisode.executebuilt the persisted timeline over[index[mid] for mid in member_ids if mid in index]but persisted the fullordered_member_ids. One member missing at execute time shifted the position pairing for every member after it (member_spans,episode_script+captions.cues_for, the picture track).executenow raisesValueErrornaming the missing ids, before any render work. It shares one helper (_resolve_members) with theepisode_timelinereconstruction path, which already refused this state (its message is unchanged).tests/test_transforms_episode_members.pyfailed with "DID NOT RAISE" before the fix, plus a control that a complete list keeps ids and timeline in step.narrate,render_dialogue,ConversationCast, body schemas, MCP tools untouched). The only behaviour change is a refusal in a state that previously produced a silently wrong episode.Local: full suite with
--doctest-modules711 passed (the two MCP test files needpy2mcp, absent from this venv; CI has it).Adversarial review (fresh Opus subagent, tried to break it): no confirmed defects. It checked every other site that filters members by the graph index (the video panels and
episode_scriptkeep a placeholder so positions do not shift), the cache-hit path, importer-written episodes, scene breaks, re-weave after a member is removed, and that no consumer matches the error text. It confirmed the new execute test fails when the fix is reverted and when the message drops the ids. Its gaps (no test of theepisode_timelinerefusal; no "nothing was persisted" assertion) are closed in the second commit, and the reconstruction test fails when the refusal is removed.🤖 Generated with Claude Code