Skip to content

fix(app): keep render state consistent - #7

Open
z2z23n0 wants to merge 3 commits into
OpenMOSS:mainfrom
z2z23n0:fix/render-state-consistency
Open

fix(app): keep render state consistent#7
z2z23n0 wants to merge 3 commits into
OpenMOSS:mainfrom
z2z23n0:fix/render-state-consistency

Conversation

@z2z23n0

@z2z23n0 z2z23n0 commented Jul 10, 2026

Copy link
Copy Markdown

Problem

Subtitle rendering was not isolated from other job operations:

  • subtitle updates were accepted while FFmpeg was rendering, so the finished MP4 could contain older subtitles than the current job state;
  • duplicate render requests started multiple full render workers for the same job;
  • restarting the service during rendering restored an otherwise editable job as failed, even when its subtitle data was intact.

Changes

  • Reject subtitle updates with HTTP 409 while a job is rendering, and keep the Web UI out of edit mode during that state.
  • Make the render state transition atomic, set rendering before the worker starts, reject duplicate render requests with HTTP 409, and restore the previous state if thread startup fails.
  • Recover interrupted render jobs with valid subtitle data to waiting_review so users can edit or retry; other interrupted processing states still recover as failed.

The work is split into three focused commits, one for each failure mode.

Impact

Rendered output can no longer silently fall behind saved subtitle content, duplicate FFmpeg work is avoided, and a server restart no longer makes completed subtitle work inaccessible in the Web UI.

Validation

  • python -m pytest -q tests/test_app_api.py (6 passed)
  • python -m pytest -q (30 passed)
  • git diff --check origin/main...HEAD

@z2z23n0
z2z23n0 marked this pull request as ready for review July 10, 2026 13:53

z2z23n0 commented Jul 15, 2026

Copy link
Copy Markdown
Author

PTAL when you have a chance, @zimoCCC @yhzx233 @gaoyang07. Thanks!

@z2z23n0
z2z23n0 force-pushed the fix/render-state-consistency branch from 644ab6b to d0ac1d2 Compare July 23, 2026 08:48
AlphaSightInc added a commit to AlphaSightInc/MOSS-Transcribe-Diarize that referenced this pull request Jul 29, 2026
Target: candidate 56 / Phase P items 60-63 (P1 monotonic measurement, P2 the
degrade rule, P3 the real-seam regression, P4 the class sweep), authorized by
the seventh prd.md amendment.

P1: RunnerBoundedWavInference measures its own decode on time.monotonic() and
never reads the runner's elapsed_sec. P2: trustworthy_duration_sec() states the
rule once as a conversion - an untrustworthy duration is recorded null (elapsed
and RTF) on canonical_processed, logged on moss_transcribe_diarize.live.decode,
and never terminal; applied in InferenceTranscript and the coordinator, both of
which used to raise. P3: four seam nodes putting the real runner's own duration
measurement under the real coordinator for the first time. P4: vllm_runner,
model_runner and jobs' progress throttle moved to monotonic;
live_transport._request_now ruled deliberate (a timestamp, not a duration).

Validation: red-before proved per half by semantic revert - each half has its
own named node, and reverting both wall-clock halves reproduces iteration 28's
probe record field for field (integrity/canonical_decode_failed, "runner result
elapsed_sec must be finite and non-negative", retryable=false) from a test with
no host. Green after: full Python suite 608 passed / 2 skipped / 368 subtests in
59 s (604 -> 608); live slice 136 passed / 329 subtests. Six nodes in
test_live_vad.py asserted the superseded rule and were rewritten to the new one,
not deleted.

New candidate 58 recorded, deliberately not fixed: the replay evaluator counts a
null (degraded) elapsed as an invalid measurement, so a declared absence fails
the RTF summary. Needs its own authorization.

Blocker: none. P5 remains - gate, advance expected_main to 77e0014 in
merge-keeper.sh, merge OpenMOSS#7, push, redeploy the server (no Mac rebuild needed),
then F1 and F3. Until the redeploy the deployed 77e0014 still carries the
defect, so no certification run or offline probe speaks for this code.
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.

1 participant