|
|
@@ -0,0 +1,85 @@
|
|
|
+# 任务-激励批次 · 契约核对结论(22 SC · 防假 RED)
|
|
|
+
|
|
|
+> 归属:契约补建计划 P0「任务-激励」· 核对时间 2026-11-07 01:14
|
|
|
+> 开工包:`docs/tdd/orchestration/task-incentive-kickoff-20261107.md`(commit `ce8c4b4b7`,已合入 `origin/cfclub`)
|
|
|
+> 核对基准:`origin/cfclub` cfc-backend controller 源码(`git show origin/cfclub:<file>`,只读,未改工作区)
|
|
|
+> 结论:**22/22 SC 接口均已实现 · 0 能力端点缺失 · 4 处契约路径引用需修正**(能力均存在,仅路径命名不同,契约须以真实路径为准,防假 RED)
|
|
|
+
|
|
|
+## 核对方法
|
|
|
+
|
|
|
+- 类级:`git grep '@RequestMapping' origin/cfclub -- controller` 定位全部相关 Controller。
|
|
|
+- 方法级:逐 Controller `git show origin/cfclub:<file>` 提取 `@PostMapping` 路径(项目约定统一 `@PostMapping`,无 Get/Put/Delete 路由,符合 AGENTS.md 规范)。
|
|
|
+- 比对:开工包 22 个 SC 的「契约接口范围」列逐端点与真实映射比对,记录「缺失端点」与「路径差异」。
|
|
|
+
|
|
|
+## 端点核对总览(17 个依赖 Controller)
|
|
|
+
|
|
|
+| Controller | 类级路径 | 开工包引用端点 | 核对结果 |
|
|
|
+|---|---|---|---|
|
|
|
+| TaskController | `/api/tasks` | create / today / {id}/complete / {id}/start / {id}/review / history / pending-review / reject/{id} / batch-complete / batch-delete / list | ✅ 均存在 |
|
|
|
+| WishController | `/api/wishes` | create / {id}/set-price / {id}/price / {id}/reject / {id}/exchange / {id}/approve-exchange / {id}/fulfill / {id}/confirm / {id}/cancel / list / pending | ✅ 均存在 |
|
|
|
+| BadgeController | `/api/badges` | all / list / detail / create / update / delete / member/list / ranking/family | ✅ 均存在 |
|
|
|
+| DailyCheckinController | `/api/daily/checkin` | create | ✅ 存在 |
|
|
|
+| DailyTaskController | `/api/daily-task` | overview | ✅ 存在 |
|
|
|
+| GrowthTaskController | `/api/growth-task` | list / claim / accept-dynamic | ⚠️ `/batch-complete` 不存在(见差异①) |
|
|
|
+| PointsExchangeController | `/api/points/exchange` | product/list / product/detail / records | ⚠️ `/create` 不存在,实为 `/submit`(见差异②) |
|
|
|
+| TaskReminderConfigController | `/api/task/reminder-config` | get / save | ✅ 均存在 |
|
|
|
+| TaskTemplatePackageController | `/api/packages` | `/`(root) / create / my | ✅ 均存在 |
|
|
|
+| GameRecordController | `/api/game` | record / history / leaderboard | ✅ 均存在 |
|
|
|
+| MarketController | `/api/market` | packages / plans(基路径) | ✅ 存在 |
|
|
|
+| ActivityController | `/api/activity` | list / detail / register / checkin / checkin-review | ✅ 均存在 |
|
|
|
+| FoodRecommendController | `/api/food/recommendation` | index / history / by-family / members(基路径) | ✅ 存在 |
|
|
|
+| MealRecommendController | `/api/meal` | recommend / log / logs | ✅ 均存在 |
|
|
|
+| AttributionController | `/api/attribution` | analyze | ✅ 存在 |
|
|
|
+| EnergyController | `/api/energy` | logs / grant / deduct-for-wish / overview | ✅ 均存在 |
|
|
|
+| AdminChallengeScoreConfigController | `/api/admin/challenge-score-config` | list / update | ✅ 均存在 |
|
|
|
+
|
|
|
+## 路径差异(4 处 · 能力均存在,仅契约引用路径需修正)
|
|
|
+
|
|
|
+| # | SC | 契约引用(开工包) | 实际实现路径 | 说明 |
|
|
|
+|---|---|---|---|---|
|
|
|
+| ① | SC-T-18 | `/api/growth-task/batch-complete` | `/api/tasks/batch-complete` | GrowthTaskController 仅 `/list`/`/claim`/`/accept-dynamic`,无 `/batch-complete`;批量完成语义在 TaskController `/api/tasks/batch-complete`(同 `/batch-delete`) |
|
|
|
+| ② | SC-C-22 | `/api/points/exchange/create` | `/api/points/exchange/submit` | PointsExchangeController 无 `/create`;兑换创建动作由 `/submit`(`PointsExchangeService.exchangeProduct`)承担 |
|
|
|
+| ③ | SC-P-16 | `/api/tasks/statistics` | `/api/task-reminders/statistics/{memberId}` | TaskController 无 `/statistics`;任务统计在 TaskReminderController `/api/task-reminders/statistics/{memberId}`(另 `/category/`、`/date/`) |
|
|
|
+| ④ | SC-P-86 | `/api/tasks/statistics/family` | `/api/task-reminders/statistics/family` | TaskController 无 `/statistics/family`;家庭排行统计在 TaskReminderController `/api/task-reminders/statistics/family` |
|
|
|
+
|
|
|
+> 结论:**0 能力端点缺失**。以上 4 处均为「能力已实现、路径命名不同」——契约设计应引用**真实路径**(/submit、/api/tasks/batch-complete、/api/task-reminders/statistics*),避免对不存在路径断言而导致假 RED。
|
|
|
+
|
|
|
+## 22 SC 逐条「接口已实现」确认
|
|
|
+
|
|
|
+| SC | 场景标题 | 依赖端点核验 | 接口已实现 |
|
|
|
+|---|---|---|---|
|
|
|
+| SC-A-05 | 勋章配置 CRUD | badges create/update/delete + challenge-score-config list/update 均存在 | ✅ |
|
|
|
+| SC-B-07 | 个性化任务/饮食推荐与采纳 | food/recommendation + meal + tasks 基路径均存在 | ✅ |
|
|
|
+| SC-C-02 | 执行任务 / 小游戏得积分 | tasks/{id}/complete + {id}/start + game/record 均存在 | ✅ |
|
|
|
+| SC-C-04 | 提心愿 | wishes/create 存在 | ✅ |
|
|
|
+| SC-C-05 | 任务打卡 ⭐ | tasks/{id}/complete + daily/checkin/create 均存在 | ✅ |
|
|
|
+| SC-C-09 | 勋章墙 | badges/member/list + badges/all 均存在 | ✅ |
|
|
|
+| SC-C-10 | 勋章解锁提醒 | badges/member/list + badges/detail 均存在 | ✅ |
|
|
|
+| SC-C-14 | 任务驳回重做 | tasks/reject/{id} + tasks/{id}/start 均存在 | ✅ |
|
|
|
+| SC-C-22 | 商城浏览/积分兑换(孩子端消费) | points/exchange product/list + product/detail + records + market 存在;⚠️ create→submit(差异②) | ✅(按真实路径 submit) |
|
|
|
+| SC-C-24 | 小游戏/任务得分触发五维增长(仅自身可见) | game/record + energy/* 均存在 | ✅ |
|
|
|
+| SC-P-12 | 任务频率/周期配置 | task/reminder-config get/save + packages 均存在 | ✅ |
|
|
|
+| SC-P-13 | 心愿创建-审批-兑换闭环 | wishes create/set-price/approve-exchange/exchange 均存在 | ✅ |
|
|
|
+| SC-P-14 | 心愿驳回/失效处理 | wishes/{id}/reject + /{id}/cancel 均存在 | ✅ |
|
|
|
+| SC-P-15 | 积分明细查看 | points/exchange/records 存在 | ✅ |
|
|
|
+| SC-P-16 | 积分流水对账 | points/exchange/records 存在;⚠️ tasks/statistics→task-reminders/statistics(差异③) | ✅(按真实路径) |
|
|
|
+| SC-P-77 | 活动打卡/助力(营销) | activity + daily/checkin 均存在(助力/组队加成属 AdminActivityConfig 对齐,见风险) | ✅ |
|
|
|
+| SC-P-86 | 成长打卡榜/家庭排行 | daily-task/overview + badges/ranking/family 存在;⚠️ tasks/statistics/family→task-reminders/statistics/family(差异④) | ✅(按真实路径) |
|
|
|
+| SC-P-87 | 任务完成触发五维能量按规则归因增长 | tasks/{id}/complete + attribution/analyze 均存在 | ✅ |
|
|
|
+| SC-P-88 | 心愿兑换扣减五维能量(余额不为负) | wishes/{id}/exchange + energy/deduct-for-wish 均存在 | ✅ |
|
|
|
+| SC-T-06 | 家庭任务审核 | tasks/pending-review + tasks/{id}/review 均存在 | ✅ |
|
|
|
+| SC-T-18 | 批量任务下发 | tasks/batch-complete + batch-delete 存在;⚠️ growth-task/batch-complete→tasks/batch-complete(差异①) | ✅(按真实路径) |
|
|
|
+| SC-X-05 | 任务激励闭环 | 全链路(任务→心愿→勋章→积分→五维)所有下游端点均存在 | ✅ |
|
|
|
+
|
|
|
+## 结论
|
|
|
+
|
|
|
+1. **22/22 SC「接口已实现」**:无任何 SC 因端点缺失而无法取证。
|
|
|
+2. **0 能力端点缺失**:全部引用能力均有真实实现。
|
|
|
+3. **4 处契约路径引用需修正**(差异①-④):契约设计须以**真实路径**为准,防假 RED。
|
|
|
+4. **风险提示(沿用开工包)**:
|
|
|
+ - SC-B-07「采纳」动作语义无专用端点(推荐→任务转化可能为客户端侧逻辑),契约须先与 `RecommendationController`/前端对齐,避免写死不存在的「采纳」端点。
|
|
|
+ - SC-P-77「助力」营销动作(分享/组队加成)无专用端点,需与 `AdminActivityController` 对齐,避免重复建键。
|
|
|
+ - SC-T-18「批量」语义(是否含子任务递归下发)未定,契约须先明确,避免能力键名与实现错位。
|
|
|
+ - SC-X-05 跨角色闭环须等正向 SC 全部闭环后取证,且三类流覆盖家长/孩子/规划师三视角。
|
|
|
+
|
|
|
+> 本结论仅作契约核对(文档核对+端点比对),**未改任何业务代码 / 测试文件**。契约设计组按真实路径编写契约后,方可 `--add-task` 入池。
|