Commit Graph

11 Commits

Author SHA1 Message Date
felixm 13633ffabf Fix drift sync: per-window verdicts, forgiving class match, event-driven status bar
Three independent defects made the focus state feel flaky and let the OS
status bar disagree with the web UI:

- Status file lagged the web by up to a minute: it rendered only on a 60s
  ticker with no hook into state changes. notify() now fans out to multiple
  listeners (AddOnChange) and the writer has a coalesced Wake() so drift
  reaches the bar as promptly as the browser.

- A brief off-task visit could latch drift for the whole session. Sibling
  windows of one app (a browser's reading tab vs its chat tab) share a window
  class, but the judge verdict was cached by class alone, so one tab's verdict
  poisoned the rest and never re-judged. Cache is now keyed by class + scrubbed
  title (judgedWindows) so siblings are judged independently.

- Allowed-class matching was exact equality, so a short token ("brave") never
  matched the real WM_CLASS ("Brave-browser") and every window was routed to
  the LLM. Matching is now substring-based, and planning surfaces the live
  window class with a click-to-add chip so users pick a token that matches.

Also fix the planning checkbox alignment: the global full-width input rule was
stretching the "Enforce focus" checkbox; scope it out for checkboxes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 09:25:30 -04:00
felixm 9012d5ddc6 Purge leftover Rust implementation
Remove the legacy/ Rust tree (Cargo manifests, .rs sources, desktop
entry), drop Rust-specific .gitignore blocks and README note, and strip
now-dangling "ported from Rust" comments from the Go sources.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 09:06:14 -04:00
felixm d149736946 Share unavailable() so the Windows sensor logs unavailable transitions 2026-06-02 12:33:23 -04:00
felixm 0daf8c2849 Add Windows polling active-window sensor 2026-06-02 12:30:16 -04:00
felixm 7d62af0750 Document foregroundTracker unavailable-state contract
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 12:23:54 -04:00
felixm e1194be3c2 Add emit-on-change tracker for the Windows polling sensor 2026-06-02 12:21:58 -04:00
felixm 71b8c80c69 Scrub spinner glyphs from window-title bucket keys
Bucket keys are {Class, ScrubTitle(Title)}, so each animated progress frame a
terminal app cycles into its title (Claude Code's braille and dingbat-star
glyphs) became a distinct bucket — fragmenting one task into dozens of rows and
inflating the switch count, since applyEvent counts a switch per key change.

ScrubTitle now drops any non-ASCII symbol or control rune and collapses leftover
whitespace. This is category-based rather than range-based, so future spinner
sets are covered too, while letters and digits of every script survive and ASCII
symbols (e.g. "C++") are left intact.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 19:23:49 -04:00
felixm 7e9d00b80b Port allowed-context matching to evidence package
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 16:42:48 -04:00
felixm ed5085ab6b M1: make evidence tests race-clean
Rewrite TestFakeSourceEmits to synchronize through a channel (it now
asserts emission instead of racing on a shared slice and discarding it).
Skip the live X11 smoke test under -race: xgbutil's event loop has an
internal Quit/Quitting race on shutdown that is never reached in
production (Watch runs under a never-cancelled context.Background()).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 12:57:50 -04:00
felixm 1646321d0b M1: X11 active-window adapter + platform fallback
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 12:44:25 -04:00
felixm a31ce702fe M1: evidence types, Source port, ScrubTitle
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 12:37:04 -04:00