Skip to content

#1199 stage 6: repair one chain segment in place #1207

Closed

Description

@dkackman

Stage of #1199, filed by model claude-opus-5-5 via provider anthropic. Already
built on feat/long-form-media (merged 3f8ed222). The authoritative spec is the
plan (docs/superpowers/plans/2026-11-03-long-form-media.md, task named below) and
the design record. If they differ, the design record says what shipped.

Built:

  • templates/minimax/repair-segment (chain_take or chain_output, segment, its
    own prompt and seed; head 22, tail 39, 175-frame render).
  • The tasks chain_repair_cut, chain_repair_splice and check_take_shots
    (dw/tasks/chain_repair.py).
  • keep_segments on the H3 chain templates (chained-segments,
    chain-video-continuity, chain-matched-to-audio, chain-matched-and-aligned,
    music-video).
  • save_segments/keep_segments accept variable: references.
  • Commits dcc5877..cf6999d.

Observe over MCP:

  • run_workflow a 4-segment chained-segments with keep_segments: true.
  • Then run_workflow templates/minimax/repair-segment with chain_take: output:<that job's final video>, segment: 3, a prompt and a seed.
  • assess_output(probe="analyze_seams") on both takes, and get_job for the
    manifest shots.

Acceptance intent:

  • The repaired take has the same frame count.
  • Only the repaired segment's frames change, and seams outside the span are unchanged
    within encode noise.
  • The repaired seams are recorded as chain seams (segment N (repaired)).
  • A take run without keep_segments is refused before the render, naming the fix.
  • segment: 1 and an out-of-range segment are refused.
  • A match_audio take keeps its whole source track (R31).
  • The VRAM estimate holds: peak at or under the estimate.

Bench evidence: 46d9c4f4b1d7 (repair of fdea6eba4a33 segment 4, 8.1 min, peak
18.92 GiB against an estimate of 19.95). Record: bench/records/repair.md.

Owes: nothing. Deploy: done at 3f8ed222.

verify: run every pending: #1207 case.

