docs: A-7 decision - re-scan as canonical API with auto_pipeline opt-in

- Decision: POST /api/v1/re-scan is canonical API
- Important: auto_pipeline=false by default (customer requirement)
- Provides manual control and safety over processing pipeline
- Includes workflow examples and Studio Team recommendations

Addresses: A-7 from Momentry_Release_Requirements_20261004.md
This commit is contained in:
Accusys
2026-10-04 13:51:50 +08:00
parent a3c3ed8dc1
commit 1ec094571f
2 changed files with 16 additions and 5 deletions
+14 -3
View File
@@ -1166,6 +1166,8 @@ struct ReScanRequest {
#[serde(default)]
face_settings: Option<FaceSettings>,
#[serde(default)]
auto_pipeline: Option<bool>,
#[serde(default)]
trigger_source: Option<String>,
#[serde(default)]
reason: Option<String>,
@@ -1400,11 +1402,13 @@ async fn re_scan(
}
};
// Step 2: Create register command with force=true
// Step 2: Create register command with force=true
// Note: force=true will automatically unregister existing file if needed
let auto_pipeline = req.auto_pipeline.unwrap_or(false);
let register_payload = serde_json::json!({
"force": true,
"auto_pipeline": true, // Flag to force auto-pipeline
"auto_pipeline": auto_pipeline,
"content_hash": null,
"face_settings": req.face_settings.as_ref().map(|fs| {
serde_json::json!({
@@ -1436,7 +1440,14 @@ async fn re_scan(
// Note: Register command with force=true will:
// 1. Unregister existing file if needed
// 2. Register the file
// 3. Trigger auto-pipeline if auto_pipeline flag is set
// 3. Trigger auto-pipeline only if auto_pipeline=true (default: false)
let mode = if auto_pipeline { "auto" } else { "manual" };
tracing::info!(
"[RE-SCAN] Mode: {} (auto_pipeline={})",
mode,
auto_pipeline
);
Ok(Json(ReScanResponse {
success: true,