speccrew 0.7.41 → 0.7.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.7.41",
3
+ "version": "0.7.42",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {
@@ -653,15 +653,26 @@ function cmdUpdateTask(args) {
653
653
  }
654
654
  targetStage = data.stages[args.stage];
655
655
  if (!targetStage.features) {
656
- targetStage.features = [];
656
+ targetStage.features = {};
657
657
  }
658
- taskArray = targetStage.features;
659
- taskIndex = taskArray.findIndex(t => t.id === args.taskId);
660
- if (taskIndex === -1) {
661
- // UPSERT: Task not found, create new entry
662
- console.error(`Info: Task ${args.taskId} not found in stage ${args.stage}, creating new entry`);
663
- taskArray.push({ id: args.taskId, status: 'pending' });
664
- taskIndex = taskArray.length - 1;
658
+ const features = targetStage.features;
659
+ if (Array.isArray(features)) {
660
+ // Array form: [{id: "F-M08-03", ...}, ...]
661
+ taskArray = features;
662
+ taskIndex = taskArray.findIndex(t => t.id === args.taskId);
663
+ if (taskIndex === -1) {
664
+ console.error(`Info: Task ${args.taskId} not found in stage ${args.stage}, creating new entry`);
665
+ taskArray.push({ id: args.taskId, status: 'pending' });
666
+ taskIndex = taskArray.length - 1;
667
+ }
668
+ task = taskArray[taskIndex];
669
+ } else {
670
+ // Object form: { "F-M08-03": { status: ... }, ... }
671
+ if (!features[args.taskId]) {
672
+ console.error(`Info: Task ${args.taskId} not found in stage ${args.stage}, creating new entry`);
673
+ features[args.taskId] = { status: 'pending' };
674
+ }
675
+ task = features[args.taskId];
665
676
  }
666
677
  } else {
667
678
  // Flat structure: data.tasks
@@ -670,9 +681,8 @@ function cmdUpdateTask(args) {
670
681
  if (taskIndex === -1 || taskIndex === undefined) {
671
682
  outputError(`Task not found: ${args.taskId}`);
672
683
  }
684
+ task = taskArray[taskIndex];
673
685
  }
674
-
675
- task = taskArray[taskIndex];
676
686
  const now = getTimestamp();
677
687
 
678
688
  // Update status