MCP / Tools / Story Workflows / story_revision_run

story_revision_run

orchestrationbetaauth: project:writeapproval: suggeststatus: v1

Use when an existing story needs structural changes, connected planning/page revisions, dialogue polish, alternative directions, planning-to-pages comparison, or comparison between story alternatives. Scene-list changes and their related planning use scene_list_revision; connected card/page changes use planning_revision. Save exact agreed changes with story_mutate; request editorial feedback with story_review_run. Standalone paid generation requires quote and acceptance before Start with payload.billing_quote_id and payload.billing_request_id; preserve both IDs and the quoted payload on retries. Follow job_get's completion/finalize actions, review proposals, and apply only approved choices. Dependent page and outline proposals must be applied with their parent revision. Pairwise assessments run inside an accepted adaptive_revision allowance.

When to use

  • Structural source inspection: scene_list_revision source requires payload.revision_id and context_selection with planning_codes, proposed_page_ids and canonical_page_ids. Related planning uses card:<card_code> review IDs; retain the exact mixed selection for dependent pages and combined Apply.
  • pairwise_assessment compares payload.first and payload.second native selectors ({} means canonical; at least one selects a shared proposal), with optional preservation requirements and revision_id. Start belongs to an accepted adaptive_revision session and uses its allowance; standalone callers use adaptive_revision to start development. Readiness, finalize(job_id) and review(assessment_id) never apply changes. Outcomes preserve source-linked reasons, costs and uncertainty; preference does not mean readiness.
  • Historical assessments: pairwise_assessment list pages recent project assessments with optional payload.limit (1-20) and offset; next_offset means older records remain even after a scope-filtered empty page. Review reads saved judgments/latest writer choices. Source first returns alternative catalogs; then supply payload.source_id, planning_codes and scene_ids to read exact immutable records. Empty/omitted lists read no records. Use the current payload.revision_id for all reads; assessment_id may belong to an earlier revision in the same project, but its captured read scope must fit the current scope. Historical proposals are evidence, not valid new generation sources or current canon.
  • planning_revision uses create, readiness, quote, accepted Start, finalize, review and apply; create saves the revision request/scope without changing story content or spending credits.
  • editing_comparison reads live or selected proposed planning/pages; readiness/quote/start use payload.revision_id with optional source_selection and page_proposal_ids. Review uses comparison_id; decide records retain/defer with finding_id and request_id, requiring an explanation for retain. It does not apply content.
  • Inspect dependent pages with screenplay_generation_run scene_screenplay phase=source, then generate and review page candidates. Parent Apply selects page_proposal_ids alongside the exact structural operation_ids or planning choices; prerequisites come from the parent's saved receipts.
  • After committing a plan, apply saved dependent drafts with operation_ids=[] for scene_list_revision or payload.choices=[] for planning_revision and selected page/outline proposal IDs. This records new draft decisions, not repeated planning decisions.
  • Selected outline_proposal_ids must match the same story/page selection; parent Apply commits the outline and its prerequisites atomically. Outline proposals cannot be applied alone.
  • outline_reconciliation proposes a scene outline from a saved comparison; readiness/quote/start use comparison_id and payload.revision_id/scene_id, finalize uses job_id and scene_id, and review uses proposal_id and scene_id. List uses revision_id, source_selection, optional page_proposal_ids, limit and offset. Apply through the parent planning_revision or scene_list_revision.
  • Polish start accepts payload.revision_id to use an existing revision's scope, or payload.edit_scope to select scene/episode targets for a new revision. Never supply both; omit both for whole-project Polish.
  • Polish finalize and saved-proposal discovery point to polish_wizard review. Apply requires that native proposal_id plus payload.request_id and explicit choices (suggestion_id, accept/reject, optional edited_after_text on accept). Retry identical choices with the same request_id; native source and scope checks remain authoritative.
  • planning_revision status reads the current lifecycle checkpoint. Finish/reopen require its version and review key; finish only on writer request. Set aside remaining work only with explicit authorization. These phases never apply content or spend credits.
  • Continue a saved Room Review note with planning_revision create and payload={request_id,note_ref:{review_id,note_id,decision}}. Decision is inspect, explore or propose; the server attaches original evidence. Inspect returns an existing comparison/decision flow; do not copy note text into a detached revision.
  • Use `adaptive_revision` to develop a saved revision under an explicit credit allowance. Create the revision with `planning_revision` first, then use readiness/start. The run continues on the server; list/status inspect your own runs. Answer, scope and budget resume saved decisions with their current versions; recover and stop preserve submitted work. Starting never applies proposals.
  • Shared editorial decisions use `adaptive_revision` phases `questions`, `question_answer` and `question_continue`. Questions lists pending shared questions, optionally filtered by proposal_id. Answer requires question_id plus payload request_id/answer; continue requires question_id and an empty payload to resume the saved answer after interruption. Current editors may answer; the original run keeps its own access and allowance. Neither phase accepts a run owner, budget or Apply permission. Execution internals stay private.
  • The structured material already exists and you want to alter, refine, or explore alternatives — the verb is CHANGE.
  • Use `change_wizard` to start a whole-story connected revision from a free-form direction. It returns shared revision_id and proposal_id identities; continue with `planning_revision` review/apply phases, including partial decisions and dependent page drafts.
  • For Novel projects, `change_wizard` readiness/quote/start/finalize take payload.change_request and optional payload.novel_scope (whole_book default, from_chapter with chapter_card_id, or chapters with chapter_card_ids) and publish one shared manuscript proposal (planning cards, Chapter plans, Canon, prose of in-scope written Chapters, Chapter List changes only when asked). Quote rejects a scope too large for the model with context_too_large; choose fewer Chapters. Review and apply it with `story_review_run(workflow=novel_review, payload.novel_operation=change_proposal)`, deciding Chapter List units first and applying only with author approval.
  • Use `planning_revision` for connected beat/card-field and screenplay revisions, including consequences beyond the initiating planning card. Scene-list additions, merges and reordering belong to `scene_list_revision` even when dependent pages need revision.
  • Supply optional payload.instruction on `planning_revision` start to develop a chosen direction or redirect the next proposal. The generator retains the original revision request and scope; it does not see your conversation unless the direction is passed explicitly.
  • Start `scene_list_revision` directly with readiness and payload.change_request plus optional scene_ids. It creates its own revision at accepted Start; do not call `planning_revision` create as a prerequisite. Supply revision_id only when intentionally continuing a saved revision.
  • Use `scene_list_revision` to generate structural additions or changes within an existing scene list, including new scenes, scene order, merges, deletions, scene-to-beat links and dependent pages. Readiness, quote and approved Start produce a reviewable proposal; they do not replace the whole scene list.
  • To develop an unapplied structural proposal, use `scene_list_revision` readiness/start with payload revision_id, source_selection, optional page_proposal_ids, and change_request for the next pass. It returns replacement operations with mapped native drafts; it never applies the source proposal.
  • Use `polish_wizard` when refining existing scene-level dialogue and style without restructuring the story.
  • Use `creative_canvas` when generating alternative directions or what-ifs for selected cards rather than committing changes immediately.
  • Use `creative_canvas` review with proposal_id and payload.revision_id to inspect saved adaptive directions after the generation job expires. Review does not choose or apply a direction.

When not to use

  • Do not use for direct point edits when screenplay tools fit better.
  • For initial whole-outline generation or an explicitly requested whole-list replacement, use `story_development_run`. Creating new scenes inside an existing outline can be a structural revision; the fact that the new scene does not exist yet does not make it a Scene Wizard task.
  • For an exact scene addition already developed in conversation, use `story_mutate(entity_type=scene, operation=create)` rather than generating a second version of the agreed scene.
  • Do not use `change_wizard` to fill empty treatment sections; use `story_development_run` with `workflow=treatment_wizard`.
  • Do not use to **get editorial feedback** without proposing changes — use `story_review_run` (room_review, analysis_wizard, continuity_audit) instead.
  • For standalone surgical prose edits use `screenplay_edit_propose` / `screenplay_edit_apply`; use `planning_revision` when planning and screenplay consequences belong in one review.
  • Do not use `change_wizard` for scene-list condensation or scene merges; use `scene_list_revision` so structural changes and dependent pages can be reviewed and applied together.

