Commit Graph
623 Commits
Author SHA1 Message Date
Evan 8f190102d0 Merge pull request #199 from ouchihao/codex/fix-185-horizontal-translations
feat(server): show translations in horizontal candidate windows
2026-09-06 19:50:37 +09:00
Evan Hu 205cafa4f5 fix(skin): @import 剥离只匹配真正的 at-rule;补转义绕过的不变量说明与用例
自查时发现的两处。

**@import 匹配过宽会损坏合法皮肤。** 此前在任意位置匹配 `@import`,于是 `.a{content:"@import //x";color:red}` 会被从 `@` 切到该声明的分号,留下一个未闭合的字符串和一份坏掉的样式表——为了保护皮肤反而弄坏了一个本来没问题的皮肤。改成只在 at-rule 能出现的位置匹配:样式表开头,或 `;` / `}` 之后;并要求关键字后面不是字母数字,避免 `@importantthing` 被当成 `@import`。

**CSS 转义不是漏洞,但原因不显然,值得钉死。** 样式表可以写 `url("https:\/\/host/x.png")`,浏览器解转义后得到一个可用的远程 URL,而字面文本里没有 `://`,分类器给出的是 Embed 而不是 Drop。这是安全的,但安全性来自 Embed 能产出什么:要么把文件内联成 data: 负载,要么回退到 candidate-skins 虚拟主机下的 URL,两者都无法命名皮肤作者选定的 origin。转义过的 `..` 同理——它以字面转义文本的形式进入文件系统查找,不会穿越,也永远不会被写回文档。

也就是说,真正保护候选窗的不变量是「Embed 永不产出攻击者命名的 origin」,而不是「Drop 拦住了远程 URL 的每一种写法」。把这条写进头文件,并补一个用例钉住「转义写法永远不落到 Keep」——将来若有人改动 Embed 的回退逻辑让它原样输出 URL,这个洞会重新打开,用例会先失败。

本机以 -Wall -Wextra -Wpedantic -Werror + ASan/UBSan 编译运行 8/8 通过,portable 目标经 CMake + ctest 验证,clang-format 干净。
2026-09-06 19:33:39 +09:00
Ouchihao 3fc7ba295f feat(server): show translations in horizontal candidate windows 2026-09-06 18:09:01 +08:00
Evan Hu e645c9abaa fix(skin): 修复 GCC 下的符号比较告警与 clang-format
两处 CI 反馈:

towlower() 在 glibc 上返回 wint_t(无符号),与 wchar_t 比较触发 -Wsign-compare。macOS 上 wchar_t 是 32 位有符号、towlower 返回 int,所以本机以 -Wall -Wextra 编译不会告警。显式转回 wchar_t 再比较。

windows_webview2.cpp 里那处调用的换行不符合仓库的 clang-format 配置,按配置重排。

重新以 -Wall -Wextra -Wpedantic -Werror + ASan/UBSan 构建运行,6 个用例全过。
2026-09-06 18:28:30 +09:00
Evan Hu 1c25466511 test(ci): 给解析不可信输入的宿主无关代码加 ASan / UBSan
MSIME-Linux 的 ci.yml 注释里已经写下了这个结论:「前端层才是解析不可信输入的那层……Windows 前端上次审计修的就是一批 race 和空指针,现有的 Debug 构建一个都抓不到。」Linux 仓照这个结论补了 sanitizer job,Windows 仓一条都没有。

给整个 Server 上 sanitizer 意味着要在 Windows runner 上做一份带 sanitizer 的 Boost、curl、sqlite 和 WebView2,代价很高。这里换一个能立刻落地的做法:把宿主无关的解析与策略代码单独建成一个不依赖任何包管理器的小目标,在 Linux runner 上用 ASan + UBSan 跑,几秒钟完成,每个 PR 都跑。

覆盖面确实小于全量 sanitize 构建,但它是真的在跑。目标从皮肤 CSS 策略起步,后续凡是能与 Windows 头文件解耦的、读取用户没写过的数据的逻辑(词库文件、IPC 负载、配置解析)都可以加进这个列表。

