fix: face group name read consistency, sync_file_status fix, cleanup ghost records, identity_agent replaced with face_dedup
- get_face_groups_handler: COALESCE(tp.name, tn.label) for name consistency - sync_file_status: compare JSON vs pre_chunks (not chunk table) - face consistency: compare frames.len() not total_faces - cleanup 2 ghost records with NULL file_name/file_path - replace identity_agent with face_dedup in pipeline stages - remove identity_agent_api.rs and all references - update required_processors to match actual processors - update AGENTS.md with team responsibilities - add Studio pipeline changes documentation
This commit is contained in:
+51
-13
@@ -1706,7 +1706,10 @@ async fn delete_trace(
|
||||
Path((file_uuid, trace_id)): Path<(String, i32)>,
|
||||
Json(req): Json<serde_json::Value>,
|
||||
) -> Json<serde_json::Value> {
|
||||
let hard_delete = req.get("hard_delete").and_then(|v| v.as_bool()).unwrap_or(false);
|
||||
let hard_delete = req
|
||||
.get("hard_delete")
|
||||
.and_then(|v| v.as_bool())
|
||||
.unwrap_or(false);
|
||||
|
||||
let qdrant = crate::core::db::qdrant_db::QdrantDb::new();
|
||||
|
||||
@@ -1719,9 +1722,17 @@ async fn delete_trace(
|
||||
]
|
||||
});
|
||||
|
||||
let deleted_count = match qdrant.delete_points_by_filter("_faces", filter.clone()).await {
|
||||
let deleted_count = match qdrant
|
||||
.delete_points_by_filter("_faces", filter.clone())
|
||||
.await
|
||||
{
|
||||
Ok(count) => {
|
||||
tracing::info!("[delete_trace] Hard deleted {} face points from Qdrant for trace {} in {}", count, trace_id, file_uuid);
|
||||
tracing::info!(
|
||||
"[delete_trace] Hard deleted {} face points from Qdrant for trace {} in {}",
|
||||
count,
|
||||
trace_id,
|
||||
file_uuid
|
||||
);
|
||||
count
|
||||
}
|
||||
Err(e) => {
|
||||
@@ -1776,13 +1787,23 @@ async fn delete_trace(
|
||||
"status": "deleted"
|
||||
});
|
||||
|
||||
let qdrant_updated = match qdrant.update_payload_by_filter("_faces", filter.clone(), payload).await {
|
||||
let qdrant_updated = match qdrant
|
||||
.update_payload_by_filter("_faces", filter.clone(), payload)
|
||||
.await
|
||||
{
|
||||
Ok(_) => {
|
||||
tracing::info!("[delete_trace] Soft deleted (marked) trace {} in {}", trace_id, file_uuid);
|
||||
tracing::info!(
|
||||
"[delete_trace] Soft deleted (marked) trace {} in {}",
|
||||
trace_id,
|
||||
file_uuid
|
||||
);
|
||||
true
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::error!("[delete_trace] Failed to mark Qdrant points as deleted: {}", e);
|
||||
tracing::error!(
|
||||
"[delete_trace] Failed to mark Qdrant points as deleted: {}",
|
||||
e
|
||||
);
|
||||
return Json(serde_json::json!({
|
||||
"success": false,
|
||||
"error": format!("Failed to mark Qdrant points: {}", e)
|
||||
@@ -1848,8 +1869,11 @@ async fn merge_trace(
|
||||
});
|
||||
|
||||
// Get count before update
|
||||
let points_count = qdrant.scroll_all_points("_faces", src_filter.clone(), 1).await
|
||||
.map(|pts| pts.len()).unwrap_or(0);
|
||||
let points_count = qdrant
|
||||
.scroll_all_points("_faces", src_filter.clone(), 1)
|
||||
.await
|
||||
.map(|pts| pts.len())
|
||||
.unwrap_or(0);
|
||||
|
||||
// Update all source points to target trace_id
|
||||
let new_payload = serde_json::json!({
|
||||
@@ -1857,7 +1881,10 @@ async fn merge_trace(
|
||||
"merged_from": trace_id
|
||||
});
|
||||
|
||||
let moved_count = match qdrant.update_payload_by_filter("_faces", src_filter, new_payload).await {
|
||||
let moved_count = match qdrant
|
||||
.update_payload_by_filter("_faces", src_filter, new_payload)
|
||||
.await
|
||||
{
|
||||
Ok(_) => points_count as u64,
|
||||
Err(e) => {
|
||||
return Json(serde_json::json!({
|
||||
@@ -1919,8 +1946,11 @@ async fn restore_trace(
|
||||
});
|
||||
|
||||
// Get count of points to restore
|
||||
let points_to_restore = qdrant.scroll_all_points("_faces", filter.clone(), 1).await
|
||||
.map(|pts| pts.len()).unwrap_or(0);
|
||||
let points_to_restore = qdrant
|
||||
.scroll_all_points("_faces", filter.clone(), 1)
|
||||
.await
|
||||
.map(|pts| pts.len())
|
||||
.unwrap_or(0);
|
||||
|
||||
if points_to_restore == 0 {
|
||||
return Json(serde_json::json!({
|
||||
@@ -1934,9 +1964,17 @@ async fn restore_trace(
|
||||
"status": serde_json::Value::Null
|
||||
});
|
||||
|
||||
let qdrant_restored = match qdrant.update_payload_by_filter("_faces", filter, clear_payload).await {
|
||||
let qdrant_restored = match qdrant
|
||||
.update_payload_by_filter("_faces", filter, clear_payload)
|
||||
.await
|
||||
{
|
||||
Ok(_) => {
|
||||
tracing::info!("[restore_trace] Restored {} Qdrant points for trace {} in {}", points_to_restore, trace_id, file_uuid);
|
||||
tracing::info!(
|
||||
"[restore_trace] Restored {} Qdrant points for trace {} in {}",
|
||||
points_to_restore,
|
||||
trace_id,
|
||||
file_uuid
|
||||
);
|
||||
true
|
||||
}
|
||||
Err(e) => {
|
||||
|
||||
Reference in New Issue
Block a user