Skip to content

Fail closed when validate stream probes ignore ffprobe exit - #145

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/validate-stream-probe-2ccd
Sep 8, 2026
Merged

Fail closed when validate stream probes ignore ffprobe exit#145
cursor[bot] merged 2 commits into
mainfrom
cursor/validate-stream-probe-2ccd

Conversation

@jmjava

@jmjava jmjava commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Problem

PR #135 made duration probes ignore ffprobe stdout on nonzero exit. Pages followed in #143. Validate _check_streams / _check_drift still json.loads(out.stdout) with no returncode check.

Empty stdout already fails json.loads (failed check). Leftover JSON that lists video+audio streams can pass stream_presence / av_drift on a corrupt recording. Those checks are hard in validate --pre-push.

Change

  • Shared Validator._ffprobe_json: nonzero exit, timeout, missing binary, or unparsable JSON raises; callers turn that into a failed check
  • Leftover stream JSON is ignored when returncode != 0
  • Successful probes still pass when both streams are present and drift is within the max

Gate

  • ruff check src/ tests/ green
  • pytest tests/ — 808 passed, 1 skipped
  • docgen benchmark meets src/docgen/benchmark_data/baseline.json (no clock change; no --update-baseline)

Out of scope

  • Soft-check policy for layout / av_sync / freeze_ratio
  • Whisper API start/end float(... or 0.0) in ai_client

Milestone: milestones/validate-stream-probe.md

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 8, 2026 00:54
stream_presence and av_drift parsed leftover ffprobe JSON without
checking returncode, so a corrupt recording that still printed streams
could pass pre-push hard checks.

Co-authored-by: jmjava <jmjava@gmail.com>
ruff green; pytest 808 passed, 1 skipped; docgen benchmark meets baseline.

Co-authored-by: jmjava <jmjava@gmail.com>
@jmjava
jmjava marked this pull request as ready for review September 8, 2026 00:55
@cursor
cursor Bot merged commit bc0f265 into main Sep 8, 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