该目标同时以 -Wall -Wextra -Wpedantic -Werror 编译,与 Linux、Apple 两仓的标准一致。本机已用 ASan+UBSan 构建并运行通过。
2026-09-06 18:11:37 +09:00
Evan Hu 87e842f6a3 build(windows): TSF、Server 与设置程序开启 /W4
/W4 已经是本仓的既有约定——ui/ 的五个 target 和 server/ 的四个辅助可执行文件都在用。漏掉的恰好是三个最大的:注入到 Chrome、QQ、Office 等宿主进程里的 TSF DLL,拥有全部网络调用、WebView2 宿主与皮肤加载的 Server 主进程,以及设置程序。这三个此前都跑在默认的 /W3 上。

暂不加 /WX:存量告警要先在 Windows 上读完并清掉,在那之前把告警变成错误只会逼出一堆 /wd 抑制。/permissive- 同样留到能在 Windows 上构建验证的后续改动,本次改动无法在本机编译验证这一项。
2026-09-06 18:11:37 +09:00
Evan Hu 680fdfa648 fix(skin): 丢弃第三方皮肤 CSS 里的远程引用,不再原样注入候选窗
皮肤是用户往 %LOCALAPPDATA%\metasequoiaime\skins 里丢的文件夹,是彻头彻尾的第三方内容,而它的 CSS 会被内联进候选窗文档。此前 IsRewritableSkinCssUrl() 对含 :// 的 URL 直接返回 false,而 false 分支把原始 url("…") 原封不动写回样式表——也就是说 `background-image: url(https://attacker/beacon.png)` 会在每一次候选窗渲染时向外发一个请求,泄露「此人此刻正在打字」以及 IP。这直接推翻了 PRIVACY.md 的 "Local conversion never contacts the network",而那句话是这个项目最强的信任资产。

问题出在这个判断只有两态:不可重写就等于放行。实际上有三类:

- Embed——皮肤包内的相对路径,读文件内联;
- Keep——本身就是惰性的 data: 负载和文档内 #fragment 引用,照原样保留;
- Drop——任何会让候选窗向皮肤包之外取数据的写法。丢掉 URL 后声明不完整,CSS 会整条丢弃,这正是想要的结果。

Drop 覆盖 http/https/ftp 等带 scheme 的、协议相对的 //host/x(不写 scheme 但照样出网)、路径穿越,以及会逃出皮肤包的绝对路径。

url() 不是唯一入口:`@import "https://…"` 根本不含 url() token,扫描器永远看不到它。补 StripRemoteImports() 做前置处理,只删远程 @import,本地的保留。

skin.preview 来自皮肤自己的 skin.toml,此前直接进 EmbedSkinCssUrl。现在同样过一遍分类,不因为它是通过 manifest 字段到达就被信任。

判断逻辑抽到 server/src/webview2/skin_css_policy.{h,cpp},不依赖任何 Windows API,配 6 个用例覆盖三类判定与两种 @import 写法。本机以 -Wall -Wextra 编译运行全部通过。
2026-09-06 18:05:09 +09:00
fanlusky 8544e74dc5 fix: Fix the position issue of the WebView2 candidate window when it touches the screen edge. 2026-09-06 14:59:19 +08:00
Evan 688972b28c Merge remote-tracking branch 'origin/main' into pr184-merge
# Conflicts:
#	server/src/session/input_session.h
2026-09-06 15:31:05 +09:00
Evan Hu ac805078e4 refactor(server): carry engine online queries through asynchronous candidate tasks 2026-09-06 13:24:03 +09:00
Evan Hu 9785ecd4bf fix(server): revalidate queued online candidate generations on apply 2026-09-06 13:17:50 +09:00
Evan b835131338 style: 格式化合并进来的 engine_input_session.cpp
main 上新合入的这一行不符合 server/.clang-format。这正是新增的格式检查要拦的东西——它在这次
合并里第一次生效就抓到了一处。
2026-09-06 13:07:28 +09:00
Evan Hu a533d5aa2b Merge remote-tracking branch 'origin/main' into chore/oss-hardening
# Conflicts:
#	AGENTS.md
2026-09-06 13:06:54 +09:00
Evan 42238a2af6 style: 用 .clang-format 重排 server / windows / ui / log
一次性重排,无任何行为改动。四个目录各自的 .clang-format 放在仓库里已久,但全组织只有
MSIME-Linux 在 CI 里执行 clang-format 检查,这边 149 个文件里有 149 个不符合自己声明的风格。

