Commit Graph
1285 Commits
Author SHA1 Message Date
Palash Debnath ce3827b613 fix(batch): check the speech model inside the transcribe step, not ahead of the whole pipeline (#4625)
* fix(batch): check the speech model when restoring, not in every pipeline run

#4623 added the missing-model check to the batch transcribe stage. Every
batch pipeline test that does not stub it then failed in CI's model-free
environment, leaving main red. Restored jobs are the only ones that skip
enqueue's check, so restore now checks once and shows such a job as failed
with Retry, leaving the pipeline as it was.

Also confines queue record paths to the batch folder after resolving them
(the CodeQL path alerts on the record writer) and reads test files as UTF-8.

* fix(batch): check the speech model inside the transcribe step itself

Review found that a job queued before its speech model was removed could
still download it, and that checking at restore can run before startup
swaps a missing saved model for an installed one. The check now runs in the
transcribe function, right before the backend loads, for every job: queued,
retried or restored. Pipeline tests that stub the guarded transcribe call
never reach it; the one test that runs it with a stubbed model opts out.

Queue record paths are checked after resolving but replaced and removed by
their own directory entry, so a link can't make a cleanup delete another
job's record.
2026-12-03 16:42:04 -08:00
Palash Debnath d6bd82844c Restart a crashed engine, ask before quitting running work, keep the batch queue across restarts (#4623)
* feat(desktop): restart a crashed engine, ask before quitting running work, keep the batch queue across restarts

- A local engine that crashed after it had started restarts on its own
  (1, 3, 6, 12, 30 s); a sixth crash in ten minutes, or a crash before it
  ever started, stays on the recovery screen.
- A quit the user starts asks first while the engine reports running work;
  confirmed update installs, OS shutdown and relaunches do not ask.
- Unfinished batch jobs keep a record beside their upload and are queued
  again, in order, on the next backend start.
- Interrupted audiobook/story renders are announced once after launch with
  a Resume action.

* changelog: add fragment for #4623

* test(dub): wait for the voice search to take focus

* fix(desktop): close the gaps review found in job resume and the quit prompt

- Quitting during a generation, clone, design or transcription now asks
  first: the engine reports open requests that do work, not just jobs.
- Restart on CPU withdraws a pending automatic restart before it saves the
  device choice, so the engine cannot start on the old device.
- Batch queue records hold only the upload's name, so they carry no home
  path and still restore after the data folder moves.
- A save racing a cancel, a job skipped as cancelled, or a record that
  cannot be deleted no longer brings finished or cancelled work back.
- One malformed record is dropped on its own instead of stopping every
  saved job from restoring.
- A queued or restored job whose speech model was removed fails with the
  enqueue message instead of downloading it.
- The interrupted-render notice retries a failed check a few times.
2026-12-04 03:43:28 +05:30
Palash Debnath 012eb41e3a ci(python): gate Ruff and ty on the rules the code already passes (#4614)
* ci(python): gate Ruff and ty on the rules the code already passes

Ruff and ty are pinned in the dev group (never installed for users: the
app syncs with --no-dev and Docker installs without groups). CI's first
Python shard and `bun run lint:py` run the same checks.

- Ruff checks runtime-bug rules: syntax, undefined names and exports,
  f-strings without fields, invalid characters, dropped asyncio tasks.
- ty fails on any rule the code passes today; the 23 rules with a backlog
  warn, so new instances of every other rule fail CI.

Fixes what the rules found:
- The setup warmup task was not referenced and could be garbage-collected
  mid-load; it is now held until it finishes.
- A perf-budget test fake called time.sleep without importing time.
- The scam guard's invisible-character class is written as escapes.
- Type-only names (httpx, Callable) are imported under TYPE_CHECKING.

* changelog: add fragment for #4614

* build(python): let lint:py sync the pinned tools before running them
2026-12-03 07:10:37 -08:00
Palash Debnath b73195bfc5 feat(stories): timeline dock with speaker tracks and a following playhead (#4606)
* feat(stories): screenplay-style script editor with timecodes and icon controls

- Lines show an estimated start time and the speaker in a gutter, named only
  when the speaker changes; characters get a colour bar, the narrator stays
  neutral.
- Voice and speed chips appear under a line only when it overrides them;
  defaults live in the hover toolbar.
- Auto-cast no longer invents speakers from one-off "Phrase: text" labels or
  from pronouns ("she said" goes to the last named speaker), and its panel
  folds away after a successful cast.
- Script and speed controls use icons with tooltips instead of text buttons
  and help paragraphs; Cover and Loudness match the other setup sections.

* changelog: add fragment for #4605

* feat(stories): timeline dock with speaker tracks and a following playhead

- A dock pinned under the script holds the last render's play bar and one
  track per speaker, each line a clip. Clicking a clip selects its line and
  moves the playhead there; the ruler and lanes seek on click; zoom with the
  buttons or +/-.
- Clip positions and the gutter timecodes come from the render's real chapter
  durations (or its total length) once there is one, and from the word-rate
  estimate before; the dock says when positions are estimates.
- The script highlights the line being played.
- The runtime under the script matches the timeline, including per-line
  speeds.

* test(longform): check the script instructions behind their info button

* changelog: add fragment for #4606

* fix(stories): stop casting determiners and offer to fold old pronoun speakers

- "said our host" / "her mother replied" name the noun, not the determiner,
  so auto-cast no longer creates speakers like "Our".
- Stories auto-cast before the pronoun fix kept members such as "She", "He"
  and "I". The script now names them and offers one click to remove them and
  give their lines to the last named speaker (first person to the narrator),
  keeping each line's own voice override.

* fix(stories): make the timeline readable on long stories

- Lay the tracks out in pixels with the ruler pinned to the top and speaker
  names pinned to the left, so both stay in view while scrolling.
- Clips too narrow to read show only their colour instead of a cut-off "L…";
  the full line stays in the tooltip and accessible name.
- Ruler labels keep about 90 px apart at any zoom; zoom goes up to 32x and the
  view follows the playhead.
- The track area can be resized from a handle (mouse or arrow keys); the
  height is remembered and the area never pads past its tracks.

* perf(stories): keep long scripts fast and add a line inspector

- A keystroke re-rendered and re-measured every line: about 2 s per key in a
  400-line story. Rows are now memoised (their handlers read the current
  draft through a ref, so a skipped render can't write stale lines) and
  off-screen rows skip layout with content-visibility. Typing drops to
  ~35 ms of script work per key; first load halves.
- A right-hand inspector shows the selected line's timing, speaker, voice and
  speed, editable in place, or a per-speaker line/runtime summary.
- The Stories editor uses the full window width instead of max-w-6xl.
- The "older saved result" notice becomes a one-line row with its detail
  in an info tooltip, instead of a large card in the sidebar footer.

* fix(stories): address review findings on the screenplay editor

- A pronoun after a screenplay label ("BOB: Hi." then "he said") now refers
  to that speaker instead of an earlier prose one.
- Consecutive legacy lines stored with no speaker read as one speaker.
- Folding pronoun cast members also reassigns chapter markers that named
  them, without a chapter counting as the last named speaker.
- The speed popup stays open while a line's first speed is set; the chip
  moves under the text only after the popup closes.
- Disabled icon actions stay focusable so their tooltip still names them.
- The book speed explanation is a keyboard-reachable info button.

* fix(stories): address review findings on the timeline

- A render's timing maps only onto the script it was made from: renders now
  save a timing key of the lines, and after edits the timeline falls back to
  estimates and stops linking clips and highlights to the audio.
- [pause] markers count as silence, so pause-only lines and chapters keep
  their place on the timeline.
- A failed chapter takes no time; a partial render without per-chapter
  durations is not spread over the whole script.
- The time grid runs left to right in right-to-left languages, so the
  playhead lines up with clips and ruler.
- Resize drags use pointer capture and end on cancel, lost capture or unmount.
- The inspector keeps an explicit unassigned speaker choice.
- A failed saved-audio check is shown, not only announced.
- Off-screen rows skip layout per column, so the hover toolbar isn't clipped.

* feat(stories): clip waveforms, playback keys and changed-line markers

- Clips show the render's waveform. A new GET /audio-peaks/{name} decodes a
  saved output with ffmpeg at 1 kHz mono and returns its loudness outline,
  cached per file version, so a long render costs the browser nothing.
- Editing-suite keys on the Stories page: Space play/pause, J back 5 s,
  K pause, L play (again for faster), Home/End. Ignored in fields and with
  modifiers; listed in an info button.
- Renders save a fingerprint per line, so lines edited, re-cast, re-timed or
  added since the render get a marker, and the timeline counts them.
- The line toolbar shows on hover or when focus enters it, not while typing,
  and sits inside the row. Rows skip layout off-screen again (column-level
  skipping laid out every toolbar: 224 ms vs 111 ms per key in 400 lines).

* feat(stories): pick any gallery voice from the Stories voice lists

The cast, line and inspector voice lists only offered saved voices, so a
gallery voice took a trip to the Gallery page. They now share one picker:
a search box over the default, your voices and the whole Voice Gallery.
Your voices filter as you type; the gallery is searched on the backend,
loads 60 at a time as the list scrolls, and long lists mount only the rows
in view. Picking a gallery voice saves it to your voices (reusing an
earlier copy) and assigns the saved voice. Arrow keys and Enter pick.

* feat(stories): rework the paste box into "Add lines from text"

The panel was titled after a button ("Auto-cast"), its placeholder promised
sentence splitting whatever the mode, and both actions hid behind a button,
a scissors icon and two info tips.

- Heading and subtitle say what it does; a collapsed panel shows when text
  is waiting.
- While empty it shows the three formats it recognises and an Open file
  button; text files can be dropped on the box.
- While typing it previews the speakers found (in their cast colours, or
  says everything goes to the narrator) and how many lines each action adds.
  The parse runs deferred, so long pastes do not stall typing.
- Auto-cast is the primary action (Ctrl/Cmd+Enter); Split into lines is a
  labelled button beside the split mode; a word count and Clear sit in the box.

* fix(stories): keep the speed help reachable while busy; NARRATOR lines never take a pronoun

- The busy state disabled the whole speed fieldset, which also took its help
  tip out of the tab order; the slider and reset are disabled one by one now.
- An explicit NARRATOR: line became the referent for a later "she said",
  casting that quote to the narrator; mergePronounCast already skipped it.

* fix(stories): address review findings on the timeline, line actions and voice picker

- Reaction-only lines ([laughter], [sigh]) took no time on the timeline, and a
  chapter of them dropped out of the chapter count, shifting every later clip.
  Estimates now come from the parser's spoken spans, reactions included.
- Changing a line's voice, its speaker's voice or the book voice left lines
  unmarked as changed. Render keys (now v2) include each line's resolved voice,
  so those lines are marked and the timeline stops mapping the old audio.
- Hovering a line put its action buttons over the first line of text. Rows now
  keep an end strip for a ⋯ button; the actions expand from it only on hover or
  focus of ⋯ or the actions themselves, or when ⋯ is pressed on touch screens.
- A gallery voice still saving when its picker closed could land later and
  rebuild the cast from an old copy, erasing newer edits. Closing the picker
  cancels it, and cast voice picks apply to the current cast.

* feat(sidebar): one line per setting in Stories, Audiobook and Batch dubbing

Title, voice, language and format (and Batch's target language, voice and
background switch) each sit on one row: muted icon and label on the left,
the control on the right, as Batch's engine row already did. The voice is a
compact button that opens the searchable voice list with the Voice Gallery;
Batch's presets appear there as their own group. Row labels are spans tied to
their fields, since the sidebar styles every label and legend as a heading.

* fix(stories): do not announce the speed help as unavailable while busy

aria-disabled on the speed group also marked its help button unavailable to
screen readers; the slider and reset carry their own disabled states.

* fix(stories): address timeline, voice picker and waveform review findings

- Time [slow]/[fast] spans at their own speed in line estimates.
- Only a render with a matching timing key maps onto the lines; resumed or
  keyless renders keep estimates instead of seeking into edited text.
- Group timeline clips in linear time; ignore transport keys another
  control already handled.
- The book voice picker offers no "engine default" row, which Generate
  would refuse.
- Voice picker: keep loaded gallery pages when a later page fails, show the
  gallery as loading until a new search settles so Enter can't pick a stale
  result, and refresh profiles when a cancelled pick may have saved.
- Line actions: the hidden toolbar's box no longer reveals it or catches
  clicks on the words.
- Waveform peaks rectify before the 1 kHz resample, so speech above 500 Hz
  is no longer drawn as silence.
- Localize the import examples and the clip length; reword the timeline
  estimate note; fix the Dutch "last render" wording.

* fix(stories): address the second round of timeline and picker review findings

- /audio-peaks needs the consumer tier: decoding a render is real work.
- The peak scan runs off the event loop.
- Timing keys include the output language, built by one timingContext()
  helper shared by the saved key and the live comparison.
- Literal bracketed text ([Appendix]) gets time; only reactions are not words.
- A result recovered only by file name keeps estimated clips.
- With estimated clips the lanes don't seek, the playhead hides and the
  clock shows the render's real length.
- Clips are reachable by keyboard (one tab stop, arrows/Home/End) and the
  lanes no longer rebuild every waveform on each playback update.
- The waveform cache keeps the last four renders.
- A clip click selects its line even while the text is locked.
- A second pointer lifting no longer ends a resize drag.
- The inspector summary lists unassigned lines when there is no Narrator.
- Speeds use the app language's decimal mark everywhere they are shown.
- The voice picker says when the gallery failed to load, with Retry.
- The page's basics panel and result views move to their own files, so
  the page stays under 500 lines.
2026-12-03 06:30:28 -08:00
Palash Debnath 554b34f6b8 Report which Sortformer piece is missing and document the macOS setup (#4599)
* Report which Sortformer piece is missing and document the macOS setup

* Add changelog fragment for #4599

* Update diarisation status tests for the missing field and cover the model override in the docs

* Re-run CI on the merged branch
2026-12-02 18:20:25 +00:00
debpalash 9635ef9ab7 fix(setup): hand fake-IP and stalled-lookup networks to the plain model downloader
The segmented downloader's address-pinned transport refused the Hub's own
download URL when the local resolver answered with non-public addresses (a
VPN or proxy app in fake-IP mode answers 198.18.x.x) or did not finish
(resolver only works through the proxy, timeouts). Those UnsafeURLErrors were
terminal, so the install stopped even though the Hub metadata requests had
just succeeded through the same network.

Cancelling a sibling range's wire lookup after one range failed also marked
the policy scope as interrupted, turning an ordinary range failure into a
terminal "destination validation was interrupted" refusal.

Both reached opt-in failure reports as ValueError (UnsafeURLError subclasses
it). Now the wire lookup of the starting origin, or any lookup that does not
complete, raises AcceleratorUnavailable and the install falls back to
snapshot_download at once with the reason logged; wire lookups no longer mark
the interruption scope. A redirect target that resolves privately and an
interrupted redirect check still stop the install.
2026-12-01 16:24:28 +05:30
debpalash aac725b660 Merge #4582: report the calling tier from GET /api/auth/whoami 2026-12-01 12:30:05 +05:30
DeryFerd acc89d5ac4 feat(sharing): rotate the share PIN without dropping the listener
The only way to change a share PIN was to disable sharing and enable it
again: that closes the socket, drops every connected guest and can move the
port, because enable() looks for a free one.

rotate_pin() issues a new PIN on the running listener under the same lifecycle
lock, keeps the port and the address list, republishes the app state, and
resets the PIN guard so a guest locked out under the old PIN starts clean. The
old PIN (and the ov_pin cookie carrying it) fails the next request, which
bounces that guest to the PIN form.

Exposed as POST /system/network/rotate-pin next to enable/disable, so it
inherits the same loopback-only control surface and returns 409 while sharing
is off. docs/sharing.md now says the PIN can be rotated while sharing stays on.

Tests: tests/test_network_share_rotate.py drives the real enable/disable
lifecycle against a fake uvicorn server and asserts the same task and server
object survive rotation, the port and addresses are unchanged, the state is
republished, the guard is reset, and the route answers the new PIN or 409.
2026-12-01 13:28:22 +07:00
DeryFerd eeef486a09 feat(auth): report the calling tier from GET /api/auth/whoami
The capability document advertises the auth routes, and the 403 text already
differs per tier, but a client could only discover its own tier by provoking
an error on a real route. whoami answers the question directly for every
tier, anonymous included, with kind, capabilities, transport and the admin
session's opaque credential id -- never a token, a PIN or a key.

The response runs through the existing /api/auth cache-control rule
(no-store), and the route joins the frozen dependency-free GET inventory with
its reason, so the authz census keeps its guarantee that a new open GET is a
reviewed decision.

Tests: loopback (native capabilities), cookie session (admin_session +
credential_id, no token in the body), API key, and an anonymous remote caller
with no key configured.
2026-12-01 13:27:50 +07:00
debpalash 45e12ccfa8 Merge #4561: feat(api-activity): add a live view for speech requests 2026-12-01 06:31:56 +05:30
debpalash 87a73d144d fix(api-activity): report stages at their real boundaries
- Loading model starts when the GPU worker runs ensure_ready() or the
  OmniVoice cold load, not while the request waits for a worker.
- Native PCM streams stay queued until their first inference step.
- Keepalive lines count as bytes but do not mark a request streaming.
- Speech routes behind an ASGI root_path are tracked.
- A failed poll freezes the shown duration instead of rewinding it.
- Tests use a plain executor and assert exceptions propagate.
2026-12-01 05:50:39 +05:30
Gabi aff4f95320 fix(api-activity): address review findings 2026-11-30 23:46:31 +01:00
Gabi dfc40e65f1 Merge remote-tracking branch 'origin/main' into fix/nonblocking-engine-inventory 2026-11-30 22:52:02 +01:00
Gabi 08071c0420 Merge remote-tracking branch 'origin/main' into feature/api-activity 2026-11-30 22:52:00 +01:00
debpalash 7aeadc519a fix(dub): pair legacy cue ids safely, retained Listen seek, Sorani search
Review fixes in the #4572 train: legacy generated cue ids pair with saved rows
by their render-time snapshot and stay unpaired when ambiguous; a retained
Listen range applies once seeking is allowed; the dub smoke expects no cue
control when the publication lookup fails; Sorani finds Central Kurdish; tests
synchronise with barriers instead of sleeps.
2026-12-01 00:08:10 +05:30
debpalash 0d4af8a0f0 fix(dub): close fork races with clear history and source replacement
Review fixes for #4538 in the #4572 train: the fork is in flight from the
moment it claims its directory, Clear history picks its ids under the job
lock, a source replaced mid-fork aborts it, missing borrowed media is refused,
an id with a history row is a conflict rather than inherited, an abandoned
fork directory is recoverable, withdrawal markers outlive pruning while held,
media_language is carried over, and POST /dub/fork has a typed response.
2026-12-01 00:08:10 +05:30
debpalash c596b7b011 Merge #4538: feat(dub): fork a prepared job over shared media 2026-11-30 22:22:00 +05:30
debpalash d26c0ced7b Merge #4571: feat(dub): add Central Kurdish (Sorani) as a translation-only dub target 2026-11-30 22:21:58 +05:30
debpalash e032e26367 Merge #4567: fix(dub): review follow-ups for the dubbing workspace redesign 2026-11-30 22:21:53 +05:30
debpalash 6f460e0432 Merge #4564: Fix unreadable Windows HF token path, duration span trim, CosyVoice long references and wrapped compiler errors 2026-11-30 22:21:49 +05:30
debpalash fc7d8597a7 Add Central Kurdish (Sorani) as a translation-only dub target
"Kurdish" (ku) resolves to Northern Kurdish in NLLB and OmniVoice, so Sorani
speakers had no dub target although OmniVoice speaks ckb and NLLB has ckb_Arab.

Fixes #4565
2026-11-30 21:49:23 +05:30
debpalash 8d749928c1 fix(dub): QC lease, legacy ids and preview cleanup; harden dub smokes
QC keeps its mix snapshot until an abandoned ASR worker drains; legacy renders
without segment ids map generated ids by position; original-track MP4 language
keeps a registered tag such as fil; failed preview muxes leave no temp file.
The dub smokes wait for settled state before asserting. Review follow-ups to
#4551.
2026-11-30 21:27:58 +05:30
debpalash da3c652a97 fix(dub): pin unversioned QC to the scored mix and keep track cue orders apart
Review fixes for #4551: QC without a publication now validates its write against
the revision it scored, so a same-text replacement cannot take old scores; a
track without its own cue order no longer borrows the last-rendered language's;
the live YouTube smoke picks the target in Project setup.
2026-11-30 20:57:01 +05:30
debpalash d8031f3d97 Cap long M4A references, bound prepared copies, trim split duration spans
Review fixes for #4564: decode references soundfile cannot read through
audio_io before capping, delete the oldest prepared reference copies past 32,
and keep trimming a duration span the renderer splits into chunks.
2026-11-30 20:33:36 +05:30
debpalash 749c230760 Keep edges on a span that carries the explicit duration
A single span before a [pause] still received the requested duration but was
then edge-trimmed, shortening the constrained speech. One predicate now decides
whether the duration reaches a span, and the planner applies the same duration
exception as plain text.

Fixes #4562
2026-11-30 20:17:38 +05:30
Palash Debnath cb5724b1d7 fix(dub): keep mix caches and review state scoped to the track 2026-11-30 05:25:28 -08:00
Palash Debnath 1c9d72f4ab fix(dub): isolate language retries and saved projects 2026-11-30 05:06:26 -08:00
Palash Debnath 0307ef84ce fix(dub): keep saved track subtitles when importing desktop projects 2026-11-30 04:43:55 -08:00
Palash Debnath 8e6967e8ee fix(dub): preserve imported silence and scope published cue actions 2026-11-30 04:37:55 -08:00
Palash Debnath f0ac499ce2 fix(dub): preserve deliberate silence and require complete recovery checkpoints 2026-11-30 04:21:41 -08:00
Palash Debnath ce06f0cef3 fix(dub): retain legacy cue timing and unblock ready batch languages 2026-11-30 03:56:00 -08:00
Palash Debnath e885fa6514 fix(dub): omit cleared cues from translated subtitles 2026-11-30 03:11:26 -08:00
Palash Debnath f918bec8fa fix(dub): preserve silent subtitles and clear stale translation checks 2026-11-30 02:59:41 -08:00
Palash Debnath b4784cbfad fix(dub): keep plan and verification current during refresh 2026-11-30 02:57:43 -08:00
Palash Debnath 315e381f5a fix(dub): tie playback reviews to prepared inputs 2026-11-30 02:42:39 -08:00
Gabi cbcbc0d4c9 Merge current VoiceStudio main into API Activity branch 2026-11-30 11:40:00 +01:00
Gabi 89fcba9819 Add bounded API Activity monitoring for speech requests 2026-11-30 11:38:02 +01:00
Palash Debnath 6a8086fdfe fix(dub): verify the published mix and retain valid cue reviews 2026-11-30 02:20:16 -08:00
Palash Debnath dde5d40dc3 fix(dub): report actual take quality and verify fitted cue timing 2026-11-30 01:20:19 -08:00
Palash Debnath b40122c998 fix(dub): preserve seek handoff and keep playback errors private 2026-11-30 01:03:24 -08:00
Palash Debnath d418de8414 fix(dub): keep active previews and tier-aware plans in sync 2026-11-30 00:56:12 -08:00
Palash Debnath 85c5507729 fix(dub): refresh takes and cues for the active language 2026-11-30 00:28:51 -08:00
Palash Debnath a668736387 docs(dub): preserve the existing mobile API description 2026-11-30 00:18:49 -08:00
Palash Debnath 6854044434 fix(dub): pin the published WAV through range delivery 2026-11-30 00:17:28 -08:00
Palash Debnath ab8cc0fe6d fix(dub): keep playback and silence tied to their source 2026-11-30 00:14:03 -08:00
Palash Debnath d4a13680f3 fix(dub): reject superseded preview muxes and preserve draft edits 2026-11-29 23:51:43 -08:00
Palash Debnath 42a0772d62 fix(dub): bind preview playback to published mix timing 2026-11-29 23:32:07 -08:00
Palash Debnath 585bf69880 fix(dub): keep verification and preview state tied to playback 2026-11-29 19:58:23 -08:00
Palash Debnath 3e31c2a5c7 fix(dub): use destination timing and keep other tracks verified 2026-11-29 19:31:09 -08:00
Palash Debnath fd8868c3f5 fix(dub): scope preview requests and inherited synthesis settings 2026-11-29 18:42:57 -08:00