Skip to content

Video core: low-priority hardening follow-ups from adversarial review of #125 #136

Description

@lstein

Adversarial review of #125 (feat/video-panel-02-core) surfaced these low-priority items. The one medium finding (accelerator flag drifting when a LoRA is removed) is already handled by setLoras + the mount reconciler introduced in #127, so only edge residue remains.

  1. Accelerator residue on reload after uninstall — if an accelerator LoRA is uninstalled between sessions, normalizeVideoSettings (features/video/core/settings.ts) clears acceleratorEnabled/acceleratorLoraKeys but keeps steps=4 / cfgScale=1 and leaves the surviving pair member as an ordinary user LoRA. Restore the model's sampling defaults there too (mirroring what setLoras does live).
  2. Prototype-chain lookup in the variant matrixbaseEntry.variants[variant] ?? baseEntry.fallback (videoPolicies.ts ~237) resolves "constructor"/"toString" variants to Object.prototype members and then throws on config.modes.includes. Use Object.hasOwn or a null-prototype object.
  3. findWanLightningLoraPair can mix families — high and low picks are independent (videoPolicies.ts ~459-465); with only [I2V High, T2V Low] installed it assembles a cross-family pair. Require both halves from the same family.
  4. Unsanitized variant token in new RegExp (videoPolicies.ts ~456): a variant containing a regex metachar makes the constructor throw. Escape the token.
  5. isValidWanNumFrames has no upper bound (dimensions.ts ~177) — accepts 165 despite WAN_NUM_FRAMES_MAX = 161. Masked because the exported isValidVideoNumFrames enforces the max; tighten the helper and its test anyway.
  6. Banker's-rounding test gap — the only half-case tested is 22.5→22 (even floor); a round-half-down regression would pass the suite. Add an odd-floor half case (e.g. one that snaps 23.5→24). (Implementation itself was fuzz-verified correct against Python round().)
  7. Stale cfgScale/steps across family switch when accelerator branch doesn't run (getVideoModelSelectionResult) — currently invisible+unvalidated for guidance-distilled H3; verify the graph builder never reads them in that state, or reconcile on switch.
  8. Unsupported H3 main gets WAN fallback config in getVideoDimensions — preview-only cosmetic coercion of '768 lowres''720p'; invocation is blocked by isSupportedVideoModel. Also: VideoSourceClip trim bounds are only validated by the backend node.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LUjUcPHzQCoL7dqgsVzi63

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions