feat: add TraceArtifacts phase + VLM waits for all key_frame.jpg

- Add TraceArtifacts phase to TkgPhase enum (phase 18)
- Report progress as key_frame.jpg/key_face.jpg are created
- VLM trigger now polls until ALL key_frame.jpg files exist
  (was: started after TKG build, before artifacts were ready)
- Add iron rule to AGENTS.md: ask before removing data

Tested: Gamma 8 (27 traces) → 27/27 VLM summaries completed
This commit is contained in:
Accusys
2026-08-24 19:13:11 +08:00
parent d29b4804af
commit 9f12e835b8
43 changed files with 3993 additions and 491 deletions
+16 -4
View File
@@ -1773,7 +1773,10 @@ async fn get_face_landmarks_handler(
let face_path = std::path::Path::new(output_dir).join(format!("{}.face.json", file_uuid));
if !face_path.exists() {
tracing::error!("[get_face_landmarks] File not found: {}", face_path.display());
tracing::error!(
"[get_face_landmarks] File not found: {}",
face_path.display()
);
return Err(StatusCode::NOT_FOUND);
}
@@ -1840,7 +1843,10 @@ async fn get_face_landmarks_handler(
y: face.get("y").and_then(|v| v.as_i64()).unwrap_or(0),
width: face.get("width").and_then(|v| v.as_i64()).unwrap_or(0),
height: face.get("height").and_then(|v| v.as_i64()).unwrap_or(0),
confidence: face.get("confidence").and_then(|v| v.as_f64()).unwrap_or(0.0),
confidence: face
.get("confidence")
.and_then(|v| v.as_f64())
.unwrap_or(0.0),
})
.collect();
@@ -1850,8 +1856,14 @@ async fn get_face_landmarks_handler(
y: selected.get("y").and_then(|v| v.as_i64()).unwrap_or(0),
width: selected.get("width").and_then(|v| v.as_i64()).unwrap_or(0),
height: selected.get("height").and_then(|v| v.as_i64()).unwrap_or(0),
confidence: selected.get("confidence").and_then(|v| v.as_f64()).unwrap_or(0.0),
pose_angle: selected.get("pose_angle").cloned().or_else(|| selected.get("pose").cloned()),
confidence: selected
.get("confidence")
.and_then(|v| v.as_f64())
.unwrap_or(0.0),
pose_angle: selected
.get("pose_angle")
.cloned()
.or_else(|| selected.get("pose").cloned()),
landmarks: selected
.get("landmarks")
.cloned()