feat(shipping-notice): 收敛复核阶段同源投影与 OT 后履约推进
统一 Case/Progress 阶段 label_key、修复 Job 成功未推进 OT 的可重试失败投影与写路径,并落地 OT 后行级匹配/波次履约与版面诊断开关。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
74270adc22
commit
fd6a23f870
100 files changed
+12138
-1017
No files matched your search
@@ -1,13 +1,71 @@
|
||||
# 订单复核工作台状态隔离契约
|
||||
|
||||
> 状态:**本轮冻结实现契约(2026-08-06)**
|
||||
> 范围:Case/PDF 切换隔离、Evidence focus 消费、Validation Snapshot 绑定、automation 文案、profile_match 权限裁剪
|
||||
> 非范围:Gate Handler 全链补齐、正式邮件多附件第二阶段回归、统一前端 View Model 重构
|
||||
> 状态:**本轮冻结实现契约(2026-08-07 收敛修订)**
|
||||
> 范围:Case/PDF 切换隔离、Evidence focus 消费、Validation Snapshot 绑定、automation 文案、
|
||||
> profile_match 四态裁剪、正式 OT 后阶段分层、`field_completeness` / `completed_checks` /
|
||||
> `owner_type` / `automation.phase`
|
||||
> 非范围:Gate Handler 全链补齐、状态模型表结构重构、新增 Gate 类型、统一前端 View Model 重构
|
||||
|
||||
---
|
||||
|
||||
## 1. 状态分层
|
||||
|
||||
```text
|
||||
Document / PDF
|
||||
↓
|
||||
Review Case + Draft
|
||||
↓
|
||||
Validation Snapshot
|
||||
↓
|
||||
Build Eligibility / Process Gate / Automation
|
||||
↓
|
||||
Formal OT(confirmed_task_id → ShippingNotice)
|
||||
↓
|
||||
process_status + current_step + stage_nodes(顶部当前阶段唯一数据源)
|
||||
```
|
||||
|
||||
| 绑定 | 范围 |
|
||||
| --- | --- |
|
||||
| 建单前顶部阶段 | Case 订单复核 |
|
||||
| 正式 OT 后顶部阶段 | **ShippingNotice** process_status / current_step / stage_nodes |
|
||||
| 字段 / 证据 / 资格 / 当前阻断 / automation | **当前 Case** |
|
||||
| 正式 OT 判定 | `confirmed_task_id` 指向可读 Task(`status=confirmed` 不足够) |
|
||||
|
||||
### 1.1 正式 OT 创建后(硬冻结)
|
||||
|
||||
```text
|
||||
Case 订单复核结束
|
||||
→ automation.phase = post_ot_progress(主卡)
|
||||
→ 订单检查进入已完成检查 / 更多状态
|
||||
→ current_blocking_gate 清除建单前 Gate
|
||||
→ 系统等待:technical_auto_only=true + owner_type=system,不显示人工待办
|
||||
→ 禁止恢复「确认建单」
|
||||
```
|
||||
|
||||
### 1.2 automation.phase
|
||||
|
||||
| phase | 含义 | waiting_to_start 文案 |
|
||||
| --- | --- | --- |
|
||||
| `pre_ot_stp` | 建单前 STP | 等待系统启动自动建单 |
|
||||
| `post_ot_progress` | 正式 OT 自动推进 | 等待系统启动(禁止「建单」字样) |
|
||||
|
||||
无 Job 时用户态仍为 `waiting_to_start`;管理员 `technical.enqueue_status=no_job`。
|
||||
|
||||
### 1.3 profile_match / field_completeness
|
||||
|
||||
- 普通用户 `profile_match.status`:`matched|unmatched|ambiguous|unknown`(不得把 unknown 压成 unmatched)
|
||||
- `field_completeness` 与 Process Gate `field_completeness` 同源;正式 OT 后 `status=ready`
|
||||
- `required_field_missing` 只出现在字段完整性,不进模板匹配失败
|
||||
|
||||
### 1.4 completed_checks
|
||||
|
||||
后端稳定投影;前端禁止自行拼接 Gate/里程碑。至少含:
|
||||
`document_available` … `formal_ot_created`(见实现模块注释)。
|
||||
|
||||
---
|
||||
|
||||
## 1(原). 状态分层(兼容)
|
||||
|
||||
```text
|
||||
Document / PDF
|
||||
↓
|
||||
@@ -22,7 +80,7 @@ Unified Progress Projection(Run 级进度条)
|
||||
|
||||
| 绑定 | 范围 |
|
||||
| --- | --- |
|
||||
| 顶部 15 步进度 | **整 Run**(切换 PDF 不跳变) |
|
||||
| 顶部 15 步进度 | **整 Run**(切换 PDF 不跳变;正式 OT 后当前阶段文案以 OT 为准) |
|
||||
| 字段 / 证据 / 资格 / 当前阻断 / automation | **当前 Case** |
|
||||
|
||||
---
|
||||
@@ -88,16 +146,19 @@ Unified Progress Projection(Run 级进度条)
|
||||
can_auto_create=true ≠ 正在推进
|
||||
```
|
||||
|
||||
| 后端事实 | 用户文案 |
|
||||
| 事实 | 用户文案 |
|
||||
| --- | --- |
|
||||
| `automation.status=waiting_to_start` | 已满足自动建单条件,等待系统启动(保留人工确认兜底) |
|
||||
| `queued` / Job 已入队 | 系统正在自动建单(隐藏确认) |
|
||||
| `automation.status=waiting_to_start` + `phase=pre_ot_stp` | 等待系统启动自动建单 |
|
||||
| `automation.status=waiting_to_start` + `phase=post_ot_progress` | 等待系统启动(禁止「建单」) |
|
||||
| `queued` / Job 已入队 | 系统正在自动建单或推进(隐藏确认) |
|
||||
| `running` + Task | 系统正在自动推进(隐藏确认) |
|
||||
| `failed` / `manual_fallback` | 自动推进失败,可重试;未 confirmed 时可人工确认 |
|
||||
| 超时无 STP 记录 | `manual_fallback`(阈值 `SHIPPING_NOTICE_STP_WAITING_TIMEOUT_SECONDS`) |
|
||||
| `task_missing` | 正式任务关联异常;禁止恢复确认建单 |
|
||||
|
||||
Case 投影字段:`automation: { status, retryable, task_no, can_auto_create, can_build, job_id }`;
|
||||
管理员另附 `technical_progress: { gate_code, status }`。
|
||||
Case 投影字段:`automation: { status, phase, owner_type, retryable, task_no, can_auto_create, can_build, job_id }`;
|
||||
另附 `field_completeness`、`completed_checks`、`current_stage`、`has_formal_ot`、`task_missing`;
|
||||
管理员另附 `technical_progress` / `automation.technical`(如 `enqueue_status=no_job`)。
|
||||
|
||||
STP 入队路径:资格达标 → `ensure_stp_auto_create_for_case` → Job `queued`(幂等键 `stp-auto:{run_no}:doc-{id}:v{ver}`)。
|
||||
|
||||
@@ -107,17 +168,9 @@ XFA:`can_auto_create=false` 时不得显示 automating;不放宽冻结门禁
|
||||
|
||||
## 5. profile_match 权限
|
||||
|
||||
- 判定:`user.role == 'admin'`
|
||||
- 普通用户 Case API:
|
||||
|
||||
```json
|
||||
{
|
||||
"available": false,
|
||||
"visibility": "admin_only"
|
||||
}
|
||||
```
|
||||
|
||||
- 管理员:完整模板审计对象
|
||||
- 判定:本轮暂 `user.role == 'admin'`(权限封装,避免散落前端)
|
||||
- 普通用户 Case API:四态 `matched|unmatched|ambiguous|unknown`,无候选分 / Profile ID / 原因链
|
||||
- 管理员:完整模板审计对象 + 用户态 `status` 映射
|
||||
- 禁止仅靠前端 `v-if` 隐藏敏感字段
|
||||
|
||||
---
|
||||
@@ -127,6 +180,9 @@ XFA:`can_auto_create=false` 时不得显示 automating;不放宽冻结门禁
|
||||
- 用户态只允许一个 `current_blocking_gate`
|
||||
- 客户确认通过后不得再投影 `confirm_customer` / 「优先处理:客户已确认」
|
||||
- `pending|queued|running` 技术 Gate 不冒充人工优先处理;普通用户看 `automation.status`
|
||||
- 正式 OT 后:建单前 Gate 必须从 `current_blocking_gate` 清除;`inventory_preparation` Worker 等待 → `technical_auto_only=true` + `owner_type=system`
|
||||
- 人工库存/履约阻断:域内 Gate + `owner_type=human` + 可执行动作
|
||||
- 前端必须同时消费 `technical_auto_only` / `owner_type`,禁止仅凭 `available_actions=[]` 推断
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in new issue
Block a user