Skip to content

fix(wizard): no silenciar preguntas con qué o por qué - #274

Closed
cursor[bot] wants to merge 1 commit into
developmentfrom
cursor/fix-wizard-que-word-boundary
Closed

fix(wizard): no silenciar preguntas con qué o por qué#274
cursor[bot] wants to merge 1 commit into
developmentfrom
cursor/fix-wizard-que-word-boundary

Conversation

@cursor

@cursor cursor Bot commented Sep 9, 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

El Wizard vuelve a mostrar la respuesta del modelo cuando alguien pregunta «¿Qué son las colecciones?» o «¿Por qué falló?». Antes sustituía esa respuesta por «No se ha ejecutado ninguna acción».

Para qué sirve

Tras el PR #270, las preguntas informativas en español con qué / por qué (las más habituales) no se reconocían. El chat mentía al usuario y ocultaba la explicación.

Impacto para el usuario

Las preguntas con qué y por qué conservan la respuesta. Un turno mixto («¿Qué son…? Crea …») sigue fallando cerrado si no hubo acción real.

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

allowsExplanation() in wizardTurnReport.ts used JS \\b after qu[eé]. In JavaScript, \\b is ASCII-only, so é is not a word character and «Qué son…?» / «Por qué…?» never matched. formatWizardTurnReply then treated a valid informational turn as empty and replaced the model reply with noActionReceipt.

AgentAssistantPanel passes the user question into formatWizardTurnReply, so this is the live Wizard path. English What and Spanish Cómo / Dónde / Cuál still worked (they end on ASCII letters). Unaccented Que / Por que also worked, which hid the bug from the existing tests.

Trigger: user asks ¿Qué son las colecciones? or ¿Por qué falló la generación? with no actions. Model returns an explanation. UI shows «No se ha ejecutado ninguna acción en este turno».

Fix: fold diacritics with the same NFD + \\u0300-\\u036f strip already used in agentActions / story helpers, then apply the existing regexes.

Mixed turns with a delimiter (Qué son las colecciones? Crea una llamada Nightwatch.) still fail closed.

Overview

PR #270 added a conservative presentation policy so model prose cannot certify action-bearing turns. The allowlist for informational questions missed accented qué because of ASCII \\b. This change only fixes that classifier input; it does not widen the mixed-turn guard or change execution.

Detailed changes

Backend

No backend changes.

UI and Wizard

  • ui/src/features/agent/wizardTurnReport.ts: normalize accents before allowsExplanation.
  • ui/tests/wizardTurnReport.test.ts: lock Qué / Por qué informational replies and a mixed Qué …? Crea … fail-closed case.

Data, provenance and compatibility

No persistence, workspace, or schema changes.

Files and ownership

Validation

  • Focused UI tests: cd ui && npx tsx --tsconfig tsconfig.app.json --import ./tests/setupI18n.ts --test tests/wizardTurnReport.test.ts — 16/16 pass
  • Live formatWizardTurnReply cases: Qué / ¿Qué / Por qué keep the model reply; mixed Crea still emits noActionReceipt
  • git diff --check
  • python scripts/verify_clean_repo.py — N/A (UI-only)
  • python -m compileall — N/A
  • cd ui && npm run i18n:check — N/A (no catalog changes)
  • cd ui && npm run lint -- --max-warnings=0 — not rerun in this pass
  • cd ui && npm run build — not rerun in this pass
  • E2E/smoke checks: N/A (classifier unit + direct function output)
  • Validation scope: fast

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
  • Cursor/Bugbot of this HEAD: pending
  • Independent agent review of this HEAD: pending
  • Human merge click (operational, not code review): pending

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 change how-to / resume / cancel classifiers (open PRs #272, #273). Does not treat undelimited mixed English (What are collections create Nightwatch) as action-bearing; that remains the existing delimiter policy.

Follow-up work

None required for this classifier. Existing open fixes: #263 (CAS sibling drop), #269 (DramaBox duration 0→1s), #272 (how-to vs resume), #273 (para vs parar).

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 

Note

Low Risk
UI-only presentation classifier change with regression tests; no auth, execution, or persistence impact.

Overview
Fixes a Wizard presentation bug where accented Spanish questions (Qué, por qué) were misclassified as non-informational turns, so formatWizardTurnReply replaced the model’s explanation with the “no action executed” receipt.

allowsExplanation now folds diacritics (NFD + strip combining marks) before the existing regexes, because JavaScript \b is ASCII-only and broke word boundaries after é. Mixed turns (e.g. Qué son…? Crea…) still fail closed via the unchanged imperative guard.

Tests lock informational Qué / ¿Qué / Por qué replies and one mixed Spanish qué + crea case.

Reviewed by Cursor Bugbot for commit 2813671. Configure here.

JS word boundaries are ASCII-only, so accented qué/por qué never matched
the informational-turn allowlist and the Wizard replaced the model answer
with a false empty-turn receipt. Fold diacritics before the classifier.

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

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

PR Review — Loreframe Studio

Risk: low
Scope: 2 file(s); +8/-2; React UI

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: ui/src/features/agent/wizardTurnReport.ts, ui/tests/wizardTurnReport.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

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Code health

Quality score: 56.4/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% 55.1 +0.0
File concentration 25% 63.0 +0.0
Oversized-file debt 20% 39.1 +0.0
Modularity 10% 80.6 +0.0

Change vs PR base: +0.0 points.

Metric Value
Production LOC 270,177
Production files 785
Test LOC 99,255
Functions measured 17,905
Functions complexity ≥ 15 857
Maximum complexity 674
Policy code-health-policy-v1
HEAD c23fa9b9d054a0fa3eee2a4303101d5e5316dce0
Base edf93aa6298b4e9cc2169f818a96beb5a2d7011a
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:7221 generate_video
381 ui/src/stores/useStore.ts:4084 Async method 'startGeneration'
355 app/_launch_runtime.py:23613 _run_generation
308 app/wgp.py:12363 generate_video_tab
268 ui/src/stores/useStore.ts:8636 Async method 'loadSettingsFromOutput'
262 ui/src/components/Sidebar/SceneAnimatorPanel.tsx:496 Function 'SceneAnimatorPanel'
258 app/services/director/planners/short_film.py:3433 ShortFilmPlanner._plan_story_driven
248 app/services/director_pipeline.py:13607 _run_video_generation
245 app/services/director_pipeline.py:7712 _run_pipeline
244 ui/src/features/agent/agentActions.ts:1150 Function 'parseAction'
226 app/services/director_pipeline.py:6541 update_comic_preview
225 ui/src/features/agent/agentActions.ts:2924 Async function 'executeAgentActions'

Trend vs baseline

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

Warnings

  • production LOC increased by +1

Ratchet passed.

@IAnMove
IAnMove marked this pull request as ready for review September 9, 2026 14:25
@cursor

cursor Bot commented Sep 9, 2026

Copy link
Copy Markdown
Author

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_a84b4643-9df9-48dc-a19c-9710891c1864)

@IAnMove

IAnMove commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Superseded by #279, which applies this fix together with the other Cursor Wizard/Studio corrections on origin/development. Not merged from this branch.

@IAnMove IAnMove closed this Sep 9, 2026
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