speccore 8.3.4 → 8.3.6
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/dist/commands/iteration/split.d.ts.map +1 -1
- package/dist/commands/iteration/split.js +57 -14
- package/dist/commands/iteration/split.js.map +1 -1
- package/dist/commands/plan.js +1 -1
- package/dist/commands/plan.js.map +1 -1
- package/dist/core/prompt-builder.d.ts.map +1 -1
- package/dist/core/prompt-builder.js +17 -2
- package/dist/core/prompt-builder.js.map +1 -1
- package/dist/core/state.d.ts +2 -0
- package/dist/core/state.d.ts.map +1 -1
- package/dist/core/state.js +23 -1
- package/dist/core/state.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../../../src/commands/iteration/split.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../../../src/commands/iteration/split.ts"],"names":[],"mappings":"AAuIA,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;AAoCD,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+0BzF"}
|
|
@@ -51,6 +51,7 @@ const questions_1 = require("../../core/questions");
|
|
|
51
51
|
const pipeline_engine_1 = require("../../core/pipeline-engine");
|
|
52
52
|
const code_scanner_1 = require("../../core/code-scanner");
|
|
53
53
|
const knowledge_graph_1 = require("../../core/knowledge-graph");
|
|
54
|
+
const git_integration_1 = require("../../core/git-integration");
|
|
54
55
|
/**
|
|
55
56
|
* 将 AI 返回的 scope 简写映射到 CONSTITUTION.md 标准端名
|
|
56
57
|
* v6.69.3+: 解决中文简写(如 "后端"、"admin")导致目录名错误的问题
|
|
@@ -1092,9 +1093,50 @@ function filterTemplateNoise(sections) {
|
|
|
1092
1093
|
return true;
|
|
1093
1094
|
});
|
|
1094
1095
|
}
|
|
1096
|
+
// v8.3.4+: 从迭代目录路径提取迭代名(如 Iteration-011-meeting-upgrade → 011-meeting-upgrade)
|
|
1097
|
+
function extractIterationName(iterationDir) {
|
|
1098
|
+
const base = iterationDir.split('/').pop() || '';
|
|
1099
|
+
return base.replace(/^Iteration-/, '');
|
|
1100
|
+
}
|
|
1101
|
+
/** 生成带实际配置值的 git-config 内容 */
|
|
1102
|
+
function buildGitConfigContent(config, platformLabel, taskType) {
|
|
1103
|
+
const branchType = taskType === 'bugfix' ? 'bugfix' : taskType === 'refactor' ? 'refactor' : taskType === 'research' ? 'research' : 'feature';
|
|
1104
|
+
const exampleName = 'example-task';
|
|
1105
|
+
const exampleHash = 'a1b2';
|
|
1106
|
+
const prefix = config.branchPrefix ? `${config.branchPrefix}-` : '';
|
|
1107
|
+
return `# 子任务级 Git 配置(${platformLabel})
|
|
1108
|
+
# 以下配置覆盖迭代级 PROJECT_GRAPH.md,未配置项自动继承上一级。
|
|
1109
|
+
# 当前值已从迭代级/全局级配置自动填充,可直接使用或按需修改。
|
|
1110
|
+
|
|
1111
|
+
# === 当前生效配置 ===
|
|
1112
|
+
源分支: ${config.defaultBranch}
|
|
1113
|
+
分支前缀: ${config.branchPrefix || '(空)'}
|
|
1114
|
+
分支格式: ${config.branchFormat}
|
|
1115
|
+
自动拉取: ${config.autoPull ? 'true' : 'false'}
|
|
1116
|
+
远程名称: ${config.remoteName}
|
|
1117
|
+
|
|
1118
|
+
# === 保护分支(禁止直接推送)===
|
|
1119
|
+
${config.protectedBranches.map(b => `- ${b}`).join('\n')}
|
|
1120
|
+
|
|
1121
|
+
# === 分支命名示例 ===
|
|
1122
|
+
# 当前任务类型: ${branchType}
|
|
1123
|
+
# 命名格式: ${config.branchFormat}
|
|
1124
|
+
# 示例分支: ${branchType}/${prefix}${exampleName}-${exampleHash}
|
|
1125
|
+
# ({hash4} 为自动生成的 4 位随机字符)
|
|
1126
|
+
|
|
1127
|
+
# === 自定义配置区 ===
|
|
1128
|
+
# 如需覆盖上述值,取消下方注释并修改:
|
|
1129
|
+
# 源分支: ${config.defaultBranch}
|
|
1130
|
+
# 分支前缀:
|
|
1131
|
+
# 分支格式: {type}/{prefix}{name}-{hash4}
|
|
1132
|
+
# 自动拉取: false
|
|
1133
|
+
# 远程名称: origin
|
|
1134
|
+
`;
|
|
1135
|
+
}
|
|
1095
1136
|
async function createTaskFromSection(iterationDir, taskId, section, allPlatforms, taskType = 'feature', allSections) {
|
|
1096
1137
|
// taskId 已含 slug(nextTaskId 返回 Task-NNN-slug),直接用
|
|
1097
1138
|
const taskDir = (0, path_1.join)(iterationDir, '030-tasks', taskType, taskId);
|
|
1139
|
+
const iterationName = extractIterationName(iterationDir);
|
|
1098
1140
|
// 确定任务涉及的端:优先使用 AI 标注的 _scopePlatforms,否则从 020-specs/{端}/TECH.md 是否存在且有内容来推断
|
|
1099
1141
|
let taskPlatforms;
|
|
1100
1142
|
if (section._scopePlatforms && section._scopePlatforms.length > 0) {
|
|
@@ -1220,6 +1262,9 @@ ${taskPlatforms.map((p) => `| ${subtaskIdMap.get(p)} | ${p} | ${owner} | 🔲
|
|
|
1220
1262
|
await (0, fs_extra_1.writeFile)((0, path_1.join)(taskDir, '.meta', 'status'), 'todo');
|
|
1221
1263
|
await (0, fs_extra_1.writeFile)((0, path_1.join)(taskDir, '.meta', 'owner'), owner);
|
|
1222
1264
|
await (0, fs_extra_1.writeFile)((0, path_1.join)(taskDir, '.meta', 'created-at'), today);
|
|
1265
|
+
// v8.3.5+: 写入预估工时到 .meta/estimated-hours,供 plan/状态面板读取
|
|
1266
|
+
const taskHours = section._complexity?.estimatedHours || complexity.estimatedHours || 8;
|
|
1267
|
+
await (0, fs_extra_1.writeFile)((0, path_1.join)(taskDir, '.meta', 'estimated-hours'), String(taskHours));
|
|
1223
1268
|
await (0, fs_extra_1.ensureDir)((0, path_1.join)(taskDir, '_shared'));
|
|
1224
1269
|
await (0, fs_extra_1.ensureDir)((0, path_1.join)(taskDir, '00-specs'));
|
|
1225
1270
|
// v6.70.0+: 优先复制全局 API_CONTRACT.yaml(全局契约是单一真相源)
|
|
@@ -1421,23 +1466,18 @@ ${section.content}
|
|
|
1421
1466
|
await (0, fs_extra_1.writeFile)((0, path_1.join)(subtaskDir, '.meta', 'status'), 'todo');
|
|
1422
1467
|
await (0, fs_extra_1.writeFile)((0, path_1.join)(subtaskDir, '.meta', 'owner'), owner);
|
|
1423
1468
|
await (0, fs_extra_1.writeFile)((0, path_1.join)(subtaskDir, '.meta', 'created-at'), today);
|
|
1469
|
+
// v8.3.5+: 子任务工时(按端均分或保持父任务工时)
|
|
1470
|
+
const subHours = complexity.estimatedHours || 8;
|
|
1471
|
+
await (0, fs_extra_1.writeFile)((0, path_1.join)(subtaskDir, '.meta', 'estimated-hours'), String(subHours));
|
|
1424
1472
|
// 功能单元标识(v6.49.2+):默认取 section 的 functionalUnit 或 section.name
|
|
1425
1473
|
const featureName = section.functionalUnit || section.name || '未分类';
|
|
1426
1474
|
await (0, fs_extra_1.writeFile)((0, path_1.join)(subtaskDir, '.meta', 'feature'), featureName);
|
|
1427
1475
|
// src/ + tests/ 目录(AI 执行时代码输出位置)
|
|
1428
1476
|
await (0, fs_extra_1.ensureDir)((0, path_1.join)(subtaskDir, 'src'));
|
|
1429
1477
|
await (0, fs_extra_1.ensureDir)((0, path_1.join)(subtaskDir, 'tests'));
|
|
1430
|
-
// git-config
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
# 修改时去掉注释符 #,填入具体值即可。
|
|
1434
|
-
|
|
1435
|
-
# 源分支: 继承迭代配置
|
|
1436
|
-
# 分支前缀: 继承迭代配置
|
|
1437
|
-
# 分支格式: 继承迭代配置
|
|
1438
|
-
# 自动拉取: 继承迭代配置
|
|
1439
|
-
# 远程名称: 继承迭代配置
|
|
1440
|
-
`);
|
|
1478
|
+
// v8.3.4+: git-config 自动填充 — 读取迭代级/全局级实际配置值写入
|
|
1479
|
+
const gitConfig = (0, git_integration_1.loadGitConfig)(iterationName);
|
|
1480
|
+
await (0, fs_extra_1.writeFile)((0, path_1.join)(subtaskDir, '.meta', 'git-config'), buildGitConfigContent(gitConfig, platformLabel, section.type));
|
|
1441
1481
|
// v6.70.0+: 从 section 提取接口/页面清单用于 TASK.md
|
|
1442
1482
|
const apiLines = section.content.split('\n').filter(l => l.includes('| GET') || l.includes('| POST') || l.includes('| PUT') || l.includes('| DELETE') || l.includes('| PATCH'));
|
|
1443
1483
|
const apiList = apiLines.length > 0
|
|
@@ -1596,12 +1636,15 @@ ${isBk ? apiList : pageList}
|
|
|
1596
1636
|
await (0, fs_extra_1.writeFile)((0, path_1.join)(autoSubtaskDir, '.meta', 'status'), 'todo');
|
|
1597
1637
|
await (0, fs_extra_1.writeFile)((0, path_1.join)(autoSubtaskDir, '.meta', 'owner'), owner);
|
|
1598
1638
|
await (0, fs_extra_1.writeFile)((0, path_1.join)(autoSubtaskDir, '.meta', 'created-at'), today);
|
|
1639
|
+
// v8.3.5+: 子任务工时
|
|
1640
|
+
const autoHours = complexity.estimatedHours || 8;
|
|
1641
|
+
await (0, fs_extra_1.writeFile)((0, path_1.join)(autoSubtaskDir, '.meta', 'estimated-hours'), String(autoHours));
|
|
1599
1642
|
// 功能单元标识(v6.49.2+)
|
|
1600
1643
|
const featureName = section.functionalUnit || section.name || '未分类';
|
|
1601
1644
|
await (0, fs_extra_1.writeFile)((0, path_1.join)(autoSubtaskDir, '.meta', 'feature'), featureName);
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1645
|
+
// v8.3.4+: git-config 自动填充
|
|
1646
|
+
const gitConfig = (0, git_integration_1.loadGitConfig)(iterationName);
|
|
1647
|
+
await (0, fs_extra_1.writeFile)((0, path_1.join)(autoSubtaskDir, '.meta', 'git-config'), buildGitConfigContent(gitConfig, '后端', section.type));
|
|
1605
1648
|
await (0, fs_extra_1.writeFile)((0, path_1.join)(autoSubtaskDir, 'TASK.md'), `# ${section.name} — ${fallbackBackend}(自动补充)
|
|
1606
1649
|
|
|
1607
1650
|
## 子任务信息
|