Skip to content

feat(batch): write sidecars abort-safely after the ladder - #185

Merged
bhemsen merged 2 commits into
mainfrom
feat/batch-sidecar-step
Oct 2, 2026
Merged

bhemsen merged 2 commits into
mainfrom
feat/batch-sidecar-step

Conversation

@bhemsen

@bhemsen bhemsen commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Change

  • batch runs the sidecar step after verification: plan_sidecars -> sidecar_paths -> existing-path check -> stale partials removed -> one multi-output ffmpeg -> sidecar renames -> output rename.
  • WrittenSidecar(path, stream, language) and Result.sidecars.
  • Failed step / failed sidecar rename / existing path each yield a note per the spec; the file stays converted. A failed output rename stays failed and keeps the renamed sidecars.
  • Stale sidecar partial sweep (best-effort, by grammar) at task start, in the outer BaseException net and in _handle_interrupt; _raise_if_terminated takes every partial.
  • No shipped profile declares a sidecar yet; behaviour for other profiles is unchanged (no extra process or probe).

Verification

scripts/verify.py green (1459 passed); new tests in tests/test_batch.py cover every Acceptance bullet with a test-local probe-first sidecar profile.

Closes #179

🤖 Generated with Claude Code

bhemsen and others added 2 commits October 2, 2026 10:54
A sidecar-declaring profile now gets a separate ffmpeg step after the
winning rung and its verification: plan, name, existing-path check, one
multi-output process, then every sidecar renamed before the output, so an
output at its final path implies its sidecar step finished. A failing step
or rename costs only the sidecar and is named in a note; an existing
sidecar is never replaced without --overwrite. Stale sidecar partials are
swept by name grammar at task start, in the outer BaseException net and in
the interrupt's stuck-future clean-up. Result gains sidecars.

Refs docs/specs/spec-subtitle-sidecars.md

Closes #179

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extract the post-failure probe and its termination check into a helper after
threading overwrite pushed the function to 55 lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bhemsen
bhemsen merged commit dd2188f into main Oct 2, 2026
7 checks passed
@bhemsen
bhemsen deleted the feat/batch-sidecar-step branch October 2, 2026 09:12
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.

feat(batch): write sidecars abort-safely after the ladder

1 participant