docs/tdd-red/07-revamp-plan.md Phase 1 — v1.1이 문서로만 선언한 것을 게이트로 옮긴다.
보호 수용 경로 게이트 (check-protected-tests.mjs):
- 06 §5 의 보호 6경로를 base revision 과 비교한다.
- 실패 조건: 테스트/스텝 블록 감소, expect 감소, .only 추가, skip/todo 추가,
보호 파일 삭제.
- 정당한 스펙 변경은 커밋 본문 `allow-protected-change: <사유>` 또는 --reason 으로만
통과한다(사람 리뷰 대체 아님). CI quality 잡이 --base HEAD^ 로 실행하며
체크아웃이 depth 2 로 바뀐다. 얕은 클론에서는 SKIP 사유를 출력한다.
품질 래칫 (check-test-quality.mjs + test-quality-baseline.json):
- 파일별 weak-assertion(toBeDefined/toBeTruthy/toBeFalsy/toBeNull)과
ambient-time(Date.now/Math.random/performance.now) 수치를 동결하고 증가만 막는다.
- 128 / 203 건을 한 번에 고치지 않고 회귀만 차단한다. --update 는 리뷰 후 실행.
배선: verify:all 에 두 게이트 편입, CI quality 잡 단계 추가,
map/02 §10 · tdd-red/06 §5·§6 · 07 Phase 0-1 상태 갱신.
검증:
- self-test: check-protected-tests 6케이스, check-test-quality 6케이스 통과
- 실제 약화 주입 시 두 게이트가 exit 1 (smoke.spec.ts .only, 약한 단정 추가) 후 원복
- npm run test:hygiene / check:design GREEN, npm test GREEN (2800+605+31+24)
The local model follows the polish instructions only most of the time: in
repeated runs it added a [00:00] or [화자 1] marker that was never in the
audio, and it turned "사실 거의 근간" into "사실 근간". Both change what the
meeting record says, so they are now enforced in code instead of hoped for
in the prompt: markers absent from the original chunk are stripped, and
meaning qualifiers the speaker said are restored from that chunk.
The instructions themselves were re-measured on the model: a fixed removal
list, an explicit qualifier example and a marker ban keep the filler cleanup
without touching ordinary words, and the same wording is used by the app,
the tests and the probe. Unknown-word repair still depends on the model.
Move the polish instructions into their own module so the prompt the app
sends, the unit tests and the local-model probe use the same text. Tests
now pin the two rules that matter: fix a misheard name or in-house term to
the learned spelling, and never swap an ordinary word on similarity alone.
Verified against the local model with the real learned corpus: 하람록에 was
rewritten to HaramLog에 and the dictionary pronunciation 디에로 to D3RO,
while a natural sentence with no learned term came back with no word
substitutions. Recorded the trap that this model returns empty content
unless thinking is disabled.
Registry uploads and signed manifests succeed, but attaching the 91 MB
installer to the Forgejo release page times out through Cloudflare on every
tag since 1.16.2. Record it so the missing page assets are not mistaken for
a broken update feed.
AI polishing of a recorded or pasted transcript was a generic rewrite: it
cleaned fillers but left names and in-house terms mangled even when the app
already knew them. Polishing now corrects dictionary pronunciations and
typed identifiers deterministically before and after the model, and hands
the model the learned term list plus the user's own expressions with
explicit rules: rewrite a misheard name, product or in-house term to the
learned spelling, and never swap an ordinary noun or ending on similarity
alone. Dictation output is re-checked the same way after the model runs.
The first cut replaced any Hangul word within one jamo of a learned term.
Measured against the real local corpus (three stored meeting transcripts)
it changed 286 of 3,005 words: 하면 became 라면, 이제 became 이게, 매일 became
메일. Most of what the app learns from typing is ordinary grammar, so
distance alone cannot separate a misheard word from a correct one.
Deterministic correction now covers only dictionary pronunciations and the
Latin identifiers the user types, preserving their casing. Korean terms
still bias recognition through the prompt hint and guide the polish
prompt. Re-measured on the same transcripts: 0 of 3,005 words changed.
Hangul-layout typing artifacts (dkssudgktpdy) are dropped from the hint.
The tree carried uncommitted work from several areas (web push, mobile
screens, admin charts, test-hygiene cleanup, CI and map docs). It is landed
as one commit so the release pipeline can start from a clean tree; the
desktop transcript-correction behaviour shipped in the previous commit and
is unchanged here.
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.
Acceptance waited for modifiers using only the uiohook-tracked set; a missed keyup
made it time out after 1.5 s and paste while Ctrl/Alt counted as held, so nothing
was inserted. Trust GetAsyncKeyState instead, and suppress new suggestions while an
accept is in flight.
Typed deltas were saved per snapshot (every 0.4-0.8 s), storing mid-word fragments.
Buffer them per field and save one diff on idle, sentence end, send or focus change;
drop short pieces, URLs, trailing jamo and truncated emoji.
The installer is unsigned, so latest.yml is now signed with an Ed25519 key and the
app verifies the downloaded installer against it before installing.
npm run release -- patch|minor bumps, gates, tags, builds, signs, publishes,
re-verifies the public feed and pushes; --resume continues after a failure.
The retired GitLab registry publisher is removed.
While suggestions are on, typos are no longer replaced silently. The popup shows
the fix next to the candidate and applies it only when the candidate is accepted.
The per-minute request cap rises from 6 to 20 so suggestions keep appearing after
accepting one and continuing to type.
The PC-wide slowdown was not a leak but model residency: boot warmup loaded
gemma4:e4b (~11.6 GB RAM incl. 5.9 GB pinned host buffer, no mmap on Windows
CUDA) and kept it for 30m, next to the large-v3 sidecar. Measured on the HEAD
build: free RAM 7.9 GB -> 32 MB within 20 s; after this change 10.8 GB with no
Ollama model loaded until typing starts.
- single LOCAL_LLM_KEEP_ALIVE (10m) for every local request; no boot warmup
- unload this app's resident Ollama models (keep_alive 0) on quit
- sidecar POST /unload for the aux slot; captions release it on stop
- partial dictation copies only the tail window, not the whole recording
- cap the voice-conversation listen buffer at 5 minutes
- mic test: generation guard so re-entry cannot orphan lease/timers
- startRealtime: single-flight and removeChannel to stop duplicate bindings
- meeting WAV save writes header and PCM without a concat copy
Docs: AI-01 policy note, GAP-PERF-01 with remaining work.
- desktop: mock @nut-tree-fork/nut-js in the shared Vitest setup; template
tests reached the real TextInsertService and libnut killed the worker on the
display-less Linux runner ("Could not open main display").
- mobile: the knowledge realtime test now unsubscribes, so the deletion
reconcile interval no longer keeps Jest alive forever.
- set-forgejo-secrets.mjs syncs every Forgejo secret from the root .env and
refuses local URLs; SUPABASE_URL had been registered as 127.0.0.1:55321, so
payple-renew never succeeded.
Typo auto-correct (INPUT-19)
- TypoCorrectionService + core typo-correction: 2-set Korean layout
mistypes both ways, always-wrong spellings, near-misses of the user's
frequent words, optional model check re-validated in core; applied by
backspace N + paste and cancelled on new keys or window change.
Prediction quality (INPUT-20/21)
- gemma models are sent raw with the user's unfinished sentence pre-filled
into the model turn, so the model truly continues the text (mid-word
joins and spacing exact). Other models keep the instruction prompt.
- Context: text before the caret (opening lines and a fact list of names,
dates, amounts outside the 400-char window), messages just sent in the
same chat window (memory only, 30 min), personal-graph follow-ups and
IDF-ranked related sentences with Korean stemming.
- Guards: first sentence only, restated-prefix stripping (also fixes the
instruction path), repeat drop, no invented dates/names/numbers
(one retry), plain -다 register, no emoji unless the user uses them,
search-box keywords. Fill loop mixes instruction prompts for variety.
- Opt-in real-model probe: tests/integration/suggestion-quality.ollama.test.ts
Suggestions now actually show up
- Terminal (Claude Code): caret trust from the input line, not the whole
screen (status line below the box blocked every keystroke); Korean
composition counts as typing at the end; a grey placeholder filling the
empty box at once is not user text.
- Chrome: UIA focus flicker while typing no longer resets "edited".
- KakaoTalk/RichEdit: trailing paragraph mark ignored for edit position
and stripped so accepted text keeps its separating space.
- While the overlay is visible the suggestion shortcuts are captured so
Ctrl+Alt+Enter no longer also types a newline; released when hidden.
- nut-js preloaded after boot (first accept waited 4.8 s).
design.md gains the wave 2 (desktop IA) and wave 3 (popups) decisions and
what was deliberately not done. Feature catalog: SHELL-01 settings route,
new SHELL-13 IA, SHELL-14 home, SHELL-15 design system v4. Backlog:
GAP-I18N-02 rows resolved; GAP-UX-01..07 capture the backend follow-ups
reported during the overhaul (meeting notes sync, record query filters,
summary-to-transcript citations, mobile IA, unified search, main-side
cleanups, remaining locales).
A five-second phone recording took over a minute: stt-proxy waited up to
60 s for the self-hosted gateway, whose GPU endpoint was off and whose NAS CPU
Whisper needs 30-90 s per clip. With a direct provider configured the gateway
now gets 5 s plus the clip length (30 s cap).
The direct OpenAI fallback never produced a result. The production key held
characters that are not valid in an HTTP header, so every request threw while
being built; provider keys are now stripped of BOM/zero-width characters and a
still-invalid key counts as not configured. whisper-1 verbose_json reports the
language by name, which the result contract rejected; names now map to codes.
Fail-closed responses list each provider's failure (status or error class,
no secrets) so an outage can be diagnosed without log access.
Desktop transcript edits, auto-polish and speaker labels now reach the phone,
which draws meetings from transcript segments, and prompt edits of the four
shared preset commands are used by the phone's commands.
Bumps the product version to 1.9.0 (Android/iOS build 1090000).
Stripe is not used. Keeping its checkout, portal and webhook paths meant a
second payment provider, a second return-URL format and dead UI.
- Delete the stripe-checkout, stripe-portal and stripe-webhook functions and
their config; billing-catalog serves Payple prices only, and the web parser
rejects a catalog that still mixes in Stripe prices.
- Web: drop the Stripe checkout/portal buttons, provider toggle and return
notices; billing shows Payple only. Past rows with provider='stripe' are
still displayed ("Stripe (종료)") with a support contact instead of a portal.
- Desktop: delete the Stripe checkout modal, payment IPC channels, preload
namespace and their types; "Remove ads with Pro" opens the web billing page
via license.openBilling. Support/refund copy names Payple.
- billingUrl() loses the Stripe-only success/canceled result option; the
Deno contract is regenerated.
- Migrations and the DB's accepted provider values are untouched (history).
- Docs and the backlog record the removal (MON-04, EXT-STRIPE-01, GAP-BILL-03).
Verified: typecheck (desktop/web/admin/api-client/mobile), contract:check,
deno check all functions, deno test 80/80, desktop 1478/1480 on the Electron
runtime (2 known environment failures), web and admin builds, release
metadata and mobile boundary self-tests, eslint on changed files.
- .env.example lists the keys the scripts actually read (NAS_HOST/NAS_USER/
NAS_SSH_PORT/NAS_DEPLOY_PATH, web build args, Supabase access token and
project ref, CRON_SECRET, Cloudflare token/account/zone/tunnel) and drops
unused ones (DSM_HOST, NAS_DEPLOY_ROOT, NAS_ADMIN_PORT, NAS_LANDING_PORT,
APP_DOMAIN, ADMIN_DOMAIN).
- docs/map/02-infrastructure.md gains a credentials map (names only) with the
matching Forgejo/Supabase/NAS copies, plus the public routing summary.
- Deploy scripts no longer point to the removed /admin static page or portal.
- docs/REFACTOR_WAVE3_REPORT.md and the Wave 3 policy: canonical map,
production changes, verification and remaining external steps.
- Gap backlog: GAP-BILL-01 resolved; new GAP-BILL-02 (Payple renewal never ran,
Payple client key never set), GAP-WEB-01 (tunnel host for /app), GAP-OPS-01
(NAS compose/.env drift), GAP-CI-01, GAP-I18N-02, GAP-TEAM-02.
- design.md: hero loop decision (numbers taken from the app capsule), pricing
mismatch closed; feature catalog SHELL-11 updated.
- docs/map, release guide and mobile release docs no longer describe the
deleted wwwroot, binaries, Dockerfile.admin, NAS site copy or .github CI.
- docker-compose.nas.yml gains the d3ro-whisper service that only existed in
the NAS copy, so the repository file is the complete definition.
- refactor-wave skill: Wave 3 index and lessons P10-P12.
- Replace claims that contradicted the app: the default hotkey is Right Alt
(hold to talk), local features are free with no daily cap, there is no
14-day trial, Team/SSO/SCIM/ZDR are not offered, and the repository is not
public. Remove invented metrics, status badges, the competitor table, the
ad-mediation changelog, the hash calculator and the duplicate demo.
- Seven sections: hero with one labelled example, features, how it works,
privacy, pricing (Free / Pro 2,900 / Pro+ 8,900 KRW a month), download, FAQ.
Footer links the privacy policy, terms and account deletion pages.
- All copy moves into i18n and every one of the 10 locales is translated.
Pricing and cloud quotas come from site/src/pricing.ts.
- Accessibility: skip link, labelled sections, aria-expanded with Esc and
focus return for the menu, language list and FAQ, live status for the
example, reduced-motion support, 44px targets, AA contrast on the primary
button. Korean keep-all line breaking is scoped to :lang(ko) because
Tailwind's break-keep blocked wrapping in Japanese and Chinese.
- JS 111 -> 98 KB gzip, CSS 7.8 -> 5.2 KB gzip.
The speech engine now keeps an auxiliary model next to the dictation model
and transcribes with whichever the request names, reloading it once if the
engine restarted. Settings > STT gains a live-caption model so captions can
run on large-v3-turbo while dictation keeps its own model. The runtime
minimum rises to 1.7.0 because older engines would silently ignore the
model choice.
Suggestion paging moves to Up/Down: the page follows the selection and the
last item waits while more candidates are being generated. The Left/Right
page shortcuts are removed; they did nothing until a page had filled and
clash with Intel's display-rotation hotkeys.
Replaces the fixed six-second batches with a streaming track per audio
source: the uncommitted audio is re-recognised every second and sent as a
partial with its agreed (stable) prefix, a short pause finalises the line,
and long unbroken speech is committed at Whisper segment boundaries. Idle
audio is trimmed so silence cannot produce invented sentences.
Finished lines are corrected by the local model against the previous lines
and replaced in place; edits that change too much are rejected. The
behaviour can be switched off in Settings.
Next-sentence suggestions now arrive one at a time up to twelve, shown three
per page with Ctrl+Alt+Up/Down to move, Left/Right to page, Enter to accept
and Esc to close; old default bindings migrate and the panel guide follows the
live bindings. The overlay is redesigned, stays put while candidates stream
and sits outside the input box when no caret is reported.
The personal phrase memory stops learning from terminals, code editors and
the coding-agent hub, ignores symbol-heavy lines and empty-field placeholders,
and prunes existing entries that break those rules.
Fixes suggestion keys starting dictation, installs stuck on a pre-1.5.0
speech engine without the focus endpoint, Ollama runner windows flashing
while typing, the speech engine starting twice, and cold-model timeouts.
Live captions can be dragged to a remembered position and show a waiting
notice until the first line arrives.
Bumps the product version to 1.6.0 (Android/iOS build 1060000).
Notes the canonical feed now serving 1.5.0 (installer hash verified), the
runtime and portable aliases pointing at the same version, and the landing
site reporting commit 5c11ee2 / 1.5.0. Also records that the site's CI
deployment still fails without a Cloudflare API token, so this refresh went
out through an authenticated local deploy, and that the stale-alias bug found
while publishing is fixed and closed.
Adds next-sentence suggestions while typing, weekly input insights and a
personal phrase memory to the desktop app, and fixes custom instructions so
they process the text instead of inserting the instruction's own wording.
Local model requests are now bounded and individually cancellable.
Bumps the product version to 1.5.0 (Android/iOS build 1050000), refreshes the
landing and web download links, and records the new INPUT feature rows and the
open verification gaps in the infrastructure map.