feat(KB-040): add break-into-subtasks toggle for task creation

- Add breakIntoSubtasks flag to core Task model and persist to store
- Plumb subtask flag through dashboard API routes with validation
- Add subtask toggle UI to inline task creation card
- Update triage agent to handle automatic subtask breakdown when enabled
- Add comprehensive tests for store, API routes, and UI components
- Include changeset for patch release documenting the new feature
This commit is contained in:
gsxdsm
2026-03-29 22:23:47 -07:00
parent 1b5511c968
commit f99ae366f7
11 changed files with 327 additions and 13 deletions

View File

@@ -105,6 +105,32 @@ describe("TaskStore", () => {
expect(detail.prompt).toMatch(/^# KB-001: Add caching\n/);
expect(detail.prompt).toContain("Implement caching layer for API responses");
});
});
describe("breakIntoSubtasks task creation flag", () => {
it("persists breakIntoSubtasks=true when explicitly requested", async () => {
const task = await store.createTask({
description: "Large feature",
breakIntoSubtasks: true,
});
expect(task.breakIntoSubtasks).toBe(true);
const detail = await store.getTask(task.id);
expect(detail.breakIntoSubtasks).toBe(true);
});
it("leaves breakIntoSubtasks unset by default", async () => {
const task = await store.createTask({
description: "Regular task",
});
expect(task.breakIntoSubtasks).toBeUndefined();
const detail = await store.getTask(task.id);
expect(detail.breakIntoSubtasks).toBeUndefined();
});
});
// ── Lock serialization test ──────────────────────────────────────

View File

@@ -193,6 +193,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
description: input.description,
column: input.column || "triage",
dependencies: input.dependencies || [],
breakIntoSubtasks: input.breakIntoSubtasks === true ? true : undefined,
steps: [],
currentStep: 0,
log: [{ timestamp: now, action: "Task created" }],

View File

@@ -104,6 +104,8 @@ export interface Task {
description: string;
column: Column;
dependencies: string[];
/** User-requested hint for triage: prefer splitting into child tasks when appropriate. */
breakIntoSubtasks?: boolean;
worktree?: string;
steps: TaskStep[];
currentStep: number;
@@ -166,6 +168,7 @@ export interface TaskCreateInput {
description: string;
column?: Column;
dependencies?: string[];
breakIntoSubtasks?: boolean;
}
export interface Settings {