Skip to content

#1439 stage A: reference-prep probe (crop, backdrop blur) on H3 Ref2VA, record and verdict #1460

Closed

Description

@dkackman

Stage A of #1439. Filed by the lead agent, model claude-opus-5-5 via anthropic.

Plan: plan v2, section "Stage" (and Design 1-7), at #1439 (comment). The plan is authoritative; this restates it.

Builds (bench probe, no engine code, no new task or surface):

  • bench/blur_outside_mask.py: PIL + scipy, no new dependency. Grows the mask (default 12 px), feathers it (gaussian sigma 6), blurs the crop (sigma 20), and composites the sharp crop over the blurred one through the feathered mask. Usage goes in its docstring, like bench/erode_mask.py.
  • bench/workflows/probe-1439-refprep.json: the arms as arguments. Masking (segment, Grounding-DINO + SAM2, prompt person) and scoring (analyze_face_drift, samples_per_shot: 16, as t26) may be separate runs.
  • bench/records/ref-prep-blur.md + .json in the house shape: issue, plan, date, server commit, settings, the arm-1 path taken, then clips[] with job/run ids, arm, seed, bleed label, SFace median/min.
  • Only if the verdict earns it: one line in plugins/dw/skills/minimax-h3/references/per-character.md, with the plugin version bumped as plugins/dw/README.md requires.

Arms: 1, the reference as it is; 2, a square recenter_crop around the mask bbox centre at about 1.75x the subject box's longer side (head and shoulders kept, per #1193); 3, the arm-2 crop with the backdrop blurred by the script.

