fix(phase-6): 后端整量两处棘轮红闭环——归属谓词改走 TaskFinalizeSupport 出口、读类身份出口分母 64->65 点名登记

整量 mvn -o test 首跑 5540 例 2 红(闸门 73 格不覆盖这两把尺,正是 AGENTS 记的「full 闸门绿 != 后端整量绿」):

1) TaskLifecycleDebtRatchetTest 15 -> 16 文件:36e110d2 的 JdCollectTaskService#queryProgress 手抄了第 17 处归属谓词。按该棘轮设计意图改走公共出口 TaskFinalizeSupport.belongsToModule(与 JdResultIngestService 同形),不是把阈值调大。

2) RequestSuppliedIdentityOutletTest boundRead 64 -> 65:36e110d2 新增 GET /api/jd-collect/tasks/{taskId}/progress(用户端进度条),@RequestParam(user_id) 先过 requireOwnershipUserId(fail-closed),属覆盖面变大,按先例(128->129->130)点名登记并写清是谁的哪一笔。

复跑:点名 7 类 44 例绿;整量 5540 例 0 失败 19 skip BUILD SUCCESS(4:43)。
This commit is contained in:
2026-11-14 18:36:50 +08:00
parent 36e110d27c
commit 47278ee425
2 changed files with 7 additions and 2 deletions
@@ -14,6 +14,7 @@ import com.nanri.aiimage.modules.task.mapper.TaskScopeStateMapper;
import com.nanri.aiimage.modules.task.model.CollectChannel;
import com.nanri.aiimage.modules.task.model.entity.FileTaskEntity;
import com.nanri.aiimage.modules.task.model.entity.TaskScopeStateEntity;
import com.nanri.aiimage.modules.task.service.TaskFinalizeSupport;
import com.nanri.aiimage.common.security.AdminAuthSupport;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -180,7 +181,8 @@ public class JdCollectTaskService {
throw new BusinessException("任务 ID 不合法");
}
FileTaskEntity task = fileTaskMapper.selectById(taskId);
if (task == null || !MODULE_TYPE.equals(task.getModuleType())) {
// 归属谓词走公共出口(TaskLifecycleDebtRatchetTest 棘轮只许降:新增手写遍数即红)。
if (task == null || !TaskFinalizeSupport.belongsToModule(MODULE_TYPE, task.getModuleType())) {
throw new BusinessException("任务不存在: " + taskId);
}
if (userId != null && task.getUserId() != null && !Objects.equals(userId, task.getUserId())) {