Improve prompt roles and correction repair context

This commit is contained in:
2026-11-11 17:42:30 +00:00
parent cf1fbe5748
commit f42573f8b0
23 changed files with 256 additions and 40 deletions

View File

@@ -131,8 +131,10 @@ matched entries in selection order for each candidate, including matches in the
replacement text. The deterministic guard and application check share the
stage's separate protection matcher.
Each candidate includes the immediately preceding and following source segments
available within its fixed chunk, labeled `preceding` or `following` with speaker,
Each candidate carries its target segment's supplied `speaker`, including an
empty value when no speaker is provided. It also includes the immediately
preceding and following source segments available within its fixed chunk,
labeled `preceding` or `following` with speaker,
text, and categories, plus glossary entries whose names, aliases, or
recognized plurals appear in its original/resulting text or those neighbors.
Glossary matching uses the same recognition rules; entries retain selection order.
@@ -143,8 +145,9 @@ already clear from its own segment does not require such evidence. No audio,
out-of-chunk context, or complete transcript is implied.
Context is serialized inside the validation item and included in the existing
payload token estimate. If one enriched item exceeds the configured limit, optional
neighbors are removed from the end first, then glossary entries from the end,
payload token estimate, including the target speaker. If one enriched item exceeds
the configured limit, optional neighbors are removed from the end first, then
glossary entries from the end,
until it fits or only required candidate data remains. Required before/after text
is never truncated. Existing oversized-candidate handling still applies if that
required data does not fit. The built-in estimator reuses encoded fragment