# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. > **Cross-project contracts live outside this repository.** The shared contract store is `P:\Contracts`, and **this line is the only place in this repository that names its location** - everywhere else cites a contract by its **id** and a rule or section number (`LAYOUT-SIGNAL rule 2`, `LAYOUT-PALETTE rule 5`, `SCENARIO-FILE rule 7`), never by path and never by drive letter, because whoever clones this repository has no `P:`. Its `README.md` is the index; `_meta/RULES.md` is the law, `_meta/VERSIONING.md` the compatibility rules, `_meta/REGISTRY.md` the live map of who implements what at which version. Nothing here ever keeps a **copy** of a contract: [docs/contracts/](docs/contracts/README.md) holds one short pointer per contract this product touches, and a disagreement between this repository and a contract is an amendment to write in the catalog or a dated exception to record in its registry - never a local edit. Aligned 2026-09-22; open conformance debts are [PLAN/Contract_Conformance_Backlog_v0.1.md](PLAN/Contract_Conformance_Backlog_v0.1.md). ## Project status **Implemented, builds + tests pass, launches as a tray app.** The full pipeline is coded (hook → flip → paste) and the app runs in the system tray under the 50 MB budget. The copy→paste flip still needs interactive manual verification with a real selection (per the spec's manual-test plan); unit tests cover the pure logic. What exists: - `src/CyrFlip/` - the app (net48 WinForms): `TransliterationEngine`, `CaseFlipEngine`, `Hotkey`, `KeyboardHook`, `ClipboardHandler`, `CursorIndicator` (layout indicator), `Autostart`, `AppConfig`, `WindowInterop`, the `CyrFlipContext` tray shell, the `TrayChordList` / `TrayHoverStateMachine` / `TrayHotkeysPopup` tray hover overview, the `Launcher*` module family (the absorbed OneClickRunner scenario launcher, feature 5 below) and the text context menu (`MouseHook`, `MouseChord`, `SelectionProbe`, `LaunchTarget`, `TextContextMenu`, feature 7 below), plus the log bundle the user mails to the author (`SupportBundle`, `MailSender`, `SupportBundleDialog`) - all implemented. - `tests/CyrFlip.Tests/` - xUnit (`TransliterationEngine` + `CaseFlipEngine` + `Hotkey`). Internals are visible to tests via `InternalsVisibleTo`. - The **quick notes** (`QuickNote*`, feature 8 below) - the local RAW notepad - are implemented, unit-tested and built in all 13 languages; the chord, the window and the context-menu capture still want a human at the keyboard (`tools/uitest/Test-QuickNotes.ps1`). - `assets/` - `cyrflip.ico` (app icon: text caret + EN/RU label), `banner.png`, `social-preview.png`, generated by `tools/IconGen` (run `dotnet run` in that folder to regenerate). - `docs/` - GitHub Pages site (served from `/docs`). `index.html` is the English landing and `ru/index.html` / `uk/index.html` the Russian and Ukrainian ones (ticket `S0024` P3.6: three standalone pages with their own `lang`, hreflang alternates and the 13-language row, no CSS `data-lang` switch and no script that rewrites the share-card tags; `docs/en/index.html` stays a `noindex` forwarder; `?lang=ru|uk|ua` on the root is forwarded by its pre-paint script); the **full guide stays EN/RU/UK** (`guide.html`, `docs/ru/`, `docs/uk/`) - as does `store.html`, the Microsoft Store channel page (`SITE-REPRESENTATION` rule 4, ticket `S0054` D2), and the Support and FAQ pages (`support.html`, `faq.html`, ticket `S0024` Q13; every page's footer links them, the other 10 locales to the English pages), while each of the other 10 UI languages gets a **standalone first page** at `docs//index.html` with its own `lang`/`dir`, hreflang alternates and the same 13-language row. The **privacy policy exists in all 13** (`docs//privacy.html`; `privacy.html` at the root is the English original and every translation links back to it as the authoritative text, saying outright that it prevails on any discrepancy) - it is the one page with an outside obligation, since the Store listing points at it in every language. All twelve translations are structurally identical (18 list items - the last of the first list is the Store package's `runFullTrust` - and the "Usage counts" paragraph after the second list, 8 sections - the eighth, "This website", names the one third-party origin the site contacts, `api.github.com`), which is the cheap way to catch a section dropped in translation. Those pages are generated copy - edit them directly, there is no build step. The site serves its own typefaces (`docs/assets/fonts/`, OFL, notice in `THIRD-PARTY-NOTICES.txt`), so no font host is contacted; every content page carries the language row (endonym plus code) and writes `sza-lang` for RU/EN/UA on a click (ticket S0053). The 13 landings state the release (version, date, the versioned ZIP and its `.sha256`, the landing JSON-LD `softwareVersion`) only from `tools/site/release-facts.json`, which `tools/site/Render-ReleaseFacts.ps1 -Version ` writes and `tools/site/sync-doc-quality.py` renders; the release preflight checks HEAD states the version it releases (S0024 F16, owner decision 3 of 2026-11-10), and the block is outside the content fingerprint, so a release moves no translation stamp. The site is declared at the **guide tier** of `SITE-STRUCTURE` / `SITE-EXPERIENCE` / `SITE-REPRESENTATION` (ticket S0049: pointers in `docs/contracts/`, the measured gaps in S0051-S0054); `tools/site/Measure-SiteContracts.ps1` (operator-typed, headless Chrome) reads the rendered pages against the rules a machine can decide, and `tools/site/Test-SiteConformance.ps1` is the older S0017 gate. `winget/` - manifest templates. `.github/` - CI + release workflows, issue/PR templates, dependabot. `build.ps1` - local build + deploy. - The **exchange server clipboard** (`Exchange*`, feature 16 below, ticket S0074) is implemented, unit-tested against a scripted server and the real server's transcripts, built in all 13 languages; the live check against the owner's server (`tools/uitest/Test-ExchangeClipboard.ps1`) and the joint runs between programs want a human. - `PLAN/` - the ticket store (local-only, gitignored). One ticket = one spec file `PLAN/Sxxxx_.md` with `**Ticket:**`, `**Status:**` (canon vocabulary: Draft, Approved, Tactical, In Progress, Implemented, Verified, Partial, Block*) and a literal `**Blocked by:**` line; an optional `PLAN/Sxxxx_/` folder holds its `research/` and tactical `INDEX.md` + `PHASE_NN__*.md`. Order and package live in `PLAN/RELEASE_QUEUE.md`, finished work in `PLAN/RELEASE_READY.md`, closed ticket files in `PLAN/done/`. The spec is in Russian and lives in [PLAN/done/KeyboardTransliterator_Specification_v1.0.md](PLAN/done/KeyboardTransliterator_Specification_v1.0.md) (moved to `PLAN/done/` now that it's implemented). The Markdown file is the single source of truth; the original Word `.docx` was dropped (recoverable from git history if ever needed). Note: the empty `dev/` directory predates the scaffold and is unused - code lives in `src/`. ## What CyrFlip is - **Settings file transfer (S0055 settings-file)** - General-page export/import/restore of private JSON v2 (S0072), with the v1 reader retained. The allow-list includes app chords, module preferences, geometry, traffic-light targets and verbatim scenario XML; recorded content, credentials and Windows input state stay local. Default-on rolling backups keep three files in Documents/CyrFlip/Backups, gated until the startup restore question is settled. Restore uses the import preview and transaction; deferral preserves the recovery backup. Import previews the resulting configuration, requires explicit recording/remote-server consent, and keeps three local snapshots. `SettingsFile*`, `SettingsImportPlan`, `SettingsSnapshot`, `SettingsTransferDialog` and `CyrFlipContext.SettingsTransfer` own the format, validation, transaction, preview and live refresh. `SettingsBackupEnabled` is exported; `BackupOfferOpen` and `BackupRestoreDeclined` are local machine history. `settings-file.log` holds counts, key names and reason codes only; backups never enter a support bundle. - **First-run welcome tour (S0055)** - five pages on a new profile, immediate language/autostart edits and live feature switches (each flip applied like the settings window applies it), and a General-page settings handoff. Skip/close keeps defaults; About replays it. Existing or migrated profiles are never nagged; an explicit `WelcomeShown=0` requests replay. CyrFlip is **a tray toolkit for your keyboard and desktop** (decided 2026-10-07, ticket S0058). The list below is the internal map of its features; **how the product is named and introduced, and the order its features take on every public surface, is [POSITIONING.md](POSITIONING.md)** - the one positioning source, held by `tools/site/Test-Positioning.ps1` (run by `build.ps1` and the release preflight), which also guards the frozen anchors (exe and assembly name, store names and identities, the extension id). The product name stays `CyrFlip` everywhere it identifies; the descriptor never enters a window title, an identifier or a store `Title`. The features: 1. **A live layout indicator where you type** (the first item of the first pillar, "Type in the right layout" - on by default, and what people search for, but one group among five, not "the headline"). Three surfaces, all driven by `CursorIndicator.LayoutChanged` (which carries `(code, klid, capsOn)`) and updated live: - the system **I-beam** mouse cursor is replaced with a caret carrying the EN/RU/UK marker (`LayoutCursor`, `SetSystemCursor(OCR_IBEAM)`); - a small marker **pinned next to the blinking text caret** (`CaretOverlay`) - because the mouse pointer is often an arrow while typing, so the caret is where the layout actually matters; - the **tray icon** (`CursorIndicator.RenderIcon`). When **CapsLock is on**, all three draw a **1px layout-colour frame** around the marker (`LayoutStyle.DrawCapsFrame`; a dark ring in the caret-overlay dot mode) so the CapsLock state is visible right where you type. Three rules govern how the marker looks, and all three are testable rather than a matter of taste: - **It is translucent** (`LayoutStyle.MarkerOpacity` = **0.6**) beside the caret (the overlay window's `Opacity`), on the mouse pointer (the badge is composed on its own layer and blended in with a `ColorMatrix`) and in the VS Code extension (which reads the same number from `layout-colors.json`) - it sits on top of the user's text all day. It started at 0.85 and that was translucency nobody could see: on a dark editor background the badge read as solid. The **I-beam itself stays opaque** (a pointer you can see through is a worse cursor, not a subtler one), and so does the tray icon, where translucency would only make a 16px icon muddy. - **The letters are fitted to the badge, not typeset into it** (`LayoutStyle.DrawCode`): the glyph outline is built, **flattened**, measured and scaled so its ink touches exactly one pixel from every edge. `MeasureString` reserves room for ascenders, descenders and leading that two capitals never use, and `GetBounds` on an unflattened path answers with the box around the Béziers' *control* points - together they left the code floating in the middle of a visibly roomier badge. - **The colour names the layout, the letters name the language.** The two letters are a language and always will be (US-International does not fit in a badge a few pixels wide), so the 25 keyboard layouts of the 13 curated languages, plus British English (`WorldLayouts.ColouredOnly` - coloured but never installed by the popular-languages button, S0085), each get their own shade **inside their language's hue** (`LayoutStyle.Layouts`, keyed by KLID) - Russian is always red, English always blue, but Russian Typewriter is a different red from Russian. In the overlay's **dot mode** that colour is the entire marker. Which layout is live comes from `LayoutIdentity`: an HKL's high word is the language id again for a language's primary keyboard, and `0xF000 | LayoutId` for every other, where `LayoutId` is what Windows stores beside the layout in `HKLM\..\Keyboard Layouts\` (verified live: US-International loads as `F0010409`, Russian Typewriter as `F0080419`). Everything outside those 13 languages is one neutral colour, `LayoutStyle.Other` - the letters still name the language (PL, JA, TR), and there is no honest way to hand out distinct recognisable colours for the ~218 layouts Windows ships. This replaced a per-code hash that gave every uncurated layout its own bright hue, which looked as deliberate as the curated ones while meaning nothing and could land right next to Russian's red. 2. **Secondary: one table of layout→layout conversions (open-ended, not a fixed option).** Any number of rows, each "from layout → to layout" with its own global chord - e.g. Ctrl+Shift+F12 = EN⇄RU, Alt+Shift+F12 = EN⇄UK, Ctrl+Alt+F12 = RU⇄UK. **This is the only home of these chords**: the original EN⇄RU flip is not a separate feature any more, it is an ordinary row seeded on first run (`AppConfig.NeedsFlipRow` / `FlipRow`, called from `Load()`; US `00000409` ⇄ Russian `00000419` on `AppConfig.DefaultFlipHotkey` = Ctrl+Shift+F12), editable and deletable like every other. An older config is migrated once: the old `Hotkey` / `EnableFlipHotkey` values become that row's chord and switch, then both registry values are deleted. **Those two values, not the emptiness of the table, are the migration marker** (`AppConfig.NeedsFlipRow`) - seeding fires when the table value is absent *or* when it is present but empty while the legacy values are still there (the config a build that had the table but not yet the merge left behind). Once they are gone a table the user empties stays empty. Rows live in `AppConfig.LayoutConversionProfiles` (`LayoutConversionProfile`, JSON in one registry value), are edited on the **"Исправление текста"** settings tab (S0062 - it was "Конвертация раскладок" until the case fix moved beside the table; the page key is still `SettingsPageKey.Conversions` and the Welcome tour keeps its own row caption), and are bound in the hook by `KeyboardHook.UpdateConversionProfiles` (an immutable snapshot array swapped atomically, so the hook never walks a list the UI is editing). The conversion carries **no alphabet table of its own**: `KeyboardLayoutConverter` asks Windows for both layouts' mappings, so it covers whatever the user has installed, and each pair is **bidirectional**: when the pair's target layout is already active, `ClipboardHandler.ConvertLayout` applies it in reverse (`KeyboardLayoutConverter.IsActiveLayout`), so one chord fixes text typed either way - hence the "⇄" in the UI. **The direction is then decided again per character**, not once per press: a character the source layout cannot produce at all was typed the other way round and is converted back, so `ghbdtnпривет` comes back as `приветghbdtn` instead of the doubled `приветпривет` a whole-string direction produced. Beside it sits the one part of the conversion that is a **preference rather than a fact**: a key that is punctuation in *both* layouts (`/` against `.`, `@` against `"`) carries no evidence of which layout the user meant - the numpad `/` is the same character everywhere and is indistinguishable once the text is on the clipboard - so `AppConfig.ConvertSymbols` (default **on**, i.e. the historic behaviour) decides whether it is swapped. A key whose other side is a **letter** (`,`→`б`, `[`→`х`) is never ambiguous and is converted whatever that switch says. The one exception is the **US ⇄ Russian pair**, which falls back to the hand-written `TransliterationEngine` table when Windows can't map the pair (the Russian keyboard was never installed) - CyrFlip's headline conversion has to keep working there, and it is the only pair we have a table for. `WorldLayouts.Popular` is the curated 13-language starter set (the world's ten most-spoken - EN/ZH/HI/ES/FR/AR/BN/PT/RU/UR - plus DE, IT and UK, with the common variants per language) behind the "Add 10 popular languages" button, and `WorldLayouts.CodeForKlid` is the shared KLID → two-letter code used by the table and the tray tooltip. 3. **Case flip (fix CapsLock).** A second global hotkey (default **Ctrl+Shift+F11**) copies the selection, inverts each letter's case (UPPER↔lower, `CaseFlipEngine`), and pastes it back - the "I left CapsLock on" fix. Same copy→transform→paste pipeline as the flip; its own user-configurable hotkey, on the **"Исправление текста"** page beside the layout table (group "Регистр"). Optional **"Synchronize CapsLock after case correction"** toggle - in the same group - (the case-flip counterpart of "Change the language after the flip"): after a successful case flip it **sets** the physical CapsLock key to match the corrected text - on when it ends in a capital, off when it ends in a small letter (`CaseFlipEngine.DesiredCapsLock`, the **last cased letter** deciding because that is where typing continues) - so continued typing matches what is now on screen. It is an absolute state, not a blind toggle, and that is the whole point: a toggle is only right while CapsLock still holds the state that produced the wrong text, so correcting the same text twice, or correcting it after the user had already pressed CapsLock by hand, left the key exactly backwards. A selection with no cased letter at all (digits, punctuation, a caseless script) says nothing about CapsLock and leaves it alone. 4. **A self-contained "Языки Windows" tab (settings editor for Windows' input config).** Goal: the user never has to open the Windows "Language & region" pane. The tab in `SettingsForm` manages three Windows settings, all writing **system** state, not CyrFlip state: - **Keyboard layouts** (`InputLayouts.cs`) - install / remove / reorder / set-default any of the ~218 layouts Windows ships (incl. the Ukrainian keyboard). **Nothing is downloaded** - layout DLLs are already present; installing a *display-language pack* stays Windows' job (deep-linked via `ms-settings:keyboard`). - **The whole-cycle switch chord** (`Keyboard Layout\Toggle`) - a dropdown: Alt+Shift / Ctrl+Shift / `` ` `` / off. - **Direct per-language hotkeys** (`LanguageHotkeys.cs`) - "Ctrl+1 → English", "Ctrl+2 → Russian" etc., which **Windows handles, not CyrFlip** (`KeyboardHook` never matches or swallows them; they survive the app being closed). Motivating case: a mouse-macro presses Ctrl+1 and can then count on Latin input. See [PLAN/done/LanguageHotkeys_Spec_Idea_v0.1.md](PLAN/done/LanguageHotkeys_Spec_Idea_v0.1.md). Both modules take a one-time pre-CyrFlip registry snapshot (`AppConfig.LanguageHotkeysBackup` / `InputLayoutsBackup`) with a "restore" button, and warn honestly that a change may need a Windows sign-out/in to fully settle. 5. **Scenario launcher ("Быстрый запуск") - the absorbed OneClickRunner, opt-in and off by default.** `EnableScenarioLauncher=0` means CyrFlip behaves exactly as before the feature: no tray entry, no taskbar button, no Jump List tasks, hook snapshot empty. When enabled: user scenarios (program/script with args/workdir/ `RunAsAdmin`, or **yt-dlp** downloads that prompt for a link) run from **five surfaces** - the tray **Launcher submenu**, the settings table, an optional **per-scenario global hotkey** (a CyrFlip extension over OneClickRunner), and, on the **taskbar button** the feature brings with it (`LauncherTaskbarWindow`), both the **Jump List** on right-click (`LauncherJumpList`, hand-rolled COM `ICustomDestinationList`/`IShellLinkW` - no WPF; no explicit AUMID, portable rides the exe-path identity, MSIX the package identity) and the same list as an ordinary **menu on left-click**. A tray-only app has no taskbar button at all, which is why the Jump List used to be reachable only from a pinned shortcut. That button, and the header of the settings page, carry the icon OneClickRunner shipped (`LauncherBrand`) - the one place the absorbed program's own mark is kept, deliberately narrowing the "never OneClickRunner branding" rule of tech plan §2.3 to *scenario icons and the app's own identity*, which still use CyrFlip's icon. All five go through one `LauncherExecution.Launch` path (validation → interpreter → UAC only when `RunAsAdmin`; the untrusted yt-dlp link travels in an **environment variable**, never concatenated into the cmd line). Storage is **`%APPDATA%\CyrFlip\Scenarios`, one `{guid}.xml` per scenario**, XML-compatible with OneClickRunner's `AppItem` (plus the extra `Hotkey` element OneClickRunner ignores). A Jump List task starts a second `CyrFlip.exe` with `/launcher-run:{guid}`; it forwards the command to the live instance over the **named pipe** (`LauncherIpc`, `CyrFlip_Launcher_{userSid}_{sessionId}`, current user only) and exits - or, with no live instance, does a OneClickRunner-parity **one-shot launch without hook/tray** (releasing the single-instance mutex first, so an open yt-dlp prompt can't block a real launch). First enable offers a **one-time, non-destructive migration** from `%APPDATA%\OneClickRunner\Scenarios` (source never written; Guids preserved unless colliding) or seeds a localized Calculator sample; the `LauncherFirstEnableDone` marker guarantees an emptied list is never re-nagged or reseeded. The "Импорт из OneClickRunner..." button repeats the import deliberately. Spec: [PLAN/done/OneClickRunner_Absorption_Spec_Idea_v0.1.md](PLAN/done/OneClickRunner_Absorption_Spec_Idea_v0.1.md) (v0.2) + tech plan + `PLAN/OneClickRunner_Source_Manifest_v0.1.md` (SHA-256 of every source file). 6. **Built-in translator on a local Ollama ("Перевод"), opt-in and off by default.** `EnableTranslate=0` means no chord is bound, no tray entry, and **CyrFlip opens no socket at all**. Enabled, it is a second open-ended table - rows of "translate the selection into this language, on this chord" (`TranslationProfile`, `AppConfig.TranslateProfiles`, bound by `KeyboardHook.UpdateTranslationProfiles` with the same immutable-snapshot discipline as the conversion table, and included in the RDP-deferral condition). A row's target is a language code or one of two live tokens resolved **when the chord fires**: `ui` (the CyrFlip UI language) and `active` (the layout live in the target window) - `TranslationLanguages.Resolve`. The answer streams into a popup **beside the mouse pointer** (`TranslationResultWindow`) that never steals focus, and can optionally be copied to the clipboard - where the history records it like any other copy, which is the point - or pasted over the selection. **The pipeline is three-phase on purpose** (spec §4): capture and delivery hold the existing `_busy` clipboard guard, the seconds-long model call runs **outside** it, so a translation never blocks the headline flip. Everything that owns the clipboard - the optional copy *and* the optional paste - runs on **one** guarded worker (`DeliverTranslation`): writing the result from the UI thread instead let a flip's copy poll pick the translation up as if it were the user's selection. Dismissing the popup (Esc, ×, the auto-close timer, switching windows) **cancels** a translation still in flight, and a result that arrives for a hidden window is dropped - otherwise an answer could paste itself into whatever the user moved on to. `TranslationService` owns the feature logic (prompt, one retry on an empty or echoed answer, model choice, the 4000-character cap), `OllamaClient` the protocol, `OllamaManager` the process. **An MSIX build never downloads or runs the Ollama installer** (`OllamaManager.CanInstallInPlace` - Store certification); it opens ollama.com instead. Ollama and the model are the user's own one-time install: CyrFlip bundles neither and has no key or account. Spec: [PLAN/done/Translator_Spec_Idea_v0.1.md](PLAN/done/Translator_Spec_Idea_v0.1.md). 7. **CyrFlip's own context menu over the selection ("Контекстное меню"), opt-in and off by default.** `EnableContextMenu=0` means the **`WH_MOUSE_LL` hook is not installed at all** - a hook that sits in the path of every mouse move on the machine must not exist for a feature nobody switched on. Enabled, a mouse chord (`MouseChord`, default **Ctrl + right click**, stored as an invariant token in `ContextMenuChord`) is swallowed - down **and** up (a low-level hook never sees a double-click message; the second down of a fast double click is swallowed like the first), because most apps open their menu on `WM_CONTEXTMENU`, which arrives after the release - and CyrFlip's own menu opens at the pointer: Copy/Cut/Paste first, then - only when the selection itself parses as something openable - **"Открыть «…»"** (`LaunchTarget`, below), then the live conversion rows, the case flip and the translation rows, then the Launcher submenu and the history window, then Settings, and **last** the two report lines ("Выделено строк: N / символов: M" - `SelectionStats`, drawn as `ToolStripLabel`s so they are captions rather than commands, and omitted entirely when the selection could not be read). Last because the menu opens *under the pointer*: whatever is at the top is what the hand is already on, and that place belongs to Copy, where every other context menu in Windows puts it. The chord list is **fixed** (six options) rather than a capture dialog because the right button **must** carry a modifier, or CyrFlip would eat every context menu in Windows; `MouseChord.TryParse` rejects a bare right click even from a hand-edited registry. **Why our own menu and not Windows'**: the menu of a modern app (Electron, WinUI, WPF, Qt) is drawn by the app and has no `HMENU` at all, and editing a real Win32 `EDIT` menu needs a native DLL injected into every process - the end of "one exe, no dependency" and an automatic Store rejection. `TextContextMenu` is a pure static builder (`ContextMenuStrip`, whose `ShowWithoutActivation` is already true, so **the menu never takes the focus and the selection survives**), and the launcher submenu comes from the very same `LauncherTrayMenu.Fill` as the tray and the taskbar button. Greying follows `SelectionProbe` (§ below); a drop-down owned by a non-foreground process never sees the click that should dismiss it, so `MouseHook.ForeignButtonDown` closes it - `SetForegroundWindow` (the taskbar button's trick) is forbidden here, it would take the focus this whole feature exists to keep. The keyboard opens the same menu with **`Ctrl+Shift+Alt+M`** (`TextMenuHotkey`, S0045 K2) at the caret; opened that way the menu does take the foreground - the arrows have to reach it - through a hidden window of ours, and hands it back when it closes without a command. Spec: [PLAN/done/ContextMenu_Spec_Idea_v0.1.md](PLAN/done/ContextMenu_Spec_Idea_v0.1.md). 8. **Быстрые заметки ("Быстрые заметки"), opt-in and off by default.** `EnableQuickNotes=0` means the journal file is **never read and never created**, there is no tray entry and no chord is bound - a place people put tokens and internal code does not get to exist because a checkbox was left at its default. Enabled, **Ctrl+Shift+Alt+N** (`AppConfig.QuickNotesHotkey`) opens `QuickNotesWindow` with a new note and the caret already in the body; the tray entry and the text context menu's **"Сохранить выделение в быстрые заметки"** are the other two ways in, the latter going through the translator's phase-A capture (synthesized Ctrl+C, clipboard handed straight back, history suppressed - the copy is scaffolding, not a copy the user made). Four decisions carry the feature: - **The text is never touched.** No Markdown, no highlighting, no smart quotes, no tab expansion; the store round-trips CRLF, LF, tabs and non-BMP text byte for byte (`QuickNotesStoreTests`). The one honest limit is the Win32 edit control: an **untouched** note is never rewritten (the editor's text is compared against what it was handed), but an **edited** one comes back with the control's CRLF. - **A name is optional and a blank one is `null`, not «Без имени».** The list caption is derived on the way to the screen (`QuickNote.Preview`) and never written back, which is what makes editing the first line of an unnamed note harmless. - **Order is creation time, newest first, and nothing else** (`QuickNotesOrder`) - editing an old note must not move it. `UpdatedAtUtc` is metadata. Ties break on `Id` descending so the order is total; the incremental `Insert` is proven equal to the reference sort over a thousand random operations, the same discipline as `ClipboardHistoryOrder`. - **Search is the index, not a convenience**: most notes have no name, so it looks in the title, the raw text and every checklist item at once, from the first character, keeping the standard order rather than inventing a relevance score. Storage is `quick-notes.log` in the MSIX-aware folder: an append-only journal of create/update/delete, **the whole record DPAPI-encrypted, not just the payload** (a title names a customer as often as a body holds a token), replayed **on the pool** at first use (the window opens in a "loading" state - the UI thread is the hook's thread), compacted **in the background** once the journal holds `QuickNotesStore.CompactAfterOperations` (500) records more than a fresh snapshot would - not a flat 500, which rewrote every note on every save for anyone with 500 notes - and on exit, via `File.Replace` - atomic on success, and the previous journal becomes the `.bak` in the same call; a failed replacement keeps its complete `.tmp` if recovery also fails. An append restores a missing journal before writing a new record, and a failed or partial replay disables writes until restart. A compaction that failed waits for another 500 records instead of re-encrypting everything on the next save (S0035 QN2-8). A line that will not read is skipped, counted, reported once **and carried through every compaction verbatim** when it is a whole ciphertext (a DPAPI key can come back) or opens but is no record (a later format); a **fragment** a kill left mid-append - told apart by walking the DPAPI blob's length-prefixed fields (`QuickNotesCipher.IsWholeBlob`, a cipher's optional `IQuickNotesCipherShape`) - is dropped by the compaction the load itself asks for, so it is warned about once, not at every start (QN2-2). A missing journal is restored from its complete `.tmp` or `.bak`; read or recovery failures have their own warning. Every record is written with a **leading** line break, so a torn tail costs only itself. A note is rewritten only when it was edited, and a note deleted this session is never committed again (ticket S0006). **A write that fails stays pending** - the note (or delete) goes back to the debounce, retried after 5 s or on the next save, and the window shows the failure until a write succeeds (`SaveFailing`/`SaveRecovered`, QN2-1); it used to be cleared as saved and overwritten on screen at once. "Delete every note" also removes the crash-left `.tmp` and the migration's kept journals (QN2-3). The count goes to `quick-notes-diagnostics.log` and the note text goes nowhere. `SupportBundle.ExcludedFiles` now holds **two** names: the journal is as off-limits as `clipboard-history.log`. Google Keep is a **manual clipboard transfer** and says so - the Keep REST API is a Workspace-administrator interface, unusable from a personal account, so CyrFlip does not pretend to sync. Spec: [PLAN/done/QuickNotes_Spec_Idea_v0.1.md](PLAN/done/QuickNotes_Spec_Idea_v0.1.md). **One deviation from the spec's §7 file list:** there is no `QuickNotesCapture.cs` - the capture is `CyrFlipContext.CaptureSelectionIntoQuickNote`, beside the translator's identical phase A, because it needs the context's `_busy` guard, `_clipboard` and history suppression and a separate class would only plumb all three back out. **Line numbers (S0078, `QuickNotesLineNumbers`, off by default, applied live):** a strip beside the editor, numbered by **logical** line (CRLF, LF and lone CR are one break each - `QuickNote.LineCount`'s rule). A wrapped line is numbered once, at its first row; when its start has scrolled out of view, its first visible row repeats the number once with a "↳". The numbers are never in the text, the clipboard, an export or the journal, and showing, scrolling or toggling them writes nothing. Spec: [PLAN/done/S0078_quick-notes-line-numbers.md](PLAN/done/S0078_quick-notes-line-numbers.md). 9. **The app theme - "Как в Windows" / "Светлая" / "Тёмная" (ticket S0020, `APP-STYLE` sections 2-5).** One theme for every window, dialog and menu, chosen on the General tab (a drop-down like every other picker, stored as the invariant token `Theme` = `system|light|dark`, default `system`) and applied **at once, no restart**; in `system` it follows Windows' `AppsUseLightTheme` **while running**. Four decisions carry it: - **Light is exactly what WinForms draws unthemed.** Controls are **built in `ThemePalette.Light`** (system colours plus the two literals the settings window always had, now the `accent` and `warning` roles); `ThemeApply` records each control's built state once and maps a built colour to its role (`ThemePalette.RoleOfDesignColor`). Dark assigns the role's dark value; light and high contrast put the record back. `ThemeCoverageTests` proves light-after-dark restores every property it touched. - **High contrast wins over every mode**: nothing of ours is drawn - the tree goes back to system colours and owner-drawn parts use `ThemePalette.HighContrast`, followed live like a theme switch. The flag is read with `SPI_GETHIGHCONTRAST` each time (`ThemeManager.SystemHighContrast`, S0036 UI-2): net48's `SystemInformation.HighContrast` stays cached until the framework's own handler runs, which comes after ours, so a toggle used to resolve against the old value. A list row built in a role colour (the support-bundle dialog's muted "not included" row) is mapped like a control (UI-6). - **The layout marker is not themed** - `LAYOUT-PALETTE`; its colours name a layout. Declared at `LayoutStyle.cs` and `CaretOverlay.cs` per `APP-STYLE` rule 5. - **No colour literal lives outside `ThemePalette.cs`** and the marker's files, and **no `MessageBox.Show` outside `Program.Fatal`** (`ThemeSourceGateTests`) - WinForms has no resource scope, so this gate plus the re-apply walk is what `APP-STYLE` rule 3's "only dynamic references" means here. Every message and confirmation goes through **`ConfirmDialog`**: Escape and the close box give the safe answer, and a destructive question (delete, clear, restore, run a program from a selection) paints its Yes in the `danger` role and defaults to No. Declared exceptions (Windows draws them): balloon tips, the Jump List, the common file dialogs, native tooltips, the track bar's channel and thumb, the numeric up-down arrows, disabled combo boxes, and the quick-notes checklist's (empty) list header. Spec: [PLAN/done/S0020_dark-theme.md](PLAN/done/S0020_dark-theme.md) (v0.2). 10. **The open exchange file - "Перенос на другой компьютер" (ticket S0023).** One plain UTF-8 text file, "CyrFlip Exchange Text v1", carrying quick notes and a chosen slice of the clipboard history to another PC or a phone: `Экспортировать...` / `Импортировать...` in the quick-notes window ("Перенос..."), the history search window and a row on both the clipboard and the quick-notes settings pages. It is **open on purpose** - no DPAPI, no base64, no password; the export dialog says so beside the button that writes it (every time history is included; `ExchangeNotesWarningOff` may silence it for notes-only), and the defaults take notes + pinned history only, never the whole history. It is a **snapshot, not a storage format**: the journals stay DPAPI and may change on their own, v1 is frozen by the files people already hold. Four rules carry it: **payloads are verbatim** inside a backtick fence longer than any run in the text (framing is LF, a payload's own CRLF survives; a file converted to CRLF as a whole is detected by its marker line); **a clipboard block's `Id` is `sha256:` of its raw UTF-8 text** - the history's own id - and a text that no longer hashes to it is refused; **the import is additive** - preview first (`PlanImport` on both services, re-planned at apply time), a note replaced only by a strictly newer `Updated-At` (a tie keeps the local one, `CreatedAtUtc` is never rewritten), a pin never removed, nothing deleted, a hand-written `## Note` without an id imported only after a yes; **a bad block costs itself** (reported with its line), except an unclosed fence, which swallows the rest. Caps: 25 MB file, 128 KB per history text, 512 KB per note, 4 KB per metadata line, 10 000 objects. Dates are written to the second and truncated, so a re-import never "updates" a note with itself. Notes are skipped while the quick notes are off, history entries while the history is off. CyrFlip never sends, opens or watches the file. Spec: [PLAN/done/S0023_history-notes-exchange-and-features.md](PLAN/done/S0023_history-notes-exchange-and-features.md). 11. **The "Снимки экрана" settings tab (it was "Графика" until S0062; page key `SettingsPageKey.Graphics`) and its capture tools: the screen region capture (ticket S0026), the full capture and the draw-on-capture module (ticket S0071).** Deliberately **no module switch for the captures and no tray submenu** (owner, 2026-09-26: an extra switch and one more menu level make the command slower to reach) - the tab groups the settings, the tray has top-level **"Снимок области экрана"** and **"Снимок всего экрана"** items that are always there, and each chord has only its own switch (`EnableScreenshotHotkey`, `EnableScreenshotFullHotkey`, both on). The area chord (`ScreenshotHotkey`, default **Ctrl+F12** since S0071 - the shipped **Ctrl+PrintScreen** "never fired" for the owner, so the capture defaults moved to the F-key family the hook provably intercepts; `Hotkey` still parses `PrintScreen`/`PrtSc` for a manual bind, and `HotkeyDialog` captures PrintScreen on the key-**up**, since Windows posts no key-down for it), the tray item or the settings button **freeze every screen first** (`ScreenCapture.Grab`, one `BitBlt` with `SRCCOPY | CAPTUREBLT` - `CopyFromScreen` drops layered windows, i.e. the tooltip the chord exists to catch), then `RegionSelectionOverlay` shows **one window per monitor** painting its slice of that one frame (a single window across mixed DPI is rescaled by Windows), with one selection rectangle in virtual-screen physical pixels. The **full capture** (`StartFullCapture`, `ScreenshotFullHotkey`, default **Ctrl+F11**, tray item "Снимок всего экрана") skips the selection: one freeze of the virtual screen straight to `DeliverScreenshot`. **Re-entry is guarded, not queued** (S0071 5): no capture of any kind starts while the selection overlay or the annotation editor is up (`CaptureBusy`) - a `BitBlt` with `CAPTUREBLT` over a live overlay would put the overlay's own dimming into the picture. The cropped region goes to the clipboard as **`PNG` + `CF_DIB`** of the same pixels in one open (`Win32Clipboard.TrySetImage`, `ClipboardImage`), under the `_busy` guard for the write only; the user's previous clipboard is replaced, not restored, and on cancel it is never opened. **"Also save to a folder"** (`ScreenshotSaveEnabled`, **on by default since S0071** - existing profiles keep their stored value; the flip obliged the privacy wording on the settings page) writes the same PNG bytes per `CAPTURE-OUTPUT` (kind `screenshot`): `screenshot_yyMMdd_HHmmss[ (n)].png` with invariant digits and the freeze time, the ordinal checked against the folder itself, temp-then-no-replace-rename, default `FOLDERID_Screenshots` with no product subfolder, fallback Screenshots -> Downloads **always told** by a balloon (`ScreenshotSaver`, file system behind `IScreenshotFileSystem`). The folder the captures land in opens on **its own chord** (ticket S0057): `ScreenshotFolderHotkey`, default **Ctrl+F10** since S0071 (was Ctrl+Shift+PrintScreen - same dead-key problem), **bound only while saving is on** and its own switch (`EnableScreenshotFolderHotkey`) is - with saving off the keystroke passes through (`ScreenshotFolderChordLive`, the text menu's D2 discipline; going live is checked like assigning it, KC-6). `ScreenshotFolderTarget` picks the target - the folder the settings show (`ScreenshotSaver.DisplayFolder`), else the remembered folder of this session's last fallback save (D4, `_lastScreenshotFolder`, in memory only), else one of two balloons; a remote path (`LaunchTargets.IsRemotePath`) is never probed but handed to the shell. `ScreenshotFolderOpener` runs the `Directory.Exists` probe on a **pool worker** (S0030 HT-1: the UI thread is the keyboard hook's thread) and opens through the shell; the settings button "Открыть папку" goes through the same opener, so the chord and the button can never disagree about the target. The chord is ignored while the region overlay is up. The caret badge and the translation popup are `WDA_EXCLUDEFROMCAPTURE` (S0026 4.2) - they also vanish from other tools' captures and screen shares. **The draw-on-capture module (S0071, on by default - `EnableScreenshotAnnotate`):** two more chords (`ScreenshotAnnotateAreaHotkey` **Ctrl+Alt+F12**, `ScreenshotFullAnnotateHotkey` **Ctrl+Alt+F11**, each with its own switch, both bound only while the module is on - the first shipped chords on the Ctrl+Alt plane, safe because `ChordMatcher` tells AltGr from a real Ctrl) run the capture and hand the frozen frame to `AnnotationEditor` instead of delivering: the region at full brightness, everything outside dimmed, and a translucent (`Opacity` 0.90 - S0093's computed floor: the lowest at which its body text and button captions hold 4.5:1 over any desktop) draggable `ScreenshotToolbar` near the pointer - six shape tools (ellipse, filled ellipse, rectangle, filled rectangle, line, arrow), an object eraser, eight fixed swatches (`AnnotationPalette` - content, not theme, the LAYOUT-PALETTE precedent), Clear, Cancel, OK, and Ctrl+Z. **Shapes are objects** (`AnnotationShape`), never pixels: OK composes them onto a copy of the frame in commit order (`AnnotationComposer`), so the toolbar and the dimming cannot enter the picture by construction and no `WDA_EXCLUDEFROMCAPTURE` is needed; the composed copy goes to `DeliverScreenshot` with the **original freeze instant** in the name. Cancel (button, Esc, focus lost, `WM_DISPLAYCHANGE`) delivers nothing. One stroke width: 3 physical px x the DPI of the monitor under the pointer at editor open. **The toolbar is a topmost window of the same band as the per-monitor editor windows, and activating one of those raises it over the toolbar** - each covers its whole monitor, so the toolbar was shown and unreachable. `AnnotationEditor.RaiseToolbar` (no activation) runs after `Show` and, a message later, after every activation of a monitor window; a pick on the toolbar hands the foreground back to the editor window (`FocusCanvas`), since Esc / Enter / Ctrl+Z are the monitor windows' keys. The tool buttons have no caption: each draws its shape (`AnnotationToolGlyph`, the theme's text ink - a white or black swatch as ink would vanish on the button) and a build cannot tell that from a blank square, so `AnnotationToolGlyphTests` reads the pixels. `Test-ScreenRegion.ps1 -EditorWindows` asks Windows what is at the toolbar's centre and checks every button against its own face on the real screen. The one-time chord re-key (`ScreenshotKeyMigrationDone`, machine history, never exported) moves profiles still carrying the old shipped Ctrl+PrintScreen / Ctrl+Shift+PrintScreen to the new defaults exactly once; everything else - customised chords, every switch, the case flip, the seeded EN⇄RU row - is never touched. Spec: [PLAN/done/S0071_screenshot-full-and-annotate.md](PLAN/done/S0071_screenshot-full-and-annotate.md); the region capture's own ticket: [PLAN/done/S0026_screen-region-capture.md](PLAN/done/S0026_screen-region-capture.md). 12. **The symbols window - a palette of characters that are on no installed layout (ticket S0056), opt-in and off by default.** `EnableSymbols=0` means no chord is bound, no tray item, no context-menu item and **no window object exists**. Enabled, `SymbolsHotkey` (**Ctrl+Shift+F9**) toggles `SymbolsWindow`: a `SizableToolWindow` that is shown without activation and whose grid answers `WM_MOUSEACTIVATE` with `MA_NOACTIVATE`, so a click on a character **never takes the focus from the user's editor** - the one hard rule, because a palette that did would make Ctrl+V paste into the wrong place. Keyboard focus lives only in the search box and the text field, and is handed back after a copy (`ForegroundActivator`, `CursorIndicator.LastActiveWindow`). The window has a group list ("Все" and the twelve groups of the table, the last one remembered in `SymbolsCategory`; a search stays inside the chosen group), a text field above it that collects the picks and mirrors the clipboard (`SymbolsClipboardMirror` decides which read may replace it), a 12-column grid that scrolls, a hover that shows the code (`U+20AC`), and a remembered switch **"Закрыть по выбору"**: off, a pick appends the character to the field and copies the whole field; on, a pick copies the character alone and closes the window (ticket S0056, revision 2026-10-08). A pick copies **exactly** the character (`Win32Clipboard.TrySetText`, `TransientMarks.None`, on the clipboard worker under the `_busy` guard; a taken guard says so on the window's own status line, never a balloon); symbol picks are excluded from CyrFlip clipboard history. The data is a **generated** table of 501 characters (`Symbols.g.cs`, from `tools/symbols/symbols.src` + `UnicodeData.txt` by `tools/IconGen -- symbols`, notice in `THIRD-PARTY-NOTICES.txt`); search is by the character, a code point, a prefix of the English or Russian name or the category, **no relevance score**. The Russian name is shown only in the Russian UI. `SymbolsHideTypable` hides what an installed layout types with one key combination (`SymbolTypability`, computed on the pool). It is declared a tab with **no vocabulary glyph** (`ICON-SET` rule 7, see `TabGlyphTests`). The machine check (every entry drawable by some installed font) and the clipboard write are `tools/uitest/Test-Symbols.ps1`; the chord, the focus rule in real editors and the handle counts are the human checklist at its end. Spec: [PLAN/done/S0056_symbols-window.md](PLAN/done/S0056_symbols-window.md). 13. **The hotkeys overview - the "Горячие клавиши" page (tickets S0056 and S0062).** One settings page - the master switch and the RDP option in its first group `hotkeys/switches`, then a list of **every** chord CyrFlip binds in six groups (`keys/fixed`, `keys/mouse`, `keys/conversions`, `keys/translations`, `keys/launcher`, `keys/windows`), says for each whether it **really fires and if not why** (`ChordBindingState`: its own switch, its module, the master switch, no chord, a token that does not parse; a **clash** is a second fact shown on both rows, since a switched-off chord still owns its chord), and lets the user change, switch and reset each from there. **It stores nothing and has no second setter**: a chord change opens the owning page's own flow (`HotkeyDialog` + `ChordGuard`, then the same setter), a switch calls the same handler as the owning page, and a refresh re-reads every control without firing a handler, so the page and the owning page are one value. The state is `ChordBinding.Evaluate` - the predicate the tray hover popup uses - and the five `*ChordLive` properties of `CyrFlipContext` now call `ChordBinding.*Live`, so the hook and the overview are made from one condition. **Reset** (`ChordResetPlan`, pure): a chord token and that chord's own switch, nothing else - never a module switch, a row's language, the number of rows or a scenario's program; the seeded EN⇄RU and translator starter rows get their shipped chord back **only while they are still that row** (`ChordDefaults.IsSeeded*`), a row the user made is only **cleared** (worded that way); a shipped chord another CyrFlip action holds is **not stolen** but reported; Windows' owners are asked about once; the plan is computed once, shown (`ConfirmDialog`, Yes in the `danger` role only when a chord changes, No by default) and the **same object** applied with every row re-checked, a stale one skipped and reported. "Сбросить все..." also turns the master switch back on (owner decision D4). The mouse chord is edited through a menu of the fixed six choices. No registry value is added. Decisions taken by the recommended defaults: D1 name "Все комбинации" after the Hotkeys page (**superseded 2026-10-11 by S0062 D3**: the old page is dissolved - each chord moved to the page of its feature - so the overview took the title "Горячие клавиши" back and the master switch moved onto it, one control, no duplicate), D2 the one-time shift of a remembered page index (**no longer happens**: S0062 reads `SettingsPageId` by key and a bare `SettingsTab` index through the pre-S0062 order table once), D3 no tab glyph until the catalog has a record (the merged page keeps `app.shortcuts`), D4 reset turns the master on, D5 no filter, D6 (**gone with S0062**: the old page and its chord rows no longer exist). **Delete on a fixed chord does nothing** (it cannot be left empty; the spec's "asks first" is not built). Spec: [PLAN/done/S0056_hotkeys-overview-tab.md](PLAN/done/S0056_hotkeys-overview-tab.md). 14. **The settings pages follow the features (ticket S0062).** A setting and a chord live on the page of the feature they configure (rule D1, held by `ChordHomeTests` and the move ledger `SettingsLedgerTests`): the case fix (chord and CapsLock sync) is on **"Исправление текста"** (the old "Конвертация раскладок", group ids `conversions/table|after|symbols|case`), the history chord on **"Буфер обмена"** (`clipboard/recording|window|clear`), the context menu, its mouse chord and its keyboard chord on the new **"Меню для выделенного"** page (`selection/mouse|keyboard`, `SettingsPageKey.SelectionMenu`, tab kind 14, glyph `feature.selection-menu`, the record asked on 2026-10-11 - until then it drew its caption alone, D7), and "Общие" has four groups (`general/language|startup|power|transfer`). The old "Горячие клавиши" page is dissolved: its master switch and RDP option are the first group (`hotkeys/switches`) of the overview page, which keeps the key `SettingsPageKey.Hotkeys` and the glyph `app.shortcuts` (`HotkeysOverview` is a retired key, read as `Hotkeys`; tab kind 13 is gone). The page order is one table, `SettingsPageKeys.DisplayOrder`, in the pillar order of `POSITIONING.md`, About last. Navigation is remembered by **key**: `SettingsViewport` rows are written `|anchor|offset` and a legacy numeric row (and a bare `SettingsTab` index) is read once through `SettingsPageKeys.FromLegacyIndex`, the pre-S0062 order table. The auto "Параметры" group is keyed by the page key and only "Индикаторы" has loose rows. Settings file inventory group ids moved with the settings (preview captions only; the file format is untouched). Spec: [PLAN/S0062_settings-tab-regrouping.md](PLAN/S0062_settings-tab-regrouping.md). 15. **The traffic light - "Светофор доступности", a board of last known reachability (ticket S0069), opt-in and off by default.** `EnableTrafficLight=0` means **no engine, no scheduler (so no timer and no network or power event subscription), no journal, no window object, no tray item and no chord** - a user who never switches it on pays nothing. Enabled, the user lists **their own** targets - seven kinds: `ping` (one ICMP echo), `tcp` (one connect), `http` (HEAD, then GET headers-only on a 4xx/5xx **that is not already accepted**, sent to where HEAD's redirects ended; redirects up to 5; system proxy; no cookies, no credentials; the **final** status is judged against `acceptedStatusCodes`, default `200-399`), `folder` (one enumeration - exists and enumerable, **at most one entry read**, nothing written), `drive` (by **letter only**), `sftp` (TCP connect and the server's identification line - proves "an SSH server answers", not "this is the share") and `exchange` (TLS handshake only, SHA-256 of the leaf compared with an optional `fingerprint`; **no application byte is ever sent**) - and each is polled on its own interval (default 60 s, **floor 2 s - a typo guard, not a speed limit**, 0 = manual only). Six decisions carry it: - **The engine is pure** (`TrafficLightEngine`): a clock and the targets in, lights out. A tile keeps its last known state while a re-check is in flight and changes only on a **completed** check; a failure reaching `failuresBeforeDown` (default 1) turns it red, below that the tile keeps its state ("confirming k/N") and the next check is due after `min(interval, 10 s)`; one success clears the streak. The interval counts from the **completion** of the previous check, so checks never overlap. **Stale** is derived, not stored (3 intervals, manual-only 1 hour, or a network target while offline) and dims a tile without changing its colour. Results live in memory only. A result that comes back for a target whose identity changed meanwhile is dropped (`Generation`). - **One scheduler timer, bounded workers** (`TrafficLightScheduler`): a 1-second tick, network probes asynchronous and capped at **16 in flight** (a due target over the cap simply waits for the next tick - that is the cold-start stagger), `folder` and `drive` calls on **4 dedicated threads** created only once such a target exists. Those calls cannot be cancelled, so the hard timeout **abandons** them: the check completes as `timeout` at once while the worker and the target's slot stay occupied until the call really returns. Network events (`NetworkChange`, `PowerModeChanged`) are subscribed only between `Start` and `Stop`, debounced 2 s, and make every target due. While Windows reports no network the network kinds are **paused, not red** (`computer-offline` is a note, not a verdict) and no balloon fires. - **Recognition is pure and offline** (`TargetRecognizer`, D24): one text field, Enter adds with that kind's defaults, Shift+Enter opens the details panel first. `D:\` a drive; `\\HOST` a machine (`ping`, else `tcp` 445 - **the one fallback, no other port is ever tried**); `\\HOST\SHARE` / `//nas/x` a folder; `192,168,1,100` an IP (commas read as dots, said so on the status line); `google.com` a website; `host:port` a `tcp` target; `sftp://` links, `FMSEXCH1:` and `FMSSFTP1/2:` strings are read **by their contracts' vectors** (`ExchangeConnectionString`, `SftpDescriptor`; byte-exact copies under `tests/CyrFlip.Tests/Fixtures/`) and **every secret - `u`, `pw`, `fp` of a share, `sid`, a link's login - is dropped at parse time and the raw text is never stored or logged**. A `.fmscfg` document is refused unread. A broken contract string is refused **whole**. - **The board** (`TrafficLightWindow`, `TrafficLightBoard`, `TrafficLightTitleBar`): one non-activating, **borderless** tool window - `ShowWithoutActivation` and `WM_MOUSEACTIVATE`->`MA_NOACTIVATE`, so the mouse never steals the focus - opened by itself at every start while the module is on (`TrafficLightShowAtStart`, default on, `TrafficLightLaunch.ShowBoard`; off = only when it was left visible, `TrafficLightVisible`, and never focused), and **the moment the module is switched on in the settings** (ticket S0084): a change on the settings page that the board draws - the switch turned on, the pin, the tile size, the columns, the transparency, the targets - shows the board without the focus, **a board the user hid included**, and raises it above the settings window (`TrafficLightWindow.RaiseWithoutFocus`, the topmost/not-topmost pair, skipped while the board is topmost; position and pin untouched), while the chord, its switch and the startup preference leave it where it is (`TrafficLightPresentation`, held by a test that fails on an unclassified setting; the import and the chord reset never present it). An automatic reopen is recorded in `TrafficLightVisible` like any other show, pinned on top as a **switch** (`TrafficLightPinned`), **excluded from every capture and screen share** (`WDA_EXCLUDEFROMCAPTURE`, D9: it is a map of the user's network, so a balloon names the **label, never the address**). It has **its own title area** (`TrafficLightTitleBar`) that drags the window, as does any empty part of the board, and carries four **icon buttons** from the vocabulary: add a target (`action.add` - a small window for an address and a label, `TrafficLightQuickAddDialog`, the recognition live under it; every other option of a target stays on the settings page), edit (`action.edit` - the settings window, on this module's page), pin on top (`action.pin` / `action.pin--off`, a switch) and close (`nav.close`). **Its size is the grid's**: `TrafficLightColumns` (default 3, 1..12) tiles in a row and as many rows as the targets make - three columns and four to six targets are two rows at once - never more columns than the widest group has tiles; the window refits whenever the targets, the columns or the tile size change, stays on the screen, and only its **position** is remembered. With the plate transparency above zero, the board's words - the title, the status line, the group captions - keep a **solid underlay** of their own extent while the plate around them fades (S0093 Q5, `TrafficLightWindow.TextUnderlay`), the way the tiles and the title-bar glyphs stay solid. The small tile size is a **bare square**: no label, and "available" is plain green with **no mark** (a tick on green repeats the hue; owner, 2026-10-13), while every other state keeps its glyph - no mark is itself the reading, so the state still never rests on colour alone - and a switched-off target has a dashed edge (`TrafficLightBoard.MarkShown`); the name and the state are on hover - and on that step there is no status line ("all available: ..") and no title text, only the buttons. The **chord** (`Ctrl+Shift+Alt+T`) and the tray item take the focus onto it (arrows, Enter = check, F5 = all, Esc = hand the focus back, the Menu key = the context menu, which holds every button's command too): hidden - show and focus; visible and unfocused - focus; focused - hide. **A left click on a tile checks that target at once**, between its scheduled checks (`TrafficLightBoard.OnMouseClick`: press and release on the same tile; a drag of the microscopic board is not a click; a double click checks once and, on the microscopic board, also opens the settings; a check already running is not started a second time). The state is **never colour alone**: each tile carries the vocabulary glyph of its state (`status.ok`, `status.warning`, `status.error`, `status.unknown`, drawn by `GlyphRenderer` in `StatusInk`; a switched-off target has none, an invalid address shows `status.error` on the muted plate - `TrafficLightBoard.GlyphOf`; the typographic marks of `MarkOf` remain only for the settings table's text column and as the fallback of a glyph that cannot be drawn) and the tooltip and the accessible value carry the word. The hover tips of the tiles and of the title bar's buttons are the controls' **own tools** (`ToolTip.SetToolTip`, `ShowAlways`), never `ToolTip.Show(.., window, ..)`: that one answers only while the window is the active one, and the mouse never activates the board - it showed nothing until the chord had focused it (`Test-TrafficLight.ps1` hovers a real pointer over a board nobody focused). The fills are new theme roles (`StatusOkFill`, `StatusWarningFill`, `StatusErrorFill`, `StatusUnknownFill`, `StatusInk`), **not** the `success`/`warning`/`danger` ink roles. - **Balloons** are per target (`notify`, default off): only a **settled** change into or out of `down`, never a baseline (the first settled state after start), never while offline, coalesced to one per 15 s naming up to three labels; the tray item carries the summary ("недоступно: 1 из 12"). - **The change journal** (`TrafficLightJournal`, per-target `recordHistory`, default off) is **plain unencrypted text** in `traffic-light-history.txt` of the data folder, written by one background writer in order, split at 5 MB, never deleted automatically and **never in a support bundle, a settings export or a diagnostic log** (`SupportBundle.ExcludedFiles` holds three names now). Keys are invariant codes, so the file reads the same in every UI language. A swallowed fault anywhere in the feature goes to `traffic-light.log` by site and exception type only (`TrafficLightLog`, one line a minute per site). The list of targets is **opt-in on both ends of the settings file** (D10): an export asks before it includes it, an import takes it only on an explicit yes, and the module switch itself is never part of the slice (importing into an off module leaves it off). An imported or hand-edited address that fails validation is shown as an invalid tile and **never probed**. Spec: [PLAN/done/S0069_network-traffic-light.md](PLAN/done/S0069_network-traffic-light.md). 16. **The clipboard on the exchange server - "Буфер на сервере" (ticket S0074), opt-in and off by default.** CyrFlip is **a device of an exchange account for one role, `clipboard`** (product `cyrflip-windows`, capability `e2e-v1`): one press sends what the Windows clipboard holds to the server of every account the device is signed in to, another puts the server's newest value onto the clipboard. `EnableExchangeClipboard=0` means **no connection is ever opened for it**, no tray item, no chord, no Jump List task, and a desktop shortcut that outlives the switch is answered in words. The owner's decisions (2026-10-14) are the shape: the slot is **personal** (one account's devices), the server keeps **only the last value, in memory**, **one object at a time** (a text, a picture or one file - several files or a folder are refused with "put them into one archive first"), **no preview, no marker filter, no confirmation** (a password copied a minute ago goes if the person sends it - `CLIPBOARD-GUARD` item M, said in the settings page, the guide and the privacy page), **CyrFlip only logs in** (registration is the server's; the empty state says to ask its host for an invitation). Five rules carry it: - **Always sealed, no clear fallback** (`DEVICE-EXCHANGE` 27, item DP). The value is sealed on this PC for the other devices of the account that hold the capability and a trusted key (HPKE Auth mode P-256 + AES-256-GCM segments of 64 KiB: `ExchangeE2e`, `ExchangeHpke`, `ExchangeDeviceKey`, `ExchangeE2eNative`, held by `ExchangeE2eTests` against RFC 9180 A.3, the catalog's `e2e-v1.json` and the server corpus). Recipients are other devices only (`ExchangeRecipients`): keys are learned on first use per entry and **never replaced** - a changed key is `key-changed`, a device without one `e2e-missing`, both named in the result. A server whose `welcome` lacks `sealed` is `server-no-e2e`: nothing is sent, nothing clear is ever placed. The server sees the account, the device names, that a value exists and its size, and the settings page says so in the contract's own words (`ExchangeMessages.HonestText`, EN/RU/UK verbatim). - **Trust before a password** (items D, AY, BN). The dialog reads the string without connecting, shows the destination `host:port`, **probes the certificate with a handshake that sends no byte**, shows a self-signed leaf's fingerprint and pins it only on a yes, and only then sends the one `enroll` (`ExchangeAccountDialog`, `ExchangeClient.ProbeAsync`, `ExchangeTrust`). A pin holds the leaf and the key fingerprint; a renewal with the same key is accepted without a prompt, another key is refused with both fingerprints. The password is never stored; the **device token and the private device key live only in DPAPI** (`ExchangeSecrets` under `HKCU\Software\CyrFlip\ExchangeSecrets`, never in the JSON of the entries, a settings export, a support bundle or a log). - **Two streams, never one.** The control stream carries `hello`, `list` (the keys of the account's devices) and `clipboard-info`; `clipboard-put` / `clipboard-get` must be the **first envelope after `welcome`** of a stream of their own (the FMS_Win server closes a control stream that gets a put). Frames carry `schemaVersion` 2 first, 16384 bytes until `welcome`, 262144 after (`ExchangeWire`, replayed against the real server's transcripts in `ExchangeWireTests`). A stream that closes with no frame after our envelope is "the server did not answer", never "unreachable"; a silent stream is closed by a watchdog and a cancel closes the socket (`ExchangeConnection` - a netfx `SslStream` read cannot be cancelled by a token). - **Three phases, each on the guard it needs** (the translator's discipline). The clipboard is read **once, in one open, under `_busy`, on its own thread** and closed before any file or network I/O; a program that owns it and does not render in 5 s is abandoned (`owner-timeout`). Order: one file by path (streamed from disk, hashed once, checked unchanged), else a text (LF ends on the wire), else a picture (`PNG`, `CF_DIBV5`, `CF_DIB`). The network holds no guard. A received value is verified (the server's size and SHA-256 over the sealed bytes, then the box's over the clear bytes), written to the clipboard in **one open with no marker and no backup**, and a file lands first in the received-files folder (`Downloads\CyrFlip`, never overwriting, `.cyrflip-part` while it arrives; a name that cleans to nothing becomes `clipboard-` from `storedAt` in UTC - `DEVICE-EXCHANGE` 1.11 item EL, `ExchangeClipboardSink.NamelessName`) (`ExchangeClipboardSource`, `ExchangeClipboardSink`, `CyrFlipContext.ExchangeClipboard`). A received text is recorded by the history like any copy. - **What a person reads is the contract's table.** A failure shows what happened, then what to try, with the code only in a details line and the log (`ExchangeMessages`: the rows of item CZ and the 15-step ladder of item CY as one-at-a-time hints); the EN/RU/UK words are the contract's and are held character for character by `ExchangeMessagesTests`; the plain-language ratchet of `ComprehensionGateTests` exempts exactly this table. Surfaces: the **"Сервер обмена"** page (`SettingsPageKey.ExchangeServer`, tab glyph `source.exchange-server` - what the feature is, the module switch, the accounts with their states, the two chords - shipped unassigned - the desktop shortcuts, the received-files folder, two portal links), the two tray items (and "Cancel the clipboard transfer" while one runs), the two pipe commands `/clipboard-send` and `/clipboard-get` (`APP-ACTIVATION` 0.12, section 9) that the desktop shortcuts and the Jump List tasks run, and the hotkeys overview. The portal pages (`ExchangePortalLinks`, hosted by the FastMediaSorter site, EN/RU/UK, every other language gets English) are published - all six answered HTTP 200 on 2026-10-25. Log: `exchange-clipboard.log` (site, kind, size, ordinal, code - whitelisted in the support bundle). Not built: a QR picture (the text of one is pasted), the Drive path of the clipboard. Spec: [PLAN/done/S0074_exchange-server-clipboard.md](PLAN/done/S0074_exchange-server-clipboard.md); the owner-run live check is `tools/uitest/Test-ExchangeClipboard.ps1`. **The settings standard (`DEVICE-EXCHANGE` 1.12, items EN to ER, ticket S0095):** beside an account whose server lists `settings`, "Save as STANDARD" / "Read STANDARD" send `settings_save_standard` / `settings_get_standard` (snake case, the contract's) on the control stream under `appId` `cyrflip`; never to a server without the feature, never for a guest (`ExchangeSettingsStandardService`). `SettingsStandard` is the pure half: ten groups mapped from the settings file's inventory groups (`general`, `indicators`, `shortcuts`, `clipboard`, `translate`, `quick-notes`, `graphics`, `symbols`, `traffic-light`, `exchange-server`), `LocalOnly` plus the file's `Excluded`, every `navigation/` value and the launcher never written and ignored on read, a payload of at most 65536 bytes. A read is parsed whole first, then goes through the **same** preview and transaction as a settings file (`ImportDocument(load, source)`). Both acts confirm first; nothing runs on a change, at start or on connecting; the last-seen `updatedAt` is in memory only. The server's operator can read a stored standard (unsealed, item EN) - said on the page, in the guide and the privacy pages. **The exchange server's mark (`EXCHANGE-MARK` 0.4, ticket S0079):** the coloured star the portfolio owner ordered for the server stands beside its name - the settings page's header band, the sign-in dialog, each account entry, the About credit "Media Exchange Server", two help pages, the guide chapter and the README headings - drawn by `ExchangeMark` / `ExchangeMarkPicture` from **byte copies of the catalog's artwork, never redrawn**: `assets/exchange-mark/` (PNG steps, embedded in the exe, plus the glyph master), `docs/assets/exchange-mark/` (site) and `docs/help/exchange-mark/` (help set), all `-text` in `.gitattributes` and pinned by SHA-256 in `ExchangeMarkTests`. The page strip's one-tone glyph is the same star through `tools/IconGen/glyph-overrides.txt` (delete the line once the catalog's generated `glyphs/source.exchange-server.svg` draws the star - `ICON-SET` 0.37 already carries it in `vocabulary.jsonl`); the launcher icon, the open exchange file (S0023) and the `sftp` kind never wear it. 17. **The size profile and the settings page rail (ticket S0076, `UI-SIZING` 1.1, `SETTINGS-NAVIGATION` 2.0).** Two things carry it. - **One size profile for every window** (`UiProfiles`, `UiProfileManager`, `UiMetrics`, `ThemedForm.OnUiProfileApplied`). The General page group "Size and input" (`general/display`) chooses the input profile (`UiInputProfile` = `pointer`|`touch`, never inferred from the device) and two scales (`UiInterfaceScale` 75/100/125/150/200, `UiTextScale` 100/125/150/200, per cent). Interface scale moves typography, glyphs, checkbox drawing, padding, gaps and targets together; text scale moves typography only. A value that is not an offered step reads as ordinary (100). The manager is **inert until `Initialize`** like `ThemeManager`, attaches every `ThemedForm` when its handle exists, applies a deliberate change to all open windows at once and re-measures the covered components at their final width (`UiProfileManager.Reflow`, UI-SIZING 1.1). The three values describe this PC and are **not** in the settings file (`SettingsFileInventory.Excluded`, "this PC\'s display"). A window that derives its own font (a language's script family) hands it to `ThemedForm.SetBaseFont` instead of assigning `Font`, so a language switch keeps the chosen size (`WindowScript.Apply` does it for its windows); a font assigned directly becomes the base of the next profile pass. The custom-painted tool windows follow the profile too: the history strip composes DPI x interface scale for geometry and x text scale for its cells and fonts, the traffic-light board and the symbols grid measure from the scaled window font and refit, the quick-notes editor face and the region overlay's size label compose both scales, the annotation toolbar's tools, swatches and dividers take the interface scale. The tray menu and the text context menu draw with Windows' menu font and are not scaled. - **The page rail** (`SettingsRail`, `SettingsRailLayout`). The native vertical tab strip is retired as a view: the `TabControl` stays as the page host with `HostOnly` (no display-area reservation for a strip, one accessible pane), and a native-scrolling owner-drawn list at the reading start lists the destinations - whole wrapped captions (never an ellipsis), the vocabulary glyph in one identity colour table (`ThemePalette.NavInk`, 3:1 held by `SettingsRailTests`), a bar and a bold caption for the selection, a click released on the pressed row, the keyboard, an accessible `List` of `ListItem`s. When the content pane would keep less than 480 logical px (interface-scaled) beside the rail, the same rail moves into a drawer opened by a "Pages" button in the header band (`SettingsRailLayout.Decide`). **Page changes are timed** from the rail\'s mouse release to a forced paint of the whole window (`PageNavigationTrace`, `CYRFLIP_NAV_TRACE=`), a newer navigation supersedes an older one, and `tools/uitest/Measure-PageNavigation.ps1` repeats the measurement in fresh processes. The measured budgets are **not** all met - see `PLAN/S0076_unified-ui-contracts/unified-ui.md` before claiming conformance. It runs in the **system tray** (the icon also shows the layout; right-click menu = the history controls, the three indicator toggles, the two keep-awake switches, the **Launcher** submenu and **"Перевести буфер обмена"** - each visible only while its module is enabled - then Settings and Exit). **Tray mouse:** a **single left click switches the input language to the next one in Windows' rotation** (`LayoutSwitcher.SwitchToNext`), a **double click opens Settings**. Since the shell also delivers the first click of a double click as an ordinary click, the switch is deferred by `SystemInformation.DoubleClickTime` and cancelled when the double click arrives - and it targets `CursorIndicator.LastActiveWindow`, not the foreground window, because clicking the notification area moves the focus to the taskbar. See [PLAN/done/Spec_v1.1_Cursor_and_Caret.md](PLAN/done/Spec_v1.1_Cursor_and_Caret.md) for the indicator design. **On the mouse cursor (important):** `SetSystemCursor` is **global** - it changes every app's I-beam until restored. The default cursors are reloaded (`SystemParametersInfo(SPI_SETCURSORS)`) on `Dispose`, `Application.ApplicationExit`, `AppDomain.ProcessExit`, `UnhandledException` and the session end (see `LayoutCursor.ForceRestore`) - **but only when CyrFlip replaced the I-beam since the last reload**: `SPI_SETCURSORS` reloads the whole scheme, undoing cursors other tools set, so with the cursor change off (the default) it is never called. The one unavoidable gap is a hard `TerminateProcess` (kill). Only `OCR_IBEAM` is replaced (not the arrow). The *displayed* I-beam only repaints on `WM_SETCURSOR` (mouse move), so after a layout change `LayoutCursor` sends a zero-delta `SendInput` mouse move (`ForceCursorRefresh`) to repaint it in place. **On the caret overlay:** the caret position comes from four sources, tried in order - (1) `GetGUIThreadInfo.rcCaret` (classic Win32 edit fields); (2) **COM UIA `IUIAutomationTextPattern2.GetCaretRange`** (`UiaCaretCom`) for **WinUI/UWP/WPF/modern-Notepad**; (3) **IAccessible2 `IAccessibleText.caretOffset`/`characterExtents`** (`Ia2Caret`) - the screen-reader caret API, and **the only source that locates the caret in Chromium/Electron** inputs (the VS Code chat box, browsers); (4) managed `TextPattern.GetSelection` as a last resort. Tracking runs on a **background MTA thread** so the cross-process calls never block the UI; the overlay window is touched only via `BeginInvoke`. It hides only where no source yields a caret (e.g. console windows). The tray menu's **"Diagnose caret position..."** dumps, for the focused element, what each source returns (log under the same MSIX-aware folder as `layout.txt`) - the way to debug "no marker here". > **Verified empirically (2026-06-21):** the VS Code chat input (`'Message input'`, ControlType.Edit, FrameworkId=Chrome) exposes **no Win32 caret, no `TextPattern2`, and a `GetSelection` that returns no caret rect** - so only the IAccessible2 path (3) places the marker there. It tracks live as you type (confirmed caret offset/x moving). Plain Chromium browsers behave the same; WinUI/native apps use paths 1-2. **COM vtable gotchas (`UiaCaretCom.cs`, `Ia2Caret.cs`):** both use hand-declared COM interfaces on Windows components (`CUIAutomation`, `oleacc`/IAccessible2) - **no new dependency**, so winget/MSIX shipping is unaffected. Method order must match the headers exactly: in `IUIAutomation`, **`ElementFromHandle`/`ElementFromPoint` sit between `GetRootElement` and `GetFocusedElement`**, so `GetFocusedElement` is **slot 6** (not 4) - getting it wrong silently calls `ElementFromHandle` with a bogus HWND and returns `E_POINTER`. `IAccessible` is laid out after IDispatch's 4 methods (`get_accName` slot 8, `get_accFocus` slot 16). Both modules guard calls with `[HandleProcessCorruptedStateExceptions]` so a vtable mishap degrades to the next source instead of crashing. **One deliberate deviation from the spec:** **tray app, not a Windows service.** A global `WH_KEYBOARD_LL` hook and the active-window/layout APIs only work in the user's interactive desktop session; a service runs in session 0 with no desktop, so AUTO/MANUAL service start types don't apply. "Autostart" is therefore a per-user `HKCU\..\Run` entry (`Autostart.cs`). ## Tech stack & hard constraints - **Target framework: .NET Framework 4.8** (`net48`), C# with `latest`. Chosen because 4.8 is preinstalled on every supported Windows 10/11, so the app ships as a single small `.exe` with **nothing to install** - the user's "full Win10 support, one EXE, no dependency" requirement. **Caveat:** net48 caps usable C# features (officially ~7.3); `latest` is enabled but features needing runtime support (records, `init`, ranges) require polyfills. This is a deliberate trade vs the spec's "C# 11+". - Built with the **.NET SDK** (`dotnet build`/`test`), not classic msbuild. net48 reference assemblies come from the `Microsoft.NETFramework.ReferenceAssemblies` package, so no VS targeting pack is required. - Heavy use of Win32 via **P/Invoke** (`[DllImport]`) - concentrated in `WindowInterop.cs`. This is the core of the app, not an edge case. - **No NuGet runtime dependencies** in the app project - config parsing uses the framework's `System.Web.Script.Serialization.JavaScriptSerializer` (a `System.Web.Extensions` reference), not `System.Text.Json`, to keep the exe self-contained without ILMerge. - Memory budget: **< 50 MB** idle. - Keyboard hook callback must be **non-blocking and < 1 ms** - do real work off the hook thread; never block inside the `WH_KEYBOARD_LL` callback. - `app.manifest` declares **PerMonitorV2 DPI awareness** (so rendered icons/labels are crisp on high-DPI) and Win10/11 `supportedOS`. ## In-app help (S0075) S0076/S0077 current UI authority, component inventory and permanent profile decisions are recorded in [PLAN/S0076_unified-ui-contracts/unified-ui.md](PLAN/S0076_unified-ui-contracts/unified-ui.md); the clause-by-clause accepted-proposal read and explicit remaining exceptions are in [PLAN/S0077_contract-sync-20261017/contract-sync-20261017.md](PLAN/S0077_contract-sync-20261017/contract-sync-20261017.md). BUTTONS 2.0 supersedes older red-dismissal/tinted-answer descriptions below. COLLAPSIBLE-GROUP 1.1 owns the native current-state triangle. `AboutResources` is the resource inventory; About's local diagnostic export uses `SupportBundle` without the separate mail handoff. No full UI conformance or release is claimed by these slices. `help-map.json` is the surface inventory and ships inside the exe. `ContextHelp` resolves both F1 and the help buttons; bare F1 remains a window command. Add a map row whenever adding a Form, settings page or tour step. `tools/help/Generate-Help.ps1` captures demo fixtures off screen in all UI languages and both themes; `docs/help/` is the generated site set and the embedded offline set. `tools/help/Test-ContextHelp.ps1` checks coverage, locale parity, page anatomy and local links, and holds every PNG to its digest in `docs/help/freshness.json` (written by `tools/help/finalize.py`); with `-Release` - the preflight's call - it also fails captures older than any input, i.e. any `src/CyrFlip/*.cs` changed since the last generator run (`CONTEXT-HELP` rung 2, static form). Between releases that count is printed, not judged. Regenerate help with UI changes; do not hand-edit PNGs. The 128 MiB uncompressed budget covers all help assets; the current implementation record is `PLAN/S0075_in-app-help-f1-and-help-button/help-implementation.md`. The release-only walk is deliberately distinct from the static gate. ## Module architecture (`src/CyrFlip/`) - **WelcomeDialog.cs / WelcomeVisuals.cs / WelcomeFacts.cs / FirstRun.cs** - modal five-page introduction; pure live-config facts and normalized-marker decision. The tour is not text on a form: every page opens with a solid plate and a large title - the vocabulary glyph everywhere but the welcome page, whose header carries the app's own icon (the `CyrFlip.app.ico` embedded resource, the same ico the exe carries) and whose body is the whole product in one index, one line per feature in POSITIONING.md's pillar order; on the later pages each feature is a row (`GlyphBadge` + bold title + the chord drawn as `KeyCaps` + a live `ToggleSwitch`); the conversions page ends in a `ConversionExample` (`ghbdtn ⇄ привет`), the indicators page shows the live layout badges and the progress is `StepDots`. These are small owner-drawn `IThemeAware` controls (`WelcomePainted`) that read `ThemePalette` roles only - no colour literal, no private picture: a meaning the vocabulary lacks (case flip, the context menu, the I-beam) gets a typographic mark ("Aa", "≡", "I") on the plate instead. `WelcomeFacts.ConversionRows()` (capped at `MaxConversionRows`) feeds the page. **The switches are live, not decoration** (owner, 2026-10-09): a person who has just installed CyrFlip meets its features and turns them on or off on the spot. A flip goes through `CyrFlipContext.ApplyWelcomeSwitch`, which calls the very handler the settings window calls (`OnQuickNotesChanged`, `SetCaseHotkeyEnabled`, the tray items for the caret marker, the cursor and the history, ...), so the hook, the tray and the config cannot tell the two apart; the tour then re-reads every switch from the configuration (`WelcomeFacts.IsOn`), so a flip another chord owner refused puts its knob back, and turning a chord on while the master switch is off turns the master on. Without a context behind it the dialog writes the value itself (`WelcomeFacts.Set`). The navigation buttons are `GlyphButton`s carrying `nav.back` / `nav.forward` / `nav.close` (the last step: `app.settings`), drawn at the theme text colour and mirrored for right-to-left. `SettingsPageKey` addresses settings pages independently of tab order. The context posts startup display, writes the marker on Shown, queues settings requests during the tour and defers the single handoff. Each class owns one concern (keep it this way - the spec prioritizes a minimal surface): - **Program.cs** - entry point (`[STAThread]` Main). Enforces **single instance** via a named mutex (`Local\CyrFlipSingleInstance`) - a second copy would install a second hook and fight over the system cursor - then runs `CyrFlipContext`. - **CyrFlipContext.cs** - the tray app shell (`ApplicationContext`). Builds the tray `NotifyIcon` + menu (history controls, cursor/caret/dot-mode toggles, keep-awake toggles, Settings, Exit), subscribes to `LayoutChanged(code, klid, capsOn)` (forwarding the CapsLock state to all three surfaces), and on any hotkey runs the matching clipboard op via the shared `RunClipboardOp` helper **on a dedicated background thread** guarded by a single `Interlocked` `_busy` flag - it serializes every conversion and the case-flip (all own the clipboard) and blocks auto-repeat re-entry. Tracks usage via `AppConfig.IncrementFlipCount` / `IncrementCaseFlipCount`. The three fixed chords (case flip, clipboard history, quick notes) are changed at runtime via `HotkeyDialog` and rejected when any other chord owner holds them (`ChordRegistry`, below); the conversion chords are set from the table itself. - **SessionEndWatcher.cs / CloseToHide.cs** - how CyrFlip ends (ticket S0003). An `ApplicationContext` with no main form is simply terminated after `WM_ENDSESSION`, so neither `Dispose` nor `ApplicationExit` runs at sign-out/shutdown; the watcher is a hidden **top-level** `NativeWindow` (a message-only window never receives the end-session messages) that always answers `WM_QUERYENDSESSION` with yes and, on `WM_ENDSESSION(TRUE)`, lets `CyrFlipContext.OnSessionEnding` run `SessionEndSequence` inside a 3 s budget: retract the layout files, append the last note edit, drain the queued history writes, restore the cursor, and only then - when no background compaction is running and under a second has gone - compact the notes journal, then flush the logs (S0035 QN2-6: the compaction used to come second, wait for a running one on the journal lock and leave the history no time). `CloseToHide.Intercept` is the rule every "close means hide" window follows: **only a `UserClosing` close is cancelled** - cancelling `WindowsShutDown` vetoed the sign-out, and cancelling `ApplicationExitCall` kept the app running after the fatal-error box said it would close. `CyrFlipContext.Dispose` is guarded (it runs twice), and every clipboard worker is started through `StartClipboardWorker`, which releases `_busy` if the thread never starts. The same window also raises `ThemeSignal` - `WM_SETTINGCHANGE` carrying `"ImmersiveColorSet"` or `SPI_SETHIGHCONTRAST`, `WM_SYSCOLORCHANGE`, `WM_THEMECHANGED` - which is how the theme follows Windows. - **ThemePalette.cs / ThemeManager.cs / ThemeApply.cs / ThemeWin32.cs / ThemeToolStripRenderer.cs / ThemeTabControl.cs** - the app theme (feature 9), one concern each. `ThemePalette` is the single table: `ThemeRole` (the `APP-STYLE` section 4 vocabulary plus the proposed `warning`/`danger`/`success` and `surface.alternate`) and three instances; `Contrast`/`Luminance` are WCAG's, which `ThemePaletteTests` holds every text/surface pair to (4.5:1, 3:1 for disabled text) - the derived fills too (the group band, the page list's rows, the button hover face, the traffic-light title plates), each a named function its control paints with (`CollapsibleGroup.BandFill`, `SettingsRail.RowFill`, `TrafficLightTitleBar.PlateFill`). **`ThemePalette.Over` is the one point of alpha arithmetic** (S0093): a translucent carrier is measured as it reaches the eye, composed over the worst backdrop grey (`WorstOverGrey`, `WorstThroughWindow`, the window alpha truncated as WinForms does), and a floor is derived by `LowestHolding` and held by `PanelColorContractTests` (the region capture's label plate and veil today). `ThemeModes` is the pure half (token, `Resolve(mode, systemPrefersDark, highContrast)`); **`ThemeManager` is inert until `Initialize`** - the tray context and the one-shot launcher call it, no unit test does, so no test paints with the developer's own Windows theme. It keeps the attached windows in a list and drops each on `Disposed` - **there is no static event a window subscribes to**, so the theme cannot leak a closed window. `SystemEvents` may raise on a thread of its own (the manager starts before any control exists), so it is posted back to the UI thread. **`ThemedForm`** is the base of every window: it attaches when its handle is created - after the constructor, before the first paint (no white flash, and the translation popup, which never activates, is painted in time) - and `ThemeCoverageTests` fails on a `Form` that is neither a `ThemedForm` nor declared (the caret overlay, the 1x1 taskbar window). `ThemeApply` is the walk: records the built state in a `ConditionalWeakTable` (static handlers only), themes late rows through `ControlAdded` and recreated handles through `HandleCreated`, owner-draws list-view headers in dark, turns buttons flat in dark, and **repaints disabled captions** in `text.disabled` - WinForms derives them from `ControlPaint.Dark(BackColor)`, invisible on a dark surface. A button's unset `UseVisualStyleBackColor` is *computed* from its parent's colour, so the walk records and restores the two private `ButtonBase` fields behind it (net48 is frozen, so are their names). `ThemeWin32` is every undocumented call, each guarded and degrading to light: the DWM title bar (attribute 20, then 19), `DarkMode_Explorer` (lists, multi-line boxes, scrollable panels), `DarkMode_CFD` (edits and combo boxes - kept **not** flat, since WinForms' flat combo draws a white frame whatever the colours), `DarkMode_ItemsView` (list headers), and uxtheme ordinals 135/136 for the native menus. `ThemeToolStripRenderer` is installed on the UI thread (`[ThreadStatic]` in net48) through `ToolStripManager.Renderer` (every manager-mode strip draws with it, so a new menu cannot forget the theme; light and high contrast get the stock renderer back); a `ToolStripLabel` reads as muted, not as a disabled command. `ThemeTabControl` user-paints the settings page list in dark only. - **UiProfile.cs / SettingsRail.cs / PageNavigationTrace.cs / SettingsPagePanel.cs** (S0076, feature 17) - one concern each. `UiProfiles` is the pure half (tokens, the offered steps, `Metrics`, `FontPoints`; unit-tested on any machine); `UiProfileManager` is the inert-until-initialized, no-static-event list of attached windows and the `Reflow` walk of the covered components. `SettingsRail` is the page list control (rows measured with the bold caption at the final width, so a choice moves no other row; cached heights released by `InvalidateMetrics`; press and release on the same row; `InputStamp` is the start of the timing) with `SettingsRailLayout` the pure docked-or-drawer breakpoint. `PageNavigationTrace` times activation to a finished frame and records nothing unless switched on; its nearest-rank percentile is the contract's method. `ThemeTabControl.HostOnly` swallows `TCM_ADJUSTRECT` so the hosted pages fill the control. `SettingsForm` mirrors the host's selection into the rail (never the other way round for state), and skips the width clamp of a page whose width and control count are unchanged (`ClampPageWhenStale`) - that clamp had been 40 to 60 per cent of every warm page change. Two more levers (2026-10-30): `SettingsPagePanel`, the page's content panel, suspends its whole subtree's layout while a page whose every control already has its handle becomes visible (WinForms re-lays-out each nested auto-size panel on show, and a hidden page is never out of date - `PerformLayout` ignores visibility), and `ClampPage` sets every caption cap under one suspension, turning a clamp requested from inside the page's own layout into another pass. Each has a test seam (`SkipRelayoutOnShow`, `SuspendClampLayout`) that `SettingsPagePanelTests` compares against, control for control. Never pre-clamp a hidden page: `EditorsPreferredHeight` skips invisible children, so a hidden clamp gives a different result. - **Glyphs.g.cs / GlyphPath.cs / GlyphRenderer.cs / AppGlyphs.cs / HistoryStripGlyphs.cs / LauncherShortcutIcons.cs** - the vocabulary glyphs (`ICON-SET` / `ICON-RENDER` / `ICON-EXTERNAL`, ticket S0022), one concern each. `Glyphs.g.cs` is **generated** (`dotnet run --project tools/IconGen -- glyphs -CatalogRoot `, from `tools/IconGen/glyph-ids.txt`; the catalog root is an argument, never a literal path): SVG path data on the 24 grid, read by key from the catalog, a MAJOR other than 0 or a missing id fails the run and leaves the previous file. `GlyphPath` reads SVG path data into a `GraphicsPath` (all of M L H V C S Q T A Z, **`FillMode.Winding`** - GDI+'s Alternate punches holes in overlapping glyphs; a record whose SVG says `fill-rule="evenodd"` - `app.shortcuts`, `GlyphRecord.EvenOdd` - is the one case that asks for Alternate, and the generator refuses any other rendering attribute, an opacity or a path transform rather than draw a glyph wrongly; a path that does not parse yields null, never an exception). `GlyphRenderer` fills it at draw time in the **caller's theme colour** - nothing is baked, one path serves every size and DPI - plus the decorated look on a round plate (glyph 0.6 of the plate) for shortcuts. `AppGlyphs` is the one place an id is spelled (a test fails on a literal id handed to the renderer elsewhere). Held: the clipboard strip's search / close / pin / delete (`HistoryStripGlyphs`, exposed to a screen reader as an `AccessibleObject` with four kinds of child), the order buttons of the layout list, the launcher list and the notes window (`action.move-up` / `action.move-down` in the theme's text colour, drawn again when the theme changes), all fourteen settings tabs (`SettingsForm.TabGlyphId`; "Меню для выделенного" was the last caption-only tab until its record `feature.selection-menu` landed on 2026-10-11 - S0062 D7, and the traffic light's `feature.network-monitor` and its four `status.*` tile marks were vendored from the catalog's glyph files on 2026-10-13 - S0069; the guides show the same glyph beside the tab's name), and the Jump List's Manage / Exit / yt-dlp / unreadable-program icons - written as `.ico` files into `icons\` beside `layout.txt` (`LauncherShortcutIcons`, the MSIX-aware folder; the name carries a revision), because the shell wants a file location and an SDK-style net48 project embeds one icon. **A meaning the vocabulary lacks does not get a private picture** - Conversions and Languages drew their own until the catalog recorded `action.convert-layout` and `system.input-language` (0.23); no tab draws a private picture now, and a tab whose glyph cannot be drawn shows its caption alone. The launcher's page header and taskbar button keep OneClickRunner's mark (declared in the registry, the decision of 2026-10-07), its tab is `feature.quick-launch`. The vocabulary records of seven of those tabs are `proposed` (`ICON-SET` rule 6: the first product to ship one turns it `active`). The layout badge is not a glyph. The licence notice for the vendored Material glyphs is `THIRD-PARTY-NOTICES.txt` (release ZIP, MSIX, About).- **BusyDialog.cs** - the small modal "please wait" window behind every job that is too long for the hooks' thread (ticket S0030 HT-2/HT-6): the exchange file's read, parse and write, the notes import's batched journal append (`QuickNotesStore.AppendBatch`), the Markdown export, and waiting for the notes replay before "delete all" / "export everything" (`LoadAsync`, never `EnsureLoaded`'s `Wait`, in the app). `BusyDialog.Run`/`Wait` run the job on the pool and keep the message loop - and so both hooks - going; `ShowDialog` disabling the thread's other windows is what keeps the notes unchanged while a worker reads them. A job done within 40 ms shows nothing; the wait for it is a wait handle, never `Task.Wait`, which may run an unstarted task inline on this very thread. Switching the quick notes off hands the final compaction to the pool (`QuickNotesService.RetireAsync`), and the next service replays only after it. - **SettingsLoadingNotice.cs** - the "Loading settings.." picture shown while the settings window is built for the first time (`CyrFlipContext.ShowSettings`, only when the window does not exist yet). The build is controls, so it runs on the hooks' thread and nothing answers meanwhile: without a picture a tray double click read as "nothing happened" and was repeated, each repeat queuing behind the build (and the stray single clicks among them switched the layout). It is a **still** picture on purpose - the thread that would animate it is the busy one - painted with `Update()` *before* the build, a non-activating tool window, closed at the next `Application.Idle` (after the settings window has painted). **The first open used to take ~6 s** (measured on a real profile, 2026-10-15) and ~4 s of it was one defect: every page panel's `Resize` re-clamped the text widths of **all 13 pages** (`ClampPageTextWidths`), and showing the window resizes every panel. A panel's `Resize` now clamps only its own page, and only while it is the selected one (`ClampPageOnResize`); a page resized while hidden is flagged and clamped on selection. `ShowSettings` also no longer runs `Reload()` right after a constructor that has just run it. What is left (~2 s) is WinForms layout of ~850 controls on a cold process - JIT is **not** the lever (measured: pre-compiling every `SettingsForm` method changed nothing). `SettingsOpenCostTests` holds both halves. - **ConfirmDialog.cs** - CyrFlip's own message and confirmation box (S0020 v0.2 item 6), in place of `MessageBox`: laid out by content, 13 languages (`DialogLayoutTests`), the system icon and sound, Ctrl+C copies the message, an ownerless box comes to the front with a taskbar button. The safe answer is the cancel role; `danger: true` puts Yes on the `danger` role and makes No the default. - **KeyboardHook.cs** - `SetWindowsHookEx(WH_KEYBOARD_LL)` wrapper. The callback never fires on an injected event (`LLKHF_INJECTED`) so our own `SendInput` can't re-enter it, matches the chords against a **physical modifier table** (`ChordMatcher`, below - never `GetAsyncKeyState`, which our own injected key-ups falsify), sees key-**ups** too so a fired trigger's auto-repeats and release are swallowed with it, raises `CaseHotkeyPressed` (case flip), `ClipboardHistoryHotkeyPressed`, `QuickNotesHotkeyPressed`, `ScreenshotHotkeyPressed`, `ScreenshotFolderHotkeyPressed`, `TextMenuHotkeyPressed`, `LayoutConversionHotkeyPressed(id)`, `LauncherHotkeyPressed`, `TranslateHotkeyPressed`, or `ChordFired`, and returns `1` to **swallow** the trigger key. **Every subscriber posts to the UI thread and does nothing inside the callback** (`CyrFlipContext` wraps all of them in `_ui.Post`) - file I/O, showing a window or starting a thread in there runs while the whole machine's keyboard waits. **`Reinstall()` exists because Windows drops a low-level hook that overran `LowLevelHooksTimeout` (~300 ms) and tells nobody**: there is no API to ask whether we are still hooked, so `CyrFlipContext._hookWatchdog` re-arms both hooks every 60 s (a WinForms timer, since a hook may only be removed by the thread that installed it), and three consecutive failures earn one balloon. That silent drop is the "my hotkeys stopped working after a while" report; the hook is also installed only *after* `_ui` is captured, or a chord pressed during startup would be swallowed and then dropped. Gated by a **master switch** (`_enabled` - when off the hook passes every key through) and **per-hotkey switches** (`_caseEnabled`/`_historyEnabled`/`_quickNotesEnabled` for the three fixed chords; each conversion row carries its own `Enabled`). On a real chord match, if **`_deferInRemoteClient`** is on and `RemoteDesktop.IsClientForeground()`, it does **not** swallow the key - it lets the chord travel to the remote session (avoids the double-instance clash when CyrFlip runs on both ends of an RDP connection; see `RemoteDesktop.cs`). `Install(caseFlip, history, quickNotes, deferInRemoteClient, enabled, caseEnabled, historyEnabled, quickNotesEnabled)`; `UpdateCaseHotkey`/`UpdateClipboardHistoryHotkey`/`UpdateQuickNotesHotkey`/`UpdateConversionProfiles`/`UpdateTranslationProfiles` and `UpdateEnabled`/`UpdateCaseEnabled`/`UpdateHistoryEnabled`/`UpdateQuickNotesEnabled`/`UpdateDeferInRemoteClient` swap fields at runtime (safe from any thread - the callback reads the fields on each invocation). One key is watched that is **not** a chord: while `UpdateCancelKeyWatch(true)` is on - only while a translation is streaming - a bare **Escape** raises `CancelKeyPressed` and is **passed through**, never swallowed. The translation popup deliberately never takes focus, so it can never receive a key of its own; without this branch the "Esc to cancel" it promises could not work at all. A second such key, **F6**, is watched only while the finished popup is up (`UpdateFocusKeyWatch`, S0045 K1) and, unlike Escape, **is** swallowed - a bare F6 only; the matcher then owns its repeats and release like a chord trigger's - raising `FocusKeyPressed`: the popup's way in and back out (`TranslationResultWindow.ToggleKeyboardFocus`), since it never takes the focus by itself. - **ChordMatcher.cs / KeyInjection.cs / HotkeyRules.cs / ChordRegistry.cs** - the pure halves of the hook and chord rules (ticket S0004), each unit-tested without a desktop. `PhysicalModifiers` is the eight side-specific modifier flags the hook keeps from the key events it sees; **CyrFlip's own injections carry `KeyInjection.Tag` in `dwExtraInfo` and never touch it**, while another tool's injected modifiers do count (a CapsLock→Ctrl remapper has to keep working). AltGr's fake LCtrl (scan `0x21D`) is tracked apart and matches **no** chord - it is not Ctrl+Alt. **The table is reconciled downwards** before a chord is matched and before every injection plan (ticket S0033 KC2-1): an up the hook never saw (Ctrl+Alt+Del → Cancel, a release over an elevated window) is dropped when `GetAsyncKeyState` says the key is up - **except a key CyrFlip itself released**, marked when the hook sees our tagged up (`TrackOwn`) and trusted to the table until the system reports it down again, since that "up" is the one lie KC-1 is about. So a plan never reuses a Ctrl the system does not confirm, and never leaves one logically down. `ChordMatcher` owns a fired trigger until its key-up (repeats and release swallowed; a gap longer than the keyboard's initial repeat delay + 500 ms, `SPI_GETKEYBOARDDELAY`, means the up was lost - KC2-2), and a watchdog re-arm keeps a trigger still inside that window: the system never saw the swallowed down, so its own state cannot be asked. `HotkeyDialog` sets `KeyboardHook.SuspendChords` while it is open, so the capture sees CyrFlip's own chords instead of running them (KC2-4). `KeyInjection` plans every synthesized key: side-specific VKs with real scan codes and the extended flag, only what is held, and the **mask key `vkE8`** tapped while modifiers are down - the swallowed trigger otherwise leaves Windows a bare Ctrl+Shift / Alt+Shift / Alt / Win release, which switches the layout, opens the menu bar or the Start menu (`KeyboardHook.ChordFired` → the context taps it on the UI thread). `HotkeyRules` is what `HotkeyDialog` refuses: Shift alone off F1-F24, the editing and system chords (Ctrl+C/V/X/Z/Y/A/S/Insert, Ctrl+Space - the Pinyin toggle - Ctrl+Backspace/Delete/ Home/End, Alt+F4, Alt+Space; KC2-7), and a Ctrl+Alt chord that types a character on **any installed** layout. `ChordRegistry` is the one ownership check behind every setter and every enable switch - **a switched-off chord still owns its chord**, the master switch does not gate the check, and Windows' direct-language hotkeys are read-only owners the user is *asked* about rather than refused. The re-arm rule both hooks share: `_wanted` says whether the hook should exist, and the new hook goes in before the old one comes out - a failure keeps the old handle and keeps returning false, so the watchdog's counter really climbs. - **MouseHook.cs** - `SetWindowsHookEx(WH_MOUSE_LL)`, installed **only while the text context menu is on**. Four rules are load-bearing: the callback sees **every mouse move** (up to 1000/s), so everything that is not one of our button messages leaves through a `switch` before a byte is marshalled - and a GC pause on this thread stalls the pointer system-wide, with Windows dropping a hook that exceeds `LowLevelHooksTimeout` (300 ms); nothing is **shown** from the callback (the subscriber posts to the UI thread - opening a menu inside a hook would run a foreign message loop there) and no thread is started there either - the press only stamps and signals `SelectionProbe.Worker` (S0030 HT-3) and posts the **mask key** for a chord with Alt or Shift (KC2-3 - Windows never saw the swallowed click, so the modifier's release would be a bare Alt/Shift tap: menu mode, an IME mode switch); **down and up** are both swallowed (the second down of a fast double click is swallowed like the first); and the up is swallowed by a **flag** (`SwallowUpGate`), not by re-checking modifiers, because the user often releases Ctrl before the button. The flag **expires after 3 s**: an up released over an elevated window is hidden from the hook by UIPI, and a flag that never cleared used to eat the next ordinary right click anywhere. `ForeignButtonDown` fires only while `UpdateForeignClickWatch(true)` (i.e. while the menu is open) - the outside click that dismisses it. - **MouseChord.cs** - modifiers + button, deliberately **not** a `Hotkey` (a keyboard chord always needs a trigger VK, a mouse chord never has one). Registry token is invariant (`Ctrl+RightClick`), the label is translated (`Display(translate)` - modifiers stay Latin, only the button name is a localization key). `Choices` is the fixed six-option list the settings dropdown offers. - **SelectionProbe.cs** - "is anything selected right now, and what does it say?", asked when the chord goes **down** and read when it comes **up**, so the 80-150 ms the user spends holding the button pays for the cross-process calls. The probing runs on **one long-lived MTA `Worker`** created and stopped with the mouse hook (ticket S0030 HT-3) - the hook callback used to create a thread per press; a request overtaken before the worker reached it (the second click of a double click) is answered Unknown at once. Three sources in cost order - `EM_GETSEL` via `SendMessageTimeout` (classic Edit/RichEdit only - **gated on the window class**, since `EM_GETSEL` to a non-edit reaches `DefWindowProc` and returns a confident, wrong 0), then `Ia2Caret` (Chromium/Electron), then managed UIA `TextPattern.GetSelection` (a **degenerate** range = caret only = nothing selected) - and **each is asked twice: about the focused element and about the element under the pointer** (`WindowFromPoint`, `AccessibleObjectFromPoint`, `AutomationElement.FromPoint`). Two rules follow from the same bug, which is what read-only text used to look like: the selection lives under the pointer while the keyboard focus sits in a search box, a container node or nowhere useful, so a source would answer confidently about an element the user was not pointing at and **Copy went grey beside a live selection**. Hence **no source may veto another's sighting** (`Present` from any source wins; `Absent` is the verdict only when every source that could answer agreed) and **`Unknown` still counts as `Present`** - a greyed command beside a live selection is the failure the user sees, while a command that runs and does nothing is what "no selection → no-op" already means everywhere else. The probe also brings back **the selected text itself** when a source hands it over (`WM_GETTEXT` on an edit control, IA2 `get_text`, UIA `range.GetText`) - capped at 64K chars (`MaxTextChars` = 65536; 2048 is `LaunchTargets.MaxLength` for candidate parsing), and the only reason it exists is the launch item below. **The longest text wins, not the first**, and that is why every source is asked rather than the scan stopping at the first answer: measured live in Chromium, IA2 returns only the part of the selection inside the element *under the pointer* - one styled run, one highlighted word - so a selected paragraph came back as `text 1 chars` in `context-menu.log`. No source announces that it is handing over a fragment, so length is the only honest tie-break. It **never** probes by synthesizing Ctrl+C - that would put text on the clipboard to draw a menu, and the history would record it as a real copy. `BudgetMs` (250) is how long the probe may work; **`MaxWaitMs` (90) is the separate cap on how long `Collect` may block the UI thread**, which the keyboard hook shares and which Windows drops after ~300 ms. - **SelectionStats.cs** - the two numbers the menu prints at its foot, so the user knows how big the clipboard is about to get before pressing anything. Pure arithmetic on the text the probe already read - nothing is copied to produce it. Two rules are decisions rather than arithmetic and each has its own test: a **trailing** line break does not open a new line (dragging past the end of a line is one line, as it looks on screen), and `\r\n` is one break rather than two. A count taken from a read that hit `SelectionProbe.MaxTextChars` is printed with a **"+"** (`Format`): the cap is why that constant is 64K rather than link-sized, since a ceiling the user can reach silently turns the number into a lie. - **LaunchTarget.cs** - "the user selected a link - offer to open it". Turns the probe's text into something the shell can open, and **refuses far more than it accepts**: the text came out of whatever window the pointer was over, so it is untrusted input the user is one click away from handing to `ShellExecute`. Exactly three shapes pass - an absolute URL in a whitelisted scheme (http/https/ftp/ftps/ mailto; `javascript:`, `shell:`, `ms-settings:` are refused **by name**), a bare host whose TLD is in a curated list (a whitelist, because "two to twenty-four letters" turns `readme.md` and `setup.exe` into web addresses), and a path that **exists on this machine right now** - and anything else yields no menu item at all rather than one that fails. The selection is tried **whole first, then word by word**: a mouse selection picks up the space or the sentence around the link, and Chromium hands the text back with its neighbours attached, so "см. https://example.com тут" still offers the link - the caption names exactly what will open, and the first candidate wins. A path with spaces is found only by the whole-text pass, which is the right way round, since splitting on spaces cannot put it back together. Anything that runs code, or anything on a network share, comes back as `LaunchKind.Program`, which `CyrFlipContext.LaunchSelection` **confirms first, naming the full path** - the menu caption is elided, and a truncated path is exactly what a plausible-looking one relies on. The confirmation stays on the UI thread; the `ShellExecute` after it runs on the pool (S0030 HT-5), since a confirmed share would otherwise freeze input for the SMB connect. **A remote path is never probed** (ticket S0008 LS-1): asking whether `\\host\share\x` exists opens an SMB session to a host the author of the text chose and stalls the thread for as long as it does not answer - so UNC (either slash, `\\?\UNC\`), `file://host/..`, a mapped drive whose `GetDriveType` is `DRIVE_REMOTE` and a root-relative path on a network current directory are recognised from the text alone and come back as `Program` with no existence check; the device namespace (`\\?\C:\`, `\\.\`) is not a target at all. The parse runs on `SelectionProbe`'s worker (`SelectionSnapshot.Launch`), never on the UI thread the hooks share. A local path is classified by what **opens** (LS-3): its canonical form with Win32's trailing dots/spaces stripped and the on-disk name of its last segment, against our list plus `AssocIsDangerous`. A bidi override or mark refuses the candidate - checked again on the final string after `Uri.LocalPath` unescapes a `%E2%80%AE` and after the variables are expanded, and on the on-disk name (S0034 LS2-1) - a URL caption elides the path but never the host, and `&` is doubled in the caption (LS-5). A **remote** whole-text candidate whose last segment has whitespace and no extension (`\\server\share\x.txt for details`) goes to the word pass first, since nothing probes it (LS2-4). The probe's verdict is published before the parse, so a slow parse costs only the launch item (LS2-5). The parser takes its probes as a `LaunchProbes` argument, so the whole matrix is unit-tested without a disk (`LaunchTargetTests`). - **TextContextMenu.cs** - the pure builder (`TextContextMenuState` in, `ContextMenuStrip` items out), so the whole "what is shown / what is grey / which separator disappears" matrix is unit-tested. Same copy-out-before-dispose discipline as `LauncherTrayMenu`, and for the same reason. The launch item is the one entry that is **absent rather than greyed** when it does not apply: every other command works on a selection it never has to read, while this one can only exist once the text has been read *and* parsed - and an item that appeared over every piece of prose and then failed would be worse than none. - **ForegroundActivator.cs** - `Activate(form)` for a window opened from a surface that never held the focus. Windows grants `SetForegroundWindow` only to the foreground process or the receiver of the last input event, and **refuses silently**: `Form.Activate()` returns, the window is visible, and it sits behind the user's editor - which is exactly how "Настройки" in the text context menu read as broken. The fix is to share the foreground thread's input queue for the duration of the call (`AttachThreadInput`) - but only with a thread that is pumping (S0036 UI-1): a **hung** window (`IsHungAppWindow`, no wait) is never attached to, since the activation would then wait on it with the hooks' thread; one that answers `WM_NULL` within 50 ms is; and when activation is still refused (a busy editor, a recalculating Excel) the window is at least raised above the others without the focus (a `HWND_TOPMOST`/`HWND_NOTOPMOST` pair) instead of opening behind them - which is what the plain 50 ms gate of `eb9a156` had brought back. Used by `ShowSettings`, `ShowHistorySearch` and `ClipboardHistoryWindow.ToggleVisible`. Every action of the text context menu is also deferred one message-loop turn (`CyrFlipContext.Defer`): inside the `Click` the drop-down is still tearing down and still holds the mouse capture. - **CompanionSurfaceRegistry.cs / TopmostYieldPolicy.cs** (S0094, S0096) - the five topmost companions (history strip, translation popup, symbols window, hotkeys popup, traffic light board) step out of a dialog's way: `TopmostYieldPolicy` is the pure rule (visible, pinned for the board, no dialog or dropdown active) and the registry applies it. **The registry compares the window's own `WS_EX_TOPMOST` bit with the rule (`Reconcile`), never a remembered "yielded" flag**: `Form.TopMost` (the board's pin switch) and a handle WinForms rebuilds when a right-to-left language is switched on both move that bit behind its back, and the flag had kept a pinned board above the settings window it believed it had yielded to. A rebuilt handle is reconciled one turn later (`HandleCreated` then `BeginInvoke`). **Both signals come from WinForms events, never from an `IMessageFilter`** (S0098): a filter sees only posted messages, and `WM_ACTIVATE` and the combo's `CBN_DROPDOWN` / `CBN_CLOSEUP` are sent, so the filter this registry used to install never fired (measured 2026-11-10). `ThemedForm` raises `NotifyFormActivated` from `OnActivated` (a window that is not a companion is a dialog) and `NotifyFormLeft` from `OnDeactivate` and `OnFormClosed` - a form closed while active gets no `Deactivate` - which reads `Form.ActiveForm` **one turn later** through the thread's synchronization context, since the foreground is not settled while the message is delivered; the theme walk calls `WatchDropdown` for every `ComboBox` (`DropDown` / `DropDownClosed`, and the destroyed handle of a combo closed with its list open). No hook or filter is installed, so nothing costs the hooks' thread a thing per message. `CompanionSurfaceSignalTests` sends the real messages. - **RemoteDesktop.cs** - `IsClientForeground()`: true when the focused window belongs to a remote-desktop client (`mstsc`/`msrdc`/`msrdcw`), resolved via `OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION)` → `QueryFullProcessImageName`. Used only by the hook's RDP-deferral path, and only on a real chord match, so the process lookup never runs on ordinary keystrokes. Beside it, **`IsSlowClipboardTarget(hwnd)`** - a wider, separate list (the RDP clients plus Citrix `wfica32`/`CDViewer`, Hyper-V `vmconnect`, VMware, VirtualBox, and the `VMware*`/`VirtualBox*` window classes): targets whose far side reads the clipboard late, which the flip pipeline gives its long waits (ticket S0009, FP-1). The deferral list stays RDP-only. - **Hotkey.cs** - parses `"Ctrl+Shift+F12"` → modifiers + VK (+ named keys: Space/Enter/F1-F24/..); `Display` round-trips it. `Hotkey.Default` is **Ctrl+Shift+F12** - the `Parse` fallback, and the chord the seeded EN⇄RU conversion row carries (Ctrl+Shift+T was dropped - it conflicts with browser "reopen tab" and Windows text-extraction tools). `Hotkey.CaseDefault` is **Ctrl+Shift+F11** (case flip). `SameChord` compares trigger key + modifiers (used to reject duplicate hotkeys). **The stored token is `INPUT-CHORD` rules 1-4**: an unknown token or a second trigger makes `TryParse` fail - the chord is inert, never the rest of it bound (`Ctrl+Shift+Hyper+F12` must not become `Ctrl+Shift+F12`) - and stored chords are re-written in the canonical spelling on load (`AppConfig.ReadHotkey`, `AppConfig.CanonicalizeChord`). `InputChordContractTests` generates the contract's vectors (`tests/CyrFlip.Tests/Fixtures/InputChord/chord-tokens.jsonl`, rewritten with `CYRFLIP_WRITE_CHORD_VECTORS=1`) and fails when file and parser disagree; the catalog holds a byte-exact copy. - **CursorIndicator.cs** - polls the foreground window's layout (`GetKeyboardLayout` → `LayoutIdentity.KlidForHkl` → `LayoutIdentity.CodeFor`: the **curated** code when the resolved KLID is one of ours, else the HKL's language id through `WorldLayouts.CodeForLangId`, **the one place that decode lives**, so the marker and the settings tables can never call the same layout two different things - Canadian French, `00001009`, whose low word is en-CA, used to read "EN" on the marker and "FR" in the tables (S0036 UI-3); a language Windows cannot name comes back as its four hex digits, not as `"??"`) **and the CapsLock state** (`IsCapsLockOn`, `GetKeyState(VK_CAPITAL)` low bit) on a 150 ms `Timer` and raises `LayoutChanged(code, klid, capsOn)` when any of them changes; the KLID beside the code comes from `LayoutIdentity` and is what picks the layout's own shade (`DetectLayout(out klid)`). Also renders the tray icon (`RenderIcon(code, klid, capsOn)`, GDI → managed `Icon` via a PNG-payload .ico, no leaked HICON). `LayoutChanged` drives all three surfaces (tray icon, `LayoutCursor`, `CaretOverlay`). The same poll remembers **`LastActiveWindow`** - the last foreground window that is neither ours nor a taskbar surface (`Shell_TrayWnd` & co, filtered by class name + process id) - because a tray click focuses the shell, so the tray's layout switch has to act on the window the user came from. - **LayoutCursor.cs** *(headline)* - renders the caret + EN/RU/UK marker to a `Bitmap`, turns it into a color cursor with a hotspot (`GetHicon` → `GetIconInfo` → `CreateIconIndirect` with `fIcon=false`), installs it via `SetSystemCursor(OCR_IBEAM)`, and nudges a repaint (`ForceCursorRefresh`). `Apply(code, klid, capsOn)` rebuilds when the code, the layout *or* the CapsLock state changes (CapsLock adds the 1px frame). There is **no dark plate** behind the letters - their own black outline carries them - and the letters are composed on **their own bitmap** and blended in at `LayoutStyle.MarkerOpacity`, so the badge is translucent while the I-beam over it stays fully opaque; `RenderCaret` is `internal` because "is the badge see-through" is a pixel fact no build can check (`LayoutMarkerTests`). `Restore`/`ForceRestore` reload default cursors. Scaled by `config.cursorSize`, the primary monitor's DPI and the Windows pointer size (`MarkerSize.CursorHeight`). **A system cursor reload by anyone else** (pointer size/colour, a theme) puts the stock I-beam back, so `SessionEndWatcher`'s `WM_SETTINGCHANGE(SPI_SETCURSORS)` re-applies it (`OnSystemCursorsChanged`) - ignoring the broadcast of CyrFlip's own `ForceRestore` (S0011 LI-6). - **CaretOverlay.cs** *(headline)* - a borderless, topmost, click-through (`WS_EX_TRANSPARENT`), no-activate (`WS_EX_NOACTIVATE` + `ShowWithoutActivation`) `Form` with a rounded window region, showing the EN/RU/UK marker **diagonally below-right of the text caret** (so it never covers the current line). Supports two rendering modes: **text label** (EN/RU/UK letters, default) and **dot mode** (a small solid circle in the layout's colour - set via `SetDotMode(bool)`; **this is the mode the 25-layout palette exists for**, since there are no letters there to name the language). The dot is placed by `CaretPlacement.PlaceDot` - centred right under the caret's line - **not** through the lettered badge's slot, which is dropped by half a badge and left the dot a line or more below the caret. `SetLayout(code, klid, capsOn)` carries the layout and the CapsLock state; when caps is on, the badge gets the 1px frame (text mode) or a dark ring (dot mode). The window is drawn at `LayoutStyle.MarkerOpacity` (`Form.Opacity`, i.e. a layered window - which the click-through/no-activate styles are happy to live with). A background MTA thread finds the caret via `GetGUIThreadInfo` (every ~90 ms) then a **throttled (~120 ms) cross-process fallback** that tries, in order, COM `GetCaretRange` (`UiaCaretCom`, WinUI/UWP/WPF), IAccessible2 (`Ia2Caret`, Chromium/Electron - VS Code chat & browsers), then managed `TextPattern.GetSelection`; it positions the form via `BeginInvoke`. **The cross-process sources run only while there is input to follow** (`CaretQueryGate`, ticket S0011 LI-1): 3 s after a physical key-down (stamped by `KeyboardHook`) or 1.5 s after a foreground/focus change (an out-of-context `SetWinEventHook`) - a query every 120 ms kept Chromium's whole accessibility tree switched on in every tab. Outside that window the last position stands. Every source returns a `CaretRect` (x, line top, line bottom; a whole-line rect refused, the RTL side read from the neighbouring character - `CaretGeometry`), `CaretPlacement.Place` keeps the badge on the caret's monitor (above the line at the bottom edge, left of the caret at the right edge), the badge is sized per monitor DPI (`MarkerSize`) and re-reads it on `WM_DISPLAYCHANGE`/`WM_DPICHANGED` (`OnDisplayChanged`, S0036 UI-4 - a monitor whose scaling changed keeps its handle), a `GetGUIThreadInfo` caret of a DPI-unaware window is converted from logical coordinates (`ClientToPhysicalScreen`), and a foreground change or a tracker silent for 1 s hides the badge until the tracker reports for the new window. Shows/hides with WinForms `Show()`/`Hide()` (relies on `ShowWithoutActivation` so it never steals focus). Passes an empty string to `SetLayout` to hide. The Monaco/VS Code *editor* caret is best handled by the companion extension; the *chat* box and browsers are handled by the IAccessible2 path - and since IAccessible2 finds the *editor* caret too, the overlay stands down there via `EditorCaretSignal` (below), which is what stopped two markers appearing at one caret. - **EditorCaretSignal.cs** - "the editor is drawing the marker, stay out of the way". The extension publishes `editor-caret.txt` beside `layout.txt` while it draws; `ShouldYield()` is true when that file is **fresh** (< 1.5 s) **and** the foreground process is a VS Code-family editor. Both halves are load-bearing: the file alone leaves the overlay hidden for a beat after the user alt-tabs away (the extension only notices the lost focus a poll later), and the process alone would hide the marker in VS Code's chat box and terminal, where the extension cannot draw at all. **The claim is time-limited because VS Code's API cannot say where the focus is** - `activeTextEditor` keeps pointing at the last editor even while the user types in the chat - so the extension refreshes the file only while there has been editor activity in the last 5 s. The consequence is deliberate and worth knowing: sit still in the editor for five seconds and the overlay returns beside the extension's marker. `IsFresh` and `IsEditorImage` are `internal` so the rule is unit-tested without a clock, a file or a foreground window (`EditorCaretSignalTests`). - **UiaCaretCom.cs** - hand-rolled COM interop to call `IUIAutomationTextPattern2.GetCaretRange` (absent from managed UIA). `GetFocusedElementSmart` = `GetFocusedElement` with a `GetFocusedElementBuildCache` fallback. See the "COM vtable gotchas" note above - the interface slot order is load-bearing. - **Ia2Caret.cs** - hand-rolled IAccessible2 interop (`oleacc.AccessibleObjectFromWindow` → drill `accFocus` → `QueryService(IAccessible2 → IAccessibleText)` → `caretOffset`/`characterExtents`). The caret source that works in Chromium/Electron where every UIA path fails. - **CaretDiagnostics.cs** - the tray "Diagnose caret position..." capture: 14 snapshots over ~7 s of every caret source for the focused element, written to `caret-diagnostics.txt` in the MSIX-aware folder. Run it while a problem input is focused to see exactly which source (if any) locates the caret. The sources are listed **in the overlay's order**, each asked through the overlay's own function (Win32 caret, `GetCaretRange`, IAccessible2, `GetSelection`), and the marker position printed is `CaretPlacement.Place`'s for the first that answered - never a hand-computed "+2/+1" (S0036 UI-7). - **SupportBundle.cs / MailSender.cs / SupportBundleDialog.cs** - the About tab's **"Отправить логи автору.."**: pack the diagnostic logs into one ZIP and hand it to the user's own mail client. Three things here are decisions, not implementation details. **`clipboard-history.log` is never collected** - the file list is an explicit whitelist (`SupportBundle.LogFiles`), never a directory glob, because a glob is exactly how that file gets in one day; it has its own test, and so does the fact that its payload appears nowhere in the archive. **What the whitelisted files may hold is a rule too** (ticket S0010 TD-1): `launcher.log` names a launch by the scenario's id, name and kind - never `FileName` or `Arguments`, where tokens live - and on collection the file is held to a **whitelist of today's record shapes** (`ScrubLauncherLog`, S0034 LS2-3): a record of a known safe shape goes as written, a known legacy one is cut after its diagnostic head, any other keeps only the words before a quote/slash/`%`, and a line with no time stamp (the continuation of a record whose name held a line break) is dropped - a list of legacy shapes had missed the `Started yt-dlp .. in ''` line every release up to v26.9.16.2132 wrote. The report counts scenarios through a **read-only** store that never re-identifies or renumbers a file (LS2-9); `caret-diagnostics.txt` records window classes and processes, a title or element name only as its length; and the dialog shows, per file, what kind of data it holds (`SupportBundle.Contents`, 13 languages). **`mailto:` cannot carry an attachment** (RFC 2368 has no such field and `attach=` is deliberately ignored), so `MailSender.Send` is a three-rung ladder - Simple MAPI `MAPISendMail(MAPI_DIALOG)` with the file attached, else a `mailto:` message plus `explorer /select` on the archive, else the path and the address for the user to do it by hand - and `MAPI_USER_ABORT` **stops** the ladder, since a user who closed the compose window has finished, not failed. MAPI is ANSI, so a non-ASCII path (a Cyrillic Windows account name) goes through `GetShortPathName` or drops a rung rather than arriving as mojibake; a 32-bit Outlook answers our 64-bit process with `MAPI_E_FAILURE`, which is unfixable and is why rung 2 exists. The ladder runs on a dedicated **STA** thread (`SendOnStaAsync`, S0010 TD-8) - classic Outlook's compose window expects one, and a pool thread (MTA) could fail silently or hang. The compose window gets **no owner** (an owner on the hooks' UI thread attached the two threads' input queues while it was open), and `SendWithAttachment` carries `[HandleProcessCorruptedStateExceptions]` so a Simple MAPI provider that faults drops a rung instead of taking the tray process down (S0036 UI-8). **The dialog is the consent step** - file list, sizes, path, an "open the folder" button and the plain statement about file paths (the usual ones no longer carry the Windows account name, one in an unusual shape still can) - so there are no checkboxes and, deliberately, **no new registry values**: the feature has no state. Since S0040 (`DIAGNOSTIC-REPORT` rules 1-4) every text in the archive passes **`DiagnosticRedactor`** (the data folders become ``, the profile and any `X:\Users\` ``, a URL loses its userinfo), `environment.txt` (`key=value`, counts and platform facts only, led by `schema_version=1`) sits beside `report.txt`, the name carries seconds, and the markers are the contract's `[Diag] LOG COMPACTED | ...` / `[Diag] LOG TRUNCATED | ...`. Since 0.12 (S0040 A7-A9) a **secret is redacted by its value's shape, whatever it sits under** - a secret query parameter, a credential `name=value` pair or JSON field, an auth header, a Bearer token, a PEM private key block, the account segments of `/live/user/pass/id`, a URL password holding `/ ? #` - each becomes `[REDACTED]`, name kept; the pass runs line by line under a 250 ms budget (a line that overruns is replaced by `[Diag] PATH REDACTION TIMEOUT | dropped_line_bytes=`); and **redaction precedes truncation** (`SupportBundle.Collect`: read whole, scrub, redact, only then `KeepTail`), a file above 16 MB being omitted whole with `[Diag] LOG OMITTED | reason=oversized_untrusted | source_bytes=`. Long logs are kept by their **tail** with a marker line (512 KB per file, 3 MB of collected bytes; a whole log left out at that budget stands in the archive as `[Diag] LOG OMITTED | reason=archive_cap | source_bytes=` - DIAGNOSTIC-REPORT 0.15, S0077 - and is still named in `report.txt`), archives live in `reports\` beside `layout.txt` (the MSIX-aware folder, because a mail client is a foreign process) and the five newest are kept. Subject and body are **English whatever the UI language is** - the artefact is addressed to the author - and the address is `sza@ukr.net`, the one already published in the site footer and the privacy policy. Nothing is ever sent automatically, not even after a crash. Spec: [PLAN/done/SendLogsToAuthor_Spec_Idea_v0.1.md](PLAN/done/SendLogsToAuthor_Spec_Idea_v0.1.md). - **QuickNote.cs / QuickNotesOrder.cs / QuickNotesStore.cs / QuickNotesService.cs / QuickNotesWindow.cs** - the quick notes, one concern each (feature 8 above). `QuickNote` is the model plus every rule that is a fact about text - the derived preview, the search, the two conversions and what each of them loses, the export shapes and the 512 KB cap. `QuickNotesOrder` is the order and the filter, with the binary `Insert` that keeps a save from costing O(n log n). `QuickNotesStore` is the DPAPI journal, replay, compaction and the `.bak`; its cipher is an **interface** (`IQuickNotesCipher`) for one reason - DPAPI is a per-user machine secret, so a test that used it would pass or fail for reasons unrelated to this code and would be unrunnable under a CI account. `QuickNotesService` owns the in-memory list, the draft that is nowhere until it has content, the 750 ms debounce and the flush-then-compact on exit. `QuickNotesWindow` is the only part that knows WinForms; `QuickNotesLog` is its one-line `DiagnosticLog` wrapper, and it records counts, never a note. - **QuickNotesTextEditor.cs** (S0078) - the editor the window hosts: a native `TextBox` (`QuickNotesTextBox`, which tells its host after it handled a scroll, key, wheel, size, font or paint) beside the drawn `QuickNotesLineGutter`. Rules that are not obvious from the code: the numbers are **read from the edit control, never computed** - a row's Y is `EM_POSFROMCHAR` in the edit's client coordinates moved into the gutter's **through the screen** (the edit has a 3-D border: the same number is not the same pixel), the visible rows are those above `EM_GETRECT`'s bottom (the edit trims it to whole rows; a cut-off row has no text and so no number), and a row's height is the edit's (`tmHeight + tmExternalLeading`, measured from two rows or `GetTextMetrics`), **not** `Font.Height` (16 for Consolas 10 pt where the edit lays out 15). In an EDIT "line" means visual row under WordWrap, so rows map to logical lines through `QuickNotesLineIndex` (starts of lines, binary search), rebuilt **only when the text changes and only while the numbers are shown** - scrolling and resizing never scan the text (`IndexBuilds` is the test seam). Nothing polls: a cheap signature of the view (first row, row count, formatting rectangle) is compared after the messages above and after `WM_PAINT`, and the strip repaints **synchronously** so it never trails the text by a frame. An EDIT breaks a line only on CRLF (a bare LF or CR is a box glyph), which is why the window's `ForDisplay` always hands it CRLF. The strip is physically on the left in an RTL window (the editor passes no layout to its children); in high contrast the numbers use `text.primary`. `WordWrap` recreates the handle, so the edit's undo history does not survive that one switch (it never did); the numbers toggle does not recreate anything. `QuickNotesLineNumbersGeometryTests` compares pixels (ink of a number against ink of the row's first characters) against an oracle that counts breaks by hand. - **CyrFlipExchangeModels.cs / CyrFlipExchangeWriter.cs / CyrFlipExchangeReader.cs / CyrFlipExchangeMerge.cs / ExchangeExportDialog.cs / ExchangeFlow.cs** - the open exchange file (feature 10). The first four know no WinForms and are what `CyrFlipExchangeTests` holds to the spec: the DTOs and caps, the writer (fence choice, one-line metadata, second-truncated dates, `SelectHistory`, the temp-file-then-replace write), the reader (splits on **LF only** - `TextReader.ReadLine` would eat a payload's CR - with the CRLF-file detection and the hash-decided line endings) and the merge planner that both the preview and the import run. `QuickNotesService.Import` changes an existing note **in place** and raises `Imported`, so the notes window reloads the one it holds open. A failed note batch returns `NotesUnwritten`; the dialog reports pending persistence instead of import completion. Quick-note copy feedback also follows the clipboard result. `ExchangeFlow` is only the dialogs around them, run through `CyrFlipContext.RunExchange`. `SettingsForm` takes the `exchange` callback as its last (nullable, required) parameter; every test builds the window through the one compiled `TestForms.NewSettings`, so a constructor change breaks the build, never the run (S0029 RB-1 - reflection binds no defaults). - **ScreenCapture.cs / RegionSelectionOverlay.cs / ClipboardImage.cs / ScreenshotSaver.cs** - the Graphics module's region capture (feature 11), one concern each: the grab, the crop and the pure rectangle math (`Normalize`, `ClampToVirtualScreen`, `IsClick`, `MonitorSlice` - `ScreenCaptureTests`); the per-monitor overlay windows, the only part that knows WinForms (declared out of theme - it paints the user's own screen; its veil colours live in `ThemePalette` as `Capture*`); the PNG and bottom-up 32bpp DIB encodings (`ClipboardImageTests`); and the `CAPTURE-OUTPUT` saver (`ScreenshotSaverTests` - conformance step 1, the name in ar-SA/hi-IN/bn-BD). The frame is the one large allocation (~66 MB for two 4K monitors) and is disposed the moment the region is cropped out of it. - **SymbolsData.cs / Symbols.g.cs / SymbolSearch.cs / SymbolsClipboardMirror.cs / SymbolTypability.cs / SymbolGrid.cs / SymbolsWindow.cs / Localization.Symbols.cs** - the symbols window (feature 12), one concern each: the entry type and the 12 categories beside the **generated** table (never edited by hand); the pure search (character / code point / name prefix / category, standard order); the clipboard mirror's rule (`SymbolsClipboardMirror`: a read replaces the text field only when it is newer than what the field shows, so a late read cannot undo a pick); the per-layout "can I already type this" answer behind a seam over the installed layouts, cached per layout set; the owner-drawn grid (`TextRenderer`, `ThemePalette` roles only, twelve columns, one accessible child per visible cell, combining marks on `◌`, blank characters as short labels) and the window - the only part that knows the focus rule and the geometry. - **ChordDefaults.cs / ChordOverviewModel.cs / ChordResetPlan.cs / SettingsForm.HotkeysOverview.cs / CyrFlipContext.ChordOverview.cs / Localization.HotkeysOverview.cs** - the hotkeys overview (feature 13), one concern each. `ChordDefaults` is the shipped chord per binding (the constants of `AppConfig`, `MouseChord.Default`) and the seeded-row identity; `ChordConfigAccess` (in `ChordOverviewModel.cs`) is the one reader/writer of a fixed chord and its switch on `AppConfig`, so a `ChordKind` added without an entry fails loudly. `ChordOverviewModel.Build` takes the config, the scenarios and Windows' records as arguments and returns `ChordOverviewRow`s - no WinForms, no registry. `ChordResetPlan` is the value described under feature 13 (`ForAll`, `ForRow`, `Apply`). `SettingsForm` is a **partial** class so the page lives in its own file (the form is already large); it builds rows from the model on every `ApplyLanguage`, keeps its focus through `RowFocus`, and routes edits through the owning page's setters. `CyrFlipContext.OnChordsEdited` is what a reset ends in: save, hand the hook **every** chord and switch again, refresh the launcher surfaces. `ChordOverviewModelTests`, `ChordResetPlanTests` and `HotkeysOverviewPageTests` hold it (the inventory gate fails the build when a chord has no row; the page is built in 13 languages with nothing clipped; "both views one value" with no handler fired by a refresh); `tools/uitest/Test-HotkeysOverview.ps1` stages a state on the real settings (backup first, refuses without it, restores in `finally`) and ends in the human checklist. - **LayoutStyle.cs** - shared marker look used by all three surfaces. The palette has **two levels and one exit**: `Curated` is the colour of a *language* (the 13; EN=blue, RU=red, UK=green ..), `Layouts` is the colour of one *keyboard layout* keyed by KLID (all 25 layouts of those 13 languages, each a shade **inside its language's hue**), and `Other` is the single neutral colour for everything else. `ColorFor(code)` answers the first, `ColorForLayout(klid, code)` walks all three rungs (exact layout → its language → `Other`), which is what every drawing surface calls. `DrawCode` renders the letters with that fill **plus a black outline** (`GraphicsPath.AddString` → `Flatten` → measure → scale → `DrawPath` black pen → `FillPath`): the **flatten-then-fit** step is load-bearing, since `GetBounds` on a curved path measures the Béziers' control points, not the ink, and fitting to that leaves lopsided margins - visibly so at 14px. `TextMargin` (1px), `OutlineFraction` and `AntiAliasBleed` are the constants behind "one pixel of border, letters as large as that allows". `MarkerOpacity` (0.6) is the translucency the caret overlay, the mouse badge and the VS Code extension share. `DrawCapsFrame` draws the **1px rounded layout-colour frame** that flags CapsLock around the marker. **This file is the source of truth for the palette, and the palette has exactly two other consumers, handled two different ways.** `tools/IconGen` **compiles this very file** (`` in its csproj), so it cannot disagree - which is also why this file must depend on nothing but `System.Drawing`. The VS Code extension is packaged separately and cannot compile C#, so it reads `vscode-extension/src/layout-colors.json` - the machine-readable copy of both tables and `other` - and `LayoutColorsTests` fails the build when the two drift, in either direction. That test exists because the drift already happened once and is invisible in both builds: the extension knew only EN/RU/UK and painted the other ten curated languages grey while the app drew them in colour. - **LayoutIdentity.cs** - the HKL → KLID decode that lets the colour name a *layout* rather than only a language. An HKL's high word is the language id again for a language's primary keyboard and `0xF000 | LayoutId` for every other one, where `LayoutId` is the value beside that layout in `HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\` (verified live on this machine: US-International = `F0010409`, Russian Typewriter = `F0080419`). `Resolve(hkl, map)` takes the registry as an argument so the decode is unit-tested (`LayoutIdentityTests`) while the registry read is cached - re-read at most every 30 s, and only when the layout id is **absent** from the map (`NeedsReread`, ticket S0030 HT-7), because a display-language pack can add layouts while CyrFlip is running; an id that is there but belongs to another language (US-International under Russian) comes back from a re-read unchanged, and used to re-open some two hundred HKLM subkeys every 30 s. Anything unresolvable (an IME's `0xE0xx` handle, an id that belongs to another language, an unreadable registry) falls back to the language's primary KLID: the marker is about to draw that language either way, and answering "unknown" would drop it to the neutral colour, which would be a lie. - **TransliterationEngine.cs** - `static`; two `Dictionary` (EN→RU, RU→EN) covering the 34 letter *and* punctuation key positions. `Transliterate` auto-detects direction **per character**, so one pass fixes either direction and mixed text; case preserved; unmapped chars pass through. O(n). A **non-letter** is the one ambiguous case, and it follows **the converter's rule** (S0009 FP-9): `TransliterateFrom(input, fromLatin)` - what the `KeyboardLayoutConverter` fallback calls, since it knows which layout of the pair is the source - tries the pair's own direction first, per character, and the opposite one only when the first has nothing to say; `Transliterate(input)` without a pair picks that direction from the text's dominant script. The old dominant-script-only rule made `привет?` come back as `ghbdtn&` without the Russian keyboard and `ghbdtn,` with it. `convertSymbols` (from `AppConfig.ConvertSymbols`, default true) says whether a key that is punctuation on *both* sides is swapped at all - see feature 2. - **CaseFlipEngine.cs** - `static`; `Flip` inverts each cased letter (UPPER↔lower) via invariant-culture mapping, leaving digits/punctuation/whitespace untouched. Works for Latin and Cyrillic; it is its own inverse for every character it changes - a letter is flipped only when its case partner maps back to it, so µ, ı, ς, ſ and the Kelvin sign K (whose partners come back as μ, i, σ, s and K) are left alone (S0009 FP-10). The transform behind the case-flip hotkey (undo an accidental CapsLock). O(n). Beside it, `DesiredCapsLock` answers **which state the CapsLock key should end up in** for a given text - the last cased letter decides, and `null` means "nothing cased here, leave the key alone". It lives here because it is a pure fact about text, which is what makes the whole "sync CapsLock" behaviour unit-testable without a keyboard. - **ClipboardHandler.cs** - the selection transform pipeline: back up clipboard → clean synthesized Ctrl+C (`SendInput`, releasing held modifiers first) → poll for the selection → apply the transform → cancel if the foreground window changed → set clipboard → Ctrl+V → restore clipboard. The core `Run(transform, syncCapsAfter, targetKlid)` is shared: `ConvertLayout(profile, switchLayoutAfter)` passes the row's physical-key conversion (and, when the setting is on, switches the window to the layout the text now reads in), `FlipCase(syncCapsAfter)` passes `CaseFlipEngine.Flip` (never switches layout; optionally sets CapsLock to match the pasted text via `SetCapsLock`, which reads the live state and sends the synthesized `VK_CAPITAL` down+up **only when it differs** - Windows has no API that sets a lock state directly, and that comparison is what makes the call idempotent). Both post-actions are absolute: `ReplaceSelection` takes a `bool? capsAfter` (null = leave it alone) beside `targetKlid`, exactly as the layout switch names a layout rather than "the next one"; with "Press SHIFT to turn off Caps Lock" (`KLLF_SHIFTLOCK`) the CapsLock key cannot turn the lock off, so `SetCapsLock` re-reads it and taps a masked Shift (`KeyInjection.ShiftTap`) when it is still on - never while the user holds a Shift (S0009 FP-11). Clipboard ops retry up to 12 attempts, 15 ms apart on lock (`Win32Clipboard.cs:444`). Both halves are also available on their own - **`TakeSelection`** (backup, capture, hand the clipboard straight back - the translator's and the quick notes' phase A) and **`ReplaceSelection`** - because the translator needs seconds of network time between them and cannot hold the clipboard that long; `Run` is capture + replace inside one backup, so the flips keep their single-backup behaviour. **The backup covers three formats, not just text** (`CF_UNICODETEXT` + `CF_DIB` + `CF_HDROP`, handed back in one open/empty/refill pass via `Win32Clipboard.RestoreIf` - restoring them one at a time cannot work, since each write empties the clipboard again): the copy half ends in `EmptyClipboard`, so backing up text alone meant a user who had a screenshot or a set of copied files on the clipboard and then fixed a word with a chord **lost them for good**. `CF_DIB` is what covers images, because Windows synthesizes `CF_BITMAP`/`CF_DIBV5` from it; an image over `MaxBackupImageBytes` (64 MB) is skipped rather than carried through memory twice on every flip. **Ticket S0009 made the hand-back exact**, and each rule has its own test: the backup is read in **one** open behind the `IClipboardReader` seam (`FakeClipboard` in the tests), text as raw bytes, with its **companions** - a password manager's four "do not record" markers (a marker that is present but unreadable goes back as DWORD 0, never dropped: dropping it published the secret to Win+V), `Preferred DropEffect` + `Shell IDList Array` (a Cut of files stays a move) and `CF_LOCALE`; a clipboard that held formats but **could not be read** stops the flip with `Failed` before a key is sent (FP-5), where it used to be overwritten and never restored; the restore is decided **inside its own open** by `ClipboardRestore.Plan` - **not at all** when the sequence number never moved (FP-3: the chord with nothing selected no longer rewrites the clipboard, which had destroyed RTF, HTML and Excel's live cell copy), and not over a clipboard somebody wrote after our paste (FP-1); an editor's whole-line copy on an empty selection (`LineCopyMarkers`) counts as no selection (FP-4); a selection over `MaxFlipChars` (1 M) is refused unread with its own balloon (FP-6); the pasted text carries `CF_LOCALE` - the target layout's language for a conversion, the selection's own for a case flip, the translation's for a translation (FP-8). **Ticket S0032 closed four edges**: the backup's sequence number is the one read *after* its own reads and again after the close (FP2-1 - reading a delay-rendered format makes Excel render and move it, which turned "unchanged" into a rewrite of the live cell copy); only the **text** can make a backup unreadable, and so can text over `MaxBackupTextBytes` (64 MB) - a picture or file list that fails to render is logged and not carried (FP2-2); a clipboard that held **no format at all** is handed back empty (`ClipboardBackup.WasEmpty`/`Restorable`, FP2-4); `TakeSelection` takes the consumer's own cap (the quick notes' 512 K) and `RunEdit` never marshals the selection at all - a one-character cap with `presenceOnly` (FP2-5). **The paste is delay-rendered** (`ClipboardOwner`, below): the restore waits for the target's own read instead of a fixed 140 ms (FP-1B). Which modifiers the user is physically holding comes from the hook's table (`PhysicalModifiers.Shared`), not from `GetAsyncKeyState`, which our own key-ups falsify; every synthesized chord is planned by `KeyInjection` (side-specific keys, only what is held, the mask key) and the released keys are pressed again only while still physically held. Runs on the dedicated background clipboard thread (MTA - `Win32Clipboard` is raw Win32, not OLE, so no STA/message pump is needed). - **ClipboardOwner.cs** - the STA thread with a message-only window that owns the clipboard while a flip's text is on it, so the text can be **delay-rendered** (ticket S0009, FP-1B): `Offer` announces CF_UNICODETEXT with no data (plus `CF_LOCALE` and the scaffolding's "do not record" markers, `TransientMarks`), and the target's read arrives as `WM_RENDERFORMAT` - the one reliable proof that it has taken the paste. A fixed 140 ms let a busy Word, a Java IDE and above all an RDP/Citrix/VM session read the clipboard *after* the restore and paste the user's previous clipboard over the selection. `PasteOffer` is one paste's state machine: a render **before** `Arm()` (i.e. before the Ctrl+V) was a clipboard monitor, not the target, and makes the target's read unobservable - the wait then falls back to the fixed settle time, and `RenderedBy` names the process in `clipboard-flip.log`. Remote/VM targets get `TransientMarks.HistoryOnly` - never `ExcludeClipboardContentFromMonitorProcessing`, since their clipboard bridge is itself a monitor. The restore judges "still ours" by **ownership** (`OwnsClipboard`: any other writer empties the clipboard, which takes it from this window), a plain write by its sequence number. A render counts as the paste only when the requester is the target's process or a remote/VM bridge (`PasteOffer.IsTargetRead`, S0032 FP2-3) - a clipboard manager that ignores the markers is an early render, i.e. the fixed wait; a failed owner start is retried after a back-off (`RetryDelayMs`, 30 s doubling to 30 min) and a window created too late stops itself (FP2-6). Everything degrades rather than fails: an owner that cannot start or cannot take the clipboard makes the caller write the text directly and wait the fixed time. Stopped by `ShutdownShared` in `CyrFlipContext.Dispose`, so a promised paste is rendered for good (`WM_RENDERALLFORMATS`). **Verified live 2026-09-25** (`tools/uitest/Test-ClipboardFlip.ps1`, inside an RDP session): the offer takes the clipboard, the target receives the delay-rendered text, `CF_LOCALE` sits beside it; on that machine a QEMU VM's clipboard sharing fetched every offer at once despite the markers, so there the flips used the fixed-wait fallback - which is the designed behaviour. - **ClipboardRestore.cs** - the pure half of the hand-back: `ClipboardRestore.Plan` (Restore / Unchanged / TakenOver / NothingToRestore), `PasteTiming` (140 ms settle, 1500 ms for a slow target; 2 s / 5 s caps; 480 / 1500 ms copy poll; 100 ms grace), `PasteWait.Run` (waits on an `IPasteSignal` against an injectable clock - consumed at 50 ms means a restore at ~150 ms, never consumed means the cap) and `BusyNotice` (the "another clipboard operation" balloon a flip now shows when `_busy` is taken, at most once per 5 s - it used to return in silence, like a dead hotkey). - **LineCopyMarkers.cs** - "the editor copied the whole line because nothing was selected" (FP-4): `MSDEVLineSelect` (Scintilla, old VS), `VisualStudioEditorOperationsLineCutCopyClipboardTag` (VS 2010+) and VS Code's `vscode-editor-data` with `"isFromEmptySelection":true` inside Chromium's custom-data pickle (decoded as UTF-16 - every pickle field is 4-byte aligned, so no pickle parser is needed). Checked inside the capture's own open. **JetBrains is deliberately absent** until its marker is identified live with a clipboard viewer - a guessed name would never match or would match an ordinary copy. - **ClipboardFlipLog.cs** - `clipboard-flip.log`, in the support bundle's whitelist: how the hand-back went (a paste not consumed within the cap, a restore skipped, a clipboard too busy to back up, which process rendered a paste early) - lengths and process names, never a character of the text. - **ClipboardHistoryService.cs (+ `ClipboardHistoryWindow` / `ClipboardHistorySearchWindow`)** - the opt-in clipboard manager: a `NativeWindow` listening on `AddClipboardFormatListener`, an append-only log (`%LOCALAPPDATA%\CyrFlip\clipboard-history.log`, **every record DPAPI-protected whole** - text, id, source app, window title - ticket S0031) and the in-memory list the strip and the search window paint from. **Accepted design decision (2026-07-26, after a leak audit): the history is deliberately unbounded.** There is no entry cap, no age-based retention and no log compaction - the whole point is that nothing the user copied is ever silently dropped, and the memory/disk cost of that is the user's to spend. Do **not** "fix" this by adding a limit; it is a decision, not an oversight. What the decision *does* oblige is that nothing may cost O(history) per copy or per repaint - and that obligation is now discharged by **`ClipboardHistoryOrder`**, a separate class holding the list, the `_byUuid` index and the "what the clipboard holds now" flag: the display order is **maintained incrementally** (a binary search plus one list move, no comparers and no allocation) instead of the whole history being re-sorted after every copy, and `SetCurrent` touches only the two entries whose flag changes instead of walking every one. Each change still raises `Changed` exactly once. Splitting it out is also what makes the order unit-testable without a `NativeWindow`, the registry or DPAPI: `ClipboardHistoryOrderTests` replays a thousand random operations and compares against that very reference sort after each one. The window persists its position **once per drag** (`MouseUp`), not on every `Move` - each save is a full `AppConfig.Save()`, i.e. forty-odd registry values plus both profile tables serialized. Four rules from ticket S0005, each with its own class. **`ClipboardHistoryJournal`** is the file: **one** dedicated writer thread owns the `FileStream` and drains one queue, so records land in the order they were made (a pool item per record once wrote a `delete` before its `add`), `Clear` is a queued command in order with the appends around it (a failed delete raises `ClearFailed`, never a silent "empty until restart"), and `Dispose` drains it; records are **snapshots** taken on the UI thread and written as `"\n" + json`, and the replay is **per line** - a torn or undecryptable line is skipped and counted (`SkippedRecords`, one balloon), never the whole history, and never removed from disk. **`ClipboardHistoryGate`** decides what CyrFlip's own traffic is by the **clipboard sequence number**, not the clock: every clipboard worker brackets itself with `SuppressBegin`/`SuppressEnd` (the end mark is the sequence after the restore), and the history's own write from the strip is skipped by its **exact** number - the 2 s window it replaced dropped real copies after a flip, and the boolean dropped the next copy after a paused restore. **`ClipboardPrivacy`**: a copy carrying `ExcludeClipboardContentFromMonitorProcessing`, `Clipboard Viewer Ignore`, or `CanIncludeInClipboardHistory`/`CanUploadToCloudClipboard` = 0 (password managers) is **not recorded**, and its text is never even read (`Win32Clipboard.TryReadForHistory` checks the markers inside the same open) - the one thing the unbounded history does not keep, at the copying app's explicit request. **`ClipboardHistoryEntry.Preview`** (first 1024 chars, one line, cached) is all the strip and the search list ever draw; the search window debounces 150 ms, matches the full text on a background task cancelled per keystroke, and is a `VirtualMode` `ListView`. `clipboard-history-diagnostics.log` (`ClipboardHistoryLog`) holds only counts and is in the support bundle's whitelist. Ticket S0031 added four rules. **Nothing readable on disk**: a record is `{"v":2,"blob":...}`, the blob the cipher of the whole record - the id is the SHA-256 of the text, which reverses a short code in milliseconds, so it never stands beside the blob (and needs no keyed hash inside it); v1 lines (payload encrypted, the rest in clear) are still read, never rewritten. **"×" erases**: a delete rewrites the file without any line of that entry (unreadable lines carried verbatim, no `.bak`), and only a failed rewrite falls back to a tombstone - a user-requested removal is not the silent dropping the unbounded decision forbids. **The owning thread by construction**: every result from the pool or the writer (capture, "too large", "clear failed", "write failed") is posted to the service's own window (`PostToOwner`, a private `WM_APP` message + a queue), never through a `SynchronizationContext` read in the constructor. **Losses are counted**: a failed write (`WriteFailures`, one balloon for background writes and a report for every failed erase), an import reports only after `FlushJournal`, and `Dispose` logs the records it abandoned. A privacy DWORD marker that is present but unreadable counts as 0 (`ClipboardPrivacy.MarkerValue`) - the flip backup's rule. **An entry's text is editable in the strip** (ticket S0089): a right click on a cell's text, or F2 on the keyboard cursor, opens one lazily created multiline `TextBox` over the cell with the **whole** text (the cell paints only the preview); Enter or any click on the strip outside it saves - that click is consumed in `WndProc` and does nothing else - Shift+Enter breaks the line, Escape discards, focus loss and hiding save, and while it is open every other key is the editor's. The strip's caption is now "Clipboard" (the window); every other surface still says "Clipboard history" (the feature). **`ClipboardHistoryService.UpdateText` keeps the id rule**: an id is the hash of its text (the exchange file refuses one that is not), so an edit is the old entry **erased** exactly as "×" erases it plus an `add` under the new text carrying the date, pin and source - no new journal action, so an older build reads the file as it is. A text another entry holds merges into it (its date, pinned when either was); empty or whitespace, unchanged, or over `MaxTextChars` (the capture cap; `ItemTooLarge` says so) changes nothing - an edit never deletes. An id erased before the replay merged is not brought back by it (`_erasedBeforeReplay`). - **AppShortcuts.cs** - the unpackaged build's Start menu and desktop `CyrFlip.lnk` (ticket S0041): there is no installer, so the first run from a stable folder creates both (`ShortcutsCreated` marker), later runs re-point an existing link at the running exe when the folder moved, a start from `%TEMP%` or `bin` touches nothing, and a deleted link comes back only through the General-page checkbox. The packaged build writes none - Windows lists the package in Start itself; an MSIX desktop shortcut (`desktop7:Shortcut`, build 19645+) is still open. - **Autostart.cs** - `HKCU\..\Run` toggle (per-user; not a service - see deviations). **Packaged (Store) builds are different in both directions:** the `Run` write is virtualized, so `Set` is a no-op and the settings checkbox opens *Settings ▸ Apps ▸ Startup* instead - but the state is **read** from the startupTask record (`..\AppModel\SystemAppData\\CyrFlipStartup\State`, `StartupTaskState` 2/4 = on) and re-read when the settings window is activated. Returning a hard `false` there is what made the checkbox look broken: it opened the system page and then "unticked" itself even though Windows was starting CyrFlip. - **KeepAwake.cs** - the two "don't sleep / don't blank the screen (like video)" toggles. Two independent switches (`KeepSystemAwake`/`KeepScreenOn`) OR-ed into one `SetThreadExecutionState` call: `ES_SYSTEM_REQUIRED` (system won't sleep) and `ES_DISPLAY_REQUIRED` (display won't blank/lock on idle). `ES_CONTINUOUS` makes the request sticky (one call per change, no polling); it is bound to the calling thread (the tray UI thread), so a hard kill clears it for free, and `Reset()` restores the normal idle policy on exit and when both are off. **Both switches are persisted** (`AppConfig.KeepSystemAwake`/`KeepScreenOn`) and re-applied at startup by `Restore(system, screen)` - **one** call carrying both bits, never two, so a launch with both on never asks Windows for half the policy first. That reverses spec §5's original "memory only, off on every launch" (changed 2026-07-28): a switch that silently forgot itself read as broken, which is exactly how it was reported. The old safety argument now lives in the UI text instead - the settings hint says outright that a forgotten switch keeps the machine awake after a restart too and that CyrFlip will not watch your battery for you. `KeepAwake` still persists nothing itself: `CyrFlipContext` writes the config and hands the state back, so the P/Invoke seam (`SetExecutionState`) stays the only thing to fake in tests. No admin rights; the two registry values are ordinary `AppConfig` state. Driven by two checkable tray items + two "General"-tab checkboxes; see [PLAN/done/KeepAwake_Spec_Idea_v0.1.md](PLAN/done/KeepAwake_Spec_Idea_v0.1.md). **Only `powercfg /requests` (admin) can confirm the request landed** - `SetThreadExecutionState` returns the previous state, never a confirmation; `tools/uitest/Test-KeepAwake.ps1` is that check. - **WindowInterop.cs** - all `[DllImport]`s + interop structs. The `INPUT` union includes `MOUSEINPUT` so `Marshal.SizeOf(INPUT)` matches the real struct on x64 (else `SendInput` silently fails). - **AppConfig.cs** - persists settings to `HKCU\Software\CyrFlip`. A failed key open marks the entire config unreadable and blocks every save, snapshot capture and first-run tour until restart (S0063). On first run with no registry key, migrates from a legacy `config.json` (from `%APPDATA%\CyrFlip\` or beside the exe) and seeds the conversion table (`NeedsFlipRow`/`FlipRow`, called from `Load()`; see feature 2). Fields: `CaseHotkey` (default **Ctrl+Shift+F11**), `CursorSize`, `EnableCursorChange` (default **false**), `EnableCaretOverlay` (default **true**), `CaretDotMode` (default **false**), `EnableLanguageSwitch` (default **false**), `FlipCapsLockAfter` (default **false**), `ConvertSymbols` (default **true**), the hotkey switches `EnableHotkeys`/`EnableCaseHotkey`/`EnableHistoryHotkey` (all default **true**), `DeferToRemoteDesktop` (default **false**), `FlipCount` + `CaseFlipCount` + `TranslateCount` (usage counters), and the translator block (`EnableTranslate`, `TranslateSeeded`, `TranslateProfiles`, `TranslateEndpoint`, `TranslateModel`, the timeouts and the result-window options - see the config table). `UiLanguage` holds the language **endonym** ("Русский", "Deutsch", "中文", ..) and defaults to the OS UI language via `Localization.DefaultLanguage()` (any of the 13 translated languages, else **English**, the source language of the translation table - never Russian). The **user's display language** (`CurrentUICulture`) wins over the language Windows was installed in (`InstalledUICulture`), which is the only one that is right for an English Windows switched to a Russian desktop; regional variants resolve to their language, so de-AT, pt-BR and zh-Hans-CN all find their translation. `SettingsTab` remembers which settings page was open (restored on the next launch too, clamped against the live page count - the tab strip grows between versions). `Save()` writes all fields; `IncrementFlipCount()`/`IncrementCaseFlipCount()`/`IncrementTranslateCount()`/`SaveSettingsTab()` write only that one value (cheap). `SaveSettingsUiState()` is the settings window's UI-context write (ticket S0048, WINDOWS-UI section 3): group expansion (`SettingsGroupsState`), per-page scroll anchors (`SettingsViewport`) and the window rectangle (`SettingsWindowX/Y/Width/Height`), written when the window hides, never while the user drags it; anchors are stable group ids/row ordinals, not translated captions. **Every value is read on its own** (`LoadFrom`/`SaveTo` over the `IConfigKey` seam, `AppConfigLoadTests`; ticket S0007 CF-1): a value of the wrong kind falls back to its own default and lands in `UnreadableValues` (one balloon per start), where it used to abort the whole load and let the next save wipe the conversion table and the one-time Windows snapshots. A table or snapshot that is present but unreadable is **never saved over** until the user edits it; window geometry values are clamped by their windows rather than on load, other numbers are clamped to their UI's range; and the two profile tables are sanitized on load - null rows dropped, null strings made `""`, duplicate ids regenerated, the repaired form written back (CF-2). - **Localization.cs (+ `Localization.*.cs` partials)** - the **single localization layer** for the whole app: settings window, tray menu and every dialog read from it, so adding a language is one column instead of a ternary in each file (the old `ru ? ... : uk ? ...` pattern is gone). The **key is the English source string** (ticket S0070: code is English, English is the source language, Russian is a translation like Ukrainian) - call sites stay readable and no resource ids are needed - and the value is one translation per language, `ru:` and `uk:` being columns like the others. A row is `Add("Recording", ru: "Запись", uk: ..., zh: ...)` and `Values` is parallel to `Names`. `Names`/`Codes` list the **13 UI languages** (the curated world set plus Russian, matching `WorldLayouts.Popular`); an unknown key returns the source unchanged and an empty translation falls back to the key itself (English), never to Russian. **A key never holds Cyrillic**, and a Cyrillic string literal lives only in a `ru:`/`uk:` column, in `Symbols.g.cs` or in the declared samples of `LocalizationSourceGateTests.DeclaredData` - the gate scans every string literal, not only the ones in a translating call. Two surfaces that need one English word in two grammatical forms of another language (`Large` for the marker, `Large (tiles)` for the traffic-light tiles; seven pairs, `PLAN/S0070_english-source-strings/research/decisions.tsv`) get distinct keys, the second with a context in parentheses and an `en:` display text that keeps the English UI unchanged. **Rewording an English caption renames its key**: `tools/l10n/Rename-SourceKey.ps1`. Three helpers carry the script-specific bits: `IsRightToLeft` (ar/ur → `RightToLeft` + `RightToLeftLayout` on every form), `FontFamily` (Nirmala UI for hi/bn, Microsoft YaHei UI for zh; null = the default font is fine) and `WidthScale`/`Scaled` (the tables' fixed pixel columns were measured against Russian, and German or Devanagari overflow them). `SettingsForm.ApplyScript` applies all three on every language change, and `RefreshBoldFonts` re-derives the section headers, whose explicit **bold** font would otherwise not inherit the new family. **A translated template is formatted by `Localization.Format`** (a language, or the window's own `T` function) and never by `string.Format`: a translation with a broken `{n}` would otherwise throw inside whatever event handler asked, so a broken one shows the source sentence instead (`APP-BEHAVIOUR` rule 7; gated by `AppBehaviourGateTests.NoTranslatedTemplateIsFormattedRaw`, and the placeholder parity of every translation by `LocalizationSourceGateTests`). **Never lay a dialog out by pixel coordinates.** Captions exist in 13 languages and are drawn at whatever display scaling makes of the UI font, so fixed geometry clips them - the bug that had "Assign" rendering as "Assig" and `Ctrl+Shift+F12` as `Ctrl+Shift+F1`. `HotkeyDialog` and `LayoutConversionDialog` use an auto-sizing `TableLayoutPanel` in an `AutoSize` form; `SettingsForm.RowHeight` derives from `Font.Height` and `MeasureConversionColumns` measures the text that is actually going to be drawn. `DialogLayoutTests` guards it. - **HotkeyDialog.cs** - a modal `Form` (`FormBorderStyle.FixedDialog`) that captures a new hotkey from the user. `KeyPreview = true`; requires at least one modifier (Ctrl/Shift/Alt) plus a trigger key (A-Z, 0-9, F1-F24, or named keys). The constructor takes an optional window title (so the case-flip dialog reads "Set case hotkey"). Returns the hotkey string via `CapturedHotkey` on `DialogResult.OK`. - **RowFocus.cs** - keeps the keyboard focus in a settings row table across the rebuild every row action does (S0045 K6), and `RowCheckBox`, the rows' caption-less switch that draws its focus rectangle round the box (K9). The keyboard routes S0045 added elsewhere: the history strip's cursor (arrows, Enter, Space pins, Delete, Ctrl+F), Esc/Enter/Delete in the history search, the region capture's arrows / Shift+arrows / Enter (whole monitor with no selection) / Ctrl+A (`RegionSelectionOverlay.OnKey`, `Nudge`), the settings page list's focus frame, and the launcher taskbar menu opening on the taskbar's edge when the pointer is not on it (`LauncherTaskbarWindow.MenuAnchor`). `KeyboardParityTests` holds the pure parts. - **InputLayouts.cs** - installs / removes / reorders **Windows keyboard layouts** for the "Языки Windows" tab (no downloads - the layout DLLs ship with Windows). Win11 keeps input layouts in **two** stores at once: legacy `HKCU\Keyboard Layout\Preload`+`Substitutes` (read by `GetKeyboardLayoutList`) and the modern, authoritative `HKCU\Control Panel\International\User Profile` (a `Languages` BCP-47 multi-string + a `:=1` value per keyboard). The modern store re-syncs the legacy one on sign-in, so both follow one canonical ordered KLID list on every successful change (`Persist` returns the failure and override): registry writes and restores first capture the complete affected trees and roll back on failure (S0063). On success, the legacy store is rebuilt, the modern one is **edited as a diff** (`ApplyLayouts` on a `ProfileModel`, unit-tested) that **never deletes an IME/TIP value** (`0804:{CLSID}{PROFILE}` - Pinyin, the Japanese/Korean IMEs; ticket S0007 WL-1), drops a language only when this edit removed its last layout and it holds no TIP, keeps a keyboard under the language it already lives in, never reorders `Languages` (the user's app/web language list) and makes a layout the default through `InputMethodOverride`. **Add, remove and "Default" go first through the documented `input.dll` API** (`InputLayoutApi.cs`, S0007 WL-1 phase B: `EnumEnabledLayoutOrTip` / `InstallLayoutOrTip` / `SetDefaultLayoutOrTip`, language + keyboard/TIP pairs, `LAYOUTORTIPPROFILE` checked live), each call **verified by enumerating again**; a missing API, a refusal or a "yes" that changed nothing returns null and the edit takes the registry path above. ↑↓ has no API call and stays on that path; a Pinyin-style stand-in row is still refused (it cannot say which TIP it is). `tools/uitest/Test-InputLayoutApi.ps1 -Apply` is the live check. The live session is driven by the documented `LoadKeyboardLayout`/`UnloadKeyboardLayout`; a removal unloads only the handles `LayoutIdentity` decodes to that KLID (`HklsToUnload`). Preload can't list two layouts of one language, so the 2nd+ use a `d` device handle via `Substitutes` (`BuildPreload`, unit-tested). A KLID's low 4 hex = its language id. `BackupAll`/`RestoreAll` snapshot both stores - format 2 keeps every profile value with its registry kind; format 1 (before S0007) is still restorable - and the restore deletes only the language subkeys, never the profile root, then reloads the live layouts. Every settings handler that writes Windows state calls `SettingsForm.EnsureSystemBackups` first (`SettingsBackupInventoryTests` scans for it), and writes nothing when that snapshot cannot be taken; a stored backup that did not read is never retaken over. The S0007 audit additions: an edit refuses when Preload cannot be read **whole** (`TryReadEffectiveKlids`) and the modern store loses only the one KLID a removal names, never a layout the list merely missed (WL-10); ↑↓ move a layout only within its own language (`GroupOf`/`CanMove` - the `Languages` order rebuilds Preload at sign-in, WL-8); a row that stands for an IME (`IsManagedByWindows`) is not removed (WL-9); a backup is all-or-nothing and restore refuses one that could not put a layout back (`TryParseSnapshot`, WL-11); duplicate direct-switch slots of one HKL are one assignment (`LanguageHotkeys.SlotsFor`, WL-12). `LayoutPickerDialog.cs` is the type-to-filter "add layout" picker (an auto-sizing `TableLayoutPanel`). - **LanguageHotkeys.cs** - editor for **Windows'** own "switch straight to this input language" chords, stored in `HKCU\Control Panel\Input Method\Hot Keys\` (ids `0x100`-`0x11F` = `IME_HOTKEY_DSWITCH_FIRST/LAST`), each a subkey with three 4-byte little-endian `REG_BINARY` values: `Key Modifiers` (a `MOD_*` mask), `Virtual Key`, `Target IME` (the destination HKL). The switch-chord setter verifies all writes, returns failure and refreshes the dropdown from Windows; one-time backups are complete or absent. Written values are re-read by the OS via `SystemParametersInfo(SPI_SETLANGTOGGLE)`. **CyrFlip does not process these chords** - the hook doesn't look at them; that's the whole point (they survive the app being closed). Two things worth knowing: the format stores an *arbitrary* modifier mask + VK, so **plain `Ctrl+1` is representable even though the built-in Windows dialog only offers `Ctrl+Shift+digit` / `Left Alt+Shift+digit`** - that's the feature's added value; and ids outside the direct-switch range are Windows' built-in IME chords (`0x10`, `0x70`, `0x200`..) which are never touched. Windows ships orphaned records (e.g. `0x104` → a Japanese HKL that isn't installed), so the UI surfaces those for removal instead of clobbering them. `AppConfig.LanguageHotkeysBackup` holds a one-time JSON snapshot of the pre-CyrFlip state so "restore" always means the state the user arrived with - since S0007 (format 2) including the three `Keyboard Layout\Toggle` values. A stored `Target IME` is **sign**-extended into an `IntPtr` (`HklFromStored`) and HKLs are compared on their low 32 bits (`HklEquals`): `new IntPtr(uint)` zero-extends, so an alternate layout (`F0010409`) or an IME never matched its own live handle on x64 (WL-4). Changing the language switch chord leaves `Layout Hotkey` alone unless the two would collide (`LayoutHotkeyAfter`, WL-6). - **KeyboardLayoutConverter.cs** - the engine behind the conversion table: converts a string **by physical key position** between two installed layouts, with no alphabet table of its own (except the US ⇄ Russian fallback described in feature 2). `VkKeyScanEx` (source layout) gives the VK+modifier state that produces the character; the VK is turned into a **scan code in the source layout** and read back as the **target layout's VK** (`MapVirtualKeyEx` both ways) - the step that makes AZERTY/QWERTZ correct, since French `a` sits on the US `q` key. `ToUnicodeEx` then renders it in the target layout. Two non-obvious rules: a negative `ToUnicodeEx` result means a **dead key latched inside the layout**, so it is flushed with Space (else the user's *next real keystroke* comes out composed), and the original character is kept whenever the result isn't exactly one char (IME/composed text is left alone). `TryConvertChar` answers **false** rather than echoing the character back, which is what lets `Convert` try the **opposite direction for that one character** and fix mixed text in a single press; it is also where `convertSymbols` refuses a key that is punctuation on both sides (feature 2). `Convert` **memoizes per distinct character** for the length of the call (S0009 FP-6): each character costs four P/Invokes and two allocations and text has a few dozen distinct ones, so a million characters convert in milliseconds; the memo is exact because a character's answer never depends on its neighbours (a latched dead key is flushed on the spot), which `TheMemoChangesNothingButTheCost` proves on a random corpus. `ResolveInstalled` is the only way KLIDs become HKLs here: `LoadKeyboardLayout` *adds* an unknown layout to the user's Windows input list, so anything not already installed is unloaded again and the conversion simply does nothing rather than silently reinstalling a layout the user removed. `LayoutSwitcher.SwitchTo` goes through the same resolver. - **LayoutConversionProfile.cs** - one table row (`SourceKlid`, `TargetKlid`, `Hotkey`, `Enabled`, plus an `Id` that survives edits) and, beside it, `WorldLayouts`: the curated ten-language KLID set, `LabelForKlid`, and `CodeForKlid` (curated code, else the language id decoded through the OS - a non-curated layout still reads as e.g. "PL", never as a raw KLID). `LayoutConversionDialog.cs` edits a row and rejects source == target. - **LayoutPublisher.cs** - writes the current layout code to `%LOCALAPPDATA%\CyrFlip\layout.txt` on every change, so the companion VS Code extension can place the marker at the editor caret (the external overlay can't track Monaco's caret reliably). Writes go through **one drain worker** (`LayoutPublisher.Channel`): the producer writes only on change, so two racing thread-pool writes could leave an older value on disk that the next poll would never heal. On a clean exit `Retract()` **deletes both files** - from the context's disposal, exit handlers and `Program.Fatal` (primary instance only - never from `/launcher-run` forwarding processes, which would otherwise delete the live instance's files) - so a missing `layout.txt` means "CyrFlip is not running" (`LAYOUT-SIGNAL` rules 5 and 6). `Folder` (= `DataFolder.Current`) is where the channel lives; a packaged build also keeps the deprecated **mirror** of both files in `%ProgramData%\CyrFlip` (`MirrorFolder`, `LAYOUT-SIGNAL` 1.1 rule 1), written and retracted with them, and `EditorCaretSignal` reads the claim from both. The active layout's KLID goes to **`layout-klid.txt` beside it, not into that file**: the extension reads the first four characters of `layout.txt` as the code, so appending anything there would break every already-installed copy - and the extension ships on its own clock, so old copies are the normal case. A second file is additive: an extension that does not know about it behaves exactly as before, one that does gets the layout's own shade. - **DataFolder.cs / DataFolderMigration.cs** - the one decision of where every per-user file lives (ticket S0016): `%LOCALAPPDATA%\CyrFlip` unpackaged; packaged, the package's own per-user folder `%LOCALAPPDATA%\Packages\\LocalCache\Local\CyrFlip`, built from the **unvirtualized** `%LOCALAPPDATA%` string plus `PackageInfo.FamilyName` and written **explicitly** - it is where MSIX puts the package's own `%LOCALAPPDATA%` writes, so the VS Code extension and a mail client find the files at the same path. `LayoutPublisher`, `DiagnosticLog` (every log and the quick-notes journal), `SupportBundle` and `CaretDiagnostics` all read it. The packaged build used to use the machine-wide `%ProgramData%\CyrFlip`, shared by every account on the PC: the second user's writes failed on the first user's files, B replayed A's journal (every line a DPAPI failure, every append refused) and anyone could read anyone's logs. `DataFolderMigration.RunOnce` (first packaged start, marker `DataFolderMigrated`) moves the **current user's own** journal and `reports\` archives out and deletes their old logs; a file another account owns is never touched, and a journal meeting an existing one is kept as `quick-notes.migrated-.log` and replayed once, the newer `UpdatedAtUtc` winning per note and a note the live journal deleted staying deleted (S0035 QN2-7). Every pass merges each kept journal without a `.merged` marker, so a merge that failed is retried like every other step (QN2-4), and every moved file has its inherited ACEs reset to the new folder's - a same-volume move kept `%ProgramData%`'s "Users: read" (QN2-5). **The live gate is still open**: that the explicit LocalCache path is not redirected a second time was reasoned, not observed - `tools/uitest/Test-PerUserFolder.ps1` is the check, to run on Windows 10 22H2 and 11 with the package installed. - **OllamaManager.cs** - the *process* side of the translator: find `ollama.exe` (the usual install folders, then PATH), is it running, start it (`ollama app.exe`, else a hidden `ollama serve`), download and launch the official installer. `CanInstallInPlace` is `!PackageInfo.IsPackaged`: **a Store build never fetches or runs an installer**, its button opens ollama.com. **The installer is verified before it runs** (ticket S0010 TD-5): a random `%TEMP%\CyrFlip-ollama-\` folder, its length against `Content-Length`, and a valid Authenticode signature whose CN **and** O are `Ollama Inc.` (`AuthenticodeCheck`, `WinVerifyTrust` without an online revocation check); a failure deletes the file and opens ollama.com instead. The verified file is **held open read-only-shared** from before the signature check until the installer process exists (`InstallerDownload.Guard`, S0037 TR-4), its folder is removed once the installer exits and old ones whenever the translator page is shown (TR-5), and the download ends on the settings' **Cancel** button or after 60 s of silence (`CopyAsync`, TR-1 - net48's pending read ignores its token, so both dispose the stream on the pool; a stalled download used to disable every translator button until a restart). TLS goes through **`TlsPolicy.EnsureTls12`**, which adds TLS 1.2 **only when the value is not `SystemDefault`** - a net48 target already starts at `SystemDefault`, and `|= Tls12` there pinned the whole process to 1.2 and switched TLS 1.3 off (TD-4). - **OllamaClient.cs** - the *protocol* side, behind `IOllamaTransport` so every parser above it is unit-tested without a server (`HttpOllamaTransport` is the real one: one shared `HttpClient`, per-request timeouts on a linked token, and a `CancellationTokenRegistration` that disposes the response stream because net48's `ReadLineAsync` takes no token - without it Esc would only be honoured after the model finished its sentence). That dispose is **queued to the pool, never run inline** (S0010 TD-3): `Cancel()` runs the registration on the UI thread, and closing a half-read chunked response on netfx **does** drain the rest of it - measured live on 2026-09-26 (`tools/uitest/Measure-TranslateCancel.ps1`, S0037 TR-7): an inline dispose took 504 ms, past the hooks' 300 ms timeout, while the app's `Cancel()` took 0 ms; the endpoint's `ConnectionLimit` is raised to 4 so a cancelled stream still generating cannot starve the next probe. `NormalizeBase` puts `http://` before an address without a scheme - `127.0.0.1:11434`, Ollama's own `OLLAMA_HOST` shape, used to be parsed as a scheme and reported as an unreachable remote server (TR-2). **The clock after the first line is silence, not a total** (TD-2): `PumpAsync` (the read loop, apart from HTTP so it is testable) re-arms a 30 s idle timer on every line, with a 10-minute ceiling for a runaway model; a deadline that fires after the first chunk makes `GenerateAsync` return the text so far with `LastStoppedEarly`, which becomes `TranslationResult.Partial` - shown with a note and never pasted automatically. `ProbeAsync`/`ListModelsAsync` (`GET /api/tags`), `PullModelAsync` (`POST /api/pull`, NDJSON progress), `GenerateAsync` (`POST /api/generate`, `stream:true`, chunks handed to a plain `Action` on whatever thread the read completed on - **marshalling is the caller's job**, an `IProgress` created down here would capture the wrong context). - **TranslationService.cs** - the feature logic: make sure the server is up (one auto-start attempt, ~8 s), resolve the model (the configured one if installed, else the best installed by `PickPreferredModel`), build the prompt, stream one completion, and judge the answer. The judgement is deliberately small (spec §5.3): an **empty or echoed** answer earns exactly one retry with a firmer prompt, and a bad retry keeps the first answer - a retry that times out included (S0037 TR-3). **An echo is accepted without a retry when the text already is in the target language** (S0010 TD-7, `IsAcceptedEcho`): the source's dominant script is the target's and no letter contradicts it (`ы` is not Ukrainian, `ї` is not Russian); a retry replaces the first answer only when it is not a near-echo (95 % edit similarity) and is written in the target's script. **Only a loopback endpoint is auto-started** (TD-6): a remote one that does not answer is `Unreachable`, named by host; a cancel anywhere in `TranslateAsync` - probe, start, model list - returns `Cancelled`, not a logged failure. `MaxChars = 4000`; longer selections are cut and the window says so. `TranslationSink` is two callbacks (chunk / reset) rather than an `IProgress`, because a retry has to clear what the first attempt already painted. - **TranslationProfile.cs** - one table row (`TargetLang`, `Hotkey`, `Enabled`, an `Id` that survives edits) and, beside it, `TranslationLanguages`: the two live tokens (`ui`, `active`), `Resolve` (token → concrete code at press time), `EnglishName` (what goes into the prompt - a curated table, else the OS name, and never Windows' literal "Unknown Language") and `Label` (the endonym the UI shows). **`AllCodes` is every language Windows knows**, and the pickers offer all of it. It used to be `Localization.Codes` - the 13 *interface* languages - which fused two unrelated sets: measured on a live Ollama, that list was wrong in both directions, offering languages the default model garbles (Ukrainian, Hindi, Bengali, Urdu on `qwen2.5:3b`) and hiding Japanese, which it does perfectly. **CyrFlip claims nothing about coverage and blocks nothing:** there is no source to claim from (the GGUF `general.languages` key is null or absent on every model checked, and a model page sometimes gives a count with no list), and coverage belongs to the model, not to us - we dispatch, it translates. `ModelPageUrl` builds the link the UI offers instead (`qwen2.5:3b` → `ollama.com/library/qwen2.5`; a name with `/` came from outside the library, so it goes to the index). The browser makes that request, not the app - CyrFlip still opens no socket of its own. - **TranslationResultWindow.cs** - the popup beside the mouse pointer: a `SizableToolWindow` (native close button and resize grip, no taskbar/Alt+Tab entry) with `ShowWithoutActivation` so it never steals focus, built from real controls in a `TableLayoutPanel` so `DialogLayoutTests` can prove nothing is clipped in 13 languages. A window that never activates never gets `Deactivate`, so "close when the user moves on" is a 400 ms poll of the foreground window, armed only **after** the answer is in - closing it mid-translation would throw away what the user is waiting for. - **TranslationDialog.cs** - the row editor (language + chord), same auto-sizing `TableLayoutPanel` shape as `LayoutConversionDialog`. - **Exchange*.cs / ExchangeClipboardIo.cs / ExchangeShortcuts.cs / ExchangePortalLinks.cs** - the exchange server clipboard (feature 16), one concern each. `ExchangeWire` is the pure framing and the envelopes; `ExchangeTrust` the pin rule and the two fingerprints; `ExchangeConnection` + `TlsExchangeTransport` the TLS stream with a watchdog; `ExchangeClient` the operations (`ProbeAsync`, `EnrollAsync`, `OpenAsync`, `ListAsync`, `InfoAsync`, `PutSealedAsync`, `GetAsync`, `RevokeAsync`) returning an `ExchangeOutcome` with a code, never throwing for the network; `ExchangeEnrollment` the join (identity, key, `id-collision` retry); `ExchangeAccountEntry` + `ExchangeSecrets` the entry (no secret in its JSON); `ExchangeRecipients` the trust-on-first-use rule; `ExchangeClipboardService` the send and the fetch across entries; `ExchangeMessages` / `ExchangeCodes` the contract's messages; `ExchangeClipboardSource` / `Sink` the two clipboard sides; `ExchangeE2e*` / `ExchangeHpke` / `ExchangeDeviceKey` the crypto (CNG + bcrypt P/Invoke, no dependency). `FakeExchangeServer` (tests) is an in-memory server that stores only sealed bytes.- **Launcher (absorbed OneClickRunner), one concern per file:** - **LauncherScenario.cs** - the model. `[XmlRoot("AppItem")]` + identical field names = the OneClickRunner XML contract; `Hotkey` is the one CyrFlip extension; **public** only because net48 `XmlSerializer` refuses internal types. `SPECIAL_YTDLP` legacy sentinel → `IsYtDlp`. - **LauncherScenarioStore.cs** - file-per-scenario store (`%APPDATA%\CyrFlip\Scenarios`, folder created lazily on first write). Corrupt file → skipped + counted in `LoadErrors`, never fatal. A listing failure is counted and keeps the live list. Add/update/move return save failures; unsaved add/edit results never replace the stored list. Control characters and CR/LF round-trip through XML entities (S0063). Contiguous `Order` normalization à la OneClickRunner (name breaks legacy all-zero ties); temp-file-then-`File.Replace` saves, the temp name unique per writer (`{name}.{pid}.{random}.tmp`; a leftover is never read and is deleted after a day - S0008 LS-9); a file with no `` or a duplicate one gets a fresh Guid saved at once (`LauncherScenario.IdWasAssigned`, LS-10); `Import` always fresh Guid; `SeedSample` only into an empty store (caller guards with the one-time marker). `Remove` drops a scenario only once its file is gone and returns the reason otherwise - the settings page says it (S0034 LS2-6); `readOnly: true` never writes (the log bundle's count, LS2-9). Every OneClickRunner import - first enable, tray, settings button - clears an imported chord something else already owns (`LauncherMigration.StripClashingHotkey`, LS2-8). - **LauncherMigration.cs** - read-only import from `%APPDATA%\OneClickRunner\Scenarios`: Guid preserved unless colliding (then fresh + counted), unreadable files listed by name, source **never** written. - **LauncherExecution.cs** - the single launch path (port of `ScenarioLauncher`): `TryResolveTarget` (file / http(s) / workdir-relative / PATH+PATHEXT, relative PATH entries skipped) returns the **absolute** path it validated, and that path is what is started or elevated (S0008 LS-6); `runas` iff `RunAsAdmin`; UAC decline (Win32 error 1223) = cancel, not failure; interpreters (`cmd.exe`, Windows PowerShell) are started by their System32 path, never a bare name (S0034 LS2-7); yt-dlp = `cmd /s /k` console (cmd by its System32 path, started in the user profile) starting yt-dlp by its resolved full path (`NoDefaultCurrentDirectoryInExePath=1`), with `--` before the link and the link **only in `CYRFLIP_YTDLP_LINK`** (an absolute http(s) URL, quote/control chars rejected); **no config is read from the download folder** (S0034 LS2-2): yt-dlp loads a "home" `yt-dlp.conf` from its `-P` folder or, without `-P`, its current directory - Downloads by default, where a web page can drop one saying `--exec` - so the command says `--ignore-config` and names the user's own configs (the portable one beside the exe, the first user config in yt-dlp's own search order, never one inside the download folder) with `--config-locations`; the folder is `-P` through `CYRFLIP_YTDLP_FOLDER` (a UNC folder cannot be cmd's current directory), so a user config's own `-P` no longer overrides the scenario's folder; `YtDlpFormat` is passed only when every space-separated token matches `[A-Za-z0-9+/\[\]<>=*._,-]` (≤ 200 chars), each token quoted - otherwise kept but not passed, and the scenario dialog says why (S0008 LS-4). Error strings are Russian-source keys passed through a `translate` seam. - **LauncherScriptInterpreter.cs** - `.ps1` → pwsh (probed) else Windows PowerShell, `-NoProfile -ExecutionPolicy Bypass -File` last; `.bat`/`.cmd` → `cmd /s /c ""script" args"` (the one quoting that survives spaced paths AND quoted args). Do not "simplify" the quoting. - **LauncherIconResolver.cs** - exe/own icon, scripts borrow the interpreter's, fallback = CyrFlip's own icon (never a blank Jump List task, never OneClickRunner branding); + `LauncherIconCache` (display-only, extraction failure never blocks a launch). **Never on the UI thread** (ticket S0030 HT-1): a scenario on `\\nas\..` or a PATH entry on a dead server stalled the hooks' thread for the SMB timeout at startup and on every settings click. A remote path (`LaunchTargets.IsRemotePath`, the selection launch's own classifier) is not probed at all and takes the fallback icon; the Jump List's tasks are built on the pool and applied back on the UI thread (a generation counter drops a stale build); the settings table gets its icons from `LauncherIconCache.Get`, which resolves on the pool and hands the icon back through the caller's sync context; the probes are a `LauncherPathProbes` argument so the tests count them. The table is rebuilt from `ApplyLanguage` only when the language, the store's `Version` or the launcher switch changed. Launching goes through `LauncherExecution.LaunchAsync` (the yt-dlp prompt on the caller's thread, everything else on the pool); the synchronous `Launch` is left to the one-shot process, which has no hook. - **LauncherIpc.cs** - named pipe `CyrFlip_Launcher_{userSid}_{sessionId}` (ticket S0008 LS-2: a pipe name is machine-global while the mutex is per session, so with fast user switching the second user used to fail forever). Strict `ParseCommand` - on the command line **and** on every line read from the pipe: only `/launcher-run:{guid}` (guid validated + normalized), `/launcher-settings`, `/exit`, at most 256 characters. One server instance for the process lifetime (`Disconnect` between clients), a DACL admitting the current user only and never the network, a 2 s read timeout, exponential backoff to 30 s logged once per hundred failures. `TrySend` connects at Identification level and refuses a server outside its own session/user (`GetNamedPipeServerProcessId`). The listener always runs, but while `EnableScenarioLauncher=0` it passes on **only `/exit`** - the build scripts stop the tray with it (`SetLauncherCommandsEnabled`, driven by `RefreshLauncherSurfaces`). Marshalling to the UI thread is the subscriber's job (`CyrFlipContext` posts via `_ui`). - **LauncherJumpList.cs** - hand-rolled COM `ICustomDestinationList` + `IObjectCollection` + `IShellLinkW` + `IPropertyStore` (PKEY_Title via a minimal PROPVARIANT). Vtable order is load-bearing (same gotcha class as `UiaCaretCom`). `BuildTasks` is pure (unit-tested); `Apply`/`Clear` guarded → shell refusal degrades to "no jump list". - **LauncherTrayMenu.cs** - builds the tray submenu **and** the taskbar button's left-click menu (scenarios → separator → Manage → optional Import) from one `Fill`, so the two lists can never drift apart. It is its own file for one load-bearing reason: `ToolStripItem.Dispose` **removes the item from its owner's collection**, so disposing while enumerating `DropDownItems` throws *"Collection was modified"* - verified on net48, and invisible until the *second* rebuild (the first starts from an empty menu). Copy out → clear → dispose, exactly as the settings window does in every `Reload*Rows`. Being a static seam it is covered directly by `LauncherTrayMenuTests`. - **LauncherScenarioDialog.cs / YtDlpLinkDialog.cs** - content-sized modal dialogs (no pixel geometry). The scenario dialog swaps the type-specific section **out of the control tree** (not `Visible=false`) so `DialogLayoutTests` measures only what is laid out. - **LauncherTaskbarWindow.cs** - the taskbar button: a 1x1, `Opacity=0`, permanently **minimized** form (`ShowInTaskbar`) that exists only while the launcher is on. It rests minimized on purpose - a taskbar click on the *active* window minimizes it, so a window that stayed restored would answer only every second click; the restore raises `WM_SIZE`/`SIZE_RESTORED` (the one notification every shell path ends in - `SC_RESTORE` is not always sent), the menu is shown there and the window minimizes again on close, which also hands focus straight back to the user's editor. The `SIZE_RESTORED` of window creation is ignored (only a restore *out of* the minimized resting state counts). A shell "Close window" is cancelled - the launcher switch owns its lifetime, exactly as the tray icon's. - **LauncherBrand.cs** - OneClickRunner's `app.ico`, embedded (`EmbeddedResource` + `LogicalName=CyrFlip.launcher.ico`, so the single exe still ships alone) and handed out cached/shared - callers must not dispose it. Marks the *feature* (settings page header, taskbar button), never the app - and not its tab in the strip: a logo on a tab stands for a meaning (`ICON-SET` rule 7), so the tab draws the vocabulary's `feature.quick-launch`. - **LauncherLog.cs** - `launcher.log` in the same MSIX-aware folder as `layout.txt`; never logs the yt-dlp link. Like `TranslateLog` and `TextMenuLog` it is a one-line wrapper over **`DiagnosticLog`**, which owns the folder, the **rotation** and - since ticket S0030 HT-4 - **the write itself**: `Append` only queues the line and returns, and one background writer drains the queue in order, one open per file per batch (most callers are on the hooks' thread, and a synchronous open/append/close behind one process-wide lock let another log's rotation or an antivirus scan stall the next context-menu line). `DiagnosticLog.Flush(timeout)` is called by `SupportBundle.CreateDefault` before it reads the logs, by the session end, by `CyrFlipContext.Dispose` and by `Program` on its way out. On a file's first write of the session and again every 1000 lines, a file over 2 MB is cut to its last 512 KB, starting on a line boundary and behind a marker line saying how much was dropped - "once per session" alone was no cap for an autostarted tray session that lasts weeks. Without it these three files grew forever (`context-menu.log` writes a line per menu opening *and* per click). The rewrite is **in place, not via a temp file that replaces it** - replacing means deleting, and a file another process holds open cannot be deleted, which is exactly the case that matters since `SupportBundle` reads these logs to build its archive. - Integration: `CyrFlipContext.RefreshLauncherSurfaces()` rebuilds tray submenu + Jump List + hook snapshot on every change (enable/disable, CRUD, language change); `KeyboardHook.UpdateLauncherHotkeys` mirrors the conversion-table snapshot discipline; the chord conflict check covers every owner through `ChordRegistry`. ## Companion VS Code extension (`vscode-extension/`) A small TypeScript extension (no native code). The app publishes the layout to a file; the extension reads it and renders the layout marker **exactly at Monaco's caret** via an `after` decoration whose CSS is absolutely-positioned (so it doesn't shift text) and outlined. This is the precise in-editor answer to the UIA-can't-find-the-caret problem in VS Code/Electron. Build with `npm install && npm run compile` (or `npx @vscode/vsce package`). Requires the CyrFlip app to be running. **Its palette is not its own** (see `LayoutStyle.cs`): `src/layout-colors.json` is the shared copy - `curated` (13 languages), `layouts` (25 KLIDs) and `other` - imported with `resolveJsonModule` so tsc emits it into `out/` and vsce packages it. The file has to live inside the extension root - vsce packages nothing from a parent directory, so a shared file under `assets/` would simply be missing from the published `.vsix`. The extension has **no test runner**; what keeps it honest is that `colorFor(code, klid)` is now a pair of table lookups with no algorithm to reimplement, and `LayoutColorsTests` compares both tables entry for entry in both directions. It reads the active layout from `layout-klid.txt` beside `layout.txt`; **when that file is absent (an older CyrFlip) it falls back to the language colour**, so an extension newer than the app still works. It writes one file of its own - `editor-caret.txt`, the "I am drawing the marker here" claim the app honours through `EditorCaretSignal` - refreshed at most every 500 ms while the window is focused, an editor is active and there has been editor activity within 5 s, and deleted when the window loses focus or the extension shuts down. Activity is the user's own: a selection change with a `kind` or an edit of the active document - **not** an editor becoming active, which an agent or a command does by itself while the user types in the chat (S0036 UI-5). End-to-end flow: hotkey (KeyboardHook, UI thread) → `OnLayoutConversionHotkeyPressed(id)`/`OnCaseHotkeyPressed` → `RunClipboardOp` spins a background thread → `ClipboardHandler.ConvertLayout` (copy → KeyboardLayoutConverter, or TransliterationEngine for an unresolvable US⇄RU pair → paste) or `ClipboardHandler.FlipCase` (copy → CaseFlipEngine → paste). CursorIndicator updates the tray icon independently on its timer. ## Critical detail: the transliteration table Now a **fallback**, not the main path: the conversion table asks Windows for both layouts' mappings, and this hand-written table is used only for the US ⇄ Russian row when those layouts can't be resolved (the Russian keyboard was never installed). It is still the exact behaviour every pre-table release shipped, so it stays correct. Bidirectional, based on the standard ЙЦУКЕН layout. The mapping used in `TransliterationEngine` (26↔26, aligned): ``` QWERTY: q w e r t y u i o p a s d f g h j k l z x c v b n m ЙЦУКЕН: й ц у к е н г ш щ з ф ы в а п р о л д я ч с м и т ь ``` ⚠️ **Spec discrepancy (§5.1):** the spec lists **28** Cyrillic letters for these **26** keys - it includes `ж` and `э`, which on ЙЦУКЕН are the `;` and `'` keys, *not* letter keys. Pasting the spec's two rows together mis-aligns everything from `z` onward (you'd wrongly get `z→ж`). The engine drops `ж`/`э` to keep the rows aligned (`z→я .. m→ь`) and has a static-ctor length assertion guarding against future drift. The punctuation row (`[ ] ; ' , . / \`` ⇄ `х ъ ж э б ю . ё`) and the shifted symbols (`{ } : " < > ? ~ @ # $ ^ & |`) **are** mapped - the table is 34 key positions, not 26 letters - which is why the two rows above are only the letter half of it. Map case-insensitively but preserve case; pass through characters with no mapping (punctuation/digits) unchanged. ## Error-handling rules (from spec) - No selection → no-op (skip silently). - Clipboard locked → retry up to **12 attempts, 15 ms apart** (`Win32Clipboard.cs:444`). - Foreground window changes mid-operation → **cancel** the operation. - Clipboard that holds something but cannot be backed up → **refuse** the operation before a key is sent (the "clipboard had other plans" balloon), never overwrite it (S0009 FP-5). ## Config Settings are stored in the Windows Registry under `HKCU\Software\CyrFlip`. All values have defaults and are written on first change. On first run with no registry key, the app migrates from a legacy `config.json` if one is present. | Registry value | Type | Default | Description | | --- | --- | --- | --- | | `CaseHotkey` | `REG_SZ` | `Ctrl+Shift+F11` | Case-flip hotkey (user-configurable on the "Исправление текста" tab, group "Регистр") | | `UiLanguage` | `REG_SZ` | Windows UI language, else `English` | Interface language endonym | | `ClipboardHistoryHotkey` | `REG_SZ` | `Ctrl+Shift+F10` | Opens clipboard history | | `EnableClipboardHistory` | `REG_DWORD` | `0` | Enables local clipboard history | | `ClipboardHistoryNoticeShown` | `REG_DWORD` | `0` | One-time marker: the "records everything you copy, local only, never trimmed" notice was shown on the first enable (S0067) | | `PauseClipboardHistory` | `REG_DWORD` | `0` | Temporarily stops recording clipboard changes | | `ShowClipboardHistoryOnStartup` | `REG_DWORD` | `1` | Opens the history window at startup when history is enabled | | `ClipboardHistoryX` / `ClipboardHistoryY` | `REG_DWORD` | `MinValue` / `MinValue` | Last history window position | | `ClipboardHistoryWidth` / `ClipboardHistoryHeight` | `REG_DWORD` | `260` / `360` | Last history window width and height | | `ClipboardHistoryOpacity` | `REG_DWORD` | `100` | History window opacity in percent (78..100; the floor is `ThemePalette.TranslucentWindowMinOpacity`, below which its text loses 4.5:1 over a bright or dark desktop - a stored lower value is raised to it on load and written back, S0093) | | `SettingsTab` | `REG_DWORD` | `0` | Index of the settings tab last left open; the window reopens on it (clamped against the live page count) | | `SettingsPageId` | `REG_SZ` | *(empty)* | Stable key (`SettingsPageKey` name) of the page last left open; it wins over `SettingsTab` when it still names a page, so the tab strip growing between versions no longer moves the remembered page | | `SettingsGroupsState` | `REG_SZ` | *(empty)* | Expansion of the settings window's collapsible groups, as `id=0\|1` pairs joined by `;` under the groups' stable internal ids (WINDOWS-UI section 3); sanitized on read - malformed rows dropped, 64 rows max | | `SettingsViewport` | `REG_SZ` | *(empty)* | Where each settings page was scrolled to, as `page\|anchor\|offset` rows (`;`-joined): a group id or stable row ordinal plus the offset from it in logical (96-DPI) px; sanitized on read | | `SettingsWindowX` / `SettingsWindowY` | `REG_DWORD` | `int.MinValue` | The settings window's last position; `int.MinValue` = never placed (then it opens centred). Written on hide/close only, restored clamped to a work area | | `SettingsWindowWidth` / `SettingsWindowHeight` | `REG_DWORD` | `0` | The settings window's last normal-state size; `0` = never user-sized. A maximized close never overwrites these | | `CursorSize` | `REG_DWORD` | `24` | Base size of the I-beam cursor and caret overlay marker (px at 100%); the "Размер метки" slider on the "Индикаторы" tab writes 18 / 24 / 32. The badge is scaled by its monitor's DPI, the I-beam by the primary monitor's DPI and the Windows pointer size (`CursorBaseSize`) - `MarkerSize`, S0011 LI-3 | | `EnableCursorChange` | `REG_DWORD` | `0` | 1 = replace the system I-beam with the layout-branded cursor | | `CursorNoticeShown` | `REG_DWORD` | `0` | One-time marker: the "replaces the I-beam in every program" notice was shown on the first enable (S0067) | | `EnableCaretOverlay` | `REG_DWORD` | `1` | 1 = show the layout marker next to the blinking text caret | | `CaretDotMode` | `REG_DWORD` | `0` | 1 = use a solid colour dot instead of EN/RU/UK text in the overlay | | `EnableLanguageSwitch` | `REG_DWORD` | `0` | 1 = after a conversion, also switch the target window to the layout the text now reads in | | `FlipCapsLockAfter` | `REG_DWORD` | `0` | 1 = after a case flip, also set the physical CapsLock key to match the corrected text (on when it ends in a capital, off when it ends in a small letter, untouched when it has no cased letter) | | `ConvertSymbols` | `REG_DWORD` | `1` | 1 = a conversion also swaps a key that is **punctuation in both layouts** (`/` against `.`, `@` against `"`) - what every release before this switch did. 0 = such a key is left alone, so `/ghbdtn` becomes `/привет` rather than `.привет`. A key whose other side is a **letter** (`,`→`б`, `[`→`х`) is never ambiguous and is converted either way | | `KeepSystemAwake` | `REG_DWORD` | `0` | 1 = hold `ES_SYSTEM_REQUIRED` (Windows won't sleep on idle); restored at startup | | `KeepScreenOn` | `REG_DWORD` | `0` | 1 = hold `ES_DISPLAY_REQUIRED` (screen won't blank/lock on idle); restored at startup | | `EnableHotkeys` | `REG_DWORD` | `1` | Master switch; 0 = the hook passes every key through (no hotkey acts) | | `EnableCaseHotkey` | `REG_DWORD` | `1` | 1 = the case-flip chord is active (only while `EnableHotkeys`=1) | | `EnableHistoryHotkey` | `REG_DWORD` | `1` | 1 = the clipboard-history chord is active | | `DeferToRemoteDesktop` | `REG_DWORD` | `0` | 1 = while an RDP client (mstsc/msrdc) is focused, let the chord pass to the remote session | | `EnableContextMenu` | `REG_DWORD` | `0` | 1 = CyrFlip's own menu over the selection is on (the `WH_MOUSE_LL` hook is installed). 0 = no mouse hook at all | | `ContextMenuChord` | `REG_SZ` | `Ctrl+RightClick` | The chord that opens it, as an invariant token; an unparsable value (incl. a bare `RightClick`) falls back to the default | | `TextMenuHotkey` | `REG_SZ` | `Ctrl+Shift+Alt+M` | The keyboard's way to the same menu (S0045 K2, `INPUT-PARITY` rule 1): opens it at the caret (the system caret, else the caret overlay's last sighting in that window, else the pointer), taking the foreground while it is open and handing it back on close. Checked against every other chord owner; an update that finds the chord already taken switches it off instead | | `EnableTextMenuHotkey` | `REG_DWORD` | `1` | 1 = that chord is bound (only while `EnableContextMenu`=1) | | `Theme` | `REG_SZ` | `system` | The app theme as an invariant token: `system` (follow Windows' `AppsUseLightTheme`, live), `light`, `dark`. Anything else reads as `system`. Windows' high contrast wins over every value | | `UiInputProfile` | `REG_SZ` | `pointer` | The input profile every window opens with (S0076): `pointer` or `touch`, chosen on the General page, never inferred from the device; unknown reads as `pointer`. Per-PC, not in the settings file | | `UiInterfaceScale` | `REG_DWORD` | `100` | Interface scale in per cent: 75, 100, 125, 150 or 200 (typography, glyphs, checkboxes, spacing and targets together); any other value reads as 100. Per-PC, not in the settings file | | `UiTextScale` | `REG_DWORD` | `100` | Text enlargement in per cent on top of the interface scale: 100, 125, 150 or 200; any other value reads as 100. Per-PC, not in the settings file | | `LanguageHotkeysBackup` | `REG_SZ` | *(empty)* | One-time JSON snapshot of Windows' own language hotkeys, taken before CyrFlip first edits them; empty = never touched | | `InputLayoutsBackup` | `REG_SZ` | *(empty)* | One-time JSON snapshot of the keyboard-layout stores (Preload/Substitutes + User Profile), taken before CyrFlip first edits them | | `InputMethodOverrideWritten` | `REG_SZ` | *(empty)* | The `InputMethodOverride` CyrFlip last wrote through "По умолчанию"; restoring a format-1 layout backup (which never captured that value) removes it only while it still equals this (S0007 WL-13) | | `LayoutConversionProfiles` | `REG_SZ` | *(seeded)* | JSON array of the layout→layout conversion table (source KLID, target KLID, chord, enabled). Absent (or empty while the legacy `Hotkey`/`EnableFlipHotkey` values survive) = seed one EN⇄RU row on Ctrl+Shift+F12; `[]` after the migration = the user emptied it, left alone | | `EnableScenarioLauncher` | `REG_DWORD` | `0` | 1 = the scenario launcher is on (tray submenu + taskbar button with its Jump List and left-click menu + per-scenario hotkeys). 0 = every surface cleared, button closed; scenario XMLs stay on disk | | `LauncherFirstEnableDone` | `REG_DWORD` | `0` | One-time marker: the first enable's migration offer / Calculator seeding ran; an emptied list is never re-nagged or reseeded | | `DataFolderMigrated` | `REG_DWORD` | `0` | One-time marker (packaged builds only): the move out of the machine-wide `%ProgramData%\CyrFlip` into the per-user package folder finished with nothing left to retry (S0016) | | `WelcomeShown` | `REG_DWORD` | `0` on a new profile; read as `1` for an existing key | One-time marker: the first-run tour was shown; an update never shows it. Explicit `0` requests replay. | | `ShortcutsCreated` | `REG_DWORD` | `0` | One-time marker (unpackaged builds only): the first run from a stable folder created the Start menu and desktop shortcuts (`AppShortcuts`, S0041); a shortcut the user deletes is never recreated by a start | | `EnableTranslate` | `REG_DWORD` | `0` | 1 = the translator is on (chords bound, tray entry visible). 0 = no chord, no tray entry, no socket | | `TranslateSeeded` | `REG_DWORD` | `0` | One-time marker: the starter row was offered on the first enable; a table the user empties is never refilled | | `TranslateProfiles` | `REG_SZ` | *(empty)* | JSON array of the translation table (target language or the `ui`/`active` token, chord, enabled) | | `TranslateEndpoint` | `REG_SZ` | *(empty)* | Ollama address; empty = `http://localhost:11434`. Another address means the selection is sent to that machine | | `TranslateModel` | `REG_SZ` | `aya-expanse:8b` | Model name; empty = use whichever model is installed. **Chosen by measurement (2026-07-28), not by size:** every model under 4 GB failed English ⇄ Russian ⇄ Ukrainian - `qwen2.5:3b` (the old default) even emitted Chinese characters inside a Russian translation | | `TranslateTimeoutSeconds` | `REG_DWORD` | `120` | Budget for the first token; then the 30 s idle timer and the 10-min ceiling | | `TranslateKeepAliveMinutes` | `REG_DWORD` | `-1` | Ollama's `keep_alive` (-1..120 minutes); -1 = keep loaded (default), 0 = unload at once; the RAM is the Ollama process's, not CyrFlip's | | `TranslateAutoStartServer` | `REG_DWORD` | `1` | 1 = try to start Ollama once (waiting ~8 s) when it doesn't answer | | `TranslateCopyResult` | `REG_DWORD` | `0` | 1 = put the translation on the clipboard, where the history records it like any other copy | | `TranslatePasteResult` | `REG_DWORD` | `0` | 1 = paste the translation over the selection (skipped, with a note, if the focus moved) | | `TranslateShowSource` | `REG_DWORD` | `0` | 1 = show the source text above the translation | | `TranslateWindowTimeout` | `REG_DWORD` | `0` | Auto-close the result window after N seconds; 0 = never | | `TranslateWindowWidth` / `TranslateWindowHeight` | `REG_DWORD` | `700` / `460` | Remembered size of the result window (its position is always at the cursor). A stored `460`/`260` - the first build's default, i.e. "never resized" - is replaced by today's, and any size is clamped to the monitor the pointer is on | | `TranslateWindowOpacity` | `REG_DWORD` | `100` | Opacity of the result window, 78..100 (the same floor and load-time raise as the history window, S0093) | | `EnableQuickNotes` | `REG_DWORD` | `0` | 1 = the quick notes are on. 0 = the journal is never read or created, no tray entry, no chord | | `QuickNotesNoticeShown` | `REG_DWORD` | `0` | One-time marker: the "local, DPAPI, not a secret store" notice was shown on the first enable | | `QuickNotesHotkey` | `REG_SZ` | `Ctrl+Shift+Alt+N` | Opens a new note with the caret in the body; checked against every other chord owner (`ChordRegistry`). The default was `Ctrl+Alt+N` until S0004 - Ctrl+Alt is AltGr, and AltGr+N is "ń" on Polish; a stored `Ctrl+Alt+N` is kept, since the hook no longer reads AltGr as Ctrl+Alt | | `EnableQuickNotesHotkey` | `REG_DWORD` | `1` | 1 = that chord is bound (only while `EnableQuickNotes`=1) | | `QuickNotesWordWrap` | `REG_DWORD` | `0` | 1 = the editor wraps long lines. Off by default: the body is more often code than prose | | `QuickNotesLineNumbers` | `REG_DWORD` | `0` | 1 = show line numbers gutter along the left edge of the editor (S0078). Off by default | | `ExchangeNotesWarningOff` | `REG_DWORD` | `0` | 1 = a **notes-only** export to the exchange file no longer shows the "plain unencrypted text" warning. An export that carries clipboard history always shows it (S0023) | | `SettingsBackupEnabled` | `REG_DWORD` | `1` | 1 = the rolling settings backup in `%USERPROFILE%\Documents\CyrFlip\Backups` is written (S0072): debounced after settings changes, keep-last-3, the writer silent while the restore question is open. Exported in the settings file v2 | | `BackupOfferOpen` | `REG_DWORD` | `0` | Marker: the "restore the backup found in Documents?" question is unanswered - it re-asks next start, and the backup writer stays silent while it is set (S0072). Machine history: never in the settings file | | `BackupRestoreDeclined` | `REG_SZ` | *(empty)* | The stamp of the backup the user answered "No - start fresh" to; the question never re-asks on that profile (S0072). Machine history | | `QuickNotesX` / `QuickNotesY` / `QuickNotesWidth` / `QuickNotesHeight` | `REG_DWORD` | `MinValue` / `MinValue` / `0` / `0` | Window geometry, saved at the end of a move or resize (ResizeEnd) and on hide (APP-BEHAVIOUR rule 10). A position no live monitor covers is clamped to the nearest surviving monitor (`ScreenPlacement.Clamp`); a size of `0` (never resized by the user) opens the window at its **measured minimum** - `QuickNotesWindow.ApplyMinimumSize` adds up the real width of the button row, the top row and the privacy hint in the current language at the current display scaling, so the floor is never the pair of constants that used to clip the buttons in most of the 13 languages. A stored size is only ever **grown** to that minimum, never shrunk | | `QuickNotesSelected` | `REG_SZ` | *(empty)* | The note the window was last left on, so it reopens where the user was | | `FlipCount` | `REG_DWORD` | `0` | Usage counter; incremented on each successful transliteration | | `CaseFlipCount` | `REG_DWORD` | `0` | Usage counter; incremented on each successful case flip | | `TranslateCount` | `REG_DWORD` | `0` | Usage counter; incremented on each successful translation | | `QuickNoteCount` | `REG_DWORD` | `0` | Usage counter; incremented when a note is created for the first time | | `ScreenshotHotkey` | `REG_SZ` | `Ctrl+F12` | Starts the screen region capture (re-keyed by S0071 from the dead Ctrl+PrintScreen; the one-time migration moves stored old defaults); checked against every other chord owner (`ChordRegistry`) | | `EnableScreenshotHotkey` | `REG_DWORD` | `1` | 1 = that chord is bound. The only switch the region capture has: no module switch, the tray item is always there | | `ScreenshotFullHotkey` | `REG_SZ` | `Ctrl+F11` | The instant all-displays capture (S0071): one freeze of the virtual screen, no selection; checked against every other chord owner | | `EnableScreenshotFullHotkey` | `REG_DWORD` | `1` | 1 = the full capture's chord is bound (its own switch only, no module switch) | | `EnableScreenshotAnnotate` | `REG_DWORD` | `1` | 1 = the draw-on-capture module is on (S0071, default on); 0 = neither annotate chord is bound and no editor can appear | | `ScreenshotAnnotateAreaHotkey` | `REG_SZ` | `Ctrl+Alt+F12` | Area capture that opens the annotation editor (S0071); bound only while `EnableScreenshotAnnotate`=1 | | `EnableScreenshotAnnotateAreaHotkey` | `REG_DWORD` | `1` | 1 = that chord is bound (only while `EnableScreenshotAnnotate`=1) | | `ScreenshotFullAnnotateHotkey` | `REG_SZ` | `Ctrl+Alt+F11` | Full capture that opens the annotation editor (S0071); same double gate | | `EnableScreenshotFullAnnotateHotkey` | `REG_DWORD` | `1` | 1 = that chord is bound (only while `EnableScreenshotAnnotate`=1) | | `ScreenshotFolderHotkey` | `REG_SZ` | `Ctrl+F10` | Opens the folder the captures are saved into (S0057, re-keyed by S0071 from the dead Ctrl+Shift+PrintScreen); checked against every other chord owner (`ChordRegistry`) | | `EnableScreenshotFolderHotkey` | `REG_DWORD` | `1` | 1 = that chord is bound (only while `ScreenshotSaveEnabled`=1; the probe and the open are `ScreenshotFolderOpener`'s, never on the hooks' thread) | | `ScreenshotSaveEnabled` | `REG_DWORD` | `1` | 1 = every capture is also saved as a PNG (the cropped region, the clipboard's bytes) into `ScreenshotFolder`. On by default since S0071 - fresh profiles save from the first capture; existing profiles keep their stored value, and the privacy wording on the page was corrected in the same change | | `ScreenshotKeyMigrationDone` | `REG_DWORD` | `0` | The one-time S0071 chord re-key marker (machine history, never exported): present = the stored Ctrl+PrintScreen / Ctrl+Shift+PrintScreen defaults were moved once | | `ScreenshotFolder` | `REG_SZ` | *(empty)* | Where saved captures go; empty = the `FOLDERID_Screenshots` known folder, resolved at save time (`CAPTURE-OUTPUT` rule 9) | | `ScreenshotCount` | `REG_DWORD` | `0` | Usage counter; incremented on each capture that reached the clipboard | | `EnableSymbols` | `REG_DWORD` | `0` | 1 = the module is on; 0 = no surface opens it, no chord bound, no window created | | `SymbolsHotkey` | `REG_SZ` | `Ctrl+Shift+F9` | Shows / hides the palette; checked against every other chord owner (`ChordRegistry`) | | `EnableSymbolsHotkey` | `REG_DWORD` | `1` | 1 = that chord is bound (only while `EnableSymbols`=1) | | `SymbolsCategory` | `REG_SZ` | `all` | The group the palette last showed: `all`, or a group key (`punctuation`, `currency`, `math`, `arrows`, `greek`, `latin`, `cyrillic`, `combining`, `symbols`, `numbers`, `invisible`, `box`); an unknown key reads as `all` | | `SymbolsCloseOnPick` | `REG_DWORD` | `0` | 1 = a pick copies the character alone and closes the window; 0 = a pick appends it to the window's text field and copies the whole field | | `SymbolsHideTypable` | `REG_DWORD` | `0` | 1 = hide the characters a single key combination of an installed layout already types | | `SymbolsX` / `SymbolsY` / `SymbolsWidth` / `SymbolsHeight` | `REG_DWORD` | `MinValue` / `MinValue` / `0` / `0` | Window geometry, saved at the end of a gesture and on hide; a position no live monitor covers is clamped, a size only ever grown to the measured minimum | | `SymbolsCount` | `REG_DWORD` | `0` | Usage counter; incremented on each successful copy | | `EnableTrafficLight` | `REG_DWORD` | `0` | 1 = the traffic light module is on; 0 = no timer, no chord, no tray item, no window, no network or power event subscription (S0069). The block is written only once the module has been on | | `TrafficLightHotkey` | `REG_SZ` | `Ctrl+Shift+Alt+T` | Shows and focuses the board, and hides it from itself; checked against every other chord owner | | `EnableTrafficLightHotkey` | `REG_DWORD` | `1` | 1 = that chord is bound (only while `EnableTrafficLight`=1) | | `TrafficLightTargets` | `REG_SZ` | *(empty)* | JSON array of the targets (label, kind, address, optional fingerprint, group, ordinal, switch, interval, timeout, thresholds, failures before down, accepted HTTP codes, untrusted-certificate option, balloon, journal). `[]` after the user emptied it; an unreadable value is never saved over until the user edits it | | `TrafficLightShowAtStart` | `REG_DWORD` | `1` | 1 = the board opens by itself (without taking the focus) at every start while `EnableTrafficLight`=1; 0 = it reopens only if it was left visible (`TrafficLightVisible`). The rule is `TrafficLightLaunch.ShowBoard` | | `TrafficLightVisible` | `REG_DWORD` | `0` | The board was left visible. With `TrafficLightShowAtStart`=1 it opens at every start anyway; with 0 this value alone decides whether it reopens (without taking the focus) | | `TrafficLightPinned` | `REG_DWORD` | `1` | 1 = the board stays on top of other windows | | `TrafficLightTileSize` | `REG_DWORD` | `1` | 0 small (a bare square: no label, no mark on "available", the glyph of any other state, no status line), 1 medium, 2 large | | `TrafficLightColumns` | `REG_DWORD` | `3` | Tiles in a row, 1..12; the rows follow from the number of targets and the window fits the grid | | `TrafficLightWindowTransparency` | `REG_DWORD` | `0` | The board window's plate transparency, 0..100: 0 the usual opaque window, 100 only the title bar's buttons and the tiles - the plate is see-through and lets clicks pass to whatever is under it | | `TrafficLightX` / `TrafficLightY` | `REG_DWORD` | `MinValue` / `MinValue` | The board's position, written at the end of a drag and on hide; a position no live monitor covers is clamped. Its size is the grid's and is never stored (`TrafficLightWidth` / `TrafficLightHeight` of the first build are no longer read) | | `EnableExchangeClipboard` | `REG_DWORD` | `0` | 1 = the exchange server clipboard module is on; 0 = no connection opened, chords unbound, tray items hidden (S0074) | | `ExchangeClipboardSendHotkey` | `REG_SZ` | *(empty)* | Chord for "send clipboard to server" (to every account entry that can take part); shipped unassigned (D6); checked against every other chord owner | | `EnableExchangeClipboardSendHotkey` | `REG_DWORD` | `1` | 1 = send chord is bound (only while `EnableExchangeClipboard`=1) | | `ExchangeClipboardGetHotkey` | `REG_SZ` | *(empty)* | Chord for "get clipboard from server" (the newest value by the servers' own time); shipped unassigned (D6); checked against every other chord owner | | `EnableExchangeClipboardGetHotkey` | `REG_DWORD` | `1` | 1 = get chord is bound (only while `EnableExchangeClipboard`=1) | | `ExchangeClipboardReceivedFolder` | `REG_SZ` | *(empty)* | Where a received file is saved before it is put on the clipboard; empty = `Downloads\CyrFlip` of the user (S0074 D4). Never the data or log folder | | `ExchangeClipboardAccounts` | `REG_SZ` | *(empty)* | JSON array of the account entries (local id, host, port, the pinned leaf and key fingerprints, login, device id, label, account kind, sign-in state, the server's features, this entry's public device key, the trusted keys of the other devices). **No token, no private key, no password**: those are in `HKCU\Software\CyrFlip\ExchangeSecrets`, one DPAPI value per entry. An unreadable value is never saved over. Excluded from the settings file | Legacy `config.json` (still accepted on first run for migration): ```json { "hotkey": "Ctrl+Shift+F12", "cursorSize": 24 } ``` ## Build, run, test **Between releases only checks of 5 seconds or less run** (S0081, `TESTING_AND_QA` section 2): the full build and every slower test run only at the release, or when the owner names that run. A slow rung a ticket skips goes into its audit as a `RELEASE` item naming the command the release will run, and the report says "not built, not tested until the release". ```powershell .\build.ps1 -Fast # FAST tier, after every edit: the static gates, no build, no test (~4 s) .\build.ps1 -Fast -Area help # one area: placement | help | positioning | site | listing .\build.ps1 # the owner's СБОРКА: app-only build + stage single exe + deploy to C:\GD\.. .\build.ps1 -Tests # RELEASE tier, owner-named only: whole solution + dotnet test + static gates .\release.ps1 # the release preflight: full build, every tier, IconGen, listing and help gates .\src\CyrFlip\bin\Release\net48\CyrFlip.exe # run the app (tray icon → right-click → Exit) dotnet run --project tools/IconGen # regenerate icon/banner assets ``` The measured list (S0081; "direct" = one timed call on the dev machine, 2026-10-29): | Check | Tier | Seconds | Source | | --- | --- | --- | --- | | `tools/checks/Test-CheckPlacement.ps1` | fast | 0.39 | direct, 2026-10-29 | | `tools/site/Test-Positioning.ps1` | fast | 0.45 | direct, 2026-10-29 | | `tools/site/Test-SiteFacts.ps1` | fast | 0.44 | direct, 2026-10-29 | | `tools/help/Test-ContextHelp.ps1` | fast | 2.57 | direct, 2026-10-29 (with the S0075 capture digests) | | `msix/render-listing-mirrors.ps1 -Check` | fast | 0.71 | direct, 2026-10-29 | | `msix/build-store-listing-csv.ps1 -Check` | fast | 0.75 | direct, 2026-10-29 | | `build.ps1 -Fast` (all six) | fast | 4.04 | direct, 2026-10-29 (one area: 0.4-1.1) | | `build.ps1 -Fast -Area store` (`tools/checks/Test-StoreChannelPreflight.ps1`, stub `msstore`, 44 cases) | fast, outside the default set | 1.0-1.3 | direct, 2026-11-12 | | `dotnet test CyrFlip.sln` (sweeps gated) | release | ~45 | dev machine, 2026-10-24 (UiSweepGate decision) | | `dotnet build CyrFlip.sln` / app-only `build.ps1` / IconGen build | release | not recorded | measured at the next release run | | `CYRFLIP_SWEEP=full` window sweeps | owner-named | ~36 min (all) | 2026-10-24 | | `tools/uitest/*`, `tools/site/Measure-SiteContracts.ps1` | owner-named | minutes, desktop-bound | `operator-typed` in `check-placement.jsonl` | Branch CI (`ci.yml`) runs only on a manual dispatch; the push and the pull request run nothing. **The 13-language UI sweeps run nowhere automatically** (`tests/CyrFlip.Tests/UiSweepGate.cs`, owner decision 2026-10-24, the fourth version of the rule: 2026-10-15 skipped a sweep only while `Localization*.cs` + `SettingsForm*.cs` were unchanged, 2026-10-16 keyed it on the build configuration, then "a release is the only thing that sweeps" - which put a ~36 minute walk of every window in every language into every `release.ps1` preflight, `release.yml` and `ci.yml`. The owner's verdict: it passed once, that is enough, and a release test run is a couple of minutes, not a space rocket). The `[UiSweepFact]` / `[UiSweepTheory]` methods (the ones that build real windows in every UI language - the full settings window, the dialogs, the module windows, the traffic-light board - **and every other test that builds a `SettingsForm` and costs 2 s or more**: a form builds in about 5 s on the dev machine, so ninety of them were 10 of the 11 minutes the rest of the suite took, measured 2026-10-24; with them gated the whole suite runs in **about 45 s**) keep no state and ask for one thing: **they run only when `CYRFLIP_SWEEP=full` is set by hand, in any configuration**, and **no script and no workflow sets it any more** - `release.ps1` clears it for its own test run and judges the run with `Assert-TestRun.ps1 -AllowSkipped`, `release.yml` and the hand-dispatched `ci.yml` do the same (`release.ps1 -SkipSweeps` and the `skip_sweeps` dispatch input are gone / a no-op, there is nothing left to skip). `dotnet test` in Debug or Release, `build.ps1 -Tests`, the preflight, CI: every sweep reports skipped. **A change to the interface sweeps the window it touched, not the interface**: `CYRFLIP_SWEEP=full dotnet test --filter SymbolsWindowTests` while working on one window, and only then - and, being above the 5 s line (S0081), only when the owner names that run. An agent never sets `CYRFLIP_SWEEP` for a change that touches no window or string table, never for the whole suite, and never to "see a green". **The default run stays at a couple of minutes** (owner, 2026-10-24): a new test that builds a `SettingsForm` or loops a window over languages or pages is `[UiSweepFact]` (`[UiSweepTheory]` for a theory) from the start, not `[Fact]`. Marking a new 13-language window loop `[UiSweepFact]` instead of `[Fact]` is the whole registration; pure-string loops over `Localization.Names` stay `[Fact]` (milliseconds, always on). Under `dotnet test` the assembly-level `[assembly: TestFramework]` hook is dead - `xunit.runner.visualstudio` 3.x ignores it - hence the attribute+discoverer mechanism. The `net48` build output *is* the distributable: a single `CyrFlip.exe` plus `config.json`, no runtime to install. (The spec's `dotnet publish .. --self-contained false` line assumed a .NET 6+ target and does not apply to the net48 choice.) Releases are cut by pushing a `vYY.M.D.HHmm` tag (`.github/workflows/release.yml` builds the ZIP + sha256, carrying `CyrFlip.exe`, `CyrFlip.exe.config`, `README.md`, `LICENSE`, and `THIRD-PARTY-NOTICES.txt`). winget manifests in `winget/` are filled per release (see `winget/README.md`). Version is stamped at build time as `YY.M.D.HHmm` via a `` property in the csproj (verified: e.g. `26.6.11.1649`). ## Testing strategy - **Unit** (`tests/CyrFlip.Tests`, xUnit): `TransliterationEngine` (EN→RU, RU→EN, case, punctuation/digits pass-through, empty/null, bijection, and the two halves of a mixed string each flipping their own way), `KeyboardLayoutConverter` (`KeyboardLayoutConverterTests` - the per-character direction, the pair being symmetric, and the `ConvertSymbols` matrix; **every case is chosen to hold on both paths**, the live layout lookup where the Russian keyboard is installed and the `TransliterationEngine` fallback where it is not, so a clean CI runner proves the same thing this machine does), `CaseFlipEngine` (Latin/Cyrillic case inversion, the CapsLock fix, pass-through, self-inverse, empty/null, and `DesiredCapsLock` - the last cased letter deciding, trailing punctuation looked past, a caseless selection leaving the key alone, and the answer being the same however many times the correction is re-applied, which a blind toggle was not), `Hotkey` (modifier/key parsing, named keys, fallback, case-insensitivity, `CaseDefault`, `SameChord`, `NameForVk`), `LanguageHotkeys` (chord ↔ `MOD_*` mask round trip, the observed `0xC006`/`0x30` record from the registry, chord equality ignoring the side bits, slot allocation incl. a full range, toggle codes), `InputLayouts` (KLID→langid decode, `BuildPreload` device-handle scheme, `GroupByLanguageTag`), `KeepAwake` (mask composition per switch, idempotent Set, `Reset` → bare `ES_CONTINUOUS`; the P/Invoke is swapped for a recorder), and the conversion table's seeding/migration (`ConversionTableSeedTests`: a fresh install gets the EN⇄RU row on Ctrl+Shift+F12, an upgrade carries over the old chord *and* its off state, an already-empty table whose legacy values survive is still seeded, and a table emptied after the migration is never refilled). `DialogLayoutTests` builds both modal dialogs **in each of the 13 languages** and fails when any caption needs more room than its control got - with a companion fact proving the guard can fail, since a walk that inspects nothing passes just as quietly as a clean one. `DefaultLanguageTests` covers the fresh-install language pick (`Localization.MatchLanguage` takes the culture as an argument, so the whole matrix - all 13 languages, regional variants, untranslated languages, the invariant culture - is testable on any machine). The launcher: `LauncherScenarioStoreTests` (XML round trip incl. the `Hotkey` extension, an as-OneClickRunner-writes-it legacy file, corrupt-file isolation, contiguous ordering + move, delete-all-stays-empty, import = fresh Guid, seed-once), `LauncherMigrationTests` (run against the **byte-exact OneClickRunner fixtures** in `tests/CyrFlip.Tests/Fixtures/OneClickRunner/` - Guid preservation, collision → fresh id, `SPECIAL_YTDLP` → yt-dlp type, corrupt skipped by name, and a hash check proving the source directory is never modified), `LauncherExecutionTests` (target validation matrix, PATHEXT resolution, the `.ps1`/`.cmd` quoting shapes verbatim, yt-dlp link rejection, and the command-shape test proving a hostile `&`-bearing link reaches cmd only through the environment variable), `LauncherIpcAndJumpListTests` (strict command parsing - OneClickRunner's own `/run:` prefix is *not* ours, a live pipe round trip on a test-private pipe name that survives an empty connection, `BuildTasks` order + the Manage/Exit tail, no blank icon sources, hook binding snapshot ignores corrupt chords), and `LauncherTrayMenuTests` (**repeated** rebuilds - the first one can never fail, so only the second catches the dispose-while-enumerating bug; plus per-item closure capture, the empty-list shape, the conditional Import item, and the standalone `ContextMenuStrip` the taskbar button drops down, which is rebuilt on *every* click). `LauncherBrandTests` proves the embedded icon is actually reachable: a wrong `LogicalName` throws nothing, it just silently leaves both branded surfaces blank. The translator: `OllamaClientTests` (endpoint normalization, `/api/tags` parsing incl. every unreadable shape, one NDJSON stream stitched back together and reported chunk by chunk, the request body's model/prompt/`keep_alive`, a server error mid-stream, pull progress and the success/error lines - all through a fake `IOllamaTransport`, because **no test may reach a real Ollama**), `TranslationServiceTests` (prompt contents, the 4000-character cut, the echo/empty retry and that a bad retry keeps the first answer, model preference and tag matching, and the whole `TranslateAsync` matrix: healthy server, not installed, auto-start off, start failed, no models, HTTP failure), and `TranslationProfileTests` (the starter row offered once and never after, a row created chordless when the default chord is taken, the stored-table reader incl. id backfill and unreadable JSON, `[ScriptIgnore]` on the computed flag, the `ui`/`active` token resolution, that `AllCodes` really is every language Windows knows rather than the 13 interface ones, and the `ModelPageUrl` shapes - the size tag dropped, a `hf.co/..` name sent to the index). `LayoutColorsTests` is the cross-language guard: both tables the VS Code extension ships (languages and layouts) must match `LayoutStyle` entry for entry **in both directions**, every curated layout in `WorldLayouts.Popular` must have a colour and no colour may describe a layout nobody can pick, no two shades may be closer than a redmean distance of 40 (in the overlay's dot mode the colour *is* the marker), none may be dark, and `ColorForLayout` must walk its three rungs in order. `LayoutPublisherTests` pins what the extension reads, byte for byte: both file names, no BOM or newline, the empty sidecar, the folder per install mode, every code `CodeForLangId` can emit fitting the consumer's four-character prefix (Hawaiian is `HAW`), the last of 200 racing publishes winning, and the retract deleting only the producer's two files. `LayoutColorsTests` also proves each language colour is its primary layout's shade and every shade stays within 12 degrees of its language's hue; `ExtensionContractConstantsTests` reads the extension's signal timings and prefixes out of its TypeScript source (it has no test runner of its own); `TrustPageTests` guards the 13 trust pages (four sections in order, the quoted dialog, no "turn off SmartScreen", linked from every download surface); `NoTestRetryPackageIsReferenced` keeps the suite free of retry-to-green. `LayoutIdentityTests` pins the HKL → KLID decode against the shapes read off a live machine, incl. the three ways it refuses to guess (an unknown layout id, an IME handle, an id belonging to another language). `LayoutMarkerTests` covers the two things only pixels can answer: the letters leave **one pixel** of margin and no more than two along the axis that limits the fit (measured in pixels, not per cent - a 14px badge and a 32px one owe the same one pixel), and the badge is drawn translucent while the I-beam beside it stays fully opaque. `WorldLayoutsTests` additionally pins `CodeForLangId`, the single decode the marker and the settings tables now share (incl. a language Windows cannot name coming back as its hex id, not as `"??"`). The text context menu: `MouseChordTests` (every offered token round-trips, a bare right click is refused while a bare middle click is not, and `Matches` demands *exactly* the configured modifiers - Win never matches), `SelectionProbeTests` (a sighting with its text ends the scan, the text may arrive from a later source than the verdict, an empty string is not text, a throwing source is skipped rather than fatal, the class gate that keeps `EM_GETSEL` away from non-edit windows, and the two counter-intuitive rules that each have a test of their own: **`Unknown` stays `Unknown`**, and **no source may veto another's sighting** - the read-only-text bug, where the focused element's confident "nothing here" greyed Copy beside a live selection under the pointer), `LaunchTargetTests` (what "Запустить" will and will not open: the allowed schemes, a bare host needing a known TLD so `readme.md` and `setup.exe` stay filenames, `javascript:`/`shell:`/`ms-settings:` refused by name, a path accepted only when it exists, a network share or anything that runs code coming back as `Program` for confirmation, the prose trimmed off a link, a multi-line selection refused, and the caption elided in the middle so both ends survive) and `TextContextMenuTests` (the full item order, greyed-not-hidden without a selection, everything enabled on `Unknown`, Paste following the clipboard rather than the selection, disabled modules leaving no dangling separator, the launch item absent - not greyed - with no target and taking its separator with it, per-row closure capture, and - as with the tray submenu - **repeated** rebuilds, since the first can never fail). The log bundle: `SupportBundleTests` (the clipboard-history exclusion **and** that its payload is nowhere in the archive - the test the whole file exists for; an absent log skipped rather than fatal; the tail kept with a marker line and starting on a line boundary; a log held open for writing still collected; the total budget dropping from the end and *saying so* in the report; the archive name; retention keeping five) and `MailSenderTests` (every rung against every MAPI code, `MAPI_USER_ABORT` **not** falling through, the RFC 2368 shape, an overlong body trimmed while the subject survives, and that a non-ASCII path never reaches the ANSI API as-is). Long-run stability (2026-07-30): `ClipboardHistoryOrderTests` - the incremental display order proven **equal to the full reference sort it replaced**, by replaying a thousand random add/touch/pin/unpin/delete operations and comparing after every one (the stream is weighted 3:2 towards adds on purpose: with adds and deletes equally likely it is a symmetric random walk that hovers near an empty history and proves almost nothing, and the test asserts every branch actually ran); `DiagnosticLogTests` (a file under the cap untouched, the tail kept behind a marker on a line boundary, the dropped byte count honest, and **a log held open for writing still rotated** - the case that failed the first implementation, which replaced the file instead of rewriting it); `ClipboardBackupTests` (an image or a file selection with no text still counts as content, and a clipboard whose text could not be read does not - restoring an empty string would clear it rather than leave it be). The flip pipeline's hand-back (S0009), all over `FakeClipboard` so no test ever opens the real clipboard: `ClipboardBackupReadTests` (a password manager's markers go back with the secret, one that cannot be read goes back as DWORD 0 and an explicit "yes" stays a yes, markers alone are not content, a Cut's `Preferred DropEffect` and `Shell IDList Array` survive, `CF_LOCALE` is restored, the text byte for byte with its padding, one open at the content's sequence number, locked-with-formats is unreadable while locked-and-empty is merely empty, and a flip over an unreadable clipboard **sends not a single key**), `ClipboardRestoreTests` (the restore planner's four answers, the receipt by sequence, the long waits for a remote target, the paste wait on a fake clock - taken at 50 ms → restored at 150 ms, never taken → restored at the cap, an early render → the fixed wait, a lost clipboard → at once - the real `PasteOffer` state machine driven by hand, which markers each `TransientMarks` level puts up, and the busy notice's interval), `LineCopyMarkersTests` (each editor's marker on a realistic Chromium pickle, a real VS Code selection accepted, another page's custom data not mistaken for one) and `RemoteDesktopTests` (which targets are slow). The engines' S0009 cases sit in their own classes: the ambiguous-punctuation rule on both paths, the memo's exactness and a million characters under a second, and the five letters without a case round trip. The clipboard history's file and gate (S0005): `ClipboardHistoryJournalTests` (a half line between two good ones, an undecryptable payload and a torn tail each cost only themselves and stay on disk; a file an earlier release wrote loads unchanged; a thousand random add/touch/pin/delete snapshots through a writer that yields at random **replay equal to the in-memory order**; add, add, Clear, add leaves exactly the last add; a clear that cannot delete says so; `Dispose` writes all 50 records still queued) and `ClipboardHistoryGateTests` (an update inside an operation or at its end mark skipped, a copy 100 ms later recorded, a five-second operation leaking nothing, the counter wrapping, the own write skipped by its exact number so a copy after a paused restore is recorded, every privacy marker and the DWORD ones only on 0, and the preview of a 64 K text short and on one line). The quick notes: `QuickNoteTests` (a blank name is `null` and not a caption, the preview derived and never stored, the search over all three fields, both conversions **and what each of them reports as lost before it happens**, the export shapes, the Keep text dropping the ticks, and the cap measured in UTF-8 bytes so Cyrillic fits half as much), `QuickNotesOrderTests` (newest-first by creation with an edit never moving a note, the `Id` tie-breaker giving the same answer whichever way the list arrives, and - the load-bearing one - the incremental insert proven **equal to the reference sort** over a thousand random operations, with the timestamps drawn from a deliberately narrow range so the tie-breaker actually runs, asserted), `QuickNotesStoreTests` (replay of create/update/delete, a fragment of code back **byte for byte** including mixed CRLF/LF, tabs and non-BMP text, a damaged line **between two good ones** skipped and counted, a record that decrypts but is not a record skipped too, compaction leaving one record per note plus a `.bak`, "delete everything" taking the `.bak` with it, and nothing readable written beside the encrypted record - title included) and `QuickNotesServiceTests` (an empty draft never created while an existing note the user emptied still is, the creation date assigned once, the debounce flushed by `Dispose` rather than lost). `QuickNotesWindowTests` builds the real window in **each of the 13 languages** and walks it for surviving Cyrillic - the window lives outside the settings control tree, so nothing else would catch a Cyrillic literal that bypassed the table in it. The theme (S0020): `ThemeModeTests` (the token round trip incl. the registry, unknown -> `system`, the resolve matrix with high contrast winning), `ThemePaletteTests` (every role in all three palettes, every text/surface pair at 4.5:1 - the ratios are printed - dark dark, light light, the marks distinguishable from body text, every design colour read back to its role), **`ThemeCoverageTests`** (every window built and walked: dark leaves no system colour and only palette colours of the right kind - a surface colour behind, a text colour in front, since the dark text grey equals the light control grey by value; high contrast leaves only system colours; light after both restores every recorded property; every `Form` is a `ThemedForm` or declared, and every `ThemedForm` is built there; a late row arrives themed; and the guard fact that the walk can fail), `ThemeSourceGateTests` (no colour literal outside the palette and the marker's files, one `MessageBox.Show` left - `Program.Fatal`), `ThemeMenuTests` (the dark renderer's background and the three caption colours) and, in `DialogLayoutTests`, `ConfirmDialog` in 13 languages x every button set plus the fact that every dialog has an Escape and a destructive question answers No to Enter. The symbols window (S0056): `SymbolTableTests` (501 entries across 12 categories, uniqueness, invisible labels, combining marks), `SymbolSearchTests` (character, code points `U+20AC`/`20ac`/`0x20AC`, prefixes, standard order without relevance reordering, surrogate pairs), `SymbolRecentTests` (MRU deduplication, 24-cap, JSON sanitization, surrogate pairs), `SymbolTypabilityTests` (fake layout provider: plain key, Shift, AltGr, dead-key reporting as not typable, layout cache), `SymbolsClipboardTests` (exact text copy, taken `_busy` guard rejection), `SymbolsWindowTests` (13 languages, no surviving Cyrillic, accessible names, minimum size, `MA_NOACTIVATE`). **A test that builds a `SettingsForm` or asks `LauncherBrand` for an image must join the `SharedGdiCollection`** (`[Collection(SharedGdiCollection.Name)]`). xUnit gives each test class its own thread and runs the classes in parallel, while `LauncherBrand` caches its icon/bitmap in plain static dictionaries and hands out the **same instance** to everyone - correct for an app with one UI thread, false in a test runner. Racing over it produced three unrelated-looking flakes with one cause: GDI+ answering concurrent use of a single `Bitmap` with *"Object is currently in use elsewhere"*, a `NullReferenceException` out of a `Dictionary` corrupted by concurrent writes, and a settings window that came back half-built (an empty version label). The collection makes those classes run one at a time; the fix is deliberately in the tests, since the app has no concurrency here to fix. It reproduced in 5 of 8 full runs before, and 0 of 15 after. **Verified live on 2026-07-25** (the tech plan's Фаза 3 gate - a build alone never proves this): with one scenario staged, the shell's own `%APPDATA%\Microsoft\Windows\Recent\CustomDestinations\*.customDestinations-ms` came back holding the task title, `/launcher-run:{guid}`, `/launcher-settings`, the exe path and the resolved icon path - i.e. every `IShellLinkW`/`IPropertyStore` slot landed where intended (a wrong vtable slot fails *silently*, so this is the only real proof). A Jump List click on a live instance dispatched over the pipe without creating a second process; with no instance it one-shot launched and left no process; switching the launcher off **deleted** that shell file and a stale task was then received but not executed. Two localization guards in `SettingsLocalizationTests`: every string registered in `Localization` has a non-empty translation in **all 13** languages, every dynamically built string is actually registered, and the live settings window is constructed **in each language** and walked for surviving Cyrillic (a Latin/Arabic/Indic/CJK build showing Cyrillic = a Russian literal that bypassed the table; "ЙЦУКЕН" is allowed - an untranslated label now reads English, which `LocalizationSourceGateTests` catches at the source: no Cyrillic literal outside the translation data, every literal of a translating call a registered key, every row with its `ru` and `uk`). The hook, clipboard flip, layout detection, and the live layout install/remove are interop-bound - verify those manually (see below). **Translator verified live on 2026-07-26** against the real Ollama on the dev machine (`qwen2.5:3b`): probe, model listing and a streamed completion all came back through the production code path - RU→EN, EN→RU, DE→UK and a two-letter string that legitimately translates to itself. First call 26 s (the model being loaded), then ~300-400 ms, which is `keep_alive` doing its job. What that check does **not** cover, and still needs a human at the keyboard: the chord itself, the synthesized copy/paste, the popup's placement and focus behaviour, and the clipboard-history interaction (spec §12.2). - **Desktop-driving checks** (`tools/uitest/`, PowerShell): the interop that xUnit cannot reach - `Test-TrayMouse.ps1` (single tray click advances the last active window's layout, double click opens Settings), **`Test-DarkTheme.ps1`** (the theme on the live app: starts it in dark and in light with `/launcher-settings`, so no mouse, captures the settings window - chosen pages via the saved `SettingsTab` - and judges each shot and its title bar by mean luminance; `-FollowWindows` flips Windows' own `AppsUseLightTheme` with the window open and broadcasts `ImmersiveColorSet`, restoring it in `finally`; `-TrayMenu` right-clicks the tray icon. `Audit-SettingsWindow.ps1 -Theme dark` renders every page off-screen in the theme, no mouse at all), **`Test-CapsSync.ps1`** (the "synchronize CapsLock" behaviour: `-InteropOnly` proves unattended that `GetKeyState` answers honestly on a **queue-less thread** - the clipboard worker is where CyrFlip reads it, and a stale reading would invert the result rather than skip it; the full run stages three scenes and asks a human for the chord, one of them being the already-off case a blind toggle got backwards, plus a fourth when "Press SHIFT to turn off Caps Lock" is set), **`Test-ClipboardFlip.ps1`** (the S0009 hand-back, `-InteropOnly` unattended: reflection into the built exe drives the real `ClipboardHandler` against a text box in its own process - the delay-rendered paste reaching the target with `CF_LOCALE` beside it, a whole case flip giving the user's clipboard back with its privacy markers, the chord with nothing selected not rewriting the clipboard at all, a Cut's move effect surviving. It **borrows the real clipboard**: it backs it up with CyrFlip's own backup first, refuses to start when it cannot, and resolves everything the hand-back needs *before* the first scene, so a scene that throws cannot take the way back with it - the first draft lost a clipboard exactly that way. Everything it stages is marked "do not record"; the rest is a checklist for RDP, Word, Excel, VS Code, KeePass, Explorer and an ANSI app), **`Test-QuickNotes.ps1`** (the quick notes: the two things the unit tests deliberately cannot reach - **real DPAPI** against the real journal, since they fake the cipher, and that journal surviving an actual restart - plus the checklist for the chord, the window and the context-menu capture. Like the support-bundle check it **never writes into the data file**: that file is the user's real notes, and a canary dropped into it would corrupt what the app reads back), `Test-SupportBundle.ps1` (waits for the log archive, then checks its contents, truncation markers and retention - whether a real mail client opened with the file attached is the one thing only a human can confirm), `Save-SettingsShots.ps1` (a PNG per settings tab, for layout/localization eyeballing) and **`Test-LongRun.ps1`** - the hours-long watch: GDI/USER handle counts, private bytes and threads sampled to CSV while a throwaway window's layout is switched to drive the icon/cursor/overlay rendering. It **fails on handle growth** (a leak there is invisible in the memory column) and reports private bytes without judging them, since the unbounded history is *meant* to grow. It deliberately never synthesizes a chord to prove the keyboard hook is alive: CyrFlip ignores injected keystrokes by design, so a synthetic `Ctrl+Shift+F10` would prove nothing - it asks a human to press one at the end instead, which is the only real check that Windows has not silently dropped the hook. Deliberately outside `dotnet test`/CI: they move the real mouse and steal focus. `CyrFlip.UiTest.psm1` holds the reusable seams (PerMonitorV2 DPI, MSAA tray-icon lookup, synthesized clicks, per-window HKL, `PrintWindow` screenshots, `GetGuiResources` handle counts, per-window layout switching) - **write new manual checks on top of it instead of hand-rolling P/Invoke in a scratch script**; `tools/uitest/README.md` lists the traps it already absorbs (UIA can't see the tray toolbar under pwsh 7, the settings caption is localized, the tray click is deferred by `DoubleClickTime`). - **Integration** (planned): full hotkey→copy→transliterate→paste path across Notepad, Word, Chrome; live layout switching. - **Manual** (planned): cursor visibility/non-obstruction; edge cases (multiline, selection at boundaries). Memory stability over 1+ hour is no longer on this list - it is `tools/uitest/Test-LongRun.ps1` above. ## Unified Rules & release conventions The **universal** SZA conventions (repository layout, versioning principle, documentation, development discipline, testing, release & distribution, localization, security, support, AI-agent operation) live in one canonical home - reference it, do not restate it here: **Canon:** the **`sza-unified-rules` repo**, installed as the `sza` Claude Code plugin, so the rules and the skills that apply them are in every session without a path to follow: ``` /plugin marketplace add SerZhyAle/sza-unified-rules /plugin install sza@sza-unified-rules ``` Load a skill rather than the whole canon: `sza:release`, `sza:store-publish`, `sza:feature-to-site`, `sza:spec-to-audit`, `sza:adopt-canon`, `sza:agent-cost`, `sza:caveman`. CyrFlip is **Overlay A - Windows desktop, no-installer variant**, plus a **companion editor extension** on the VS Code Marketplace. The per-project record with full evidence is `rules/contrib/cyrflip.md` in that repo; the adoption stamp is `.sza-canon.json` here. This project **references** the canon (does not mirror it); only the CyrFlip-specific deltas below stay local. **The stamp is written only by the `sza:adopt-canon` run** (`REPO-STAMP` rule 8). When the plugin moves but the coreDigest does not, nothing is owed - never bump `canon.version` by hand to quiet the gate (commit `468ffb8` once did exactly that). A `SZA-CANON03` warning means: re-read the changed rule docs, reconcile, then let the run rewrite the version and the digest together. The canon moved out of the hub repo on 2026-07-27; the old `..\Unified_Rules` local path is dead - a path no CI job and no second machine could reach. **Two canon mechanisms nothing here re-implements:** - **Enforcement hooks.** The plugin ships and registers its own guard family, so this repo registers **none**: `.claude/settings.json` carries permissions only, and there is no `hooks/` folder here. Never hand-wire a guard the plugin already ships - it would then run twice, and the canon's inventory gate cannot see a machine-local registration to tell you so. - **The release package plan** (RELEASE_AND_DISTRIBUTION §8) is **adopted by hand (2026-09-25)**: `PLAN/RELEASE_QUEUE.md` (work remaining, owner's order, packages `1`/`2`/`3`/`--`) and `PLAN/RELEASE_READY.md`, one line per `Sxxxx` ticket. Status changes only through the shared ticket tool (`update.ps1 -Id -Status `); never edit the `**Status:**` line by hand. The tool syncs the spec header and journal together. An agent never reorders the queue or rewrites a package. **Overlay facts (this repo):** - **Version shape** - dotted `YY.M.D.HHmm` (e.g. `26.7.22.1712`), stamped at build time by the csproj (`src/CyrFlip/CyrFlip.csproj`). The `v*` git tag is authoritative for release-asset names; `release.yml` re-pins the embedded exe version to the tag (`-p:Version=`) so the in-file stamp matches the ZIP name. The **VS Code extension runs its own semver clock** (`vscode-extension/package.json`, `0.1.5`), decoupled from the app date tag. - **Channels (4 publish ops + a site).** GitHub Release (`CyrFlip--windows-x64.zip` + `.sha256`, body auto from `generate_release_notes`); **winget** `SerZhyAle.CyrFlip` (`winget/*.yaml`, `InstallerType: zip` / `NestedInstallerType: portable`, alias `cyrflip`); **Microsoft Store** MSIX (`msix/build-msix.ps1`, manual Partner Center); **VS Code Marketplace** (`npx @vscode/vsce publish`, manual). GitHub Pages from `/docs` (trilingual). **No installer** - portable ZIP only (no Inno `.iss` / WiX `.wxs`). - **Frozen anchors** - winget `PackageIdentifier: SerZhyAle.CyrFlip`; MSIX Identity `Name: SZA.CyrFlip` + `Publisher: CN=F98ACEDB-1E22-4C39-AF63-F9FCFE807DCD` + Store ID `9NB4W41NGQJ4`; exe/`AssemblyName` `CyrFlip`; VS Code extension id `SerZhyAle.cyrflip-vscode`. No Inno `AppId` / WiX `UpgradeCode`. - **Companion extension** - `vscode-extension/` is **not** an edition and **not** a co-shipped binary: it is a code-independent (TypeScript) companion coupled to the app by a **one-way file contract** (the app writes `layout.txt` via `LayoutPublisher.cs`; the extension polls it), published on its own clock. **Build/release wall & CI cost levers** (every repo runs on paid Windows minutes): - **`build.ps1`** = СБОРКА (free local build, appends `[skip ci]`, may push to `main` but **never tags**); **`release.ps1`** = РЕЛИЗ (the only tagger; preflight = on-main + local build/test, then `-Push` creates the `release: vX` anchor commit + tag). The billable boundary is that tag, not a script-capability wall. **A dirty tree blocks neither script** (single-developer repo): the preflight reports how many paths are uncommitted - they simply won't be in the release, since the tag points at the anchor commit - and carries on; `-RequireClean` brings the old refusal back. `build.ps1 -Commit` with nothing to commit likewise reports and finishes instead of failing. `build.ps1` stops the running tray app before building and, when the build or the tests fail, **starts the previous copy again** from where it ran (S0038 RP-5) - it used to leave the user without indicator and hotkeys until a green build. - Levers wired: `[skip ci]` on build commits; **`ci.yml` runs only on a manual dispatch** (S0081 - a full solution build plus the whole suite is above the 5 s line, so a push or a pull request runs nothing; the release runs the same build and suite against the tag's tree, and the preflight builds IconGen, which only CI used to build); the tag triggers only `release.yml`; `concurrency cancel-in-progress` true on CI / false on release. - **Preflight verdict contract (`CHECK-VERDICT` 0.9)**: gates exit **0** (pass), **1** (defect/drift), **2** (could-not-verify / unverified / tool missing / unreachable origin without `-Offline`), or **3** (advisories). A green tail line is never printed over a failed check. The preflight ends with a machine-readable verdict line `: PASS|FAIL (n)|NOT VERIFIED (n)` as the last stdout line. Mirror and CSV checks run even after a failed test (rule 9 collect-all). - **Check placement (`CHECK-PLACEMENT` 0.9)**: declared in `tools/checks/check-placement.jsonl` and verified both ways by `tools/checks/Test-CheckPlacement.ps1` in `build.ps1 -Fast` / `-Tests` and `release.ps1`. - **Zero accepted debt (`CHECK-BASELINE` 0.9)**: zero-tolerance build (`WarningsAsErrors`, `Skipped: 0`), no accepted-debt baseline file exists. - **Artifact version gate** - `release.yml` checks out the tag it releases (also on a manual dispatch), re-applies the tag-shape gate, and fails unless the built exe - and again the exe inside the ZIP - has `FileVersion` = the tag version and `ProductVersion` = `+` (`BUILD-EVIDENCE` rule 2). `msix/build-msix.ps1` applies the same `ProductVersion` check on both its paths (S0038 RP-3), and its identity comes from `msix/identity.json` - **it holds** the frozen Store anchors (`SZA.CyrFlip` / `CN=F98ACEDB-...` / `SZA`, plus the Store ID and the package family name; no file, no build; S0100; a local test identity only behind `-SelfSign -TestIdentity`, RP-2). - **Store channel preflight (S0100, `WINDOWS-STORE` 0.4 section D)** - the release preflight reads the live Store read-only **before the tag**: `msix/Invoke-StoreChannelPreflight.ps1` finds the canon's shared `Store-Preflight.ps1` (the `sza` plugin), passes it `msix/identity.json` and the MSIX version about to be built, and the shared script issues one `msstore submission get ` and no other verb. Exit 1 (a pending submission, a version not newer, a price not `Free`, no live submission, an unreadable state) fails the preflight with the reason - a console-made draft such as Submission 16 does exactly that until the owner commits or deletes it in Partner Center; exit 2 (CLI missing or unconfigured, token refused, recorded credential expired, plugin absent) prints one line, the Store step is manual, and changes nothing, so the channel never fails a release after the tag. `release.ps1 -SkipStoreChannel` (and `-Offline`) leaves it out; one evidence line per run goes to `artifacts/store-channel-evidence.jsonl` (values the script sets itself, no account identifier). The upload stays the Partner Center web flow; no write has ever been made through the channel. `tools/checks/Test-StoreChannelPreflight.ps1` (in `build.ps1 -Fast -Area store`) runs it against a stub `msstore`. Detail: `msix/README.md`. - **A published tag is never rebuilt** (S0038 RP-1): the resolve step asks `gh release view` and refuses when the release already carries its `CyrFlip-*.zip`, and the publish step has `overwrite_files: false` - a re-run makes a ZIP with other bytes (`Compress-Archive` stamps fresh times), and replacing it and its `.sha256` breaks the hash in every winget manifest already merged. - **Tag-format gate** - `release.ps1` validates `^\d{2}\.(?:[1-9]|1[0-2])\.(?:[1-9]|[12]\d|3[01])\.\d{4}$` (no zero-padded month/day) + `ParseExact` before tagging, so a mistyped `-Version` fails before any push; `release.yml` applies the same shape, `ParseExact` and "newer than every other `v*` tag" gates to what it is asked to release (RP-6). - **About and the log report show the tag's spelling** (`26.9.26.0930`, from the informational version - `SupportBundle.AppVersion`, S0038 RP-4), not the SDK-normalized assembly version (`26.9.26.930`). - Releases ship **unsigned** (CI Authenticode step is opt-in via `SIGNING_CERT_*` secrets, which are unset; the Store re-signs the MSIX). Don't claim releases are signed. **Repo-specific decisions (resolved 2026-07-23):** - **Store-listing source of truth = `msix/store-listing-export.csv`** (Partner Center export-then-merge), all 13 languages. `msix/store-listings.md` and `store/listing-*.txt` are **generated** from it by **`msix/render-listing-mirrors.ps1`** - never hand-edit the copy in them; the prose *outside* the three locale sections of the md (the runFullTrust justification, the submission notes) is hand-written and the renderer leaves it alone. `release.ps1` runs the same script with **`-Check`** in the preflight, because the alternative is what actually happened: both mirrors sat a release behind on the translator paragraph and on four feature lines, in three languages, and nothing could see it - the mirror is exactly what gets pasted into the live listing on the day the CSV importer refuses a file. `msix/listing/.txt` is upstream of the CSV, not downstream: the merge fills **empty** cells only, so a change made there alone never reaches the Store - edit both. - **VS Code extension is published by hand** (`vsce publish`, its own semver), only when `vscode-extension/` changed - deliberately no `ext-vscode-v*` tag/workflow. **Local specifics (kept):** - **Menu strings keep the Win32 trailing `...`** - `Настройки...`, `Импорт из OneClickRunner...`, `Diagnose caret position...`: roughly 200 strings across the 13 languages where the ellipsis is the platform's "this opens a dialog" signal rather than prose. The house style's `..` governs prose, and the docs quote those strings verbatim, which is why the compliance gate warns on four documentation lines - each of them is the gate's own "a quoted real UI string is legitimate" case. Changing them would be a user-visible UI decision in 13 languages, not a typography fix. - Single-instance via a **path-independent named mutex** (`Local\CyrFlipSingleInstance`), so debug/release/ renamed copies don't each install a hook. - Code style is **wired in the csproj**: `enable` + a fixed `` list (`CS0108;CS0162;CS0164;CS0168;CS0219;CS0414;CS0649;CS1998`). Keep clean builds warning-free. - `build.ps1` deploys the staged exe to the local sync folders `C:\GD\i\` and `C:\GD\tc\SZA\_APP\`. - Interop pieces (hook, clipboard flip, layout detection) still need **manual validation** - run the tray exe and exercise the hotkeys in real apps; xUnit only covers the pure logic.