Skip to content

test: separar validación local de smoke real - #131

Merged
IAnMove merged 5 commits into
mainfrom
feat/local-validation-and-smoke
Sep 4, 2026
Merged

test: separar validación local de smoke real#131
IAnMove merged 5 commits into
mainfrom
feat/local-validation-and-smoke

Conversation

@IAnMove

@IAnMove IAnMove commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Añade rutina local provider-free para pre-push y wrapper explícito para smoke real ACE/H3. Los E2E normales siguen simulados; la generación real requiere confirmación y nunca se ejecuta en CI. Incluye documentación y no toca launchers.


Note

Medium Risk
Large changes in _launch_runtime.py job routing and filesystem source resolution affect GPU tools and gallery metadata; boundaries are shared with existing rembg tooling but revoice voice-ref resolution and cancellation cleanup add regression surface.

Overview
Tools upscale now handles still images and videos through one API and worker. Requests resolve sources via the same confined asset/path rules as background removal (_resolve_tool_source + extended resolve_source), publish richer sidecars (lineage, capability, provenance), and route images through _upscale_tool_image with perform_spatial_upsampling(..., still_image=True) while videos keep the audio-preserving pipeline. Revoice reuses that resolver for video-only sources; cancel/ interrupt paths drop late upscale artifacts.

The Studio Tools UI switches image selection to a thumbnail grid (also used for upscale media), submits source / source_kind with provenance, and adds Playwright/unit coverage for upscale alongside remove-background updates.

Developer workflow: scripts/validate_local.sh runs contract pytest, UI test/lint/build, and simulated E2E without GPU or providers; run_real_media_smoke.sh gates real ACE smoke behind explicit env confirmation and is documented in LOCAL_VALIDATION.md.

CI / ratchet: PR code-health checks compare against the base commit report (--baseline from a worktree), hotspot per-PR allowance rises to 600 lines, and API.md documents the upscale contract.

Reviewed by Cursor Bugbot for commit 761ff95. Configure here.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

PR Review — Loreframe Studio

Risk: medium
Scope: 22 file(s); +1412/-187; GitHub workflows, React UI, backend services, docs, generation pipeline, repo scripts / CI

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

Findings

  • medium — Large pull request
    1412 additions / 187 deletions. Reviewers will have an easier time with smaller, focused PRs.
  • medium — Very large file change (app/_launch_runtime.py)
    app/_launch_runtime.py adds 628 lines. Consider splitting the PR.
  • 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

  • added: docs/development/LOCAL_VALIDATION.md, scripts/run_real_media_smoke.sh, scripts/validate_local.sh, tests/test_tools_upscale_contract.py
  • modified: .github/workflows/ci.yml, app/_launch_runtime.py, app/docs/API.md, app/services/generation_provenance.py, app/shared/tools/background_removal_request.py, app/wgp.py, docs/development/CODE_HEALTH.md, scripts/code_health.py, tests/fixtures/architecture_wire_inventory.json, ui/e2e/helpers/apiRoutes.ts, ui/e2e/specs/tools-background-removal.spec.ts, ui/src/api/generation.ts, ui/src/components/Sidebar/ToolsPanel.tsx, ui/src/components/Sidebar/ToolsSourcePanel.tsx, ui/src/i18n/locales/en/studio.json, ui/src/i18n/locales/es/studio.json, ui/src/stores/useStore.ts, ui/tests/toolsPanel.test.tsx

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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.

Fix All in Cursor

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: Revoice upload source resolution fails
    • runTool now forwards toolsSourceWorkspace (including uploads) on submitToolRevoice so confined resolve_source can find uploaded clips.
  • ✅ Fixed: Simulated tool sidecar omits tags
    • Simulated upscale/revoice sidecars now write edit_sub_mode and the concrete tool name, matching _write_tool_sidecar and the asset manifest origin.

Create PR

Or push these changes by commenting:

@cursor push 72060fd160
Preview (72060fd160)
diff --git a/app/_launch_runtime.py b/app/_launch_runtime.py
--- a/app/_launch_runtime.py
+++ b/app/_launch_runtime.py
@@ -23719,22 +23719,25 @@
         return False
     output_name = os.path.basename(generated_path)
     record_job_outputs(job, [output_name])
-    tool_job = str(params.get("_non_durable_tool") or "") in {"upscale", "revoice"}
+    tool_name = str(params.get("_non_durable_tool") or "")
+    tool_job = tool_name in {"upscale", "revoice"}
     sidecar_params = params
     if tool_job:
         # Simulation still exercises the real queue/task/manifest path, but
         # host filesystem paths and uploaded voice references must never enter
-        # the durable sidecar.
+        # the durable sidecar. Mirror _write_tool_sidecar so gallery filters
+        # and manifests see the concrete tool name plus edit_sub_mode.
         sidecar_params = {
             key: value
             for key, value in params.items()
             if not str(key).startswith("_")
             and key not in {"source_path", "video_path", "voice_ref_paths"}
         }
