Files
ai-contract-platform/project-docs/V2-smoke-database-authority-verification-2026-06-28.md
T
yuqei a3bb78e06b
Security Quality Gate / npm audit, Bandit, pip-audit, detect-secrets (pull_request) Failing after 16m35s
release: freeze V2 release candidate
2026-07-12 15:32:24 +08:00

102 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# AI 合同平台 V2 Smoke 数据库权威环境核验记录
日期:2026-06-28
## 执行目的
按照《V2 下一阶段开发优化方案》的阶段 0,启动并核验 Docker smoke 环境,确定后续 V2 dev/smoke 的唯一权威数据库环境。
## 执行动作
执行部署:
```powershell
.\yuqei-infra\scripts\deploy-v2-smoke-docker.ps1 -UseSshpass -AllowDirtyWorktree -KeepRemoteBackup -SkipSmoke
```
执行说明:
- 使用当前本地 V2 代码重新部署远端 smoke。
- 保留远端代码备份。
- 未使用 `-ResetSmokeVolumes`,因此没有重置 Docker 数据卷。
- 使用 `-SkipSmoke` 跳过合同审查写入型 smoke。
- 部署脚本自身健康检查、AI golden sample gate、三库存在性检查通过。
部署产物:
```text
project-docs/qa-artifacts/v2-smoke-docker-deploy/2026-06-28T09-50-56
```
## 核验结果
### 容器状态
`yuqei-contract-v2-smoke` 下核心容器均为 running / healthy:
- `postgres`
- `redis`
- `minio`
- `contract-api`
- `ai-platform-api`
- `contract-web`
- `worker`
- `contract-review-worker`
### 数据库存在性
已确认存在:
- `yuqei_contract`
- `yuqei_ai`
- `yuqei_ops`
### 迁移头
| 数据库 | Alembic version table | 当前版本 |
| --- | --- | --- |
| `yuqei_contract` | `contract_api_alembic_version` | `20260628_0017` |
| `yuqei_ai` | `ai_platform_alembic_version` | `20260624_0018` |
### 表数量
| 数据库 | 表数量 |
| --- | --- |
| `yuqei_contract` | 12 |
| `yuqei_ai` | 16 |
| `yuqei_ops` | 0 |
### 扩展
| 数据库 | 扩展 |
| --- | --- |
| `yuqei_contract` | `pg_trgm` |
| `yuqei_ai` | `pg_trgm`、`vector` |
### 健康检查
已确认:
- Contract API `/health` 返回 `status=ok`,环境为 `staging`,数据库 backend 为 PostgreSQL。
- AI Platform API `/health` 返回 `status=ok`。
- Contract Web 容器健康检查通过。
## 正式结论
Docker project `yuqei-contract-v2-smoke` 正式登记为当前 V2 dev/smoke 权威环境。
后续开发、压测、安全扫描回归、Docker smoke、迁移验证,应默认以该环境为准。
宿主机 PostgreSQL `5432/yuqei_contract` 仍保留为临时合同测试库,不再作为默认开发/验收目标。
旧库 `ai_contract_platform` 仍保留为 V1/历史单体库,只读用于资产迁移和行为对照。
## 后续动作
下一步进入 Phase 1:
1. Contract API 增加运行时 schema check。
2. AI Platform API 增加运行时 schema check。
3. Docker healthcheck 从服务 alive 升级为 schema ready。
4. 本地 Codex 联调环境变量改为清晰指向权威 smoke PostgreSQL。