MCP: Coverage (#195) #209

Merged
crowmaki merged 2 commits from issue-195-mcp-coverage into main 2026-10-14 02:41:41 +00:00
Owner

Closes #195. Part of #157.

What changed

  • Read: read_coverage returns a Scene's cast and each member's Look, Wardrobe item and whether they speak. It also returns the Setups in order, each with its label, framing note, location angle, subjects and Shots. Each Shot has its label (12A, or 12B·1, 12B·2), its run of Lines, its length and its aspect ratio. angleChoices lists the Tiles a Setup can take as its location angle.
  • Cast: add_to_cast, remove_from_cast, set_cast_look and set_cast_wardrobe each return read_coverage.
  • Setups: add_setup returns the new Setup. delete_setup and reorder_setups return read_coverage. set_setup_framing_note, set_setup_location_angle, add_setup_subject, remove_setup_subject and reorder_setup_subjects return the Setup.
  • Shots: add_shot returns { shotId, setup }. split_shot returns { shotIds, setup }. set_shot_lines, set_shot_length, set_shot_aspect_ratio and delete_shot return the Setup, so the new labels show.
  • Action text: read_shot_action_text reads the action text and summary. set_shot_action_text and set_shot_summary take nodes; without nodes, each follows its default again. ActionNodeDto now derives JsonSchema.
  • Prompt: read_shot_prompt returns the composed text, the override, composerChanged, brokenTags and queueBlock. set_shot_prompt_override, reconcile_shot_prompt (hunks) and finish_reconcile (rebase) complete the set.
  • Slots: read_shot_slots, set_shot_slot_list (per medium) and reset_shot_slot_lists. SlotPlacementDto now derives JsonSchema.
  • Atlases: read_setup_atlases, set_setup_atlas_groups, and set_setup_atlas_size, which takes a budgetPixels, native, or neither to follow the Project's size.

Review notes

  • The broken-slot-tag error. The core saves an override with a broken tag, as the UI does, and refuses it only when a Take is queued. So the save does not fail. read_shot_prompt and the override tools return queueBlock, the exact error that queuing would give. The new plain ApiImpl::shot_prompt_and_block reads it from the core's queueable_prompt. Please confirm this is how you read "an override with a broken slot tag returns the app's error".
  • What the deletes return. delete_setup and delete_shot return the coverage or the Setup, not the undo state that the Entity deletes return. This lets a harness see the new labels straight away. The undo label is still available from undo_state.
  • Not exposed: Shot complex/previz, Board options and clearing the Slot lists' "new" badges. The last is left out so that an agent can't hide new references from the filmmaker.

Tests

src-tauri/tests/mcp_coverage.rs has 11 tests at the MCP boundary. Every edit goes through h.edit, which asserts that a change event was emitted, and there are undo checks on cast, Setup, Shot and prompt edits. They cover:

  • Setups and Shots added, split, deleted and reordered, read back with their labels.
  • The composed prompt, a <Picture 9> override that returns queueBlock, and a reconcile that is run and finished.
  • Slot list reorder and exclude, which round-trip and reset.
  • Atlas regrouping and the three size modes.
  • Refusals without a Project and for unknown ids.

cargo test --workspace passes.

Closes #195. Part of #157. ## What changed - **Read:** `read_coverage` returns a Scene's cast and each member's Look, Wardrobe item and whether they speak. It also returns the Setups in order, each with its label, framing note, location angle, subjects and Shots. Each Shot has its label (`12A`, or `12B·1`, `12B·2`), its run of Lines, its length and its aspect ratio. `angleChoices` lists the Tiles a Setup can take as its location angle. - **Cast:** `add_to_cast`, `remove_from_cast`, `set_cast_look` and `set_cast_wardrobe` each return `read_coverage`. - **Setups:** `add_setup` returns the new Setup. `delete_setup` and `reorder_setups` return `read_coverage`. `set_setup_framing_note`, `set_setup_location_angle`, `add_setup_subject`, `remove_setup_subject` and `reorder_setup_subjects` return the Setup. - **Shots:** `add_shot` returns `{ shotId, setup }`. `split_shot` returns `{ shotIds, setup }`. `set_shot_lines`, `set_shot_length`, `set_shot_aspect_ratio` and `delete_shot` return the Setup, so the new labels show. - **Action text:** `read_shot_action_text` reads the action text and summary. `set_shot_action_text` and `set_shot_summary` take nodes; without nodes, each follows its default again. `ActionNodeDto` now derives `JsonSchema`. - **Prompt:** `read_shot_prompt` returns the composed text, the override, `composerChanged`, `brokenTags` and `queueBlock`. `set_shot_prompt_override`, `reconcile_shot_prompt` (hunks) and `finish_reconcile` (rebase) complete the set. - **Slots:** `read_shot_slots`, `set_shot_slot_list` (per medium) and `reset_shot_slot_lists`. `SlotPlacementDto` now derives `JsonSchema`. - **Atlases:** `read_setup_atlases`, `set_setup_atlas_groups`, and `set_setup_atlas_size`, which takes a `budgetPixels`, `native`, or neither to follow the Project's size. ## Review notes - **The broken-slot-tag error.** The core saves an override with a broken tag, as the UI does, and refuses it only when a Take is queued. So the save does not fail. `read_shot_prompt` and the override tools return `queueBlock`, the exact error that queuing would give. The new plain `ApiImpl::shot_prompt_and_block` reads it from the core's `queueable_prompt`. Please confirm this is how you read "an override with a broken slot tag returns the app's error". - **What the deletes return.** `delete_setup` and `delete_shot` return the coverage or the Setup, not the undo state that the Entity deletes return. This lets a harness see the new labels straight away. The undo label is still available from `undo_state`. - **Not exposed:** Shot complex/previz, Board options and clearing the Slot lists' "new" badges. The last is left out so that an agent can't hide new references from the filmmaker. ## Tests `src-tauri/tests/mcp_coverage.rs` has 11 tests at the MCP boundary. Every edit goes through `h.edit`, which asserts that a change event was emitted, and there are undo checks on cast, Setup, Shot and prompt edits. They cover: - Setups and Shots added, split, deleted and reordered, read back with their labels. - The composed prompt, a `<Picture 9>` override that returns `queueBlock`, and a reconcile that is run and finished. - Slot list reorder and exclude, which round-trip and reset. - Atlas regrouping and the three size modes. - Refusals without a Project and for unknown ids. `cargo test --workspace` passes.
read_coverage shows a Scene's cast, its Setups with their Shots (labels,
runs of Lines, lengths, aspect ratios) and the angles a Setup can take.
Tools change the cast and each member's Look and Wardrobe item; add,
delete and reorder Setups and set their framing note, location angle and
subjects; add Shots over runs of Lines, set their Lines, length and aspect
ratio, split and delete them; read and set action text and summaries;
read the composed prompt, set a Prompt override, and run and finish a
reconcile; read and set Slot lists; and read and set a Setup's Atlas
groups and size.

read_shot_prompt carries queueBlock, the error queuing a Take is refused
with while the override has a broken slot tag.
Tool descriptions name what split_shot resets, the runs add_shot and
set_shot_lines refuse, finish_reconcile's refusals, and the audio Slot
list a Performance fills.
crowmaki deleted branch issue-195-mcp-coverage 2026-10-14 02:41:41 +00:00
Sign in to join this conversation.
No description provided.