From a37dd639091d20a272695dcf8583918a6db9e285 Mon Sep 17 00:00:00 2001 From: Yun Chan Date: Sat, 14 Nov 2026 14:36:47 +0900 Subject: [PATCH] docs(map): record v1.17.1 multi-surface production deployment --- .dockerignore | 28 ++++++++++++++++++++++++++++ docs/map/00-index.md | 6 ++++-- docs/map/02-infrastructure.md | 6 +++--- docs/map/09-supabase-backend.md | 2 +- docs/map/11-gap-backlog.md | 8 ++++---- 5 files changed, 40 insertions(+), 10 deletions(-) diff --git a/.dockerignore b/.dockerignore index 23fef26..5f06e54 100644 --- a/.dockerignore +++ b/.dockerignore @@ -30,3 +30,31 @@ obj/ # 앱별 로컬 환경 파일(비밀값)이 이미지 빌드 컨텍스트에 들어가지 않게 한다. **/.env **/.env.* + +apps/desktop/ +apps/mobile-rn/ +apps/api-server/ +apps/api-server.Tests/ +apps/admin-swagger/ +scratch/ +site/ +server/ +docs/ +memory/ +scripts/ +release/ +supabase/ +araso/ +bucket/ +.agents/ +.claude/ +.codex/ +.crush/ +.forgejo/ +.pi/ +.tmp/ +.wrangler/ +.chrome-debug-profile/ +.chrome-interactive-profile/ +.chrome-playwright-profile/ +.playwright-oauth-profile/ diff --git a/docs/map/00-index.md b/docs/map/00-index.md index ea67b8e..f53b26b 100644 --- a/docs/map/00-index.md +++ b/docs/map/00-index.md @@ -2,7 +2,9 @@ > Status: ACTIVE > Last full audit: 2026-09-13 -> Last update: 2026-11-14 — **전 표면 코드 위생 · 최적화 · 버그 헌팅 완결(Wave 6, WS1–WS4 병렬).** (1) **Desktop Main & Sidecar (`WS1`):** `ipc/renderer-broadcast.ts`(`safeSendToRenderer`/`broadcastToAllWindows`) 9개 파일 단일화, `OnlineLLMService` 스트림 abort/401/예외 래핑, `UnifiedSearchService` FTS5→`LIKE` 런타임 폴백·집계·정렬·인덱스(`started_at`/`created_at`) 보강, `rag/chunk-store.ts` 캐시 무효화·중복 `embedding` JSON 제거·손상 Float32 방어, `disk-wav-audio-sink.ts` uint32 오버플로·헤더 write 실패 fd 정리, `AdMediationEngine`/`AudioCaptureService`/`LocalLLMService`/`WindowManager` 타이머·팝업 레이스 수정, `sidecar/main.py` `UploadFile.close()`·PCM 바이트 경계·`/shutdown` 스레드 join 완료. (2) **Shared Packages & Desktop Renderer (`WS2`):** `@d3ro/i18n` `shared.ts` 및 지연 로드/언마운트 레이스 차단(`25/25`), `@d3ro/core` PII 플레이스홀더·CSV BOM/CR·타임스탬프·검색 경계값(`626/626`), `@d3ro/ui` `wave-math.ts` + 캔버스 `LinearGradient` 캐싱(`7/7`), `@d3ro/ui-native`/`api-client` 경계 가드, 렌더러 `utils/error-message.ts`·훅/컴포넌트 언마운트·타이머 정리 및 Vanilla JS 팝업 6종 `beforeunload`/DOM 안전화 완료. (3) **Mobile RN (`WS3`):** `features/shared/{service-guards,owned-cache-files}.ts`, `features/import/abort-guard.ts`, `lib/locale-speech.ts`(12개 로케일), `features/meetings/meeting-error-message.ts`로 26+ 파일 중복 가드·오류·포맷 통합, `FreeTierBanner` 슬롯 전환 시 높이 고착 수정·내구성 큐 조기 폐기 경합 차단·녹음 리스 누수·언마운트 재생/로케일 레이스 해결(Jest `98 suites / 625 tests PASS`). (4) **Web · Admin · Site · Edge · Worker · .NET (`WS4`):** Edge 20개 엔드포인트 `_shared/json-response.ts`(스트리밍 바이트 상한 포함 `readJsonBody`·`jsonResponse`) 통합 및 `account-delete`/`llm-proxy`/`payple`/`realtime-token` fail-closed 강화(Deno `270/270`), `.NET` `SttProxyService` Base64 상한 + `CancellationToken` 전파(xUnit `32/32`), Cloudflare Worker `resolveBackendTargetUrl` SSRF·타임아웃·`/worker-health` 정보 노출 차단(Deno `9/9`), 웹 `MarkdownPreview` DOM XSS/레이스·`WebPush` 재진입·`team-client` fail-closed(`42/42`), 어드민 `request-security.ts`/`detail-row.tsx`·CSRF/`ADMIN_UUID_PATTERN`/비용 검증, 사이트 `AppLoopDemo`/`rel="noopener noreferrer"` 보강 완료. 상세: [`REFACTOR_WAVE6_REPORT.md`](../REFACTOR_WAVE6_REPORT.md). +> Last update: 2026-11-14 — **전 표면 프로덕션 `v1.17.1` 배포 완결.** 데스크톱(`v1.17.1`, 커밋 `6c6875b`, 서명 매니페스트 `1.17.1/latest.yml`·`.sig` 및 `latest/latest.yml`, 런타임 `runtime-1.17.1`/`runtime-latest`, 포터블 `portable-1.17.1`/`portable-latest` 모두 Forgejo HTTP `200`, 태그 `v1.17.1` canonical/mirror 푸시; Human Release #339 ~91MB 바이너리 첨부만 Cloudflare HTTP 524/`ECONNRESET` `GAP-REL-16` 예외), Supabase 운영 DB(`db push --remote`, 전체 74개 마이그레이션 일치) 및 Edge Functions 24종(`--import-map deno.json --use-api`) 재배포, 랜딩 사이트(`site/` → Cloudflare Pages `d3ro`, `https://d3ro.chanpaca.net/release-identity.json` = `1.17.1`/`6c6875b` & `assetlinks.json` 검증 GREEN), Cloudflare Worker(`d3ro-voice-api` `--keep-vars`, Version ID `fe6d9532-0052-48f5-b62c-45c86f6aaaa5`), NAS Docker 스택(`d3ro_voice_api` `v1.17.1` `/health` `200`, `d3ro_voice_admin` `:3001`/`d3ro-admin.chanpaca.net/login` `200`, `d3ro_voice_web` `:3002/app/login`·`d3ro.chanpaca.net/app/login` `200`) 반영 완료. +> +> Previous update: 2026-11-14 — **전 표면 코드 위생 · 최적화 · 버그 헌팅 완결(Wave 6, WS1–WS4 병렬).** (1) **Desktop Main & Sidecar (`WS1`):** `ipc/renderer-broadcast.ts`(`safeSendToRenderer`/`broadcastToAllWindows`) 9개 파일 단일화, `OnlineLLMService` 스트림 abort/401/예외 래핑, `UnifiedSearchService` FTS5→`LIKE` 런타임 폴백·집계·정렬·인덱스(`started_at`/`created_at`) 보강, `rag/chunk-store.ts` 캐시 무효화·중복 `embedding` JSON 제거·손상 Float32 방어, `disk-wav-audio-sink.ts` uint32 오버플로·헤더 write 실패 fd 정리, `AdMediationEngine`/`AudioCaptureService`/`LocalLLMService`/`WindowManager` 타이머·팝업 레이스 수정, `sidecar/main.py` `UploadFile.close()`·PCM 바이트 경계·`/shutdown` 스레드 join 완료. (2) **Shared Packages & Desktop Renderer (`WS2`):** `@d3ro/i18n` `shared.ts` 및 지연 로드/언마운트 레이스 차단(`25/25`), `@d3ro/core` PII 플레이스홀더·CSV BOM/CR·타임스탬프·검색 경계값(`626/626`), `@d3ro/ui` `wave-math.ts` + 캔버스 `LinearGradient` 캐싱(`7/7`), `@d3ro/ui-native`/`api-client` 경계 가드, 렌더러 `utils/error-message.ts`·훅/컴포넌트 언마운트·타이머 정리 및 Vanilla JS 팝업 6종 `beforeunload`/DOM 안전화 완료. (3) **Mobile RN (`WS3`):** `features/shared/{service-guards,owned-cache-files}.ts`, `features/import/abort-guard.ts`, `lib/locale-speech.ts`(12개 로케일), `features/meetings/meeting-error-message.ts`로 26+ 파일 중복 가드·오류·포맷 통합, `FreeTierBanner` 슬롯 전환 시 높이 고착 수정·내구성 큐 조기 폐기 경합 차단·녹음 리스 누수·언마운트 재생/로케일 레이스 해결(Jest `98 suites / 625 tests PASS`). (4) **Web · Admin · Site · Edge · Worker · .NET (`WS4`):** Edge 20개 엔드포인트 `_shared/json-response.ts`(스트리밍 바이트 상한 포함 `readJsonBody`·`jsonResponse`) 통합 및 `account-delete`/`llm-proxy`/`payple`/`realtime-token` fail-closed 강화(Deno `270/270`), `.NET` `SttProxyService` Base64 상한 + `CancellationToken` 전파(xUnit `32/32`), Cloudflare Worker `resolveBackendTargetUrl` SSRF·타임아웃·`/worker-health` 정보 노출 차단(Deno `9/9`), 웹 `MarkdownPreview` DOM XSS/레이스·`WebPush` 재진입·`team-client` fail-closed(`42/42`), 어드민 `request-security.ts`/`detail-row.tsx`·CSRF/`ADMIN_UUID_PATTERN`/비용 검증, 사이트 `AppLoopDemo`/`rel="noopener noreferrer"` 보강 완료. 상세: [`REFACTOR_WAVE6_REPORT.md`](../REFACTOR_WAVE6_REPORT.md). > > Previous update: 2026-11-13 — **전 표면 성능 최적화 · 코드 위생 완결(Wave 5) · 백로그 일괄 구현 · TDD v2.0 게이트 완성.** (1) **소스·패키징 위생:** 루트 중복 `resources/sox/`(5.21 MB) 및 `apps/desktop/resources/sox/` 불필요 바이너리 10종 제거 + `electron-builder.yml` 필터 적용, 데스크톱 미구현 광고 어댑터 9종 단일화(`UNAVAILABLE_AD_NETWORK_SPECS`), `scripts/local/` 109개 및 미참조 루트 스크립트 16개 삭제 + `npm run clean:deep`(`scripts/ci/clean-deep.mjs`), `apps/mobile-rn` 루트 순환 의존성(`d3ro-voice-monorepo`)·NTFS 정션 제거, `.NET` `SttController` 무호출 중복 라우트(`GET /providers`, `POST /test`) 삭제. (2) **번들·코드 스플리팅 & 대형 모듈 분리:** `@d3ro/i18n`을 렌더러/웹 동적 로케일 청크(`index.tsx`), 무-React 동기 로더(`@d3ro/i18n/main`), 모바일 지연 엔트리(`index.native.tsx`, Metro `inlineRequires`)로 3분할하고, 데스크톱 `AppLayout.tsx`(7페이지·6모달 `React.lazy`), 모바일 `App.tsx`(`getComponent`), 웹 `MarkdownPreview`(`next/dynamic` + 조건부 `mermaid`) 스플리팅으로 데스크톱 초기 부팅 JS를 `8.79 MB` → `3.62 MB`(`-58.8%`)로 축소했으며, `SettingsModal.tsx`(`951`→`349`줄, 탭 4종 + `settings-model-helpers.ts`)와 `SuggestionService.ts`(`suggestion-policy-helpers.ts`) 순수 모듈 분리를 완료했다. (3) **데스크톱 SQLite · 프로세스 · 오디오 디스크 스트리밍:** SQLite WAL PRAGMA(`synchronous=NORMAL`, `mmap_size=64MB`, `cache_size=-16000`), FTS5 trigram 전문 검색, RAG `embedding_blob`(`Float32Array`) + `WeakMap` 캐시, `PersonalGraphService` 단일 트랜잭션, Windows `koffi` `SendInput` 일원화, 기본 모드 `mousemove`/`wheel` 훅 차단, 백그라운드 팝업 지연 생성, `LocalSTTService` 주 Whisper 모델 유휴/클라우드 언로드, 회의 녹음 PCM 디스크 스트리밍(`DiskWavAudioSink`, 메모리 상주 `O(N)→O(1)`)을 적용했다. (4) **Wave 5 계약·보안 & 기능 백로그 해소:** `@d3ro/core`에 `guards`/`csv`/`format`/`unified-search`/`admin-roles`/`ports` 6개 SSOT 모듈을 추출해 앱 간 중복을 제거하고, 클라우드 LLM·고객지원 `redactPII`/`rehydrateText` 및 녹음 폐기 시 `secureWipeAudioChunks`/`secureZeroBuffer`를 실배선했으며, 고아 키 253개를 정리한 `2,500`키 × 12개 언어를 데스크톱·웹(`LocaleSwitcher`)·모바일(온보딩/설정/계정 + Android `localeFilters` 12개, R8/`shrinkResources`) 전 표면에 노출했다. 또한 `site/` 정적·빌드 CI 게이트(`typecheck:site`/`lint:site`), 웹 `teams` 실 멤버 수 집계(`team-client.ts`), 모바일 `>=600dp` 태블릿/폴더블 반응형 레이아웃(`@d3ro/ui-native/responsive`, 10개 화면 + `FreeTierBanner` `90dp` 슬롯 예약), `meeting_memos.revision` 불변 CAS(마이그레이션 #74 `20261113000001`), 사이드카 `POST /diarize` + 데스크톱·웹·모바일 화자 배지·필터 바(`MTG-08`)를 완성했다. (5) **TDD v2.0 Phase 2~5 자동화 게이트:** `check:i18n`, `check:ds-contract`(`SegmentControl` ARIA `tablist`/`tab` + `@d3ro/ui` 테스트), `test:affected`, `release:installer:smoke`(`verify-desktop-installer-smoke.mjs`: PE64·blockmap·SHA-512·`app-update.yml`·ASAR Pickle·Ed25519 `.sig`)를 `verify:all` 및 `.forgejo/workflows/{ci,release}.yml`에 연결했다. 상세: [`REFACTOR_WAVE5_REPORT.md`](../REFACTOR_WAVE5_REPORT.md). > @@ -37,7 +39,7 @@ > Previous update: 2026-09-22 — **Gemma/Ollama 폭주 방어 계약을 기록했다.** 19:14:12 부팅 워밍업이 `keep_alive: 30m`으로 `gemma4:e4b`를 19:44:12까지 VRAM 3,226,342,521 bytes / context 4096으로 강제 상주시킨 것이 관측됐으며, 같은 시점 Windows GPU Engine PID 표본에는 Ollama의 활성 compute가 없었다. 즉 당시 상태는 무한 추론이 아니라 강제 residency였다. 19:11:17~19:11:58의 자동 제안 연속 생성은 기존 900 ms·12/min·5 candidates·128 tokens·한 글자 재생성 정책이 허용한 burst였다. 현재 구현 계약은 부팅 warmup 제거, `keep_alive: 2m`, 제안 600 ms / 최소 5 s 간격 / 기본 6회·hard max 12회 per min / 3 candidates / 64 tokens / 12-char growth / 8 s timeout, 그리고 요청별 취소·상한·종료 정리다. 독립 표적 검증은 6 test files / 69 tests passed / 0 failed, 변경 코드·테스트 ESLint와 `git diff --check`도 exit 0이다. Raw Ollama에서는 cold bounded 요청이 client hard timeout 15.044 s에 취소된 뒤 `/api/ps`가 비었고 `/api/version`은 80 ms에 회복했다. 명시 warmup은 HTTP 200 / 16.639 s, 후속 warm 요청은 body `options.num_predict=1`, `keep_alive='2m'`로 553 ms HTTP 200 / `done:true` / `eval_count:1` / `done_reason:length`였고 `/api/ps` expiry는 약 119.9 s였다. **19:48:59 +09:00에는 새 generate/unload/kill/retry 없이 충분히 지난 뒤 한 번의 `/api/ps`가 HTTP 200 / 45.8 ms / `{models:[]}`였고 `/api/version`은 HTTP 200 / 7.3 ms / `0.32.13`이었다.** 이는 raw API 수준의 expiry 뒤 unload 확인일 뿐 앱 재시작·GUI·실제 타이핑 증거는 아니므로 상태는 `[~]`로 유지한다 (`11` GAP-LLM-04, GAP-INPUT-06). > > Previous update: 2026-09-21 — **Input intelligence (입력 레메트리 + 다음 문장 제안) 신규**. 데스크톱에 입력 수집기(`InputTelemetryService`), UIA 컨텍스트 브리지(사이드카 `GET /uia/focus`), 제안 서비스(`SuggestionService`), 어렛 커 오버레이, 설정 > 입력 탭(동의·정책·주간 인사이트·개인 문구)을 추가했다. 카탈로그에 `INPUT-01`~`INPUT-08`(전부 데스크톱 `[~]` — 유닛 48건은 GREEN 이지만 **실앱 타이핑 검증 전**), 백로그에 GAP-INPUT-01~05 + GAP-LLM-03, §7 에 CONSTRAINT-INPUT-01(키 내용 미저장 — ActivityWatch 정책 채택)을 기록. 설계 근거는 조사 기반이다: 어렛은 `GetGUIThreadInfo` 가 아니라 UIA `TextPattern.GetSelection`(Chromium 은 `TextPattern2` 미구현), 타이핑 스트는 키코드 복원이 아니라 UIA 스냅샷 diff(한/일 IME 대응), 디바운스/토큰 한도는 인라인 컴플리션 실측값(Continue 350 / Tabby 250 / twinny 300 ms, 출력 64~256 토큰). 의존성: `koffi` 3.3.1(포그라운드 창 FFI), 사이드카 `uiautomation` 2.0.29 + `comtypes`. 데스크톱 유닛 총계 1409(+49), Electron ABI 실행에서 신규 실패 0건. 당시의 24.7초/4.9초 지연 설명과 `keep_alive: 30m`·부팅 워밍업 처방은 **현재 상태가 아닌 과거 가설/완화 이력**이며, 최신 운영 결론은 위 2026-09-22 항목과 `11` GAP-LLM-04를 따른다. 직전: LLM instruction-prompt fix (`9c2b4d4`): the custom-instruction path inserted the instruction's own wording instead of the processed result and had **never worked in any shipped release** (`v0.1.0-alpha`..`v1.4.0`, introduced `fea923d` 2026-04-05, not a regression). `llm-prompts.ts` is now the SSOT for prompt resolution and placeholder substitution, shared by `VoiceModeService` / `ChainService` / `LLM.PROCESS`. AI-04/05/06/07 are demoted to `[~]` on desktop — fixed with unit tests, but **not verified in a running app** and the four related `tests/red/*.usecase.test.ts` could not execute (`better-sqlite3` ABI). New: GAP-LLM-01 (no target-language setting), GAP-LLM-02 (this fix unverified); GAP-INFRA-06 amended (the ABI masks verification, not just dev-env switching cost); GAP-I18N-01 amended (`popup.error.default` missing in 10 locales). Earlier the same day: CAP-16 (desktop key bindings rebuilt on one `@d3ro/core/keybinding` SSOT — multiple bindings per action, mouse buttons, `HOTKEY` → `KEYBINDING` IPC group), verified on Windows by a manual run, so CAP-16 and CAP-02 are `[x]` and GAP-KEY-01 is closed. Still open: GAP-KEY-02/03, GAP-QA-02, GAP-I18N-01/02, GAP-INFRA-06, GAP-LLM-01/02, GAP-INPUT-01~05; `11` §7 holds accepted design constraints (things deliberately kept, not gaps) -> Scope: entire monorepo `D:/workspace/D3ROVoice` at product version `1.16.5` (`release/product-version.json`) +> Scope: entire monorepo `D:/workspace/D3ROVoice` at product version `1.17.1` (`release/product-version.json`) > Purpose: let any agent (or human) answer two questions in under a minute: > 1. **What infrastructure exists?** (build, CI, services, APIs, data, packages, deploy) > 2. **How far is each feature developed?** (per surface, with file anchors and status) diff --git a/docs/map/02-infrastructure.md b/docs/map/02-infrastructure.md index 182212e..33e3350 100644 --- a/docs/map/02-infrastructure.md +++ b/docs/map/02-infrastructure.md @@ -1,7 +1,7 @@ # 02 — Repository & Infrastructure Map > Surface: whole repo -> Last updated: 2026-11-13 — Source/packaging hygiene (`clean:deep`, trimmed `apps/desktop/resources/sox`, macOS-only `@nut-tree-fork` `asarUnpack`, Android R8 + `shrinkResources` + 12-locale `localeFilters`), `@d3ro/i18n` 2,500-key split, `site/` static/build CI gate, and TDD v2.0 Phase 2–5 gates (`check:i18n`, `check:ds-contract`, `test:affected`, `release:installer:smoke`) +> Last updated: 2026-11-14 — `v1.17.1` 전 표면 운영 배포 반영(Desktop/Runtime/Portable Forgejo `200`, Supabase 74 migrations + 24 Edge Functions, Site Pages `d3ro.chanpaca.net`, Worker `d3ro-voice-api`, NAS Docker `api`/`admin`/`web`), 루트 `.dockerignore` 빌드 컨텍스트 격리(대용량 `apps/desktop/`·`scratch/`·`.chrome-*` 제외), `verify-desktop-installer-smoke.mjs` ASAR Pickle 32 MiB 헤더 판독 수정(`405ae16`) > Source of truth for: layout, workspaces, build/test commands, CI/CD, Docker, deploy, scripts, resources --- @@ -203,7 +203,7 @@ Stages `validate → test → build → e2e → package → publish → deploy`. | `apps/api-server/Dockerfile` | Multi-stage .NET 10 (sdk → aspnet runtime), port 5000, `VOLUME /app/data`; no longer serves static files (`wwwroot` removed — see `07-api-server.md`) | | `apps/web/Dockerfile` | Next.js standalone runner for `@d3ro/web`, basePath `/app`, port 3002 (added 2026-09-26, Wave 3, b6fe588) | | `docker-compose.yml` | Dev/self-host: `d3ro-api-server` (5050→5000, `./data` volume), `d3ro-admin` (3001), `d3ro-web` (3002, `@d3ro/web` basePath `/app`, Supabase/Payple keys as build args), optional `ollama` (profile `ai`, 11434) | -| `docker-compose.nas.yml` | NAS: prebuilt `d3ro-voice-api:latest` / `d3ro-voice-admin:latest` / `d3ro-voice-web:latest` (3002) / `d3ro-whisper` (faster-whisper, OpenAI-compatible). No legal-doc `wwwroot` mount and no `NEXT_PUBLIC_API_URL` — both were dropped 2026-09-26 (Wave 3, b6fe588); legal pages are served only from `site/public`. | +| `docker-compose.nas.yml` | NAS: prebuilt `d3ro-voice-api:latest` / `d3ro-voice-admin:latest` / `d3ro-voice-web:latest` (3002) / `d3ro-whisper` (faster-whisper, OpenAI-compatible). No legal-doc `wwwroot` mount and no `NEXT_PUBLIC_API_URL` — both were dropped 2026-09-26 (Wave 3, b6fe588); legal pages are served only from `site/public`. Root `.dockerignore` excludes non-web/admin directories (`apps/desktop/`, `scratch/`, browser profiles, etc.) so remote `DOCKER_HOST=ssh://...` builds of `admin`/`web` skip local release artifacts; `apps/api-server` builds with `./apps/api-server` context. | Deploy scripts: `scripts/deploy-nas.ps1`, `scripts/deploy-nas.sh`, `scripts/nas-control.sh` (start/stop/restart/status/logs/backup/update). `scripts/deploy-site-to-nas.js` was deleted 2026-09-26 (Wave 3, cd9d199) — site deploy is Cloudflare Pages only (`.forgejo/workflows/deploy-site.yml`). @@ -243,7 +243,7 @@ Full detail: [`09-supabase-backend.md`](./09-supabase-backend.md). | File | Purpose | |---|---| -| `release/product-version.json` | version `1.16.5`, `androidVersionCode`/`iosBuildNumber` `1160500`, desktop license keyId | +| `release/product-version.json` | version `1.17.1`, `androidVersionCode`/`iosBuildNumber` `1170100`, desktop license keyId | | `release/android-release-identity.json` | package `com.d3ro.voice`, Play app ID, app-signing SHA-256, upload cert SHA-256, evidence keyId, AdMob unit IDs | | `release/desktop-license-public.pem` | Ed25519 public key for desktop offline licenses | | `release/mobile-release-evidence-public.pem` | Ed25519 public key for mobile release evidence | diff --git a/docs/map/09-supabase-backend.md b/docs/map/09-supabase-backend.md index f42e54a..d902bb3 100644 --- a/docs/map/09-supabase-backend.md +++ b/docs/map/09-supabase-backend.md @@ -8,7 +8,7 @@ ## 1. Supabase project (`server/supabase/`) - `config.toml` — project_id `d3ro-voice`; local ports API 55321 / DB 55322 / Studio 55323 / local SMTP UI 55324; DB major v17; storage 50 MiB; auth `site_url` localhost:5173, redirects include `https://d3ro.chanpaca.net` and `d3ro-voice://auth-callback`; external providers Google/GitHub/Apple; per-function `verify_jwt` settings; analytics off. The mail section uses the Supabase CLI 3.x `[local_smtp]` name rather than the removed `[inbucket]` alias. -- `seed.sql`, `migrations/` (74 source files; last confirmed production state was `20260927000036`, with `20261113000001_meeting_memos_revision_cas.sql` pending production push), `functions/` (24 source functions; the 23 functions present on 2026-09-27 were redeployed that day), `functions/_shared/`, `tests/`, `deno.json`. +- `seed.sql`, `migrations/` (74 source files; pushed and confirmed synced with production `llnocwyqvhgwpdjcqqyw` on 2026-11-14 via `supabase db push --remote` and `migration list --remote`), `functions/` (all 24 source functions redeployed on 2026-11-14 via `--use-api --import-map server/supabase/functions/deno.json`), `functions/_shared/`, `tests/`, `deno.json`. > Note: root `supabase/` contains only empty scaffolding (`.branches/`, `snippets/`). The real project lives under `server/supabase/`. diff --git a/docs/map/11-gap-backlog.md b/docs/map/11-gap-backlog.md index 8fa9809..8cb9622 100644 --- a/docs/map/11-gap-backlog.md +++ b/docs/map/11-gap-backlog.md @@ -22,7 +22,7 @@ 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`, `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-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. **2026-11-14 (`v1.17.1`):** Desktop `1.17.1` (`6c6875b`, `D3RO-Voice-Setup-1.17.1-x64.exe` `95,294,301` bytes + Ed25519 signed `latest.yml`/`.sig`), `runtime-1.17.1`/`runtime-latest`, `portable-1.17.1`/`portable-latest`, 및 Landing `site/` (`https://d3ro.chanpaca.net/release-identity.json` = `1.17.1`/`6c6875b`)가 프로덕션에 게시됐다(단 Authenticode SmartScreen 평판 `GAP-REL-02`/`06` 및 Release #339 ~91MB 첨부 `GAP-REL-16` 예외는 유지). | | 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`를 보고한다. 자동 게시에는 여전히 시크릿 등록이 필요하다. | @@ -33,7 +33,7 @@ Legend: `[ ]` open · `[~]` in progress · `[!]` blocked externally · `[x]` res | 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-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`이었다. **2026-11-14 운영 반영:** `audio-purge` 포함 24개 Edge Function을 운영(`verify_jwt = false` `config.toml` 반영)에 재배포했으며 무인증 호출이 HTTP `401`로 거부됨을 확인했다. **남은 경계:** 운영 DB의 실제 `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도 확인하지 않았다. | @@ -69,7 +69,7 @@ Legend: `[ ]` open · `[~]` in progress · `[!]` blocked externally · `[x]` res | GAP-MTG-02 | Meetings | Speaker diarization only partially done on desktop; absent web/mobile. | `apps/desktop/sidecar/main.py` (`POST /diarize`), `MeetingModeService.ts`, `packages/core/src/meeting-transcript.ts`, `apps/desktop/src/renderer/components/meeting/{TranscriptTab,EditableSegment}.tsx`, `apps/web/src/components/meetings/live-transcript-list.tsx`, `apps/mobile-rn/src/screens/MeetingDetailScreen.tsx` | `[~]` **2026-11-13 전 표면 구현·테스트 완료:** 사이드카 `POST /diarize`(`pyannote.audio` 설치 시 자동 사용 + 무의존 에너지 VAD 화자 교대 분할 폴백, Python 30/30 PASS)를 `LocalSTTService.sidecarBaseUrl`로 `MeetingModeService._diarizeTranscript`(LLM 추정 폴백 및 `stripInventedMarkers({ allowSpeakerMarkers })` 포함)에 연결하고, `@d3ro/core/meeting-transcript` 화자 목록/필터 유틸과 화자 배지·다중 화자 필터 칩을 데스크톱·웹·모바일 상세 화면 전부에 구현했다(코어 13/13, 데스크톱·웹·모바일 테스트 전수 PASS; 실음성 다중 화자 데스크톱 GUI 확인 전까지 `[~]`). | | 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-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`). **Direct measurement against the real local database** (`users/_local/d3ro.db`: 1,952 learned phrases / 2,522 typing samples / 3 meeting transcripts) exposed that the first cut also rewrote ordinary Korean (286 of 3,005 words: 하면→라면, 이제→이게, 매일→메일, 정보→정도), and v1.16.3 restricts deterministic correction to dictionary pronunciations plus typed Latin identifiers — re-measured **0 of 3,005**. Real-engine check with the local sidecar (`large-v3-turbo`): a Korean TTS fixture containing the user term transcribes as 하람로그에 with no hint and haramlog에 with the learned hint; a dictionary pronunciation entry maps 디에로 → D3RO. Hangul-layout artifacts (dkssudgktpdy) are excluded from the hint. Evidence: `packages/core/__tests__/transcript-correction.test.ts` 16/16, `apps/desktop/tests/main/services/transcript-glossary.test.ts` 10/10, core 589/589, desktop offline suite, workspace typecheck, touched-file ESLint, `test:hygiene`. **Remaining:** a live meeting with real names/jargon by voice, and a packaged-install check of the new IPC event. | -| GAP-REL-16 | Release | Forgejo release-page asset attachment for the ~91 MB installer times out through Cloudflare (HTTP 524), although the package registry upload and the signed manifest succeed. | `scripts/ci/publish-forgejo-release.mjs`, `scripts/ci/lib/immutable-package-guard.mjs` | `[~]` 2026-11-06: reproduced on v1.16.2, v1.16.3 and v1.16.4. Each time the registry artifacts, `latest.yml`, `latest.yml.sig` and the public signed-manifest verification completed, so installed apps can update; only the human-facing release page has no attached binaries for those tags. To retry only this step, check out the tag detached (`git checkout v1.16.4`) before `npm run release -- --resume`; the resume path requires HEAD to equal the tag. | +| GAP-REL-16 | Release | Forgejo release-page asset attachment for the ~91 MB installer times out through Cloudflare (HTTP 524), although the package registry upload and the signed manifest succeed. | `scripts/ci/publish-forgejo-release.mjs`, `scripts/ci/lib/immutable-package-guard.mjs` | `[~]` 2026-11-06: reproduced on v1.16.2, v1.16.3 and v1.16.4. **2026-11-14 (`v1.17.1`):** `v1.17.1` (`6c6875b`) also reproduced `write ECONNRESET` at Human Release #339 asset attachment due to Cloudflare ~91 MB proxy limit, while Forgejo generic registry (`1.17.1/latest.yml`, `.sig`, `latest/latest.yml`, `runtime-1.17.1`, `portable-1.17.1`) and public signed-manifest verification completed with HTTP `200`, so installed apps can auto-update cleanly. To retry only this step locally without Cloudflare proxy timeout or check detached tag: check out `v1.17.1` before `npm run release -- --resume`. | | 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`에 연결했다. | @@ -126,7 +126,7 @@ 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. | `server/supabase/migrations/20261113000001_meeting_memos_revision_cas.sql`, `packages/api-client/src/types.ts` `MeetingMemo`, `apps/mobile-rn/src/features/meetings/meetings-service.ts`, `apps/desktop/src/main/{db/schema.ts,services/sync/sync-adapters.ts}` | `[~]` **2026-11-13 마이그레이션·클라이언트·단위 검증 완료:** 74번째 마이그레이션 `20261113000001_meeting_memos_revision_cas.sql`로 `meeting_memos.revision integer not null default 1 check (revision >= 1)` 및 단조 증가 트리거 `bump_meeting_memo_revision`을 추가하고, `@d3ro/api-client`, 모바일 `updateMeetingMemoConflictSafe`/`deleteMeetingMemoConflictSafe`(단조 `revision` 우선 CAS로 `A→B→A` 회피 차단, 구 스키마 폴백 유지), 데스크톱 SQLite `meeting_memos.revision`·`sync-adapters.ts`를 모두 갱신했다(`check:migrations` 74개 GREEN, 모바일 `meetings.test.ts` 18/18·데스크톱 `SyncEngine.test.ts` 20/20 PASS). 남은 단계: 운영 DB `supabase db push` 반영. | +| 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. | `server/supabase/migrations/20261113000001_meeting_memos_revision_cas.sql`, `packages/api-client/src/types.ts` `MeetingMemo`, `apps/mobile-rn/src/features/meetings/meetings-service.ts`, `apps/desktop/src/main/{db/schema.ts,services/sync/sync-adapters.ts}` | `[x]` **2026-11-13 마이그레이션·클라이언트·단위 검증 완료 → 2026-11-14 운영 DB 반영:** 74번째 마이그레이션 `20261113000001_meeting_memos_revision_cas.sql`로 `meeting_memos.revision integer not null default 1 check (revision >= 1)` 및 단조 증가 트리거 `bump_meeting_memo_revision`을 추가하고, `@d3ro/api-client`, 모바일 `updateMeetingMemoConflictSafe`/`deleteMeetingMemoConflictSafe`(단조 `revision` 우선 CAS로 `A→B→A` 회피 차단, 구 스키마 폴백 유지), 데스크톱 SQLite `meeting_memos.revision`·`sync-adapters.ts`를 모두 갱신했다(`check:migrations` 74개 GREEN, 모바일 `meetings.test.ts` 18/18·데스크톱 `SyncEngine.test.ts` 20/20 PASS). **2026-11-14:** 운영 Supabase `supabase db push --remote`로 21개 보류 마이그레이션(`20260927000037`~`20261113000001`)을 반영하고 `supabase migration list --remote`에서 전체 74개 로컬=원격 일치를 확인했으며 데스크톱 `v1.17.1`도 함께 게시했다. | | 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). |