a3bb78e06b
Security Quality Gate / npm audit, Bandit, pip-audit, detect-secrets (pull_request) Failing after 16m35s
118 lines
4.6 KiB
Markdown
118 lines
4.6 KiB
Markdown
# AI 合同平台 V2 Phase 3 action_hint 远端 smoke 验证
|
||
|
||
## 验证范围
|
||
|
||
本次验证对齐《AI 合同平台 V2 下一阶段开发优化方案》的 Phase 3 schema 硬化与 UI 展示字段治理路径,重点验证 `20260630_0022` 和 Slice 3.5.3-a 到 3.5.3-e 的远端 Docker/PostgreSQL 可运行状态。
|
||
|
||
验证目标:
|
||
|
||
- 不重置 smoke 数据卷。
|
||
- 将 Contract API Alembic 迁移推进到 `20260630_0022`。
|
||
- 确认 `contracts.action_hint` 在真实 PostgreSQL schema 中存在。
|
||
- 确认旧展示缓存字段仍保留且与派生值一致。
|
||
- 抽样验证 `action_hint` 与旧 `next_action` PATCH 兼容。
|
||
- 抽样验证结构化审批、审查上下文优先级高于人工 `action_hint`。
|
||
|
||
## 远端环境
|
||
|
||
- 主机:`192.168.3.90`
|
||
- 远端目录:`/opt/apps/ai-contract-platform-v2-smoke`
|
||
- Compose project:`yuqei-contract-v2-smoke`
|
||
- Contract API:`http://192.168.3.90:18100`
|
||
- AI Platform API:`http://192.168.3.90:18101`
|
||
- Contract Web:`http://192.168.3.90:13000`
|
||
- PostgreSQL smoke 端口:`15432`
|
||
|
||
## 部署命令
|
||
|
||
本次未传入 `-ResetSmokeVolumes`,因此 compose 只执行 `down --remove-orphans`,没有删除 PostgreSQL 数据卷。
|
||
|
||
```powershell
|
||
$env:SSHPASS='<由运维临时提供>'
|
||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\yuqei-infra\scripts\deploy-v2-smoke-docker.ps1 -UseSshpass -AllowDirtyWorktree -KeepRemoteBackup -SkipSmoke
|
||
```
|
||
|
||
部署 artifact:
|
||
|
||
```text
|
||
D:\yuqei-project\ai-contract-platform\project-docs\qa-artifacts\v2-smoke-docker-deploy\2026-06-30T20-20-57
|
||
```
|
||
|
||
部署脚本结果:
|
||
|
||
- `remote_preflight`:pass
|
||
- `remote_deploy`:pass
|
||
- `remote_health`:pass
|
||
- `ai_golden_sample_gate`:pass,90 samples / 6 suites / 16 checks
|
||
- `remote_db_check`:pass,`yuqei_contract`、`yuqei_ai`、`yuqei_ops` 均存在
|
||
- `review_worker_smoke`:skip,本次按计划跳过通用 review worker smoke,改跑 3.5.3 专项抽样
|
||
|
||
## schema-check 结果
|
||
|
||
远端 Contract API:
|
||
|
||
```http
|
||
GET http://192.168.3.90:18100/api/v1/runtime/schema-check
|
||
```
|
||
|
||
关键结果:
|
||
|
||
- 顶层 `status`:`ok`
|
||
- `database_backend`:`ok`,PostgreSQL
|
||
- `database_name`:`ok`,`yuqei_contract`
|
||
- `alembic_version.actual`:`20260630_0022`
|
||
- `alembic_version.expected_head`:`20260630_0022`
|
||
- `action_hint_columns.status`:`ok`
|
||
- `display_cache_consistency.status`:`ok`
|
||
- `display_cache_consistency.checked_rows`:`12013`
|
||
- `display_cache_consistency.mismatch_count`:`0`
|
||
- `display_cache_cleanup_prestate.status`:`ok`
|
||
- `postgres_extensions.status`:`ok`,`pg_trgm`
|
||
|
||
## 专项流程抽样
|
||
|
||
新增测试合同:
|
||
|
||
- `contract-35c3cb1397f5`
|
||
- `contract-2f1f60e9da82`
|
||
- 文件:`file-9a6b83bf3a8d`
|
||
- 审查任务:`review-4f48da7f03c2`
|
||
|
||
验证路径:
|
||
|
||
1. 创建草稿合同。
|
||
2. PATCH `action_hint`,确认 `action_hint` 落库,并在无结构化上下文时派生为 `next_action`。
|
||
3. PATCH 旧 `next_action`,确认兼容写入 `action_hint`。
|
||
4. 提交审批,确认合同进入 `approval_pending`,且结构化审批动作覆盖人工提示。
|
||
5. 审批退回,确认合同进入 `rejected`。
|
||
6. 重新提交审批,确认再次进入 `approval_pending`,结构化审批动作仍覆盖人工提示。
|
||
7. 审批通过,确认合同进入 `approved`。
|
||
8. 创建第二份合同并上传文件,确认文件上传写入 `action_hint`,且未发起审查前可派生为 `next_action`。
|
||
9. 基于上传文件发起审查,确认合同进入 `reviewing`,审查上下文覆盖文件上传产生的人工提示。
|
||
10. 复跑 runtime schema-check,确认 display cache 仍为 0 mismatch。
|
||
|
||
专项抽样最终结果:
|
||
|
||
```json
|
||
{
|
||
"status": "pass",
|
||
"checked_at": "2026-06-30T20:29:59.2780853+08:00",
|
||
"contract_id": "contract-35c3cb1397f5",
|
||
"file_review_contract_id": "contract-2f1f60e9da82",
|
||
"file_id": "file-9a6b83bf3a8d",
|
||
"review_task_id": "review-4f48da7f03c2",
|
||
"alembic_actual": "20260630_0022",
|
||
"action_hint_columns": "ok",
|
||
"display_cache_consistency": "ok",
|
||
"display_cache_checked_rows": 12013,
|
||
"display_cache_mismatch_count": 0,
|
||
"display_cache_cleanup_prestate": "ok"
|
||
}
|
||
```
|
||
|
||
## 结论
|
||
|
||
`20260630_0022` 已在权威 V2 smoke PostgreSQL/Docker 环境验证通过。`action_hint` 字段、兼容 PATCH、派生优先级、审批/审查上下文覆盖、旧 display cache 一致性均符合 Slice 3.5.3 的设计。
|
||
|
||
当前仍不建议删除 `contracts.next_action / contracts.next_actions` 旧列。下一步应继续 Slice 3.5.3-f:清理旧方法签名和兼容参数,优先处理 `_transition_contract(...)` 与 `ContractAuditRepository.transition_contract(...)` 中仍保留的 `next_action / next_actions` 参数,同时保持 API 响应字段兼容。
|