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:
+14
-3
@@ -1166,6 +1166,8 @@ struct ReScanRequest {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
face_settings: Option<FaceSettings>,
|
face_settings: Option<FaceSettings>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
auto_pipeline: Option<bool>,
|
||||||
|
#[serde(default)]
|
||||||
trigger_source: Option<String>,
|
trigger_source: Option<String>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
reason: Option<String>,
|
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
|
// 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!({
|
let register_payload = serde_json::json!({
|
||||||
"force": true,
|
"force": true,
|
||||||
"auto_pipeline": true, // Flag to force auto-pipeline
|
"auto_pipeline": auto_pipeline,
|
||||||
"content_hash": null,
|
"content_hash": null,
|
||||||
"face_settings": req.face_settings.as_ref().map(|fs| {
|
"face_settings": req.face_settings.as_ref().map(|fs| {
|
||||||
serde_json::json!({
|
serde_json::json!({
|
||||||
@@ -1436,7 +1440,14 @@ async fn re_scan(
|
|||||||
// Note: Register command with force=true will:
|
// Note: Register command with force=true will:
|
||||||
// 1. Unregister existing file if needed
|
// 1. Unregister existing file if needed
|
||||||
// 2. Register the file
|
// 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 {
|
Ok(Json(ReScanResponse {
|
||||||
success: true,
|
success: true,
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ impl PythonExecutor {
|
|||||||
|
|
||||||
if !scripts_path.exists() {
|
if !scripts_path.exists() {
|
||||||
anyhow::bail!(
|
anyhow::bail!(
|
||||||
"Scripts directory not found at {} (set MOMENTRY_SCRIPTS_DIR env var)",
|
"Scripts directory not found at {:?} (set MOMENTRY_SCRIPTS_DIR env var)",
|
||||||
scripts_dir
|
scripts_dir
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1422,7 +1422,7 @@ impl CliExecutor {
|
|||||||
|
|
||||||
if !cli_path.exists() {
|
if !cli_path.exists() {
|
||||||
anyhow::bail!(
|
anyhow::bail!(
|
||||||
"CLI directory not found at {} (set MOMENTRY_CLI_DIR env var)",
|
"CLI directory not found at {:?} (set MOMENTRY_CLI_DIR env var)",
|
||||||
cli_dir
|
cli_dir
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user