From 9c2b6a978298017b93a2f5ffa67aedec4644da28 Mon Sep 17 00:00:00 2001 From: Yun Chan Date: Thu, 5 Nov 2026 21:58:28 +0900 Subject: [PATCH] feat(meeting): correct transcripts with vocabulary learned from typing Meeting and caption transcription never used what the app had already learned: speech recognition ran with a fixed Korean prompt, the refine prompt had no glossary, refined lines stopped inside the caption service, and the saved transcript was a raw join of segments. Names and jargon the user types every day were therefore re-mangled on every recording. The learned corpus (user dictionary plus personal phrases) now feeds one glossary that biases recognition, fixes mistyped words deterministically right after each line is finalized, and is handed to the local model when it polishes a line. Refined lines also reach the meeting transcript and screen through a new segment-updated event. Corrections never touch words the user actually wrote, refuse ties between equally likely candidates, and keep particles intact. --- CHANGELOG.md | 15 +- .../src/main/services/CaptionService.ts | 44 +- .../src/main/services/DictionaryService.ts | 10 +- .../main/services/FileTranscriptionService.ts | 15 +- .../src/main/services/MeetingModeService.ts | 16 +- .../services/TranscriptGlossaryService.ts | 184 +++++++ .../src/main/services/VoiceModeService.ts | 10 +- apps/desktop/src/main/services/llm-prompts.ts | 6 + .../meeting/MeetingRecordingSession.ts | 16 + apps/desktop/src/preload/index.ts | 3 + .../src/renderer/pages/MeetingModePage.tsx | 6 + .../main/services/transcript-glossary.test.ts | 155 ++++++ apps/desktop/tests/red/harness.ts | 2 + docs/map/04-desktop-app.md | 11 +- docs/map/10-feature-catalog.md | 36 +- docs/map/11-gap-backlog.md | 41 +- memory/project_status.md | 8 + .../__tests__/transcript-correction.test.ts | 160 +++++++ packages/core/package.json | 4 + packages/core/src/ipc-channels.ts | 1 + packages/core/src/transcript-correction.ts | 452 ++++++++++++++++++ 21 files changed, 1134 insertions(+), 61 deletions(-) create mode 100644 apps/desktop/src/main/services/TranscriptGlossaryService.ts create mode 100644 apps/desktop/tests/main/services/transcript-glossary.test.ts create mode 100644 packages/core/__tests__/transcript-correction.test.ts create mode 100644 packages/core/src/transcript-correction.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cb99dd..0281cb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,15 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Fixed -- Prevent fast Han/Eng auto-correction from interleaving with the next keystroke; defer corrections during continuous bursts and apply the current trailing correction region together after typing pauses. - ### Planned - macOS / Linux support - Additional Whisper model management UI - Plugin system for custom pipelines +## [1.16.2] - 2026-11-05 + +> Published from an annotated tag. Installer and update metadata are served by the +> canonical Forgejo feed; no binaries are committed to this repository. + +### Added +- Meeting and live-caption transcription now use the vocabulary the app learned from your typing: dictionary words, pronunciations and frequently typed terms bias speech recognition before it runs, fix mistyped words as soon as each line is finalized (no model required), and are given to the local model when it polishes a line. +- Polished caption lines now reach the meeting transcript and the meeting screen instead of stopping inside the caption service, so the saved transcript carries the corrected text. + +### Fixed +- Learned vocabulary used to feed typing suggestions only, which is why transcripts kept mangling names and jargon the app already knew. + ## [1.16.1] - 2026-11-04 > Published from an annotated tag. Installer and update metadata are served by the diff --git a/apps/desktop/src/main/services/CaptionService.ts b/apps/desktop/src/main/services/CaptionService.ts index 5115e30..c4ec7d1 100644 --- a/apps/desktop/src/main/services/CaptionService.ts +++ b/apps/desktop/src/main/services/CaptionService.ts @@ -14,6 +14,7 @@ import { getLocalLLMService } from './LocalLLMService' import { getHistoryService } from './HistoryService' import { configGet } from './ConfigService' import { buildCaptionRefinePrompt } from './llm-prompts' +import { getTranscriptGlossaryService } from './TranscriptGlossaryService' import { StreamingCaptionTrack, type CaptionTranscription } from './caption/StreamingCaptionTrack' import { CaptionAudioSources } from './caption/CaptionAudioSources' import { acceptCaptionRefinement } from '@d3ro/core/caption-streaming' @@ -97,6 +98,8 @@ const DEFAULT_START_OPTIONS: ResolvedStartOptions = { interface CaptionServiceEvents { 'state-changed': (state: CaptionState) => void 'segment': (segment: CaptionSegment) => void + /** 다듬기(학습 어휘 교정·LLM 교열)로 확정 줄의 텍스트가 바뀌었다 */ + 'segment-updated': (update: { id: string; text: string }) => void 'delta': (data: { text: string; isFinal: boolean }) => void 'session-saved': (summary: CaptionSessionResult) => void /** @@ -211,7 +214,8 @@ class CaptionService extends EventEmitter { this._segments = [] this._refineQueue = [] this._sessionLanguage = null - // 초기 컨텍스트 힌트 — Whisper 첫 청크 환각 방지 + // 초기 컨텍스트 힌트 — Whisper 첫 청크 환각 방지. + // 학습 어휘 힌트는 _transcribe 가 매 인식마다 덧붙인다(트랙 문맥에 섞이면 중복된다). const lang = configGet('sttLanguage') as string | undefined const initialContext = lang === 'ko' ? '다음은 한국어 대화입니다.' : '' @@ -467,7 +471,8 @@ class CaptionService extends EventEmitter { const language = configured === 'auto' ? (this._sessionLanguage ?? 'auto') : configured const result = await getLocalSTTService().transcribe(audio, { language, - initialPrompt: opts.initialPrompt, + // 학습 어휘 힌트는 매 인식마다 붙인다 — rolling context 가 잘려도 용어 편향이 유지된다. + initialPrompt: getTranscriptGlossaryService().sttHint(opts.initialPrompt), vadFilter: true, partial: opts.partial, modelId: this._captionModelId ?? undefined, @@ -493,7 +498,14 @@ class CaptionService extends EventEmitter { this._sendToMainWindow(IPC_CHANNELS.CAPTION.DELTA, delta) } - private _emitFinal(text: string, source: 'mic' | 'system'): void { + private _emitFinal(rawText: string, source: 'mic' | 'system'): void { + // 학습 어휘(사전 + 개인 문구)로 먼저 되돌린다 — LLM 이 꺼져 있어도 용어는 고쳐진다. + const corrected = getTranscriptGlossaryService().correct(rawText) + const text = corrected.text.trim() + if (!text) return + if (corrected.corrections.length > 0) { + logger.info(`자막 학습 어휘 교정 ${corrected.corrections.length}건 (${source})`) + } const segment: CaptionSegment = { id: crypto.randomUUID(), text, @@ -534,7 +546,12 @@ class CaptionService extends EventEmitter { const index = this._segments.findIndex((item) => item.id === segment.id) if (index === -1) return const previous = this._segments.slice(Math.max(0, index - 2), index).map((item) => item.text) - const { systemPrompt, text } = buildCaptionRefinePrompt({ text: segment.text, previous }) + const glossary = getTranscriptGlossaryService().promptSection() + const { systemPrompt, text } = buildCaptionRefinePrompt({ + text: segment.text, + previous, + ...(glossary ? { glossary } : {}), + }) try { const result = await getLocalLLMService().generate(text, { systemPrompt, @@ -544,17 +561,24 @@ class CaptionService extends EventEmitter { }) const refined = acceptCaptionRefinement(segment.text, result.text) if (!refined) return - const current = this._segments.find((item) => item.id === segment.id) - if (!current) return - current.text = refined - const update = { id: segment.id, text: refined } - sendToCaptionOverlay(IPC_CHANNELS.CAPTION.SEGMENT_UPDATED, update) - this._sendToMainWindow(IPC_CHANNELS.CAPTION.SEGMENT_UPDATED, update) + // 모델이 용어를 다른 표기로 되돌렸을 수 있다 — 정본 표기를 마지막에 다시 강제한다. + this._replaceSegmentText(segment.id, getTranscriptGlossaryService().correct(refined).text) } catch (err) { logger.debug(`자막 다듬기 건너뜀: ${err instanceof Error ? err.message : String(err)}`) } } + /** 확정 줄 텍스트를 바꾸고 오버레이·메인 창·회의 모드에 알린다. */ + private _replaceSegmentText(segmentId: string, text: string): void { + const current = this._segments.find((item) => item.id === segmentId) + if (!current || current.text === text) return + current.text = text + const update = { id: segmentId, text } + sendToCaptionOverlay(IPC_CHANNELS.CAPTION.SEGMENT_UPDATED, update) + this._sendToMainWindow(IPC_CHANNELS.CAPTION.SEGMENT_UPDATED, update) + this.emit('segment-updated', update) + } + // ── 내부: 세션 저장 ── private _saveSession(persist: boolean): CaptionSessionResult | null { diff --git a/apps/desktop/src/main/services/DictionaryService.ts b/apps/desktop/src/main/services/DictionaryService.ts index 6b9e64f..75da363 100644 --- a/apps/desktop/src/main/services/DictionaryService.ts +++ b/apps/desktop/src/main/services/DictionaryService.ts @@ -9,6 +9,7 @@ import { getDatabase } from '../db' import { dictionary } from '../db/schema' import type { Dictionary, NewDictionary } from '../db/schema' import { getLogger } from './LoggerService' +import { invalidateTranscriptGlossary } from './TranscriptGlossaryService' import { getCloudSyncService } from './CloudSyncService' import { getMainWindow } from '../windows/WindowManager' import { D3ROError, ErrorCode } from '@d3ro/core/errors' @@ -114,6 +115,8 @@ class DictionaryService { throw err } logger.info(`Dictionary entry added: "${word}"`) + // 학습 어휘 캐시(전사 교열·STT 힌트)는 즉시 무효화한다 — 방금 추가한 단어가 바로 쓰여야 한다. + invalidateTranscriptGlossary() // Phase 3.3: 자동 push (fire-and-forget) void getCloudSyncService().pushOne('dictionary', id) return this._toEntry(entry as Dictionary) @@ -150,6 +153,7 @@ class DictionaryService { } const updated = db.select().from(dictionary).where(eq(dictionary.id, params.id)).get() + invalidateTranscriptGlossary() // Phase 3.3: 자동 push (fire-and-forget) void getCloudSyncService().pushOne('dictionary', params.id) return updated ? this._toEntry(updated) : null @@ -158,7 +162,10 @@ class DictionaryService { delete(id: string): boolean { const db = getDatabase() const result = db.delete(dictionary).where(eq(dictionary.id, id)).run() - if (result.changes > 0) getCloudSyncService().pushDelete('dictionary', id) + if (result.changes > 0) { + invalidateTranscriptGlossary() + getCloudSyncService().pushDelete('dictionary', id) + } return result.changes > 0 } @@ -449,6 +456,7 @@ class DictionaryService { logger.info( `Dictionary import: ${outcome.imported} imported, ${outcome.skipped} skipped, ${outcome.errors} errors` ) + if (outcome.imported > 0) invalidateTranscriptGlossary() return outcome } diff --git a/apps/desktop/src/main/services/FileTranscriptionService.ts b/apps/desktop/src/main/services/FileTranscriptionService.ts index d5ec26a..63d7504 100644 --- a/apps/desktop/src/main/services/FileTranscriptionService.ts +++ b/apps/desktop/src/main/services/FileTranscriptionService.ts @@ -35,6 +35,7 @@ import type { } from '@d3ro/core/types' import { collapseRepeatedSegments, collapseRepeats, isDegenerateTranscript } from './file-transcription/repetition' +import { getTranscriptGlossaryService } from './TranscriptGlossaryService' import { SUPPORTED_MEDIA_EXTENSION_SET } from './file-transcription/media-formats' const logger = getLogger('FileTranscriptionService') @@ -178,7 +179,8 @@ class FileTranscriptionService extends EventEmitter { let result = await sttService.transcribe(chunkBuffer, { language: lang, - initialPrompt: previousContext || undefined, + // 학습 어휘 힌트를 매 조각에 붙인다 — 앞 문맥이 없어도 고유명사 표기가 유지된다. + initialPrompt: getTranscriptGlossaryService().sttHint(previousContext) || undefined, vadFilter: true, }) // 인식 중에 취소됐으면 결과를 버린다(STT 호출 자체는 끊을 수 없다) @@ -187,12 +189,17 @@ class FileTranscriptionService extends EventEmitter { // 앞 조각 힌트 때문에 반복 루프에 빠졌으면 힌트 없이 한 번 다시 듣는다 if (previousContext && isDegenerateTranscript(result.text ?? '')) { logger.warn(`청크 ${i + 1}/${totalChunks}: 반복 루프 감지 — 앞 문맥 없이 다시 전사`) - result = await sttService.transcribe(chunkBuffer, { language: lang, vadFilter: true }) + result = await sttService.transcribe(chunkBuffer, { + language: lang, + initialPrompt: getTranscriptGlossaryService().sttHint('') || undefined, + vadFilter: true, + }) throwIfCancelled() } const rawText = result.text?.trim() ?? '' - const chunkText = collapseRepeats(rawText) + // 학습 어휘(사전 + 개인 문구)로 잘못 들은 어절을 되돌린다. + const chunkText = getTranscriptGlossaryService().correct(collapseRepeats(rawText)).text if (chunkText.length > 0) { allTexts.push(chunkText) // 반복으로 망가진 결과는 다음 조각의 힌트로 넘기지 않는다 — 넘기면 반복이 다음 조각으로 번졌다 @@ -200,7 +207,7 @@ class FileTranscriptionService extends EventEmitter { for (const seg of collapseRepeatedSegments(result.segments)) { allSegments.push({ - text: seg.text, + text: getTranscriptGlossaryService().correct(seg.text).text, start: seg.start + startSec, end: seg.end + startSec, confidence: seg.confidence, diff --git a/apps/desktop/src/main/services/MeetingModeService.ts b/apps/desktop/src/main/services/MeetingModeService.ts index 3d6888e..9c270b8 100644 --- a/apps/desktop/src/main/services/MeetingModeService.ts +++ b/apps/desktop/src/main/services/MeetingModeService.ts @@ -57,6 +57,7 @@ import { } from '@d3ro/core/meeting-transcript' import { markdownToDocx } from '@d3ro/core/utils/markdown-to-docx' import { getFileTranscriptionService } from './FileTranscriptionService' +import { getTranscriptGlossaryService } from './TranscriptGlossaryService' import { buildImportedMeetingTranscript } from './meeting/imported-recording' import type { MeetingModeState, @@ -371,6 +372,11 @@ class MeetingModeService extends EventEmitter { captionService.on('segment', listener) return () => { captionService.off('segment', listener) } }, + // 다듬기(학습 어휘·LLM 교열)로 바뀐 줄도 받아야 회의록 전사가 원문에 머물지 않는다. + onSegmentUpdated: (listener) => { + captionService.on('segment-updated', listener) + return () => { captionService.off('segment-updated', listener) } + }, // 회의가 소유한 세션만 멈춘다. 다른 소유자면 false(요약 없음). stop: () => captionService.stop('meeting'), }, @@ -385,6 +391,10 @@ class MeetingModeService extends EventEmitter { this.emit('segment', segment) this._sendToRenderer(IPC_CHANNELS.MEETING_MODE.SEGMENT, segment) }, + onSegmentUpdated: (update) => { + this.emit('segment-updated', update) + this._sendToRenderer(IPC_CHANNELS.MEETING_MODE.SEGMENT_UPDATED, update) + }, onStopError: (err) => { logger.error(`자막 정지 실패 — 지금까지의 전사로 저장한다: ${err instanceof Error ? err.message : String(err)}`) }, @@ -1419,10 +1429,14 @@ class MeetingModeService extends EventEmitter { if (!transcript) throw new D3ROError(ErrorCode.MeetingPolishFailed, '전사 텍스트가 없습니다') const llm = await this._resolveMeetingLlm() + // 사용자가 학습시킨 용어·표현을 교열 지시에 넘긴다 — 예전엔 일반 프롬프트만 받아 + // 고유명사·사내 용어가 매번 다르게 교정됐다. + const glossary = getTranscriptGlossaryService().promptSection() const polished = await this._rewriteTranscriptInChunks( llm, transcript, - '다음 음성 전사 텍스트를 다듬어주세요. 필러 단어(음, 어, 그, 아, 뭐 등), 말 바꾸기(A 아니 A가 아니라 B → B), 불필요한 어절·의미 중복을 제거하고 문장 구조를 자연스럽게 교정하되, 화자의 원래 말투(반말/존댓말)와 의미·내용은 절대 변경하지 마세요. 타임스탬프 형식 [MM:SS]과 화자 표기([화자 N] 등)는 그대로 유지하세요.', + '다음 음성 전사 텍스트를 다듬어주세요. 필러 단어(음, 어, 그, 아, 뭐 등), 말 바꾸기(A 아니 A가 아니라 B → B), 불필요한 어절·의미 중복을 제거하고 문장 구조를 자연스럽게 교정하되, 화자의 원래 말투(반말/존댓말)와 의미·내용은 절대 변경하지 마세요. 타임스탬프 형식 [MM:SS]과 화자 표기([화자 N] 등)는 그대로 유지하세요.' + + (glossary ? `\n\n${glossary}` : ''), ErrorCode.MeetingPolishFailed, ) diff --git a/apps/desktop/src/main/services/TranscriptGlossaryService.ts b/apps/desktop/src/main/services/TranscriptGlossaryService.ts new file mode 100644 index 0000000..1a938ea --- /dev/null +++ b/apps/desktop/src/main/services/TranscriptGlossaryService.ts @@ -0,0 +1,184 @@ +// src/main/services/TranscriptGlossaryService.ts +// 전사 교열용 학습 어휘 창구(싱글톤). +// +// 왜 필요한가: +// - 사용자가 키보드로 친 문장은 개인 그래프(personal_phrases)와 사전(dictionary)에 쌓이지만, +// 회의록·자막 전사에는 그 어휘가 한 번도 쓰이지 않았다. 자막은 `다음은 한국어 대화입니다.`라는 +// 고정 힌트로 인식됐고, 확정된 줄은 용어 사전 없이 일반 프롬프트로만 다듬어졌다. +// - 이 서비스는 그 어휘를 한 곳에서 모아 STT 힌트·결정적 교정·LLM 교열 참고 블록으로 공급한다. +// 교정 규칙 자체는 core `transcript-correction` 이 정본이고, 여기서는 소스 수집과 캐시만 맡는다. +// +// 소스는 주입 가능하다(테스트는 DB 없이 가짜 소스). + +import { desc } from 'drizzle-orm' +import { getLogger } from './LoggerService' +import { getDatabase } from '../db' +import { dictionary, personalPhrases } from '../db/schema' +import { + appendGlossaryHint, + buildGlossaryPromptSection, + buildTranscriptGlossary, + correctLearnedTerms, + isGlossaryEmpty, + replaceDictionaryTerms, + type CorrectedTranscript, + type GlossaryDictionaryEntry, + type GlossaryPhrase, + type TranscriptCorrectionEntry, + type TranscriptGlossary, +} from '@d3ro/core/transcript-correction' + +const logger = getLogger('TranscriptGlossaryService') + +/** 학습 어휘 캐시 수명. 사전/학습은 회의 중에도 늘 수 있으므로 짧게 둔다. */ +const GLOSSARY_TTL_MS = 15_000 + +export interface TranscriptGlossarySources { + /** 사용자 사전 (정본 단어 + 발음 변형) */ + listDictionary(): readonly GlossaryDictionaryEntry[] + /** 개인 그래프에서 배운 문구 (빈도 포함) */ + listPhrases(): readonly GlossaryPhrase[] + now?: () => number +} + +interface CachedGlossary { + glossary: TranscriptGlossary + at: number +} + +export class TranscriptGlossaryService { + private _cache: CachedGlossary | null = null + private readonly _now: () => number + + constructor( + private readonly _sources: TranscriptGlossarySources, + private readonly _ttlMs: number = GLOSSARY_TTL_MS, + ) { + this._now = _sources.now ?? Date.now + } + + /** 현재 글로서리 (TTL 캐시). 소스가 실패하면 빈 글로서리 — 전사는 계속돼야 한다. */ + get(): TranscriptGlossary { + const now = this._now() + if (this._cache && now - this._cache.at < this._ttlMs) return this._cache.glossary + let glossary: TranscriptGlossary + try { + glossary = buildTranscriptGlossary({ + dictionary: this._sources.listDictionary(), + phrases: this._sources.listPhrases(), + }) + } catch (err) { + logger.warn(`학습 어휘 수집 실패 — 이번 전사는 어휘 없이 진행: ${err instanceof Error ? err.message : String(err)}`) + glossary = buildTranscriptGlossary({}) + } + this._cache = { glossary, at: now } + return glossary + } + + /** 사전·학습이 바뀌었을 때 호출한다. */ + invalidate(): void { + this._cache = null + } + + /** STT initial_prompt 에 학습 어휘 힌트를 덧붙인다. */ + sttHint(base: string): string { + return appendGlossaryHint(base, this.get()) + } + + /** LLM 교열 프롬프트에 넣는 용어·문체 참고 블록 (없으면 빈 문자열). */ + promptSection(): string { + return buildGlossaryPromptSection(this.get()) + } + + /** + * 학습 어휘 기반 결정적 교정 (LLM 없이 즉시). + * 1) 사전 발음 변형 → 정본 표기 + * 2) 학습 어절과 1자모 차이 나는 전사 어절 → 학습 어절 + * 사용자가 실제로 쓴 어절은 건드리지 않는다(core 규칙). + */ + correct(text: string): CorrectedTranscript { + if (!text || text.trim().length === 0) return { text, corrections: [] } + const glossary = this.get() + if (isGlossaryEmpty(glossary)) return { text, corrections: [] } + + const corrections: TranscriptCorrectionEntry[] = [] + let current = text + if (glossary.dictionary.length > 0) { + const dictionaryPass = replaceDictionaryTerms( + current, + glossary.dictionary.map((entry) => ({ word: entry.word, pronunciation: entry.variants.join(',') })), + ) + current = dictionaryPass.text + corrections.push(...dictionaryPass.changes) + } + + const learned = correctLearnedTerms(current, glossary) + if (learned.corrections.length > 0) corrections.push(...learned.corrections) + return { text: learned.text, corrections } + } + + /** + * 학습 어절만 교정한다. 사전 치환을 호출자가 사용 횟수 집계와 함께 처리하는 경로 + * (받아쓰기)에서 쓴다. + */ + correctLearned(text: string): CorrectedTranscript { + if (!text || text.trim().length === 0) return { text, corrections: [] } + const glossary = this.get() + if (isGlossaryEmpty(glossary)) return { text, corrections: [] } + return correctLearnedTerms(text, glossary) + } +} + +let instance: TranscriptGlossaryService | null = null + +/** DB 기반 기본 소스. DB 가 아직 없으면 빈 어휘를 돌려준다(전사를 막지 않는다). */ +function defaultSources(): TranscriptGlossarySources { + return { + listDictionary: () => { + try { + return getDatabase() + .select({ word: dictionary.word, pronunciation: dictionary.pronunciation }) + .from(dictionary) + .orderBy(desc(dictionary.usageCount)) + .limit(300) + .all() + } catch { + return [] + } + }, + listPhrases: () => { + try { + return getDatabase() + .select({ text: personalPhrases.phrase, count: personalPhrases.count }) + .from(personalPhrases) + .orderBy(desc(personalPhrases.count), desc(personalPhrases.lastUsedAt)) + .limit(400) + .all() + } catch { + return [] + } + }, + } +} + +export function initTranscriptGlossaryService( + sources: TranscriptGlossarySources = defaultSources(), + ttlMs?: number, +): TranscriptGlossaryService { + instance = new TranscriptGlossaryService(sources, ttlMs) + return instance +} + +export function getTranscriptGlossaryService(): TranscriptGlossaryService { + if (!instance) instance = initTranscriptGlossaryService() + return instance +} + +/** 사전·학습이 바뀌었을 때 호출한다(아직 만들지 않았으면 아무 것도 하지 않는다). */ +export function invalidateTranscriptGlossary(): void { + instance?.invalidate() +} + +export function resetTranscriptGlossaryServiceForTests(): void { + instance = null +} diff --git a/apps/desktop/src/main/services/VoiceModeService.ts b/apps/desktop/src/main/services/VoiceModeService.ts index e5f00b2..e3c7d91 100644 --- a/apps/desktop/src/main/services/VoiceModeService.ts +++ b/apps/desktop/src/main/services/VoiceModeService.ts @@ -27,6 +27,7 @@ import { configGet } from './ConfigService' import { getTextInsertService } from './TextInsertService' import { getLocalLLMService } from './LocalLLMService' import { getLlmGateway } from './llm/LlmGateway' +import { getTranscriptGlossaryService } from './TranscriptGlossaryService' import { buildInstructionInvocation, resolveTargetLanguage } from './llm-prompts' import { D3ROError, ErrorCode } from '@d3ro/core/errors' import { cleanDictatedText } from '@d3ro/core/dictation-cleaner' @@ -907,13 +908,12 @@ class VoiceModeService extends EventEmitter { const stt = getSTTManager() const language = configGet('sttLanguage') - // Dictionary → STT initialPrompt 주입 (Speakly 패턴) + // 사전 + 학습 어휘 → STT initial_prompt 주입 (사용자가 학습시킨 용어를 인식 단계에서 미리 편향) let initialPrompt: string | undefined try { - const { getDictionaryService } = await import('./DictionaryService') - initialPrompt = getDictionaryService().getPromptHints() || undefined + initialPrompt = getTranscriptGlossaryService().sttHint('') || undefined } catch { - // DictionaryService 미초기화 시 무시 + // 학습 어휘 소스 미준비 시 무시 } // 사이드카는 요청을 직렬 처리하므로, 진행 중인 미리보기 요청이 최종 전사를 @@ -950,6 +950,8 @@ class VoiceModeService extends EventEmitter { } catch { // DictionaryService 미초기화 시 무시 } + // 사전에 없는 개인 어휘(학습한 어절)로 남은 오인식을 되돌린다. + rawText = getTranscriptGlossaryService().correctLearned(rawText).text if (this._session) { this._session.transcription = rawText diff --git a/apps/desktop/src/main/services/llm-prompts.ts b/apps/desktop/src/main/services/llm-prompts.ts index 2d7fd59..e41f922 100644 --- a/apps/desktop/src/main/services/llm-prompts.ts +++ b/apps/desktop/src/main/services/llm-prompts.ts @@ -529,6 +529,8 @@ const CAPTION_REFINE_SYSTEM_PROMPT = `실시간 음성 인식으로 받아 적 규칙: - 띄어쓰기, 문장부호, 앞 문맥으로 볼 때 명백하게 잘못 들은 단어만 고치세요. +- [사용자 용어] 가 있으면 전사에 나온 비슷한 표기를 그 용어로 바꾸세요(고유명사·제품명·사내 용어). +- [사용자가 실제로 쓰는 표현] 은 말투·용어 참고용입니다. 그 문장을 그대로 옮기거나 문장을 새로 쓰지 마세요. - 뜻을 바꾸거나, 요약하거나, 말을 더하거나 빼지 마세요. - 원문과 같은 언어, 같은 말투(존댓말/반말, 구어체)를 유지하세요. - 고친 문장 한 줄만 출력하세요. 설명, 따옴표, 번호를 붙이지 마세요. @@ -537,8 +539,12 @@ const CAPTION_REFINE_SYSTEM_PROMPT = `실시간 음성 인식으로 받아 적 export function buildCaptionRefinePrompt(input: { text: string previous: readonly string[] + /** 학습 어휘 참고 블록 (`buildGlossaryPromptSection` 결과) */ + glossary?: string }): { systemPrompt: string; text: string } { const sections: string[] = [] + const glossary = input.glossary?.trim() + if (glossary) sections.push(glossary, '') const previous = input.previous.filter((line) => line.trim().length > 0).slice(-2) if (previous.length > 0) sections.push('[앞 문맥]', ...previous, '') sections.push('[다듬을 자막]', input.text.trim()) diff --git a/apps/desktop/src/main/services/meeting/MeetingRecordingSession.ts b/apps/desktop/src/main/services/meeting/MeetingRecordingSession.ts index 2d6b865..7807e51 100644 --- a/apps/desktop/src/main/services/meeting/MeetingRecordingSession.ts +++ b/apps/desktop/src/main/services/meeting/MeetingRecordingSession.ts @@ -16,6 +16,8 @@ import type { CaptionSegment, MeetingMemo } from '@d3ro/core/types' export interface RecordingCaptionPort { /** 확정 세그먼트 구독 — 해지 함수를 돌려준다 */ onSegment(listener: (segment: CaptionSegment) => void): () => void + /** 다듬기(학습 어휘·LLM 교열)로 확정 세그먼트 텍스트가 바뀌었을 때 (선택) */ + onSegmentUpdated?(listener: (update: { id: string; text: string }) => void): () => void /** 이 녹음이 소유한 자막 세션을 멈춘다(마지막 문장 flush 포함). 세그먼트 요약을 돌려줄 수 있다. */ stop(): Promise<{ segments: CaptionSegment[] } | null | false> } @@ -31,6 +33,8 @@ export interface MeetingRecordingSessionPorts { now?: () => number /** 세그먼트가 이 녹음에 추가될 때(구독으로 받은 것만) */ onSegment?: (segment: CaptionSegment) => void + /** 세그먼트 텍스트가 다듬어졌을 때 — 화면·기록이 원문에 머물지 않게 알린다 */ + onSegmentUpdated?: (update: { id: string; text: string }) => void /** 자막 정지 실패 — 정지는 계속 진행된다(스냅샷은 그때까지의 세그먼트로 만든다) */ onStopError?: (error: unknown) => void } @@ -54,6 +58,7 @@ export class MeetingRecordingSession { private _audio: Buffer[] = [] private _lastRms = 0 private _unsubscribeSegment: (() => void) | null = null + private _unsubscribeSegmentUpdated: (() => void) | null = null private _unsubscribeAudio: (() => void) | null = null private _stopPromise: Promise | null = null private _snapshot: RecordingSnapshot | null = null @@ -74,6 +79,13 @@ export class MeetingRecordingSession { this._segments.push(segment) this._ports.onSegment?.(segment) }) + this._unsubscribeSegmentUpdated = + this._ports.caption.onSegmentUpdated?.((update) => { + const target = this._segments.find((segment) => segment.id === update.id) + if (!target || target.text === update.text) return + target.text = update.text + this._ports.onSegmentUpdated?.(update) + }) ?? null } /** 오디오 구독을 건다(파일 저장·레벨 표시용). */ @@ -89,6 +101,8 @@ export class MeetingRecordingSession { detach(): void { this._unsubscribeSegment?.() this._unsubscribeSegment = null + this._unsubscribeSegmentUpdated?.() + this._unsubscribeSegmentUpdated = null this._unsubscribeAudio?.() this._unsubscribeAudio = null } @@ -158,6 +172,8 @@ export class MeetingRecordingSession { } finally { this._unsubscribeSegment?.() this._unsubscribeSegment = null + this._unsubscribeSegmentUpdated?.() + this._unsubscribeSegmentUpdated = null } // 구독 밖에서 확정된 세그먼트가 있으면 요약에서 보충한다 if (summary) { diff --git a/apps/desktop/src/preload/index.ts b/apps/desktop/src/preload/index.ts index fa796ad..818dfbb 100644 --- a/apps/desktop/src/preload/index.ts +++ b/apps/desktop/src/preload/index.ts @@ -793,6 +793,9 @@ const electronAPI = { on(IPC_CHANNELS.MEETING_MODE.STATE_CHANGED, cb), onSegment: (cb: (e: CaptionSegment) => void): Unsubscribe => on(IPC_CHANNELS.MEETING_MODE.SEGMENT, cb), + /** 다듬기(학습 어휘·LLM 교열)로 바뀐 확정 줄 — 화면이 원문에 머물지 않게 갱신한다 */ + onSegmentUpdated: (cb: (e: { id: string; text: string }) => void): Unsubscribe => + on(IPC_CHANNELS.MEETING_MODE.SEGMENT_UPDATED, cb), onProcessingProgress: (cb: (e: MeetingProcessingProgress) => void): Unsubscribe => on(IPC_CHANNELS.MEETING_MODE.PROCESSING_PROGRESS, cb), onSessionCompleted: (cb: (e: MeetingSessionDetail) => void): Unsubscribe => diff --git a/apps/desktop/src/renderer/pages/MeetingModePage.tsx b/apps/desktop/src/renderer/pages/MeetingModePage.tsx index c846cf5..f571681 100644 --- a/apps/desktop/src/renderer/pages/MeetingModePage.tsx +++ b/apps/desktop/src/renderer/pages/MeetingModePage.tsx @@ -187,6 +187,11 @@ export function MeetingModePage(): React.ReactElement { }, 50) }) + // 다듬기(학습 어휘·LLM 교열)로 확정 줄이 바뀌면 화면도 그 문장으로 바꾼다. + const unsubSegmentUpdated = window.electronAPI.meetingMode.onSegmentUpdated((update) => { + setSegments((prev) => replaceSegmentText(prev, update.id, update.text)) + }) + const unsubProgress = window.electronAPI.meetingMode.onProcessingProgress((p) => { setProgress(p) }) @@ -213,6 +218,7 @@ export function MeetingModePage(): React.ReactElement { return () => { unsubState() unsubSegment() + unsubSegmentUpdated() unsubProgress() unsubCompleted() unsubError() diff --git a/apps/desktop/tests/main/services/transcript-glossary.test.ts b/apps/desktop/tests/main/services/transcript-glossary.test.ts new file mode 100644 index 0000000..f2ce690 --- /dev/null +++ b/apps/desktop/tests/main/services/transcript-glossary.test.ts @@ -0,0 +1,155 @@ +// tests/main/services/transcript-glossary.test.ts +// 학습한 어휘(사용자 사전 + 개인 문구)가 전사 교열에 실제로 쓰이는지 검증한다. +// 예전에는 자막이 고정 힌트로만 인식되고, 전사된 줄은 용어 사전 없이 다듬어져 +// 사용자가 키보드로 배운 표기가 회의록에 반영되지 않았다. + +import { describe, expect, it } from 'vitest' +import { useRedHarness } from '../../red/harness' +import { + getTranscriptGlossaryService, + TranscriptGlossaryService, +} from '../../../src/main/services/TranscriptGlossaryService' +import { getDictionaryService } from '../../../src/main/services/DictionaryService' +import { getPersonalGraphService } from '../../../src/main/services/PersonalGraphService' +import { MeetingRecordingSession } from '../../../src/main/services/meeting/MeetingRecordingSession' +import type { CaptionSegment } from '@d3ro/core/types' + +useRedHarness() + +/** 같은 문장을 n 번 친 것으로 개인 그래프에 남긴다(count 누적). */ +function learnPhrase(text: string, times: number): void { + for (let i = 0; i < times; i += 1) { + getPersonalGraphService().indexText(text, { source: 'typed', appName: 'notepad.exe' }) + } +} + +describe('학습한 어휘가 전사 교정에 쓰인다', () => { + it('키보드로 배운 어절과 한 글자 다른 전사 어절을 되돌린다', () => { + learnPhrase('회의록 정리해줘', 5) + + const result = getTranscriptGlossaryService().correct('회이록 정리해줘') + + expect(result.text).toBe('회의록 정리해줘') + expect(result.corrections).toEqual([{ from: '회이록', to: '회의록', source: 'learned' }]) + }) + + it('사용자 사전의 발음 표기를 정본 표기로 바꾼다', () => { + getDictionaryService().add({ word: 'D3RO', pronunciation: '디에로' }) + + const result = getTranscriptGlossaryService().correct('디에로 보이스 좋네요') + + expect(result.text).toBe('D3RO 보이스 좋네요') + }) + + it('STT 힌트에 사전 단어와 학습 어절이 함께 들어간다', () => { + getDictionaryService().add({ word: 'Whisper' }) + learnPhrase('녹음 파일 올려줘', 4) + + const hint = getTranscriptGlossaryService().sttHint('다음은 한국어 대화입니다.') + + expect(hint.startsWith('다음은 한국어 대화입니다.')).toBe(true) + expect(hint).toContain('Whisper') + expect(hint).toContain('녹음') + }) + + it('한 번만 쓴 어절은 학습 어휘로 쓰지 않는다', () => { + learnPhrase('회의록 정리해줘', 1) + + const result = getTranscriptGlossaryService().correct('회이록 정리해줘') + + expect(result.text).toBe('회이록 정리해줘') + }) + + it('사전에 단어를 추가하면 캐시를 기다리지 않고 바로 반영된다', () => { + expect(getTranscriptGlossaryService().sttHint('')).not.toContain('Supabase') + + getDictionaryService().add({ word: 'Supabase', pronunciation: '수파베이스' }) + + expect(getTranscriptGlossaryService().sttHint('')).toContain('Supabase') + }) + + it('LLM 교열 프롬프트에 사용자 용어 블록을 넣는다', () => { + getDictionaryService().add({ word: 'D3RO', pronunciation: '디에로' }) + learnPhrase('오늘 회의는 세 시에 시작합니다', 3) + + const section = getTranscriptGlossaryService().promptSection() + + expect(section).toContain('[사용자 용어') + expect(section).toContain('D3RO') + expect(section).toContain('오늘 회의는 세 시에 시작합니다') + }) +}) + +describe('글로서리 캐시', () => { + it('캐시가 살아 있으면 소스를 다시 읽지 않고, 무효화하면 다시 읽는다', () => { + let dictionaryReads = 0 + let now = 1_000 + const service = new TranscriptGlossaryService( + { + listDictionary: () => { + dictionaryReads += 1 + return [{ word: 'D3RO', pronunciation: null }] + }, + listPhrases: () => [{ text: '회의록 정리해줘', count: 5 }], + now: () => now, + }, + 1_000, + ) + + service.get() + service.get() + expect(dictionaryReads).toBe(1) + + now += 1_500 + service.get() + expect(dictionaryReads).toBe(2) + + service.invalidate() + service.get() + expect(dictionaryReads).toBe(3) + }) + + it('소스가 실패해도 빈 어휘로 진행한다', () => { + const service = new TranscriptGlossaryService({ + listDictionary: () => { + throw new Error('db down') + }, + listPhrases: () => [{ text: '회의록', count: 5 }], + }) + + expect(service.get().promptHint).toBe('') + expect(service.correct('회이록').text).toBe('회이록') + }) +}) + +describe('회의 세션이 다듬어진 줄을 받는다', () => { + it('자막이 알린 수정 문장이 회의 세그먼트에 반영된다', () => { + const segmentListeners = new Set<(segment: CaptionSegment) => void>() + const updateListeners = new Set<(update: { id: string; text: string }) => void>() + const updates: Array<{ id: string; text: string }> = [] + const session = new MeetingRecordingSession('session-1', 0, { + caption: { + onSegment: (listener) => { + segmentListeners.add(listener) + return () => segmentListeners.delete(listener) + }, + onSegmentUpdated: (listener) => { + updateListeners.add(listener) + return () => updateListeners.delete(listener) + }, + stop: async () => null, + }, + audio: { onChunk: () => () => undefined }, + onSegmentUpdated: (update) => updates.push(update), + now: () => 1_000, + }) + session.attachCaption() + const segment: CaptionSegment = { id: 'seg-1', text: '회이록 정리해줘', timestamp: 500, isFinal: true } + + for (const listener of segmentListeners) listener(segment) + for (const listener of updateListeners) listener({ id: 'seg-1', text: '회의록 정리해줘' }) + + expect(session.segments[0].text).toBe('회의록 정리해줘') + expect(updates).toEqual([{ id: 'seg-1', text: '회의록 정리해줘' }]) + }) +}) diff --git a/apps/desktop/tests/red/harness.ts b/apps/desktop/tests/red/harness.ts index 8992264..6b8e800 100644 --- a/apps/desktop/tests/red/harness.ts +++ b/apps/desktop/tests/red/harness.ts @@ -36,6 +36,7 @@ import { LocalSTTService, resetLocalSTTServiceForTests, } from '../../src/main/services/LocalSTTService' +import { resetTranscriptGlossaryServiceForTests } from '../../src/main/services/TranscriptGlossaryService' import { D3ROError, ErrorCode, type IPCResult } from '@d3ro/core/errors' import type { NewHistory } from '../../src/main/db/schema' @@ -102,6 +103,7 @@ export function resetAllSingletons(): void { resetMeetingSummaryServiceForTests() resetLocalLLMServiceForTests() resetLocalSTTServiceForTests() + resetTranscriptGlossaryServiceForTests() } export function useRedHarness(): void { diff --git a/docs/map/04-desktop-app.md b/docs/map/04-desktop-app.md index cecdad4..fdd7a64 100644 --- a/docs/map/04-desktop-app.md +++ b/docs/map/04-desktop-app.md @@ -14,7 +14,7 @@ | Preload | `src/preload/` | `index.ts` exposes `window.electronAPI`; `popup.ts` exposes `window.popupAPI` | | Renderer | `src/renderer/` | React app: `AppLayout` + 7 pages + modals + 5 vanilla popups | -**Main entry** `src/main/index.ts`: sets app name/AppUserModelId, disables GPU acceleration, EPIPE/uncaught handlers, registers `d3ro-voice://` deep-link protocol (Supabase OAuth implicit + PKCE), single-instance lock, then `bootstrap()` + `setupLifecycle()`. +**Main entry** `src/main/index.ts`: sets app name/AppUserModelId, disables GPU acceleration, EPIPE/uncaught handlers, registers `d3ro-voice://` deep-link protocol (Supabase OAuth implicit + PKCE), single-instance lock, then `bootstrap()` + `setupLifecycle()`. The explicit manual-QA argument `--preview-update-dialogs` is isolated before protocol registration/bootstrap: it bypasses the single-instance lock, invokes the real update-dialog prompter for four consent/restart variants, touches no feed/download/install/settings state, then quits. This path is unit-tested, but its packaged native dialogs still require an external-terminal visual run. **Bootstrap** `src/main/bootstrap.ts`: ordered `BootstrapStep[]` — logger, config, **database (critical)**, license, create-windows (critical), tray, **ipc-handlers (critical)**, custom-instructions, voice-commands, sound-effects, auto-launch, popup-preload, key-bindings, voice-mode, stt-warmup, llm-polling, meeting-summary-wiring, meeting-mode, cloud-sync, auto-update. Wires VoiceMode events to sound + history persistence, and subscribes to `KeyBindingService` `triggered` for the `history-popup` / `command-popup` actions (`bootstrap.ts:159`) — those two were hardcoded accelerators before and are now rebindable like everything else. @@ -66,7 +66,8 @@ Singleton + `EventEmitter` pattern (`getXService()` accessors). ### Phase 10+ features | Service | Purpose | |---|---| -| `CaptionService` | Live captions from system/loopback audio; caption overlay (events segment, state-changed, session-saved, error) | +| `CaptionService` | Live captions from system/loopback audio; caption overlay (events segment, segment-updated, state-changed, session-saved, error). Since 2026-11-05 every recognition call carries the learned-vocabulary STT hint, each final line passes the deterministic glossary correction, and the LLM refine prompt receives the user-term/style block | +| `TranscriptGlossaryService` | Learned-vocabulary gateway for transcription (`@d3ro/core/transcript-correction`): merges user dictionary words + pronunciations and personal-graph phrases into a 15 s cached glossary, and exposes the STT `initial_prompt` hint, deterministic word correction (dictionary variants + 1-jamo learned-term match that never touches words the user actually wrote), and the LLM 교열 reference block. Sources are injectable; DB failures fall back to an empty glossary so transcription never blocks | | `FileTranscriptionService` | Audio/video file → ffmpeg → 30s chunks → STT merge (events progress, complete, error, state-changed). Shared media-format SSOT is `file-transcription/media-formats.ts`; meeting import can skip duplicate history persistence and retain the normalized WAV | | `MeetingSummaryService` | Post-caption LLM summary | | `DictationTemplateService` | Field-by-field voice form filling | @@ -77,7 +78,7 @@ Singleton + `EventEmitter` pattern (`getXService()` accessors). ### Phase 12–15 | Service | Purpose | |---|---| -| `MeetingModeService` | Meeting recording and existing-media import: live/file transcript, normalized meeting audio, timestamp memos, doc generation/export, diarization. `meeting/imported-recording.ts` maps file-transcription segments to the canonical meeting transcript. Account revision checks before/after WAV copy and after transcription reject even A→B→A changes; unsuccessful imports remove only their own generated audio | +| `MeetingModeService` | Meeting recording and existing-media import: live/file transcript, normalized meeting audio, timestamp memos, doc generation/export, diarization. `meeting/imported-recording.ts` maps file-transcription segments to the canonical meeting transcript. Account revision checks before/after WAV copy and after transcription reject even A→B→A changes; unsuccessful imports remove only their own generated audio. Since 2026-11-05 refined caption lines reach the meeting transcript (`meetingMode:segmentUpdated`) instead of the raw text, and auto-polish receives the learned-vocabulary block | | `MeetingDocTemplateService` | Meeting-doc templates (built-ins + CRUD) | ### Input intelligence (2026-09-21; Local Flow Intelligence extension 2026-09-22) @@ -103,7 +104,7 @@ The existing `input-telemetry-handlers` and `suggestion-handlers` IPC extensions | `CloudSyncService` | Supabase auth + lifecycle: per-user DB switching, local-mode import on first sign-in, Realtime (`ws` transport) + 5-min heartbeat, device check-in, debounced flush/pull triggers. The sync itself lives in `services/sync/` | | `services/sync/` | `SyncEngine` (backfill once per user DB → push outbox → pull by server-clock keyset cursor → tombstones → memo-tag reconcile), `sync-outbox` (`sync_outbox`/`sync_state` tables), `sync-adapters` (history, dictionary, meetings, meeting memos/documents, custom commands, templates), `memo-tag-sync`, `supabase-sync-remote`, `device-registration`, `realtime-transport`, `settings-sync` (mobile `user_settings` ↔ language/theme/defaultLLMAction/activeInstructionId), `audio-sync` (recording upload to the `audio` bucket, remote cleanup on delete), knowledge adapter (source-text chunks), `transcript-sync` (meeting segments from the desktop transcript), `builtin-instruction-sync` (preset prompt edits ↔ server preset rows). Services record changes with `getCloudSyncService().pushOne/pushDelete(entity, id)`; pulled rows are applied without re-queuing | | `CloudSTTService` | Thin cloud STT wrapper over `D3ROCloudDriver` | -| `UpdateService` | electron-updater (canonical Forgejo feed, channels, mandatory/full-vs-delta policy, staged rollout, restart dialog) | +| `UpdateService` | electron-updater (canonical Forgejo feed, channels, mandatory/full-vs-delta policy, staged rollout). Native consent/restart dialogs resolve `update.dialog.*` through a fresh `getPopupTranslator()` at each prompt, so a runtime locale change is reflected without rebuilding the prompter; unit tests cover required/optional paths and a ko→en switch on the same prompter. `update-dialog-preview.ts` exposes only the explicit `--preview-update-dialogs` manual-QA entry described above. The current-source package was built and its native ABI verified; packaged dialog appearance/interaction remains unverified until that executable is run on the interactive desktop. | | `AutoLaunchService` | OS login-item auto-start | | `LoggerService` | electron-log wrapper + category loggers | | upgrade / billing | No in-app checkout. `license-handlers.ts` `LICENSE.OPEN_BILLING` opens `billingUrl({ tier })` (web Payple); tier returns via `license:tierChanged`. Stripe `payment-handlers.ts`·`CheckoutModal`·`payment:*` IPC removed 2026-09-26 | @@ -209,6 +210,8 @@ Key-binding UI lives in `components/keybinding/` (`Keycap`, `KeyBindingPicker`, Hooks: `useRealtimeConversation` (OpenAI Realtime WebRTC), `useLicenseState`, `useProFeature`, `useKeyBindingMap` (subscribes to `keybinding:changed`; the dashboard renders the live `dictation` binding through `BindingKeycaps`), `useInputInsights` (telemetry + suggestion state + weekly summary + phrases; the Dashboard shows a weekly input card when collection is on). +Test-facing surface (stable, Playwright E2E depends on these): `AppSidebar` `nav-*` buttons expose `data-testid="nav-${route}"` + `aria-current="page"`; `SettingsModal` tabs expose `data-testid="settings-tab-${id}"`; onboarding mode cards expose `onboarding-mode-local|online`; `EmptyStateCard` exposes `empty-state-card`. Add a testid before writing an E2E journey; do not select by MUI classes. + DB schema (`src/main/db/schema.ts`, drizzle SQLite): `history`, `dictionary`, `stats`, `memo_tags`, `daily_usage`, `rag_documents`, `rag_chunks`, `meeting_sessions`, `meeting_memos`, `meeting_documents`, `input_activity` (hour × app counters), `typing_samples`, `personal_phrases`, `suggestions`. --- diff --git a/docs/map/10-feature-catalog.md b/docs/map/10-feature-catalog.md index 1ec20bb..ca2267e 100644 --- a/docs/map/10-feature-catalog.md +++ b/docs/map/10-feature-catalog.md @@ -89,6 +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, 1-jamo learned-term correction with a unique-best rule that never touches words the user actually wrote, 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). Tests: core `transcript-correction.test.ts` (16), desktop `transcript-glossary.test.ts` (9); real-app meeting verification still open (`GAP-MTG-04`). | --- @@ -114,12 +115,12 @@ Status quick-reference: `[x]` done+verified · `[~]` partial/unverified · `[ ]` | ACC-04 | Password reset / recovery deep link | [ ] | [ ] | [x] | [x] | Mobile ForgotPassword/UpdatePassword | | ACC-05 | Account profile / identity management | [~] | [~] | [x] | [x] | Desktop `LicenseTab`; mobile `AccountScreen` | | ACC-06 | Logout + local sensitive purge | [x] | [x] | [x] | [x] | Mobile central purge GREEN | -| ACC-07 | Account deletion (server cascade + local purge) | [ ] | [ ] | [~] | [x] | `account-delete` Edge; mobile device E2E pending | +| ACC-07 | Account deletion (server cascade + local purge) | [ ] | [ ] | [~] | [x] | `account-delete` Edge; mobile device E2E pending. **2026-11-04 backend retention proof:** isolated local Supabase verified `audio-purge` authorization and both direct and pg_cron/Vault dispatch; the queued DB row, deleted `audio_files` row, and private Storage object were removed together. Production deployment/schedule remains `GAP-OPS-04`. | | ACC-08 | Cloud sync (per-user data) | [~] | [x] | [x] | [x] | Desktop `CloudSyncService` + `services/sync/`. The earlier `[x]` hid shipped defects fixed on 2026-09-27 (GAP-SYNC-01/02): first pull after sign-in fetched nothing, only the first meeting's memos/documents were pushed, deletions never propagated, team meetings were pulled into the personal DB and their `team_id` cleared on re-push, Realtime never connected. Anonymous local-mode data is now imported into the first account that signs in (`db/index.ts importLocalModeData`). Production deploy pending (GAP-SYNC-05) | -| ACC-09 | Device registration + revocation | [~] | [ ] | [x] | [x] | Mobile `DevicesScreen`. **Desktop registers itself since 2026-09-27** (`services/sync/device-registration.ts`, platform `windows`/`macos`, installation id in `AppConfig.deviceInstallationId`); revoking it from the phone signs the desktop out (Realtime on `devices` + 5-min heartbeat), signing out on desktop unregisters it. Mobile parser accepted only `android`/`ios`, so one desktop row would have failed the whole Devices screen — fixed (`device-service.ts`, `__tests__/devices.test.ts`) and the card now names the platform. Local-stack evidence in the integration test; production pending GAP-SYNC-05 | +| ACC-09 | Device registration + revocation | [~] | [~] | [x] | [x] | Mobile `DevicesScreen`. **Desktop registers itself since 2026-09-27** (`services/sync/device-registration.ts`, platform `windows`/`macos`, installation id in `AppConfig.deviceInstallationId`); revoking it from the phone signs the desktop out (Realtime on `devices` + 5-min heartbeat), signing out on desktop unregisters it. Web creates/checks in a stable `platform='web'` device only when the user opts into browser notifications, refuses to resurrect a revoked row, and revalidates an existing local Push subscription through the register RPC before showing it connected (`web-device.ts`, `web-push-session.ts`, `web-push.spec.ts`). An isolated throwaway local-browser run produced exactly one active web device and one device-bound token; no web device-management UI or production proof. Mobile parser accepts all five platforms and names them on the card. Local-stack desktop evidence exists; production pending GAP-SYNC-05 | | ACC-10 | Offline queue + retry | [~] | [ ] | [x] | [x] | Mobile durable queue | | ACC-11 | Data export/import (portability) | [~] | [ ] | [x] | [x] | Mobile canonical JSON E2E GREEN; desktop has export files. **2026-09-27 backend fix:** `export_account_portability` serialised whole rows, so columns added after the v1 archive (meeting creation metadata, meeting-document template/idempotency) made any account with meetings fail the exact-key check in both the server restore and the mobile parser; the export now projects onto v1 keys (migration `20260927000034`, integration test asserts memo/meeting keys) | -| ACC-12 | Notification / push | [ ] | [x] | [~] | [x] | Backend transports for FCM + Web Push (VAPID) + APNs (.p8) + outbox cron drain implemented. **2026-10-30 (`GAP-PUSH-03` `[x]`):** Web service worker (`apps/web/public/sw.js`) + `registerWebPushSubscription` (`provider: 'webpush'`) and mobile platform-aware registration (`iOS` → `provider: 'apns'`, `Android` → `provider: 'fcm'`) implemented and unit-tested (`__tests__/notifications.test.ts`). Android live delivery awaits Firebase project (`EXT-FIREBASE-01`). | +| ACC-12 | Notification / push | [ ] | [~] | [~] | [x] | Backend transports for FCM + Web Push (VAPID) + APNs (.p8) + outbox cron drain implemented. **2026-11-04 (`GAP-PUSH-03` `[~]`):** Web production sidebar calls the explicit user-gesture permission → stable web device → `subscribeWebPush` → `register_push_registration` path. Opt-out records disabled intent before bounded parallel server/local cleanup; a stale local subscription is re-registered through the server RPC before it may appear connected, and logout never waits on cleanup (`web-push.spec.ts` 17 contract tests). The standalone image copies `public/sw.js`, and missing build-time `NEXT_PUBLIC_VAPID_PUBLIC_KEY` fails closed. Isolated local evidence reached active device + token + pending outbox + completed drain + `push_deliveries.status='delivered'`; this is provider acceptance, not browser receipt. The final production-standalone browser attempt timed out at login navigation before the dashboard, so production permission/subscription/render/receipt and deployed cron/provider configuration remain open (`EXT-FIREBASE-01` for Android). | --- @@ -143,7 +144,7 @@ Status quick-reference: `[x]` done+verified · `[~]` partial/unverified · `[ ]` | ID | Feature | D | W | M | B | Anchors / notes | |---|---|---|---|---|---|---| | MON-01 | Tier gating (Free/Pro/Pro+/Team/Enterprise) | [x] | [x] | [x] | [x] | `LicenseService`, entitlement provider | -| MON-02 | Usage quotas (daily_usage) | [x] | [x] | [x] | [x] | | +| MON-02 | Usage quotas (daily_usage) | [x] | [x] | [x] | [x] | `packages/core/src/plan-catalog.ts` is the quota SSOT, including `knowledge_embedding`; Deno consumers use the generated `core-contract.generated.ts` copy guarded by `npm run contract:check`. | | MON-03 | Desktop offline license (Ed25519) | [x] | [-] | [-] | [x] | `crypto-license` + admin issuer | | MON-04 | ~~Web checkout (Stripe)~~ — **삭제됨 2026-09-26** | [-] | [-] | [-] | [-] | 사용자 결정: 결제는 웹 Payple(KRW) + 모바일 Google Play만. `stripe-checkout`/`stripe-portal`/`stripe-webhook` 함수, 웹 `checkout-button`/`portal-button`, 데스크톱 `CheckoutModal`·`payment-handlers`·`payment:*` IPC 삭제. 과거 `provider='stripe'` 구독 행은 읽기 전용 표시만(마이그레이션 불변). 운영 정리는 GAP-BILL-03 | | MON-05 | Web checkout (Payple) | [-] | [x] | [~] | [~] | Payple checkout/manage/renew/webhook; webhook signature pending | @@ -151,7 +152,7 @@ Status quick-reference: `[x]` done+verified · `[~]` partial/unverified · `[ ]` | MON-07 | Mobile IAP purchase + restore | [-] | [-] | [~] | [x] | `iap-verify` + `billing-context`; live store E2E blocked | | MON-08 | Billing catalog / pricing display | [x] | [x] | [x] | [x] | Server catalog SSOT; hardcoded prices removed | | MON-09 | Free-tier banner ads | [~] | [-] | [x] | [x] | Desktop adapters fail-closed; mobile AdMob test GREEN, prod serving blocked | -| MON-10 | Rewarded ads → quota credits | [x] | [-] | [x] | [x] | **2026-10-30 (`GAP-ADS-02` `[x]`):** Desktop `AdMediationEngine.claimReward` verifies adapter `reportRewardCompletion`, impression, duration, cooldown, and nonce uniqueness before calling `LicenseService.grantRewardQuota` (`AdMediationEngine.spec.ts` 23/23 PASS); mobile SSV GREEN | +| MON-10 | Rewarded ads → quota credits | [x] | [-] | [x] | [x] | **2026-10-30 (`GAP-ADS-02` `[x]`):** Desktop `AdMediationEngine.claimReward` verifies adapter `reportRewardCompletion`, impression, duration, cooldown, and nonce uniqueness before calling `LicenseService.grantRewardQuota` (`AdMediationEngine.test.ts` 23/23 PASS); mobile SSV GREEN | | MON-11 | Ad mediation engine + settlement | [~] | [-] | [~] | [x] | Engine + settlement built. `DirectHouseSponsorAdapter` is now a **real configurable REST adapter** (bid/impression/click/reward via `endpointUrl`, fail-closed when unconfigured, unit-tested). Other 9 networks remain `UnavailableAdAdapter` stubs pending official SDKs. | | MON-12 | Subscription management (portal/store) | [-] | [x] | [x] | [x] | Payple manage / Play manage (Stripe portal 삭제 2026-09-26) | @@ -197,19 +198,19 @@ end-to-end behaviour has **not been verified by typing in a real app** (`11` GAP |---|---|---|---|---|---|---| | SHELL-01 | Settings / preferences | [x] | [~] | [x] | [x] | **2026-09-28 개편:** 데스크톱 설정은 모달이 아니라 메인 창 전체 화면 라우트(`settings`) — 왼쪽 세로 탭 8개 + 본문 `components/settings/SettingsRows`(구획 h3 + 라벨·설명/컨트롤 행). 일반 탭에 키 바인딩 편집기(CAP-16). 이전 기록: Desktop tabbed modal; the General tab hosts the whole key-binding editor (CAP-16: global on/off switch + one `KeyBindingField` per action, grouped voice/window — `SettingsModal.tsx:239`), which is also the first settings entry point the `command` action ever had; web theme/i18n; mobile `SettingsScreen` | | SHELL-02 | Theme system (6 themes) | [x] | [x] | [x] | [-] | `theme.ts` SSOT | -| SHELL-03 | i18n (12 locales) | [x] | [x] | [x] | [-] | `@d3ro/i18n`; **2026-10-30 (`GAP-I18N-01` `[x]`, `GAP-UX-07` `[x]`):** all 12 locales (`ko`, `en`, `ja`, `zh`, `zh-TW`, `es`, `fr`, `de`, `pt`, `ru`, `vi`, `th`) synchronized to 2,716 keys via `scripts/ci/sync-i18n-locales.mjs` and guarded by `i18n-locale-parity.test.ts` (15/15 PASS). | +| SHELL-03 | i18n (12 locales) | [x] | [~] | [~] | [-] | `@d3ro/i18n`; all 12 catalogs (`ko`, `en`, `ja`, `zh`, `zh-TW`, `es`, `fr`, `de`, `pt`, `ru`, `vi`, `th`) are synchronized to 2,742 keys and guarded by `i18n-locale-parity.test.ts` (15/15 PASS), including the updater dialog keys added on 2026-11-04. Catalog parity is not surface exposure: web has no locale selector and mobile currently exposes ko/en only (`GAP-I18N-03`, SSOT `O-012`), so those surfaces remain `[~]`. | | SHELL-04 | Onboarding / first-run | [x] | [ ] | [~] | [-] | Desktop model bootstrap (`onboarding.llmModelSize` aligned to 4.0GB `gemma4:e4b`, `GAP-UX-07` `[x]`); mobile audience/theme/locale. **2026-11-01:** 신규 사용자 목적지를 persistence 전에 준비하도록 수정하고 Fold6에서 `.2` fresh auth/signup/invite/small-screen 4/4 PASS (`fold6-20261101-fix1`); latest `.3` first-run auth and retry fail at onboarding visibility (`fold6-20261101-mtg13`). Exact `.3` APK now passes isolated API 34 emulator fresh auth 37 s / signup 50 s with restart persistence; personal Fold6 data was preserved and its separate failures remain open. | -| SHELL-05 | Accessibility / reduced motion | [~] | [~] | [~] | [-] | Desktop reduced-motion honored; mobile a11y rows pending | +| SHELL-05 | Accessibility / reduced motion | [~] | [~] | [~] | [-] | Desktop reduced-motion honored. Mobile source labels/roles and 48dp tests plus 2026-11-04 inspected-route UIAutomator/font-scale/rotation evidence are partial GREEN; the AdMob SDK descendant exposed one unlabeled clickable WebView. Manual TalkBack/focus order, reduced-motion/app-wide coverage, and iOS remain ([evidence](../evidence/2026-11-04-mobile-runtime-a11y.md)). | | SHELL-06 | System tray / background | [x] | [-] | [-] | [-] | Desktop tray | | SHELL-07 | Auto-launch on login | [x] | [-] | [-] | [-] | Desktop only | -| SHELL-08 | Auto-update | [x] | [-] | [!] | [-] | Desktop electron-updater; Forgejo canonical feed; channels + mandatory/major-vs-delta policy (`release/update-policy.json`); mobile store updates **2026-10-24 UI:** updates are now visible in the app, not only through native dialogs. Settings → About opens with an Updates section (`components/settings/UpdateSection.tsx`): status, progress bar, last check, and Check / Download / Restart-to-install buttons. A title-bar chip (`components/shell/UpdateChip.tsx`) appears only while an update is available, downloading or ready, and opens that tab. IPC `appUpdate:getStatus|check|download|install` plus the `appUpdate:statusChanged` event; state comes from `UpdateService.getStatus()`. A skipped version still shows, and downloading it manually clears the skip. Dev and portable builds show "disabled". Not yet checked by eye in a packaged build. | +| SHELL-08 | Auto-update | [x] | [-] | [!] | [-] | Desktop electron-updater; Forgejo canonical feed; channels + mandatory/major-vs-delta policy (`release/update-policy.json`); mobile store updates **2026-10-24 UI:** updates are now visible in the app, not only through native dialogs. Settings → About opens with an Updates section (`components/settings/UpdateSection.tsx`): status, progress bar, last check, and Check / Download / Restart-to-install buttons. A title-bar chip (`components/shell/UpdateChip.tsx`) appears only while an update is available, downloading or ready, and opens that tab. IPC `appUpdate:getStatus|check|download|install` plus the `appUpdate:statusChanged` event; state comes from `UpdateService.getStatus()`. A skipped version still shows, and downloading it manually clears the skip. Dev and portable builds show "disabled". **2026-11-04:** native consent/restart dialogs resolve `getPopupTranslator()` at each prompt, so a runtime locale change is not cached; ko→en behavior is covered by `update-dialog-i18n.test.ts`. The isolated `--preview-update-dialogs` packaged-QA entry calls the real prompter without updater/feed/install side effects and is covered by entry/prompt tests. The current-source package/ABI passed, but the native dialog appearance and interaction remain an external-desktop gate (`GAP-QA-04`). | | SHELL-09 | Support / diagnostics | [x] | [ ] | [ ] | [x] | Desktop `SupportModal` (`support-handlers.ts` strict-typed, `GAP-REL-15` `[x]`); admin `/support` fail-closed `content_reports` & support console (`GAP-SHELL-01` `[x]`). | | SHELL-10 | Download center / releases | [-] | [x] | [-] | [x] | Web `/download`, admin `/releases`, Forgejo | | SHELL-11 | Landing site / legal pages | [-] | [-] | [-] | [-] | `site/` — the only landing/download/legal/invite/assetlinks surface (Wave 3, 2026-09-26: copies in api-server wwwroot and apps/web removed; 404.html; hero loops a copy of the app recording capsule). Prices/URLs from `packages/core` plan-catalog/web-urls — see `design.md`. **2026-10-28 designpaca audit:** flat header (`Header.tsx` blur removed), WCAG AA contrast verified across all 14 routes (`ko`..`vi`, `privacy`, `terms`, `delete-account`, `accept-invite`), `legal.css` explicit `font-weight: 500/600` (no `>=700` fallback), `accept-invite` polite Korean register (`해요체`) and `--faint`/`--accent` AA contrast. | | SHELL-12 | Notifications (in-app / desktop) | [x] | [ ] | [x] | [x] | Desktop events; mobile push | | SHELL-13 | Desktop/mobile information architecture (2026-09-28) | [x] | [-] | [x] | [-] | 1급 홈·기록·회의 + 2급 도구. Desktop: `renderer/navigation/app-navigation.tsx`, `AppSidebar`, status bar removed. Mobile: visible Home/Records/Meetings/More tabs, hidden Record route, floating three-action Record FAB, More tool/account grouping; full Jest and the canonical 320dp dark/411dp light runtime journeys are GREEN (`11` GAP-UX-04). `DashScreen`/`WorksHubScreen` were removed; WorksHub-only local filter/pinning was intentionally retired while every destination remains in tabs/More and user content is untouched. Decision SSOT: root `design.md`. | | SHELL-14 | Home ("오늘") | [x] | [-] | [x] | [-] | Desktop `pages/HomePage.tsx`: recording key, starts, blockers, summary, recent 6/4, file transcription, bounded usage. Mobile `HomeScreen`: today summary, recent records 5/meetings 3, unified-search and plan entry; canonical 320dp dark and 411dp light runtime journeys GREEN. | -| SHELL-15 | Design system v4 "조용한 계기" | [x] | [x] | [~] | [-] | `packages/ui/src/theme-raw.ts` raw-value SSOT (`--d3-text-inverse` mapped to `accent.ink`); flat surfaces, three text levels with AA contrast, `accent.solid/ink`, `InstrumentPanel`/`SegmentControl` aligned with v4. **2026-10-28 designpaca audit:** `apps/web`, `apps/admin`, `apps/desktop/src/renderer` (main 16 routes/tabs + 6 popups), `site/` (14 routes), and `apps/mobile-rn` audited and fixed (`npm run check:design` 0 violations; Playwright headless Chromium 36/36 routes PASS for contrast, `<11px` floor, `<=600` weight cap, zero blur, single `h1`, labeled controls, and zero horizontal overflow across 320–1440px). `packages/ui-native` mirrors dark/light semantics and exposes 48dp control/numeral/motion tokens; mobile `[~]` remains only because actual TalkBack, font-scale, and rotation proof on physical device is pending. | +| SHELL-15 | Design system v4 "조용한 계기" | [x] | [x] | [~] | [-] | `packages/ui/src/theme-raw.ts` raw-value SSOT (`--d3-text-inverse` mapped to `accent.ink`); flat surfaces, three text levels with AA contrast, `accent.solid/ink`, `InstrumentPanel`/`SegmentControl` aligned with v4. **2026-10-28 designpaca audit:** `apps/web`, `apps/admin`, `apps/desktop/src/renderer` (main 16 routes/tabs + 6 popups), `site/` (14 routes), and `apps/mobile-rn` audited and fixed (`npm run check:design` 0 violations; Playwright headless Chromium 36/36 routes PASS for contrast, `<11px` floor, `<=600` weight cap, zero blur, single `h1`, labeled controls, and zero horizontal overflow across 320–1440px). `packages/ui-native` mirrors dark/light semantics and exposes 48dp control/numeral/motion tokens. **2026-11-04 Android follow-up:** inspected app-owned Home/Login actions were labeled and >=48dp; API 34 Login was reachable at font scale 2.0 in portrait/landscape with scroll. Mobile stays `[~]` because this is automated route-level evidence, while physical TalkBack/focus order, an SDK-owned unlabeled AdMob WebView descendant, app-wide coverage, and iOS remain ([evidence](../evidence/2026-11-04-mobile-runtime-a11y.md)). | --- @@ -217,25 +218,26 @@ end-to-end behaviour has **not been verified by typing in a real app** (`11` GAP | ID | Feature | Status | Anchors | |---|---|---|---| -| INFRA-01 | Monorepo + workspaces + turbo | [x] | `package.json`, `turbo.json` | +| INFRA-01 | Monorepo + npm workspaces | [x] | `package.json`; unused `turbo.json` and `pnpm-workspace.yaml` removed in Wave 4 | | INFRA-14 | Unified entitlement resolver (`@d3ro/core/entitlement`) | [x] | `EntitlementSnapshot` + `resolveEntitlement` map Supabase/desktop-license/.NET sources to one contract; adopted across desktop (`LicenseService`), web (`apps/web/src/lib/entitlement.ts`), and mobile (`apps/mobile-rn/src/lib/entitlement-context.tsx`) (`11` GAP-ID-01/02 `[x]`). | | INFRA-02 | Shared packages | [x] | `packages/*` | | INFRA-03 | Desktop build + signed packaging | [x] | `electron-builder.yml`, GitLab `package-windows/macos` | -| INFRA-04 | Mobile CI (debug/E2E/release) | [~] | `.github/workflows/ci.yml`, `.gitlab-ci.yml`; production AAB external | +| INFRA-04 | Mobile CI (debug/E2E/release) | [~] | `.forgejo/workflows/ci.yml`, `.gitlab-ci.yml`, root `test:mobile` → mobile `test:ci` (`jest --runInBand`); production AAB remains external | | INFRA-05 | .NET API tests | [x] | `apps/api-server.Tests` | -| INFRA-06 | Edge function tests (Deno) | [x] | `server/supabase/functions`, `tests/` | -| INFRA-07 | E2E desktop (playwright) | [x] | `apps/desktop/tests`, `apps/desktop/playwright.config.ts` | -| INFRA-08 | E2E web (playwright) | [x] | `apps/web/e2e` | -| INFRA-09 | E2E mobile (Maestro + instrumentation) | [~] | `.maestro/`, `androidTest`; emulator API 35 gate in CI | +| INFRA-06 | Edge function tests (Deno) | [x] | `server/supabase/functions/**/*.test.ts` (root `tests/` was not an Edge test home and was removed 2026-11-04) | +| INFRA-07 | E2E desktop (playwright) | [x] | `apps/desktop/tests/e2e` (5 protected journeys + shared `support/electron-app.ts` fixture), `apps/desktop/playwright.config.ts`. 2026-11-04: red-team cycle specs and 4 stale feature specs deleted, duplicated launch code consolidated. Policy: `docs/tdd-red/06-repo-application.md`. | +| INFRA-08 | Web tests (vitest + playwright) | [x] | `apps/web/tests` (vitest pure-logic contracts, now part of root `npm test`); `apps/web/e2e` (playwright; `smoke.spec.ts` owns the unauthenticated surface contract — fail-closed redirects + `/download` handoff). Web declares its own `@playwright/test`/`vitest` devDeps instead of using the desktop workspace's hoisted binaries. | +| INFRA-09 | E2E mobile (Maestro + instrumentation) | [~] | `.maestro/`, `androidTest`; emulator API 35 gate in CI. 2026-11-04 current-source dual-ABI E2E APK verifier + state-preserving `adb install -r`/cold launch passed on Fold6 Android 16 and API 34 AVD; physical Notifications status/privacy/recent flow passed 1/1 without a permission command, and automated UIA/font-scale/rotation checks are recorded. Manual TalkBack, permission transition/real FCM receipt, full journey, iOS, and production AAB remain ([evidence](../evidence/2026-11-04-mobile-runtime-a11y.md)). | | INFRA-10 | Secret scanning / release boundaries | [x] | `scripts/ci/check-no-hardcoded-secrets.mjs`, `verify-mobile-release-*.mjs` | | INFRA-11 | Docker + NAS deploy | [x] | `docker-compose.nas.yml`, `scripts/deploy-nas.*` | | INFRA-12 | Cloudflare edge + tunnel | [x] | `server/cloudflare-worker`, Cloudflare Tunnel `kd-nas` | -| INFRA-13 | Site deploy (Cloudflare Pages + GitHub Pages) | [x] | `.forgejo/workflows/deploy-site.yml`, `.github/workflows/deploy-site.yml` | +| INFRA-13 | Site deploy (Cloudflare Pages) | [x] | `.forgejo/workflows/deploy-site.yml`; the unused GitHub Pages workflow was removed in Wave 3 | +| INFRA-17 | Test hygiene gate (TDD policy) | [x] | `scripts/ci/check-test-hygiene.mjs` (`npm run test:hygiene` + `:test`), wired into `.forgejo/workflows/ci.yml` quality and `.gitlab-ci.yml` validate. Rules: `.only`, reason-less `.skip()`, trivial assertions, `isVisible()`-gated assertions, machine paths, `waitForTimeout`, `.e2e.test.ts`, `e2e/` 밖의 `*.spec.ts`, assertion-free files. Applied policy + deletion/consolidation log: `docs/tdd-red/06-repo-application.md`. | | INFRA-15 | Update & release system | [x] | Canonical Forgejo feed + channels/policy (`release/update-policy.json`, `src/main/update-policy.ts`), canonical publisher `scripts/ci/publish-forgejo-release.mjs`, legacy GitLab mirror; `npm run release:metadata:test`. v1.1.0 was published to Forgejo on 2026-09-15; product version moved to `1.2.0` as a forward-fix with CI-only publication, a same-version re-release guard, and download centers that link the feed instead of repository paths. `1.3.0` (2026-09-18) carries the local-STT fixes; Windows publication still needs the CI signing secrets (`11` GAP-REL-02). | | INFRA-16 | Desktop STT engine packaging | [x] | `apps/desktop/scripts/setup-sidecar.mjs` + `build-sidecar.mjs`, `electron-builder.yml` `extraResources` (`sidecar-dist/sidecar` → `resources/sidecar`, `resources/ffmpeg`), and `scripts/ci/verify-sidecar-bundle.mjs` run in `package-windows`/`package-macos` before electron-builder. Verified on the real bundle: `sidecar.exe` + `_internal` including `faster_whisper/assets/silero_vad_v6.onnx`, plus a packaged-engine transcription round-trip on GPU. | | INFRA-17 | 서명 없는 배포 채널 (portable + Scoop) | [x] | `scripts/ci/build-portable.mjs` (95MiB 7z 분할 볼륨 + Scoop 매니페스트), `scripts/ci/publish-portable-release.mjs`, `scripts/local/install-d3ro-voice.ps1`, `bucket/` 버킷, `.forgejo/workflows/portable.yml`; 7z 분할 볼륨(Scoop, 162MiB) + zip 분할 부품(수동 설치, 243MiB, 7-Zip 불필요); updater feed와 분리. 2026-09-18 `portable-1.3.1` 게시 + 실제 설치 검증. | | INFRA-18 | 로컬 런타임 온디맨드 설치 | [x] | `RuntimeProvisioner`(부품 다운로드 + SHA-256 검증 + tar 해제, `%APPDATA%/d3ro-voice/runtime`), `POST runtime:ensure` / `runtime:progress` IPC, 설정 > STT 상태/내려받기 UI. 설치본에서 엔진/ffmpeg를 분리해 189MB → 90.6MiB, 업데이트 피드 게시 복구. 검증은 전부 디스크에 기록된 파일 기준이며(부품 크기·해시 → 결합본 크기·해시), 부품 다운로드는 최대 3회 재시도한다. 2026-09-18 실제 feed 통합 검증(엔진 94.4MiB/18초, ffmpeg 21.7MiB/5초). | -| INFRA-19 | 네이티브 ABI + updater 설정 게이트 | [x] | `scripts/ci/verify-native-abi.mjs`(패키징된 `better_sqlite3.node`가 Electron ABI인지 호스트 Node 로드 거부로 판별) + `scripts/ci/fix-native-abi.mjs`(로컬 잠금 우회용 주입). GitLab/Forgejo/GitHub 패키징 단계에 검증 삽입. 2026-09-18: Node ABI 모듈로 앱이 시작 즉시 죽은 사고 + 누락으로 자동 업데이트가 죽은 사고를 함께 방지(). | +| INFRA-19 | 네이티브 ABI + updater 설정 게이트 | [x] | `scripts/ci/verify-native-abi.mjs`는 패키징된 `better_sqlite3.node`를 host Node가 로드하면 잘못된 ABI로 실패시키고, 대상별 실제 `uiohook-napi/prebuilds/-/uiohook-napi.node`도 필수로 검사한다. `--self-test`가 N-API prebuild 누락/존재 fixture를 고정하며 상대·절대 `--dir` 모두 같은 package를 검증한다. `fix-native-abi.mjs`는 better-sqlite3 주입만 담당한다. GitLab desktop jobs와 Forgejo release/portable scripts가 검증기를 실행하고, installer/portable build는 `resources/app-update.yml`도 필수로 확인한다. 2026-09-18의 잘못된 Node ABI 즉시 종료와 updater 설정 누락 사고를 함께 방지한다. | | INFRA-20 | Desktop typing race and load verification | [~] | `typing-race-proof.mjs` deterministic baseline 2/17 vs current 17/17. 2026-11-02: installed 1.16.0 native Korean IME passed 7/7 under bounded 100% CPU and 7/7 with direct `gemma4:e4b` cold-load overlap. The Latin-layout control reproduced next-key/backspace interleaving; source now defers bursts for 140 ms and batches the current trailing region after a pause, with desktop 2,773 tests/build GREEN. The fix is published in Windows v1.16.1; installed-app Latin GUI, physical keyboard and Chromium/terminal runs remain. See [evidence](../evidence/2026-11-02-verification.md), GAP-INPUT-11. | --- diff --git a/docs/map/11-gap-backlog.md b/docs/map/11-gap-backlog.md index 6d37eba..430eda8 100644 --- a/docs/map/11-gap-backlog.md +++ b/docs/map/11-gap-backlog.md @@ -21,29 +21,33 @@ Legend: `[ ]` open · `[~]` in progress · `[!]` blocked externally · `[x]` res | ID | Area | Gap | Evidence | Suggested next step | |---|---|---|---|---| -| GAP-QA-01 | Quality | Extreme Red Team: headful end-to-end bug hunting across real desktop Electron, Web Next.js, and CI pipelines. | `red_team_log.md`, `tests/e2e/red_team_cycle*.spec.ts`, `apps/web/e2e/red_team_cycle4_web.spec.ts` | `[x]` 2026-09-15: 18 scenarios executed, 14 defects caught and 100% resolved (infinite chunking loop DEF-008, IPC signature mismatch DEF-004, markdown editor typing rollback DEF-006, Web RSC Link serialization DEF-012, secret scanner lookahead DEF-013, etc.). All 18 scenarios GREEN with zero regressions. | -| GAP-REL-01 | Release | Official release publication to Forgejo and active public download center deployment. | `scripts/ci/publish-forgejo-release.mjs`, `apps/web/src/app/download/page.tsx`, `site/src/sections/Download.tsx`, `apps/web/e2e/red_team_cycle4_web.spec.ts` | `[~]` 2026-09-15: v1.1.0 release assets (`D3RO-Voice-Setup-1.1.0-x64.exe`, `.blockmap`, `latest.yml`, `update-policy.json`) published to canonical Forgejo registry and release hub. 2026-09-16: the published 1.1.0 installer carries no Authenticode signature, so it does not satisfy the release policy; product version moved to `1.2.0` and publication must come from CI with the signing gate GREEN. Download centers in `apps/web` (`/download`) and `site` (`#download`) link the canonical Forgejo feed. 2026-09-19: `1.3.7` (overlay fix) is published to the canonical updater feed (`latest.yml` = 1.3.7, 90.6MiB); the CI signing gate that blocks tag-driven publication is still unresolved, so this went out through the local updater path (GAP-REL-06). 2026-09-23: `1.5.0` published the same way (updater feed `latest.yml` = 1.5.0, installer 91.2MiB / 95,612,108 bytes, sha512 matches the local build and the feed serves it anonymously); the runtime and portable channels were republished first. | +| GAP-QA-01 | Quality | Extreme Red Team: headful end-to-end bug hunting across real desktop Electron, Web Next.js, and CI pipelines. | `red_team_log.md`, `apps/desktop/tests/e2e`, `apps/web/e2e/smoke.spec.ts` | `[x]` 2026-09-15: 18 scenarios executed, 14 defects caught and 100% resolved (infinite chunking loop DEF-008, IPC signature mismatch DEF-004, markdown editor typing rollback DEF-006, Web RSC Link serialization DEF-012, secret scanner lookahead DEF-013, etc.). All 18 scenarios GREEN with zero regressions. **2026-11-04 rework:** the red-team cycle specs were one-off bug hunts (machine screenshot paths, fixed sleeps, conditional assertions) and were replaced by 5 behavior-scoped protected journeys + a shared Electron fixture; 4 stale/duplicate feature specs, the orphaned root `tests/e2e`, and 7 ad-hoc Playwright runner scripts were deleted. Duplicates merged. New `npm run test:hygiene` gate blocks the patterns that made them meaningless. Log: `docs/tdd-red/06-repo-application.md`. | +| GAP-REL-01 | Release | Official release publication to Forgejo and active public download center deployment. | `scripts/ci/publish-forgejo-release.mjs`, `apps/web/src/app/download/page.tsx`, `site/src/sections/Download.tsx`, `apps/web/e2e/smoke.spec.ts` | `[~]` 2026-09-15: v1.1.0 release assets (`D3RO-Voice-Setup-1.1.0-x64.exe`, `.blockmap`, `latest.yml`, `update-policy.json`) published to canonical Forgejo registry and release hub. 2026-09-16: the published 1.1.0 installer carries no Authenticode signature, so it does not satisfy the release policy; product version moved to `1.2.0` and publication must come from CI with the signing gate GREEN. Download centers in `apps/web` (`/download`) and `site` (`#download`) link the canonical Forgejo feed. 2026-09-19: `1.3.7` (overlay fix) is published to the canonical updater feed (`latest.yml` = 1.3.7, 90.6MiB); the CI signing gate that blocks tag-driven publication is still unresolved, so this went out through the local updater path (GAP-REL-06). 2026-09-23: `1.5.0` published the same way (updater feed `latest.yml` = 1.5.0, installer 91.2MiB / 95,612,108 bytes, sha512 matches the local build and the feed serves it anonymously); the runtime and portable channels were republished first. | | GAP-REL-08 | Release | 다운로드 센터가 **존재하지 않는 설치 파일**을 가리켰다. `apps/web/src/lib/desktop-release.ts`와 `site/src/release.ts`의 `DESKTOP_VERSION`이 `1.2.0`에 멈춰 있어 설치 URL이 `D3RO-Voice-Setup-1.2.0-x64.exe`였고, 그 경로는 피드에서 404다(실측: 1.2.0=404, 1.3.7=206). `version:sync`가 이 두 표면을 덮지 않아 계속 어긋났다. | `scripts/ci/sync-version.mjs`, `apps/web/src/lib/desktop-release.ts`, `site/src/release.ts` | `[x]` 2026-09-19: 두 다운로드 계약 파일을 `sync-version.mjs` 대상에 추가해 버전·릴리스일이 SSOT에서 자동 반영되도록 하고, 현재 값(1.3.7 / 2026-09-19)으로 정정했다. `version:check`·typecheck·site 빌드 GREEN. | | GAP-REL-09 | Release | 랜딩 사이트가 **재배포되지 않는다**. `deploy` 워크플로가 main push마다 실패한다. 실측 원인(run#66 로그): `site/src/sections/Hero.tsx`가 타이머 ref를 `NodeJS.Timeout`으로 타이핑해 `@types/node` 네임스페이스가 필요했고, 배포 잡은 `npm ci --prefix site`만 하므로 조상 `node_modules`의 hoisted 타입이 없어 `tsc -b`가 `TS2503: Cannot find namespace 'NodeJS'`로 실패한다. 그래서 `https://d3ro.chanpaca.net/release-identity.json`이 404다(공개 버전 검증 불가). | `.forgejo/workflows/deploy-site.yml`, `site/src/sections/Hero.tsx` | `[x]` 2026-09-19: ref를 `ReturnType`으로 바꿔 hoisted 타입 의존을 제거했다(격리 `--typeRoots`로 CI 조건 재현 → 수정 전 TS2503, 수정 후 clean). 같은 수정을 push하자 `deploy` run#67이 사이트 빌드를 통과해 `dist/`를 만들었고, 실패는 다음 단계(Cloudflare)로 이동했다. | | GAP-REL-09b | Release | `d3ro.chanpaca.net`이 404였던 직접 원인: 이 Cloudflare 계정에 Pages 프로젝트 `d3ro`/`d3ro-voice`가 **존재하지 않아** 커스텀 도메인 바인딩이 없었다(빈 본문 404, `cf-ray`만 반환). Pages 커스텀 도메인은 존 DNS CNAME(`d3ro → d3ro.pages.dev`)을 요구하는데 기존 `d3ro` 레코드가 남아 있어 `CNAME record not set`으로 pending에 머물렀고, 로컬 wrangler 자격증명에는 DNS 스코프가 없다(403 Authentication error). `deploy-site.yml`은 `CF_API_TOKEN` 시크릿이 없어 마지막 게시 단계에서도 `exit 1`이다. | `server/cloudflare-site-bridge/`, `.forgejo/workflows/deploy-site.yml`, `docs/map/02-infrastructure.md` | `[x]` 2026-09-19: Pages 프로젝트 `d3ro` 생성 + `site/dist` production 배포(`d3ro.pages.dev` 200, `release-identity.json` = commit `2407f5a` / 1.3.7) + 커스텀 도메인 연결. DNS 없이 도메인을 살리기 위해 Workers 라우트 브리지(`server/cloudflare-site-bridge`, `d3ro.chanpaca.net/*` → Pages 프록시, `npx wrangler deploy`)를 배포 → 라이브 확인: `/`·`/privacy/`·`/terms/`·`/delete-account/` 200, 라이브 번들이 설치 파일명을 `1.3.7`로 계산, `/download.html` → `/#download`. 남은 정리 2건: (1) 대시보드에 CNAME을 추가한 뒤 브리지 워커 삭제, (2) CI 자동 게시를 위해 `CF_API_TOKEN`(Pages/Workers Edit) + `CF_ACCOUNT_ID`=`8e83cc130e7329c160cf2b88d6b4c20a`를 Forgejo 시크릿에 등록. **2026-09-23:** CI `deploy`(deploy-site.yml)는 `CF_API_TOKEN` 부재로 run#71까지 여전히 실패한다. 로컬 인증 wrangler(pages:write)로 `npm run build --prefix site` → release-identity 작성 → `npx wrangler pages deploy site/dist --project-name d3ro --branch main`을 수동 배포했고, 라이브 `https://d3ro.chanpaca.net/release-identity.json`이 commit `5c11ee2` / version `1.5.0`을, 라이브 번들이 설치 파일명 `D3RO-Voice-Setup-1.5.0-x64.exe`를 보고한다. 자동 게시에는 여전히 시크릿 등록이 필요하다. | -| GAP-BILL-01 | Billing | 사이트 가격과 서버 청구 금액·결제 진입 URL이 제각각이었다. | `packages/core/src/plan-catalog.ts`, `packages/core/src/web-urls.ts`, `scripts/ci/sync-core-contract.mjs` | `[x]` 2026-09-26 (Wave 3, 88f24d8·b6fe588): 가격·쿼터·공개 URL 정본을 core 두 파일로 합치고 Deno는 생성 사본(`contract:check`). Payple 함수 4종+billing-catalog 운영 재배포(payple-* v9, billing-catalog v5) → 신규·갱신 모두 ₩2,900/₩8,900. 결제 진입은 `/app/billing` 하나. | +| GAP-BILL-01 | Billing | 사이트 가격과 서버 청구 금액·결제 진입 URL이 제각각이었다. | `packages/core/src/plan-catalog.ts`, `packages/core/src/web-urls.ts`, `scripts/ci/sync-core-contract.mjs` | `[x]` 2026-09-26 (Wave 3, 88f24d8·b6fe588): 가격·쿼터·공개 URL 정본을 core 두 파일로 합치고 Deno는 생성 사본(`contract:check`). Payple 함수 4종+billing-catalog 운영 재배포(payple-* v9, billing-catalog v5) → 신규·갱신 모두 ₩2,900/₩8,900. 결제 진입은 `/app/billing` 하나. **2026-11-04:** `knowledge_embedding` 쿼터도 `PLAN_QUOTA`에 편입하고 `embedding-quota.ts`가 생성 계약을 소비하도록 중복 상수를 제거했다. | | GAP-BILL-02 | Billing | **Payple 정기 갱신이 한 번도 실행되지 않았다.** 갱신 cron(`payple-renew`)이 `.github/workflows`에만 있었는데 GitHub 원격이 없다. 웹 Payple 결제용 `NEXT_PUBLIC_PAYPLE_CLIENT_KEY`는 설정된 적이 없다. | `.forgejo/workflows/payple-renew.yml`, `apps/web/src/components/billing/payple-checkout-button.tsx`, `apps/web/Dockerfile` | `[~]` 2026-09-26: 워크플로 Forgejo 이식(dc43884), `CRON_SECRET` 새로 발급해 Supabase 함수 시크릿·Forgejo 시크릿에 등록, Forgejo `SUPABASE_URL` 등록 — main에 push되면 스케줄이 등록된다. **백로그(사용자 결정, 2026-09-27):** 아직 Payple 계약·계정이 없다. 웹 Payple 클라이언트 키(`NEXT_PUBLIC_PAYPLE_CLIENT_KEY`)는 계약 후 `.env`에 넣고 웹 이미지를 다시 빌드한다. 그 전까지 웹 결제 버튼은 꺼진 상태로 둔다. Stripe는 쓰지 않고(2026-09-26 저장소에서 제거, GAP-BILL-03), Google Play 가격은 스토어가 정본이라 사이트에 표시하지 않는다. | | GAP-BILL-03 | Billing | **Stripe 결제 제거 — 운영 잔여물 정리.** 사용자 결정(2026-09-26)으로 저장소에서 Stripe 코드·설정·테스트를 모두 지웠다(함수 3종, 웹 checkout/portal 버튼, `billing-catalog`의 Stripe 가격 조회, 데스크톱 `CheckoutModal`·`payment:*` IPC, `billingUrl()`의 `success`/`canceled` 복귀 쿼리). 배포된 Supabase 함수와 시크릿은 아직 운영에 남아 있다. 과거 `provider='stripe'` 행·`stripe_*` 컬럼·마이그레이션은 이력 호환으로 유지한다. | `server/supabase/config.toml`, `server/supabase/functions/billing-catalog/index.ts`, `apps/web/src/lib/billing-catalog.ts` | `[ ]` 운영: `supabase functions delete stripe-checkout`·`stripe-portal`·`stripe-webhook`, 시크릿 `STRIPE_SECRET_KEY`·`STRIPE_WEBHOOK_SECRET`·`STRIPE_PRICE_PRO`·`STRIPE_PRICE_PRO_PLUS`·`STRIPE_PRICE_TEAM` unset, Stripe 대시보드 웹훅 엔드포인트 비활성화. `billing-catalog` 재배포는 웹앱 배포보다 먼저(웹 파서가 Stripe 가격을 거부). | | GAP-WEB-01 | Web | 웹앱(`apps/web`)이 공개되지 않았다(배포 경로가 없었음). | `apps/web/Dockerfile`, `docker-compose.nas.yml`, `server/cloudflare-site-bridge` | `[x]` 2026-09-26: `/app` basePath·NAS `d3ro_voice_web`(3002). 터널 `kd-nas` ingress에 `d3ro.chanpaca.net` path `^/app` → NAS 3002를 추가하고 브리지 워커가 `/app`·`/api`·`/health`를 도메인 원본(터널)으로 흘린다(4aadee8). Supabase `site_url`을 `https://d3ro.chanpaca.net/app`으로(기존 localhost:3000), 허용 목록에 `/app/**` 추가. 라이브 `/app/login` 200. 같은 수정으로 9/19부터 끊겨 있던 API(`/api`, 관리자 로그인·stt-proxy)도 복구. | | GAP-OPS-01 | Ops | NAS 운영 compose가 저장소와 어긋나 있었다(JWT 기본값 폴백, 법률 wwwroot 마운트, 필수 변수 4개 누락). | `docker-compose.nas.yml`, NAS `/volume1/docker/d3ro/.env` | `[x]` 2026-09-26: NAS `.env`에 `SUPABASE_URL`·`SUPABASE_SERVICE_ROLE_KEY`(운영 service_role)·`ADMIN_BOOTSTRAP_TOKEN`(신규)·`API_SERVER_URL` 추가, 저장소 compose로 교체 후 `docker compose up -d`. 4개 컨테이너 정상, 백업 `*.before-wave3-20260926`. | | GAP-OPS-02 | Ops | 관리자 주소가 두 개였다(`admin.chanpaca.net`, `d3ro-admin.chanpaca.net`). `admin.d3ro.chanpaca.net`은 2단계 서브도메인이라 고급 인증서(ACM, 월 $10)가 필요하다. | Cloudflare 터널 kd-nas ingress, chanpaca.net DNS | `[x]` 2026-09-26: 사용자 결정 — 관리자 주소는 `d3ro-admin.chanpaca.net` 하나(chanpaca.net에 다른 서비스가 많다). `admin.chanpaca.net` 터널 규칙·DNS 삭제로 이름을 풀었다. ACM은 지금 구독하지 않는다. 참고: `*.kite`·`*.voice` 고급 인증서는 ACM이 꺼져 2026-11-02 만료 후 갱신되지 않는다(다른 프로젝트). | | GAP-OPS-03 | Ops | **`payple-renew` 크론이 등록 이후 한 번도 성공하지 못했다.** Forgejo 시크릿 `SUPABASE_URL`이 로컬 Supabase 주소(`127.0.0.1:55321`)로 등록돼 매일 `curl: (7) Failed to connect`. Payple 계약 전이라 청구 대상 구독은 없다(GAP-BILL-02). | `.forgejo/workflows/payple-renew.yml`, `scripts/ci/set-forgejo-secrets.mjs` | `[~]` 2026-10-11: 시크릿을 `.env` 운영 값으로 교체, 스크립트를 `.env` 정본 동기화 + 로컬 주소 거부로 확장. 남은 확인: 다음 정기 실행(10:00 KST)이 HTTP 200인지(수동 dispatch는 실결제 경로라 보류). | +| GAP-OPS-04 | Ops | `audio-purge`가 pg_cron의 service credential을 handler 안에서 검증하는 구조인데 `config.toml`에 함수 stanza가 없어 기본 gateway JWT 검증이 먼저 요청을 거부할 수 있었다. | `server/supabase/config.toml`, `server/supabase/functions/audio-purge/{index,handler}.ts`, migration `20260929000004_audio_retention_on_delete.sql` | `[~]` 2026-11-04: `[functions.audio-purge] verify_jwt = false`를 명시하고 격리 로컬 Supabase에서 실제 경로를 검증했다. 키 없음/유효한 non-service 키는 401, service 키는 200이었고 direct drain과 `pg_cron` → Vault → `pg_net` → Edge → Storage 경로 모두 `claimed=1`, `removed=1`, `failed=0`, `completed=1`; queue/`audio_files`/`storage.objects`는 `1|1|1`→`0|0|0`이었다. **남은 경계:** 이 소스의 배포 및 운영 pg_cron/Vault/실객체 실행은 확인하지 않았다. | | GAP-CI-02 | CI | `linux-builder` 러너가 노트북 한 대(`kd-desktop`)뿐이라 노트북이 꺼지면 CI·크론이 통째로 멈춘다(2026-09-29~10-09, run #128~#137 Canceled). | `.forgejo/workflows/*.yml` (`runs-on: linux-builder`) | `[ ]` 후보: 상시 켜진 NAS 러너에 `linux-builder`(또는 크론 전용) 라벨 추가, 최소한 `payple-renew`는 NAS로. | | GAP-CI-03 | CI | 9-28부터 `ci.yml`의 데스크톱 Vitest·모바일 Jest가 테스트 전부 통과인데도 실패했다. 데스크톱: 템플릿 테스트가 결과를 실제 TextInsertService로 넣다가 nut-js(libnut)가 X 디스플레이 없음(`Could not open main display`)으로 워커를 죽임. 모바일: `knowledge-service.test.ts`가 구독의 삭제 대조 setInterval을 끄지 않아 Jest가 끝나지 않음(잡 무한 대기). | `apps/desktop/tests/setup.ts`, `apps/mobile-rn/__tests__/knowledge-service.test.ts` | `[x]` 2026-10-11: setup.ts에 nut-js 공통 목, 테스트가 unsubscribe. 러너 호스트(vd-linux)에서 데스크톱 2539/2539 exit 0, 모바일 589/589 정상 종료 확인. | +| GAP-CI-04 | CI | Forgejo build validation과 root `build:all`이 web production build를 생략했고, migration checker도 CI quality gate에 연결되지 않았다. | `.forgejo/workflows/ci.yml`, `scripts/ci/build-all.mjs`, `scripts/ci/check-supabase-migrations.mjs` | `[x]` 2026-11-04: web production build를 두 경로에 추가하고 CI quality에서 `check:migrations:test` → `check:migrations`를 실행한다. CI 자체는 73개 파일의 naming/order/metadata 검사다. 같은 날 별도 격리 로컬 스택에서 empty/reset replay 73/73과 `pg-delta --strict-coverage` shadow diff 0을 확인했지만, 이 runtime gate는 아직 CI에 자동화되지 않았고 linked remote drift도 확인하지 않았다. | | GAP-CI-01 | CI | macOS 빌드·서명 러너가 없다. `.github`의 build-mac·release-signing-ca는 실행된 적 없이 삭제됐다. | `.forgejo/workflows/*`, `.gitlab-ci.yml` | `[!]` EXT: Mac 호스트에 Forgejo runner(`macos` 라벨)를 붙이거나 GitLab `package-macos` 사용. 서명된 Android 릴리스는 GitLab `mobile-production-release`가 정본. | | GAP-I18N-02 | Desktop | 녹음 캡슐의 "처리 중..."이 `recording-tip/index.html`에 한국어로 고정돼 앱 언어를 따르지 않는다. | `apps/desktop/src/renderer/popups/recording-tip/*`, `WindowManager.getPopupI18nStrings` | `[x]` 2026-09-28: 캡슐 문구는 main `_i18n`(popup.tip.*)으로, 오류는 `@d3ro/core/voice-error-message` 분류 → 사용자 언어 문구(bootstrap 이 error.code 를 넘기지 않던 버그 포함). 팝업 문서 lang 도 앱 언어. | +| GAP-I18N-03 | i18n | 12개 locale catalog의 키 정합성과 실제 제품 표면의 언어 선택 범위가 혼동돼 web/mobile이 12개 언어 완료로 표시됐다. | `packages/i18n/src/locales/*`, `apps/web`, `apps/mobile-rn`, `docs/v3/MOBILE_APP_COMPLETION_SSOT.md` O-012 | `[~]` 2026-11-04: 12개 catalog는 2,742키 parity가 있고 updater dialog도 모두 동기화됐다. 그러나 web에는 locale selector가 없고 mobile은 ko/en 표면만 제공한다. 각 표면의 selector·routing·전체 번역 런타임 검증 후 `SHELL-03` W/M을 `[x]`로 올릴 것. | | GAP-UX-01 | Desktop | 회의 "내 메모"(상세 탭)는 이 기기 localStorage 에만 저장된다 — 기기 간 동기화되지 않는다. 끝난 회의에는 addMemo 가 거부된다(`MeetingModeService.ts:383`). | `components/meeting/meeting-notepad-storage.ts`, `MeetingModeService`, `MeetingNotesTab.tsx`, `tests/unit/desktop-ux-gaps.test.ts`, `tests/red/meeting.usecase.test.ts` | `[x]` 2026-10-30: `MeetingModeService.addMemo(content, meetingId?)`가 종료된 회의(`meetingId` 또는 `_finalizedSessionId`)에도 메모를 추가·저장하고 `CloudSyncService.pushOne('meeting_memos', memo.id)`로 기기 간 동기화하며, `MeetingNotesTab.tsx`가 `syncNotepadMemo`(`meeting-notepad-storage.ts`)로 내 메모를 동기화한다. 검증: `desktop-ux-gaps.test.ts` 13/13, `meeting.usecase.test.ts` 23/23 통과. | | GAP-UX-02 | Desktop | 기록 조회에 모드·즐겨찾기 조건, 태그+검색 조합이 없어 화면이 불러온 페이지 위에서 거른다(조건이 까다로우면 여러 페이지를 불러와야 보인다). 오프셋 페이지라 사이 삽입·삭제 때 누락·중복 가능. 기록 제목·본문 편집 없음. 마크다운 내보내기는 태그 붙은 기록만·저장 위치 선택 불가. | `HistoryService`, `history-handlers.ts`, `MemoService.exportMarkdown`, `HistoryEntryCard.tsx`, `HistoryPage.tsx`, `tests/unit/records-view.test.ts`, `tests/red/memo.usecase.test.ts` | `[x]` 2026-10-30: `HistoryService.list`/`getAll`에 SQLite 직접 조건(`mode`, `isFavorite`, `tag`, `search`/`query`, `beforeCreatedAt` 커서 페이지네이션)을 추가하고, `HistoryService.update`(`history:update` IPC + `HistoryEntryCard` 인라인 편집 + 동기화 push)와 `MemoService.exportMarkdown`(무태그 기록 포함, 필터 연동, `savePath` 및 저장 대화상자 선택)을 구현했다. 검증: `records-view.test.ts` 21/21, `memo.usecase.test.ts` 15/15 통과. | | GAP-UX-03 | Desktop | 회의 요약 항목 → 전사 구간 근거 링크 없음(요약·전사를 잇는 인용 데이터가 없다). | `MeetingSummaryService`, `MarkdownRenderer.tsx`, `MeetingSummaryTab.tsx`, `MeetingDetailTabs.tsx`, `TranscriptTab.tsx`, `EditableSegment.tsx`, `tests/unit/desktop-ux-gaps.test.ts` | `[x]` 2026-10-30: `MeetingSummaryService`가 요약·결정·액션아이템에 `[MM:SS]` 타임스탬프 근거 인용을 생성·파싱(`parseCitationTimestampMs`, `extractTranscriptCitations`)하고, `MarkdownRenderer`/`MeetingSummaryTab`에서 인용 배지 클릭 시 전사 탭의 해당 `EditableSegment`(`data-timestamp-ms`)로 이동·하이라이트한다. 검증: `desktop-ux-gaps.test.ts` 13/13 통과. | | GAP-UX-04 | Mobile | 모바일 정보 구조 개편: visible Home/Records/Meetings/More 4탭, 숨은 Record route, 세 동작 FAB, Home/More, 새/전환된 v4 흐름의 `ScreenHeader`와 48dp back target. | `apps/mobile-rn/src/navigation/TabNavigator.tsx`, `components/{RecordFab,ScreenHeader}.tsx`, `screens/{Home,More}Screen.tsx` | `[x]` 2026-09-28: 전체 Jest 86 suites/589 tests, 320dp dark 1/1 PASS(88초), 411dp light 1/1 PASS(100초). Canonical 보고서는 `scratch/design-audit/wave45/navigation-shell-search-{320-dark,411-light}-verified.xml`, 추적 요약은 `docs/evidence/wave45-mobile-shell-search-2026-09-28.md`. `DashScreen`/`WorksHubScreen`은 삭제했고 WorksHub의 로컬 도구 검색·고정은 복잡도 축소를 위해 의도적으로 종료했다. 목적지는 탭/More에 보존됐고 콘텐츠 삭제는 없으며 비활성 `works-hub-pins.v1` 키는 남을 수 있다. TalkBack/font-scale/rotation은 이 셸 gap을 다시 열지 않고 Q-021 `[~]`로 추적한다. | | GAP-UX-05 | Desktop+Mobile | 기록+회의 통합 검색. 두 원본은 분리 유지하고 결과만 `source + id`로 상세 화면에 연결한다. | `@d3ro/core/types`, desktop `UnifiedSearchService`/`UnifiedSearchPage`, mobile `features/search`/`UnifiedSearchScreen` | `[~]` 2026-09-28 → **2026-10-30 코드·테스트 보강 완료:** 모바일 `unified-search-service.ts` 및 `UnifiedSearchScreen.tsx`에 `AbortSignal`/`AbortController` 요청 취소, `transcripts` 구간 테이블 검색(`searchTranscriptSegments`), 대용량 원문 상한(`boundPayloadText`)을 추가하고, 데스크톱 `UnifiedSearchService.ts`에도 `meetingMemos` 및 전사 구간 타임스탬프 스니펫 추출·인덱스 정렬을 추가했다(검증: 모바일 `unified-search-service.test.ts` 및 데스크톱 `UnifiedSearchService.test.ts` 12/12 통과). Electron `Ctrl+K` 실앱 수동 검증만 남아 `[~]` 유지. | | GAP-UX-06 | Desktop | main 쪽 정리 필요: `STTManager.ts:53-129` 공급자 설명 한국어 하드코딩·마케팅 문구("100% 완전 오프라인", "Industry Benchmark") — 렌더러는 더 이상 쓰지 않는다 / audio TEST_DEVICE 가 deviceId 무시 / 사전 `incrementUsage` 호출처 없음(사용 횟수 항상 0) / 사전 발음 필드가 인식 힌트·치환에 쓰이지 않음 / 대화 세션 다시 듣기 IPC 없음 / preload `instruction.getAll` 이 `unknown[]` / 지식 추가 실패 판정이 문구 비교. | `STTManager.ts`, `ipc/audio-handlers.ts`, `DictionaryService.ts`, `VoiceModeService.ts`, `VoiceConversationService.ts`, `preload/index.ts`, `ipc/rag-handlers.ts`, `KnowledgeBasePage.tsx` | `[x]` 2026-10-30: 7개 항목 전수 해결 — (1) `STTManager.ts` 중립 기술 설명으로 교체, (2) `audio-handlers.ts` `TEST_DEVICE`가 `deviceId`·`durationMs` 전달, (3) `DictionaryService` 발음 힌트(`getPromptHints`) 및 발음→표제어 치환·`incrementUsage`(`applyDictionaryCorrections`)를 `VoiceModeService._transcribe`에 연결, (4) `voiceConversation:replayMessage` IPC + `VoiceConversationPage` 다시 듣기 버튼 추가, (5) `preload` `instruction.getAll` 타입 `CustomInstruction[]` 지정, (6) `rag-handlers.ts`·`KnowledgeBasePage.tsx` 구조화 에러(`details.cancelled` / `ErrorCode`) 판정으로 전환. 검증: `desktop-ux-gaps.test.ts` 13/13 통과. | -| GAP-UX-07 | Desktop | 2026-09-28 개편 문구는 ko·en 만 — 다른 8개 로케일은 en 폴백. 온보딩 Ollama 모델 크기 표기(`onboarding.llmModelSize` 9.6GB)와 안내 모달의 크기가 다르다. | `packages/i18n/src/locales/*`, `OllamaGuideModal.tsx`, `scripts/ci/sync-i18n-locales.mjs`, `tests/main/services/i18n-locale-parity.test.ts` | `[x]` 2026-10-30: `onboarding.llmModelSize`와 `OllamaGuideModal.tsx`의 기본 모델(`gemma4:e4b`) 크기 표기를 `4.0GB`로 통일하고, 12개 로케일 전체에 2,716개 키를 100% 동기화했다(`i18n-locale-parity.test.ts` 15/15 통과). | +| GAP-UX-07 | Desktop | 2026-09-28 개편 문구는 ko·en 만 — 다른 8개 로케일은 en 폴백. 온보딩 Ollama 모델 크기 표기(`onboarding.llmModelSize` 9.6GB)와 안내 모달의 크기가 다르다. | `packages/i18n/src/locales/*`, `OllamaGuideModal.tsx`, `scripts/ci/sync-i18n-locales.mjs`, `tests/main/services/i18n-locale-parity.test.ts` | `[x]` 2026-10-30: `onboarding.llmModelSize`와 `OllamaGuideModal.tsx`의 기본 모델(`gemma4:e4b`) 크기 표기를 `4.0GB`로 통일하고, 12개 로케일 전체를 동기화했다. **2026-11-04:** updater dialog 16키를 추가해 현재 2,742키이며 `i18n-locale-parity.test.ts` 15/15가 이를 고정한다. | +| GAP-UX-08 | Mobile | **대화면(태블릿/폴더블 펼침) 레이아웃 대응이 없다.** 825dp 폭에서도 모든 화면이 한 열로 늘어난 휴대폰 레이아웃이고, `useWindowDimensions`/breakpoint/`numColumns` 사용처가 0건이다. More/Meetings/Commands/Templates 는 2열 그리드 후보, Dictionary Edit·Delete 와 Templates Select 는 화면 절반~전체 폭 버튼이 된다. 적응형 배너(`ANCHORED_ADAPTIVE_BANNER`, `minHeight: 50`)는 로드 후 728×90↔468×60 으로 높이가 변해 탭 바가 시프트한다(콘텐츠 가림은 스크롤로 회피 확인). | `apps/mobile-rn/src/navigation/TabNavigator.tsx`, `screens/*`, `packages/ui-native/src/theme.ts`, `docs/evidence/2026-11-05-tablet-layout-audit.md` | `[ ]` 2026-11-05 실기 감사 — **Tab S11 Ultra 1848×2960 @320dpi ≈ 924dp 가로** 및 Fold6 OPENED 825dp. 실측: 온보딩 본문·로그인 폼·Recorder 버튼이 2880px(900dp) full-width, More 라벨↔chevron 800dp, Home/Records 행 40..2920px. 다음 단계: `useContentWidth()`/`ContentColumn` 공용 컬럼 → 탭 화면 7곳 적용 → `≥600dp` 2열 그리드 → full-width 버튼 `maxWidth` 제한 → 배너 slot 높이 예약. 실기기 회귀는 Maestro `open`/`closed` 2회 실행으로. | | GAP-TEAM-02 | Team | 브라우저에서 초대를 수락하는 경로가 없다. 웹 `accept-invite` 페이지는 발급 링크가 가리키지 않고 로그인 후 토큰을 읽는 곳이 없어 끊겨 있었으므로 삭제했다(사이트 `/accept-invite/`는 앱 딥링크만). | `apps/web/src/app/accept-invite/page.tsx`, `apps/web/src/app/(app)/team/page.tsx`, `site/public/accept-invite/` | `[x]` 2026-10-30: `/app/accept-invite?token=...` 웹 수락 페이지(비로그인 시 `/login?next=/app/accept-invite?token=...` 경유 후 `team-accept` Edge Function 호출 → `/app/team` 이동)와 랜딩 `/accept-invite/`의 `"웹 브라우저에서 수락하기"` 보조 CTA를 구현했다. 검증: `apps/web` typecheck 0 에러. | | GAP-REL-10 | Release | `release-windows`(태그 파이프라인)는 서명 가드에 도달하기 **전에** sidecar 단계에서 죽는다. 이 러너 컨텍스트에서는 `sidecar:setup`이 Python 3.11+를 찾지 못한다(`Python 3.11+ 를 찾을 수 없습니다`) → `sidecar:build` → `verify-sidecar-bundle.mjs` 연쇄 실패(실측: run#65 `v1.3.7`, run#61 `v1.3.6`). 같은 러너의 portable 잡은 `py -3.11 → Python 3.11.9`를 찾아 사이드카 빌드에 성공하므로, 워크플로/컨테이너 간 PATH 차이다. | `.forgejo/workflows/release.yml`, `apps/desktop/scripts/setup-sidecar.mjs` | `[!]` 2026-09-19: 러너에 Python 3.11+(`py` 런처 포함)를 보장하거나 워크플로에 `actions/setup-python` 단계를 추가한다. 그 전까지 서명 게시는 불가능하다(GAP-REL-02와 별개 선행 차단). **2026-10-17 `[x]`**: 런타임이 설치본에서 분리돼 `release.yml` 은 더 이상 사이드카를 빌드하지 않는다(`build-desktop-installer.mjs`). | | GAP-REL-11 | Release | portable 워크플로의 마지막 `actions/upload-artifact@v4` 단계가 Forgejo 러너에서 `GHESNotSupportedError`로 실패한다(증거 보존만 실패, 게시는 성공). | `.forgejo/workflows/portable.yml`, `scripts/ci/verify-release-metadata.mjs` | `[x]` 2026-10-30: `.forgejo/workflows/portable.yml`에서 미지원 `actions/upload-artifact@v4` 단계를 제거하고 `portable.json`·볼륨 SHA-256 요약 출력 단계로 대체했으며, `verify-release-metadata.mjs`에 회귀 방지 검증(`forgejo_portable_unsupported_upload_artifact`)을 추가했다 (`npm run release:metadata:test` 18 cases PASS). | @@ -55,7 +59,7 @@ Legend: `[ ]` open · `[~]` in progress · `[!]` blocked externally · `[x]` res | GAP-REL-06 | Release | 서명 인증서가 없어 stable(`latest`) 채널에 **무서명** 설치본을 게시했다. electron-updater는 `app-update.yml`에 `publisherName`이 없으면 서명 검증을 건너뛰므로 설치는 동작하지만, SmartScreen 평판은 버전마다 0부터 시작한다. | `scripts/ci/publish-forgejo-release.mjs`, `release/update-policy.json`, `.forgejo/workflows/release.yml` | `[~]` 2026-10-17: 무서명 게시가 정식 경로가 됐다 — `--ack-unsigned` 예외 대신 latest.yml Ed25519 서명 + 앱 검증(GAP-REL-13). SmartScreen 평판 문제만 남음. 이력: 2026-09-18: `1.3.2`를 `--ack-unsigned`(명시적 승인 플래그)로 게시. **2026-09-19: `1.3.7`도 같은 경로로 게시**(`npm run release:updater -- --ack-unsigned`, 설치본 90.6MiB, `latest.yml`=1.3.7, 설치본 sha512가 피드 메타데이터와 일치). 인증서 확보 시 더 높은 버전으로 서명 게시하여 대체하고, 이 예외를 제거한다. **2026-09-23: `1.5.0`도 같은 경로로 게시**(`npm run release:updater -- --build --ack-unsigned`, 설치본 91.2MiB, `latest.yml`=1.5.0, sha512 검증). | | GAP-REL-07 | Release | 패키징된 `better-sqlite3`가 호스트 Node ABI여서 `1.3.2` 설치본이 시작 즉시 죽었다(NODE_MODULE_VERSION 131 vs 130). 원인: 로컬 `npm install`이 네이티브 모듈을 Node용으로 재빌드했고 패키징이 재빌드를 건너었다. | `scripts/ci/verify-native-abi.mjs`, `scripts/ci/fix-native-abi.mjs`, `.gitlab-ci.yml`/`.forgejo`/`.github` 패키징 단계 | `[x]` 2026-09-18: 패키징 후 Electron ABI를 검증하고, 검증된 트리에서만 설치본을 생성(`--prepackaged`)한다. `1.3.3`은 설치본에서 추출한 바이너리로 재검증 GREEN. | | GAP-ADS-01 | Ads | 9 of 10 desktop ad adapters still extend `UnavailableAdAdapter` (`provider_not_integrated`). | `apps/desktop/src/main/services/ads/*` | `[~]` 2026-09-13: `DirectHouseSponsorAdapter` is now a real configurable REST adapter (bid/impression/click/reward via `endpointUrl`; fail-closed when unconfigured; 22 unit tests GREEN). Remaining 9 need official SDKs/authenticated endpoints. | -| GAP-ADS-02 | Ads | Desktop mediation reward accounting is not wired to license quota (`claimReward` still returns no tokens). | `AdMediationEngine.ts`, `LicenseService.ts`, `license-store.ts`, `AppLayout.tsx`, `tests/unit/AdMediationEngine.spec.ts` | `[x]` 2026-10-30: `AdMediationEngine.claimReward`가 어댑터 `reportRewardCompletion` 검증 및 노출·재생시간·쿨다운·논스 중복 검증을 통과한 경우에만 `LicenseService.grantRewardQuota`를 호출해 당일 `PREMIUM_LLM` 보너스 쿼터를 지급하도록 연결했다(미검증/위조 요청은 fail-closed 거부). 검증: `AdMediationEngine.spec.ts` 23/23 통과. | +| GAP-ADS-02 | Ads | Desktop mediation reward accounting is not wired to license quota (`claimReward` still returns no tokens). | `AdMediationEngine.ts`, `LicenseService.ts`, `license-store.ts`, `AppLayout.tsx`, `tests/unit/AdMediationEngine.test.ts` | `[x]` 2026-10-30: `AdMediationEngine.claimReward`가 어댑터 `reportRewardCompletion` 검증 및 노출·재생시간·쿨다운·논스 중복 검증을 통과한 경우에만 `LicenseService.grantRewardQuota`를 호출해 당일 `PREMIUM_LLM` 보너스 쿼터를 지급하도록 연결했다(미검증/위조 요청은 fail-closed 거부). 검증: `AdMediationEngine.test.ts` 23/23 통과. | | GAP-ID-01 | Identity | Supabase, .NET JWT/SQLite, and the desktop offline license each had their own tier/role shape. | `@d3ro/core/entitlement`, `LicenseService`, `entitlement-context` | `[x]` 2026-10-30: canonical `EntitlementSnapshot` + `resolveEntitlement` adopted across desktop, web, and mobile (see GAP-ID-02). | | GAP-ID-02 | Identity | Web and mobile still hand-roll tier/role normalization instead of consuming the canonical resolver; .NET identity is still a separate store. | `apps/web/src/lib/entitlement.ts`, `apps/mobile-rn/src/lib/entitlement-context.tsx`, `apps/mobile-rn/__tests__/entitlement.test.ts` | `[x]` 2026-10-30: 웹(`apps/web/src/lib/entitlement.ts`, `billing/page.tsx`, `dashboard-client.ts`)과 모바일(`apps/mobile-rn/src/lib/entitlement-context.tsx`) 모두 `@d3ro/core/entitlement`의 `resolveEntitlement`·`normalizeEntitlementTier`·`normalizeAdminRole`을 정본으로 사용하도록 통합했다(`.NET` 서버는 엔터프라이즈/레거시 프록시 전용 매핑 유지). 검증: `apps/mobile-rn/__tests__/entitlement.test.ts` 통과. | | GAP-TEAM-01 | Teams | Team comments / activity feed was not implemented. | `server/supabase/migrations/20260913000033_team_activities.sql`, web `activity-feed.tsx`, mobile `team-service.ts` | `[x]` 2026-09-13: `team_activities` table + `create_team_activity` RPC + RLS + realtime publication; web + mobile UI. | @@ -64,15 +68,16 @@ Legend: `[ ]` open · `[~]` in progress · `[!]` blocked externally · `[x]` res | GAP-MTG-01 | Meetings | Audio seek ↔ transcript timestamp sync missing. | `apps/mobile-rn/src/features/meetings/meetings-service.ts`, `MeetingDetailScreen.tsx`, `apps/web/src/components/meetings/{meeting-audio-player,live-transcript-list}.tsx`, `apps/mobile-rn/__tests__/meetings.test.ts` | `[x]` 2026-10-30: 모바일(`MeetingDetailScreen.tsx`)과 웹(`meeting-audio-player.tsx` ↔ `live-transcript-list.tsx`) 및 데스크톱(`TranscriptTab.tsx` / `EditableSegment.tsx`)에 `[MM:SS]` 구간 타임스탬프 파싱·오디오 시크 이동 및 재생 위치별 활성 전사 세그먼트 하이라이트를 구현했다 (`__tests__/meetings.test.ts` 통과). | | GAP-MTG-02 | Meetings | Speaker diarization only partially done on desktop; absent web/mobile. | `docs/phases/phase-15.5-speaker-diarization.md`, SSOT H-014 | Finish desktop pyannote path; expose speaker labels cross-surface. | | GAP-MTG-03 | Meetings | Existing recordings could become plain transcription history, but not a meeting with linked audio and minutes. | desktop `MeetingModeService`, `meeting/imported-recording.ts`, `meeting-mode-handlers.ts`; mobile `MeetingsScreen` → `RecordScreen`; MTG-13 | `[~]` 2026-11-02: installed Windows 1.16.0 passed native picker→timestamped transcript→local summary/action item with a real WAV (`2026-11-02-verification.md`). Desktop GUI gate is complete; authenticated Android picker→upload→transcript→minutes on Fold6 remains. | -| GAP-INFRA-01 | Build | `apps/mobile-rn` is outside npm workspaces, so root `typecheck`/`test`/`lint` skip it. `typecheck:mobile`/`lint:mobile`/`test:mobile`/`verify:all` root scripts added 2026-09-13 (`package.json`), but membership/CI integration is still open. | `package.json`, `.forgejo/workflows/ci.yml`, `.gitlab-ci.yml` | `[x]` 2026-10-30: React Native Metro/Gradle 네이티브 오토링킹 격리를 위해 `apps/mobile-rn`은 독립 `node_modules`로 유지하고, 루트 `verify:all` 및 `.forgejo/workflows/ci.yml`·`.gitlab-ci.yml`의 `mobile-quality` 잡이 모바일 `lint`·`typecheck`·`test:ci`를 필수 게이트로 실행하도록 정본화했다. | +| GAP-MTG-04 | Meetings | Learned typing vocabulary never reached meeting transcription: STT used a hardcoded Korean hint, refine had no glossary, refined lines stopped inside `CaptionService`, and the stored transcript was raw segments. | `packages/core/src/transcript-correction.ts`, `apps/desktop/src/main/services/TranscriptGlossaryService.ts`, `CaptionService.ts`, `meeting/MeetingRecordingSession.ts`, `MeetingModeService.ts`, `FileTranscriptionService.ts`, `VoiceModeService.ts`; MTG-14 | `[~]` 2026-11-05: one glossary SSOT wired into caption, meeting, file transcription and dictation; refined lines now propagate to the meeting transcript and renderer (`meetingMode:segmentUpdated`). Evidence: `packages/core/__tests__/transcript-correction.test.ts` 16/16, `apps/desktop/tests/main/services/transcript-glossary.test.ts` 9/9, desktop offline suite, workspace typecheck, touched-file ESLint and `test:hygiene` green. **Remaining:** run a real meeting with the user's actual learned vocabulary and confirm no over-correction of ordinary Korean words, plus a packaged-install check of the new IPC event. | +| GAP-INFRA-01 | Build | `apps/mobile-rn` is outside npm workspaces, so root `typecheck`/`test`/`lint` skip it. `typecheck:mobile`/`lint:mobile`/`test:mobile`/`verify:all` root scripts added 2026-09-13 (`package.json`), but membership/CI integration is still open. | `package.json`, `.forgejo/workflows/ci.yml`, `.gitlab-ci.yml` | `[x]` 2026-10-30: React Native Metro/Gradle 네이티브 오토링킹 격리를 위해 `apps/mobile-rn`은 독립 `node_modules`로 유지하고, 루트 `verify:all` 및 `.forgejo/workflows/ci.yml`·`.gitlab-ci.yml`의 `mobile-quality` 잡이 모바일 `lint`·`typecheck`·`test:ci`를 필수 게이트로 실행하도록 정본화했다. **2026-11-04:** root `test:mobile`도 watch-capable 기본 Jest가 아니라 mobile `test:ci`(`jest --runInBand`)를 호출하도록 고정했다. | | GAP-MOB-01 | Legacy | `apps/mobile` Expo skeleton duplicated auth/data code and got version-sync edits. | SSOT G-002 | `[x]` 2026-09-13: deleted `apps/mobile`, removed from `sync-version.mjs` and `package-lock.json`; `version:check` GREEN. | | GAP-INFRA-02 | CI | GitLab admin NAS deploy job is disabled; admin deploy is manual/GHCR. | `.gitlab-ci.yml`, `docs/deployment/nas-deploy-runbook.md` | `[x]` 2026-10-30: 임시 CI DinD 데몬만 바꾸던 구 잡 대신 `docker-compose.nas.yml` 기반의 정본 배포·헬스체크·롤백 절차를 `docs/deployment/nas-deploy-runbook.md`로 문서화하고 `.gitlab-ci.yml` 및 `02-infrastructure.md`에 연결했다. | | GAP-INFRA-03 | Release | Desktop auto-update was single-channel and pointed at GitLab while the public hub was Forgejo; no channel, mandatory-update, major-vs-delta, staging, or kill-switch policy. | `apps/desktop/src/main/update-feed.ts`, `electron-builder.yml`, `.forgejo/workflows` | `[x]` 2026-09-13: canonical Forgejo feed + legacy GitLab mirror, `release/update-policy.json` + runtime policy, `publish-forgejo-release.mjs` + Forgejo release workflow, 21 policy tests, verifier self-test 13 cases. See `docs/deployment/update-system-assessment.md`. | | GAP-INFRA-04 | Quality | Desktop `typecheck` is a no-op: `tsconfig.json` is `files: []` + references, so `tsc --noEmit` checks nothing. Real `tsc -p tsconfig.node.json --noEmit` surfaces many pre-existing errors. | `apps/desktop/package.json`, `apps/desktop/tsconfig.node.json`, `apps/desktop/tsconfig.web.json` | `[x]` 2026-10-30: `apps/desktop/package.json`의 `typecheck`가 `tsc --noEmit -p tsconfig.node.json && tsc --noEmit -p tsconfig.web.json`을 실행하도록 수정하고 전체 컴파일 에러를 0건으로 해소했다 (GAP-REL-15). | | GAP-SHELL-01 | Support | Admin `/support` is a stub panel; desktop-only `SupportModal`. No shared ticket contract. | `apps/admin/src/app/(admin)/support/page.tsx` | `[x]` 2026-10-30: 어드민 `/support`를 정적 스텁에서 `content_reports` 기반의 fail-closed 고객지원·콘텐츠 신고 관리 콘솔(상태별 필터, 요약 지표 카드, 페이지네이션, 백엔드 미연결 시 명시적 오류 배너 `support-backend-error`)로 업그레이드했다 (`apps/admin` typecheck 0 에러). | -| GAP-PUSH-01 | Push | `send-push` accepted `webpush`/`apns` but marked them `push_provider_not_supported`. | `_shared/webpush.ts`, `_shared/apns.ts`, `send-push/index.ts` | `[x]` 2026-09-13: VAPID Web Push (RFC 8291) + APNs `.p8` transports implemented and routed; 10 new tests incl. an encryption round-trip. Client registration for those providers still pending (see GAP-PUSH-03). | +| GAP-PUSH-01 | Push | `send-push` accepted `webpush`/`apns` but marked them `push_provider_not_supported`. | `_shared/webpush.ts`, `_shared/apns.ts`, `send-push/index.ts` | `[x]` 2026-09-13: VAPID Web Push (RFC 8291) + APNs `.p8` transports implemented and routed; 10 new tests incl. an encryption round-trip. Web/iOS client registration code now exists (see GAP-PUSH-03); provider secrets, deployed cron execution, and live delivery remain separate runtime gates. | | GAP-PUSH-02 | Push | Nothing triggered `send-push?mode=drain`; enqueued notifications never left the outbox. | `server/cloudflare-worker/src/push-drain.ts`, `wrangler.toml` | `[x]` 2026-09-13: Cloudflare Cron Trigger (`* * * * *`) drains the outbox; tests in CI. Requires `SUPABASE_URL` + `SUPABASE_SERVICE_ROLE_KEY` secret on the worker. | -| GAP-PUSH-03 | Push | Mobile/web clients register only `fcm`; no service worker subscription or APNs device token. | `apps/web/public/sw.js`, `apps/web/src/lib/web-push.ts`, `apps/mobile-rn/src/features/notifications/*`, `apps/mobile-rn/__tests__/notifications.test.ts` | `[x]` 2026-10-30: 웹 서비스워커(`apps/web/public/sw.js`)와 VAPID 구독 헬퍼(`apps/web/src/lib/web-push.ts`, `provider: 'webpush'`), 모바일 플랫폼별 푸시 공급자 분기(`iOS` → `provider: 'apns'`, `Android` → `provider: 'fcm'`)를 구현하고 단위 테스트(`__tests__/notifications.test.ts`)로 검증했다. | +| GAP-PUSH-03 | Push | Web/iOS provider-specific registration paths were missing; web additionally needed a production call site that actually subscribes the signed-in device. | `apps/web/public/sw.js`, `apps/web/src/lib/{web-device,web-push,web-push-session}.ts`, `apps/web/src/components/layout/web-push-control.tsx`, `apps/web/e2e/web-push.spec.ts`, `packages/api-client/src/types.ts`, `apps/mobile-rn/src/features/notifications/*`, `apps/mobile-rn/__tests__/notifications.test.ts` | `[~]` 2026-11-04: web sidebar opt-in/out uses explicit user-gesture permission, a stable active `platform='web'` device, device-bound RPCs, rollback, disabled-intent reconciliation, bounded parallel local/server cleanup, and logout-independent sign-out; 17 Playwright contract tests cover these boundaries. An ephemeral isolated local run proved device/token/outbox/drain and a provider-accepted `delivered` row, but did not observe the service-worker notification. A production-standalone rerun built/served, then timed out during throwaway login navigation before dashboard render. Mobile APNs/FCM branching is unit-tested. Still open: matching production VAPID configuration, authenticated production permission/subscription and 1440/390/a11y render proof, deployed scheduled drain, and real Web Push/APNs receipt. | | GAP-PUSH-04 | Push | Android still depends on FCM (`google-services.json`). | `apps/mobile-rn/android`, `send-push` | Decide: minimal Firebase project, or UnifiedPush/ntfy. See `docs/deployment/push-transport-without-firebase.md`. | | GAP-STT-01 | Local STT | Packaged desktop builds shipped **no** faster-whisper sidecar: `electron-builder.yml` had no `extraResources` entry for it and no pipeline job built it. Local transcription was impossible on any installed build; the app fell back to a system Python without the runtime. | `apps/desktop/electron-builder.yml`, `.gitlab-ci.yml`, `apps/desktop/scripts/build-sidecar.mjs` | `[x]` 2026-09-18: sidecar bundled via `extraResources` (`sidecar-dist/sidecar` → `resources/sidecar`), `sidecar:setup`/`sidecar:build` scripts, and `scripts/ci/verify-sidecar-bundle.mjs` fails packaging when the engine or its Silero VAD data is missing. Verified on the real 242 MB bundle. | | GAP-STT-02 | Local STT | Dev resolved the sidecar/SoX paths against the Vite output dir (`out/main`), so the sidecar ran a Python without faster-whisper and SoX recording died with `spawn sox ENOENT`. | `apps/desktop/src/main/utils/paths.ts`, `apps/desktop/tests/main/utils/paths.test.ts` | `[x]` 2026-09-18: app root is discovered by walking up for app markers; packaged mode fails loudly instead of silently falling back. Unit tests pin both branches. | @@ -88,7 +93,8 @@ Legend: `[ ]` open · `[~]` in progress · `[!]` blocked externally · `[x]` res | GAP-KEY-03 | Key bindings | `command` 액션에 전용 핸들러가 없다. 이번에 처음으로 설정 UI 에 노출됐지만, 트리거되면 dictation 파이프라인으로 fallback 하며 `KEYBINDING_ACTIONS` 의 `holdMode:false` 대신 dictation 과 같은 hold-to-talk 로 강제된다. 개편 이전부터 같은 동작이었고 이번 작업은 그 사실을 코드에 명시화만 했다(기능 변화 없음). | `apps/desktop/src/main/services/voice-intent.ts`, `VoiceModeService.ts`, `tests/main/services/voice-intent.test.ts` | `[x]` 2026-10-30: `resolveGestureHoldMode` 및 `VoiceModeService`에서 `command` 액션이 `KEYBINDING_ACTIONS`의 `holdMode: false`(토글)와 hold-to-talk를 모두 지원하도록 예외 강제를 제거하고, `actionId === 'command'` 세션에서는 일반 받아쓰기 설정과 무관하게 음성 명령 매칭(`VoiceCommandService.match`) 및 LLM 후처리(`defaultLLMAction === 'none'`일 때 `'refine'` 폴백)를 수행하도록 전용 경로를 구현했다 (`voice-intent.test.ts` 19/19 통과). | | GAP-QA-02 | Quality | 캡션 테스트 2건이 **개발 머신에 사이드카 venv 가 있는지에 따라 결과가 갈린다**. `LocalSTTService.initialize()`(`:239`) → `_ensureSidecarRunning()`(`:583`) → `_spawnSidecar()`(`:650`) → `_waitForHealth()`(`:794`) 경로에서 venv 가 존재하면 실제 Python 프로세스를 띄우고 health 폴링이 vitest 기본 타임아웃 10초를 넘긴다. venv 가 없으면 `getSidecarCommand()`(`apps/desktop/src/main/utils/paths.ts:174`)가 즉시 throw 해서 같은 테스트가 빠르게 통과한다. 테스트가 로컬 환경을 격리하지 못한 것이 결함이다. | `apps/desktop/tests/red/harness.ts`, `tests/red/{ipc-surfaces,silent-errors,rag}.usecase.test.ts`, `tests/main/utils/paths.test.ts` | `[x]` 2026-10-30: `tests/red/harness.ts`의 `useRedHarness()`에서 `LocalSTTService.prototype.initialize`/`ensureSidecar` 및 오프라인 `fetch`를 기본 스텁 처리해 로컬 Python venv·임베딩 서버 유무와 무관하게 결정론적으로 실행되게 격리했고, `paths.test.ts`의 에러 문구 정규식도 일치시켰다 (`paths.test.ts`, `ipc-surfaces.usecase.test.ts`, `silent-errors.usecase.test.ts`, `rag.usecase.test.ts` 총 60개 테스트 1.8초 내 전수 통과). | | GAP-QA-03 | Quality | 데스크톱 `test`와 `test:unit`이 같은 전체 Vitest 를 실행하고, STT export 모의 누락·Electron 모의 중복·오래된 built-in/UIA 기대값으로 35개가 상시 실패해 전체 테스트가 게이트 역할을 하지 못했다. | `apps/desktop/vitest.config.ts`, `apps/desktop/package.json`, `tests/red/{voice,conversation}.usecase.test.ts`, `tests/main/windows/popup-redteam-r2-3.test.ts`, `tests/main/services/input-telemetry-stale-snapshot.test.ts`, `tests/main/sync/sync-redteam-r1-0.test.ts` | `[x]` 2026-10-31: STT 부분 모의가 실제 export 를 보존하고, 팝업 복구 테스트를 기존 팝업 하네스로 통합했으며, built-in 6개와 합성 유니코드 키 무시 계약을 기대값에 반영했다. 하나의 Vitest 설정에 `unit`/`service`/`integration`/`eval`/`all` mode 를 두고 기본 `test`는 오프라인 `unit`+`service`만 실행한다. 검증: `test:unit` 286, `test:service` 2478, 기본 `test` 2764 전부 통과; `test:all` 2788 통과·10개 환경 의존 테스트 skip·0 실패; typecheck·변경 파일 ESLint·build·`git diff --check` 통과. 외부 Ollama/Supabase 실행은 환경 변수가 없어 미검증이다. | -| GAP-I18N-01 | i18n | 로케일별 키 수가 크게 어긋난다. 2026-09-21 실측: `ko` 1716 / `en` 1709 / 나머지 10개 로케일 각 327. `keybinding.*` 55개는 12개 로케일 전부에 동일하게 들어갔지만, 그 밖 약 1,380개 키가 비영어 로케일에 없어 폴백 체인(locale → `en` → `ko`)으로 표시된다. 키바인딩 작업 이전부터 있던 부채이며 그 작업 범위 밖이었다. | `packages/i18n/src/locales/*.json`, `scripts/ci/sync-i18n-locales.mjs`, `apps/desktop/tests/main/services/i18n-locale-parity.test.ts` | `[x]` 2026-10-30: `scripts/ci/sync-i18n-locales.mjs`로 12개 로케일(`ko`, `en`, `ja`, `zh`, `zh-TW`, `es`, `fr`, `de`, `pt`, `ru`, `vi`, `th`) 전체를 2,716개 마스터 키로 100% 동기화하고, `i18n-locale-parity.test.ts`(15/15 통과)로 키 누락 회귀를 차단했다. | +| GAP-QA-04 | Desktop QA | updater의 native consent/restart dialogs는 로케일·분기 자동화만 있고 packaged GUI 외형/상호작용 증거가 없었다. | `apps/desktop/src/main/update-dialog-preview.ts`, `src/main/index.ts`, `tests/main/{update-dialog-preview,index-update-dialog-preview}.test.ts` | `[~]` 2026-11-04: 명시적 `--preview-update-dialogs` 실행은 protocol/single-instance/bootstrap/updater/feed/download/install/settings 경로를 건너뛰고 실제 prompter의 네 다이얼로그만 순서대로 띄운 뒤 종료한다. current-source package와 native ABI, entry/prompt tests는 통과했다. 남은 게이트는 interactive desktop의 external terminal에서 packaged executable을 이 인자로 실행해 네 다이얼로그의 문구·버튼·required/optional 동작을 눈으로 확인하는 것이다. | +| GAP-I18N-01 | i18n | 로케일별 키 수가 크게 어긋난다. 2026-09-21 실측: `ko` 1716 / `en` 1709 / 나머지 10개 로케일 각 327. `keybinding.*` 55개는 12개 로케일 전부에 동일하게 들어갔지만, 그 밖 약 1,380개 키가 비영어 로케일에 없어 폴백 체인(locale → `en` → `ko`)으로 표시된다. 키바인딩 작업 이전부터 있던 부채이며 그 작업 범위 밖이었다. | `packages/i18n/src/locales/*.json`, `scripts/ci/sync-i18n-locales.mjs`, `apps/desktop/tests/main/services/i18n-locale-parity.test.ts` | `[x]` 2026-10-30: `scripts/ci/sync-i18n-locales.mjs`로 12개 로케일(`ko`, `en`, `ja`, `zh`, `zh-TW`, `es`, `fr`, `de`, `pt`, `ru`, `vi`, `th`) 전체를 동기화하고 키 누락 회귀를 차단했다. **2026-11-04:** updater dialog 16키 추가 후 2,742개 마스터 키, `i18n-locale-parity.test.ts` 15/15 통과. 표면별 언어 노출은 별도 `GAP-I18N-03`으로 추적한다. | | GAP-I18N-02 | i18n | 렌더러가 `ko.json` 에 없는 `license.*` 키를 쓴다. `TranslationKey` 가 `ko.json` 에서 파생되므로 누락은 타입 에러로 드러난다. 타입 에러로만 끝나지 않는다 — 폴백 체인이 `locale → en → ko → 키 문자열` 이므로 마스터 로케일에도 없으면 **`license.team` 같은 키가 화면에 그대로 노출된다**. 2026-09-21 실측: `license.feature.premium_llm`·`license.team`·`license.enterprise` 가 없고 이로 인한 TS2345 가 4건이다. HEAD 에서도 없던 키이므로 선재 결함이며 키바인딩 작업과 무관하다. | `apps/desktop/src/renderer/components/UpgradePromptModal.tsx:47`·`:192`, `apps/desktop/src/renderer/pages/DashboardPage.tsx:481`·`:529`, `packages/i18n/src/locales/ko.json` | `[x]` 2026-09-28: 세 키 + `license.feature.cloud_sync`·`team_workspace` 를 ko·en 에 추가하고, 문자열 조립 대신 `renderer/utils/display-labels.ts`(featureLabelKey·tierLabelKey) 타입 매핑으로 바꿔 누락이 컴파일 오류가 되게 했다. `LicenseTab`·`LicenseModal` 의 TFunction TS2322 와 `currentTier` 미정의(팀·엔터프라이즈에서 설정 화면이 멈추던 결함)도 수정. 12개 로케일 전체 동기화 완료(GAP-UX-07, GAP-I18N-01). | | GAP-LLM-01 | LLM | **번역 대상 언어를 사용자가 고를 수 없다.** 항상 `English` 고정이다. `AppConfig` 에 대상 언어 키가 없고, 기존 두 키 모두 대용할 수 없다 — `language` 는 UI 로케일이라 `'ko'` 같은 코드가 프롬프트에 그대로 들어가 문장이 깨지고, `sttLanguage` 는 입력(원문) 언어라 그 값으로 번역하면 원문이 그대로 나온다. 2026-09-21 LLM 수정(`9c2b4d4`)은 대상 언어가 호출 프레임 두 단계 밖의 기본값에 의존하던 것을 명시 인자로 바로잡았을 뿐, 선택지를 만들지는 않았다(설정 키 + 설정 UI + i18n 이 필요해 patch 범위 밖으로 뒀다). | `packages/core/src/types.ts`(`AppConfig.targetLanguage`), `ConfigService.ts`, `llm-prompts.ts`(`SUPPORTED_TARGET_LANGUAGES`, `resolveTargetLanguage`), `SettingsModal.tsx`, `tests/main/services/llm-prompts.test.ts` | `[x]` 2026-10-30: `AppConfig.targetLanguage`(기본값 `'English'`)를 추가하고, `resolveTargetLanguage(explicit)`가 설정값을 읽도록 연결했으며, `SettingsModal.tsx` 후처리 섹션에 12개 번역 대상 언어 선택 드롭다운과 12개 로케일 번역 키(`settings.targetLanguage.*`)를 추가했다 (`llm-prompts.test.ts` 43/43, `i18n-locale-parity.test.ts` 15/15 통과). | | GAP-LLM-02 | LLM | **2026-09-21 LLM 지시문 수정(`9c2b4d4`)이 실앱 구동으로 검증되지 않았다.** 유닛 테스트는 통과하지만(`llm-prompts.test.ts` 21, `llm-handlers.test.ts` 7, `VoiceModeService.test.ts` 22, `ChainService.test.ts` 5 — 수정 4건을 각각 되돌려 실제로 실패하는 것까지 확인), 실행 중인 Electron 에서 실제 지시문을 돌려 결과가 삽입되는 것을 본 적이 없다. 에이전트는 데스크톱 GUI 를 띄울 수 없다(`AGENTS.md` §3). **게다가 이 수정과 직접 관련된 usecase 테스트 4개가 실행조차 되지 않았다** — `tests/red/{instruction,chain,voice,config}.usecase.test.ts` 가 `better-sqlite3` ABI 불일치로 DB 생성 단계에서 먼저 죽는다(GAP-INFRA-06). 즉 그 범위는 통과도 실패도 아닌 **미검증**이다. 영향 받는 카탈로그 행: AI-04, AI-05, AI-06, AI-07(전부 데스크톱 `[~]`). | `apps/desktop/src/main/services/llm-prompts.ts`, `VoiceModeService.ts:779`·`:827-870`, `ChainService.ts:196`, `src/main/ipc/llm-handlers.ts:96`, `src/renderer/pages/CommandsPage.tsx:180-205` | **2026-10-30:** `rebuild:test`·`harness.ts` 격리로 `tests/red/{instruction,chain,voice,config}.usecase.test.ts` 4종이 모두 실행·통과함을 확인했다. 남은 것은 사용자가 `run-desktop.bat` 로 앱을 띄워 실제 받아쓰기 삽입을 눈으로 확인하는 수동 검증뿐이다. | @@ -119,8 +125,9 @@ Legend: `[ ]` open · `[~]` in progress · `[!]` blocked externally · `[x]` res | GAP-SYNC-05 | Sync | **Not yet in production.** Migration `20260927000034` is applied only to the local stack; the rewritten desktop sync ships with the next desktop release. Until the migration is deployed, desktop tombstone pulls and template RPCs fail against production (they are isolated per step, other entities keep syncing). | migration file, `apps/desktop/src/main/services/sync/` | `[~]` 2026-09-27: production `supabase db push` applied `0029`–`0035` (backup dump taken first; see GAP-OPS-01), all 23 Edge Functions redeployed, v1.7.0 published (runtime/portable first, then the updater feed) and installed on the owner PC. **Remaining:** the desktop on that PC is in local mode — one Google sign-in in Settings > Cloud, then edit/delete on the phone and confirm the desktop updates within seconds and appears under Devices. | | GAP-SYNC-06 | Sync | Still desktop-local (not mirrored): knowledge base (desktop local RAG embeddings vs cloud pgvector — different embedding spaces), audio (desktop WAV files vs mobile Storage uploads), `user_settings` (locale, auto-polish, active command), desktop preset-command prompt edits, meeting `transcripts` segments (desktop uses `raw_transcript`, which mobile also fills). | `docs/map/10-feature-catalog.md` MEM-09/MEM-05/SHELL rows | `[x]` 2026-09-27: knowledge docs sync as source text and are re-embedded per surface; recordings upload to the mobile storage contract (≤50 MiB per file, opt-out toggle) and remote recordings play through signed URLs; `user_settings` maps the shared fields. 2026-09-27 (later): the two items first left out are done too — meeting `transcripts` segments are rebuilt from the desktop transcript (the phone renders segments before `edited_transcript`, so desktop edits were invisible there) and preset prompt edits reach the phone through `sync_set_builtin_instruction_prompt_v1` (migration `0036`, production applied; `tests/main/sync/SyncTranscriptsPresets.test.ts` (4) + local-stack integration case "전사 구간·프리셋"). Evidence: `tests/main/sync/SyncExtensions.test.ts` (9) + integration case "지식 문서·설정·녹음" against the local Supabase stack. | | GAP-SYNC-07 | Sync | `sync_tombstones` grows without a schedule. `prune_sync_tombstones_v1(interval)` (service_role) exists; nothing calls it. | migration §1 | `[x]` 2026-09-27: migration `0035` enables `pg_cron` and schedules `prune-sync-tombstones` daily at 03:17 UTC (production `cron.job` active=true). A client whose cursor is older than 180 days must fall back to a full resync. | +| GAP-SYNC-08 | Sync | Meeting memo conflict detection compares mutable content plus timestamp/creation fields instead of an immutable revision. An A→B→A edit can return to the same compared values and evade stale-client detection; the shared `MeetingMemo` type has no `updated_at` or revision field. | `packages/api-client/src/types.ts` `MeetingMemo`, `apps/mobile-rn/src/features/meetings/meetings-service.ts` `updateMeetingMemoConflictSafe`/`deleteMeetingMemoConflictSafe` | `[ ]` Add a DB revision (preferred) or reliable `updated_at` CAS contract, regenerate shared types, and prove concurrent update/delete plus A→B→A against a local Supabase stack before changing the completion status. | -| GAP-OPS-01 | Ops | **Production Supabase was five migrations behind** (`0029` content reporting, `0030` profile column ACL — users could raise their own `role`/`tier` through PostgREST, `0031` audit-log actor unlink, `0032` meeting-document reporting, `0033` team activity feed) and `content-report` was never deployed, while the map listed those features GREEN from local runs. Most functions still ran the 2026-08-21 build. | `server/supabase/migrations/`, `scripts/ci/check-supabase-migrations.mjs` | `[x]` 2026-09-27: schema+data dump taken, `db push` applied `0029`–`0035`, all functions redeployed (unauthenticated calls return 401, i.e. live and gated); `authenticated` can no longer UPDATE `profiles.tier`; real-account export returns exactly the v1 keys. **2026-10-30:** `scripts/ci/check-supabase-migrations.mjs` (`npm run check:migrations:test`, 73 migrations + self-test PASS) added to enforce migration ordering, naming, and optional linked remote drift detection. | +| GAP-OPS-01 | Ops | **Production Supabase was five migrations behind** (`0029` content reporting, `0030` profile column ACL — users could raise their own `role`/`tier` through PostgREST, `0031` audit-log actor unlink, `0032` meeting-document reporting, `0033` team activity feed) and `content-report` was never deployed, while the map listed those features GREEN from local runs. Most functions still ran the 2026-08-21 build. | `server/supabase/migrations/`, `scripts/ci/check-supabase-migrations.mjs` | `[x]` 2026-09-27: schema+data dump taken, `db push` applied `0029`–`0035`, all functions redeployed (unauthenticated calls return 401, i.e. live and gated); `authenticated` can no longer UPDATE `profiles.tier`; real-account export returns exactly the v1 keys. **2026-11-04 boundary:** file checker는 73개 파일의 self-test/order/name/duplicate/non-empty만 다룬다. 별도 격리 로컬 stack의 empty/reset replay와 `pg-delta` shadow diff는 통과했지만 linked remote migration state/drift는 재검증하지 않았다. | | GAP-STT-01 | Cloud STT | A 5 s phone recording took ~66 s and ended on the phone's tiny local model (2026-09-27). Chain: the gateway's first endpoint (laptop GPU 192.168.0.227) is off (3 s), the NAS CPU Whisper (2 cores, load ~7) needs 30–90 s for 3 s of audio, and `stt-proxy` waited up to 60 s for the gateway. The direct OpenAI fallback **never worked**: the production `OPENAI_API_KEY` secret is not a valid header value (invisible/non-ASCII characters — `TypeError: headers … not a valid ByteString`), and whisper-1 `verbose_json` reports the language by name, which the result contract rejected. The same key backs `embed-chunks`, `search-knowledge` and `realtime-token`. | `server/supabase/functions/{stt-proxy,_shared/stt-contract.ts,_shared/provider-key.ts}` | `[!]` 2026-09-27 code fixed and deployed: gateway wait = 5 s + clip length (max 30 s) when a direct provider exists, provider language names mapped to codes, keys stripped of BOM/zero-width characters (still-invalid keys count as not configured), fail-closed responses list per-provider failures (`attempts`). **External:** re-enter a valid `OPENAI_API_KEY` (or add `GROQ_API_KEY`) in Supabase function secrets, or keep the GPU endpoint online; until then cloud STT runs on the NAS CPU (~30 s for a short clip). | --- @@ -130,16 +137,16 @@ These are the mobile SSOT rows still `[ ]` / `[~]`. Do not duplicate the full te | Group | Open rows | Theme | |---|---|---| -| G (governance) | G-002, G-006, G-007, G-008, G-009, G-010, G-011 | Type/error/identity consolidation, legacy bundle separation, credential rotation | +| G (governance) | G-008..G-011; G-006/G-007 `[~]` | 2026-11-04 route/push contract typing and Talk logger improved; remaining type/error/identity consolidation, legacy bundle separation, credential rotation | | A (auth/account) | A-001..A-013, A-018; A-014..A-017 `[~]` | Session restore, signup, deep links, OAuth, profile, provider E2E | -| O (onboarding/a11y) | O-002..O-007, O-009, O-011; O-001 `[~]`, O-008/O-010/O-012 `[~]` | O-001 2026-11-01: `.2` Fold6 fresh auth/signup/small-screen PASS; latest `.3` fresh-auth/retry FAILED (onboarding visibility), 회귀 테스트 추가(`apps/mobile-rn/.maestro-output/fold6-20261101-fix1/`). Remaining: permissions, tutorial; app-wide theme coverage, TalkBack/font-scale/rotation; full-app ko/en audit | +| O (onboarding/a11y) | O-002..O-007, O-009, O-011; O-001 `[~]`, O-008/O-010/O-012 `[~]` | O-001 2026-11-01: `.2` Fold6 fresh auth/signup/small-screen PASS; latest `.3` fresh-auth/retry FAILED (onboarding visibility), 회귀 테스트 추가(`apps/mobile-rn/.maestro-output/fold6-20261101-fix1/`). 2026-11-04 current-source E2E upgrade/launch, inspected-route UIA labels/48dp, and AVD font-scale 2.0 + rotation/scroll passed. Remaining: permission journeys/tutorial, app-wide theme/a11y, manual TalkBack/focus order and SDK AdMob descendant, iOS, full-app ko/en audit ([evidence](../evidence/2026-11-04-mobile-runtime-a11y.md)) | | D (data/sync/offline) | D-001..D-014 | Schema/RLS, devices, cross-surface read/write, offline queue, conflict policy | | R (record/transcribe) | R-001..R-009, R-011..R-015, R-017..R-020; R-016 `[x]` | Permissions, recorder, FGS, upload queue, job state, sharing | | H (history/meetings) | H-001..H-005, H-007..H-010, H-012..H-015; H-006/H-011/H-016 `[x]` | Pagination, filters, detail, meeting timeline/docs/diarization/cross-app | | F (feature parity) | F-003..F-010, F-013, F-014; F-001 `[~]`; F-002/F-011/F-012 `[x]` | Mobile Home dashboard subset, commands/actions/chat/conversation/knowledge | | T (teams/admin/notify) | T-001..T-005, T-009..T-012; T-006..T-008, T-013 `[x]` | Team CRUD/roles, push delivery/deep links, notification settings | | M (monetization) | M-025, M-027; M-013 `[~]` | Play Billing license test, Payple webhook signature | -| Q (quality/release) | Q-012..Q-014, Q-019, Q-020, Q-022, Q-026; Q-010/Q-011/Q-021/Q-023/Q-027/Q-028 `[~]` | Emulator scripts, OAuth/billing E2E, full journey; TalkBack/font-scale/rotation, env unification, production AAB | +| Q (quality/release) | Q-012..Q-014, Q-019, Q-020, Q-022, Q-026; Q-010/Q-011/Q-021/Q-023/Q-027/Q-028 `[~]` | Current-source Fold6/API 34 state-preserving install, cold launch, Notifications cards, and bounded crash/UIA/font-scale/rotation automation are GREEN. Remaining: OAuth/billing/full journey; manual TalkBack and permission/FCM transitions, app-wide visual coverage, iOS, env unification, production AAB ([evidence](../evidence/2026-11-04-mobile-runtime-a11y.md)) | --- @@ -155,7 +162,7 @@ These are the mobile SSOT rows still `[ ]` / `[~]`. Do not duplicate the full te | EXT-PLAY-04 | Closed test 0/12 members, 14 days; production access disabled | Run closed test, request production | SSOT EXT-010 | | EXT-OAUTH-01 | GitHub/Apple provider secrets; real mobile Google consent→callback | Configure providers, verify consent | SSOT EXT-001 | | EXT-APPSIGN-01 | Live App Links still old certificate | Deploy updated `assetlinks.json`, re-verify live | SSOT App Links row | -| EXT-PHYS-01 | Physical Fold6 install/OAuth/purchase evidence | User runs the artifact on device | SSOT EXT-009 | +| EXT-PHYS-01 | Physical Fold6 share/OAuth/purchase and production-artifact evidence | Current-source E2E upgrade install/cold launch passed on 2026-11-04 without clearing data. Run real file share, OAuth, purchase/restore, and later the signed production artifact on device | SSOT EXT-009; [2026-11-04 evidence](../evidence/2026-11-04-mobile-runtime-a11y.md) | | EXT-PAY-01 | Payple live history + webhook signature verification | Provider contract + signature scheme | SSOT M-027 | | EXT-STRIPE-01 | ~~Production Stripe/Payple cross-verification~~ | **삭제됨 2026-09-26** — Stripe 제거. Payple 라이브 검증은 EXT-PAY-01 | SSOT M-013 | | EXT-STT-01 | Production provider keys (Groq/OpenAI/Deepgram/Gemini) | Inject provider secrets | `apps/api-server/Program.cs` env docs | @@ -191,7 +198,7 @@ These are the mobile SSOT rows still `[ ]` / `[~]`. Do not duplicate the full te - **Desktop key bindings (CAP-16):** rewritten onto one SSOT with multiple bindings per action and mouse-button support; **verified on Windows** by a manual run on 2026-09-21 and unit-tested in `KeyBindingService.test.ts` (11/11) + `voice-intent.test.ts` (19/19) (GAP-KEY-01 `[x]`, GAP-KEY-03 `[x]`). macOS/Linux mouse behavior is still unconfirmed (GAP-KEY-02). -- **Web console:** yes, feature-complete for server-shared data; knowledge upload/search, team feed, browser invite acceptance (`/app/accept-invite`), audio-transcript seek sync, and Web Push registration (`sw.js`) implemented. +- **Web console:** server-shared data flows include knowledge upload/search, team feed, browser invite acceptance (`/app/accept-invite`), and audio-transcript seek sync. Web Push has a production sidebar call site, stable web-device binding, register/unregister cleanup, and a packaged service worker, but remains partial until matching VAPID/provider configuration and real-browser delivery evidence (`GAP-PUSH-03`). - **Mobile:** code complete for most flows and tested locally; blocked mainly by external store/console gates, plus a11y and some E2E depth. - **Backend:** fail-closed AI proxies, RLS, billing, ads SSV implemented; push transports (FCM + webpush + APNs) and cron drain implemented. - **Admin:** complete with deliberate "unavailable" states; `/support` upgraded to a live `content_reports` & support management console (GAP-SHELL-01 `[x]`). @@ -204,7 +211,7 @@ Actionable checklist for the work started this session. Fields to fill are blank `.env` (git-ignored) and mirrored in `.env.example`. **Push — server (code done, config pending)** -- [ ] Set Supabase Edge secrets for the transports you deploy: `WEBPUSH_VAPID_PUBLIC_KEY`, `WEBPUSH_VAPID_PRIVATE_KEY`, `WEBPUSH_SUBJECT` (web); `APNS_KEY_ID`, `APNS_TEAM_ID`, `APNS_PRIVATE_KEY`, `APNS_TOPIC`, `APNS_ENVIRONMENT` (iOS); `FCM_SERVICE_ACCOUNT_JSON`, `FCM_PROJECT_ID` (Android). +- [ ] Set Supabase Edge secrets for the transports you deploy: `WEBPUSH_VAPID_PUBLIC_KEY`, `WEBPUSH_VAPID_PRIVATE_KEY`, `WEBPUSH_SUBJECT` (web); `APNS_KEY_ID`, `APNS_TEAM_ID`, `APNS_PRIVATE_KEY`, `APNS_TOPIC`, `APNS_ENVIRONMENT` (iOS); `FCM_SERVICE_ACCOUNT_JSON`, `FCM_PROJECT_ID` (Android). Bake the same public VAPID value into the web image as `NEXT_PUBLIC_VAPID_PUBLIC_KEY`; never expose the private key as `NEXT_PUBLIC_*`. - [ ] Deploy the updated `send-push` (`supabase functions deploy send-push`). - [ ] Generate a VAPID keypair (P-256) and store the private/public pair; subject must be `mailto:` or `https:`. - [ ] Create the APNs `.p8` key in the Apple Developer portal and record Key ID + Team ID. @@ -216,7 +223,7 @@ Actionable checklist for the work started this session. Fields to fill are blank - [ ] Verify end-to-end: enqueue a test event (e.g. team invite) → drain → delivery row `delivered`. **Push — clients** -- [x] Web: add a service worker + `pushManager.subscribe`, store the JSON subscription as the registration id, register `provider: 'webpush'`. (GAP-PUSH-03 — `apps/web/public/sw.js` + `apps/web/src/lib/web-push.ts`) +- [~] Web: production sidebar opt-in/out uses the packaged service worker, a stable active web device, `pushManager.subscribe`, device-bound RPCs, disabled-intent reconciliation, bounded local/server cleanup, and non-blocking logout. Isolated local provider acceptance is proven; production authenticated permission/subscription, rendered desktop/mobile accessibility/hit-target evidence, scheduled drain, and browser receipt remain open. (GAP-PUSH-03 — `apps/web/public/sw.js`, `apps/web/src/lib/{web-device,web-push,web-push-session}.ts`, `apps/web/src/components/layout/web-push-control.tsx`) - [x] iOS: register the APNs device token with `provider: 'apns'`. (GAP-PUSH-03 — `apps/mobile-rn/src/features/notifications/notification-service.ts`) - [ ] Android: decide FCM vs UnifiedPush/ntfy. (GAP-PUSH-04) diff --git a/memory/project_status.md b/memory/project_status.md index 4a5beb7..ce676f4 100644 --- a/memory/project_status.md +++ b/memory/project_status.md @@ -1,5 +1,13 @@ # D3RO-VOICE 프로젝트 현황 +## 학습 어휘를 회의록 전사 교열에 연결 (2026-11-05) + +- 사용자 보고: "키보드로 치는 건 다 학습하는데 회의록 전사에 활용을 못 한다, 전사가 엉망". +- 규명된 원인 5가지: (1) 자막/회의 STT는 `다음은 한국어 대화입니다.` 고정 힌트만 사용(사전·학습 어휘는 받아쓰기 경로에만 있었음), (2) 개인 어휘(`personal_phrases`)는 입력 제안(`SuggestionService`/`PersonalNgramIndex`)에만 연결, (3) 교열 프롬프트에 용어 블록 없음, (4) `CaptionService`의 다듬기 결과가 회의 세션·렌더러로 전달되지 않아 저장 전사는 원문 그대로, (5) `rawTranscript`는 원문 세그먼트 단순 결합. +- 해결: 새 SSOT `packages/core/src/transcript-correction.ts`(글로서리·사전 변형 치환·1자모 학습 어절 교정·LLM 참고 블록) + `TranscriptGlossaryService`(사전+개인 문구 15초 캐시, 사전 변경 시 즉시 무효화, 실패 시 빈 어휘) 를 `CaptionService`(매 인식 힌트·확정 줄 교정·교열 프롬프트·`segment-updated`), `MeetingRecordingSession`/`MeetingModeService`(`meetingMode:segmentUpdated`로 회의 세션·화면 갱신, auto-polish에 용어 블록), `FileTranscriptionService`(조각별 힌트·교정), `VoiceModeService`(학습 어절 패스)에 배선. +- 교정 안전 규칙: 사용자가 실제로 쓴 어절은 절대 변경하지 않고, 후보가 동률이면 고치지 않으며, 조사는 그대로 두고 어절만 바꾼다. +- 검증: core `transcript-correction.test.ts` 16, 데스크톱 `transcript-glossary.test.ts` 9, 데스크톱 offline 전체(2788)에서 드러난 회귀 2건을 수정해 재통과, workspace typecheck·변경 파일 ESLint·`test:hygiene` GREEN. 실회의 실측은 `GAP-MTG-04`로 남김. + ## v1.9.0 — 전사 구간·프리셋 프롬프트 동기화 (2026-09-27) - "일부러 동기화 안 함"으로 두었던 두 가지도 구현(사용자: "모두 마무리"). 커밋 08c6504(0036) 2aac10f(데스크톱) 796916b(v1.9.0). diff --git a/packages/core/__tests__/transcript-correction.test.ts b/packages/core/__tests__/transcript-correction.test.ts new file mode 100644 index 0000000..e6bd0b5 --- /dev/null +++ b/packages/core/__tests__/transcript-correction.test.ts @@ -0,0 +1,160 @@ +// packages/core/__tests__/transcript-correction.test.ts +// 학습 어휘(사전 + 개인 문구)가 STT 힌트·결정적 교정·LLM 교열 참고로 바뀌는 규칙. + +import { describe, expect, it } from 'vitest' +import { + appendGlossaryHint, + buildGlossaryPromptSection, + buildTranscriptGlossary, + correctLearnedTerms, + replaceDictionaryTerms, + splitGlossaryVariants, + type GlossaryPhrase, +} from '../src/transcript-correction' + +function phrases(...items: Array<[string, number]>): GlossaryPhrase[] { + return items.map(([text, count]) => ({ text, count })) +} + +describe('buildTranscriptGlossary', () => { + it('사전 용어와 학습 어절을 STT 힌트로 만든다', () => { + const glossary = buildTranscriptGlossary({ + dictionary: [{ word: 'D3RO', pronunciation: '디에로' }], + phrases: phrases(['회의록 정리해줘', 5]), + }) + + expect(glossary.promptHint).toContain('D3RO') + expect(glossary.promptHint).toContain('회의록') + expect(glossary.dictionary[0]).toEqual({ word: 'D3RO', variants: ['디에로'] }) + }) + + it('한 번 쓴 어절은 교정 후보로 쓰지 않는다', () => { + const glossary = buildTranscriptGlossary({ phrases: phrases(['회의록 정리해줘', 1]) }) + + expect(glossary.vocabulary.has('회의록')).toBe(false) + expect(glossary.vocabulary.has('정리해줘')).toBe(false) + }) + + it('기능어는 힌트와 교정 후보에서 뺀다', () => { + const glossary = buildTranscriptGlossary({ phrases: phrases(['그래서 회의록 정리', 9]) }) + + expect(glossary.vocabulary.has('그래서')).toBe(false) + expect(glossary.promptHint).not.toContain('그래서') + }) + + it('힌트는 길이 한도 안에서 만든다', () => { + const longWords = Array.from({ length: 80 }, (_, i) => `용어${String(i).padStart(2, '0')}`) + const glossary = buildTranscriptGlossary({ + dictionary: longWords.map((word) => ({ word, pronunciation: null })), + }) + + expect(glossary.promptHint.length).toBeLessThanOrEqual(250) + expect(glossary.promptHint.endsWith('.')).toBe(true) + }) + + it('아무 정보도 없으면 빈 힌트를 돌려준다', () => { + const glossary = buildTranscriptGlossary({}) + + expect(glossary.promptHint).toBe('') + expect(glossary.vocabulary.size).toBe(0) + expect(buildGlossaryPromptSection(glossary)).toBe('') + }) +}) + +describe('splitGlossaryVariants', () => { + it('발음 문자열을 변형 목록으로 나누고 정본 표기는 뺀다', () => { + expect(splitGlossaryVariants('디에로, 디로 / D3RO', 'D3RO')).toEqual(['디에로', '디로']) + expect(splitGlossaryVariants(null, 'D3RO')).toEqual([]) + }) +}) + +describe('replaceDictionaryTerms', () => { + it('발음 변형을 정본 표기로 바꾸고 치환 내역을 남긴다', () => { + const result = replaceDictionaryTerms('디에로 보이스 좋네요', [ + { word: 'D3RO', pronunciation: '디에로' }, + ]) + + expect(result.text).toBe('D3RO 보이스 좋네요') + expect(result.changes).toEqual([{ from: '디에로', to: 'D3RO', source: 'dictionary' }]) + expect(result.matched).toEqual(['D3RO']) + }) + + it('영단어 정본은 다른 단어 안쪽을 건드리지 않는다', () => { + const result = replaceDictionaryTerms('D3ROVoice 와 디에로', [ + { word: 'D3RO', pronunciation: '디에로' }, + ]) + + expect(result.text).toBe('D3ROVoice 와 D3RO') + }) +}) + +describe('correctLearnedTerms', () => { + const glossary = buildTranscriptGlossary({ + phrases: phrases(['회의록 정리해줘', 6], ['전사 교정', 4]), + }) + + it('1자모 차이 나는 전사 어절을 학습 어절로 되돌린다', () => { + const result = correctLearnedTerms('회이록 정리해줘', glossary) + + expect(result.text).toBe('회의록 정리해줘') + expect(result.corrections).toEqual([{ from: '회이록', to: '회의록', source: 'learned' }]) + }) + + it('조사는 붙인 채로 어절만 고친다', () => { + expect(correctLearnedTerms('회이록은 좋다', glossary).text).toBe('회의록은 좋다') + }) + + it('사용자가 실제로 쓴 어절은 건드리지 않는다', () => { + const result = correctLearnedTerms('회의록 정리해줘', glossary) + + expect(result.text).toBe('회의록 정리해줘') + expect(result.corrections).toEqual([]) + }) + + it('후보가 둘 이상이면(동률) 고치지 않는다', () => { + const tied = buildTranscriptGlossary({ + phrases: phrases(['정리해', 4], ['정리히', 4]), + }) + + expect(correctLearnedTerms('정리하', tied).text).toBe('정리하') + }) + + it('어휘가 없으면 원문을 그대로 돌려준다', () => { + const result = correctLearnedTerms('아무 말이나 적는다', buildTranscriptGlossary({})) + + expect(result).toEqual({ text: '아무 말이나 적는다', corrections: [] }) + }) + + it('사전 정본 표기가 학습 어절보다 우선한다', () => { + const withDictionary = buildTranscriptGlossary({ + dictionary: [{ word: '회의록', pronunciation: null }], + phrases: phrases(['회의녹 정리', 9]), + }) + + expect(correctLearnedTerms('회이록 정리', withDictionary).text).toBe('회의록 정리') + }) +}) + +describe('LLM 교열 참고 블록', () => { + it('사전 용어와 사용자 표현을 지시와 함께 넣는다', () => { + const glossary = buildTranscriptGlossary({ + dictionary: [{ word: 'D3RO', pronunciation: '디에로' }], + phrases: phrases(['오늘 회의는 세 시에 시작합니다', 3]), + }) + const section = buildGlossaryPromptSection(glossary) + + expect(section).toContain('[사용자 용어') + expect(section).toContain('D3RO (다르게 들리면: 디에로)') + expect(section).toContain('[사용자가 실제로 쓰는 표현') + expect(section).toContain('오늘 회의는 세 시에 시작합니다') + }) + + it('STT 힌트는 기존 문맥 뒤에 붙는다', () => { + const glossary = buildTranscriptGlossary({ dictionary: [{ word: 'Whisper' }] }) + + expect(appendGlossaryHint('다음은 한국어 대화입니다.', glossary)).toBe( + '다음은 한국어 대화입니다. 용어: Whisper.', + ) + expect(appendGlossaryHint('', buildTranscriptGlossary({}))).toBe('') + }) +}) diff --git a/packages/core/package.json b/packages/core/package.json index ce7da85..926c86c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -58,6 +58,10 @@ "types": "./src/caption-streaming.ts", "default": "./src/caption-streaming.ts" }, + "./transcript-correction": { + "types": "./src/transcript-correction.ts", + "default": "./src/transcript-correction.ts" + }, "./meeting-transcript": { "types": "./src/meeting-transcript.ts", "default": "./src/meeting-transcript.ts" diff --git a/packages/core/src/ipc-channels.ts b/packages/core/src/ipc-channels.ts index e99f380..32e86eb 100644 --- a/packages/core/src/ipc-channels.ts +++ b/packages/core/src/ipc-channels.ts @@ -382,6 +382,7 @@ export const IPC_CHANNELS = { // Main → Renderer events STATE_CHANGED: 'meetingMode:stateChanged', SEGMENT: 'meetingMode:segment', + SEGMENT_UPDATED: 'meetingMode:segmentUpdated', PROCESSING_PROGRESS: 'meetingMode:processingProgress', SESSION_COMPLETED: 'meetingMode:sessionCompleted', DOC_GENERATING_PROGRESS: 'meetingMode:docGeneratingProgress', diff --git a/packages/core/src/transcript-correction.ts b/packages/core/src/transcript-correction.ts new file mode 100644 index 0000000..981b195 --- /dev/null +++ b/packages/core/src/transcript-correction.ts @@ -0,0 +1,452 @@ +// packages/core/src/transcript-correction.ts +// 학습한 사용자 어휘(사전 + 개인 문구)를 전사 교열에 쓰는 정본. +// +// 왜 필요한가: +// - 사용자가 키보드로 친 문장은 개인 그래프(personal_phrases)에 쌓이지만, 그 어휘는 입력 제안에만 +// 쓰이고 회의록·자막 전사에는 한 번도 닿지 않았다. 그래서 Whisper 가 같은 이름·용어를 매번 +// 다르게 받아 적어도 앱이 배운 것을 활용하지 못했다. +// - 이 모듈은 그 어휘를 3가지 형태로 바꾼다. +// 1) promptHint : STT initial_prompt 에 넣는 용어 힌트 (인식 단계에서 미리 편향) +// 2) vocabulary : 전사된 어절을 학습 어휘로 되돌리는 결정적 교정 (LLM 없이 0ms) +// 3) promptSection: LLM 교열 프롬프트에 넣는 용어·문체 참고 블록 +// +// 순수 함수만 둔다. DB·Electron 을 모르므로 데스크톱 서비스가 소스를 주입한다. + +import { decomposeHangul, editDistance, tokenizeWords } from './typo-correction' + +/** 사용자 사전 한 항목 */ +export interface GlossaryDictionaryEntry { + word: string + /** 발음·오인식 변형 (쉼표·슬래시·세미콜론 구분) */ + pronunciation?: string | null +} + +/** 개인 그래프에서 배운 문구 한 건 */ +export interface GlossaryPhrase { + text: string + count: number +} + +export const TRANSCRIPT_GLOSSARY_LIMITS = { + /** 사전 항목 상한 */ + dictionaryEntries: 300, + /** 학습 문구 상한 */ + phrases: 400, + /** STT 힌트에 넣는 용어 수 */ + promptTerms: 40, + /** STT 힌트 최대 길이 (자) */ + promptChars: 240, + /** 교정 어휘 상한 */ + vocabularyTerms: 500, + /** 학습 어절을 교정 후보로 인정하는 최소 빈도 */ + minLearnedCount: 3, + /** LLM 교열 프롬프트에 보여 줄 사용자 표현 수 */ + refineExamples: 8, +} as const + +/** + * 힌트·교정 어휘에서 빼는 흔한 기능어. + * 전사 편향만 만들고 실제 오인식 교정에는 도움이 되지 않는다. + */ +const STOP_WORDS: ReadonlySet = new Set([ + '그리고', '그래서', '그런데', '그러면', '그러니까', '하지만', '그치만', '근데', + '저는', '제가', '저희', '우리', '너는', '니가', '네가', + '이거', '그거', '저거', '이건', '그건', '저건', '이런', '그런', '저런', + '지금', '이제', '아직', '다시', '일단', '먼저', '나중에', + '정말', '진짜', '너무', '많이', '조금', '약간', '좀더', '아주', + '하는', '해서', '하면', '하고', '해요', '합니다', '입니다', '있어', '없어', + '있습니다', '없습니다', '같아', '같은', '것은', '것을', '수가', '수도', + '이렇게', '그렇게', '저렇게', '여기', '거기', '저기', +]) + +/** 토큰에서 떼어 낼 수 있는 조사 (긴 것부터) */ +const JOSA_SUFFIXES: readonly string[] = [ + '이라는', '이라고', '이라도', '에서는', '에게는', '에서도', '으로는', '으로써', + '에서는', '부터', '까지', '에게', '한테', '에서', '으로', '라고', '라는', + '이나', '라도', '이랑', '하고', '이고', '이든', '처럼', '보다', '만큼', + '에는', '에도', '께서', '이란', '이라', + '은', '는', '이', '가', '을', '를', '에', '의', '로', '도', '와', '과', '만', '들', +] + +export interface TranscriptGlossary { + /** 사전 정본 단어 (원표기) */ + terms: readonly string[] + /** 사전 정본 단어 + 발음 변형 */ + dictionary: readonly { word: string; variants: readonly string[] }[] + /** 소문자 어절 → 빈도 (교정 후보) */ + vocabulary: ReadonlyMap + /** 사용자가 실제로 쓰는 표현 (문체 참고) */ + examples: readonly string[] + /** STT initial_prompt 힌트 (없으면 빈 문자열) */ + promptHint: string +} + +export interface TranscriptCorrectionEntry { + from: string + to: string + source: 'dictionary' | 'learned' +} + +export interface CorrectedTranscript { + text: string + corrections: readonly TranscriptCorrectionEntry[] +} + +const EMPTY_GLOSSARY: TranscriptGlossary = { + terms: [], + dictionary: [], + vocabulary: new Map(), + examples: [], + promptHint: '', +} + +/** 사전 항목의 발음/변형 문자열을 개별 토큰으로 나눈다 (정본 표기는 제외). */ +export function splitGlossaryVariants(pronunciation: string | null | undefined, canonical: string): string[] { + const raw = typeof pronunciation === 'string' ? pronunciation.trim() : '' + if (!raw) return [] + const canonicalLower = canonical.toLowerCase() + const out: string[] = [] + for (const part of raw.split(/[,/;]+/u)) { + const value = part.trim() + if (!value) continue + if (value.toLowerCase() === canonicalLower) continue + if (out.includes(value)) continue + out.push(value) + } + return out +} + +function bump(map: Map, key: string, amount: number): void { + map.set(key, (map.get(key) ?? 0) + amount) +} + +function topEntries(map: ReadonlyMap, limit: number): Array<[string, number]> { + return [...map.entries()] + .sort((a, b) => (b[1] - a[1] !== 0 ? b[1] - a[1] : a[0].localeCompare(b[0]))) + .slice(0, Math.max(0, limit)) +} + +function isLearnableToken(word: string): boolean { + if (word.length < 2) return false + if (!/^[가-힣A-Za-z0-9]+$/u.test(word)) return false + return !STOP_WORDS.has(word) +} + +/** + * 사전 + 학습 문구에서 전사 교열용 글로서리를 만든다. + * 사전 단어는 사용자가 명시한 정본이므로 학습 어절보다 항상 우선한다. + */ +export function buildTranscriptGlossary(input: { + dictionary?: readonly GlossaryDictionaryEntry[] + phrases?: readonly GlossaryPhrase[] +}): TranscriptGlossary { + const limits = TRANSCRIPT_GLOSSARY_LIMITS + const dictionary: Array<{ word: string; variants: readonly string[] }> = [] + const terms: string[] = [] + const vocabulary = new Map() + const seen = new Set() + + for (const entry of (input.dictionary ?? []).slice(0, limits.dictionaryEntries)) { + const word = entry.word?.trim() + if (!word) continue + const key = word.toLowerCase() + if (seen.has(key)) continue + seen.add(key) + dictionary.push({ word, variants: splitGlossaryVariants(entry.pronunciation, word) }) + terms.push(word) + // 사전 정본은 어떤 학습 어절보다 우선 후보가 되도록 큰 가중치를 준다. + bump(vocabulary, key, 1000) + } + + const examples: string[] = [] + const phraseTokens = new Map() + for (const phrase of (input.phrases ?? []).slice(0, limits.phrases)) { + const text = phrase.text?.replace(/\s+/gu, ' ').trim() + if (!text) continue + if ( + examples.length < limits.refineExamples && + text.length >= 4 && + text.length <= 80 && + !examples.includes(text) + ) { + examples.push(text) + } + const weight = Math.max(1, phrase.count) + for (const token of tokenizeWords(text)) { + const word = token.text + if (!isLearnableToken(word)) continue + bump(phraseTokens, word.toLowerCase(), weight) + } + } + + for (const [word, count] of topEntries(phraseTokens, limits.vocabularyTerms)) { + if (count < limits.minLearnedCount) break + if (vocabulary.has(word)) continue + if (!isLearnableToken(word)) continue + vocabulary.set(word, count) + } + + // 힌트 용어: 사전 정본 먼저, 그 다음 학습 빈도순. + const hintTerms: string[] = [] + const pushed = new Set() + const pushHint = (word: string): void => { + const key = word.toLowerCase() + if (pushed.has(key)) return + if (hintTerms.length >= limits.promptTerms) return + pushed.add(key) + hintTerms.push(word) + } + for (const word of terms) pushHint(word) + for (const [word] of topEntries(phraseTokens, limits.promptTerms)) { + if (!isLearnableToken(word)) continue + pushHint(word) + } + + let joined = '' + for (const word of hintTerms) { + const next = joined ? `${joined}, ${word}` : word + if (next.length > limits.promptChars) break + joined = next + } + const promptHint = joined ? `용어: ${joined}.` : '' + + if (vocabulary.size === 0 && terms.length === 0 && examples.length === 0) { + return { ...EMPTY_GLOSSARY, vocabulary: new Map() } + } + return { terms, dictionary, vocabulary, examples, promptHint } +} + +/** 글로서리에 아무 정보도 없으면 true */ +export function isGlossaryEmpty(glossary: TranscriptGlossary): boolean { + return glossary.dictionary.length === 0 && glossary.examples.length === 0 && glossary.vocabulary.size === 0 +} + +/** STT initial_prompt 에 글로서리 힌트를 덧붙인다. */ +export function appendGlossaryHint(base: string, glossary: TranscriptGlossary): string { + const prefix = base.trim() + if (!glossary.promptHint) return prefix + return prefix ? `${prefix} ${glossary.promptHint}` : glossary.promptHint +} + +function escapeRegExp(value: string): string { + return value.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&') +} + +function isAsciiWordChar(char: string | undefined): boolean { + return Boolean(char && /[A-Za-z0-9]/u.test(char)) +} + +function buildTokenRegex(token: string): RegExp { + const escaped = escapeRegExp(token) + const prefix = isAsciiWordChar(token[0]) ? '(? b.length - a.length, + ) + for (const variant of variants) { + const regex = buildTokenRegex(variant) + let found = false + for (const match of current.matchAll(regex)) { + const from = match[0] + if (from === canonicalWord) continue + if (changes.some((change) => change.from === from && change.to === canonicalWord)) continue + changes.push({ from, to: canonicalWord, source: 'dictionary' }) + found = true + } + if (!found) continue + hit = true + current = current.replace(buildTokenRegex(variant), canonicalWord) + } + if (buildTokenRegex(canonicalWord).test(current)) hit = true + if (hit && !matched.includes(canonicalWord)) matched.push(canonicalWord) + } + return { text: current, matched, changes } +} + +interface VocabularyCandidate { + word: string + count: number + jamo: readonly string[] + script: 'hangul' | 'latin' +} + +interface VocabularyIndex { + byLength: Map + /** 소문자 정본 표기 — 이미 맞게 적힌 단어는 건드리지 않는다 */ + known: Set +} + +/** + * 어휘 인덱스 메모 — 글로서리는 15초 캐시로 재사용되므로 한 번 만들어 두고 계속 쓴다. + * WeakMap 이라 글로서리가 버려지면 인덱스도 함께 사라진다. + */ +const vocabularyIndexCache = new WeakMap() + +function scriptOf(value: string): 'hangul' | 'latin' | null { + if (/^[가-힣]+$/u.test(value)) return 'hangul' + if (/^[A-Za-z]+$/u.test(value)) return 'latin' + return null +} + +function buildVocabularyIndex(glossary: TranscriptGlossary): VocabularyIndex { + const cached = vocabularyIndexCache.get(glossary) + if (cached) return cached + const built = buildVocabularyIndexUncached(glossary) + vocabularyIndexCache.set(glossary, built) + return built +} + +function buildVocabularyIndexUncached(glossary: TranscriptGlossary): VocabularyIndex { + const byLength = new Map() + const known = new Set() + for (const [word, count] of glossary.vocabulary) { + const script = scriptOf(word) + if (!script) continue + known.add(word) + const candidate: VocabularyCandidate = { + word, + count, + jamo: decomposeHangul(word), + script, + } + const bucket = byLength.get(candidate.jamo.length) + if (bucket) bucket.push(candidate) + else byLength.set(candidate.jamo.length, [candidate]) + } + return { byLength, known } +} + +/** + * 학습 어절에서 1자모 차이 나는 유일한 후보를 찾는다. + * 동률이면(어느 쪽이 맞는지 알 수 없으면) 고치지 않는다. + */ +function bestCandidate(token: string, index: VocabularyIndex): VocabularyCandidate | null { + const script = scriptOf(token) + if (!script) return null + const jamo = decomposeHangul(token) + let best: VocabularyCandidate | null = null + let bestCount = 0 + let ties = 0 + for (const length of [jamo.length - 1, jamo.length, jamo.length + 1]) { + const bucket = index.byLength.get(length) + if (!bucket) continue + for (const candidate of bucket) { + if (candidate.script !== script) continue + if (candidate.jamo.length === jamo.length && candidate.word === token.toLowerCase()) continue + if (editDistance(jamo, candidate.jamo) > 1) continue + if (candidate.count > bestCount) { + best = candidate + bestCount = candidate.count + ties = 0 + } else if (candidate.count === bestCount) { + ties += 1 + } + } + } + return ties === 0 ? best : null +} + +interface TokenAttempt { + /** 비교할 어절 (조사를 떼어 낸 형태일 수 있다) */ + text: string +} + +function tokenAttempts(token: string): TokenAttempt[] { + const attempts: TokenAttempt[] = [{ text: token }] + for (const josa of JOSA_SUFFIXES) { + if (token.length - josa.length < 2) continue + if (!token.endsWith(josa)) continue + const stem = token.slice(0, token.length - josa.length) + if (!/^[가-힣A-Za-z0-9]+$/u.test(stem)) continue + attempts.push({ text: stem }) + break + } + return attempts +} + +/** + * 학습 어휘로 어절을 되돌린다. 띄어쓰기·문장부호·조사는 그대로 두고 어절만 바꾼다. + * 사용자가 실제로 쓴 어절(어휘에 있음)은 절대 건드리지 않는다. + */ +export function correctLearnedTerms( + text: string, + glossary: TranscriptGlossary, +): CorrectedTranscript { + const trimmed = text + if (!trimmed || glossary.vocabulary.size === 0) return { text: trimmed, corrections: [] } + + const index = buildVocabularyIndex(glossary) + const corrections: TranscriptCorrectionEntry[] = [] + let out = '' + let cursor = 0 + + for (const token of tokenizeWords(trimmed)) { + let replaced: { value: string; prefixLength: number } | null = null + for (const attempt of tokenAttempts(token.text)) { + if (index.known.has(attempt.text.toLowerCase())) continue + if (attempt.text.length < 2) continue + const candidate = bestCandidate(attempt.text, index) + if (!candidate) continue + replaced = { value: candidate.word, prefixLength: attempt.text.length } + break + } + if (!replaced) continue + const original = token.text.slice(0, replaced.prefixLength) + if (original === replaced.value) continue + corrections.push({ from: original, to: replaced.value, source: 'learned' }) + out += trimmed.slice(cursor, token.start) + replaced.value + cursor = token.start + replaced.prefixLength + } + + if (corrections.length === 0) return { text: trimmed, corrections: [] } + return { text: out + trimmed.slice(cursor), corrections } +} + +/** + * LLM 교열 프롬프트에 넣는 참고 블록. 정보가 없으면 빈 문자열. + * + * 용어는 "이 표기를 그대로 쓰라"는 지시로, 예시는 "문체·용어 참고"로만 쓴다. + * 예시 문장을 그대로 베끼게 하면 전사가 아니게 되므로 지시문에 명시한다. + */ +export function buildGlossaryPromptSection(glossary: TranscriptGlossary): string { + if (isGlossaryEmpty(glossary)) return '' + const parts: string[] = [] + if (glossary.dictionary.length > 0) { + parts.push('[사용자 용어 — 이 표기를 그대로 쓰세요]') + for (const entry of glossary.dictionary.slice(0, 30)) { + parts.push( + entry.variants.length > 0 + ? `- ${entry.word} (다르게 들리면: ${entry.variants.join(', ')})` + : `- ${entry.word}`, + ) + } + } + if (glossary.examples.length > 0) { + parts.push('', '[사용자가 실제로 쓰는 표현 — 말투·용어만 참고하고 문장을 그대로 베끼지 마세요]') + for (const example of glossary.examples.slice(0, TRANSCRIPT_GLOSSARY_LIMITS.refineExamples)) { + parts.push(`- ${example}`) + } + } + return parts.join('\n') +}