+        sidecar_params["edit_sub_mode"] = tool_name
     sidecar = {
         "params": sidecar_params,
         "generation_mode": params.get("generation_mode"),
-        "tool": "tools" if tool_job else None,
+        "tool": tool_name if tool_job else None,
         "capability": params.get("capability") if tool_job else None,
         "job_id": job.get("id"),
         "task_id": job.get("task_id"),
@@ -23749,7 +23752,12 @@
         sidecar["inputs"] = params.get("inputs") or []
         sidecar["parents"] = params.get("parents") or []
         sidecar["transformations"] = params.get("transformations") or []
-    _publish_generation_sidecar_for_studio_job(job, generated_path, sidecar)
+    _publish_generation_sidecar_for_studio_job(
+        job,
+        generated_path,
+        sidecar,
+        tool=tool_name if tool_job else "studio",
+    )
     if not finalize:
         return update_job(
             job,

diff --git a/ui/src/api/generation.ts b/ui/src/api/generation.ts
--- a/ui/src/api/generation.ts
+++ b/ui/src/api/generation.ts
@@ -292,6 +292,7 @@
   diffusion_steps?: number
   cfg_rate?: number
   workspace?: string
+  source_workspace?: string
 }): Promise<{ job_id: string }> {
   const res = await fetch(`${BASE}/api/v1/tools/revoice`, {
     method: 'POST',

diff --git a/ui/src/stores/useStore.ts b/ui/src/stores/useStore.ts
--- a/ui/src/stores/useStore.ts
+++ b/ui/src/stores/useStore.ts
@@ -3925,7 +3925,13 @@
           provenance: { actor: 'user' },
         })
         : tool === 'revoice'
-          ? await api.submitToolRevoice({ video_path: source, voice_ref_paths: refPaths, mode: s.toolsRevoiceMode, workspace: s.activeWorkspace })
+          ? await api.submitToolRevoice({
+            video_path: source,
+            voice_ref_paths: refPaths,
+            mode: s.toolsRevoiceMode,
+            workspace: s.activeWorkspace,
+            source_workspace: s.toolsSourceWorkspace || undefined,
+          })
           : await api.submitToolRemoveBackground({
             asset_id: s.toolsSourceAssetId || undefined,
             source,

You can send follow-ups to the cloud agent here.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 761ff95. Configure here.

Comment thread ui/src/stores/useStore.ts
method: s.toolsUpscaleMethod,
workspace: s.activeWorkspace,
provenance: { actor: 'user' },
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revoice upload source resolution fails

High Severity

runTool still submits revoice with only video_path and the active workspace, while tools_revoice now resolves through confined _resolve_tool_source. Uploaded clips are tagged __uploads__ in the panel but that scope never reaches the API, so a bare upload filename is looked up in the destination workspace and the request fails.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 761ff95. Configure here.

Comment thread app/_launch_runtime.py
"params": sidecar_params,
"generation_mode": params.get("generation_mode"),
"tool": "tools" if tool_job else None,
"capability": params.get("capability") if tool_job else None,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simulated tool sidecar omits tags

Medium Severity

Simulated upscale and revoice sidecars set tool to tools and never write edit_sub_mode, while the real worker publishes tool as upscale/revoice plus that gallery tag. Simulated tool outputs therefore classify differently from real runs.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 761ff95. Configure here.

Comment thread ui/src/stores/useStore.ts
method: s.toolsUpscaleMethod,
workspace: s.activeWorkspace,
provenance: { actor: 'user' },
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upscale result skips asset refresh

Low Severity

toolsAssetsRevision increments only after remove-background completes. A finished image upscale never refreshes the Tools library grid, so the derived PNG stays invisible as a source until the panel remounts.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 761ff95. Configure here.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Code health

Quality score: 49.0/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% 52.2 -0.3
File concentration 25% 53.6 -0.7
Oversized-file debt 20% 29.3 -0.1
Modularity 10% 62.4 -0.2

Change vs PR base: -0.3 points.

Metric Value
Production LOC 241,256
Production files 531
Test LOC 69,994
Functions measured 15,077
Functions complexity ≥ 15 784
Maximum complexity 667

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

Most complex functions

Complexity Where
667 app/wgp.py:7164 generate_video
374 ui/src/stores/useStore.ts:4021 Async method 'startGeneration'
355 app/_launch_runtime.py:23773 _run_generation
308 app/wgp.py:12281 generate_video_tab
271 ui/src/components/Sidebar/SceneAnimatorPanel.tsx:474 Function 'SceneAnimatorPanel'
266 ui/src/stores/useStore.ts:8563 Async method 'loadSettingsFromOutput'
258 app/services/director/planners/short_film.py:3433 ShortFilmPlanner._plan_story_driven
248 app/services/director_pipeline.py:13735 _run_video_generation
245 app/services/director_pipeline.py:7860 _run_pipeline
243 ui/src/features/agent/agentActions.ts:1109 Function 'parseAction'
226 app/services/director_pipeline.py:6689 update_comic_preview
225 ui/src/features/agent/agentActions.ts:2766 Async function 'executeAgentActions'

Trend vs baseline

Metric Δ
Production LOC +661
Test LOC +416
Functions ≥ 15 +5
Maximum complexity +0

Warnings

  • production LOC increased by +661
  • functions at complexity >= 15 increased by +5
  • complexity hotspot ui/src/components/Sidebar/ToolsPanel.tsx rose 19 -> 21
  • hotspot app/_launch_runtime.py increased by +526 lines
  • hotspot app/wgp.py increased by +7 lines
  • hotspot ui/src/stores/useStore.ts increased by +9 lines

Ratchet passed.

@IAnMove
IAnMove merged commit 94921fb into main Sep 4, 2026
6 checks passed
@IAnMove
IAnMove deleted the feat/local-validation-and-smoke branch September 5, 2026 11:52
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