feat(KB-636): add Missions system for large-scale project planning

- Fix TaskStore sliceId persistence and bidirectional linking between tasks and features
- Add comprehensive mission integration tests for hierarchy, status rollup, and events
- Enhance E2E tests with reorder, cascade delete, and error handling coverage
- Add scheduler integration tests for mission slice activation
- Fix duplicate mission commands in CLI help text
- Add changeset for missions launch
This commit is contained in:
gsxdsm
2026-04-01 08:04:51 -07:00
parent df63396830
commit 6009ebaf06
12 changed files with 477 additions and 12 deletions

View File

@@ -919,6 +919,11 @@ export class MissionStore extends EventEmitter<MissionStoreEvents> {
status: "triaged",
});
// Also update the task's sliceId for bidirectional linking
this.db.prepare(`
UPDATE tasks SET sliceId = ? WHERE id = ?
`).run(feature.sliceId, taskId);
this.emit("feature:linked", { feature: updated, taskId });
// Recompute slice status
@@ -941,11 +946,21 @@ export class MissionStore extends EventEmitter<MissionStoreEvents> {
throw new Error(`Feature ${featureId} not found`);
}
// Get the taskId before clearing it
const { taskId } = feature;
const updated = this.updateFeature(featureId, {
taskId: undefined,
status: "defined",
});
// Clear the task's sliceId
if (taskId) {
this.db.prepare(`
UPDATE tasks SET sliceId = NULL WHERE id = ?
`).run(taskId);
}
// Recompute slice status
this.recomputeSliceStatus(updated.sliceId);