Skip to content

Fail closed when nested validation tunables are not YAML numbers - #118

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/validation-numeric-tunables-2ccd
Sep 7, 2026
Merged

cursor[bot] merged 2 commits into
mainfrom
cursor/validation-numeric-tunables-2ccd

Conversation

@jmjava

@jmjava jmjava commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Problem

Top-level validation.max_drift_sec / max_freeze_ratio are already typed. Nested check tunables still go through int() / float(). A YAML bool is a subclass of int, so:

  • validation.av_sync.tolerance_sec: true became 1.0s OCR slack
  • validation.ocr.min_confidence: true became 1
  • validation.story_end.max_early_sec: true became 1s

A YAML list or string raised TypeError / ValueError inside validate, not ConfigError at load.

Change

Present values of nested OCR / layout / av_sync / timing_sync / story_end numerics must be YAML numbers (int or float, not bool). Missing keys keep defaults. Enable flags are unchanged.

Milestone: milestones/validation-numeric-tunables.md

Tests

  • Bool tolerance_sec / max_early_sec rejected
  • List min_confidence rejected
  • Quoted max_tail_gap_sec rejected
  • Valid numbers still load
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 7, 2026 21:52
bool is a subclass of int, so av_sync.tolerance_sec: true became 1.0s
OCR slack and ocr.min_confidence: true became 1.

Co-authored-by: jmjava <jmjava@gmail.com>
Record PR #118 and pytest / benchmark results on the milestone.

Co-authored-by: jmjava <jmjava@gmail.com>
@jmjava
jmjava marked this pull request as ready for review September 7, 2026 21:53
@cursor
cursor Bot merged commit 5fc783c into main Sep 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants