Skip to content

Show actionable errors for invalid cartoon cuts.json #232

@realproject7

Description

@realproject7

Context

During the #211 pilot, the agent generated a custom plot-01.cuts.json schema. The current API correctly rejects invalid cut files through validateCutsFile, but the user-facing cartoon workspace needs to make this failure obvious and actionable instead of leaving the user with an empty or confusing preview/editor state.

Parent epic: #197. Blocks #211 pilot approval.

Task

Improve UI/API handling for invalid cartoon plot-NN.cuts.json files.

Files to inspect/update:

  • app/routes/stories.ts
  • app/lib/cuts.ts
  • app/web/components/CutListPanel.tsx
  • app/web/components/PreviewPanel.tsx
  • relevant tests under app/routes/*.test.ts and app/web/components/*.test.tsx

Requirements

  • When a cartoon plot has an invalid cuts file, surface the exact validation error in the UI.
  • Do not silently treat invalid cuts.json as “no cuts found”.
  • The error should tell the user/agent that plot-NN.cuts.json must follow the OWS v1 schema.
  • If there is a natural existing recovery action, expose it safely. Acceptable MVP recovery options:
    • show “Regenerate cuts.json using the v1 schema” guidance text, or
    • provide a guarded reset/recreate action only if it does not delete existing user-created assets or text without confirmation.
  • Keep fiction preview behavior unchanged.

Acceptance Criteria

  • Invalid plot-NN.cuts.json produces a visible, actionable error in the cartoon workspace.
  • Tests cover invalid JSON and wrong-schema JSON.
  • Existing valid cartoon cut flows still work.
  • Existing fiction flows still pass.
  • npm run typecheck and relevant tests pass.

Public Safety

Do not include private story content, secrets, wallet data, auth tokens, local absolute user paths, or Claude session IDs in tests/docs/issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agentbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions