# WKAppBot Changelog -- v5.10 ~ v5.13

> Moved from CLAUDE.md for token efficiency. Reference when investigating regressions or understanding past design decisions.

### v5.13.133~140 (2026-04-10, Session 8)
- **Core worker self-log** (v5.13.133): `IsLauncherInParentChain()` WMI walk -- if Launcher not in ancestor chain, Core auto-creates `WorkerStderrTeeWriter` log. Covers Eye-spawned workers (claude-proxy, whisper-ring, analyze-hack) that bypass Launcher.
- **Launcher stderr relay hardening** (v5.13.136): buffers last-20 stderr lines + captures `[LOG]` path; writes `{source:launcher}` fallback `errors.jsonl` entry on non-zero exit. Raw-byte sentinel detection (`\0UIT`) + StringBuilder line accumulation.
- **AppBotQuitFlush** (v5.13.137): unified Launcher exit function -- `stderrRelay.Wait(2000)` -> `AppBotExit(code)` -> flush + TerminateSelf. All bare `TerminateSelf` calls replaced.
- **Core stderr flush** (v5.13.140): `Console.Error.Flush()` added to ProcessExit hook, `DoRequiredExitCleanup`, and `WriteExitFile` (`FlushFileBuffers(STD_ERROR_HANDLE)`). Critical for MCP loop which has no `_activeTee`.
- **claude-proxy** (v5.13.130): local Anthropic API proxy on port 7788. Always-on `[PROXY] <- STATUS (Nms)` logging. `ANTHROPIC_BASE_URL=http://localhost:7788` in `~/.claude/settings.json`. Context-limit -> auto Gemini handoff.
- **Skills added**: `core-worker-logging-launcher-chain` (13-step logging architecture guide), `a11y-command-cheatsheet` v2.11 (ambiguous grap auto-resolution via L1 TargetAmbiguityGuard documented)

### v5.11.101+ (2026-04-08, Session 7)
- **# TARGET output redesign** (copy-paste-ready grap):
  - `# TARGET "hwnd:0xXXXX[#absTagPath]" [OK] Nms  proc=name  {compact-context}`
  - bash-safe: `hwnd:0x...` as primary paste token, JSON5 as context suffix
  - `BuildAbsoluteTagPath`: UIA type 3-char abbreviations (`Document->Doc`, `Group->Gro`, `Edit->Edi`)
  - `BuildCompactWinGrap`: strips title/url, browser->domain(no cls), legacy->cls
  - `[OK]/[MISS]` verification + timing ms
  - window title -> stderr
  - hack-hover same format + `BuildCompactWinGrap` shared function
- **FormatNodeLabel unified**: AutomationElement overload -> fully delegates to string overload
  - name wrapped in single quotes `<Button'OK'>`, removed 17-char truncation
  - `-> #scope` hint right of TARGET tag when UIA scope accessible
  - rect `ltwh=` attr included; VERDICT v suppressed (only !/? output)
- **KNOWHOW/ShowKnowhowBroadcast/ShowKnowhowHint** -> all stderr
- **UiaLocator.GetAbsoluteTagPath()** added (exposes automation tree walker)

