Skip to content

Fail closed when pages ffprobe exits with leftover JSON - #143

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/pages-ffprobe-returncode-2ccd
Sep 8, 2026
Merged

Fail closed when pages ffprobe exits with leftover JSON#143
cursor[bot] merged 2 commits into
mainfrom
cursor/pages-ffprobe-returncode-2ccd

Conversation

@jmjava

@jmjava jmjava commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Problem

PR #135 made compose / TTS / validate / local-timestamp duration probes ignore ffprobe stdout when the process exits non-zero. Pages was left behind.

PagesGenerator duration badges still json.loads(out.stdout) with no returncode check. A failed probe that still printed JSON (or leftover stdout) can stamp a wrong ~Mm Ss onto generated index.html instead of the "varies" / "concat" fallback.

Change

  • Shared _ffprobe_duration_label: nonzero exit, timeout, missing ffprobe, or unparsable JSON → fallback
  • Successful probes still render ~Mm Ss
  • Tests cover leftover JSON on failure (segment + concat cards) and a real duration badge

Gate

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

Out of scope

  • Validate _check_streams / _check_drift JSON probes (empty stdout already fails json.loads → failed check)
  • Whisper prompt-cap int(... or 0) in timing enrichment
  • Raising from docgen pages when ffprobe is missing

Milestone: milestones/pages-ffprobe-returncode.md

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 8, 2026 00:43
Pages duration badges parsed ffprobe stdout without checking returncode,
so a failed probe could stamp a wrong ~Mm Ss onto index.html. Ignore stdout
on nonzero exit and keep the varies/concat fallbacks.

Co-authored-by: jmjava <jmjava@gmail.com>
ruff green; pytest 799 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:44
@cursor
cursor Bot merged commit 029b553 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