fix(meeting): keep polish from inventing markers or dropping qualifiers

The local model follows the polish instructions only most of the time: in
repeated runs it added a [00:00] or [화자 1] marker that was never in the
audio, and it turned "사실 거의 근간" into "사실 근간". Both change what the
meeting record says, so they are now enforced in code instead of hoped for
in the prompt: markers absent from the original chunk are stripped, and
meaning qualifiers the speaker said are restored from that chunk.

The instructions themselves were re-measured on the model: a fixed removal
list, an explicit qualifier example and a marker ban keep the filler cleanup
without touching ordinary words, and the same wording is used by the app,
the tests and the probe. Unknown-word repair still depends on the model.
This commit is contained in:
Yun Chan 2026-11-06 23:24:30 +09:00
parent bcd0cf4f23
commit 3aa68f466c
8 changed files with 167 additions and 5 deletions

View file

@ -89,7 +89,7 @@ Status quick-reference: `[x]` done+verified · `[~]` partial/unverified · `[ ]`
| MTG-11 | Meeting AI chat over transcript | [x] | [ ] | [ ] | [x] | Desktop `MeetingChatPanel` + `MEETING_CHAT` |
| MTG-12 | Content reporting for generated docs | [-] | [ ] | [x] | [x] | `content-report` Edge + generation receipts |
| MTG-13 | Existing audio/video import into a meeting | [x] | [ ] | [~] | [x] | **2026-11-01:** Desktop `meetingMode:importRecording` reuses `FileTranscriptionService` without duplicate history, saves canonical timestamped transcript + normalized WAV, then opens existing minutes generation. Mobile `MeetingsScreen` creates the workspace then routes `meetingId` + `importRequest` to the existing durable Record meeting pipeline. **2026-11-02:** installed Windows 1.16.0 passed the actual Electron picker→timestamped transcript→local summary/action-item journey, so desktop is `[x]`. Fold6 `.3` import entry/editor rendered, but authenticated device file-to-minutes E2E remains (`GAP-MTG-03`). [Evidence](../evidence/2026-11-02-verification.md). |
| MTG-14 | Learning-informed transcript correction (user dictionary + typed vocabulary) | [~] | [ ] | [ ] | [ ] | **2026-11-05 (root cause + rebuild of the transcript-correction seam):** the learned corpus was only wired to input suggestions. Meeting/live captions ran STT with a hardcoded `다음은 한국어 대화입니다.` prompt (no dictionary, no learned terms), the refine prompt had no glossary, the refine result updated only `CaptionService`'s own copy (meetings and the renderer kept the raw line), and the persisted `rawTranscript` was a plain join of raw segments. Now: core SSOT `@d3ro/core/transcript-correction` (glossary build, dictionary-variant replacement, learned-identifier correction with a unique-best rule, LLM reference block) + desktop `TranscriptGlossaryService` (dictionary + `personal_phrases`, 15 s cache invalidated on dictionary writes, fail-closed) are wired into `CaptionService` (hint on every recognition, deterministic correction per final line, glossary-aware refine, `segment-updated` event), `MeetingRecordingSession`/`MeetingModeService` (refined lines reach the meeting transcript and renderer via `meetingMode:segmentUpdated`; auto-polish gets the glossary block), `FileTranscriptionService` (per-chunk hint + correction) and `VoiceModeService` (learned-term pass). **2026-11-05 (v1.16.3 correction policy):** the first cut also rewrote ordinary Hangul words by 1-jamo distance. Measured against the real local corpus (users/_local/d3ro.db, 3 stored meeting transcripts) it changed **286 of 3,005 words** (하면 to 라면, 이제 to 이게, 매일 to 메일, 정보 to 정도). Deterministic correction is now limited to dictionary pronunciations and typed Latin identifiers (canonical casing preserved); Korean terms reach recognition through the STT hint and the polish prompt only. Re-measured on the same corpus: **0 of 3,005**. Real-engine check (sidecar large-v3-turbo, Korean TTS fixture containing the user term): baseline 하람로그에 to hinted transcript haramlog에, and a dictionary pronunciation entry still maps 디에로 to D3RO. Hangul-layout typing artifacts (dkssudgktpdy) are dropped from the hint. **2026-11-06 (v1.16.4 AI correction grounded in learning):** the polish pass no longer runs as a generic rewrite. Deterministic dictionary/identifier correction runs before and after the model, and the model receives a learned term list plus the user expressions with explicit rules (fix a misheard name/product/in-house term to the learned spelling; never swap ordinary nouns or endings on similarity alone). Re-measured on the real corpus: 0 of 3,005 deterministic changes, and the generated term block now shows canonical identifiers (HaramLog, Android, AI) with Hangul-layout artifacts removed from terms, hints and style examples. Dictation output is re-checked against the learned vocabulary after the LLM finishes. Tests: core transcript-correction.test.ts (17), desktop transcript-glossary.test.ts (10), red meeting-llm usecase (+1), polish-prompt.test.ts (4). **Real-model probe (2026-11-06, local gemma4:e4b with think:false):** with the production prompt and the real learned corpus, the misheard 하람록에 was rewritten to HaramLog에 and the dictionary pronunciation 디에로 to D3RO (2 word changes, no collateral edits); a natural Korean sentence without a learned term came back with 0 word substitutions (only a spacing merge); filler and self-correction were removed. Trap: without think:false (or /no_think) this model spends the whole output budget on its thinking block and returns empty content, which the chunk guard rejects. Live meeting with real jargon still open (GAP-MTG-04). |
| MTG-14 | Learning-informed transcript correction (user dictionary + typed vocabulary) | [~] | [ ] | [ ] | [ ] | **2026-11-05 (root cause + rebuild of the transcript-correction seam):** the learned corpus was only wired to input suggestions. Meeting/live captions ran STT with a hardcoded `다음은 한국어 대화입니다.` prompt (no dictionary, no learned terms), the refine prompt had no glossary, the refine result updated only `CaptionService`'s own copy (meetings and the renderer kept the raw line), and the persisted `rawTranscript` was a plain join of raw segments. Now: core SSOT `@d3ro/core/transcript-correction` (glossary build, dictionary-variant replacement, learned-identifier correction with a unique-best rule, LLM reference block) + desktop `TranscriptGlossaryService` (dictionary + `personal_phrases`, 15 s cache invalidated on dictionary writes, fail-closed) are wired into `CaptionService` (hint on every recognition, deterministic correction per final line, glossary-aware refine, `segment-updated` event), `MeetingRecordingSession`/`MeetingModeService` (refined lines reach the meeting transcript and renderer via `meetingMode:segmentUpdated`; auto-polish gets the glossary block), `FileTranscriptionService` (per-chunk hint + correction) and `VoiceModeService` (learned-term pass). **2026-11-05 (v1.16.3 correction policy):** the first cut also rewrote ordinary Hangul words by 1-jamo distance. Measured against the real local corpus (users/_local/d3ro.db, 3 stored meeting transcripts) it changed **286 of 3,005 words** (하면 to 라면, 이제 to 이게, 매일 to 메일, 정보 to 정도). Deterministic correction is now limited to dictionary pronunciations and typed Latin identifiers (canonical casing preserved); Korean terms reach recognition through the STT hint and the polish prompt only. Re-measured on the same corpus: **0 of 3,005**. Real-engine check (sidecar large-v3-turbo, Korean TTS fixture containing the user term): baseline 하람로그에 to hinted transcript haramlog에, and a dictionary pronunciation entry still maps 디에로 to D3RO. Hangul-layout typing artifacts (dkssudgktpdy) are dropped from the hint. **2026-11-06 (v1.16.4 AI correction grounded in learning):** the polish pass no longer runs as a generic rewrite. Deterministic dictionary/identifier correction runs before and after the model, and the model receives a learned term list plus the user expressions with explicit rules (fix a misheard name/product/in-house term to the learned spelling; never swap ordinary nouns or endings on similarity alone). Re-measured on the real corpus: 0 of 3,005 deterministic changes, and the generated term block now shows canonical identifiers (HaramLog, Android, AI) with Hangul-layout artifacts removed from terms, hints and style examples. Dictation output is re-checked against the learned vocabulary after the LLM finishes. Tests: core transcript-correction.test.ts (17), desktop transcript-glossary.test.ts (10), red meeting-llm usecase (+1), polish-prompt.test.ts (4). **Real-model probe (2026-11-06, local gemma4:e4b with think:false):** with the production prompt and the real learned corpus, the misheard 하람록에 was rewritten to HaramLog에 and the dictionary pronunciation 디에로 to D3RO (2 word changes, no collateral edits); a natural Korean sentence without a learned term came back with 0 word substitutions (only a spacing merge); filler and self-correction were removed. Trap: without think:false (or /no_think) this model spends the whole output budget on its thinking block and returns empty content, which the chunk guard rejects. **2026-11-06 (v1.16.5 polish guards):** the polish prompt was re-tuned by A/B on the local model and two invariants moved from prompt to code, because the model broke them intermittently: (a) invented `[MM:SS]` / `[화자 N]` markers are stripped from the saved transcript (`stripInventedMarkers`), (b) meaning qualifiers the speaker said (거의/대부분/아직 …) are restored from the original chunk (`restoreProtectedQualifiers`). Measured on the reporter transcript: fillers gone, comma fragments joined, 유치역학 → 유체역학 repaired, 거의 kept after the guard even when the model dropped it. Unknown-word repair itself is model-dependent (2/3 then 1/2 across prompt sets) and becomes deterministic only once the term is in the dictionary or has been typed. Tests: core hardening suite (15), polish-prompt (7), red meeting-llm (+2). Live meeting with real jargon still open (GAP-MTG-04). |
---