已逐文件核对语义等价:去掉空白、注释与相邻字符串字面量拆分之后,全部 149 个文件与重排前逐字节
相同。差异只有三类——缩进与换行、clang-format 补的 } // namespace 结尾注释、以及长字符串被拆成
相邻字面量(C++ 保证自动拼接)。

这个提交会写进 .git-blame-ignore-revs。
2026-09-06 12:13:47 +09:00
Evan f70f64acaa fix(ci,ui): 修掉 6 条 CodeQL high 告警,补上发布目标的祖先校验
- validate-draft-release.sh 增加「target_sha 必须在 main 历史上」的校验。此前有 write 权限的人可以
  建一个指向任意 commit 的 draft release 再 dispatch,那份代码就会被编译并签进正式安装包;唯一的
  祖先检查跑在 checkout 之后的不可信工作树里,而负责编译的 TSF job 根本没有这道检查。校验放在
  prepare(默认分支上下文)里,所有构建 job 都 needs 它。
- 字体名引用只转义了 `"` 没转义反斜线,以 `\` 结尾的字体名能吃掉闭合引号让后续内容按 CSS 解析。
  两处(appearance.ts、shared.ts)都改为先转义转义符。
- voice_input_service.cpp: float 平方先提升到 double
- engine-bump-triage.yml 顶层权限从 write 收到 read,写权限下放到 job;runner 与同仓其他 workflow
  统一为 ubuntu-24.04

新增 CONTRIBUTING.md,把散在各 AGENTS.md / 组件 README 里的环境要求、构建顺序、打包步骤和提交前
检查串成外部贡献者能照着走完的一条路径,并从 README 首屏链出。
2026-09-06 12:09:50 +09:00
Evan 4fc16952b3 wip(windows): 补齐隐私与许可交付,修好外部人的构建入口
- 新增 PRIVACY.md:逐项写明每个联网端点、发送内容、默认开关与关闭方式,明确云候选默认开启、
  token 在 config.toml 明文存储、无任何遥测
- 设置页「用户协议」「隐私政策」两个无 handler 的死按钮接上;前者改名为「开源许可协议」指向
  LICENSE,开源产品的用户条款就是许可证本身,不再承诺一份不存在的 EULA
- 安装包随包装入 GPL 正文并在安装向导显示(GPLv3 §4/§6),补上打包测试断言
- release.yml 增加 build provenance attestation,并在发布后向 MSIME-Web 发 repository_dispatch,
  让 msime.app/update.json 不再等两小时一次的 cron
- 所有 CMakePresets 的 vcpkg 路径改用 $env{VCPKG_ROOT},server 的 Boost 回退不再指向个人目录
- ui/README.md 指向本机绝对路径的 markdown 死链改成相对链接
- 新增 check-developer-paths.sh 并接入 required 的 quality 检查,防止路径回潮
- docs/installation.md 不再写死版本号
2026-09-06 12:05:06 +09:00
Evan 6341b4fffc fix(server): 出厂配置的占位凭据不再被当作真凭据
IsPlaceholderToken 与 IsUsableSecret 都只识别 `<YOUR_OWN_` 前缀,而 config.default.toml 实际使用
`<YOUR_XXX>` 和 `FAKESECRET_` 两种写法,18 个占位符无一被识别。叠加 ai_assistant.enabled、
voice_input.voice_input、tencent_tmt.enabled 三项默认为 true,全新安装在用户未做任何配置的情况下
就会把输入串发往 api.deepseek.com、把候选文本发往 tmt.tencentcloudapi.com——请求虽然鉴权失败,
内容已经离开本机。

两处判定改为按占位符的形状判断,并新增 test_default_config_credentials:它直接读安装器实际打包的
config.default.toml,逐条校验没有任何凭据被当成可用值,因此换一种占位符写法也会被拦下。
2026-09-06 11:56:11 +09:00
Evan 2b8bf937d9 fix(server): adopt isolated engine sessions and helpcode annotations (#178) 2026-09-06 11:44:30 +09:00
Evan 2562026a2a fix: 修复审计发现的候选页竞态、管道权限、TSF 空指针与皮肤 CSS 逃逸等八项缺陷 (#169)
* fix(server): publish candidate pages as immutable snapshots

Global::candidate_ui is a plain global with no lock. The IPC worker rebuilds and destroys its vectors while the UI thread paints from them, and the handoff is an asynchronous PostMessage, so the worker returns to its loop and pops the next task without waiting. A second keystroke, or an async english.db candidate arrival, could free the page_views buffer and its strings while FillItemsFromUi held a reference into it. ShowItemContextMenu reads the same vectors from a mouse callback with no message handoff at all.

The worker now copies each finished page into an immutable snapshot and publishes it at the single point where the rebuild completes; every UI-thread reader loads that snapshot once and reads only its own copy. PostMessage is deliberately left alone: the worker also serves UI-originated tasks, so a synchronous handoff would invite a cross-thread deadlock.

* fix(server): bound the aux and diagnostic pipe reads

Both listeners serve a single pipe instance inline and polled a NOWAIT handle for as long as the process ran, breaking only on a read that succeeded or failed with something other than ERROR_NO_DATA. A client that connected and never wrote held the only instance forever, so the loop never returned to ConnectNamedPipe and no later client was accepted, permanently losing the langbar right-click channel and the terminal-deactivation teardown fallback.

Give both loops the same deadline the hello reads already use and go back to accepting when it expires.

* fix(server): snapshot the voice config and replace config.toml atomically

GetConfiguredVoiceInput handed out a reference to a global that LoadImeConfig rewrites from the IPC worker thread, clearing and refilling two std::map members and around twenty strings. The voice control thread and the low-level keyboard hook, which copies the struct on every keystroke, walked those nodes as they were freed. LoadImeConfig now parses into a local and publishes it in one step under a process-local shared_mutex, and the getter returns a snapshot by value. The file lock is deliberately not reused for readers: it is a named cross-process mutex with a five second wait, and taking it in a keyboard hook would stall typing system-wide.

WriteConfiguredValue also reopened the live config.toml with ios::trunc, so a crash mid-write destroyed the user settings and could leave the file unparseable for good. It now goes through WriteFileTextAtomically, which this file already uses elsewhere. That makes the directory entry swap atomic; it does not flush, so it is not a durability guarantee.

* fix(ipc): restrict the server pipes to the owning account

The pipe DACL granted Everyone FILE_ALL_ACCESS. That bit set includes FILE_CREATE_PIPE_INSTANCE, so any local account could add an instance to a name this server already owned and answer part of the connections in its place. The names are machine-global with no per-user component, and the TSF client opened them with no SQOS, so a squatter could also impersonate the connecting thread.

Build the descriptor from the process owner SID and admit only LocalSystem, that account, and app containers with connect-only rights so UWP text input still works; fail pipe creation outright when the SID cannot be resolved rather than falling back to something permissive. Pass FILE_FLAG_FIRST_PIPE_INSTANCE on the first instance of each name so a squatted name fails loudly, and request SECURITY_IDENTIFICATION on the client side.

Authenticating the peer process after connect is a larger change to the handshake and is not attempted here.

* fix(tsf): guard the null focus paths and unadvise the compartment sink

_CandidateChangeNotification treated ITfThreadMgr::GetFocus and ITfDocumentMgr::GetTop as if they could only fail through a FAILED HRESULT. Both return S_OK with a null out-pointer when nothing has focus or the document stack is empty, and the results were dereferenced unconditionally, so an external UILess host calling Finalize while focus moved away crashed the host application. The sibling _RequestCancelComposition in the same class already checks both.

CLangBarItemButton::CleanUp only unregistered the compartment inside the SUCCEEDED branch of a CoCreateInstance, then deleted the sink regardless. This TIP registers COM-less activation support, where that call does fail, and the sink was freed while TSF still held it advised. Unadvising never needed the thread manager, so it now runs unconditionally before the deletes.

* fix(ui): drop the cached visuals when the scene is replaced

Window caches focused, hovered and captured Visual pointers into the scene tree, and SetScene destroyed that tree without clearing them. Toggling the input mode rebuilds the floating toolbar scene, so the next mouse move dispatched a virtual call through a freed object.

Clear all three before the assignment, and release the capture only when this window actually holds it: an adopted HWND may never have called SetCapture, and capturedVisual_ is set even when it did not.

* fix(settings): scope external skin CSS through the CSS parser

injectScopedSkinCss concatenated a skin toolbar.css into an @scope block as text. Block nesting is textual, so a leading close brace in the skin ended the block early and the rest styled the whole settings window. The host validates only the skin file name, never the body, and candidatePreviewCss interpolated unvalidated colour strings into rule bodies the same way.

Create the scope rule empty and re-insert every rule parsed out of the skin as a child of it, so nothing lands outside however the braces are balanced, and accept a colour only in the plain notations we actually render.

* fix(release): gate the dictionary source commit on its default branch

verify_published iterated only data["repositories"], but the dictionary block pins a source_commit exactly like they do. The manifest check merely proves the release agrees with the lock about that commit, which a branch commit satisfies just as happily, so a dictionary built from an unmerged branch shipped with the provenance the gate exists to refuse.

Run the dictionary through the same loop under its own name, resolving its repository from the lock. A retired dictionary repository that no longer answers is reported rather than failing the release: its published artifacts are immutable history, and being unable to re-check them is not the same as finding them unmerged.
2026-09-06 10:31:48 +09:00
Evan Hu 807a098f33 docs(server): 补齐合仓后的隔离开发数据和页面准备 2026-09-06 09:42:53 +09:00
Evan Hu 0baaf9a1d0 fix(server): 将本地测试入口接回合仓后的主工程 2026-09-06 09:40:36 +09:00
Evan Hu 98a5e590c2 test(build): verify manifest arguments and stop on embedding failure 2026-09-06 09:02:13 +09:00
Evan Hu b2d736cd79 fix(build): finish local tooling migration to the monorepo 2026-09-06 09:02:13 +09:00
Evan Hu eca353daed fix(server): include the shared voice error declaration 2026-09-06 04:47:04 +09:00
Evan Hu 8b5205db96 chore(server): pin merged shared voice provider implementation 2026-09-06 04:37:29 +09:00
Evan Hu cf872efc52 refactor(server): share batch voice encoding and provider codecs 2026-09-06 04:35:40 +09:00
Evan Hu 5f8d75d79e fix(installer): use Engine tables in the local monorepo layout 2026-09-06 04:16:19 +09:00
Evan Hu c3fcc4a515 refactor(product): consume the consolidated Engine data and shared voice capture
Ports metasequoiaime/MSIME-Windows#153 onto the consolidated repository. That pull request was written against the six-repository layout: it edited product-ci.yml, which no longer exists, and re-pinned Server, UiHtml and Installer, which are directories now.

Three of its pinned commits had not reached this repository at all. The consolidation took each source repository at its main, and Server, UiHtml and Installer each landed two more commits afterwards, so dropping the pins as merely obsolete would have silently dropped the work the pull request exists to consume. The two substantive ones are ported here: Server drops its vendored miniaudio.h and builds against the engine's MetasequoiaIme::VoiceCapture, and the installer collects helpcodes from the engine. UiHtml's was an engine gitlink bump, which one submodule resolves on its own.

The engine is pinned to d0dc0c2b rather than to the b7c799ef that pull request named. b7c799ef predates 403b4a4d, which is what this repository pins today and is the commit that added pagination to the settings dictionary contract, so taking the pull request's pin verbatim would have reverted a contract main already depends on and stripped offset, limit and hasMore back out of the generated web bindings. d0dc0c2b is the engine's main and is the same commit the dictionary release declares as its source, so the code and the data now name one commit.

The helpcodes moved into the engine, so MSIME-HelpCode stops being a product input: the gitlink that pins the contracts pins the tables too. product-lock.json is down to the engine and the dictionary release, and the dictionary itself now ships from MSIME-Engine. Its manifest states which commit built the data and whether that tree was clean, and the lock verifies both, so matching digests can no longer stand in for a source nobody can rebuild from. The retired MSIME-Dict repository stays valid for the one tag that shipped from it and nothing else.

The release job that packages now checks out submodules, because the helpcodes it collects live in one.
2026-09-06 04:13:04 +09:00
Evan Hu 9a9c6f328f fix(server): always answer explicit settings snapshot requests 2026-09-06 03:32:54 +09:00
Evan Hu 06bba15d4f fix(server): keep settings I/O off UI thread and bound dictionary rendering 2026-09-06 03:31:40 +09:00
Evan Hu b5d07f11eb fix(server): reduce WebView message and first-paint overhead 2026-09-06 03:05:36 +09:00
Evan Hu ecc1bf4f6b fix(server): point the panel resources at the ui component
The emoji, keyboard and handwriting panels embed the GUI framework's icon through a relative path that was written when msimeui was a submodule under server/. It now lives one level further out, at the repository root.

Found by the resource compiler rather than by the sweep that moved the submodules: that sweep matched CMake, JSON, PowerShell, Python, shell and YAML by extension, and .rc was not on the list. Re-checked by resolving every relative path literal in every tracked file regardless of extension; these three were the only ones left that did not resolve.
2026-09-06 03:04:00 +09:00
Evan Hu 05036a763d docs: describe one repository instead of six
The product README was under windows/ after the move, but it was never a component readme: it is the download page, the feature guide and the contribution guide for the whole product, so it goes back to the root and windows/ gets a real component readme.

AGENTS.md at the root now carries the repository map, the component boundaries that used to be cross-repository rules, and the release process, since the scripts that process drives live at the root. The component files keep what is genuinely theirs and say which paths they are relative to. References that named sibling repositories now name sibling directories, and the lock documentation records that Server, the pages, the GUI framework and the installer are no longer inputs to pin.
2026-09-06 02:40:51 +09:00
Evan Hu 32e722c176 ci: build every component from the one checkout
The product lock existed because five repositories had to be pinned to reproduce one product. Four of them are directories now, so a commit of this repository already pins them and there is nothing left for the lock to say about them. What it still records is what the product consumes from outside: the engine submodule, the helpcodes and the dictionary release.

CI gains a job per component instead of a reusable workflow that checked out locked commits and rebuilt them. The release workflow no longer stages five sibling checkouts under historical names and no longer carries a second sparse checkout for its own scripts; Prepare-PackageFiles.ps1 already took the source directory names as parameters, so it is told the new ones, plus where the product-wide notice now lives.

Two checks the removed cross-repository pins used to provide are replaced in kind: the pages are verified against the engine submodule's web contract in CI rather than by locking UiHtml and Engine together, and the engine bump triage that Server carried moves here and now also says so when a bump leaves the lock behind.
2026-09-06 02:35:49 +09:00
Evan Hu 373f8d1473 refactor: collapse the duplicated submodules into one vendor/ directory
Windows, Server and UiHtml each carried their own gitlink to MSIME-Engine, all three pinned to the same commit, and Server carried a gitlink to MSIME-UI that is now the ui/ component. Git only reads the root .gitmodules, so the nested ones had to go regardless.

The engine and the two third-party dependencies now live once at vendor/MetasequoiaImeEngine, vendor/opencc and vendor/cpp-pinyin. Server reaches them through MSIME_VENDOR_DIR and builds ui/ as an out-of-tree subdirectory; the Windows tip's relative contract includes gained the extra level; the ui-html contract sync and the Server env/table generators follow the engine to its new location.
2026-09-06 02:27:52 +09:00
Evan b035527874 Merge pull request #33 from metasequoiaime/architecture/product-contracts
refactor(session): share input composition and candidate presentation
2026-09-06 01:53:01 +09:00
Evan Hu 0c734891a1 chore(deps): pin verified partial-composition flush semantics 2026-09-06 01:34:33 +09:00
Evan Hu 984870ea29 chore(deps): pin the shared portable composition contract 2026-09-06 01:30:06 +09:00
Evan Hu 920a4bf4e9 fix(build): keep standalone GUI tests out of the Server test registry 2026-09-06 01:05:44 +09:00
Evan Hu 0f1ffb4343 fix(clipboard): do not truncate a clipboard entry mid surrogate pair
NormalizeClipboardText caps an entry at kMaxChars with text.resize(). wchar_t is UTF-16 on Windows, so that cap counts code units, and a cut landing between a high and low surrogate leaves a lone high surrogate. The result is not valid UTF-16, and it is what gets serialised into the history store and read back.

It takes a non-BMP character — an emoji, or a supplementary-plane Han character, both of which this IME can produce — sitting exactly at the boundary. The entry then carries an unpaired surrogate for as long as it stays in the history.

The cut now steps back one unit when it would split a pair, dropping the incomplete character instead of half of it. Entries that do not end on a surrogate are unaffected.

MSIME-Linux does not have this: its normalize() truncates with g_utf8_offset_to_pointer, which is codepoint aware. The two implementations otherwise agree exactly, including kMaxItems, kMaxChars and the promote-to-front policy.
2026-09-06 01:03:50 +09:00
Evan Hu 25291459a0 chore(deps): pin final shared contracts and GUI boundary checks 2026-09-06 00:46:23 +09:00
Evan Hu 8e54b79547 merge(main): retain direct shared local-mode calls and remove legacy adapters 2026-09-06 00:27:39 +09:00
Evan Hu 6783ff7175 refactor(session): use shared composition and local queries with one candidate view model 2026-09-06 00:26:38 +09:00
Evan 61ef53a855 Merge pull request #32 from metasequoiaime/chore/remove-unbuilt-candidate-window
Remove the Direct2D candidate window that nothing builds
2026-09-06 00:00:56 +09:00
Evan Hu 6425044435 chore: remove the Direct2D candidate window that nothing builds
src/d2d/candidate_window_d2d.{cpp,h} is 528 lines that no target compiles: it appears in no add_executable source list in CMakeLists.txt, and nothing outside the directory names candidate_window_d2d or CandidateWindowD2D. The d2d1 in CMakeLists.txt is the Windows system library, not this directory. It was last modified on 2025-06-25.

It is an earlier candidate window, superseded twice over: the shipped candidate window is the WebView2 page from MSIME-UiHtml, and the native GUI work now lives in the msimeui framework. Keeping a third, unbuilt implementation in the tree means every candidate window change invites the question of whether this one needs the same fix, and the answer is always no because it never runs.

The history keeps it if the Direct2D drawing is ever wanted as a reference.
2026-09-05 23:42:32 +09:00
Evan Hu 60fce0f043 Merge branch main into feat/generic-pinyin-order-correction
唯一冲突是 engine 子模块指针,取 main 的当前值(其中已含本 PR 依赖的
MSIME-Engine#1,以及后续的 #20 门控修复)。
2026-09-05 23:34:30 +09:00
Evan 6ba26c3baf Merge pull request #30 from metasequoiaime/architecture/product-contracts
Use shared IPC definitions and negotiate main client sessions
2026-09-05 23:23:03 +09:00
Evan Hu 3c24076fad feat(webview): validate shared message contracts before native dispatch 2026-09-05 23:07:50 +09:00
Evan Hu 8a36ee264a test(quanpin): expect four-syllable alternatives and bound them at five
The engine pin moved 55839c8 -> 127019f in the previous commit, and that range contains 86c5fa7 "fix(quanpin): enumerate alternative segmentations for four-syllable input". QuanpinDictionaryOnlyTriesMultipleSegmentationsForAtMostThreeSyllables asserted the behaviour that fix deliberately changed, so it failed here and, through the product lock, in MSIME-Windows' locked-Server integration job as well.

The engine is the authoritative layer: quanpin/quanpin_dictionary.cpp declares kMaxSyllablesForMultipleSegmentations = 4 and gates enumeration on segments.size() <= that. Four syllables now enumerate alternatives; five still do not. The test says exactly that, with a tbl_6_x fixture row so the five-syllable case would have something to find if the bound ever moved silently.
2026-09-05 23:00:52 +09:00
Evan Hu 0d1831db2c chore: point the engine submodule at main with the autocorrect fix
MSIME-Engine#20 修复了 #1 引入的 autocorrect 门控回归,本仓的
QuanpinDictionaryAutocorrectDisabledKeepsLegacyBehavior 因此可以通过。
2026-09-05 22:51:54 +09:00