Fail closed when scene-spec bools become wait_word 1 - #147
Merged
Conversation
validate_scene_spec used isinstance(int/float), so wait_word: true became index 1, run_time/width true became 1, and title.font_size true compiled as font size 1. Reject YAML bools; wait_word: 0 still validates. Co-authored-by: jmjava <jmjava@gmail.com>
ruff green; pytest 818 passed, 1 skipped; docgen benchmark meets baseline. Co-authored-by: jmjava <jmjava@gmail.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.
Problem
Config generation tunables already reject YAML bools (#117 / #120). Scene-spec validation still used
isinstance(v, (int, float))andisinstance(ww, int).boolis a subclass ofint, sowait_word: truebecame index 1,run_time/width: truebecame 1,title.font_size: truecompiled as font size 1, andpage_transition_run_time: truepassed the(0, 5]range as 1.0.scene-compile/load_scene_specboth go throughvalidate_scene_spec.Change
_is_yaml_number/_is_yaml_intexclude boolwait_word/wait_segment/run_time/ box sizes / image sizes / layout run times / title font_sizewait_word: 0still validatesGate
ruff check src/ tests/greenpytest tests/— 818 passed, 1 skippeddocgen benchmarkmeetssrc/docgen/benchmark_data/baseline.json(no clock change; no--update-baseline)Out of scope
wait_wordsemantic drift)Milestone:
milestones/scene-spec-bool-numerics.md