Skip to content

Fix review/rejoin treating a selected stale take as current - #409

Merged
IAnMove merged 1 commit into
cursor/critical-bug-management-48e0from
cursor/critical-bug-management-stale-selected
Sep 12, 2026
Merged

Fix review/rejoin treating a selected stale take as current#409
IAnMove merged 1 commit into
cursor/critical-bug-management-48e0from
cursor/critical-bug-management-stale-selected

Conversation

@cursor

@cursor cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Resumen ejecutivo

Esta primera sección está pensada para project managers y revisores no técnicos. Mantén el detalle técnico completo más abajo.

Qué cambia

Si el director ya había elegido una toma y luego regenera el fotograma inicial, guardar una nota o pulsar Rejoin ya no trata ese vídeo viejo como actual.

Para qué sirve

Evita montar la película final con un plano que ya no corresponde a la imagen de partida.

Impacto para el usuario

Rejoin y el guardado de revisión siguen respetando la toma elegida para reproducirla, pero piden regenerar el vídeo cuando esa toma quedó obsoleta.

Riesgo

  • Medio
  • Bajo
  • Alto

Estado

  • Listo para revisión
  • En desarrollo
  • Bloqueado por CI o revisión
  • Requiere migración o acción manual

Summary

_backfill_clip_video_attempts promoted selected_video_filename to video_filename and also set video_stale=False. That is correct for playback authority, but it erased an intentional stale mark after rerun_clip_image.

