speccore 8.3.37 → 8.3.39

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.
@@ -1 +1 @@
1
- {"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../../../src/commands/iteration/split.ts"],"names":[],"mappings":"AAwIA,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AA+ID,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAi2BzF"}
1
+ {"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../../../src/commands/iteration/split.ts"],"names":[],"mappings":"AAwIA,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AA+ID,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAu2BzF"}
@@ -751,7 +751,10 @@ async function iterationSplitCommand(options) {
751
751
  }
752
752
  }
753
753
  // ── 1. 检查 ANALYSIS.md + AI 智能拆分建议 ──
754
- const analysisPath = (0, path_1.join)(iterationDir, '020-specs', 'ANALYSIS.md');
754
+ // v8.3.38: 兼容新旧结构
755
+ const analysisPathNew = (0, path_1.join)(iterationDir, '020-specs', spec_paths_1.GLOBAL_SPECS_DIR, 'ANALYSIS.md');
756
+ const analysisPathOld = (0, path_1.join)(iterationDir, '020-specs', 'ANALYSIS.md');
757
+ const analysisPath = await (0, fs_extra_1.pathExists)(analysisPathNew) ? analysisPathNew : analysisPathOld;
755
758
  if (await (0, fs_extra_1.pathExists)(analysisPath)) {
756
759
  const analysis = await (0, fs_extra_1.readFile)(analysisPath, 'utf-8');
757
760
  const blockerLines = analysis.split('\n').filter(l => l.includes('🔴') || l.includes('🚫') || l.toLowerCase().includes('blocker'));
@@ -867,7 +870,10 @@ async function iterationSplitCommand(options) {
867
870
  else {
868
871
  logger_1.logger.info(' ℹ️ 未找到 ANALYSIS.md,建议先运行 speccore analyze');
869
872
  }
870
- const reqFile = (0, path_1.join)(iterationDir, '020-specs', options.file || 'REQUIREMENT.md');
873
+ // v8.3.38: 兼容新旧结构 — 优先查新路径 020-specs/overview/REQUIREMENT.md,回退旧路径 020-specs/REQUIREMENT.md
874
+ const reqFileNew = (0, path_1.join)(iterationDir, '020-specs', spec_paths_1.GLOBAL_SPECS_DIR, options.file || 'REQUIREMENT.md');
875
+ const reqFileOld = (0, path_1.join)(iterationDir, '020-specs', options.file || 'REQUIREMENT.md');
876
+ const reqFile = await (0, fs_extra_1.pathExists)(reqFileNew) ? reqFileNew : reqFileOld;
871
877
  if (!(await (0, fs_extra_1.pathExists)(reqFile))) {
872
878
  spinner.fail(`Requirement file not found: ${reqFile}`);
873
879
  return;
@@ -1250,12 +1256,23 @@ async function createTaskFromSection(iterationDir, taskId, section, allPlatforms
1250
1256
  taskPlatforms = [section.platform];
1251
1257
  }
1252
1258
  else {
1253
- // v8.3.36: 从已加载的 specContents 推断平台(兼容新旧结构)
1259
+ // v8.3.38: 从已加载的 specContents 推断平台(兼容新旧结构 + 按功能模块过滤)
1254
1260
  taskPlatforms = [];
1255
1261
  const specKeys = Object.keys(specContents);
1262
+ // 从 section.name 提取功能模块名(去掉 "2.1 " 等前缀)
1263
+ const sectionFeatureName = section.name.replace(/^\d+(\.\d+)*\s*/, '').trim();
1256
1264
  for (const platform of allPlatforms) {
1257
1265
  // 新结构: {feature}/{platform}/TECH.md | 旧结构: {platform}/TECH.md
1258
- const hasPlatformTech = specKeys.some(key => key === `${platform}/TECH.md` || key.includes(`/${platform}/TECH.md`));
1266
+ const hasPlatformTech = specKeys.some(key => {
1267
+ if (key === `${platform}/TECH.md`)
1268
+ return true; // 旧结构
1269
+ if (key.includes(`/${platform}/TECH.md`)) {
1270
+ // 新结构:优先匹配当前功能模块下的端文档
1271
+ const keyFeature = key.split('/')[0];
1272
+ return sectionFeatureName.includes(keyFeature) || keyFeature.includes(sectionFeatureName);
1273
+ }
1274
+ return false;
1275
+ });
1259
1276
  if (hasPlatformTech) {
1260
1277
  taskPlatforms.push(platform);
1261
1278
  }
@@ -1281,6 +1298,7 @@ async function createTaskFromSection(iterationDir, taskId, section, allPlatforms
1281
1298
  subtaskIdMap.set(p, generateSubtaskId(taskNum, p));
1282
1299
  }
1283
1300
  // ── 1. 任务目录指引(功能模块分组) ──
1301
+ await (0, fs_extra_1.ensureDir)(taskDir);
1284
1302
  const isResearch = taskType === 'research';
1285
1303
  await (0, fs_extra_1.writeFile)((0, path_1.join)(taskDir, 'README.md'), isResearch
1286
1304
  ? `# ${section.name}
@@ -2245,7 +2263,10 @@ async function generateEnvExample(iterationDir, sections) {
2245
2263
  logger_1.logger.info(`Env example: ${iterationDir}/.env.example`);
2246
2264
  }
2247
2265
  async function injectTechFromAnalysis(iterationDir, taskDir, sectionName) {
2248
- const analysisPath = (0, path_1.join)(iterationDir, '020-specs', 'ANALYSIS.md');
2266
+ // v8.3.38: 兼容新旧结构
2267
+ const analysisPathNew = (0, path_1.join)(iterationDir, '020-specs', spec_paths_1.GLOBAL_SPECS_DIR, 'ANALYSIS.md');
2268
+ const analysisPathOld = (0, path_1.join)(iterationDir, '020-specs', 'ANALYSIS.md');
2269
+ const analysisPath = await (0, fs_extra_1.pathExists)(analysisPathNew) ? analysisPathNew : analysisPathOld;
2249
2270
  if (!(await (0, fs_extra_1.pathExists)(analysisPath)))
2250
2271
  return;
2251
2272
  const analysis = await (0, fs_extra_1.readFile)(analysisPath, 'utf-8');