diff --git a/docs_v1.0/M4_workspace/2026-09-27_pipeline_architecture_flaws.md b/docs_v1.0/M4_workspace/2026-09-27_pipeline_architecture_flaws.md new file mode 100644 index 00000000..8b5f82a5 --- /dev/null +++ b/docs_v1.0/M4_workspace/2026-09-27_pipeline_architecture_flaws.md @@ -0,0 +1,117 @@ +--- +title: Pipeline Architecture Flaws Analysis +version: 1.0 +date: 2026-09-27 +author: OpenCode +status: critical +--- + +## Summary + +Pipeline unable to complete due to multiple architectural flaws. + +--- + +## Pipeline Flow + +**Phase 1:** ASR, ASRX, Face, OCR, Pose, CUT, Scene VLM +**Phase 2:** Face Tracing, Face Dedup, TKG, Rule Ingestion + +**Dependency:** Face Detection → Face Tracing → Face Dedup → TKG + +--- + +## Critical Flaws + +### 1. Data Flow Inconsistency + +- Face Detection outputs to `face.json` +- Face Tracing reads from `workspace.sqlite` +- No automatic conversion + +**Result:** Data lost between stages + +--- + +### 2. Status Check Flaw + +```rust +// ❌ Current +if face_traced_json.exists() { skip } + +// ✅ Should +if all_files_exist && data_complete { skip } +``` + +--- + +### 3. Infinite Wait + +- Worker waits for 15 missing files +- No timeout +- No error reporting +- Never completes + +--- + +### 4. Scattered State + +- PostgreSQL `processing_status` +- Redis +- File system (face_traced.json) +- Worker memory + +**Problem:** No single source of truth + +--- + +### 5. Insufficient Error Handling + +- No data integrity check +- No auto-repair +- No user-visible errors +- No retry limits + +--- + +## Root Causes + +1. Data flow broken between stages +2. Status management chaotic +3. Error handling insufficient +4. Monitoring lacking +5. No atomic state updates + +--- + +## Recommendations + +### Short-term + +1. Add data integrity checks +2. Add timeout/retry limits +3. Improve error reporting + +### Long-term + +1. Unified state management (PostgreSQL only) +2. Unified data pipeline +3. Robustness design (timeout + recovery) +4. Monitoring + alerting +5. Test coverage + +--- + +## Impact + +- Pipeline frequently stuck +- Hard to diagnose +- Hard to recover +- Poor user experience + +--- + +## Related + +- `2026-09-27_020mp4_root_cause_zombie_worker.md` +- `2026-09-27_020mp4_stuck_analysis.md`