Activity

  1. dkackman commented on Nov 7, 2026

    @dkackman
    OwnerAuthor

    Verify of stage #1207 on lem develop @ 85bcd33, by tester claude-opus-5-5 via anthropic. Bounced to the lead: one acceptance point fails. The suites hold no pending: #1207 cases (I grepped every regression-suite-*.md), so I checked the stage's own acceptance list.

    Calls I ran

    1. run_workflow templates/minimax/chained-segments {segments: 4, keep_segments: true, seed: 1207} in workspace default → job 6bf2c404eee4, succeeded, 7.4 min (estimate 18). The take is 430 frames: segment 1 is 124 frames, segments 2–4 are 102 each, and every shot has a segment_file.
    2. run_workflow templates/minimax/repair-segment {chain_take: output:templates/minimax/chained-segments/20261107-145804-eb6cf5f0/final/MiniMaxH3I2VChained-chained_keyframe_to_video_audio.0-0.0.mp4, segment: 3, seed: 31207} → job ed74b8209df7, succeeded, 3.3 min (estimate 8.1).

    Results against the acceptance list

    • Same frame count: pass. The splice writes 430 frames, the same as the source.

    • Seams outside the repaired span unchanged: pass. assess_output(probe=analyze_seams) on seam 1 (segment 1 | segment 2) gives level_step 3.05 → 3.06 dB, frame_delta 3.18 → 3.15, jump_ratio 1.35 → 1.35. That is encode noise. Segments 1–2 keep the same start frames and sample counts.

      • Note: the repaired span is start_frame 226, num_frames 114, and segment 4 becomes start_frame 340, num_frames 90, trim_frames 12. So 12 frames at the head of segment 4 are replaced, and the seam moves from 13.667 s to 14.167 s. I'm reading this as the tail hold re-rendering into segment 4, as designed. If the plan promised only segment 3's own 102 frames would change, this is a second failure.
    • Repaired seams recorded as chain seams: pass. The shots read segment 3 (repaired). Both seams carry crossfade_ms: 3.0, and analyze_seams names them segment 2 | segment 3 (repaired) and segment 3 (repaired) | segment 4. The source's seam-3 seam_level_step warning of 5.7 dB is gone; it is now 2.12.

    • segment: 1 refused: pass. validate_workflow returns arguments.segment: 'segment' is 1 ... must be at least 2, before anything loads.

    • Out-of-range segment refused: pass. segment: 9 passes validate but the run refuses it: job 4ff131d0a43f failed in 2.5 s at chain_repair_cut with 'segment' must be 2 to 3 of this 4-segment chain, got 9 ..., before any render.

    • A take without keep_segments refused, naming the fix: FAIL. The run is refused before the render, but the error names the wrong fix. I used repair-segment {chain_take: output:templates/minimax/chained-segments/20261107-144311-ee63cf23/final/MiniMaxH3I2VChained-chained_keyframe_to_video_audio.0-0.0.mp4, segment: 2, seed: 31207} in workspace bench. That is job dabd85f4630d, a chained-segments run with no keep_segments. The run is job 2620b0dd685a, which failed in 0.5 s:

      chain_repair_cut: MiniMaxH3I2VChained-chained_keyframe_to_video_audio.0-0.0.mp4's shots name no segment files (a chain run before they were recorded, or a take copied away from its run) - pass 'chain_output', one of its segment files, as well

      A take run without keep_segments has no segment files to pass, so "pass chain_output" can't be followed. The message never mentions keep_segments. Expected: the refusal says to re-run the chain with keep_segments: true, and keeps the chain_output advice for the copied-away case only. validate_workflow also accepts this take as valid, so the refusal only comes at run time. That is acceptable, since nothing renders first.

    • VRAM within the estimate: inconclusive over MCP. The memory events for ed74b8209df7 don't report a peak. The closest reading, taken right after denoise (seq 38), is gpu_memory_reserved_mb 14966, well under the 19.95 GiB bench estimate. I can't confirm the true peak from what the events expose.

    • match_audio take keeps its whole source track (R31): not run. I skipped it in this pass because the check above already fails; it needs to be run on the next verify.

    To fix: the no-segment-files refusal in chain_repair_cut should tell a take with no kept segments apart from one copied away from its run, and name keep_segments: true for the first.

  2. added
    owner:leadFeature lead's turn (harnest R11)
    owner:donParked for human decision
    status:needs-approvalParked pending a written proposal + human approval
    and removed
    owner:leadFeature lead's turn (harnest R11)
    on Nov 7, 2026
  3. dkackman commented on Nov 7, 2026

    @dkackman
    OwnerAuthor

    unstrand: Don — this is a stage of #1199 (its body says "Stage of #1199"), but GitHub has no sub-issue parent link on it, so lib/classify.jq reads "stage with no parent" and no queue picks it up. Labels alone can't fix that: the link needs a sub-issue write, which this loop can't make. Separately, the tester bounced it to the lead with a failed acceptance point, and the parent #1199 sits with owner:tester + status:fixed-pending-verify, so even linked it would wait on #1199 rather than reach a lead build.

    Readings:

    Same call for #1205, #1206, #1207, #1208, #1209, #1211 and #1214.

    Unstranded by model claude-opus-5-5 via provider anthropic.

    Decision for Don: do the bounced #1199 stages go back to the lead (link them under #1199) or to the implementer loop as bugs?
    Kind: record Default: reading A: link each as a sub-issue of #1199, return #1199 and the stages to owner:lead
    If otherwise: reading B: relabel each bug + owner:implementer, no status, with a backend: label Reversible: yes

  4. added
    bugSomething isn't working
    and removed
    owner:donParked for human decision
    on Nov 7, 2026
  5. 20 remaining items

  6. dkackman commented on Nov 7, 2026

    @dkackman
    OwnerAuthor

    triage: work — bounced verify: a take copied away with keep_output (asset:) gets 'segment file ... is gone'; chain_repair_cut should detect segment files not beside the take and ask for chain_output. Message-only change in dw/tasks/chain_repair.py; the match_audio R31 case is still unverified. (implementer, claude-opus-5-5 via anthropic)

  7. added a commit that references this issue on Nov 7, 2026
  8. dkackman commented on Nov 7, 2026

    @dkackman
    OwnerAuthor

    Fix for the bounced copied-away case, by model claude-sonnet-5-5 via provider anthropic.

    repair-segment with a chain_take that was copied away from its run (e.g. keep_output to an asset:), where the take's shots name segment files that are not beside it and no chain_output is given: it now refuses before any render with " was copied away from its run - its segment files are not beside it; pass 'chain_output', one of the chain's kept segment files, as well". Before, it said the segment file "is gone". The "is gone" message no longer exists: a given chain_output is read for its siblings and a missing one fails there. The no-keep_segments and already-repaired refusals are unchanged. Message-only; no new surface.

    Commit ad58b0c6 (rebased as part of develop at 0c3d1b9), deployed to lem 21:25 UTC, healthy. The match_audio R31 case is still unverified; it runs on verify.

  9. added a commit that references this issue on Nov 7, 2026
  10. dkackman commented on Nov 7, 2026

    @dkackman
    OwnerAuthor

    Architecture review queued by the loop driver: this hand-off changed dw/ or dw_mcp/ on develop (4c497de5c3..ac94b0b950: dw/server/api_models.py dw/server/routes/media.py dw/tasks/chain_repair.py dw/tasks/timeline_export.py dw_mcp/tools_catalog.py). The reviewer checks it against docs/ARCHITECTURE.md before the tester verifies.

  11. dkackman commented on Nov 7, 2026

    @dkackman
    OwnerAuthor

    arch-review: pass, no findings. Reviewed by model claude-opus-5-5 via provider anthropic.

    Read: git diff 4c497de5..ac94b0b9 -- dw/ dw_mcp/. The #1207 commit is 0c3d1b91, which touches only dw/tasks/chain_repair.py (+7/-4). The other commit in the range, 92dfffe0 (#1254), is not this issue's and I didn't review it here. I checked the change against docs/ARCHITECTURE.md and item 3 of stage-c-guardrails.md:

    Nothing was waived (no arch-approved). The issue goes on to the tester's verify: the copied-away asset: case, plus the match_audio R31 case, which still hasn't been run.

  12. dkackman commented on Nov 7, 2026

    @dkackman
    OwnerAuthor

    Verify of #1207 (copied-away refusal fix 0c3d1b91, plus the outstanding match_audio R31 case) on lem develop @ 0258d35, by tester claude-opus-5-5 via provider anthropic. Verified.

    No suite case carries pending: #1207, so there was no pending case to run or un-pend. Every run below was validated first and acknowledged at its bound fingerprint.

    Refusals (all templates/minimax/repair-segment, seed: 31207, each failed in chain_repair_cut before any render):

    1. Copied-away take (the bounced repro): pass. Workspace default, chain_take: asset:verify-1207-copied-take.mp4, segment: 2 → job d73f77e6e22f:

      chain_repair_cut: verify-1207-copied-take.mp4 was copied away from its run - its segment files are not beside it; pass 'chain_output', one of the chain's kept segment files, as well

    2. No keep_segments (the original repro): still passes. Workspace bench, the 20261107-144311-ee63cf23 take, segment: 2 → job 7ae621c4954b: ... was run without keep_segments ... re-run the chain with 'keep_segments: true' (and save_segments), then repair that take.
    3. segment: 1: refused at validate (arguments.segment: must be at least 2).
    4. Too-short render (seen along the way): a 122-frame segment at the default 175 frames → job d3d9ce9cb7e3, refused before render: 'num_frames' 175 cannot hold segment 2 (122 frames) between a 22-frame head and a 39-frame tail guide - pass num_frames=192. Clear, and it names the fix.

    match_audio R31 case: pass.

    • Source: templates/minimax/chain-matched-to-audio, keep_segments: true, seed: 31207 → job 5545ff9ea47c (23.8 min, est. 19.8): 3 segments (124/122/18 frames), 264 frames, 11.0 s, each shot carrying a segment_file.
    • Repair: chain_take: output:<that take>, segment: 2, num_frames: 192 → job dc2bf57f67a6, succeeded in 6.9 min (est. 8.9).
    • Frame count: 264 → 264. Duration 11.0 s, audio 485100 samples at 44.1 kHz stereo on both.
    • Manifest shots: segment 1 (0, 124), segment 2 (repaired) (124, 131, trim_frames: 22), segment 3 (255, 9, trim_frames: 9). The repaired seam is recorded as a chain seam; analyze_seams reads shots_source: manifest and names segment 1→segment 2 (repaired) and segment 2 (repaired)→segment 3.
    • Source track kept: get_gallery_metadata(envelope=true, interval_seconds=0.5) on both. All 22 RMS bins agree within 0.04 dB, including bins 10–21 (5–11 s, the repaired span); e.g. bin 15 −35.82 vs −35.82, bin 9 −41.10 vs −41.11. Whole-file integrated LUFS −12.51 vs −12.53. pcm_sha256 differs (5cf82519… vs f1163eef…), which is consistent with one re-encode generation. The repaired segment's generated audio did not replace the take's track.
    • Seams: seam 1 stays at 5.167 s with the same audio either side (−40.58/−39.55 vs −40.57/−39.56 dBFS). The visual jump there changed (ratio 15.1 → 19.3), which is expected because that seam is the repaired span's head. Seam 2 moved from 10.25 s to 10.625 s because the 39-frame tail guide is longer than the 18-frame last segment, so with 3 segments no seam sits outside the span to compare. The 4-segment "unchanged outside the span" check is not re-run here.

    Not re-checked this session: the VRAM peak against the estimate (the bench evidence 46d9c4f4b1d7 covers it).

    Left behind: asset verify-1207-copied-take.mp4 and the two R31 runs, both in workspace default.

  13. added
    status:verifiedTester confirmed the fix via a real MCP call
    and removed on Nov 7, 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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions