fix: harden post-correct prompts and add overlap drift guard

This commit is contained in:
Adolfo Reyna
2026-03-06 20:42:01 -05:00
parent 617f2872e7
commit 2b501f9cdd
2 changed files with 58 additions and 19 deletions
+9
View File
@@ -185,3 +185,12 @@ The project now features a high-performance, Apple Silicon-optimized pipeline th
- When a probable speaker switch is detected, the current buffered caption line is force-flushed early instead of waiting only for silence.
- Added speaker-state resets on watchdog/hallucination/silence reset paths to avoid stale identity drift.
- **Outcome:** Users can opt into faster caption segmentation at speaker boundaries while keeping default behavior unchanged.
## Phase 23: Prompt Hardening + Anti-Drift Guardrails
- **Goal:** Reduce semantic drift in LLM post-correction and merge decisions.
- **Approach:**
- Rewrote post-correction prompt with strict "current line only" and "if uncertain, keep original" constraints.
- Expanded post-correction context to up to two previous lines but marked as reference-only.
- Added token-overlap acceptance guard (`--post-correct-min-overlap`) to reject LLM rewrites that diverge too far from source text.
- Updated merge-decider prompt to stricter JSON behavior and added overlap-based fallback to heuristic merge.
- **Outcome:** Improved protection against context bleed (e.g., replacing current line with prior sentence) while keeping optional LLM improvements.