Arm 1 source (Don's ruling, Design 4): first re-run the #484 / #487 known-bleed shot exactly (job, get_job_workflow, assets, prompt, seed) if its inputs are still on lem. Arms 2-3 prepare its portrait(s) and change nothing else. Confirm the bleed reproduces before arms 2-3. If it doesn't, record that as a finding. Fallback (inputs gone or no reproduction): the v1 gate with new busy-backdrop pictures on templates/minimax/reference-to-video at defaults, two fixed seeds, a second picture if the first shows no bleed, then "not reproduced; drop" with no arm-2/3 jobs. The record says which path ran.

GPU cap: about 1.5 h of lem GPU. Past it, stop and record what ran. Prepare only the leaking portrait if that keeps it inside the cap. If Grounding-DINO/SAM2 are missing on lem, stop and ask; don't download.

Scoring: SFace against the original, unprepared picture. Bleed is judged by eye on get_output_frames (frames 0, 12, 24, 48 + mid), labelled none / framing / backdrop / both. A difference below the 0.03 encode floor is a tie. The verdict follows plan Design 7.

Owes: ruff clean. pytest tests/test_plugin_skills.py passes if the skill changes. No unit tests for the bench script.

Deploy: none to the server (it runs at the current lem commit). Plugin-only if the skill line lands.

Passes when the record satisfies the plan's acceptance intent (every job id resolves over MCP as a completed run with the stated seed and references; arm-1 path named; arm-2/3 assets exist; frame labels agree; SFace reproduces within 0.01; segmenter, crop numbers, blur settings, the five missing tasks, GPU time and verdict stated) and every pending: #<this issue> case the tester writes passes.

Activity

  1. added
    featureWork bigger than a fix: designed with Don, built in stages (harnest R11)
    owner:leadFeature lead's turn (harnest R11)
    stageA child issue: one stage of a feature
    on Nov 19, 2026
  2. dkackman commented on Nov 19, 2026

    @dkackman
    OwnerAuthor

    Progress (Claude Opus 5.5, claude-opus-5-5, provider anthropic): branch feat/1439-A-refprep-blur, pushed (bench/blur_outside_mask.py, bench/workflows/probe-1439-refprep.json).

  3. added 2 commits that reference this issue on Nov 19, 2026
  4. dkackman commented on Nov 19, 2026

    @dkackman
    OwnerAuthor

    Hand-off (Claude Opus 5.5, claude-opus-5-5, provider anthropic).

    What shipped:

    • merged into develop @ 44126e05;
    • branch feat/1439-A-refprep-blur: 84467523 (the script and the probe workflow) and c32ec17f (the record).
    • No deploy. The stage is bench-only and has no engine code; lem stays at 603649f1.

    Outcome: not reproduced at one reference; drop. No arm-2/3 jobs ran and no skill line lands. That is the plan's fallback branch.

    Plan items:

    • bench/blur_outside_mask.py:
      • reads IMAGE, MASK and OUT, with --grow 12, --feather 6 and --blur 20;
      • binarizes the mask at 128 and requires it to be the picture's size;
      • composites alpha*sharp + (1-alpha)*blurred;
      • is ruff clean. No unit tests, per the plan.
    • bench/workflows/probe-1439-refprep.json: composes templates/minimax/reference-to-video at its defaults, with prompt, subject (the arm) and seed as arguments.
    • bench/records/ref-prep-blur.md + .json:
      • Header: issue, plan v2, date, server commit and settings.
      • Arm-1 path: the fallback, and why.
      • clips[]: job and run ids, arm, seed, bleed label, and SFace median/min.
      • Also named: the segmenter, the crop and blur settings, the five missing tasks, GPU time against the cap (about 16 of 90 min), and the two-character pair as a follow-up.
    • Skill line: not added, because the verdict is drop. plugins/dw is unchanged, so tests/test_plugin_skills.py doesn't apply.

    Results. Four arm-1 clips: two pictures by two seeds (14391, 14392). The bleed label is none on all four, judged at frames 0/12/24/48/62. SFace median/min against the original pictures:

    Picture Seed Job SFace median / min
    grocer 14391 bee9c7bccd1c 0.211 / 0.120
    grocer 14392 57c092b9464e 0.179 / 0.058
    market 14391 432ef37f69cd 0.222 / 0.042
    market 14392 c58224e7a012 0.191 / 0.049

    The scores are low because the face is small in the full-figure wide shot.

    Deviations from the plan:

  5. added and removed
    owner:leadFeature lead's turn (harnest R11)
    on Nov 19, 2026
  6. dkackman commented on Nov 19, 2026

    @dkackman
    OwnerAuthor

    Architecture review queued by the loop driver: this hand-off changed dw/ or dw_mcp/ on develop (603649f184..88cb46d97b: dw/model_use.py dw/plan_downloads.py dw/server/admission.py dw/server/api_models.py dw/server/job_record.py dw/server/jobs.py dw/server/routes/jobs.py dw/server/routes/library.py ). The reviewer checks it against docs/ARCHITECTURE.md before the tester verifies.

  7. dkackman commented on Nov 19, 2026

    @dkackman
    OwnerAuthor

    Architecture review: pass (reviewer, model claude-opus-5-5 via anthropic).

    Read git log 603649f1..88cb46d9, filtered first to dw/ and dw_mcp/ and then to commits naming #1460. I checked the result against docs/stabilization/harness/stage-c-guardrails.md item 3.

    No arch-approved waiver was needed. Ownership stays with the tester for verification.

  8. added
    status:verifiedTester confirmed the fix via a real MCP call
    and removed on Nov 19, 2026
  9. dkackman commented on Nov 19, 2026

    @dkackman
    OwnerAuthor

    Verified. Tester: claude-opus-5-5 via anthropic. lem runs develop @ 603649f. Every check below is an MCP call I made this session in workspace bench.

    Repro and stage acceptance (cases marked pending: #1460):

    • M-F434: pass.
      • All four clips succeeded: bee9c7bccd1c (grocer, 14391), 57c092b9464e (grocer, 14392), 432ef37f69cd (market, 14391) and c58224e7a012 (market, 14392).
      • get_job_workflow on each shows templates/minimax/reference-to-video receiving only prompt, subject and seed. Everything else is the template default.
      • The prompt is a wide empty beach at dusk, a different setting from both backdrops.
      • list_jobs(bench) holds only the two FLUX pictures, the four clips and the four scoring jobs. There are no segment, crop, arm-2/3 or pair jobs.
    • M-F435: n/a. The gate failed, so arm 1 had no bleed and no arm-2/3 pictures exist. list_assets(prefix="bench/1439/") returns only grocer.jpg and market.jpg.
    • M-F436: pass.
      • get_output_frames at frames 0, 12, 24 and 48 on all four clips shows one figure on an open beach.
      • None of the frames shows any grocery-shop or night-market backdrop, and none copies the portrait's framing. That agrees with the label none on all four.
      • assess_output on each clip reports no findings except the known full_scale warning (+0.78 dBFS) on 432ef37f69cd, which is audio only.
    • M-F437: pass.
      • Scoring job dde677150e51 ran analyze_face_drift against asset:bench/1439/grocer.jpg (the original picture) with samples_per_shot: 16. It gives median 0.211 and min 0.12 over 16/16 faces, matching the record.
      • I re-scored market seed 14392 (job 10ee2694f376). It gives median 0.191 and min 0.049, an exact match to the record. I deleted the re-score afterwards with delete_output(job_id=...).
    • M-F438: pass.
      • Exactly two pictures, each run at the same two seeds, all labelled none, and no arm-2/3 jobs.
      • The four clips used roughly 16 GPU minutes in total, well within the ~90-minute cap.
    • M-F439: pass for what MCP can show.
      • The verdict is drop, which follows the Design 7 rule: no bleed in arm 1 means drop.
      • list_tasks has no blur, composite, mask-grow or mask-box-crop task. Only the existing segment, recenter_crop and crop_face_track are there.
      • The record's own wording (segmenter, crop numbers, blur settings, the five missing tasks) is a bench record file I can't read over MCP, so that part rests on the hand-off.
    • M-F440: pass.

    I removed the pending: #1460 lines from M-F434 through M-F440.

    Caveat for whoever reads the SFace numbers: the re-score's notes say market.jpg "holds 3 faces; the largest was used". The market picture isn't a single-face portrait, so its similarity scores are against the largest face. That doesn't change the bleed labels or the drop verdict.

  10. added a commit that references this issue on Nov 19, 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

    featureWork bigger than a fix: designed with Don, built in stages (harnest R11)owner:testerTester's turn to actstageA child issue: one stage of a featurestatus:verifiedTester confirmed the fix via a real MCP calltarget:lem

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions