1use schemars::JsonSchema;
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
15#[schemars(
16 title = "SubtaskItem",
17 description = "One proposed child session in an orchestrator decomposition plan. Each subtask \
18 runs unattended in its own worktree branched from the same base branch, so it \
19 must be completable without coordinating with its siblings."
20)]
21pub struct SubtaskItem {
22 #[schemars(
24 title = "prompt",
25 description = "Complete standalone prompt for the child session. The child sees only this \
26 prompt and the repository, so restate every constraint it needs instead of \
27 referring back to the plan or to sibling subtasks."
28 )]
29 pub prompt: String,
30 #[schemars(
32 title = "task_key",
33 description = "Short stable `kebab-case` identifier for this subtask, unique within the \
34 plan. Reuse the exact same key when re-proposing a subtask so a retry \
35 replaces the previous attempt instead of creating a duplicate."
36 )]
37 pub task_key: String,
38 #[schemars(
40 title = "title",
41 description = "Short human-readable title describing what this subtask delivers."
42 )]
43 pub title: String,
44 #[serde(default)]
47 #[schemars(
48 title = "touched_areas",
49 description = "Literal repository-relative file or directory paths this subtask expects \
50 to modify. Wildcard patterns are not supported. These sets must not \
51 overlap between subtasks in the same plan. Defaults to an empty list when \
52 omitted, which is rejected as an unplanned subtask."
53 )]
54 pub touched_areas: Vec<String>,
55}