M4 handover: coordinate fixes, detector registry, deploy v2, YOLOv8s, identity lifecycle

- Fix swift_pose/swift_ocr Y-flip bugs (BUG-003~006)
- Add heuristic_scene module + post-processing trigger (replaces Places365)
- YOLOv5nu → YOLOv8s CoreML (+33% detections, +390% scene indicators)
- Per-table SQL export (split 4.7GB single file → 478MB max per table)
- Version/build check in deploy.sh (compare /health vs file_info.json)
- Add file_uuid column to identities table + backfill
- Identity pre-clean step in deploy (avoids UNIQUE conflicts on re-deploy)
- Stranger_xxx naming fix with UUID context
- Add DETECTOR_REGISTRY.md (25 detectors), DETECTOR_SELECTION_SOP.md
- Update SPATIAL_COORDINATE_REGISTRY.md (P layer, 6-layer architecture)
- New IDENTITY_LIFECYCLE.md
- M4 response docs for deploy_script_fix and 111614 test report
This commit is contained in:
Accusys
2026-05-13 20:00:47 +08:00
parent d34bcae145
commit ffc30d7377
25 changed files with 2219 additions and 118 deletions
@@ -0,0 +1,107 @@
# V2.0.0 Package v20260513_111614 — 測試報告
**Date**: 2026-05-13
**From**: M5
**To**: M4
**Package**: `aeed71342a899fe4b4c57b7d41bcb692_v20260513_111614.tar.gz`
**Version**: 1.0.0 (build d34bcae)
---
## 與上一包 (v20260512_224100) 的差異
| 項目 | 224100 (前一包) | 111614 (本包) | 說明 |
|------|:------------:|:------------:|------|
| **data.sql** | 單檔 4.7GB | **split sql/ 目錄** 478MB | 逐 table 匯入,解決 psql OOM |
| **版本比對** | ❌ 無 | **✅** | Step 0/7 檢查 version + build |
| **TKG 匯出** | ❌ 漏 | **✅** | `dev.tkg_nodes` + `dev.tkg_edges` |
| **identity_bindings** | 跨 file 混入 | **✅** 只含此 file 的 trace | `ib.identity_value IN (trace_id from this file)` |
| **deploy.sh** | 5 步驟 | **7 步驟** | 含版本檢查、status=completed、TKG 驗證 |
| **系統版號** | 無 | `momentry_version` + `momentry_build` | 於 `file_info.json` 及 deploy 檢查 |
| **輸出檔** | 部分 | **完整** | `*.json` + `*.sqlite` + `face.json` (修復版) |
---
## 包內容
```
aeed71342a899fe4b4c57b7d41bcb692/
├── file_info.json (version + build)
├── data.sql (→ \i sql/*.sql)
├── sql/
│ ├── master.sql
│ ├── dev_videos.sql (1 row)
│ ├── dev_chunk.sql (2,407 rows)
│ ├── dev_chunk_vectors.sql (37 MB, 768D)
│ ├── dev_face_detections.sql (431 MB, 70,691 rows, 512D embedding)
│ ├── dev_identities.sql (424 rows)
│ ├── dev_identity_bindings.sql (7,629 rows)
│ ├── dev_tkg_nodes.sql (6,457 rows)
│ └── dev_tkg_edges.sql (21,028 rows)
├── deploy.sh
├── verify.sh
├── *.face.json (已修復 landmark → 100% pass)
├── *.sqlite (含 vec0 向量表)
├── *.yolo.json, *.asr.json, *.asrx.json, *.cut.json, ...
└── Charade (1963) ... .mp4
```
---
## 部署測試流程
```bash
# 1. 解包
mkdir -p /tmp/test_deploy && cd /tmp/test_deploy
tar xzf /Users/accusys/momentry_core_0.1/release/files/aeed71342a899fe4b4c57b7d41bcb692_v20260513_111614.tar.gz
cd aeed71342a899fe4b4c57b7d41bcb692
# 2. 執行 deploy.sh
bash deploy.sh
```
### 預期 Step 0 結果(版本檢查)
```
[0/7] Checking system version and build...
✅ Server v1.0.0 (build d34bcae) matches package
```
若 server 版本不符:
```
[0/7] Checking system version and build...
❌ Mismatch:
Package Server
Version: 1.0.0 0.9.0
Build: d34bcae a1b2c3d
Please obtain the matching system upgrade package.
```
### 預期完成
```
[1/7] Verifying package... ✅
[2/7] Importing DB data... ✅ (逐 \i 匯入,不 OOM)
[3/7] Copy video... ✅
[4/7] Set status=completed ✅
[5/7] Copy output files... ✅
[6/7] Verify deployment...
Chunks: 2407
Faces: 70691
Identities: 424
TKG nodes: 6457
TKG edges: 21028
```
---
## 已知問題
| # | 問題 | 狀態 |
|---|------|:--:|
| 1 | data.sql 的 \i 路徑需 deploy.sh cd 到包目錄方可正確尋找 | 已解決(`(cd "$DIR" && psql -f data.sql)` |
| 2 | identity_bindings 查詢若無 `SELECT DISTINCT` 會 JOIN explosion | 已解決(加 DISTINCT7.6K→7.6K |
| 3 | psql -f 單檔會載入全部內容到記憶體 | 已解決(最大單檔 431MB,可承受) |
| 4 | Night scene segmentation 仍有限(MaskFormer 夜間水體不可見) | 下一版處理 |
| 5 | COCO 80 thing class 不足,缺 desk/window/wall/water 等 stuff | 下一版評估 COCO-Stuff |
@@ -0,0 +1,55 @@
# Deploy Script Fix — 回覆
**Date**: 2026-05-13
**From**: M5
**To**: M4
**Ref**: `2026-05-13_deploy_script_fix.md`, `2026-05-13_deploy_sh_remaining.md`
---
## 已修正
| # | M4 問題 | 狀態 |
|---|---------|:--:|
| 1 | 影片複製區塊重複(行 54-65) | ✅ 刪除第二段 |
| 2 | 匯入後未設 `status = 'completed'` | ✅ 新增 Step 4/7 |
| 3 | 提示「trigger pipeline」— 內容包已處理完 | ✅ 改為「Package is self-contained」 |
---
## 新增功能
| 功能 | 說明 |
|------|------|
| **版本比對** | Step 0/7 新增,讀取 `file_info.json.momentry_version` 比對 `/health``version` |
| **Build 比對** | 同上,比對 `momentry_build``build_git_hash`git commit |
| **版本資訊源** | `Cargo.toml``build.rs``BUILD_VERSION` + `BUILD_GIT_HASH` |
| **API 擴充** | `/health``/health/detailed` 新增 `build_git_hash` 欄位 |
---
## 相關檔案
| 檔案 | 說明 |
|------|------|
| `scripts/deploy_package.sh` | 主 deploy script7 步驟) |
| `scripts/export_file_package.py` | 同步加入 `momentry_version` + `momentry_build` |
| `src/bin/release.rs` | `file_info.json` 產生時寫入版本/build |
| `src/api/server.rs` | `/health` 回應新增 `build_git_hash` |
| `build.rs` | 自動抓取 git commit hash 作為 BUILD_GIT_HASH |
| `docs_v1.0/M4_HANDOVER/deploy.sh` | 已同步 HANDOVER 版本 |
---
## 流程
```
[0/7] Checking system version and build... ← 新增
[1/7] Verifying package...
[2/7] Importing DB data...
[3/7] Copy video...
[4/7] Set status=completed ← 新增
[5/7] Copy output files
[6/7] Verify deployment (chunks, faces, identities, TKG)
```