Examples

  • “"Develop a new confrontation scene and adjust its surrounding scenes and dependent pages." Use `scene_list_revision`, preserving the rest of the outline for review.”
  • “Run a change wizard over this project.”
  • “Explore new directions in Creative Canvas for selected cards.”
  • “Boundary - "Improve the existing scene list for better flow." Use `scene_list_revision` for structural changes; `polish_wizard` is for screenplay prose.”
  • “Boundary - "Restructure act 2 around a betrayal beat." Use `change_wizard` here because the caller wants to commit changes, not just receive feedback.”
  • “Boundary - "Merge these three procedural scenes into one sharper set piece." Use `scene_list_revision` because scene structure and dependent screenplay prose need a coordinated revision.”

Anti-examples

  • Add the already-developed scene after an identified scene without changing surrounding scenes; use `story_mutate(entity_type=scene, operation=create)`.
  • Show me template manifests.
  • Generating a brand-new scene outline from an idea — that is `story_development_run` with `scene_wizard` or `story_bootstrap`.
  • Fill treatment cards 50.10.10-50.10.40 from scratch — that is `story_development_run` with `treatment_wizard`.
  • Asking for editorial scores or notes without applying any changes — that is `story_review_run` with `analysis_wizard` or `room_review`.
  • Writing screenplay prose from the existing outline — that is `screenplay_generation_run` with `screenplay_writer`.

Workflows

Switch behavior by setting the workflow input field.

WorkflowPhasesCalls
outline_reconciliationreadiness, quote, start, finalize, review, listoutline_reconciliation.run
pairwise_assessmentlist, source, readiness, start, finalize, reviewpairwise_assessment.run
editing_comparisonreadiness, start, finalize, review, decideediting_comparison.run
planning_revisionstatus, finish, reopen, create, readiness, source, quote, start, finalize, review, applyplanning_revision.run
adaptive_revisionquestions, question_answer, question_continue, readiness, start, list, status, answer, scope, budget, recover, stopadaptive_revision.run
change_wizardreadiness, quote, start, finalizechange_wizard.run
scene_list_revisionsource, readiness, quote, start, finalize, review, applyscene_list_revision.run
polish_wizardreadiness, quote, start, finalize, review, applypolish_wizard.run
creative_canvasreadiness, quote, start, finalize, reviewcreative_canvas.generate_directions

Linked resources

Tool calls may return resource_links pointing at these resource families.

Input schema

