* feat(engine): webview 契约给统计概览增加首词命中率字段并支持 null 分支 * feat(server,ui-html): 统计新增首词命中率(决策点记录、stats v2 迁移与设置页展示) * fix(server): 首词命中计数补日语标点排除与并发迁移复查 * fix(ui-html): 统计卡片改用自适应列宽,避免长数字被省略号截断 * fix(server,installer): 修复首词命中率随附测试在 CI 的失败 三条 server 用例是首词命中率改动新加、但从未跑绿:RawDb 在迁移用例里对尚不存在的库开只读写连接,补上 SQLITE_OPEN_CREATE;09-19 写了一次次选,按契约它是一次真实测量(0%),断言却要求 nullopt,改为断言 0.0,并把 nullopt 覆盖移到迁移用例(total==0 的那天)。安装器 preserve-user-data 从 stats_pipe.cpp 取库名,而 EnsureStatsStoreOpen 连同 stats.db 字面量已挪到 stats_candidate_capture.cpp,改到新位置。 * fix(server,ui-html): 首词命中率写库移出按键路径,修正迁移与统计口径 - 选词计数改由后台 SerialTaskRunner 写库,标点收尾与选词路径不再同步等 SQLite 锁 - 迁移以表结构为准,不再被版本号挡住;缺列时在 IMMEDIATE 事务里逐列补齐 - 标点在日期入口上收尾时按实际上屏的首条候选计数 - 五笔四码唯一自动上屏不计入;多段造词任一段非首位即不算命中 - 只有选词计数的日线不算打字日,不影响天数、日均与连续天数 - 卡片复用 formatFirstWordRatio 并展示累计命中率,概览复用 DailyRow::FirstWordRatio --------- Co-authored-by: fanlusky <1730976608@qq.com>
WebView messages
messages.json owns the message envelope, payload shape, and allowed sender windows.
Change it here, run python3 generate.py, and re-sync the copy under ui-html/ in the same
commit. The generated TypeScript union and embedded C++ schema must pass generate.py --check.
runtime.js and validator.h implement the documented schema subset and run the same
fixtures.json compatibility cases. The standalone CMake test requires Boost.JSON;
the input engine itself does not acquire that dependency.
New messages carry protocolVersion: 1. A missing version is accepted as legacy v1
for existing skins; an explicit unknown version, unknown message, invalid payload,
or message sent from the wrong window is rejected before dispatch. This is envelope
validation, not a replacement for domain checks such as dictionary key validation,
allowed configuration values, or the host's HTTPS URL policy.
ui-html/scripts/sync-contracts.py materializes these bindings into
ui-html/webview2/shared and checks byte equality; CI runs it with --check, which
now compares against this directory directly rather than against a pinned submodule.
Settings imports the typed serializer and checks incoming messages. Classic candidate,
toolbar and menu pages load the same runtime from the host's https://msime-contracts/
virtual mapping; packaging must include webview2/shared.
Server-to-page candidate rendering currently uses the existing view functions; this contract covers WebMessage actions and settings responses. Candidate view model ownership is documented separately from transport envelopes.