### v5.11.74~100 (2026-04-08, Session 6)
- **stdout noise elimination**: 124 Commands/*.cs files bulk-replaced `Console.WriteLine($"["` -> stderr (wkedit bulk)
- **ClickZoomHelper**: `[ZOOM:]` Console.Write -> Console.Error.Write (all stderr)
- **a11y find output restructure**:
  - first line `# FOCUS {grap}` + `# TARGET {grap}` stdout (copy-paste ready)
  - CURSOR section: run-length encode consecutive identical unnamed nodes (`<Group> x7`)
  - TARGET section: deduplicated header grap
- **BuildTargetJson5 field order**: `hwnd,pid,proc,domain,title,...` (proc/domain moved forward)
- **ErrorScope**: error-pattern immediate passthrough, ErrorDetected flag, exit-0+error -> -9999
- **Skills added**: `grap` (10-step UI address system guide), `wkedit` v1.1 (bulk transaction edit)
- **Skill rule**: no direct `.skill.json` edits -- must use `skill contribute/edit` commands

### v5.11 new (2026-04-05)
- **TargetAmbiguityGuard 6-Layer**: AI target ambiguity detection + auto-guidance system
  - L1: ambiguous pattern matches multiple windows -> list + `[OK]` verify + hwnd auto-heal
  - L2: modal alert blocking -> auto-find inside alert (UIA + Win32 buttons)
  - L3: FOCUSED/LEAF terminal node -> grap target guidance on all commands
  - L4: Win32 child window not found -> sibling window listing (MFC/HTS)
  - L5: element action without #scope -> root children + focus chain
  - L6: UIA scope element not found -> list available elements
- **CDP fixed delay -> state-based polling**: triad consensus implementation
  - `WaitForWindowStateAsync` shared helper (50ms interval windowState polling)
  - SetWindowBoundsAsync, EnsureMinimizedAsync, SwitchToTargetAsync, EnsureCorrectWindowAsync all replaced
  - WebOpenCommand: Thread.Sleep(1-2s) -> document.readyState polling
- **BuildTargetJson5 improvement**: title 50-char truncate, removed ellipsis (ensures substring matching)

### v5.11.37~73 (2026-04-06, Session 5)
- **hack-hover major improvements**:
  - Live overlay: root window size, full UIA descendant dotted lines
  - Target parent chain 2x thick neon dotted highlight
  - Blind window (no UIA / no experience DB) immediately fires hack (non-cancellable)
  - Experience DB FSW: overlay refreshes immediately on file change
  - Hot-swap: TryRenameSwap detects .new.exe -> re-spawns Launcher
  - Console: output every tick, Eye: change+analysis only (auto-detects RunningInEye)
  - Screen reader auto-activation (boosts Chromium UIA tree)
- **hack-input worker**: keyboard focus analysis (UIA GetFocusedElementInfo)
- **TypeViaIme**: IMM32 focusless text input Tier 2 integration
  - AttachThreadInput + ImmSetCompositionString + CPS_COMPLETE
  - State backup/verify/restore (restores previous composition on failure)
- **auto-hack process isolation**: Eye A11yHackCommand -> AppBotPipe.Spawn (prevents memory leak)
- **CDP EvalAsync**: 2->3 retries + 500ms/1000ms exponential backoff
- **pump watchdog**: 3s->5s + secondary decrease check (prevents false positives)
- **Overlay improvements**: removed translucent fill entirely, Known/Cached alpha 10%, atomic swap render
- **CommandHelpMap**: speak, hack, hack-hover, hack-input help registered

### v5.10 (2026-04-04)
- **Eye pipe 100ms timeout**: `firstOutputTimeoutMs` -- applied to most commands except slack/ask/newchat. Auto-fallback to Core if Eye is slow
- **TryRenameSwap shared function**: Eye main loop + startup gentle-swap + `wkappbot hotswap` CLI -- same logic
- **OcrCorrectionDb**: pixel-hash -> correct answer self-learning dictionary (WKAppBot.Vision). UIA verify auto-learns, OCR results auto-corrected
- **suggest show/get/view**: query full content by number/ts. Unknown subcommand guard (noise prevention)
- **suggest resolve safety**: duplicate guard backup fallback, .manifest delete detection+auto-restore, evidence preserved on failure
- **CDP Input.* minimize removed**: CDP renderer direct delivery -> minimize unnecessary. Only IsFocusStealingMethod minimizes
- **Runtime.enable retry**: EnableRuntimeWithRetry (max 4x exponential backoff)
- **Log routing fix**: Eye pipe commands -> per-command `old {cmd}/` folder. Typos -> `old unknown/`
- **auto-hack log noise removed**: TeeWriter suppressed with WKAPPBOT_WORKER=1
- **Encoding corruption watch**: U+FFFD detection after file edit + auto Slack alert
- **a11y hack top-right node name**: UIA AutomationId/Name displayed inside segment top-right
