Skip to content

fix(review): keep notes when restating a stale approval - #411

Draft
cursor[bot] wants to merge 1 commit into
developmentfrom
cursor/critical-bug-management-d13c
Draft

fix(review): keep notes when restating a stale approval#411
cursor[bot] wants to merge 1 commit into
developmentfrom
cursor/critical-bug-management-d13c

Conversation

@cursor

@cursor cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Resumen ejecutivo

Qué cambia

Tras Aprobar un take y regenerar la imagen de inicio, guardar notas en Production Review ya no falla. El desk reenvía tag_clip: good; el servidor ahora acepta restablecer una aprobación que ya existía y sigue bloqueando una aprobación nueva de un take stale o sin vídeo.

Para qué sirve

#406 dejó video_stale persistente para que Rejoin no arme un take que ya no coincide con el start frame. El desk, sin embargo, siempre reenvía la decisión actual junto con las notas. Rechazar ese good no-op tiraba el batch atómico y las notas se perdían.

Impacto para el usuario

Puede anotar un plano aprobado después de un rerun de imagen. Rejoin/export siguen bloqueados hasta regenerar el vídeo. No se puede aprobar por primera vez un take stale.

Riesgo

  • Bajo
  • Medio
  • Alto

Estado

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

Summary

After Approve + rerun_clip_image, the clip stays tag=good and video_stale=True. Production Review persist always sends select_take + tag_clip: good + note_clip. _apply_review rejected any good tag on a stale clip, so the atomic batch rolled back and notes never landed. Trigger: approve a completed take, rerun the start image, type notes and blur (or right-click compare). Workaround before this fix: Reject first.

Fix: treat restating an already-good tag as a no-op that is allowed on a stale clip. Still reject a new approval when the take is missing or stale. Rejoin/export continue to read video_stale independently.

Overview

  1. Director clip is approved (tag=good).
  2. Image rerun marks video_stale=True and keeps the tag.
  3. Desk persistCommandsFor restates tag_clip: good with notes/select.
  4. Server now accepts the restated tag, writes notes, leaves video_stale set.
  5. A first-time tag_clip: good on a stale/missing take still 400s and writes nothing.

Detailed changes

Backend

_apply_review in director_review.py: the stale/missing guard for tag=good now applies only when clip.tag != "good".

UI and Wizard

No runtime UI change. Unit test documents that notes persist restates tag: good on an approved+stale shot (the command shape the server must accept).

Data, provenance and compatibility

No migration. Checkpoints keep tag=good + video_stale=True after notes persist, matching test_review_notes_keep_a_stale_selected_take_stale.

Files and ownership

  • app/services/director_review.py — idempotent restated approval
  • tests/test_director_review.py — desk-shaped batch succeeds; new approval of stale still rolls back
  • ui/tests/productionReview.test.ts — desk command contract for approved+stale notes

Untouched: _select_take still clears stale when switching to a different take (documented as intended). Rejoin stale gate from #406 unchanged.

Validation

  • Date (UTC): 2026-09-12

  • Base SHA: 5da575a267fc8691c785d945d5a388fb9f43d931

  • Head SHA: bb11d1c3f2939c9e3ef287d30356c09f86081f7f

  • Validation scope: focused

  • python scripts/verify_clean_repo.py

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

  • Focused Python tests: /workspace/.venv/bin/python -m pytest tests/test_director_review.py -q11 passed

  • cd ui && npm run i18n:check

  • UI tests: npx tsx --test tests/productionReview.test.ts11 passed; tests/productionReviewRuntime.test.tsx14 passed

  • cd ui && npm run lint -- --max-warnings=0

  • cd ui && npm run build

  • git diff --check — clean

  • E2E/smoke checks: N/A — persist contract is covered by unit tests; no visual UI change

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

Switching to a different historical take still clears video_stale (_select_take / persist.ts). That behavior is covered by an existing projector test and was left unchanged.

Follow-up work

None.

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 

After Approve plus an image rerun the desk re-sends tag_clip:good with
notes. Rejecting that no-op dropped the whole atomic batch. Allow an
already-good tag to be restated while still blocking a new approval of a
missing or stale take.

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); +64/-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

  • low — UI changed — rebuild before merge
    Run cd ui && npm run build (CI already does this). Pinokio Update rebuilds for end users; keep ui/dist untracked.

Changed files

  • modified: app/services/director_review.py, tests/test_director_review.py, ui/tests/productionReview.test.ts

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.1 +0.0
File concentration 25% 73.7 +0.0
Oversized-file debt 20% 49.5 +0.0
Modularity 10% 88.3 +0.0

Change vs PR base: +0.0 points.

Metric Value
Production LOC 313,967
Production files 1,053
Test LOC 128,356
Functions measured 21,386
Functions complexity ≥ 15 908
Maximum complexity 674
Policy code-health-policy-v1
HEAD e601895d264fa7ea6ce7270e7163208018957848
Base 5da575a267fc8691c785d945d5a388fb9f43d931
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:13616 _run_video_generation
245 app/services/director_pipeline.py:7716 _run_pipeline
233 ui/src/features/agent/agentActions.ts:1152 Function 'parseAction'
226 app/services/director_pipeline.py:6545 update_comic_preview
225 ui/src/features/agent/agentActions.ts:2998 Async function 'executeAgentActions'

Trend vs baseline

Metric Δ
Production LOC +9
Test LOC +54
Functions ≥ 15 +0
Maximum complexity +0

Warnings

  • production LOC increased by +9

Ratchet 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.

1 participant