story_revision_run input
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "oneOf": [
    {
      "type": "object",
      "required": [
        "workflow",
        "phase",
        "project_id"
      ],
      "properties": {
        "workflow": {
          "type": "string",
          "enum": [
            "change_wizard",
            "scene_list_revision",
            "polish_wizard",
            "creative_canvas",
            "planning_revision"
          ],
          "description": "scene_list_revision changes scene structure, related planning and dependent pages; use source for version-bound inspection and readiness for generation; planning_revision connects card/page changes, starting at create. change_wizard develops a revision direction; polish_wizard refines dialogue/style; creative_canvas explores alternatives. editing_comparison compares planning/pages; outline_reconciliation proposes an outline from a saved comparison. adaptive_revision continues a saved revision under an accepted allowance."
        },
        "phase": {
          "type": "string",
          "enum": [
            "readiness",
            "start",
            "finalize",
            "apply",
            "create",
            "review",
            "status",
            "finish",
            "reopen",
            "quote",
            "source"
          ],
          "description": "Use the selected workflow's returned next_actions. Paid generation requires quote then accepted Start; follow job_get and finalize where requested. Review before approved Apply. Comparison decide records retain/defer; outline_reconciliation never applies content directly."
        },
        "project_id": {
          "type": "integer"
        },
        "job_id": {
          "type": "string",
          "minLength": 1
        },
        "reservation_id": {
          "type": "string"
        },
        "proposal_id": {
          "type": "string",
          "minLength": 1,
          "description": "Saved diff proposal id returned by scene_list_revision finalize; required for scene_list_revision apply."
        },
        "operation_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Exact selected structural operation and related card:<card_code> planning IDs for parent Apply; dependencies are enforced server-side. Use [] with selected page/outline proposals after the plan is already committed."
        },
        "payload": {
          "type": "object",
          "properties": {
            "change_request": {
              "type": "string",
              "minLength": 1,
              "description": "Free-form revision direction. Required for change_wizard and scene_list_revision start."
            },
            "scene_ids": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Optional scene ids/codes to focus scene_list_revision context."
            },
            "sequence_numbers": {
              "type": "array",
              "items": {
                "type": "integer"
              },
              "description": "Optional sequence numbers to focus scene_list_revision context."
            },
            "constraints": {
              "type": "object",
              "description": "Scene List Revision constraints. preserve_beat_codes and preserve_scene_ids are enforced at finalize/apply; max_scene_deletions limits delete/merge absorption count.",
              "properties": {
                "preserve_beat_codes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Beat codes that must remain linked to a surviving scene after apply."
                },
                "preserve_scene_ids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Scene ids that must not be deleted or absorbed."
                },
                "max_scene_deletions": {
                  "type": "integer",
                  "description": "Maximum number of scenes that may be deleted or absorbed by merge operations."
                }
              },
              "additionalProperties": true
            },
            "operation_ids": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Exact selected structural operation and related card:<card_code> planning IDs for parent Apply; dependencies are enforced server-side. Use [] with selected page/outline proposals after the plan is already committed."
            },
            "beat_changes": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "novel_scope": {
              "type": "object",
              "description": "Novel change_wizard quote/start only: Chapters whose prose is read and may change (default whole book). Chapter plan and prose changes stay inside it.",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "whole_book",
                    "from_chapter",
                    "chapters"
                  ]
                },
                "chapter_card_id": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "First Chapter for kind=from_chapter."
                },
                "chapter_card_ids": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "minItems": 1,
                  "maxItems": 500,
                  "uniqueItems": true,
                  "description": "Chapters for kind=chapters."
                }
              },
              "required": [
                "kind"
              ],
              "additionalProperties": false,
              "allOf": [
                {
                  "if": {
                    "properties": {
                      "kind": {
                        "const": "from_chapter"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "chapter_card_id"
                    ],
                    "properties": {
                      "chapter_card_ids": false
                    }
                  }
                },
                {
                  "if": {
                    "properties": {
                      "kind": {
                        "const": "chapters"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "chapter_card_ids"
                    ],
                    "properties": {
                      "chapter_card_id": false
                    }
                  }
                },
                {
                  "if": {
                    "properties": {
                      "kind": {
                        "const": "whole_book"
                      }
                    }
                  },
                  "then": {
                    "properties": {
                      "chapter_card_id": false,
                      "chapter_card_ids": false
                    }
                  }
                }
              ]
            },
            "prompt": {
              "type": "string",
              "minLength": 1
            },
            "preset_id": {
              "type": "string"
            },
            "model_hint": {
              "type": "string"
            },
            "snapshot_rev": {
              "type": "integer"
            },
            "selected_card_codes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "canon_excluded_card_codes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "visible_group_ids": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "refinement_text": {
              "type": "string"
            },
            "discussion_turns": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "current_directions": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "revision_id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "request_id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "instruction": {
              "type": "string",
              "minLength": 1,
              "maxLength": 8000
            },
            "read_scope": {
              "type": "object",
              "properties": {
                "whole_project": {
                  "type": "boolean"
                },
                "entities": {
                  "type": "array",
                  "maxItems": 500,
                  "uniqueItems": true,
                  "items": {
                    "type": "object",
                    "required": [
                      "kind",
                      "id"
                    ],
                    "properties": {
                      "kind": {
                        "enum": [
                          "card",
                          "scene",
                          "episode"
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "additionalProperties": false,
              "allOf": [
                {
                  "if": {
                    "required": [
                      "whole_project"
                    ],
                    "properties": {
                      "whole_project": {
                        "const": true
                      }
                    }
                  },
                  "then": {
                    "properties": {
                      "entities": {
                        "maxItems": 0
                      }
                    }
                  }
                }
              ]
            },
            "edit_scope": {
              "type": "object",
              "properties": {
                "whole_project": {
                  "type": "boolean"
                },
                "entities": {
                  "type": "array",
                  "maxItems": 500,
                  "uniqueItems": true,
                  "items": {
                    "type": "object",
                    "required": [
                      "kind",
                      "id"
                    ],
                    "properties": {
                      "kind": {
                        "enum": [
                          "card",
                          "scene",
                          "episode"
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "additionalProperties": false,
              "allOf": [
                {
                  "if": {
                    "required": [
                      "whole_project"
                    ],
                    "properties": {
                      "whole_project": {
                        "const": true
                      }
                    }
                  },
                  "then": {
                    "properties": {
                      "entities": {
                        "maxItems": 0
                      }
                    }
                  }
                }
              ]
            },
            "choices": {
              "type": "array",
              "minItems": 0,
              "maxItems": 500,
              "items": {
                "type": "object",
                "required": [
                  "suggestion_id",
                  "decision"
                ],
                "properties": {
                  "suggestion_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "decision": {
                    "enum": [
                      "accept",
                      "reject"
                    ]
                  },
                  "edited_after_text": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Polish accept only: optional complete replacement block. Omit to accept the saved suggestion unchanged."
                  }
                },
                "additionalProperties": false
              },
              "description": "Native planning or Polish decisions for exact suggestion IDs. Review before approved accept/reject choices. Only Polish accepts edited_after_text; empty choices select saved dependent drafts on planning Apply."
            },
            "source_selection": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "proposal_id",
                "operation_ids"
              ],
              "properties": {
                "proposal_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "operation_ids": {
                  "type": "array",
                  "maxItems": 500,
                  "uniqueItems": true,
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "edited_fields": {
                  "type": "object",
                  "maxProperties": 500,
                  "additionalProperties": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              },
              "description": "Saved parent proposal and selected operation/suggestion IDs for proposed-source comparison or development. Retain selection and any source page_proposal_ids through readiness, quote and Start."
            },
            "page_proposal_ids": {
              "type": "array",
              "maxItems": 500,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "description": "Source page candidates for readiness/quote/Start with source_selection; retain exact IDs. Apply selected drafts using top-level page_proposal_ids."
            },
            "note_ref": {
              "type": "object",
              "required": [
                "review_id",
                "note_id",
                "decision"
              ],
              "properties": {
                "review_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "note_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "decision": {
                  "enum": [
                    "inspect",
                    "explore",
                    "propose"
                  ]
                }
              },
              "additionalProperties": false
            },
            "expected_version": {
              "type": "integer",
              "minimum": 1
            },
            "expected_review_key": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64
            },
            "set_aside_pending": {
              "type": "boolean"
            },
            "billing_quote_id": {
              "type": "string",
              "format": "uuid",
              "description": "Accepted quote identity from the returned Start action; required on Start only. Reuse unchanged on retries."
            },
            "billing_request_id": {
              "type": "string",
              "format": "uuid",
              "description": "Start request UUID from the accepted quote action; required on Start only. Reuse with the same quote and scope on retries."
            },
            "context_selection": {
              "additionalProperties": false,
              "properties": {
                "source_fingerprint": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}
quot; }, { "type": "null" } ] }, "planning_codes": { "items": { "type": "string", "minLength": 1 }, "title": "Planning Codes", "type": "array", "uniqueItems": true }, "proposed_page_ids": { "items": { "type": "string", "minLength": 1 }, "title": "Proposed Page Ids", "type": "array", "uniqueItems": true }, "canonical_page_ids": { "items": { "type": "string", "minLength": 1 }, "title": "Canonical Page Ids", "type": "array", "uniqueItems": true } }, "required": [ "planning_codes", "proposed_page_ids", "canonical_page_ids" ], "title": "PlanningContextSelection", "type": "object", "description": "Read selected evidence with source; omit source_fingerprint to discover its current authorized version. Source returns working_set.selection with the exact binding and generation_readiness. Retain that complete selection for quote/Start, where the fingerprint is required. No extra read/edit authority." }, "generation_phase": { "type": "string", "enum": [ "planning", "development", "structure" ], "description": "Quote/Start: planning_revision accepts planning or development. scene_list_revision accepts structure (default) or development; development retains a selected structural parent and drafts and edits only selected fields/blocks. It requires source_selection and bound context_selection; omit topology constraints." } }, "additionalProperties": false }, "outline_proposal_ids": { "type": "array", "minItems": 1, "maxItems": 20, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 200 }, "description": "Parent Apply only: reviewed outline follow-ups matching the selected story/pages. Applied atomically with prerequisites; never apply an outline proposal alone." }, "page_proposal_ids": { "type": "array", "minItems": 1, "maxItems": 500, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 200 }, "description": "On parent Apply, select reviewed dependent pages with their matching operation_ids or planning choices. Pages cannot be applied alone. After committing a plan, use operation_ids=[] or payload.choices=[] to decide saved drafts." } }, "allOf": [ { "if": { "properties": { "workflow": { "const": "polish_wizard" } } }, "then": { "properties": { "phase": { "enum": [ "readiness", "quote", "start", "finalize", "review", "apply" ] } } } }, { "if": { "properties": { "phase": { "const": "apply" } } }, "then": { "properties": { "workflow": { "enum": [ "scene_list_revision", "planning_revision", "polish_wizard" ] } } } }, { "if": { "properties": { "workflow": { "const": "scene_list_revision" }, "phase": { "const": "apply" } } }, "then": { "required": [ "proposal_id" ] } }, { "if": { "properties": { "phase": { "const": "finalize" } } }, "then": { "required": [ "job_id" ] } }, { "if": { "properties": { "workflow": { "const": "scene_list_revision" }, "phase": { "enum": [ "quote", "start" ] } } }, "then": { "required": [ "payload" ], "properties": { "payload": { "required": [ "change_request" ] } } } }, { "if": { "properties": { "workflow": { "const": "change_wizard" }, "phase": { "enum": [ "quote", "start" ] } } }, "then": { "required": [ "payload" ], "properties": { "payload": { "anyOf": [ { "required": [ "change_request" ] }, { "required": [ "beat_changes" ], "properties": { "beat_changes": { "minItems": 1 } } } ] } } } }, { "if": { "properties": { "workflow": { "const": "polish_wizard" }, "phase": { "enum": [ "quote", "start" ] } } }, "then": { "required": [ "payload" ], "properties": { "payload": { "required": [ "prompt" ] } } } }, { "if": { "properties": { "workflow": { "const": "creative_canvas" }, "phase": { "enum": [ "quote", "start" ] } } }, "then": { "required": [ "payload" ], "properties": { "payload": { "required": [ "selected_card_codes" ], "properties": { "selected_card_codes": { "minItems": 1 } } } } } }, { "if": { "anyOf": [ { "required": [ "page_proposal_ids" ] }, { "required": [ "outline_proposal_ids" ] } ] }, "then": { "properties": { "workflow": { "enum": [ "scene_list_revision", "planning_revision" ] }, "phase": { "const": "apply" } } } }, { "if": { "properties": { "workflow": { "const": "polish_wizard" }, "phase": { "enum": [ "review", "apply" ] } } }, "then": {}, "else": { "if": { "properties": { "workflow": { "const": "planning_revision" } } }, "then": { "required": [ "payload" ], "properties": { "operation_ids": false, "reservation_id": false } }, "else": { "if": { "properties": { "workflow": { "const": "scene_list_revision" } } }, "then": { "properties": { "phase": { "not": { "const": "create" } }, "payload": { "properties": { "request_id": false, "instruction": false, "read_scope": false, "edit_scope": false, "choices": false } } } }, "else": { "if": { "properties": { "workflow": { "const": "creative_canvas" }, "phase": { "const": "review" } } }, "then": { "required": [ "proposal_id", "payload" ], "properties": { "payload": { "required": [ "revision_id" ], "properties": { "request_id": false, "instruction": false, "read_scope": false, "edit_scope": false, "choices": false } } } }, "else": { "if": { "properties": { "workflow": { "const": "polish_wizard" }, "phase": { "enum": [ "quote", "start" ] } } }, "then": { "properties": { "payload": { "not": { "required": [ "revision_id", "edit_scope" ] }, "properties": { "request_id": false, "instruction": false, "read_scope": false, "choices": false } } } }, "else": { "properties": { "phase": { "not": { "enum": [ "create", "review" ] } }, "payload": { "properties": { "request_id": false, "instruction": false, "read_scope": false, "edit_scope": false, "choices": false } } }, "allOf": [ { "if": { "properties": { "workflow": { "const": "creative_canvas" }, "phase": { "enum": [ "readiness", "quote", "start" ] } } }, "then": {}, "else": { "properties": { "payload": { "properties": { "revision_id": false } } } } } ] } } } } } }, { "if": { "properties": { "workflow": { "const": "planning_revision" }, "phase": { "const": "create" } } }, "then": { "required": [ "payload" ], "properties": { "payload": { "required": [ "request_id" ], "properties": { "change_request": false, "scene_ids": false, "sequence_numbers": false, "constraints": false, "operation_ids": false, "beat_changes": false, "prompt": false, "preset_id": false, "model_hint": false, "snapshot_rev": false, "selected_card_codes": false, "canon_excluded_card_codes": false, "visible_group_ids": false, "refinement_text": false, "discussion_turns": false, "current_directions": false, "revision_id": false, "choices": false }, "oneOf": [ { "required": [ "instruction", "read_scope", "edit_scope" ], "properties": { "note_ref": false } }, { "required": [ "note_ref" ], "properties": { "instruction": false, "read_scope": false, "edit_scope": false } } ] }, "proposal_id": false, "job_id": false } } }, { "if": { "properties": { "workflow": { "const": "planning_revision" }, "phase": { "const": "readiness" } } }, "then": { "required": [ "payload" ], "properties": { "payload": { "required": [ "revision_id" ], "properties": { "change_request": false, "scene_ids": false, "sequence_numbers": false, "constraints": false, "operation_ids": false, "beat_changes": false, "prompt": false, "preset_id": false, "model_hint": false, "snapshot_rev": false, "selected_card_codes": false, "canon_excluded_card_codes": false, "visible_group_ids": false, "refinement_text": false, "discussion_turns": false, "current_directions": false, "request_id": false, "instruction": false, "read_scope": false, "edit_scope": false, "choices": false } }, "proposal_id": false, "job_id": false } } }, { "if": { "properties": { "workflow": { "const": "planning_revision" }, "phase": { "enum": [ "quote", "start" ] } } }, "then": { "required": [ "payload" ], "properties": { "payload": { "required": [ "revision_id" ], "properties": { "change_request": false, "scene_ids": false, "sequence_numbers": false, "constraints": false, "operation_ids": false, "beat_changes": false, "prompt": false, "preset_id": false, "model_hint": false, "snapshot_rev": false, "selected_card_codes": false, "canon_excluded_card_codes": false, "visible_group_ids": false, "refinement_text": false, "discussion_turns": false, "current_directions": false, "request_id": false, "read_scope": false, "edit_scope": false, "choices": false } }, "proposal_id": false, "job_id": false } } }, { "if": { "properties": { "workflow": { "const": "planning_revision" }, "phase": { "const": "finalize" } } }, "then": { "required": [ "payload" ], "properties": { "payload": { "required": [ "revision_id" ], "properties": { "change_request": false, "scene_ids": false, "sequence_numbers": false, "constraints": false, "operation_ids": false, "beat_changes": false, "prompt": false, "preset_id": false, "model_hint": false, "snapshot_rev": false, "selected_card_codes": false, "canon_excluded_card_codes": false, "visible_group_ids": false, "refinement_text": false, "discussion_turns": false, "current_directions": false, "request_id": false, "instruction": false, "read_scope": false, "edit_scope": false, "choices": false } }, "proposal_id": false } } }, { "if": { "properties": { "workflow": { "const": "planning_revision" }, "phase": { "const": "review" } } }, "then": { "required": [ "payload", "proposal_id" ], "properties": { "payload": { "required": [ "revision_id" ], "properties": { "change_request": false, "scene_ids": false, "sequence_numbers": false, "constraints": false, "operation_ids": false, "beat_changes": false, "prompt": false, "preset_id": false, "model_hint": false, "snapshot_rev": false, "selected_card_codes": false, "canon_excluded_card_codes": false, "visible_group_ids": false, "refinement_text": false, "discussion_turns": false, "current_directions": false, "request_id": false, "instruction": false, "read_scope": false, "edit_scope": false, "choices": false } }, "job_id": false } } }, { "if": { "properties": { "workflow": { "const": "planning_revision" }, "phase": { "const": "apply" } } }, "then": { "required": [ "payload", "proposal_id" ], "properties": { "payload": { "required": [ "revision_id", "request_id", "choices" ], "properties": { "change_request": false, "scene_ids": false, "sequence_numbers": false, "constraints": false, "operation_ids": false, "beat_changes": false, "prompt": false, "preset_id": false, "model_hint": false, "snapshot_rev": false, "selected_card_codes": false, "canon_excluded_card_codes": false, "visible_group_ids": false, "refinement_text": false, "discussion_turns": false, "current_directions": false, "instruction": false, "read_scope": false, "edit_scope": false } }, "job_id": false }, "anyOf": [ { "properties": { "payload": { "properties": { "choices": { "minItems": 1 } } } } }, { "required": [ "page_proposal_ids" ], "properties": { "page_proposal_ids": { "minItems": 1 } } }, { "required": [ "outline_proposal_ids" ], "properties": { "outline_proposal_ids": { "minItems": 1 } } } ] } }, { "if": { "properties": { "workflow": { "const": "scene_list_revision" }, "phase": { "const": "review" } } }, "then": { "required": [ "proposal_id", "payload" ], "properties": { "payload": { "required": [ "revision_id" ] } } } }, { "if": { "properties": { "workflow": { "enum": [ "planning_revision", "creative_canvas", "scene_list_revision" ] }, "phase": { "enum": [ "readiness", "start", "quote", "source" ] } } }, "then": {}, "else": { "properties": { "payload": { "properties": { "source_selection": false, "page_proposal_ids": false } } } } }, { "if": { "required": [ "payload" ], "properties": { "payload": { "required": [ "page_proposal_ids" ] } } }, "then": { "properties": { "payload": { "required": [ "source_selection" ] } } } }, { "if": { "properties": { "workflow": { "enum": [ "creative_canvas", "scene_list_revision" ] }, "payload": { "required": [ "source_selection" ] } }, "required": [ "payload" ] }, "then": { "properties": { "payload": { "required": [ "revision_id" ] } } } }, { "if": { "properties": { "workflow": { "const": "planning_revision" }, "phase": { "const": "create" } } }, "then": {}, "else": { "properties": { "payload": { "properties": { "note_ref": false } } } } }, { "if": { "properties": { "phase": { "enum": [ "status", "finish", "reopen" ] } } }, "then": { "properties": { "workflow": { "const": "planning_revision" }, "job_id": false, "reservation_id": false, "proposal_id": false, "operation_ids": false, "page_proposal_ids": false, "outline_proposal_ids": false } }, "else": { "properties": { "payload": { "properties": { "expected_version": false, "expected_review_key": false, "set_aside_pending": false } } } } }, { "if": { "properties": { "phase": { "const": "status" } } }, "then": { "required": [ "payload" ], "properties": { "payload": { "type": "object", "required": [ "revision_id" ], "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "additionalProperties": false } } } }, { "if": { "properties": { "phase": { "enum": [ "finish", "reopen" ] } } }, "then": { "required": [ "payload" ], "properties": { "payload": { "type": "object", "required": [ "revision_id", "request_id", "expected_version", "expected_review_key", "set_aside_pending" ], "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "expected_version": { "type": "integer", "minimum": 1 }, "expected_review_key": { "type": "string", "minLength": 64, "maxLength": 64 }, "set_aside_pending": { "type": "boolean" } }, "additionalProperties": false } } } }, { "if": { "properties": { "phase": { "const": "reopen" } } }, "then": { "properties": { "payload": { "properties": { "set_aside_pending": { "const": false } } } } } }, { "if": { "properties": { "phase": { "const": "quote" } } }, "then": { "properties": { "workflow": { "enum": [ "polish_wizard", "planning_revision", "change_wizard", "scene_list_revision", "creative_canvas" ] } } } }, { "if": { "properties": { "workflow": { "enum": [ "polish_wizard", "planning_revision", "change_wizard", "scene_list_revision", "creative_canvas" ] }, "phase": { "const": "start" } } }, "then": { "required": [ "payload" ], "properties": { "payload": { "required": [ "billing_quote_id", "billing_request_id" ] } } }, "else": { "properties": { "payload": { "properties": { "billing_quote_id": false, "billing_request_id": false } } } } }, { "if": { "required": [ "payload" ], "properties": { "payload": { "required": [ "novel_scope" ] } } }, "then": { "properties": { "workflow": { "const": "change_wizard" }, "phase": { "enum": [ "quote", "start" ] } } } }, { "if": { "properties": { "phase": { "const": "source" } } }, "then": { "required": [ "payload" ], "properties": { "workflow": { "const": "planning_revision" }, "payload": { "required": [ "revision_id", "context_selection" ], "properties": { "change_request": false, "scene_ids": false, "sequence_numbers": false, "constraints": false, "operation_ids": false, "beat_changes": false, "prompt": false, "preset_id": false, "model_hint": false, "snapshot_rev": false, "selected_card_codes": false, "canon_excluded_card_codes": false, "visible_group_ids": false, "refinement_text": false, "discussion_turns": false, "current_directions": false, "request_id": false, "instruction": false, "read_scope": false, "edit_scope": false, "choices": false } }, "proposal_id": false, "job_id": false } } }, { "if": { "required": [ "payload" ], "properties": { "payload": { "required": [ "context_selection" ] } } }, "then": { "anyOf": [ { "properties": { "workflow": { "const": "planning_revision" }, "phase": { "enum": [ "source", "quote", "start" ] } } }, { "properties": { "workflow": { "const": "scene_list_revision" }, "phase": { "enum": [ "quote", "start" ] }, "payload": { "required": [ "generation_phase" ], "properties": { "generation_phase": { "const": "development" } } } } } ] } }, { "if": { "properties": { "phase": { "enum": [ "quote", "start" ] }, "payload": { "required": [ "context_selection" ] } }, "required": [ "payload" ] }, "then": { "properties": { "payload": { "properties": { "context_selection": { "required": [ "source_fingerprint" ], "properties": { "source_fingerprint": { "type": "string", "pattern": "^[0-9a-f]{64}
quot; } } } } } } } }, { "if": { "required": [ "payload" ], "properties": { "payload": { "required": [ "generation_phase" ] } } }, "then": { "properties": { "phase": { "enum": [ "quote", "start" ] } }, "oneOf": [ { "properties": { "workflow": { "const": "planning_revision" }, "payload": { "properties": { "generation_phase": { "enum": [ "planning", "development" ] } } } } }, { "properties": { "workflow": { "const": "scene_list_revision" }, "payload": { "properties": { "generation_phase": { "enum": [ "structure", "development" ] } } } } } ] } }, { "if": { "properties": { "workflow": { "const": "scene_list_revision" }, "payload": { "required": [ "generation_phase" ], "properties": { "generation_phase": { "const": "development" } } } }, "required": [ "payload" ] }, "then": { "properties": { "payload": { "required": [ "revision_id", "source_selection", "context_selection" ], "properties": { "constraints": false } } } } }, { "if": { "properties": { "workflow": { "const": "polish_wizard" } } }, "then": {}, "else": { "properties": { "payload": { "properties": { "request_id": { "maxLength": 128 }, "choices": { "items": { "properties": { "edited_after_text": false } } } } } } } }, { "if": { "properties": { "workflow": { "const": "polish_wizard" }, "phase": { "const": "review" } } }, "then": { "type": "object", "properties": { "workflow": { "const": "polish_wizard" }, "phase": { "const": "review" }, "project_id": { "type": "integer" }, "proposal_id": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Saved native Polish proposal. Review captures before/after blocks and decisions without applying." } }, "required": [ "workflow", "phase", "project_id", "proposal_id" ], "additionalProperties": false } }, { "if": { "properties": { "workflow": { "const": "polish_wizard" }, "phase": { "const": "apply" } } }, "then": { "type": "object", "properties": { "workflow": { "const": "polish_wizard" }, "phase": { "const": "apply" }, "project_id": { "type": "integer" }, "proposal_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "payload": { "type": "object", "required": [ "request_id", "choices" ], "properties": { "request_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "choices": { "type": "array", "minItems": 1, "maxItems": 500, "items": { "oneOf": [ { "type": "object", "required": [ "suggestion_id", "decision" ], "properties": { "suggestion_id": { "type": "string", "minLength": 1 }, "decision": { "const": "accept" }, "edited_after_text": { "type": [ "string", "null" ] } }, "additionalProperties": false }, { "type": "object", "required": [ "suggestion_id", "decision" ], "properties": { "suggestion_id": { "type": "string", "minLength": 1 }, "decision": { "const": "reject" }, "edited_after_text": { "type": "null" } }, "additionalProperties": false } ] }, "description": "Explicit approved native suggestion choices. Reuse request_id and the identical choices on retries; accept checks captured blocks and scope." } }, "additionalProperties": false } }, "required": [ "workflow", "phase", "project_id", "proposal_id", "payload" ], "additionalProperties": false } } ], "additionalProperties": false }, { "type": "object", "properties": { "workflow": { "const": "editing_comparison", "description": "scene_list_revision changes scene structure, related planning and dependent pages; use source for version-bound inspection and readiness for generation; planning_revision connects card/page changes, starting at create. change_wizard develops a revision direction; polish_wizard refines dialogue/style; creative_canvas explores alternatives. editing_comparison compares planning/pages; outline_reconciliation proposes an outline from a saved comparison. adaptive_revision continues a saved revision under an accepted allowance." }, "project_id": { "type": "integer" }, "phase": { "enum": [ "readiness", "quote", "start" ], "description": "Use the selected workflow's returned next_actions. Paid generation requires quote then accepted Start; follow job_get and finalize where requested. Review before approved Apply. Comparison decide records retain/defer; outline_reconciliation never applies content directly." }, "payload": { "type": "object", "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "source_selection": { "type": "object", "properties": { "proposal_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "operation_ids": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 120 }, "minItems": 0, "maxItems": 500, "uniqueItems": true }, "edited_fields": { "type": "object", "maxProperties": 500, "additionalProperties": { "type": "object", "additionalProperties": true } } }, "required": [ "proposal_id", "operation_ids" ], "additionalProperties": false, "description": "Saved parent proposal and selected operation/suggestion IDs for proposed-source comparison or development. Retain selection and any source page_proposal_ids through readiness, quote and Start." }, "page_proposal_ids": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 200 }, "maxItems": 500, "uniqueItems": true, "description": "Source page candidates for readiness/quote/Start with source_selection; retain exact IDs. Apply selected drafts using top-level page_proposal_ids." }, "billing_quote_id": { "type": "string", "format": "uuid", "description": "Accepted quote identity from the returned Start action; required on Start only. Reuse unchanged on retries." }, "billing_request_id": { "type": "string", "format": "uuid", "description": "Start request UUID from the accepted quote action; required on Start only. Reuse with the same quote and scope on retries." } }, "required": [ "revision_id" ], "additionalProperties": false, "allOf": [ { "if": { "required": [ "page_proposal_ids" ], "properties": { "page_proposal_ids": { "minItems": 1 } } }, "then": { "required": [ "source_selection" ] } } ] } }, "required": [ "workflow", "project_id", "phase", "payload" ], "additionalProperties": false, "allOf": [ { "if": { "properties": { "phase": { "const": "start" } } }, "then": { "properties": { "payload": { "required": [ "billing_quote_id", "billing_request_id" ] } } }, "else": { "properties": { "payload": { "not": { "anyOf": [ { "required": [ "billing_quote_id" ] }, { "required": [ "billing_request_id" ] } ] } } } } } ] }, { "type": "object", "properties": { "workflow": { "const": "editing_comparison", "description": "scene_list_revision changes scene structure, related planning and dependent pages; use source for version-bound inspection and readiness for generation; planning_revision connects card/page changes, starting at create. change_wizard develops a revision direction; polish_wizard refines dialogue/style; creative_canvas explores alternatives. editing_comparison compares planning/pages; outline_reconciliation proposes an outline from a saved comparison. adaptive_revision continues a saved revision under an accepted allowance." }, "project_id": { "type": "integer" }, "phase": { "enum": [ "finalize" ], "description": "Use the selected workflow's returned next_actions. Paid generation requires quote then accepted Start; follow job_get and finalize where requested. Review before approved Apply. Comparison decide records retain/defer; outline_reconciliation never applies content directly." }, "payload": { "type": "object", "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "revision_id" ], "additionalProperties": false }, "job_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "workflow", "project_id", "phase", "payload", "job_id" ], "additionalProperties": false }, { "type": "object", "properties": { "workflow": { "const": "editing_comparison", "description": "scene_list_revision changes scene structure, related planning and dependent pages; use source for version-bound inspection and readiness for generation; planning_revision connects card/page changes, starting at create. change_wizard develops a revision direction; polish_wizard refines dialogue/style; creative_canvas explores alternatives. editing_comparison compares planning/pages; outline_reconciliation proposes an outline from a saved comparison. adaptive_revision continues a saved revision under an accepted allowance." }, "project_id": { "type": "integer" }, "phase": { "enum": [ "review" ], "description": "Use the selected workflow's returned next_actions. Paid generation requires quote then accepted Start; follow job_get and finalize where requested. Review before approved Apply. Comparison decide records retain/defer; outline_reconciliation never applies content directly." }, "payload": { "type": "object", "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "revision_id" ], "additionalProperties": false }, "comparison_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "workflow", "project_id", "phase", "payload", "comparison_id" ], "additionalProperties": false }, { "type": "object", "properties": { "workflow": { "const": "editing_comparison", "description": "scene_list_revision changes scene structure, related planning and dependent pages; use source for version-bound inspection and readiness for generation; planning_revision connects card/page changes, starting at create. change_wizard develops a revision direction; polish_wizard refines dialogue/style; creative_canvas explores alternatives. editing_comparison compares planning/pages; outline_reconciliation proposes an outline from a saved comparison. adaptive_revision continues a saved revision under an accepted allowance." }, "project_id": { "type": "integer" }, "phase": { "enum": [ "decide" ], "description": "Use the selected workflow's returned next_actions. Paid generation requires quote then accepted Start; follow job_get and finalize where requested. Review before approved Apply. Comparison decide records retain/defer; outline_reconciliation never applies content directly." }, "payload": { "type": "object", "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "finding_id": { "type": "string", "minLength": 1, "maxLength": 240 }, "decision": { "enum": [ "retain", "defer" ] }, "explanation": { "type": "string", "maxLength": 4000 }, "expected_decision_id": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 200 }, { "type": "null" } ] } }, "required": [ "revision_id", "request_id", "finding_id", "decision" ], "additionalProperties": false, "allOf": [ { "if": { "properties": { "decision": { "const": "retain" } } }, "then": { "required": [ "explanation" ], "properties": { "explanation": { "pattern": "\\S" } } } } ] }, "comparison_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "workflow", "project_id", "phase", "payload", "comparison_id" ], "additionalProperties": false }, { "type": "object", "required": [ "workflow", "project_id", "phase", "comparison_id", "payload" ], "properties": { "workflow": { "const": "outline_reconciliation", "description": "scene_list_revision changes scene structure, related planning and dependent pages; use source for version-bound inspection and readiness for generation; planning_revision connects card/page changes, starting at create. change_wizard develops a revision direction; polish_wizard refines dialogue/style; creative_canvas explores alternatives. editing_comparison compares planning/pages; outline_reconciliation proposes an outline from a saved comparison. adaptive_revision continues a saved revision under an accepted allowance." }, "project_id": { "type": "integer" }, "phase": { "enum": [ "readiness", "quote" ], "description": "Use the selected workflow's returned next_actions. Paid generation requires quote then accepted Start; follow job_get and finalize where requested. Review before approved Apply. Comparison decide records retain/defer; outline_reconciliation never applies content directly." }, "comparison_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "payload": { "type": "object", "required": [ "scene_id", "revision_id" ], "properties": { "scene_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "project_id", "phase", "comparison_id", "payload" ], "properties": { "workflow": { "const": "outline_reconciliation", "description": "scene_list_revision changes scene structure, related planning and dependent pages; use source for version-bound inspection and readiness for generation; planning_revision connects card/page changes, starting at create. change_wizard develops a revision direction; polish_wizard refines dialogue/style; creative_canvas explores alternatives. editing_comparison compares planning/pages; outline_reconciliation proposes an outline from a saved comparison. adaptive_revision continues a saved revision under an accepted allowance." }, "project_id": { "type": "integer" }, "phase": { "const": "start", "description": "Use the selected workflow's returned next_actions. Paid generation requires quote then accepted Start; follow job_get and finalize where requested. Review before approved Apply. Comparison decide records retain/defer; outline_reconciliation never applies content directly." }, "comparison_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "payload": { "type": "object", "required": [ "scene_id", "revision_id", "billing_quote_id", "billing_request_id" ], "properties": { "scene_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "billing_quote_id": { "type": "string", "format": "uuid", "description": "Accepted quote identity from the returned Start action; required on Start only. Reuse unchanged on retries." }, "billing_request_id": { "type": "string", "format": "uuid", "description": "Start request UUID from the accepted quote action; required on Start only. Reuse with the same quote and scope on retries." } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "project_id", "phase", "job_id", "payload" ], "properties": { "workflow": { "const": "outline_reconciliation", "description": "scene_list_revision changes scene structure, related planning and dependent pages; use source for version-bound inspection and readiness for generation; planning_revision connects card/page changes, starting at create. change_wizard develops a revision direction; polish_wizard refines dialogue/style; creative_canvas explores alternatives. editing_comparison compares planning/pages; outline_reconciliation proposes an outline from a saved comparison. adaptive_revision continues a saved revision under an accepted allowance." }, "project_id": { "type": "integer" }, "phase": { "const": "finalize", "description": "Use the selected workflow's returned next_actions. Paid generation requires quote then accepted Start; follow job_get and finalize where requested. Review before approved Apply. Comparison decide records retain/defer; outline_reconciliation never applies content directly." }, "job_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "payload": { "type": "object", "required": [ "scene_id" ], "properties": { "scene_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "project_id", "phase", "proposal_id", "payload" ], "properties": { "workflow": { "const": "outline_reconciliation", "description": "scene_list_revision changes scene structure, related planning and dependent pages; use source for version-bound inspection and readiness for generation; planning_revision connects card/page changes, starting at create. change_wizard develops a revision direction; polish_wizard refines dialogue/style; creative_canvas explores alternatives. editing_comparison compares planning/pages; outline_reconciliation proposes an outline from a saved comparison. adaptive_revision continues a saved revision under an accepted allowance." }, "project_id": { "type": "integer" }, "phase": { "const": "review", "description": "Use the selected workflow's returned next_actions. Paid generation requires quote then accepted Start; follow job_get and finalize where requested. Review before approved Apply. Comparison decide records retain/defer; outline_reconciliation never applies content directly." }, "proposal_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "payload": { "type": "object", "required": [ "scene_id" ], "properties": { "scene_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Revision-associated review: bind to the saved revision and its current read scope. Required inside adaptive sessions." } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "project_id", "phase", "payload" ], "properties": { "workflow": { "const": "outline_reconciliation", "description": "scene_list_revision changes scene structure, related planning and dependent pages; use source for version-bound inspection and readiness for generation; planning_revision connects card/page changes, starting at create. change_wizard develops a revision direction; polish_wizard refines dialogue/style; creative_canvas explores alternatives. editing_comparison compares planning/pages; outline_reconciliation proposes an outline from a saved comparison. adaptive_revision continues a saved revision under an accepted allowance." }, "project_id": { "type": "integer" }, "phase": { "const": "list", "description": "Use the selected workflow's returned next_actions. Paid generation requires quote then accepted Start; follow job_get and finalize where requested. Review before approved Apply. Comparison decide records retain/defer; outline_reconciliation never applies content directly." }, "payload": { "type": "object", "required": [ "revision_id", "source_selection" ], "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "source_selection": { "type": "object", "properties": { "proposal_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "operation_ids": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 120 }, "minItems": 0, "maxItems": 500, "uniqueItems": true }, "edited_fields": { "type": "object", "maxProperties": 500, "additionalProperties": { "type": "object", "additionalProperties": true } } }, "required": [ "proposal_id", "operation_ids" ], "additionalProperties": false, "description": "Saved parent proposal and selected operation/suggestion IDs for proposed-source comparison or development. Retain selection and any source page_proposal_ids through readiness, quote and Start." }, "page_proposal_ids": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 200 }, "maxItems": 500, "uniqueItems": true, "description": "Source page candidates for readiness/quote/Start with source_selection; retain exact IDs. Apply selected drafts using top-level page_proposal_ids." }, "limit": { "type": "integer", "minimum": 1, "maximum": 100 }, "offset": { "type": "integer", "minimum": 0 } }, "additionalProperties": false } }, "additionalProperties": false }, { "oneOf": [ { "type": "object", "required": [ "workflow", "phase", "project_id", "revision_id" ], "properties": { "workflow": { "const": "adaptive_revision" }, "phase": { "const": "readiness" }, "project_id": { "type": "integer" }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 128 } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "phase", "project_id", "revision_id" ], "properties": { "workflow": { "const": "adaptive_revision" }, "phase": { "const": "list" }, "project_id": { "type": "integer" }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 128 } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "phase", "project_id", "revision_id", "run_id" ], "properties": { "workflow": { "const": "adaptive_revision" }, "phase": { "const": "status" }, "project_id": { "type": "integer" }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "run_id": { "type": "string", "format": "uuid" } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "phase", "project_id", "revision_id", "payload" ], "properties": { "workflow": { "const": "adaptive_revision" }, "phase": { "const": "start" }, "project_id": { "type": "integer" }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "payload": { "type": "object", "required": [ "request_id", "expected_revision_version", "credit_limit", "billing_quote_id", "billing_request_id" ], "properties": { "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "expected_revision_version": { "type": "integer", "minimum": 1 }, "credit_limit": { "type": "integer", "minimum": 1 }, "billing_quote_id": { "type": "string", "format": "uuid" }, "billing_request_id": { "type": "string", "format": "uuid" } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "phase", "project_id", "revision_id", "run_id", "payload" ], "properties": { "workflow": { "const": "adaptive_revision" }, "phase": { "const": "answer" }, "project_id": { "type": "integer" }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "run_id": { "type": "string", "format": "uuid" }, "payload": { "type": "object", "required": [ "request_id", "expected_version", "answer" ], "properties": { "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "expected_version": { "type": "integer", "minimum": 1 }, "answer": { "type": "string", "minLength": 1, "maxLength": 8000 } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "phase", "project_id", "revision_id", "run_id", "payload" ], "properties": { "workflow": { "const": "adaptive_revision" }, "phase": { "const": "scope" }, "project_id": { "type": "integer" }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "run_id": { "type": "string", "format": "uuid" }, "payload": { "type": "object", "required": [ "request_id", "expected_version", "approve" ], "properties": { "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "expected_version": { "type": "integer", "minimum": 1 }, "approve": { "type": "boolean" } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "phase", "project_id", "revision_id", "run_id", "payload" ], "properties": { "workflow": { "const": "adaptive_revision" }, "phase": { "const": "budget" }, "project_id": { "type": "integer" }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "run_id": { "type": "string", "format": "uuid" }, "payload": { "type": "object", "required": [ "request_id", "expected_version", "credit_limit" ], "properties": { "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "expected_version": { "type": "integer", "minimum": 1 }, "credit_limit": { "type": "integer", "minimum": 1 } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "phase", "project_id", "revision_id", "run_id", "payload" ], "properties": { "workflow": { "const": "adaptive_revision" }, "phase": { "const": "recover" }, "project_id": { "type": "integer" }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "run_id": { "type": "string", "format": "uuid" }, "payload": { "type": "object", "required": [ "expected_version" ], "properties": { "expected_version": { "type": "integer", "minimum": 1 } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "phase", "project_id", "revision_id", "run_id", "payload" ], "properties": { "workflow": { "const": "adaptive_revision" }, "phase": { "const": "stop" }, "project_id": { "type": "integer" }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "run_id": { "type": "string", "format": "uuid" }, "payload": { "type": "object", "required": [ "expected_version" ], "properties": { "expected_version": { "type": "integer", "minimum": 1 } }, "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "phase", "project_id", "revision_id" ], "properties": { "workflow": { "const": "adaptive_revision" }, "phase": { "const": "questions" }, "project_id": { "type": "integer" }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "proposal_id": { "type": "string", "minLength": 1 } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "phase", "project_id", "revision_id", "question_id", "payload" ], "properties": { "workflow": { "const": "adaptive_revision" }, "phase": { "const": "question_answer" }, "project_id": { "type": "integer" }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "question_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "payload": { "type": "object", "properties": { "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "answer": { "type": "string", "minLength": 1, "maxLength": 8000 } }, "required": [ "request_id", "answer" ], "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "phase", "project_id", "revision_id", "question_id", "payload" ], "properties": { "workflow": { "const": "adaptive_revision" }, "phase": { "const": "question_continue" }, "project_id": { "type": "integer" }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "question_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "payload": { "type": "object", "properties": {}, "required": [], "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": [ "workflow", "phase", "project_id", "revision_id", "payload" ], "properties": { "workflow": { "const": "adaptive_revision" }, "phase": { "const": "quote" }, "project_id": { "type": "integer" }, "revision_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "payload": { "type": "object", "required": [ "expected_revision_version", "credit_limit" ], "properties": { "expected_revision_version": { "type": "integer", "minimum": 1 }, "credit_limit": { "type": "integer", "minimum": 1 } }, "additionalProperties": false } }, "additionalProperties": false } ] }, { "type": "object", "properties": { "workflow": { "const": "pairwise_assessment", "description": "Compare exact alternatives under an accepted adaptive_revision allowance. Start requires server-owned session authority; readiness/finalize/review never apply content." }, "project_id": { "type": "integer" }, "phase": { "enum": [ "readiness", "start" ] }, "payload": { "type": "object", "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "first": { "type": "object", "properties": { "source_selection": { "type": "object", "properties": { "proposal_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "operation_ids": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 120 }, "minItems": 0, "maxItems": 500, "uniqueItems": true }, "edited_fields": { "type": "object", "maxProperties": 500, "additionalProperties": { "type": "object", "additionalProperties": true } } }, "required": [ "proposal_id", "operation_ids" ], "additionalProperties": false, "description": "Saved parent proposal and selected operation/suggestion IDs for proposed-source comparison or development. Retain selection and any source page_proposal_ids through readiness, quote and Start." }, "page_proposal_ids": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 200 }, "maxItems": 500, "uniqueItems": true, "description": "Source page candidates for readiness/quote/Start with source_selection; retain exact IDs. Apply selected drafts using top-level page_proposal_ids." }, "billing_quote_id": { "type": "string", "format": "uuid", "description": "Accepted quote identity from the returned Start action; required on Start only. Reuse unchanged on retries." }, "billing_request_id": { "type": "string", "format": "uuid", "description": "Start request UUID from the accepted quote action; required on Start only. Reuse with the same quote and scope on retries." } }, "additionalProperties": false, "allOf": [ { "if": { "required": [ "page_proposal_ids" ], "properties": { "page_proposal_ids": { "minItems": 1 } } }, "then": { "required": [ "source_selection" ] } } ] }, "second": { "type": "object", "properties": { "source_selection": { "type": "object", "properties": { "proposal_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "operation_ids": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 120 }, "minItems": 0, "maxItems": 500, "uniqueItems": true }, "edited_fields": { "type": "object", "maxProperties": 500, "additionalProperties": { "type": "object", "additionalProperties": true } } }, "required": [ "proposal_id", "operation_ids" ], "additionalProperties": false, "description": "Saved parent proposal and selected operation/suggestion IDs for proposed-source comparison or development. Retain selection and any source page_proposal_ids through readiness, quote and Start." }, "page_proposal_ids": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 200 }, "maxItems": 500, "uniqueItems": true, "description": "Source page candidates for readiness/quote/Start with source_selection; retain exact IDs. Apply selected drafts using top-level page_proposal_ids." }, "billing_quote_id": { "type": "string", "format": "uuid", "description": "Accepted quote identity from the returned Start action; required on Start only. Reuse unchanged on retries." }, "billing_request_id": { "type": "string", "format": "uuid", "description": "Start request UUID from the accepted quote action; required on Start only. Reuse with the same quote and scope on retries." } }, "additionalProperties": false, "allOf": [ { "if": { "required": [ "page_proposal_ids" ], "properties": { "page_proposal_ids": { "minItems": 1 } } }, "then": { "required": [ "source_selection" ] } } ] }, "preservation": { "type": "array", "items": { "type": "string", "pattern": "\\S" } } }, "required": [ "revision_id", "first", "second" ], "additionalProperties": false, "anyOf": [ { "properties": { "first": { "required": [ "source_selection" ] } } }, { "properties": { "second": { "required": [ "source_selection" ] } } } ] } }, "required": [ "workflow", "project_id", "phase", "payload" ], "additionalProperties": false }, { "type": "object", "properties": { "workflow": { "const": "pairwise_assessment", "description": "Compare exact alternatives under an accepted adaptive_revision allowance. Start requires server-owned session authority; readiness/finalize/review never apply content." }, "project_id": { "type": "integer" }, "phase": { "enum": [ "finalize" ] }, "payload": { "type": "object", "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "revision_id" ], "additionalProperties": false }, "job_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "workflow", "project_id", "phase", "payload", "job_id" ], "additionalProperties": false }, { "type": "object", "properties": { "workflow": { "const": "pairwise_assessment", "description": "Compare exact alternatives under an accepted adaptive_revision allowance. Start requires server-owned session authority; readiness/finalize/review never apply content." }, "project_id": { "type": "integer" }, "phase": { "enum": [ "review" ] }, "payload": { "type": "object", "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Current revision authorizing the read. assessment_id may identify an earlier shared assessment in this project; captured evidence must fit the current read scope. Old proposals remain historical references." } }, "required": [ "revision_id" ], "additionalProperties": false }, "assessment_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "workflow", "project_id", "phase", "payload", "assessment_id" ], "additionalProperties": false }, { "type": "object", "properties": { "workflow": { "const": "pairwise_assessment" }, "project_id": { "type": "integer" }, "phase": { "enum": [ "source" ] }, "payload": { "type": "object", "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Current revision authorizing the read. assessment_id may identify an earlier shared assessment in this project; captured evidence must fit the current read scope. Old proposals remain historical references." }, "planning_codes": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 200 }, "maxItems": 0 }, "scene_ids": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 200 }, "maxItems": 0 } }, "required": [ "revision_id" ], "additionalProperties": false }, "assessment_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "workflow", "project_id", "phase", "payload", "assessment_id" ], "additionalProperties": false }, { "type": "object", "properties": { "workflow": { "const": "pairwise_assessment", "description": "Compare exact alternatives under an accepted adaptive_revision allowance. Start requires server-owned session authority; readiness/finalize/review never apply content." }, "project_id": { "type": "integer" }, "phase": { "enum": [ "source" ] }, "payload": { "type": "object", "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Current revision authorizing the read. assessment_id may identify an earlier shared assessment in this project; captured evidence must fit the current read scope. Old proposals remain historical references." }, "source_id": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Omit to discover immutable alternative catalogs. Supply a catalog source_id to read only the explicit planning_codes and scene_ids; empty/omitted lists read no records." }, "planning_codes": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 200 } }, "scene_ids": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 200 } } }, "required": [ "revision_id", "source_id" ], "additionalProperties": false }, "assessment_id": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "workflow", "project_id", "phase", "payload", "assessment_id" ], "additionalProperties": false }, { "type": "object", "properties": { "workflow": { "const": "pairwise_assessment", "description": "Compare exact alternatives under an accepted adaptive_revision allowance. Start requires server-owned session authority; readiness/finalize/review never apply content." }, "project_id": { "type": "integer" }, "phase": { "enum": [ "list" ] }, "payload": { "type": "object", "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Current revision authorizing paged historical discovery. Chronological pages are scope-filtered after scanning; next_offset indicates older records remain, including after an empty eligible page." }, "limit": { "type": "integer", "minimum": 1, "maximum": 20 }, "offset": { "type": "integer", "minimum": 0 } }, "required": [ "revision_id" ], "additionalProperties": false } }, "required": [ "workflow", "project_id", "phase", "payload" ], "additionalProperties": false }, { "type": "object", "additionalProperties": false, "required": [ "workflow", "phase", "project_id", "payload" ], "properties": { "workflow": { "const": "scene_list_revision" }, "phase": { "const": "source" }, "project_id": { "type": "integer" }, "payload": { "type": "object", "additionalProperties": false, "required": [ "revision_id", "context_selection" ], "properties": { "revision_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "source_selection": { "type": "object", "additionalProperties": false, "required": [ "proposal_id", "operation_ids" ], "properties": { "proposal_id": { "type": "string", "minLength": 1, "maxLength": 200 }, "operation_ids": { "type": "array", "maxItems": 500, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 120 } }, "edited_fields": { "type": "object", "maxProperties": 500, "additionalProperties": { "type": "object", "additionalProperties": true } } }, "description": "Saved parent proposal and selected operation/suggestion IDs for proposed-source comparison or development. Retain selection and any source page_proposal_ids through readiness, quote and Start." }, "page_proposal_ids": { "type": "array", "maxItems": 500, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 200 }, "description": "Source page candidates for readiness/quote/Start with source_selection; retain exact IDs. Apply selected drafts using top-level page_proposal_ids." }, "context_selection": { "additionalProperties": false, "properties": { "source_fingerprint": { "anyOf": [ { "type": "string", "pattern": "^[0-9a-f]{64}
quot; }, { "type": "null" } ] }, "planning_codes": { "items": { "type": "string", "minLength": 1 }, "title": "Planning Codes", "type": "array", "uniqueItems": true }, "proposed_page_ids": { "items": { "type": "string", "minLength": 1 }, "title": "Proposed Page Ids", "type": "array", "uniqueItems": true }, "canonical_page_ids": { "items": { "type": "string", "minLength": 1 }, "title": "Canonical Page Ids", "type": "array", "uniqueItems": true } }, "required": [ "planning_codes", "proposed_page_ids", "canonical_page_ids" ], "title": "PlanningContextSelection", "type": "object", "description": "Structural source inspection only: read complete selected records from the current authorized capture. Omit source_fingerprint to discover its version; retain the returned binding for further reads. Generation keeps the complete captured source." } }, "allOf": [ { "if": { "required": [ "page_proposal_ids" ] }, "then": { "required": [ "source_selection" ] } } ] } } } ] }

Output schema

story_revision_run output
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": [
    "workflow",
    "phase"
  ],
  "properties": {
    "credits_charged": {
      "type": "number",
      "minimum": 0
    },
    "credits_skipped_reason": {
      "type": "string"
    },
    "workflow": {
      "type": "string"
    },
    "phase": {
      "type": "string"
    },
    "async": {
      "type": "boolean"
    },
    "job_id": {
      "type": "string"
    },
    "reservation_id": {
      "type": "string"
    },
    "readiness": {
      "type": "object"
    },
    "result": {
      "type": "object"
    },
    "resource_links": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "pipeline_state": {
      "$ref": "./_common/pipeline_state.schema.json"
    },
    "next_actions": {
      "type": "array",
      "items": {
        "$ref": "./_common/next_action.schema.json"
      }
    }
  },
  "additionalProperties": true
}
← All toolsv1 · workflow_runner