Skip to content

[#232] Show actionable errors for invalid cartoon cuts.json#235

Merged
realproject7 merged 1 commit into
mainfrom
task/232-actionable-cuts-errors
May 28, 2026
Merged

[#232] Show actionable errors for invalid cartoon cuts.json#235
realproject7 merged 1 commit into
mainfrom
task/232-actionable-cuts-errors

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • CartoonPreview and CutListPanel now show an "Invalid cuts file" error with the exact validation message plus actionable guidance (must follow OWS v1 schema, ask Claude to regenerate using v1 cuts schema)
  • Missing files (404) still show "No cuts yet" — invalid files (400) are no longer silently treated as no cuts
  • No destructive reset action — guidance-only recovery per MVP safety requirement (does not delete user assets/text)
  • Fiction preview behavior unchanged

Test plan

  • npm run typecheck passes
  • npm run lint passes
  • npm run test passes (270 tests)
  • Invalid schema → visible actionable error with v1 guidance (both preview + cut list)
  • Invalid JSON → visible actionable error
  • Missing cuts (404) → "No cuts yet", not an error
  • Backend route: 404 missing, 400 invalid schema, 400 malformed JSON
  • Valid cartoon cut flows still work
  • Fiction flows unchanged

Closes #232

🤖 Generated with Claude Code

CartoonPreview and CutListPanel now show an "Invalid cuts file"
error with the exact validation message plus actionable guidance:
the file must follow the OWS v1 schema, and the user should ask
Claude to regenerate it using the v1 cuts schema. Missing files
(404) still show "No cuts yet" — invalid files (400) are no longer
silently treated as no cuts.

No destructive reset action added (guidance-only recovery, per MVP
safety requirement).

Tests: frontend invalid-schema and invalid-JSON error display with
v1 guidance, 404 still shows No cuts; backend route returns 404 for
missing, 400 with validation error for wrong schema, 400 for
malformed JSON.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@realproject7
Copy link
Copy Markdown
Owner Author

@re2 verdict: APPROVE

Reviewed:

Error display (CartoonPreview + CutListPanel):

  • Both preview-tab and edit-tab error states now show: "Invalid cuts file" heading + exact validation error + OWS v1 schema guidance ("Ask Claude to regenerate it using the v1 cuts schema").
  • data-testid="cuts-error" for testability.
  • Guidance ties back nicely to the v1 schema example added in [#231] Fix cartoon agent instructions to emit app-compatible cuts.json #234 — good cross-ticket coherence.

404 vs 400 distinction (already correct, now surfaced):

  • 404 (missing file) → "No cuts yet" (not an error) — unchanged.
  • 400 (invalid schema / malformed JSON) → actionable error. Previously showed a generic error; now actionable.

Recovery: Guidance-only, no destructive reset — correct per MVP safety requirement (no deletion of user assets).

Tests:

  • Backend route (3): missing → 404, invalid schema → 400, malformed JSON → 400 with "invalid JSON".
  • Frontend (5 across both components): invalid schema → actionable error + v1 guidance, invalid JSON → actionable error, 404 → "No cuts yet" not error.

Fiction preview unchanged. No issues found.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

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

Verdict: APPROVE

Summary

Invalid cartoon cuts files now surface visible, actionable OWS v1 schema errors in both preview and cut-list contexts, while missing cuts files still show the normal empty state. Backend tests cover missing, malformed JSON, and wrong-schema responses, and fiction behavior is not touched.

Findings

  • None.

Decision

Approved. The #232 acceptance criteria are met and lint-and-typecheck passed in CI.

@realproject7 realproject7 merged commit 7f75333 into main May 28, 2026
1 check 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.

Show actionable errors for invalid cartoon cuts.json

2 participants