Skip to content

assemble-and-score / dissolve-between-shots: a score longer than the cut is still trimmed silently (#246 only fixed pair_audio fit:"video") #342

Closed

Description

@dkackman

tool/endpoint: templates/assemble-and-score, templates/dissolve-between-shots (slice_audio step soundtrack)

repro: templates/assemble-and-score with 12 H3 shots (each 17n+5 frames, so a 12-shot total is ≡ 9 mod 17; the reachable totals near the score are 4089/4106/4123/4140). Use total_frames: 4089 (170.375 s @ 24 fps), score_start_frame: 0, and score a 172.74 s wav whose last seconds are loud: the loudest second in the file, +0.56 dBFS peak, is at 171 s.

expected: A warning that the score runs N s past the cut and its tail was dropped, symmetric with the existing slice_past_end warning for the short-score direction and with #246's audio_trimmed_to_video.

actual: succeeded, no warning. The last 2.37 s of the song, including its loudest second, are dropped. The template description documents the padding direction ("a score that does not reach that far is padded…") and says nothing about this one.

code:

proposed fix: slice_audio is a slice, so warning on every unused remainder would fire on legitimate excerpts. Prefer one of these:
(a) In the two templates, pass slice_audio a new optional warn_unused_tail_seconds-style argument (default off in the task, on in the templates). It warns with the seconds dropped and the peak dBFS of the dropped region when the remainder after the slice is non-silent.
(b) Emit the warning in slice_audio only when the unused tail is short relative to the slice (e.g. < 10 s or < 5%) and non-silent. That is the "the cut almost reached the score's end" signature of a frame-lattice miss.
Also add the longer-score direction to both template descriptions (the total_frames lattice means an exact match is often unreachable; move score_start_frame or re-end the score with fade_audio).

source: dw-findings-ledger DW-06 (T#9b), triaged 2026-09-22 against develop f11ac2a. Reopens the scope of #246.


Filed from Don's dw findings ledger (dw-findings-ledger.html, DW-06). First-pass triage for applicability and value against open/closed issues and develop @ f11ac2a by claude-opus-5-5 via anthropic (interactive session with Don; code-checking subagents inherited that model).

Activity

  1. dkackman commented on Sep 22, 2026

    @dkackman
    OwnerAuthor

    Related: #339 touches the same two templates on the score/world path. Natural batch. (claude-opus-5-5 via anthropic, filing session)

  2. dkackman commented on Sep 22, 2026

    @dkackman
    OwnerAuthor

    triage: batch with #339, #342 — same two templates (assemble-and-score, dissolve-between-shots) on the score/world path; one branch, one deploy. For #342 prefer a warning inside slice_audio with no new task argument; if a new argument turns out necessary, park that part for approval rather than adding it. (claude-opus-5-5 via anthropic, triage session)

  3. added a commit that references this issue on Sep 22, 2026
  4. dkackman commented on Sep 22, 2026

    @dkackman
    OwnerAuthor

    Fixed on develop, deployed to lem, same branch/deploy as #339.

    Per the triage note, this is implemented as a warning inside `slice_audio` with no new task argument. Added `_warn_on_slice_trims_tail` to `dw/tasks/audio_utils.py`, called right after the existing `_warn_on_slice_past_end` check. It only fires for the narrow "almost reached the end" signature: the dropped tail must be short in absolute terms (< `SLICE_TRIM_WARN_SECONDS` = 10s) and short relative to the slice itself (< `SLICE_TRIM_WARN_FRACTION` = 5% of the slice length), and the dropped region must be non-silent (checked via `level_dbfs(..., "peak")` returning a real value). A deliberate short excerpt out of a long recording (e.g. 1s slice out of a 60s source, 57s remainder) correctly does not warn, since the absolute-seconds gate fails. When it does fire, it emits `kind="slice_trimmed_tail"` with `source_seconds`, `dropped_seconds`, `dropped_peak_dbfs`, and `sample_rate`, following the same `emit_warning` pattern as the existing pad/trim warnings in `pair_audio.py`.

    • Commit: `d591404` (on `develop`, merged from `fix/339-342-world-fade-slice-trim`)
    • Deploy: `ssh lem 'scripts/deploy.sh develop'`, healthy at `d591404`, 2026-09-22 22:24 UTC
    • Worked as: Claude Sonnet 5 (claude-sonnet-5), provider Anthropic

    Proposed regression case (for the tester to add once verified over MCP) — `regression-suite-complete.md` (edge-case, not fundamental-path): call `slice_audio` (directly, or via `assemble-and-score`/`dissolve-between-shots` with `total_frames` set a few hundred ms short of the score's actual length, on a non-silent tail) and expect a `slice_trimmed_tail` warning in the job's `warnings`. Pair it with a negative case — a short slice out of a much longer source — expecting no such warning, to pin the "deliberate excerpt" exclusion.

  5. dkackman commented on Sep 23, 2026

    @dkackman
    OwnerAuthor

    Verified over MCP against lem develop @ e5bfb9e. Verified as claude-opus-5-5 via anthropic (tester, VERIFY session).

    The score is asset:qa-cast/ep11-bed.wav (19.67 s, 32 kHz mono, non-silent throughout). All runs were in workspace regression-complete, and their outputs were deleted afterwards.

    1. Direct slice_audio, as an inline 3-step workflow (job 1a06544c0760, succeeded):
      • near_end: start_frame: 0, num_frames: 460, fps: 24 (19.17 s, 0.50 s tail, 2.6 %). Warns: near_end: slice_audio: the slice ends 0.50 s before the 19.67 s source does, dropping its tail (peak -50.2 dBFS in the dropped 0.50 s) - ...
      • excerpt: num_frames: 24 (1 s slice, 18.67 s tail). No warning, as expected: the absolute gate is not met.
      • half: duration_seconds: 10 (9.67 s tail: under 10 s but 97 % of the slice). No warning, as expected: the fraction gate is not met.
    2. The issue's template path, templates/assemble-and-score (job 61ea679c3904, succeeded):
      • Inputs: shots qa-cast/ep28-shot1-wide.mp4 + qa-cast/ep28-shot2-close.mp4 (124 + 124 frames), total_frames: 248, score_start_frame: 214, sample_rate: 32000.
      • That leaves 0.42 s of the score unused.
      • Warns on step soundtrack: the slice ends 0.42 s before the 19.67 s source does, dropping its tail (peak -53.5 dBFS in the dropped 0.42 s).

    This matches expected:. The warning names the seconds dropped and the peak of the dropped region, and deliberate excerpts stay quiet.

    Not exercised:

    • dissolve-between-shots. It uses the same slice_audio step, so the change covers it, but I didn't run it separately.
    • The template-description wording for the longer-score direction. expected: didn't require it, and it's still worth adding.
  6. added
    status:verifiedTester confirmed the fix via a real MCP call
    and removed on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    owner:testerTester's turn to actstatus:verifiedTester confirmed the fix via a real MCP call

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions