diff --git a/docs/evidence/m5-approved-terms-host-verification.md b/docs/evidence/m5-approved-terms-host-verification.md index 1253a10..c299915 100644 --- a/docs/evidence/m5-approved-terms-host-verification.md +++ b/docs/evidence/m5-approved-terms-host-verification.md @@ -18,16 +18,15 @@ desktop with the installed `0.5.4-preview` package (in-place upgraded from → real dictionary restored byte-identical (SHA-256 verified) ``` -The remaining open step is narrower than before: with the ContextIME profile -active and the 0.5.4 server freshly restarted, typing `ceshishuyu` in the -target editor and committing `CeShiShuYu 〔项目·术语〕` still needs one -interactive observation. The first attempts were invalidated by a dead -ContextIME TSF server (fail-open English passthrough mistaken for -composition), which was diagnosed and fixed during the session. +The complete candidate path was then verified end to end on the installed +package: a fresh smoke workspace was ingested by the real Adapter, the +user-approved term was injected through the bounded `CIPM` `UPSERT_TERM` +op while the workspace lease was live, and the app-smoke observed the +candidate window and committed the term inside a TypeScript comment. ```text M5.5_MANAGEMENT_PATH_INSTALLED = VERIFIED -M5.5_INSTALLED_CANDIDATE_ACCEPTANCE = REAL_WINDOWS_VERIFICATION_REQUIRED +M5.5_INSTALLED_CANDIDATE_ACCEPTANCE = VERIFIED ``` ## Fixed product and build @@ -82,34 +81,63 @@ rebooted; the `0.5.3-preview` install leaf was replaced by smoke confirms the ContextIME profile activates (`ProfileActivationHResult = 0x0`). -## Not completed in this session - -- **Candidate commit observation.** Typing `ceshishuyu` under the active - ContextIME profile with the workspace lease live and committing - `CeShiShuYu 〔项目·术语〕` still requires one interactive desktop check. - The session was interrupted twice for safety: first because the user moved - into a full-screen RDP session (synthetic keys could reach the remote - machine), then again for the same reason. The manual-term record is - already persisted in the target project dictionary, so the remaining step - is a single typing observation on a free desktop. - - Additional diagnoses collected for that final pass: - - - The driver tooling must send virtual-key events (the app-smoke - `TypeAscii` approach); `KEYEVENTF_UNICODE`-style text injection bypasses - the IME pipeline entirely and always produces raw text, which invalidated - several early observations. - - The TSF smoke confirms ContextIME composition, candidates, and commit - work end-to-end in its own window (`shurufa → 输入法`, `Passed = true`) - after the server restart, so the server-side pipeline is healthy. - - VS Code typing stayed raw even with virtual-key events, including inside - a real `//` comment line. The editor-context decision mapping - (`Comment → Chinese`) exists in the Context Service, but the M3 - "real TSF automatic switching" loop has never been verified on a real - desktop (`REAL_WINDOWS_VERIFICATION_REQUIRED` from M3), so the comment - context may not be applied to the live session yet. The next pass should - either confirm the automatic comment switch or force Chinese mode - manually before typing. +## Installed candidate acceptance (final pass) + +The `vscode-project-candidate` app-smoke scenario was run against the +installed 0.5.4 package with `--input ceshishuyu --expected CeShiShuYu`: + +```text +smoke workspace (isolated VS Code + report-only 0.5.0 adapter) + → Language Server symbols ingested (b816-style fresh project) + → CIPM UPSERT_TERM "CeShiShuYu" while the lease was live + → persisted as term/manual with server-owned last_seen + → smoke waits for the persisted symbol, then types in the comment + → candidate window: 1. CeShiShuYu 〔项目·术语〕 + → space commits; editor ends with "// CeShiShuYu" +``` + +Evidence (artifacts of this session): + +- Evidence JSON: `Passed = true`, `CandidateWindowDetected = true` + (91,899 changed pixels), `ProjectCandidateCommitMatched = true`, + final editor text ends with `// CeShiShuYu`; +- Candidate screenshot: the first candidate is + `CeShiShuYu 〔项目·术语〕` followed by ordinary librime candidates + (测试属于 / 测试 / 侧室 / 侧视); +- `m55-installed-acceptance2.json` and + `m55-installed-acceptance2.json.project-candidate.png` under + `artifacts/contextime-0.5.4-staged/`. + +Two test-harness changes were required and are part of this change set: + +- The app-smoke dictionary wait was hard-coded to + ` language_server `; it now also accepts + ` manual ` so user-approved terms can drive the scenario. +- The term was delivered through a minimal CIPM client (the same bounded + frame the manager uses) while the lease was live; the UPSERT_TERM publish + path then propagated the snapshot to the candidate transport within the + 500 ms worker fetch. + +All test workspaces and their dictionaries were removed afterwards through +CIPM `REMOVE_PROJECT`; only the user's real dictionary +(`e37d5123…`, SHA-256 unchanged) remains. + +## Session diagnostics (recorded for future work) + +- The ContextIME TSF server died repeatedly during this session. Each + `/nascii` "hang" was actually a command child becoming a replacement + server (the running instance was not found); the smoke's 5-second timeout + then killed that fresh server. After the final clean start the server + stayed healthy, but the instance-discovery failure behind the hang is + worth investigating. +- `KEYEVENTF_UNICODE`-style text injection bypasses the IME pipeline + entirely and always yields raw text; drivers must send virtual-key events + (the app-smoke `TypeAscii` approach). +- VS Code typing stayed raw even with virtual keys while the editor context + pipeline was not feeding decisions; the M3 "real TSF automatic switching" + loop (comment → Chinese) has never been verified on a real desktop + (`REAL_WINDOWS_VERIFICATION_REQUIRED` from M3). The M5.3-era manual force + (`/nascii`) plus the manual-origin guard remains the working path. - **Installer reboot behavior.** The NSIS script sets `SetRebootFlag true` unconditionally on the upgrade path, which forced the reboot the user experienced after installing 0.5.4. Recorded as a 0.5.5 installer task: diff --git a/docs/roadmap.md b/docs/roadmap.md index 35a8cd7..c7b9850 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -303,7 +303,8 @@ M4.2 设计:[`docs/vscode-adapter.md`](vscode-adapter.md)。验证证据:[`d - [x] 提供词库查看、删除和禁用。 - [x] M5.3 在候选窗口以 `〔项目·类型〕` 标记项目候选来源。 - [x] M5.5 手动术语写入项目词库与管理入口(真机验证)。 -- [ ] M5.5 手动术语候选上屏安装版验收;资源名等待后续有界 source。 +- [x] M5.5 手动术语候选上屏安装版验收。 +- [ ] 资源名等待后续有界 source。 - [x] M5.2 协议不承载或保存完整源码、URI、workspace 路径、range、detail、container、Token 或环境变量值。 - [x] 大项目索引不阻塞输入。 @@ -371,9 +372,11 @@ M5.5 用户批准术语当前边界: - active-project snapshot 发布过滤器从仅 `language_server` 扩展为 `language_server + manual`,手动术语沿 M5.3 桥接进入候选并显示 `〔项目·术语〕`; - 中文词语当前不会由拼音前缀命中(需后续 pinyin 标注);`UPSERT_TERM` 不能创建不存在的项目词库; - CI 证据:见 `docs/evidence/m5-approved-terms-ci.md`(私有仓库 Actions 因账单暂停,构建与测试由 ContextIME-public 镜像 CI 完成); -- `0.5.4-preview` 已由用户完成覆盖安装并重启;登录桌面上已验证:真实 Adapter 采集进安装版服务(同一工作区路径得到同一匿名 ID)、管理器添加术语落盘 `term/manual`、管理器删除词条把被误加术语的真实词库恢复到字节级一致(SHA-256 前后相同)、整库删除回归通过;证据见 `docs/evidence/m5-approved-terms-host-verification.md`; -- 会话中诊断出早前"无候选"观察的根因:ContextIME TSF Server 在 smoke 超时处理中被误杀后,TSF fail-open 英文直传被误读为组合输入;重启安装版 0.5.4 Server 并完成部署后档案激活恢复正常; -- 安装版候选上屏验收(输入拼音、提交 `〔项目·术语〕` 候选)只剩一次交互观察:因用户转入全屏 RDP 会话,合成按键有打进远程机器的风险,本轮刻意中止;`M5.5_INSTALLED_CANDIDATE_ACCEPTANCE = REAL_WINDOWS_VERIFICATION_REQUIRED`。 +- `0.5.4-preview` 已由用户完成覆盖安装并重启;登录桌面上已验证:真实 Adapter 采集进安装版服务(同一工作区路径得到同一匿名 ID)、管理器添加术语落盘 `term/manual`、管理器删除词条把被误加术语的真实词库恢复到字节级一致(SHA-256 前后相同)、整库删除回归通过; +- **安装版候选上屏验收已通过**:隔离 smoke 工作区由真实 Adapter 采集后,租约活跃期间经 CIPM `UPSERT_TERM` 注入 `CeShiShuYu`,app-smoke 在 TypeScript 注释行输入拼音,候选窗口第一项为 `CeShiShuYu 〔项目·术语〕`,空格上屏后编辑器以 `// CeShiShuYu` 结尾(91,899 像素候选窗变化 + 截图证据);smoke 的词库等待谓词同步演进为同时接受 `language_server` 与 `manual` 来源;测试工作区与词库已全部经 CIPM `REMOVE_PROJECT` 清理; +- 会话中诊断出早前"无候选"观察的根因链:ContextIME TSF Server 被 smoke 超时逻辑反复误杀(`/nascii` 子进程在实例发现失败时会变成新 Server,被超时逻辑击杀)、UNICODE 直插字符天然绕过 IME 管线、M3 注释→中文自动切换仍是未验证欠账(本次通过 M5.3 时代的手动强制中文路径完成验收); +- 证据:`docs/evidence/m5-approved-terms-host-verification.md`;状态:`M5.5_INSTALLED_CANDIDATE_ACCEPTANCE = VERIFIED`; +- 安装器强制重启问题(升级路径无条件 `SetRebootFlag true`)记录为 0.5.5 任务:改为显式提示并评估免重启升级。 ## M6:个人习惯 diff --git a/native/tests/app-smoke/ContextIMEAppSmoke.cs b/native/tests/app-smoke/ContextIMEAppSmoke.cs index 85e465c..83063ba 100644 --- a/native/tests/app-smoke/ContextIMEAppSmoke.cs +++ b/native/tests/app-smoke/ContextIMEAppSmoke.cs @@ -679,7 +679,8 @@ private static bool WaitForDictionarySymbol( if (File.Exists(path)) { string content = File.ReadAllText(path, Encoding.UTF8); - if (content.IndexOf("\tlanguage_server\t" + symbolHex, StringComparison.Ordinal) >= 0) + if (content.IndexOf("\tlanguage_server\t" + symbolHex, StringComparison.Ordinal) >= 0 || + content.IndexOf("\tmanual\t" + symbolHex, StringComparison.Ordinal) >= 0) { elapsedMilliseconds = clock.ElapsedMilliseconds; return true;