docs: all Gates G-1~G-4 completed

All Gate conditions satisfied:
- G-1 (A-9): phase_completed in status ✅
- G-2 (A-10): pipeline empty result handling ✅
- G-3 (A-4.2): hardcoded paths cleared ✅
- G-4 (A-13): status consistency fixed ✅

Ready for Stage 3-4 deployment testing
This commit is contained in:
Accusys
2026-10-04 18:22:48 +08:00
parent 1672a042af
commit 36c54fd5e8
@@ -0,0 +1,129 @@
# Gate G-1 ~ G-4 全部完成
**日期**: 2026-10-04
**状态**: ✅ **所有 Gate 已完成**
---
## 完成摘要
### G-1 (A-9) ✅
- **问题**: phase_completed 未纳入 status 判断
- **修复**: `src/api/processing.rs` - get_status() 检查 phase_completed
- **Commit**: `ad307423`
### G-2 (A-10) ✅
- **问题**: pipeline 进度对 0 结果无法收尾
- **修复**: `src/api/processing.rs` - 处理 result_count: 0 情况
- **Commit**: `0d11c601`
### G-3 (A-4.2) ✅
- **问题**: 开发机硬编码路径烧进 release binary
- **修复**: 清除所有影响 release 运行的硬编码路径
- **Commits**: 11 commits (详见下方)
### G-4 (A-13) ✅
- **问题**: Status 一致性问题 - list 和 detail 返回不同 status
- **修复**:
- 创建 `compute_file_status()` 统一推导逻辑
- `get_file_detail` 始终使用推导 status
- `list_files` 添加 `sync_status` 参数可选推导
- **Commit**: `1672a042`
---
## G-3 修复清单
| 文件 | 修复数 | Commit |
|------|--------|--------|
| `src/core/admin_config.rs` | 5 处 | b4dec14f |
| `src/api/files.rs` | 2 处 | 1166599f |
| `src/watcher/watcher.rs` | 1 处 | c55f664e |
| `src/api/processing.rs` | 4 处 | 3285cf76, 30ea3845 |
| `src/core/agent/tools.rs` | 3 处 | 0afb90e2 |
| `src/worker/job_worker.rs` | 2 处 | 036fc9f8 |
| `src/api/scan.rs` | 2 处 | b32a6494, 1e622646, 14bbae25 |
| `src/api/health.rs` | 1 处 | cccb0aa9 |
| `src/core/config.rs` | 1 处 | cccb0aa9 |
| `src/core/storage/output_dir.rs` | 1 处 | cccb0aa9 |
| `src/core/tmdb/probe.rs` | 1 处 | cccb0aa9 |
| `src/core/path_utils.rs` | models_dir() | 61b8fb3b |
**总计**: 11 个文件,约 25 处硬编码路径
---
## G-4 详细说明
### 问题分析
- **现象**: list 返回 'scanning',detail 返回 'completed'
- **根源**: 两个端点都直接读取 DB status 字段,但 DB status 可能过时
- **影响**: 前端 LibraryView.vue:173 使用 status 判断,显示不准确
### 解决方案
1. **统一推导逻辑**:创建 `compute_file_status()` 函数
- 检查 `processing_status->>'phase'`
- 检查处理器 JSON 文件存在性
- 推导实际 status
2. **detail 端点**:始终使用推导 status
- 确保单文件查询准确
- 性能影响可接受
3. **list 端点**:可选推导
- 添加 `sync_status` 查询参数
- `sync_status=true`: 推导每个文件(准确但较慢)
- `sync_status=false` (默认): 使用 DB status(快速)
### 测试方法
```bash
# Detail (始终准确)
curl http://localhost:3002/api/v1/file/:uuid
# List with DB status (默认)
curl http://localhost:3002/api/v1/files
# List with computed status (可选)
curl http://localhost:3002/api/v1/files?sync_status=true
```
---
## 验收检查
### Gate G-1 ~ G-3
```bash
# 核心代码剩余路径
grep -rn "/Users/accusys\|/Users/nextorageai" src --include="*.rs" | \
grep -v "\.bak" | \
grep -v "bin/release\|bin/service\|bin/sync\|bin/test\|player/\|playground\|handlers.rs" | \
wc -l
# 结果: 8 (均为可接受的开发工具/废弃功能)
```
### Gate G-4
```bash
# 编译验证
cargo check --lib
# 结果: Finished `dev` profile
```
---
## Stage 3-4 准备就绪
✅ Gate G-1 ~ G-4 **全部完成**
✅ 满足 M4ProMini 部署测试前置条件
---
## 下一步
1. **重新构建 release binary**(包含 G-4 修复)
2. 准备 Stage 3 测试环境
3. 执行 `install_momentry.sh` 部署验证
---
**Core Team**
2026-10-04