Repository navigation
#601 stage 1: window_video task (split a long source into overlapping windows) #628
Copy link
Copy link
Closed
Labels
featureWork bigger than a fix: designed with Don, built in stages (harnest R11)Work bigger than a fix: designed with Don, built in stages (harnest R11)owner:testerTester's turn to actTester's turn to actstageA child issue: one stage of a featureA child issue: one stage of a featurestatus:verifiedTester confirmed the fix via a real MCP callTester confirmed the fix via a real MCP call
Description
Stage 1 of #601. It builds the plan's Stage 1: window_video (server) and the window_video design section of plan v2. If this body and the plan disagree, the plan wins.
Filed by the lead agent, model claude-opus-5-5 via anthropic, 2026-10-05.
Builds
- A new utility task,
window_video(video, index, num_frames, overlap, fps=None), which returns oneAudioVideo: windowindex, covering source frames[i·stride − overlap, i·stride + stride)withstride = num_frames − overlap.- Frames before 0 are frame 0 repeated. Frames past the end are the last frame repeated.
- The audio is the source's samples for the real span, measured on source-frame boundaries with
frames_to_samplesso adjacent windows tile exactly (shot records: dissolve_videos floors frame→sample, pair_audio/gain_audio round — re-pairing an episode shifts its shots by one sample #401). The synthetic frames get silence of matching length. - Frames are float [0,1], like
loop_frames. - It refuses
overlap >= num_frames,overlap < 0,index < 0, andindex · stride >= source_frames. - It is not a probe (
assessment=False).
TASK_ARGUMENT_DOMAINSentries:indexandoverlapnon-negative,num_framespositive. The task also checks them at run time.- The
AudioVideoconstruction site added totests/test_shots.pyEXPECTED_SITESand todw/shots.py's list.
Owes
- Tests: window spans (first, middle, last); prefix and pad frames; audio spans tiling across windows at 24 and 25 fps with 44.1k and 48k audio; each refusal; a source with no audio.
- Docs:
docs/TASKS.md(Video Processing) and adocs/ARCHITECTURE.mdrow.
Deploy
Server restart.
Passes when
The plan's stage 1 acceptance intent holds over MCP. With a ~50-frame asset: clip, num_frames=17 and overlap=4: index=0 gives 17 frames whose first 4 match frame 0 and whose first 4 frames of audio are silent; index=3 gives 17 frames whose last 2 repeat frame 49; index=4, overlap=17 and a negative overlap are refused. The stage also passes every pending: #<this issue> case the tester writes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureWork bigger than a fix: designed with Don, built in stages (harnest R11)Work bigger than a fix: designed with Don, built in stages (harnest R11)owner:testerTester's turn to actTester's turn to actstageA child issue: one stage of a featureA child issue: one stage of a featurestatus:verifiedTester confirmed the fix via a real MCP callTester confirmed the fix via a real MCP call
Activity
Merge branch 'feat/601-A-window-video' into develop (#628)
dkackman commentedon Oct 6, 2026
Stage 1 built and deployed (lead,
claude-opus-5-5viaanthropic)Shipped:
9015a5e1(branchfeat/601-A-window-video), merged todevelopasa83ad1cc. Deploy:[deploy 06:16:13] deployed develop @ a83ad1cc, healthy after 6s, mcp=true. The server was restarted.Plan items covered:
window_video(video, index, num_frames, overlap, fps=None)is in the new moduledw/tasks/windows.py, registered withassessment=False.[i·stride − overlap, i·stride + stride). Frames before the source repeat frame 0 and frames past its end repeat the last frame.frames_to_sampleson source-frame boundaries (the shot records: dissolve_videos floors frame→sample, pair_audio/gain_audio round — re-pairing an episode shifts its shots by one sample #401 cumulative rule). Synthetic frames get silence of the matching length. A track that runs a few samples short is zero-padded, so the window's audio length depends only on its frames.fpsargument, falling back to the source's own rate.overlap >= num_frames,overlap < 0andindex < 0are refused at run time.index·stride >= source_framesis refused at run time. The message names the source frame count and the last valid index,(total-1)//stride.TASK_ARGUMENT_DOMAINS["window_video"]: index ≥ 0, num_frames > 0, overlap ≥ 0, fps > 0. The same check runs again at run time throughcheck_arguments.("dw/tasks/windows.py", "window_video"): ("none", 1)is added toEXPECTED_SITES, and thedw/shots.pydocstring now mentions it.tests/test_window_video.pycovers:audio=None;realize_args, then the task, and comes out with its audio.### window_videosection indocs/TASKS.md(Video Processing), plus a row in its command table. A new "Overlap windows of a long video" row indocs/ARCHITECTURE.md.Deviations, so they don't read as bugs:
validate_workflowrefuses a literaloverlap >= num_framesitself, through a cross-argument check intask_domains.window_video_errors, not only at run time. The plan allowed either. The index-past-end refusal stays run-time only, because the source's length isn't known at validate time.videois read. A key namedvideois normally loaded as bare frames, which would strip anasset:/output:/path source of its audio. Sowindow_videojoins_LAZY_FRAME_COMMANDSindw/arguments.py: a file source reaches the task as aVideoFileReference, and the task reads it withload_audio_video. Two consequences:previous_result:) is used as it is, audio included when it has one.dkackman commentedon Oct 6, 2026
Architecture review queued by the loop driver: this hand-off changed
dw/ordw_mcp/ondevelop(2e8fced048..a83ad1ccb4: dw/arguments.py dw/shots.py dw/task_domains.py dw/tasks/task.py dw/tasks/video_utils.py dw/tasks/windows.py). The reviewer checks it againstdocs/ARCHITECTURE.mdbefore the tester verifies.2 remaining items
fix(windows): #628 - cut the window's real audio span with dsp.slice_…
Merge branch 'feat/601-A-window-video' into develop (#628)
dkackman commentedon Oct 6, 2026
Architecture bounce resolved; stage 1 redeployed (lead,
claude-opus-5-5viaanthropic)Shipped:
94231fb2onfeat/601-A-window-video, merged todevelopas6b6da603. Deploy:[deploy 06:53:01] deployed develop @ 6b6da603, healthy after 6s, mcp=true. The server was restarted.Fix for Finding 1:
_window_audioindw/tasks/windows.pynow cuts the real span withdsp.slice_samples(waveform, f2s(real_start), f2s(real_end) - f2s(real_start)). The hand-rolledshortpadding is gone, sodw/dsp.pyis the only place that does frame-aligned slicing and zero-padding. The head and tail silence for the synthetic frames hasn't changed. The behavior is the same:TestAudio::test_strides_tile_the_source_track_exactlyand the rest oftests/test_window_video.pypass without changes. The full suite has 8758 passed, 16 skipped and 1 xfailed, andruffis clean.Plan items and deviations: these are the same as in the first hand-off comment. The overlap check is static as well as run-time, and
window_videojoins_LAZY_FRAME_COMMANDSso a file source keeps its audio. No MCP shape changed.dkackman commentedon Oct 6, 2026
Architecture review queued by the loop driver: this hand-off changed
dw/ordw_mcp/ondevelop(29457326d0..6b6da603c1: dw/tasks/windows.py). The reviewer checks it againstdocs/ARCHITECTURE.mdbefore the tester verifies.dkackman commentedon Oct 6, 2026
Architecture review: passed (reviewer,
claude-opus-5-5viaanthropic)What I read:
git diff 29457326..6b6da603 -- dw dw_mcp(commit94231fb2). The only file it touches isdw/tasks/windows.py. I checked it againstdocs/ARCHITECTURE.mdand item 3 ofdocs/stabilization/harness/stage-c-guardrails.md.Finding 1 (second owner,
dw/dsp.py): resolved._window_audionow gets the real span fromdsp.slice_samples(waveform, f2s(real_start), f2s(real_end) - f2s(real_start)). The hand-rolledshortpadding is gone, so the zero-padding rule lives only indsp.py. The head and tail silence for the synthetic frames is unchanged, as the bounce allowed.No new findings:
CLAUDE.mdchanged.The first review covered the rest of the original change (
2e8fced0..a83ad1cc) and found nothing else.Waived: nothing. #628 has no
arch-approvedlabel.Not checked: I didn't run the tests or
scripts/arch_metrics.py. They're left to CI and the hook. The tester's MCP verify comes next.dkackman commentedon Oct 6, 2026
Verified over MCP against lem
develop@ 955c519 — tester, claude-opus-5-5 via anthropic.Surface:
list_taskslistswindow_videounder commands;get_taskshowsindex/overlapnon_negative,num_frames/fpspositive.C-F226 — PASS (
asset:qa-cast/ep6-cold-open.mp4, 124 f, 24 fps, 32 kHz stereo; num_frames 17, overlap 4)analyze_audioon frames 0–3 all null (digital silence). Window frames 4–16 vs source 0–12: peak −5.2307/−5.2307, RMS −19.7283/−19.7280 dB.C-F227 — PASS
validate_workflow, pathoverlap, "needs 'overlap' below 'num_frames'".C-F228 — PASS (job 7a62de571f20,
window_videooverprevious_result:ofvideo_frames): 17 frames, 960×544, 24 fps,get_gallery_metadatareports no audio stream; frames 0–4 = source frame 0, frame 16 ≈ source 12.Removed the
pending: #628lines from C-F226/C-F227/C-F228 in harnest'sregression-suite-complete.md; they are ordinary cases now.Unrelated, filed separately:
get_output_framesreturns HTTP 500 whenatholds a video's last two adjacent frames.feat(windows): dkackman#628 - window_video, one overlapping fixed-len…