Skip to content

fix(studio): forward route settings and guard stale AI results - #55

Merged
Unheat merged 2 commits into
mainfrom
fix/studio-route-parity
Nov 24, 2026
Merged

Unheat merged 2 commits into
mainfrom
fix/studio-route-parity

Conversation

@Unheat

@Unheat Unheat commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes Studio request handoff so page operations use the engine tiers the user actually selected, honors an explicit Disabled color tier, preserves generated-layout provenance, and keeps Studio engine state synchronized through the background-normalized popup state. Includes audited hardening from a follow-up bug/ROI scan (Local Only hydration, stale AI results, invalid Studio fetch/mask input, model-status completeness).

Issue

No linked issue — this came from a direct audit of Studio/offscreen route parity. Closes # (none).

Changes

  • Add resolveStudioOperationOverrides(); full-page retranslate and brush OCR now forward OCR/inpaint/translation tiers, and retranslate records the resolved IDs.
  • Add resolveStudioColorTier(); offscreen honors explicit colorTier: 'none' and the Color tool disables its action for Disabled.
  • Preserve textFromGeneratedLines through the Studio OCR response type and bridge.
  • Hydrate Studio engine selections through background GET_POPUP_STATE; subscribe to popup-state changes; skip hydration when syncWithGlobal is false (Local Only).
  • Guard StudioCanvas OCR/inpaint results against page switches (jobId ref), matching the existing colorize/retranslate guards.
  • Validate Studio colorize/inpaint image and mask fetches; a supplied mask that cannot be decoded now fails loudly instead of silently widening to a full-patch erase.
  • handleGetModelStatuses records false for rejected checks instead of omitting keys.
  • Docs: architecture note + docs/dev-history/devlog/120_phase120_studio_route_parity.md.

Testing

  • Automated unit tests pass (npm test) — 144 files / 1671 tests
  • Documentation gate passes (npm run docs:check) and architecture docs match the change
  • Production build succeeds (npm run build)
  • Linter passes (npm run lint) — 0 errors, 58 pre-existing warnings
  • (If touching backend worker) Worker checks pass (npm run worker:test) — N/A
  • Manual test in browser or Studio with sample manga panels — not performed in this session

Targeted PR1 repro suite: 5 files / 15 tests green. npm run gate:translation reports "no pipeline files changed" (verified after reverting an OCR debug-log touch).

Screenshots / Demo

N/A — logic/state fix, no visual redesign.

Notes for Reviewers

  • Stacked: PR2 will cover SFX-policy plumbing, typography-field parity, OCR catalog/default consolidation, and the AGENTS/coding-standards rule.
  • The new pre-push hook from swe-workflow flagged worker/.dev.vars.example as a secret (placeholder sk-or-v1-...), so this push used GIT_SWE_SKIP=1; the full suite was run manually. Worth fixing the hook's example-file exclusion separately.
  • runStudioOcr intentionally remains caller-owned; it is not merged into PipelineOrchestrator.

- Add resolveStudioOperationOverrides so full-page retranslate and brush
  OCR pass OCR/inpaint/translation tiers; retranslate records resolved IDs.
- Honor explicit colorTier 'none' in offscreen; disable Color tool action.
- Preserve textFromGeneratedLines provenance through Studio OCR responses.
- Hydrate Studio engine selections via GET_POPUP_STATE and subscribe to
  popup-state changes; respect syncWithGlobal (Local Only) during hydration.
- Guard StudioCanvas OCR/inpaint results against page switches.
- Validate Studio image/mask fetches; fail loudly instead of silent
  full-patch erase when a supplied mask cannot be decoded.
- Report false for rejected model status checks.
@Unheat
Unheat marked this pull request as ready for review November 24, 2026 01:02
@Unheat
Unheat merged commit 8c07741 into main Nov 24, 2026
6 checks passed
@Unheat
Unheat deleted the fix/studio-route-parity branch November 24, 2026 01:02
@Unheat
Unheat restored the fix/studio-route-parity branch November 24, 2026 01:03
@Unheat
Unheat deleted the fix/studio-route-parity branch November 24, 2026 01:07
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