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.
Learned text becomes part of a prompt, so a dictionary word or phrase
containing a newline could add its own instruction line. Every value that
reaches the recognition hint or the polish block is now flattened to one
line and length-capped, and a test proves an injected line stays plain text.
Also cover the invariants that keep the correction safe (random inputs,
Hangul untouched, idempotent, no token growth, large transcript) and the
file-transcription wiring that attaches the learned hint to every chunk and
corrects each chunk and segment before it is stored.
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 window survives a renderer crash, so the get*Window() getters never
recreated it and the popup stayed blank until the app restarted (and a
crashed suggestion overlay could still swallow clicks). On crashed, oom or
abnormal-exit the ready flag is cleared and the renderer reloads, at most
once per 30s so a renderer that keeps dying is not restarted in a loop.
The login item now passes --autostart (also used when querying it, which
Windows needs to match the registration). On such a launch the main window
is shown inactive instead of focused, flashed and pinned on top for a second,
so typing that already started in another app is not interrupted. Existing
registrations migrate on the next startup sync.