实现M002 V3 P0.1 Parent Group路由修订
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
|
||||
| 项目 | 内容 |
|
||||
| --- | --- |
|
||||
| 文档版本 | 0.1 |
|
||||
| 日期 | 2026-07-11 |
|
||||
| 状态 | 0711 P0 基线确认版;后端已完成 M002 V3 CP1-CP6 入站、路由持久化、列表 / 详情展示、同卡复核解阻和 P0 fixtures 回归第一版 |
|
||||
| 文档版本 | 0.2 |
|
||||
| 日期 | 2026-07-12 |
|
||||
| 状态 | 0712 P0.1 增量确认版;后端已完成 M002 V3 CP1-CP6 第一版,Parent Group / Cancel Allotment 路由按 P0.1 修订 |
|
||||
| 适用范围 | SourceMessage 之后的 SuperAgent 输出适配、任务路由、只读通知卡、人工复核同卡解阻、前后端协作边界 |
|
||||
| 主要读者 | 产品、后端、前端、测试、SuperAgent 对接方、后续协作 agent |
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
本文是 `M002-order-task-workflow-v2.md` 的第三版修正。V2 记录了当前后端阶段实现:`ai_task_results[]`、`S000/S999` 文本结果、订单任务基础流转、任务草稿确认、OPERA 模拟骨架、SuperAgent 查询上下文接口和前端 P0 查询接口。
|
||||
|
||||
V3 记录 2026-07-11 导入的 SuperAgent P0 冻结基线,以及本项目已经确认的产品决策。后续 M002 新开发应优先按本文执行;当前代码中已经存在的 V2 行为,需要按 checkpoint 逐步兼容迁移,不能在未实现前对外宣称已经完成。
|
||||
V3 记录 2026-07-11 导入的 SuperAgent P0 冻结基线、2026-07-12 导入的 P0.1 Parent Group 语义修订,以及本项目已经确认的产品决策。后续 M002 新开发应优先按本文和 `M002-v3-p0.1-parent-group-routing-update.md` 执行;当前代码中已经存在的 V2 行为,需要按 checkpoint 逐步兼容迁移,不能在未实现前对外宣称已经完成。
|
||||
|
||||
本文不替代 `docs/project/integrations/superagent-api-contract.md` 的线上联调接口说明。若要给 SuperAgent 联调方使用,必须在对应接口实现完成后同步更新该对外契约。
|
||||
|
||||
@@ -25,23 +25,27 @@ V3 以以下资料和决策为输入:
|
||||
| 资料 | 用途 |
|
||||
| --- | --- |
|
||||
| `docs/import/20260711/开发交付_P0冻结基线_2026-07-11/README_交付说明.md` | 0711 P0 交付边界、可先实现范围、P1/P2 暂缓范围 |
|
||||
| `docs/import/20260711/开发交付_P0冻结基线_2026-07-11/01_Adapter_Frontend/任务卡前端字段变更与路由说明_3.0_to_current.md` | Adapter / Frontend 的 42 路由、人工复核、Parent split、fail-closed 规则 |
|
||||
| `docs/import/20260711/开发交付_P0冻结基线_2026-07-11/01_Adapter_Frontend/任务卡前端字段变更与路由说明_3.0_to_current.md` | Adapter / Frontend 的 P0 路由、人工复核、fail-closed 规则;其中 Parent split / 42 路由部分已被 0712 P0.1 覆盖 |
|
||||
| `docs/import/20260711/开发交付_P0冻结基线_2026-07-11/01_Adapter_Frontend/任务卡前端字段变更说明_3.0_to_当前版_2026-07-10.xlsx` | P0 字段、三元组路由、旧枚举迁移、非法组合和验收用例 |
|
||||
| `docs/import/20260711/开发交付_P0冻结基线_2026-07-11/02_AI_Runtime/main_agent_prompt.md` | 当前 Main Agent 运行提示词 |
|
||||
| `docs/import/20260711/开发交付_P0冻结基线_2026-07-11/02_AI_Runtime/booking-desk-event.skill` | 当前 Skill 包 |
|
||||
| `docs/import/20260711/开发交付_P0冻结基线_2026-07-11/02_AI_Runtime/核心契约_展开阅读/*.md` | 输出契约、事件路由、内容完整性、Main 到 Skill 输入、人工复核规则 |
|
||||
| `docs/import/20260711/开发交付_P0冻结基线_2026-07-11/03_P0_Acceptance/` | P0 fixtures 和轻量 validator |
|
||||
| `docs/import/20260711/开发交付_P0冻结基线_2026-07-11/04_Known_Issues_非契约/` | P1/P2 未闭合范围,只用于识别暂缓和 fail-closed,不作为生产规则源 |
|
||||
| `docs/import/20260712/开发交付_P0_to_P0.1_增量修订说明_给开发Codex_2026-07-11.md` | Parent Group / Allotment 语义修订、40 路由、当前 producer 禁止旧 Parent Cancel Booking |
|
||||
| `docs/import/20260712/Agent 0711 1743/**` | P0.1 Main Agent prompt、booking-desk-event skill 和 references |
|
||||
| `docs/project/requirements/M002-v3-p0.1-parent-group-routing-update.md` | 本项目对 P0.1 增量的落地说明和验收清单 |
|
||||
|
||||
本项目确认的产品决策:
|
||||
|
||||
- M002 V3 正式采用 0711 P0 基线。
|
||||
- M002 V3 正式采用 0711 P0 基线,并从 2026-07-12 起采用 P0.1 Parent Group / Allotment 增量修订。
|
||||
- 旧数据 `S000/S999` 继续在任务列表可见;新数据迁移为 `S10/S99`。
|
||||
- `S10/S99` 继续复用隐藏技术订单 + 任务列表只读卡,不进入订单列表和订单执行队列。
|
||||
- 缺少 `source_message.source_message_id` 时,后端已按 `HTTP 400 + infrastructure_input_error + retryable=true` 的技术错误响应返回,不创建 SourceMessage、AI transition、订单、任务或通知卡。
|
||||
- 内部任务模型采用“方案 C”:完整保存 AI 三元组,系统处理分类和前端展示分类单独维护。
|
||||
- type-known manual review 使用同一张业务卡复核解阻,不生成第二张 normal task。
|
||||
- 第一版保存全部 42 条路由 / 枚举,先支持保存和列表展示。
|
||||
- 第一版保存全部 40 条 P0.1 路由 / 枚举,先支持保存和列表展示。
|
||||
- `Allotment / Control Block = Parent Group`;完整 Parent split 的父事件必须是 `Cancel Allotment + cancel_allotment_control_block`,不是普通 `Cancel Booking`。
|
||||
- P1/P2 未闭合范围命中时 fail closed,不由本系统发明字段或业务规则。
|
||||
- 普通任务切换订单继续后置;P0 仅支持“复核场景下确认订单归属”。
|
||||
|
||||
@@ -51,7 +55,7 @@ V3 以以下资料和决策为输入:
|
||||
| --- | --- | --- |
|
||||
| SuperAgent 业务输出 | 顶层 `source_message_id + ai_task_results[]` | 顶层 `source_message + message_events[] + case_candidates[] + extraction_warnings[] + unhandled_current_intents[]` |
|
||||
| 信息类 / 入口问题 | `text/plain`:`S000,source_message_id` / `S999,source_message_id` | 结构化 JSON:`S10` / `S99`,`result_type=source_message_review_notification` |
|
||||
| 任务路由 | 以 `result_type + task_type + task_subtype` 粗映射系统主任务 | 按每个 `message_events[i]` 派生 42 条 P0 三元组 |
|
||||
| 任务路由 | 以 `result_type + task_type + task_subtype` 粗映射系统主任务 | 按每个 `message_events[i]` 派生 40 条 P0.1 三元组 |
|
||||
| 人工复核 | Fallback / manual_review 可转换为业务任务 | type-known review 保留原业务卡;只有类型或 subtype 未知才走 Fallback |
|
||||
| 复核解阻 | 偏“转换”思路 | 同卡 `review_status + review_resolution.field_overrides[]` 解阻 |
|
||||
| Message Notification | 历史信息提醒任务 | 新入口统一使用 `S10/S99` 只读源邮件通知卡;历史数据兼容展示 |
|
||||
@@ -159,21 +163,35 @@ V3 接收端按根结构分流:
|
||||
|
||||
## 7. Adapter 路由模型
|
||||
|
||||
### 7.1 42 条 P0 路由
|
||||
### 7.1 40 条 P0.1 路由
|
||||
|
||||
V3 第一版必须保存并支持以下路由类别:
|
||||
|
||||
- 19 个业务 subtype,每个 subtype 都有 normal 和 type-known manual review 两条路由,共 38 条。
|
||||
- 18 个业务 subtype,每个 subtype 都有 normal 和 type-known manual review 两条路由,共 36 条。
|
||||
- `S10` 和 `S99` 两条源邮件通知路由。
|
||||
- 类型或 subtype 未知的 Fallback 路由:`manual_review + Fallback + business_event_review`。
|
||||
- `unhandled_current_intent + Unhandled Current Intent + requires_business_approval_or_unsupported_task_card` 展示路由。
|
||||
|
||||
第一版后端要求:
|
||||
|
||||
- 42 条路由全部进入枚举或稳定配置,不能只硬编码已实现的少数几条。
|
||||
- 40 条路由全部进入枚举或稳定配置,不能只硬编码已实现的少数几条。
|
||||
- `route_code` 是历史稳定码,不因 P0.1 总数从 42 调整为 40 而重编号;`R41_FALLBACK_BUSINESS_EVENT_REVIEW` 和 `R42_UNHANDLED_CURRENT_INTENT` 继续保留。
|
||||
- 每条入站 event 都按自己的 `message_events[i]` 独立派生,不能在邮件根只生成一个任务。
|
||||
- 同一封邮件多个任务按 SuperAgent 返回数组顺序和事件顺序生成执行顺序。
|
||||
- `Note`、`Allotment Maintenance`、`update_allotment_control_block` 仅历史兼容,不允许新数据生成。
|
||||
- 当前 producer 不允许再生成 `normal_task/manual_review + Cancel Booking + linked_parent_release_after_child_split`。
|
||||
- `relationship_type=linked_parent_release_after_child_split` 只用于 Parent / Child 关联和 Preflight,不再决定 `task_subtype`。
|
||||
- 旧 V2 兼容 `ai_task_results[]` 若继续提交 `Cancel Booking + linked_parent_release_after_child_split`,也按当前 producer 契约错误处理。
|
||||
|
||||
P0.1 Parent Group 路由规则:
|
||||
|
||||
| 场景 | 合法事件 / 三元组 | 系统处理 |
|
||||
| --- | --- | --- |
|
||||
| Child Group 创建 | `normal_task/manual_review + New Booking + new_group_block` | 创建 New Booking 业务任务 |
|
||||
| Parent Group 完整释放 / 取消 | `normal_task/manual_review + Cancel Allotment + cancel_allotment_control_block` | 创建 Cancel Allotment 业务任务卡 |
|
||||
| 旧 Parent split 新入站 | `Cancel Booking + linked_parent_release_after_child_split` | `adapter_contract_error`,不创建业务任务 |
|
||||
| 重复 Parent 候选 | 同一 Parent Group 再次输出合法 Parent 候选 | 第二个及后续 Parent 写入 `adapter_contract_error` |
|
||||
| 历史旧 payload 只读展示 | `Cancel Booking + linked_parent_release_after_child_split` | reader / adapter 展示层可归一为 Cancel Allotment,不改写原 payload |
|
||||
|
||||
### 7.2 方案 C:AI 三元组和系统处理分类分离
|
||||
|
||||
@@ -341,10 +359,11 @@ Content-Type: application/json
|
||||
|
||||
命中以下情况时,第一版应 fail closed:
|
||||
|
||||
- 42 路由与 runtime 输出不一致或无法唯一匹配。
|
||||
- 40 路由与 runtime 输出不一致或无法唯一匹配。
|
||||
- `manual_review` 九字段不完整。
|
||||
- `missing_fields[]` 不是 RFC 6901 pointer,或无法映射到可编辑字段。
|
||||
- Parent split 关系字段不完整或无法一一对应。
|
||||
- 当前 producer 输出 `Cancel Booking + linked_parent_release_after_child_split`。
|
||||
- `Note`、`Allotment Maintenance`、`update_allotment_control_block` 新数据出现。
|
||||
- Fix Charge、Preflight/lock、Fallback 非字段解阻、Voucher 文件对象缺失、Manual RateCode 边界等 P1/P2 未闭合场景。
|
||||
|
||||
@@ -366,6 +385,8 @@ Content-Type: application/json
|
||||
- 复核解阻页需要能提交 `field_overrides[]`,并在复核场景下确认订单归属。
|
||||
- `unhandled_current_intents[]` 只作为展示块,不提供执行按钮。
|
||||
- P1/P2 fail-closed 返回时,前端展示稳定错误和源邮件入口,不让用户误以为可以确认执行。
|
||||
- Parent split 父事件展示为 `Cancel Allotment / cancel_allotment_control_block`,不再展示独立 Parent Cancel Booking 卡。
|
||||
- 任务列表筛选不提供 `linked_parent_release_after_child_split`;新开发阶段只展示 `S10/S99` 筛选,不再展示旧 `S000/S999` 筛选项。
|
||||
|
||||
## 12. 后端实施 checkpoint 建议
|
||||
|
||||
@@ -373,16 +394,17 @@ V3 建议拆成以下 checkpoint,避免一次性重构过大:
|
||||
|
||||
| Checkpoint | 目标 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| M002-V3-CP1 | 文档和枚举基线 | 已完成:建立 42 路由枚举 / 稳定配置,作为入站路由唯一代码源 |
|
||||
| M002-V3-CP1 | 文档和枚举基线 | 已完成:建立 0711 P0 42 路由枚举 / 稳定配置;P0.1 后已调整为 40 路由 |
|
||||
| M002-V3-CP2 | 入站解析兼容 | 已完成:正式回调支持结构化 S10/S99 和 V3 业务根,保留旧 S000/S999 兼容 |
|
||||
| M002-V3-CP3 | 路由持久化 | 已完成第一版:已保存 AI 原始三元组、route_code、system_process_category、unhandled_current_intents 和 adapter_contract_error |
|
||||
| M002-V3-CP4 | 列表 / 详情展示 | 已完成第一版:任务列表、订单任务时间线和任务详情透出 V3 路由字段;任务详情支持 S10/S99 入口通知结构、unhandled intent 展示块和 adapter contract error 展示块 |
|
||||
| M002-V3-CP5 | 同卡复核解阻 | 已完成第一版:支持 review_status、review_resolution.field_overrides[]、复核场景订单归属确认、JSON Pointer 校验和 READY 流转 |
|
||||
| M002-V3-CP6 | P0 fixtures 回归 | 已完成第一版:引入 0711 P0 fixtures / validator 作为后端适配测试参考,覆盖 main_outcomes、candidate_gate、manual_review_resolution、source_identity_errors、parent_split_two_children、row_multiple_derived、allotment_scope;其中 candidate_gate 是 Main Agent 调 Skill 前契约,后端以 validator 和 fixture reference 固化,不作为任务结果回调直接建任务 |
|
||||
| M002-V3-CP7 | P0.1 Parent Group 路由修订 | 当前 checkpoint:将 Parent split 父事件从旧 Cancel Booking 迁移为 Cancel Allotment,路由总数 42 → 40,并保留旧 payload 只读兼容 |
|
||||
|
||||
## 13. 明确不做
|
||||
|
||||
V3 P0 不做以下事项:
|
||||
V3 P0.1 不做以下事项:
|
||||
|
||||
- 不做真实 OPERA / OHIP 写入。
|
||||
- 不做普通任务任意切换订单。
|
||||
@@ -394,12 +416,12 @@ V3 P0 不做以下事项:
|
||||
|
||||
## 14. 当前代码现状提醒
|
||||
|
||||
截至 M002 V3 CP6 落地后,当前后端已经实现:
|
||||
截至 M002 V3 CP7 落地后,当前后端已经实现:
|
||||
|
||||
- `S000/S999` 文本结果兼容处理。
|
||||
- 结构化 `S10/S99` 入站处理,复用 `SOURCE_MESSAGE_ONLY` 只读特殊任务。
|
||||
- 42 条 P0 路由枚举 / 稳定配置。
|
||||
- V3 业务根 `source_message + message_events[]` 基础解析;能派生到稳定路由的 event 创建业务任务,无法派生的 event、显式 `contract_errors`、根 `missing_fields`、不完整 `manual_review` 和不完整 parent split 候选只落 `adapter_contract_error` transition。
|
||||
- 40 条 P0.1 路由枚举 / 稳定配置。
|
||||
- V3 业务根 `source_message + message_events[]` 基础解析;能派生到稳定路由的 event 创建业务任务,无法派生的 event、显式 `contract_errors`、根 `missing_fields`、不完整 `manual_review`、当前 producer 旧 Parent Cancel Booking 和不完整 parent split 候选只落 `adapter_contract_error` transition。
|
||||
- `unhandled_current_intents[]` 只落 `UNHANDLED_CURRENT_INTENT` transition,不创建订单和任务,也不伪装成 adapter 契约错误。
|
||||
- AI transition 最小保存 `route_code`、`system_process_category`、`adapter_error_code`、`adapter_error_message`。
|
||||
- 任务列表、订单任务时间线和任务详情顶层透出 `result_type`、`ai_task_type`、`task_subtype`、`route_code`、`system_process_category`。
|
||||
@@ -409,11 +431,11 @@ V3 P0 不做以下事项:
|
||||
- `POST /api/reservation/tasks/{taskId}/manual-review-resolutions` 支持字段修正、当前订单归属确认、JSON Pointer 到可编辑字段校验、READY 流转、confirmed payload 写入、两条 OPERA 模拟操作创建和审计记录。
|
||||
- `POST /api/reservation/tasks/{taskId}/manual-review-resolutions` 的 `field_overrides[]` 已支持 `field_pointer` 和 `field_path` 两种定位方式;`field_path` 可为 P0 主路径或旧扁平路径,成功后响应归一化到 P0 主 `field_path`。
|
||||
- `source_message.source_message_id` 缺失时按 V3 typed `infrastructure_input_error` 结构响应。
|
||||
- 0711 P0 fixtures 已纳入后端回归测试参考,并补齐 S10/S99 严格契约、P0 type-known manual review 解阻、candidate_gate reference 和当前扁平字段矩阵兼容。
|
||||
- 0711 P0 fixtures 已纳入后端回归测试参考,并补齐 S10/S99 严格契约、P0 type-known manual review 解阻、candidate_gate reference 和当前扁平字段矩阵兼容;Parent split 相关用例按 0712 P0.1 增量改为 Cancel Allotment。
|
||||
- `field_contract_version` 历史迁移已收紧:V18 只把没有 `draft_payload_json` 且没有 `confirmed_payload_json` 的 `code-v1` 任务卡标记为 `20260711-p0`;已经存在用户草稿或确认 payload 的历史任务卡保留旧版本,等待重新保存、确认或后续专项 backfill。
|
||||
- 订单 / 任务列表、任务详情、草稿保存、最终确认、OPERA 模拟骨架和审计列表。
|
||||
- SuperAgent 查询上下文接口 1、2,以及邮件会话相关查询。
|
||||
|
||||
仍需后续 checkpoint 实现:
|
||||
|
||||
- 真实 OPERA / OHIP、普通任务任意切换订单、字段矩阵从当前扁平结构整体迁移到 0711 P0 新结构。
|
||||
- 真实 OPERA / OHIP、普通任务任意切换订单、字段矩阵从当前扁平结构整体迁移到 0711 P0 新结构、历史旧 Parent Cancel Booking payload 批量迁移。
|
||||
|
||||
Reference in New Issue
Block a user