speccrew 0.7.40 → 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.
@@ -160,7 +160,7 @@ ${api_list.error_codes}</field>
160
160
  <block type="gateway" id="G4" mode="exclusive" desc="Update progress based on mode">
161
161
  <branch test="${feature_id} != null" name="Feature mode">
162
162
  <block type="task" id="B10" action="run-script" desc="Update workflow progress for feature">
163
- <field name="command">node "${workspace_path}/scripts/update-progress.js" update-task --file "${iteration_path}/WORKFLOW-PROGRESS.json" --task-id "${feature_id}" --status confirmed --outputs '["02.feature-design/${feature_id}-${feature_name}-feature-spec.md","03.api-contract/${feature_id}-${feature_name}-api-contract.md"]'</field>
163
+ <field name="command">node "${workspace_path}/scripts/update-progress.js" update-task --file "${iteration_path}/WORKFLOW-PROGRESS.json" --stage 03_api_contract --task-id "${feature_id}" --status confirmed --outputs '["02.feature-design/${feature_id}-${feature_name}-feature-spec.md","03.api-contract/${feature_id}-${feature_name}-api-contract.md"]'</field>
164
164
  </block>
165
165
  </branch>
166
166
  <branch default="true" name="Module mode">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.7.40",
3
+ "version": "0.7.42",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {
@@ -652,13 +652,27 @@ function cmdUpdateTask(args) {
652
652
  outputError(`Stage not found: ${args.stage}`);
653
653
  }
654
654
  targetStage = data.stages[args.stage];
655
- if (!targetStage.features || !Array.isArray(targetStage.features)) {
656
- outputError(`Stage has no features array: ${args.stage}`);
655
+ if (!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
- outputError(`Task not found in stage ${args.stage}: ${args.taskId}`);
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];
662
676
  }
663
677
  } else {
664
678
  // Flat structure: data.tasks
@@ -667,9 +681,8 @@ function cmdUpdateTask(args) {
667
681
  if (taskIndex === -1 || taskIndex === undefined) {
668
682
  outputError(`Task not found: ${args.taskId}`);
669
683
  }
684
+ task = taskArray[taskIndex];
670
685
  }
671
-
672
- task = taskArray[taskIndex];
673
686
  const now = getTimestamp();
674
687
 
675
688
  // Update status