@peterxiaoyang/superspec 0.1.53 → 0.1.54
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/transition.js +21 -1
- package/package.json +1 -1
package/dist/transition.js
CHANGED
|
@@ -1016,6 +1016,24 @@ function applyPlanningMaterialsChanged(changeRoot, events) {
|
|
|
1016
1016
|
const baseline = latestApplyPlanningBaseline(events);
|
|
1017
1017
|
return baseline != null && applyPlanningDocsChangedSinceBaseline(changeRoot, baseline);
|
|
1018
1018
|
}
|
|
1019
|
+
/**
|
|
1020
|
+
* self-test-fix 由使用者明确指定已完成的父 task;它可以修复早于当前
|
|
1021
|
+
* Apply round 的实现问题。普通 Apply 仍只消费当前轮完成事件,这个查询
|
|
1022
|
+
* 只用于自测修复的人工关联,不改变任务完成判定。
|
|
1023
|
+
*/
|
|
1024
|
+
function hasHistoricalTaskCompletion(events, taskId) {
|
|
1025
|
+
return events.some(event => {
|
|
1026
|
+
if (event.event_type !== "task_completed")
|
|
1027
|
+
return false;
|
|
1028
|
+
const payload = event.payload;
|
|
1029
|
+
if (payload.task_id !== taskId || typeof payload.attempt_id !== "string")
|
|
1030
|
+
return false;
|
|
1031
|
+
const checkboxUpdate = payload.checkbox_update;
|
|
1032
|
+
if (!checkboxUpdate || typeof checkboxUpdate !== "object" || Array.isArray(checkboxUpdate))
|
|
1033
|
+
return true;
|
|
1034
|
+
return checkboxUpdate.status !== "failed";
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1019
1037
|
function proposalReopenBaseline(changeRoot, events, source) {
|
|
1020
1038
|
const applyBaseline = ["apply", "apply_done", "review"].includes(source)
|
|
1021
1039
|
? latestApplyPlanningBaseline(events)
|
|
@@ -1154,7 +1172,9 @@ export function reopen(projectRoot, change, changeRoot, to, reason, opts = {}) {
|
|
|
1154
1172
|
if (pendingStatus.pending.length > 0 || snapshot.active_task_attempts.some(attempt => attempt.state === "active")) {
|
|
1155
1173
|
return { skip: true, message: "自测修复只允许在当前 task 全部完成且没有活跃执行尝试后创建" };
|
|
1156
1174
|
}
|
|
1157
|
-
if (pendingStatus.mode === "contract" &&
|
|
1175
|
+
if (pendingStatus.mode === "contract" &&
|
|
1176
|
+
!pendingStatus.completedByEvent.includes(parentTaskId) &&
|
|
1177
|
+
!hasHistoricalTaskCompletion(events, parentTaskId)) {
|
|
1158
1178
|
return { skip: true, message: `自测修复关联的 task ${parentTaskId} 缺少完成事件,不能只依赖 checkbox` };
|
|
1159
1179
|
}
|
|
1160
1180
|
if (pendingStatus.mode === "legacy" && !parentTask.done) {
|