Skip to content

feat([issue-3231]): route video renders per surface — videoGen.mode pin, per-target video defaults, Music Video render pins - #3237

Merged
atomantic merged 6 commits into
mainfrom
next/issue-3231
Jul 30, 2026
Merged

feat([issue-3231]): route video renders per surface — videoGen.mode pin, per-target video defaults, Music Video render pins#3237
atomantic merged 6 commits into
mainfrom
next/issue-3231

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

Phase 4 (final phase) of the render-target defaults registry: video renders now route through the same defaults system as images.

  • resolveVideoMode pin ladder — request → renderDefaults[target].videoMode → new install-wide settings.videoGen.mode → local, every rung usability-gated (a disabled grok pin degrades instead of failing). The rung list is enumerated once (videoPinRungs + hasVideoPin) so consumers can't drift from the resolver.
  • Video route honors the pin safely — only when body.backend is absent and the request shape is grok-deliverable; local-only machinery (semantic modes, keyframes, audio, IC refs, extend, LoRAs, last frame, chunks, a named local modelId) stays local rather than silently dropping inputs. The VideoGen page now sends its backend toggle explicitly so the pin can't reroute a Local render behind the UI.
  • Creative-agent video enqueues consult the target/install pins (project pin still wins); the target videoModel rides local resolutions. The byte-identical-when-auto contract holds via hasVideoPin.
  • Music Video — per-record imageMode/imageModelId pins (the shared universe/series/sprite field pair) resolved for scene-frame renders in prepareParams through the music-video render target; a RecordRenderPinRow on the director board edits them. New projects seed videoSettings.backend from the pin ladder (the board sends an explicit backend per clip, so creation is where the pin acts). The MV pins sync with the record like videoSettings already does — sanitizeProjectForSync spreads raw, so the fields are additive-safe with no schema bump.
  • Settings → Image Gen → Defaults — install-wide video backend pin plus per-surface video pins for Music Video and creative-agent (backend only: grok video has no model knob, and local video models are picked on each surface). music-video leaves the parity test's deliberately-unlisted set, emptying it.

No migration needed (pins persist only when set) and no sync schema bump (additive fields on whole-record-LWW kinds).

Closes #3231

Test plan

  • New server tests: resolveVideoMode ladder precedence/normalization/usability gating; video-route pin behavior (install pin routes, explicit backend wins, local-only machinery and named local models anchor local, disabled pin degrades); creative-agent video pin ladder + target videoModel; MV create-time seeding (target pin, install pin, explicit win, degrade, settings-failure); MV record pin persistence + patch clear; prepareParams MV resolution (record pin, target default, explicit-mode skip, missing project); settings videoGen/renderDefaults.videoMode slice validation.
  • New client test pins the exact videoGen save wire body (sibling defaultModelId round-trip — invisible to the server suite).
  • Full suites green: server 23519 passed, client 5468 passed. Reviewed by claude (3 findings fixed) + ollama (clean), plus a 4-angle quality pass.

… per-target videoMode, Music Video image lane

Phase 4 of the render-target defaults registry (#3231):
- resolveVideoMode gains the pin ladder: request -> renderDefaults[target].videoMode
  -> settings.videoGen.mode -> local, each rung usability-gated.
- The video route honors the pin when body.backend is absent, but only for
  grok-deliverable request shapes (local-only machinery stays local).
- Creative-agent video enqueues consult the target/install pins; the target
  videoModel rides local resolutions.
- Music Video: per-record imageMode/imageModelId pins (scene frames resolve
  through the music-video render target in prepareParams), and new projects
  seed videoSettings.backend from the ladder — the board sends an explicit
  backend per clip, so creation is where the pin can act.
- Settings: Defaults tab gains the install video backend pin and per-surface
  video pins for music-video/creative-agent (backend only — grok video has no
  model knob); music-video leaves the parity test's unlisted set.
…g list, cheaper MV resolution, shared schema/normalizer copies

- videoGen/modes.js owns the pin-rung enumeration (videoPinRungs + hasVideoPin);
  media.js gates on it instead of re-enumerating the ladder.
- prepareParams skips the MV project fetch when an explicit mode wins anyway,
  and passes the plain EXTERNAL fallback (the resolver already walks the
  install default).
- validation.js reuses emptyToNull and hoists one videoModePinSchema for both
  the per-target entry and settings.videoGen.mode.
- Client gets the normalizeRenderPinValue mirror in imageGenBackends.js;
  ImageGenTab keeps the round-trip videoGen slice in a ref, not state.
- grokDeliverable also keeps chunked renders local (chunks>1 was a day-one gap
  in the local-only machinery list).
…chor named-local-model requests local under a grok pin

The install-wide grok video pin could hijack renders that never chose grok:
the VideoGen page's local branch sent no backend field (the toggle showed
Local while the render went to grok, discarding model/frames/fps), and a
media requeue rebuilding a local render's config (modelId, no backend) lost
its model the same way. The page now sends backend:'local' explicitly and
the route treats a named modelId as local-anchoring machinery. Also pinned
the videoGen sibling-key round-trip in the client suite (the server test
alone could not see a dropped defaultModelId) and renamed the server test
to what it actually proves.
Main's CI has been red since the Phase 2 parity test landed: it imported
client/src/lib/imageGenBackends.js, whose top-level lucide-react import
cannot resolve in the server job (client packages aren't installed there),
and the unprotected-main auto-merges let the red slip through. The pure
constants + helpers now live in a dependency-free imageGenModes.js leaf
(re-exported flat by imageGenBackends so consumers keep one import site;
namespace-exported in the lib barrel to avoid identifier collisions) and
the parity test imports the leaf.
@atomantic
atomantic merged commit 04ec8b8 into main Jul 30, 2026
6 checks passed
@atomantic
atomantic deleted the next/issue-3231 branch July 30, 2026 16:34
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.

Route image and video renders per surface: a render-defaults registry plus per-record provider and model overrides

1 participant