refactor: remove Rule 3, Story, and Caption processors
- Remove Rule 3 (Scene Chunking) from worker auto-trigger - Remove rule3_ingest.rs and related imports - Remove Story/Caption from playground module parsing - Clean up scan.rs Rule 3 display - Fix ASRX field name conversion (start_time -> start) Reason: Story/5W1H/Scene accuracy too poor - will redesign later
This commit is contained in:
+15
-42
@@ -7,7 +7,7 @@ use tokio::time::sleep;
|
||||
use tracing::{debug, error, info, warn};
|
||||
|
||||
use crate::api::identity_agent_api::run_identity_agent;
|
||||
use crate::core::chunk::{rule1_ingest, rule3_ingest};
|
||||
use crate::core::chunk::rule1_ingest;
|
||||
use crate::core::config::OUTPUT_DIR;
|
||||
use crate::core::db::qdrant_db::QdrantDb;
|
||||
use crate::core::db::{
|
||||
@@ -1023,21 +1023,10 @@ impl JobWorker {
|
||||
.fetch_optional(pool)
|
||||
.await
|
||||
.unwrap_or(None)
|
||||
.unwrap_or(0)
|
||||
.unwrap_or(0)
|
||||
> 0;
|
||||
|
||||
let rule3 = !has_cut
|
||||
|| sqlx::query_scalar::<_, i32>(&format!(
|
||||
"SELECT 1 FROM {chunk_t} WHERE file_uuid = $1 AND chunk_type = 'cut' LIMIT 1"
|
||||
))
|
||||
.bind(uuid)
|
||||
.fetch_optional(pool)
|
||||
.await
|
||||
.unwrap_or(None)
|
||||
.unwrap_or(0)
|
||||
> 0;
|
||||
|
||||
let trace = !has_face
|
||||
let trace = !has_face
|
||||
|| sqlx::query_scalar::<_, i64>(&format!(
|
||||
"SELECT COUNT(DISTINCT trace_id) FROM {fd_t} WHERE file_uuid = $1 AND trace_id IS NOT NULL"
|
||||
))
|
||||
@@ -1047,14 +1036,13 @@ impl JobWorker {
|
||||
.unwrap_or(0)
|
||||
> 0;
|
||||
|
||||
let all_ok = rule1 && vector && rule3 && trace;
|
||||
if !all_ok {
|
||||
tracing::info!(
|
||||
"[Ingestion] waiting (uuid={}): rule1={} vector={} rule3={} trace={}",
|
||||
uuid,
|
||||
rule1,
|
||||
vector,
|
||||
rule3,
|
||||
let all_ok = rule1 && vector && trace;
|
||||
if !all_ok {
|
||||
tracing::info!(
|
||||
"[Ingestion] waiting (uuid={}): rule1={} vector={} trace={}",
|
||||
uuid,
|
||||
rule1,
|
||||
vector,
|
||||
trace
|
||||
);
|
||||
}
|
||||
@@ -1227,27 +1215,12 @@ impl JobWorker {
|
||||
Ok(None) => error!("Video not found for chunking: {}", uuid_clone),
|
||||
Err(e) => error!("Failed to get video info for chunking: {}", e),
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if all_completed {
|
||||
if has_cut {
|
||||
info!("📝 Prerequisites met for Rule 3 Scene Chunking. Starting ingestion...");
|
||||
let db_clone = self.db.clone();
|
||||
let uuid_clone = uuid.to_string();
|
||||
tokio::spawn(async move {
|
||||
match rule3_ingest::ingest_rule3(db_clone.pool(), &uuid_clone).await {
|
||||
Ok(count) => info!(
|
||||
"✅ Rule 3 Scene Ingestion completed: {} scenes processed.",
|
||||
count
|
||||
),
|
||||
Err(e) => error!("❌ Rule 3 Scene Ingestion failed: {}", e),
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 🚀 P2 Trigger: Face Trace + DB Store (after Face)
|
||||
if all_completed {
|
||||
// 🚀 P2 Trigger: Face Trace + DB Store (after Face)
|
||||
// Runs face_tracker.py (IoU+embedding tracking), stores trace_id + position in DB
|
||||
if has_face {
|
||||
info!("📝 Face completed, triggering face trace + DB store...");
|
||||
|
||||
Reference in New Issue
Block a user