load_pipeline_state (GET, Rejoin) and _update_saved_pipeline (prompt edits; also the projection #406 now persists) then treated the old take as current. Rejoin assembled a movie whose start frame no longer matched the video.

The backfill still uses the selection for playback. It no longer clears video_stale. Explicit take changes (_select_take, select_clip_video_attempt, video rerun) still set video_stale=False.

Overview

  1. User reruns a clip video (this writes selected_video_filename).
  2. User reruns the start image → disk has video_stale=True while the selected take remains.
  3. Opening the desk, saving notes, or clicking Rejoin loaded the projection and cleared stale.
  4. Rejoin concatenated the outdated take against the new still.

After this change, step 3 keeps video_stale=True and Rejoin refuses until the video is regenerated.

Detailed changes

Backend

  • app/services/director_pipeline.py: when a selected take exists, copy it to video_filename only.

UI and Wizard

Unchanged. The desk already keeps stale when re-persisting the current take (re-persisting the current take does not clear a stale clip).

Data, provenance and compatibility

No migration. Existing checkpoints that already lost video_stale stay as they are; new loads no longer drop a present flag.

Files and ownership

  • app/services/director_pipeline.py — root-cause one-liner in the GET/persist projection.
  • tests/test_director_cancellation.py — Rejoin + notes persist with selected+stale.
  • tests/test_director_review.py — review notes keep stale and the existing approval tag.
  • Left untouched: _select_take / video rerun still clear stale when the user picks or generates a new take.

Validation

  • Date (UTC): 2026-09-12

  • Base SHA: 60e867a

  • Head SHA: acf3c51

  • Validation scope: focused

  • python scripts/verify_clean_repo.py — PASS

  • python -m compileall -q app/services/director_pipeline.py app/services/director_review.py — PASS

  • Focused Python tests: pytest -q tests/test_director_review.py (5 passed) and test_rejoin_rejects_stale_video_even_when_a_take_is_selected plus image-rerun / history-rejoin cases (all passed)

  • cd ui && npm run i18n:check — N/A (no UI files)

  • UI tests — N/A

  • cd ui && npm run lint -- --max-warnings=0 — N/A

  • cd ui && npm run build — N/A

  • git diff --check — PASS

  • E2E/smoke checks: N/A — no video generation; temp files and mocked concatenate only

Code quality

  • Score: pending CI
  • Complexity trend: pending CI
  • Production LOC trend: pending CI
  • Regression versus main: pending CI
  • Ratchet: pending CI

CI and review

  • CI of this HEAD: pending

  • Independent agent review of this HEAD: pending

  • Human merge click (operational, not code review): pending

  • Reviewed at current HEAD

  • Earlier review; HEAD has changed since (stale)

  • Pending

  • Unavailable

Coste de la tarea

  • Tests simulados: 0 tokens externos
  • Tests reales: N/A
  • Llamadas LLM externas: 0
  • Tokens de prompt: N/A
  • Tokens de respuesta: N/A
  • Tokens totales: N/A
  • Generaciones de imágenes/audio/vídeo: 0
  • Tiempo transcurrido: N/A
  • Proveedores/modelos: N/A

Notes and limitations

Does not restore video_stale on checkpoints that already persisted false after a notes save on #406 or a prompt edit. Does not change the rule that choosing a different take clears stale.

Follow-up work

  • #406 still awaits review (sidecar-recovered takes). This fix is on development so that PR inherits it when it rebases or when both merge.
  • #405 (Approve after notes blur) and #408 (cut-paper mouth before first word) remain open; not this bug.

Checklist

  • The executive summary is understandable without reading the code.
  • The detailed Summary/Overview has not been removed or shortened.
  • Tests and their actual results are recorded.
  • Generated assets, secrets and local-only files are not committed.
  • Required CI and Cursor/Bugbot review are complete, or the PR is clearly marked as waiting for them.
Open in Web View Automation 

Backfill used a Studio selection as playback authority and also cleared
video_stale. After an image rerun the selected take no longer matches the
new start frame, but load, prompt edits, and review persist then let Rejoin
assemble that outdated video.

Keep the selection for playback and leave video_stale for callers that
gate export.

Co-authored-by: ignaciodelcano+dcl <ignaciodelcano+dcl@gmail.com>
@github-actions

Copy link
Copy Markdown

PR Review — Loreframe Studio

Risk: low
Scope: 3 file(s); +65/-1; backend services

Automated review from scripts/analyze_pr.py. This is a heuristic pass (no LLM) so humans still own the merge decision.

Findings

  • No heuristic issues. Still run the CI checklist below.

Changed files

  • modified: app/services/director_pipeline.py, tests/test_director_cancellation.py, tests/test_director_review.py

CONTRIBUTING checklist

  • python scripts/verify_clean_repo.py
  • python -m compileall -q app/services app/launch.py scripts
  • cd ui && npm run build if the UI changed
  • No weights, CivitAI sidecars, or generated guides
  • Stays local-first (no required accounts / telemetry)

Posted by the repo PR review workflow. Re-runs on each push to the PR.

@github-actions

Copy link
Copy Markdown

Code health

Quality score: 63.8/100

Higher is better. The score is a trend dashboard; the independent ratchet below remains the CI gate.

Component Weight Current Change
Cyclomatic health 45% 59.2 +0.0
File concentration 25% 73.7 +0.0
Oversized-file debt 20% 49.4 +0.0
Modularity 10% 88.3 +0.0

Change vs PR base: +0.0 points.

Metric Value
Production LOC 313,652
Production files 1,052
Test LOC 127,872
Functions measured 21,367
Functions complexity ≥ 15 906
Maximum complexity 674
Policy code-health-policy-v1
HEAD 3cdfd27c6ad71538f02fedcd9e85cf918f77a7cb
Base 60e867a6aae832d5b56c5ebd44b99867bda55b26
UI measurement complete

Markdown, JSON catalogs and tests are out of this table. Only app/ runtime + ui/src TS/JS count.

Most complex functions

Complexity Where
674 app/wgp.py:7230 generate_video
382 ui/src/stores/useStore.ts:4129 Async method 'startGeneration'
355 app/_launch_runtime.py:23674 _run_generation
308 app/wgp.py:12372 generate_video_tab
269 ui/src/components/Sidebar/SceneAnimatorPanel.tsx:508 Function 'SceneAnimatorPanel'
264 ui/src/stores/useStore.ts:8684 Async method 'loadSettingsFromOutput'
258 app/services/director/planners/short_film.py:3433 ShortFilmPlanner._plan_story_driven
248 app/services/director_pipeline.py:13614 _run_video_generation
245 app/services/director_pipeline.py:7714 _run_pipeline
233 ui/src/features/agent/agentActions.ts:1152 Function 'parseAction'
226 app/services/director_pipeline.py:6543 update_comic_preview
225 ui/src/features/agent/agentActions.ts:2998 Async function 'executeAgentActions'

Trend vs baseline

Metric Δ
Production LOC +2
Test LOC +62
Functions ≥ 15 +0
Maximum complexity +0

Warnings

  • production LOC increased by +2
  • hotspot app/services/director_pipeline.py increased by +2 lines

Ratchet passed.

@IAnMove
IAnMove changed the base branch from development to cursor/critical-bug-management-48e0 September 12, 2026 18:42
@IAnMove
IAnMove merged commit 35806db into cursor/critical-bug-management-48e0 Sep 12, 2026
12 checks passed
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.

2 participants