feat(KB-635): add Mission system integration across CLI, engine, and dashboard

- Add mission CLI commands: create, list, show, delete, activate-slice
- Add pi extension tools for mission management
- Add MissionStore helper methods and Mission types
- Add scheduler mission awareness for automatic slice activation
- Add engine integration wiring for mission-aware task execution
- Add dashboard mission routes and API endpoints
- Link tasks to missions via sliceId field with autoAdvance support
This commit is contained in:
gsxdsm
2026-04-01 07:49:21 -07:00
parent 021055c82a
commit 360af7d863
11 changed files with 1032 additions and 50 deletions

View File

@@ -725,6 +725,29 @@ export class MissionStore extends EventEmitter<MissionStoreEvents> {
return updated;
}
/**
* Find the next pending slice in a mission.
* Iterates milestones by orderIndex, then slices by orderIndex,
* and returns the first slice with status "pending".
*
* @param missionId - Mission ID
* @returns The next pending slice, or undefined if none found
*/
findNextPendingSlice(missionId: string): Slice | undefined {
const milestones = this.listMilestones(missionId);
for (const milestone of milestones) {
const slices = this.listSlices(milestone.id);
for (const slice of slices) {
if (slice.status === "pending") {
return slice;
}
}
}
return undefined;
}
// ── Feature Operations ─────────────────────────────────────────────
/**
@@ -929,6 +952,29 @@ export class MissionStore extends EventEmitter<MissionStoreEvents> {
return updated;
}
/**
* Update a feature's status.
* Recomputes slice status after update.
*
* @param featureId - Feature ID
* @param status - New status
* @returns The updated feature
* @throws Error if feature not found
*/
updateFeatureStatus(featureId: string, status: FeatureStatus): MissionFeature {
const feature = this.getFeature(featureId);
if (!feature) {
throw new Error(`Feature ${featureId} not found`);
}
const updated = this.updateFeature(featureId, { status });
// Recompute slice status
this.recomputeSliceStatus(updated.sliceId);
return updated;
}
/**
* Find a feature by its linked task ID.
*

View File

@@ -48,6 +48,8 @@ export interface Mission {
status: MissionStatus;
/** State of the AI specification interview process */
interviewState: InterviewState;
/** When true, automatically activate the next pending slice when current slice completes */
autoAdvance?: boolean;
/** ISO-8601 timestamp of creation */
createdAt: string;
/** ISO-8601 timestamp of last update */

View File

@@ -426,6 +426,8 @@ export interface Task {
summary?: string;
/** Files modified during agent execution, captured at task completion time */
modifiedFiles?: string[];
/** Optional ID of the slice this task is linked to (for mission-based work) */
sliceId?: string;
/** ISO-8601 timestamp of when the task last entered its current column.
* Used to sort cards within a column so that recently-moved cards appear at the top. */
columnMovedAt?: string;