Files
momentry_core/src/bin/fix_chunks.rs
T
Accusys 3d13a06bd9 feat: face fix deployment + trace_* regeneration + executor stderr filter fix
- swift_face.swift: frame rounding (.rounded()), conf 0.75, min_size 64
- trace_* directories regenerated for KOBA (37 traces, start_frame 5307)
- executor.rs: stderr filter now logs all non-empty stderr (was discarding)
- VAD not skippable in ASRX (main_fixed.py Step 2 always runs)
- Step 2.5 sentence boundary refinement added
- Cluster agent async endpoints + similarity transparency
- Keyword search: relationship text extraction, priority ordering
- Face fix handoff doc for Studio team
2026-08-05 00:13:50 +08:00

43 lines
1.3 KiB
Rust

use anyhow::Result;
use momentry_core::core::chunk::rule1_ingest;
use momentry_core::core::config;
use momentry_core::core::db::PostgresDb;
#[tokio::main]
async fn main() -> Result<()> {
tracing_subscriber::fmt::init();
let db = PostgresDb::new(&config::DATABASE_URL).await?;
// Find files with OCR pre_chunks but missing OCR chunks
let files: Vec<(String, f64)> = sqlx::query_as::<_, (String, f64)>(
r#"
SELECT pc.file_uuid, v.fps
FROM pre_chunks pc
JOIN videos v ON v.file_uuid = pc.file_uuid
WHERE pc.processor_type = 'ocr'
AND NOT EXISTS (
SELECT 1 FROM chunk c
WHERE c.file_uuid = pc.file_uuid AND c.chunk_type = 'ocr'
)
GROUP BY pc.file_uuid, v.fps
ORDER BY COUNT(*) DESC
"#,
)
.fetch_all(db.pool())
.await?;
println!("Found {} files with OCR stuck in pre_chunks", files.len());
for (file_uuid, fps) in &files {
println!("Processing {} (fps={})...", file_uuid, fps);
match rule1_ingest::execute_rule1(&db, file_uuid, *fps).await {
Ok(count) => println!(" ✅ Created {} chunks", count),
Err(e) => eprintln!(" ❌ Failed: {}", e),
}
}
println!("Done!");
Ok(())
}