diff --git a/.gitattributes b/.gitattributes
index d80940da..adeb3c3b 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -5,3 +5,6 @@
*.py text eol=lf
*.ps1 text eol=crlf
experiments/core/fixtures/*.bin binary
+# Preserve upstream license bytes and unified-diff context prefixes.
+research/msys-runtime-window-prefix/CYGWIN_LICENSE whitespace=-blank-at-eol,-blank-at-eof
+research/msys-runtime-window-prefix/window-prefix.patch whitespace=-blank-at-eol,-space-before-tab
diff --git a/docs/EVIDENCE.md b/docs/EVIDENCE.md
index eca30d7e..667fc374 100644
--- a/docs/EVIDENCE.md
+++ b/docs/EVIDENCE.md
@@ -10,7 +10,7 @@
|---|---|
| main 默认:自研核心 + 系统 ConPTY | R1 限定总验收和有限 VT/Unicode 子集;默认构建不需要 Rust |
| main 显式候选:`termforge.4` + 系统 ConPTY | [固定来源/补丁台账](../experiments/candidates/alacritty/PROVENANCE.md)、[适配边界](../experiments/core/CANDIDATE.md)、[#39 字素合同](research/streaming-graphemes.md);仅按已有合同验收 |
-| PR #50 实验:`termforge.5` + 固定官方 ConPTY | [Draft PR](https://github.com/JavaZeroo/termforge/pull/50) / [#47](https://github.com/JavaZeroo/termforge/issues/47);旧`.4`的[联合基线](research/joint-conpty-baseline.md)保留。#51/#53/#87/#88各自限定交付见下表;最新完整官方56/57,#52仍失败,MSYS输入边界仅为诊断;#63已复现工作区路径的因果核验及完整shell通过见下表;更早缺运输样本保留未知。当前能力以[FEATURES](FEATURES.md)为准 |
+| PR #50 实验:`termforge.5` + 固定官方 ConPTY | [Draft PR](https://github.com/JavaZeroo/termforge/pull/50) / [#47](https://github.com/JavaZeroo/termforge/issues/47);旧`.4`的[联合基线](research/joint-conpty-baseline.md)保留。#51/#53/#87/#88各自限定交付见下表;最新完整官方56/57,#52原固定运行库仍失败,MSYS输入边界与隔离运行库修补结果分列;#63已复现工作区路径的因果核验及完整shell通过见下表;更早缺运输样本保留未知。当前能力以[FEATURES](FEATURES.md)为准 |
R1 固定总出口的源码为 `ce9b24d`,早期 `2dc8d6d` / `9b16acc` 仍分别只代表原记录。源 VT、原生控制台 CHAR_INFO、transport、末端状态、自有 DIB、绘制提交和真实呈现是不同检查点;未知端点保持未知。
@@ -57,6 +57,7 @@ R1 固定总出口的源码为 `ce9b24d`,早期 `2dc8d6d` / `9b16acc` 仍分
| Native Vim 捕获目录隔离 | [原因与复验](research/vim-fixture-isolation.md)、[固定原件审计](../experiments/conpty/results/2026-10-26-vim-fixture-isolation/validation.json) | 实验分支同旧 EXE 的兄弟运行一绿一红;修正新目录隔离后完整模块9/9。仅闭合 #52 native 夹具原因;GUI stage59 仍开放,未知与受扰动探针分列。 |
| 工作区尺寸标记残尾(#63) | [原因与复验](research/workspace-native-viewport.md)、[单变量/原生/回放及无插桩验收](../experiments/shell/results/2026-10-27-workspace-native-viewport/validation.json) | 旧原三轮UI/main第三轮各红;同EXE仅切策略分别原红/绿,原生尺寸和标记正确、底部核心残尾。现有#51修复覆盖;无插桩原三轮各重复两批、完整shell37通过/3原skip、93.62秒,#52和完整R2仍未验收。 |
| GUI Vim/MSYS 输入边界(#52) | [运行时边界与限制](research/vim-msys-input-boundary.md)、[白名单事件与身份](../experiments/shell/results/2026-10-27-vim-msys-input/validation.json) | 两轮API级原失败、一轮诊断绿及一轮函数边界原失败:完整93 B到达原生输入,红例MSYS仅交付92 B;resize旧快照清理取走Ctrl-O的调用顺序已捕获。无截断、Job0/desktopgone;未修产品、未替换固定应用,#52继续开放。 |
+| GUI Vim/MSYS 隔离运行库补丁(#52) | [实验与限制](research/vim-msys-runtime-prototype.md)、[许可与补丁](../research/msys-runtime-window-prefix/README.md)、[七轮白名单记录](../experiments/shell/results/2026-10-27-vim-msys-runtime-prototype/validation.json) | 原 DLL 两轮一绿一 stage59,未修重建 DLL 首轮 stage59;只调整 resize 前缀消费的重建 DLL 两批共四轮原方法通过,七轮均完整回收。无新 API/加载模块轨迹,未验证鼠标/实际 longjmp 或完整 CTest;正式固定运行库验收、兼容策略及 #52 保持开放。 |
| 原生 viewport resize 与默认策略隔离(#51) | [原因与复现](research/native-viewport-resize.md)、[固定验证及六组合成原件](../experiments/conpty/results/2026-10-27-native-viewport-resize/validation.json) | 原 `.4` GUI stage43 与独立 native/replay 红;`.5` 原 resize/Unicode、历史/空格复制、六组 native 对照通过。默认策略填充误判经实际红绿修复;最终完整回归 54/56、12 项内部 skip,#52/#88 及此前 #87 的失败独立保留,不计完整后端或 WindTerm 等价。 |
| 窄列命令回显与恢复完成(#88) | [独立判据合同](research/workspace-restore-transport-oracle.md)、[原件哈希/红绿/正式两轮验证](../experiments/shell/results/2026-10-27-workspace-echo-cr/validation.json) | 原 262 B cmd 运输中的回显裸 CR 使完成判据提前拒绝;修正仅使该记录保持不可信至真实 LF。原两轮保存/普通恢复/钳制及完整 shell 通过;官方完整回归 55/56、8 项内部 skip,#52 当时仍红,#63/#87 旧因未闭合(#87 后续见下一行)。构建重叠结果明确排除。 |
| 替换会话完整记录检查点(#87) | [机制、因果与边界](research/workflow-record-checkpoint.md)、[固定源码及原两轮验证](../experiments/shell/results/2026-10-27-workflow-record-checkpoint/validation.json) | 旧判据在真实消费半行时采样而红,同 session 后续字节补齐;被动等待方案因输出结束而红。默认关闭的有界 LF 检查点受控通过,最终 c662011 两轮原八会话及关闭 guard 通过;完整官方 56/57、8 项内部 skip,Vim59 仍红。历史两份 native 后续缺口、诊断 trace 截断及未复现分别保留。 |
diff --git a/docs/FEATURES.md b/docs/FEATURES.md
index 5be241e4..681b95ec 100644
--- a/docs/FEATURES.md
+++ b/docs/FEATURES.md
@@ -14,7 +14,7 @@
|---|---|---|
| 默认 main:自研核心 + 系统 ConPTY | 默认构建与已发布 Alpha 的基础路线,不需要 Rust | 已有 R1 限定验收;VT/Unicode 能力仍为有限子集,不能引用候选核心的字素或 TUI 结果 |
| 显式候选 main:`termforge.4` + 系统 ConPTY | `TERMFORGE_BUILD_CANDIDATE_ADAPTER=ON`;按 [ADR-0003](adr/0003-core-reference-and-reuse.md)保留为可评估实验,正式核心选型待用户确认 | [固定来源](../experiments/candidates/alacritty/PROVENANCE.md)、[适配边界](../experiments/core/CANDIDATE.md)与 [#39 字素合同](research/streaming-graphemes.md);候选正确性通过不关闭系统 ConPTY 或 R2 父项 |
-| 实验分支:`termforge.5` + 固定官方 ConPTY | [PR #50(Draft)](https://github.com/JavaZeroo/termforge/pull/50),`.4` 联合源码 `3e5b96d` 的[真实基线](research/joint-conpty-baseline.md)保留,尚未合并 main 或通过产品整体验收 | [#51 原生 viewport 修复](research/native-viewport-resize.md)的原 resize/Unicode 及原生样本、[#88 回显完成判据](research/workspace-restore-transport-oracle.md)的原保存/恢复/钳制分别通过;[#87 完整记录检查点](research/workflow-record-checkpoint.md)有受控旧红/新绿及最终同源码两轮原八会话 data-only。最新官方完整回归 56/57、8 项内部 skip,[Vim #52](https://github.com/JavaZeroo/termforge/issues/52)仍红,[MSYS输入边界](research/vim-msys-input-boundary.md)已定位捕获样本的Ctrl-O丢失位置但未修复,[#63 工作区残尾](research/workspace-native-viewport.md)已由同EXE单变量与运输回放确认现有viewport修复覆盖,原UI/主区三轮重复两批及完整shell通过;更早缺运输样本保留未知。[#53 UI fence](research/ui-paste-fence.md)与[行键复用/关闭回复](research/resize-replay-cost.md)、[#62 worker 夹具](research/sender-fence.md)各自限定通过。终端 margin 与原生状态分列,#47 及完整后端仍开放;旧失败和历史运输缺口保留 |
+| 实验分支:`termforge.5` + 固定官方 ConPTY | [PR #50(Draft)](https://github.com/JavaZeroo/termforge/pull/50),`.4` 联合源码 `3e5b96d` 的[真实基线](research/joint-conpty-baseline.md)保留,尚未合并 main 或通过产品整体验收 | [#51 原生 viewport 修复](research/native-viewport-resize.md)的原 resize/Unicode 及原生样本、[#88 回显完成判据](research/workspace-restore-transport-oracle.md)的原保存/恢复/钳制分别通过;[#87 完整记录检查点](research/workflow-record-checkpoint.md)有受控旧红/新绿及最终同源码两轮原八会话 data-only。最新官方完整回归 56/57、8 项内部 skip,[Vim #52](https://github.com/JavaZeroo/termforge/issues/52)仍红,[MSYS输入边界](research/vim-msys-input-boundary.md)已定位捕获样本的Ctrl-O丢失位置,后续[隔离运行库补丁](research/vim-msys-runtime-prototype.md)在重建基点red后原方法四轮通过;正式固定运行库验收未完成,[#63 工作区残尾](research/workspace-native-viewport.md)已由同EXE单变量与运输回放确认现有viewport修复覆盖,原UI/主区三轮重复两批及完整shell通过;更早缺运输样本保留未知。[#53 UI fence](research/ui-paste-fence.md)与[行键复用/关闭回复](research/resize-replay-cost.md)、[#62 worker 夹具](research/sender-fence.md)各自限定通过。终端 margin 与原生状态分列,#47 及完整后端仍开放;旧失败和历史运输缺口保留 |
以下能力默认指已合并实现;某个配置的通过结果不能转用于另一个配置。R1 的真实系统 CF/拼音验收属于固定自研核心配置,不外推到候选 `.4` 或实验后端联合配置。
@@ -35,7 +35,7 @@
| Unicode 与文字显示 | **实现中,未验收**:默认自研保留 Unicode 15。显式候选 `.4` 的 [#39 Unicode 17 流式字素合同](research/streaming-graphemes.md)已限定验收:固定 ZWJ/keycap 的单 lead/两列、光标、SGR/查询、原子选择复制、单列 resize 与有界无损分片;实际 ConPTY/DWrite 核对固定样本的单 glyph、字体和网格 | [#30](https://github.com/JavaZeroo/termforge/issues/30) 仍需完整输入/IME 交叉;所有脚本/整形、通用 fallback、所有原生重放、真彩色/更多属性、Powerline 和真实跨屏未验收。分段 helper 的规范数据通过不代表完整终端 Unicode 正确性;[#54](https://github.com/JavaZeroo/termforge/issues/54) 保留已观察的性能成本 | R2 / R4 |
| resize 与 reflow | **限定验收**:默认按 ADR-0005 物理行裁剪;候选在[固定 ConPTY 重放](../experiments/core/results/2026-10-26-resize-replay/validation.json)与连续同步中保持行身份、Find/选区和有界历史,淘汰/清空不复活;候选 `.4` 另覆盖主/备用屏缩到单列 | [#29](https://github.com/JavaZeroo/termforge/issues/29) 的完整 resize 交叉未完成;固定事务不等于完整 reflow 或 WindTerm 等价。系统/实验 ConPTY、备用屏/滚动区、真实 DPI、呈现、性能及 #36/#38 分别验收;默认缩窄不可恢复 | R2 |
| 本地 shell 选择 | **实现中,未验收**:`ShellLaunch` 分离可执行文件、参数、工作目录及 shell 命令差异;cmd、Windows PowerShell 5.1、PowerShell 7、显式 Ubuntu WSL 各有[两轮真实启动/目录/尺寸/正常退出证据](../experiments/shell/results/2026-10-24-r2-shell-lifecycle/validation.json),无效程序启动错误可见且可关闭后恢复 cmd | 仅声明上述固定入口和隔离目录;任意 profile/参数、通用分屏/排序、全部运行时错误提示及管理员 shell 未完成 | R2;权限场景 R4 |
-| 常用 TUI | **实现中,未验收**:显式候选 + 系统 ConPTY 有固定 Vim 进入、编辑、60×12 resize、退出写盘、主屏恢复及光标回复的[产品证据](../experiments/core/CANDIDATE.md);More 尾部 ECH 与捕获端点有[限定修复](research/more-capture-ech.md) | [#28](https://github.com/JavaZeroo/termforge/issues/28) 的更多应用及完整输入/输出模式未完成;PR #50 实验后端的 GUI Vim [#52](https://github.com/JavaZeroo/termforge/issues/52) 仍有失败,[MSYS输入观测](research/vim-msys-input-boundary.md)不构成修复;[native 捕获目录复用](research/vim-fixture-isolation.md)已独立定位并修正,不能代替 GUI 或完整 TUI 验收。headless 比较与自有 DIB 不等于真实呈现,`presented_done=null` | R2 |
+| 常用 TUI | **实现中,未验收**:显式候选 + 系统 ConPTY 有固定 Vim 进入、编辑、60×12 resize、退出写盘、主屏恢复及光标回复的[产品证据](../experiments/core/CANDIDATE.md);More 尾部 ECH 与捕获端点有[限定修复](research/more-capture-ech.md) | [#28](https://github.com/JavaZeroo/termforge/issues/28) 的更多应用及完整输入/输出模式未完成;PR #50 实验后端的 GUI Vim [#52](https://github.com/JavaZeroo/termforge/issues/52) 仍有失败,[MSYS输入观测](research/vim-msys-input-boundary.md)及[隔离运行库修补实验](research/vim-msys-runtime-prototype.md)不替代原固定运行库验收;[native 捕获目录复用](research/vim-fixture-isolation.md)已独立定位并修正,不能代替 GUI 或完整 TUI 验收。headless 比较与自有 DIB 不等于真实呈现,`presented_done=null` | R2 |
## 工作区与会话
diff --git a/docs/PROVENANCE.md b/docs/PROVENANCE.md
index f962d8f9..ff4846d4 100644
--- a/docs/PROVENANCE.md
+++ b/docs/PROVENANCE.md
@@ -18,6 +18,8 @@
## 已使用的第三方数据
+- `research/msys-runtime-window-prefix/`:外部运行库的隔离研究补丁,来源为 `git-for-windows/msys2-runtime` 固定提交 `2e2ef940151485490aff0c7b00c00965ef7a71a4` 的 `winsup/cygwin/fhandler/console.cc`;修改 resize 输入前缀的消费顺序,适用上游 LGPLv3-or-later 及 `CYGWIN_LICENSE` 中的 Linking Exception。完整上游许可、补丁与来源见[目录说明](../research/msys-runtime-window-prefix/README.md)。这不是 WindTerm 源码,不是产品依赖,也不进入默认构建或发布包;不由项目 MIT 覆盖。编译/隔离 Vim 结果及未验边界见[实验记录](research/vim-msys-runtime-prototype.md)。
+
- `assets/fonts/RobotoMono-Regular.ttf`:从 Google Fonts 的 RobotoMono 官方仓库固定提交独立取得,未修改;适用 SIL Open Font License 1.1,完整版权与许可证随字体分发。字体源码、固定版本、原始链接、字节数和 SHA-256 见[字体来源](../assets/fonts/README.md)。只在 TermForge 进程内作为工作区 UI 字体加载;不是从 WindTerm 提取的资源,不受项目 MIT 许可证覆盖。
- 差分测试依赖 `pyte 0.8.2`(LGPLv3)和 `wcwidth 0.2.13`(MIT),固定 wheel 哈希并保留原包许可;没有复制其源码或将其作为产品组件。版本、官方来源与适配边界见[差分说明](../experiments/differential/README.md)。原创项目许可证不替代这些依赖的许可证。
diff --git a/docs/milestones/R2-local-terminal.md b/docs/milestones/R2-local-terminal.md
index 33b41690..07606ed3 100644
--- a/docs/milestones/R2-local-terminal.md
+++ b/docs/milestones/R2-local-terminal.md
@@ -44,7 +44,7 @@ flowchart LR
## 下一批的任务边界
-1. **在已冻结基线上逐项闭合后端回归。** #55 已交付含红的真实基线;接续 #52 的 GUI Vim 失败。#62 的[真实 writer 持块、取消与停止夹具](../research/sender-fence.md)不降低原 4MiB/16KiB/期限,#53 已接入默认关闭的 fence,[单窗口 UI/3MB/768B 与控制故障切片](../research/ui-paste-fence.md)及[同源码两轮原八会话data-only](../research/resize-replay-cost.md)已通过;[#51 原生 viewport 修复](../research/native-viewport-resize.md)的原 resize 与 Unicode、[#88 回显完成判据](../research/workspace-restore-transport-oracle.md)的原保存/恢复/钳制限定回归通过;[#87 完整记录检查点](../research/workflow-record-checkpoint.md)已具有受控因果红绿及同源码两轮原八会话 data-only。[#63 工作区尺寸标记残尾](../research/workspace-native-viewport.md)已核验现有viewport修复覆盖,并通过原三轮重复与180秒完整shell合同。完整官方回归中的 Vim、更早缺运输的工作区失败及历史聚合期限证据分别保留,#87 的历史运输缺口不追溯补造,真实 CF/IME 组合独立验收。各回归可用原冻结输入独立定位,最终修复验收须在联合配置重建;一次未复现不自动构成因果修复。
+1. **在已冻结基线上逐项闭合后端回归。** #55 已交付含红的真实基线;接续 #52 的 GUI Vim 失败;[隔离运行库修补实验](../research/vim-msys-runtime-prototype.md)已提供基点red与补丁green,原固定运行库兼容方案及正式验收仍需闭合。#62 的[真实 writer 持块、取消与停止夹具](../research/sender-fence.md)不降低原 4MiB/16KiB/期限,#53 已接入默认关闭的 fence,[单窗口 UI/3MB/768B 与控制故障切片](../research/ui-paste-fence.md)及[同源码两轮原八会话data-only](../research/resize-replay-cost.md)已通过;[#51 原生 viewport 修复](../research/native-viewport-resize.md)的原 resize 与 Unicode、[#88 回显完成判据](../research/workspace-restore-transport-oracle.md)的原保存/恢复/钳制限定回归通过;[#87 完整记录检查点](../research/workflow-record-checkpoint.md)已具有受控因果红绿及同源码两轮原八会话 data-only。[#63 工作区尺寸标记残尾](../research/workspace-native-viewport.md)已核验现有viewport修复覆盖,并通过原三轮重复与180秒完整shell合同。完整官方回归中的 Vim、更早缺运输的工作区失败及历史聚合期限证据分别保留,#87 的历史运输缺口不追溯补造,真实 CF/IME 组合独立验收。各回归可用原冻结输入独立定位,最终修复验收须在联合配置重建;一次未复现不自动构成因果修复。
2. **并行处理原版对照、平台语义与性能。** [原生语义处理路径 #56](https://github.com/JavaZeroo/termforge/issues/56)先明确 #41 原合同需要什么、哪些路径可支持;保留必要的上游或独立实现工作,不用“平台不同”豁免缺口。#3/#4 优先建立原版 Windows 本地终端基线;#54 现在冻结重复方法与完成端点并定位吞吐成本,数值预算作为提案交用户确认,不等到 #34 才补性能。
3. **在主线推进独立行为合同。** #29 核对极窄/极短、软硬行、历史/淘汰、选择/Find、连续 resize 和 child ack;#30 核对 IME 组合/提交/取消与输出/resize/切换、应用键盘/粘贴接收、实际复制及同次八会话。已验收的 #39 只提供首批字素基础,最终配置的交叉验收仍需执行。
4. **补终端模式和应用矩阵。** #27 明确 DECOM/DECAWM、pending-wrap、保存恢复、异常序列与 margin×resize;#28 先固定应用版本/入口/动作及协议字节预期,再逐应用完成进入、操作、resize、退出、主屏恢复。Vim 的一个修复不替代完整 TUI 验收。
diff --git a/docs/research/vim-msys-input-boundary.md b/docs/research/vim-msys-input-boundary.md
index e6733236..9df5b4ec 100644
--- a/docs/research/vim-msys-input-boundary.md
+++ b/docs/research/vim-msys-input-boundary.md
@@ -1,6 +1,6 @@
# Vim resize 后 Ctrl-O 的输入边界
-[#52](https://github.com/JavaZeroo/termforge/issues/52) 的 GUI stage59 仍未修复。新的有界运行时记录将捕获到的失败定位在 MSYS 控制台事件到 `read(0)` 的转换:TermForge 成功写出完整 93 B,原生输入也包含 Ctrl-O,但 Vim 收到的读结果仅剩其后 92 B。本文记录诊断,不改变固定应用、输入、期限或验收合同。
+[#52](https://github.com/JavaZeroo/termforge/issues/52) 的原固定运行库 GUI stage59 验收仍未完成。本文的有界运行时记录将捕获到的失败定位在 MSYS 控制台事件到 `read(0)` 的转换:TermForge 成功写出完整 93 B,原生输入也包含 Ctrl-O,但 Vim 收到的读结果仅剩其后 92 B。本文记录诊断,不改变固定应用、输入、期限或验收合同;后续[隔离运行库修补实验](vim-msys-runtime-prototype.md)单独记录重建基点 red 与修补四轮 green,不替代原固定目标验收。
## 固定身份与观测范围
@@ -32,7 +32,7 @@
## 源码解释与未完成项
-固定源码的 [`send_winch_maybe`](https://github.com/git-for-windows/msys2-runtime/blob/2e2ef940151485490aff0c7b00c00965ef7a71a4/winsup/cygwin/fhandler/console.cc#L935) 在发送SIGWINCH时临时释放、再取得 `input_mutex`;[`process_input_message`](https://github.com/git-for-windows/msys2-runtime/blob/2e2ef940151485490aff0c7b00c00965ef7a71a4/winsup/cygwin/fhandler/console.cc#L1124) 先Peek并处理旧快照,再按旧数量Read清理。同期 [`cons_master_thread`](https://github.com/git-for-windows/msys2-runtime/blob/2e2ef940151485490aff0c7b00c00965ef7a71a4/winsup/cygwin/fhandler/console.cc#L363) 可以移除resize并写回键盘记录。由此推断旧快照在释放锁期间失效,与实际调用顺序吻合;尚没有单变量修补后的因果红绿,不宣称已完成修复。
+固定源码的 [`send_winch_maybe`](https://github.com/git-for-windows/msys2-runtime/blob/2e2ef940151485490aff0c7b00c00965ef7a71a4/winsup/cygwin/fhandler/console.cc#L935) 在发送SIGWINCH时临时释放、再取得 `input_mutex`;[`process_input_message`](https://github.com/git-for-windows/msys2-runtime/blob/2e2ef940151485490aff0c7b00c00965ef7a71a4/winsup/cygwin/fhandler/console.cc#L1124) 先Peek并处理旧快照,再按旧数量Read清理。同期 [`cons_master_thread`](https://github.com/git-for-windows/msys2-runtime/blob/2e2ef940151485490aff0c7b00c00965ef7a71a4/winsup/cygwin/fhandler/console.cc#L363) 可以移除resize并写回键盘记录。由此推断旧快照在释放锁期间失效,与实际调用顺序吻合;本诊断批次没有修补后的因果红绿,后续独立实验见上文链接,不混用其运行身份。
这个释放锁的代码来自[避免less信号处理longjmp导致死锁的上游修正](https://github.com/git-for-windows/msys2-runtime/commit/76e1edeb27a573a955ebf3ae5a7a7fd1a75b290f)。后续方案必须同时保留这项约束,不能简单删除解锁,也不能补发Ctrl-O、延长等待、换应用或跳过原断言来结项。可继续准备隔离的最小运行库修补与真实输入回归;外部应用或运行库升级的诊断结果不能自动替换原固定验收目标,正式兼容方案另行提出。
diff --git a/docs/research/vim-msys-runtime-prototype.md b/docs/research/vim-msys-runtime-prototype.md
new file mode 100644
index 00000000..5454d59b
--- /dev/null
+++ b/docs/research/vim-msys-runtime-prototype.md
@@ -0,0 +1,50 @@
+# Vim/MSYS resize 输入前缀修补实验
+
+固定公开运行库源码的最小补丁,使隔离环境中的原 GUI Vim 方法连续两批、每批两轮通过;同条件未修补的重建 DLL 首轮复现 stage59。这支持此前捕获的“SIGWINCH 解锁期间旧 Peek 前缀失效”解释。**[#52](https://github.com/JavaZeroo/termforge/issues/52) 的原固定运行库验收仍未完成**:本次没有修改 TermForge 产品、测试或正式兼容策略,也没有把实验 DLL 放入产品包。
+
+## 固定身份与实验边界
+
+TermForge 基点 `ed55a8758423b3273fbd98f07e0bfd77d88e46ac`,产品代码与 `c662011` 相同;候选 `0.26.1-dev+termforge.5`、官方 ConPTY `1.25.260930003`、flags24。所有 GUI 样本使用同一个无插桩 EXE,SHA-256 `7f26395942f107297565f50402568650e1e17c5eb23924bee1bfb02c50c60d16`。本机 Windows 11 x64,批次完成后查询系统版本为 `10.0.26200`;没有发布主机名。
+
+固定 Vim 9.1 patches 1–532,EXE SHA-256 `2e0fda63a89171adfc46c9417d5105cc39ed778cc69a890b83a4eabc34e7646a`。Vim 与四个相邻 DLL 从既有安装按哈希复制到隔离目录;各变体使用同一个活动路径,只有 `msys-2.0.dll` 切换,其他四个文件保持原字节。没有复制 Vim runtime 配置目录。每次切换前检查上一方法的自有 Job 已清空、私有桌面已释放;批次后复核既有安装的五个文件未变。
+
+| 运行库变体 | SHA-256 | 实际结果 |
+|---|---|---|
+| 隔离原 DLL | `3096d2ba9be20e90be1399edd391bac65d84bc387f5a419b502c9b326081930f` | 一次原两轮方法:先通过、后 stage59 |
+| 固定源码未修补重建 | `d9e490fdbe31c233eab6578168fb4f2bda84f53252be3898d0cdd0e8610db721` | 首轮 stage59,立即停止 |
+| 同条件修补重建 | `dd792766fa976b031cbff0540744b6f3d2b3fc0d695ed764a01457b65eab6258` | 两次原两轮方法:四轮通过,达到预定上限后停止 |
+
+本批未附加 Frida,也未采集实际加载模块路径或新的输入 API 轨迹。文件身份和隔离路径是本批证据;此前的调用边界证据仍属于独立的[输入边界诊断](vim-msys-input-boundary.md),不能混写成这批运行的调用记录。
+
+## 原方法、停止条件与结果
+
+直接调用现有 `CandidateTuiTests.test_real_fullscreen_editor_and_cursor_reply`,每次方法原有两轮,保留原输入、Vim 脚本、事件文件、精确断言及 25 秒内层 / 40 秒每轮外层期限。先限定原 DLL 一次方法;未修重建 DLL 最多两次方法,首次 stage59 或其他失败立即停止;只有重建基点出现原 stage59 才执行修补变体,最多两次方法,任何失败即停。实际共四次方法、七个 GUI 样本,没有额外 GUI 重试。
+
+两个失败均为原 stage59,外层未超时,命令进入插入内容;`candidate-insert-log.txt` 均为相同的 221 B,resize 文件为空。两个失败的 `candidate-input.bin` 也为空、未完成刷新,**不能将其视为完整输入轨迹或“未收到输入”的证据**。原测试输入未改由源码身份保证,实际 API 字节链路只由前一诊断批次证明。
+
+四轮修补结果通过原就绪、进入/离开插入模式、编辑、60×12 resize 文件、写盘、退出、主屏恢复、独立 child 尺寸及 CPR 回复检查;`presented_done` 仍为 `null`。原 DLL 的首轮也通过,但不覆盖其后失败。七轮均无外层超时,Job active/terminated 为 0,desktop gone。导出时仅离线重放原断言及验证器,复核保存的结果和文件哈希,没有重跑 GUI。
+
+## 修改机制与尚未覆盖的路径
+
+此前记录显示:`process_input_message` Peek 到 resize 后调用 `send_winch_maybe`,后者为信号递送临时释放 `input_mutex`;另一线程可以消耗 resize。旧调用恢复后按旧数量清理队列,取走新到的 Ctrl-O。这是已捕获失败的调用顺序,不能追溯填补没有原生输入记录的历史失败。
+
+[研究补丁](../../research/msys-runtime-window-prefix/README.md)仅修改 `winsup/cygwin/fhandler/console.cc` 的 `WINDOW_BUFFER_SIZE_EVENT` 分支,12 行新增、6 行删除:在输入锁仍保护旧 Peek 前缀时,先 `ReadConsoleInputW` 消费已处理前缀并调整 `num_processed`;再保留原 `send_winch_maybe` 解锁、SIGWINCH 与再加锁,返回现有 read 循环,下一次重新 Peek。即使尺寸未实际变化也结束当前快照处理,后续输入进入新一轮。
+
+没有删除为 less 信号处理器 longjmp 保留的解锁。结构保留不等于已做实际 longjmp 回归;`MOUSE_EVENT` 中的同类信号路径、读取失败注入、其他应用和正式兼容/分发策略尚未验证。补丁沿用既有 `ReadConsoleInputW` 错误处理,未声称修复这些边界。
+
+## 构建条件与来源
+
+- 运行库:[固定 MSYS 源码](https://github.com/git-for-windows/msys2-runtime/tree/2e2ef940151485490aff0c7b00c00965ef7a71a4),提交 `2e2ef940151485490aff0c7b00c00965ef7a71a4`。未修补基点 tracked 源码干净;修补变体仅上述文件有 diff,公开补丁已做 `git apply --check` 并比对应用后的源码哈希。
+- 独立 Git SDK:提交 `36b102843d99c4993084b29d839dc6f5ef4db2f9`,构建依赖只装入私有 SDK。完整[包版本清单](../../research/msys-runtime-window-prefix/build-packages.txt)随研究记录保存;其中 GCC/G++ 16.2.0,GNU C/C++17,binutils 2.47、make 4.4.1。
+- Win32 头文件:SDK 提交 `eb069c08fe8ef4d2f19dc6b99c4816a4c51fd2ae`(2024-07-10)的 `usr/include/w32api`,包版本 `12.0.0.r0.g819a6ec2e-1`;同时固定裸包含与 `w32api/` 前缀包含路径。不能仅设置顶层 `CPPFLAGS` 后假定子目录采用了旧头文件。
+- 配置保留 `--disable-dependency-tracking --disable-doc --disable-dumper --with-msys2-runtime-commit=2e2ef940151485490aff0c7b00c00965ef7a71a4`,生成构建文件后在目标 `winsup/cygwin` 目录构建 `all`。C 使用 `gcc -std=gnu17 -Wno-error=old-style-definition`;C++ 使用 `g++ -std=gnu++17` 和 `-O2 -g -Wno-error -Wno-narrowing -Wno-use-after-free`。最终 make 显式传入两个旧头文件的 `-isystem` 路径,`-j2`,每次构建上限 900 秒。构建准备失败和编译警告原件保留在本地,不计 GUI 结果。
+
+这是新工具链重建实验,不是官方 2024 DLL 的逐字节复建。两个重建变体的 310 项构建对象清单具有相同键集合,六项哈希不同:`fhandler/console.o`、`libdll.a`、`msysdll.a`、`new-msys-2.0.dll`、`version.o`、`winver.o`,包含再生成的版本对象。只能声称一处主动源码修改,不能声称二进制只有一个函数或一个文件不同。
+
+公开源码补丁遵循固定上游的 LGPLv3-or-later 与 `CYGWIN_LICENSE` 中的 Linking Exception;完整许可及修改归属见[来源说明](../../research/msys-runtime-window-prefix/README.md),不套用项目 MIT。它是 MSYS/Cygwin 研究材料,不属于 WindTerm 公开或逆向源码。
+
+## 证据与结论限制
+
+[白名单验证记录](../../experiments/shell/results/2026-10-27-vim-msys-runtime-prototype/validation.json)包含源码、EXE/DLL、补丁/许可、对象差异、全部七轮结果、原文件哈希与回收状态;DLL、原始终端输出、个人路径及完整工具日志仅本地保存。
+
+本实验为原诊断补充了重建基点 red 与修补变体四轮 green,但没有重新执行完整 57 项 CTest,没有获得 WindTerm 同应用对照,也没有形成性能或普遍可靠性结论。原固定运行库下的完整官方 56/57 结果保持不变;#52、#47 和 Draft PR #50 的正式出口继续开放,不能用替换外部应用 DLL 自动关闭原合同。
diff --git a/experiments/shell/results/2026-10-27-vim-msys-runtime-prototype/validation.json b/experiments/shell/results/2026-10-27-vim-msys-runtime-prototype/validation.json
new file mode 100644
index 00000000..697e6029
--- /dev/null
+++ b/experiments/shell/results/2026-10-27-vim-msys-runtime-prototype/validation.json
@@ -0,0 +1,655 @@
+{
+ "schema_version": 1,
+ "purpose": "isolated source-rebuilt MSYS runtime prototype for issue 52",
+ "status": "rebuilt baseline reproduced stage59; patched runtime passed four original GUI cases; original fixed-runtime acceptance remains open",
+ "termforge": {
+ "source_commit": "ed55a8758423b3273fbd98f07e0bfd77d88e46ac",
+ "product_code_same_as": "c662011",
+ "product_and_test_changes": false,
+ "binary_sha256": "7f26395942f107297565f50402568650e1e17c5eb23924bee1bfb02c50c60d16",
+ "candidate": "0.26.1-dev+termforge.5",
+ "backend": "reviewed-side-by-side-1.25.260930003",
+ "conpty_flags": 24,
+ "source_files_sha256": {
+ "experiments/shell/shell.cpp": "b4f6fe98812d1d23fa5f5bbcc7376437404af6cdb67cd6cdcdf448b57cb31fe9",
+ "experiments/shell/test_candidate_tui.py": "a300380b97ad424c5af06219a021a256de6178c3af7fb7e933e24bb8142201ee",
+ "experiments/shell/run.py": "45976b828eecb316881d698dedaef09ad304f72d991dfa360f1c552bbcbe9f1d"
+ }
+ },
+ "environment": {
+ "os_version_observed_after_batch": [
+ "11",
+ "10.0.26200",
+ "SP0",
+ "Multiprocessor Free"
+ ],
+ "architecture": "x64",
+ "personal_installation_unchanged_hash_check": true,
+ "fixture_files_original_sha256": {
+ "vim.exe": "2e0fda63a89171adfc46c9417d5105cc39ed778cc69a890b83a4eabc34e7646a",
+ "msys-ncursesw6.dll": "73ff8bc8b1f515e57b185e57d25d9ad29067057ff0819a8e588677c65ca61629",
+ "msys-2.0.dll": "3096d2ba9be20e90be1399edd391bac65d84bc387f5a419b502c9b326081930f",
+ "msys-intl-8.dll": "23d30f4bcbc0a258cf5ecfe29e707f9b05d51c32d5b16a910f1012b889136c12",
+ "msys-iconv-2.dll": "9cbf5613b946be7bad403ac0d7277efbd514a35faa644c6a0d6e7f6cc0b40780"
+ },
+ "same_active_fixture_path_across_variants": true,
+ "fixture_runtime_files_not_copied": true,
+ "loaded_module_paths_observed": false,
+ "diagnostic_instrumentation": false
+ },
+ "runtime": {
+ "source_commit": "2e2ef940151485490aff0c7b00c00965ef7a71a4",
+ "original_dll_sha256": "3096d2ba9be20e90be1399edd391bac65d84bc387f5a419b502c9b326081930f",
+ "sdk_commit": "36b102843d99c4993084b29d839dc6f5ef4db2f9",
+ "headers_commit": "eb069c08fe8ef4d2f19dc6b99c4816a4c51fd2ae",
+ "win32_headers": "msys2-w32api-headers 12.0.0.r0.g819a6ec2e-1; both w32api-prefixed and bare paths pinned",
+ "c_compiler": "gcc 16.2.0, GNU17, -Wno-error=old-style-definition",
+ "cxx_compiler": "g++ 16.2.0, GNU++17, -O2 -g -Wno-error -Wno-narrowing -Wno-use-after-free",
+ "build_script_sha256": "13d47fb56cec438c591861e996b2954214869c541d3b2540e623912c82844fa9",
+ "packages_sha256": "0c10cee128f4d02add7fd28c9e5d4df6035c3cddca2a80cdc8c15600eade5f67",
+ "package_inventory_path": "research/msys-runtime-window-prefix/build-packages.txt",
+ "selected_build_packages": {
+ "gcc": "16.2.0-1",
+ "binutils": "2.47-1",
+ "make": "4.4.1-3",
+ "cocom": "0.996-6",
+ "zlib-devel": "1.3.2-1"
+ },
+ "build_object_count": 310,
+ "changed_build_object_count": 6,
+ "changed_build_objects": {
+ "fhandler/console.o": {
+ "base": "308e4d37447fd48dbb4b06b511abf5ffe16ccd0899bea8e08506fd765ef9867b",
+ "window-prefix": "06a2a4519d4f7fd74f240aae0fc91b262bbafceff36f2b4414928e8a59e47b27"
+ },
+ "libdll.a": {
+ "base": "6c12fadc029325b2f683ccaa1a391a2ba50c385a2bd36fc0cba1e3065285d57c",
+ "window-prefix": "03c56b71231c3f8b224c10009531a94baad6c5ebd8a2bcdfb92efa03b61c7b80"
+ },
+ "msysdll.a": {
+ "base": "e8e3b40bbcc8de7f7b266c57e7d64e9f147f71d1fcfcb9bff00f0126f859f14a",
+ "window-prefix": "f3768c0c931ba35c3050a23cb062c2a39a1ed93410e8e06ee6722076b3d142fc"
+ },
+ "new-msys-2.0.dll": {
+ "base": "d9e490fdbe31c233eab6578168fb4f2bda84f53252be3898d0cdd0e8610db721",
+ "window-prefix": "dd792766fa976b031cbff0540744b6f3d2b3fc0d695ed764a01457b65eab6258"
+ },
+ "version.o": {
+ "base": "3a669b9dac2aed0a7619052d974d5819e48846d1af3fa8de41bc1cda9da7efd5",
+ "window-prefix": "51bc7e867867b7eec6694f40618f13ebf66eb8317a8e7ff22b71342b18ef836a"
+ },
+ "winver.o": {
+ "base": "b5cd6766287393c78274b5c16a85ac94009cbec3603096d94cf6533642ca584b",
+ "window-prefix": "c52d7f4fe56736b0a55f2b4f32676efd0a0f7786933731185f5bc0b60e45e24f"
+ }
+ },
+ "variants": {
+ "base": {
+ "dll_sha256": "d9e490fdbe31c233eab6578168fb4f2bda84f53252be3898d0cdd0e8610db721",
+ "console_source_sha256": "00d73637398314b74b81f6fabf4bd32176056dd088ce825f4546b2c4b38726b8",
+ "source_status": "",
+ "private_identity_sha256": "c8f08c4544fa76a1355900000dbe34cdc5676c7f183f853a6c8aa55fcf6c15d3"
+ },
+ "window-prefix": {
+ "dll_sha256": "dd792766fa976b031cbff0540744b6f3d2b3fc0d695ed764a01457b65eab6258",
+ "console_source_sha256": "5d2b1b4c1fecefa15518d8e3ff6a375a5a00f8c91fee0267a96a1c4e08eb3fc1",
+ "source_status": " M winsup/cygwin/fhandler/console.cc\n",
+ "private_identity_sha256": "be5d87b794b709ad4dd63bc9ea1a6cb594e99ffd74b92a2b5f531556072755d0"
+ }
+ }
+ },
+ "patch": {
+ "path": "research/msys-runtime-window-prefix/window-prefix.patch",
+ "sha256": "e942c2d08b7cc5a294203bf0a52f7414b9b19f3cd675624644feadf907418c77",
+ "changed_source_file": "winsup/cygwin/fhandler/console.cc",
+ "insertions": 12,
+ "deletions": 6,
+ "apply_check_and_resulting_source_hash_verified": true,
+ "license": "LGPL-3.0-or-later with upstream CYGWIN_LICENSE linking exception",
+ "license_files_sha256": {
+ "CYGWIN_LICENSE": "794433752103cf4bbb4a84a1bdb8fbc150abb1762704bb35fecc9f7f820be984",
+ "COPYING.LIB": "da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768",
+ "COPYING": "8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903"
+ }
+ },
+ "method": {
+ "name": "CandidateTuiTests.test_real_fullscreen_editor_and_cursor_reply",
+ "original_repetitions": 2,
+ "inner_timeout_seconds": 25,
+ "outer_timeout_seconds_per_case": 40,
+ "max_methods": {
+ "original": 1,
+ "base": 2,
+ "window-prefix": 2
+ },
+ "stops": [
+ "Original relocated DLL: one method only.",
+ "Rebuilt base: stop on first stage59 or other failure.",
+ "Patched: run only after rebuilt stage59; stop on any failure or after two methods.",
+ "Do not switch runtime until all preceding owned Jobs are inactive and desktops gone."
+ ],
+ "actual_methods": 4,
+ "actual_cases": 7,
+ "passed_cases": 5,
+ "stage59_cases": 2,
+ "patched_passed_cases": 4,
+ "no_extra_gui_runs_during_export": true
+ },
+ "methods": [
+ {
+ "id": "original-method-0",
+ "variant": "original",
+ "started_utc": "2026-10-27T00:43:09.383669+00:00",
+ "runtime_sha256": "3096d2ba9be20e90be1399edd391bac65d84bc387f5a419b502c9b326081930f",
+ "outcome": "stage59",
+ "test_success": false,
+ "tests_run": 1,
+ "skips": 0,
+ "original_assertions_offline_rechecked_for_successful_cases": true,
+ "samples": [
+ {
+ "index": 0,
+ "status": "passed",
+ "failure_stage": null,
+ "exit_code": 0,
+ "outer_timed_out": false,
+ "job_after": {
+ "active": 0,
+ "total": 9,
+ "terminated": 0
+ },
+ "job_after_cleanup": {
+ "active": 0,
+ "total": 9,
+ "terminated": 0
+ },
+ "desktop_gone": true,
+ "result": {
+ "valid": true,
+ "candidate_tui_start": true,
+ "candidate_tui": true,
+ "candidate_resize": true,
+ "candidate_replies": true,
+ "command_verified": true,
+ "exit_code": 37,
+ "active_children_after": 0,
+ "cleanup_complete": true,
+ "input_rejected": 0,
+ "columns": 60,
+ "rows": 12,
+ "presented_done": null
+ },
+ "files": {
+ "candidate-input.bin": {
+ "bytes": 115,
+ "sha256": "4bd689a84f1eb7336afb3b607dec760d117caef3d83f3e8e1b6b1f83d70b4b68"
+ },
+ "candidate-insert-log.txt": {
+ "bytes": 58,
+ "sha256": "3d07108bcc44f0831b31530265fac711c1d1e69194aa9309897e4440c26de65a"
+ },
+ "candidate-resize-log.txt": {
+ "bytes": 5,
+ "sha256": "2d3db728e657a0e1ab99b23acb6b2d08c586c4eaba6e65a66ab65e7fb47693b7"
+ },
+ "candidate-startup-log.txt": {
+ "bytes": 6,
+ "sha256": "3dfa3fb239f56c778a1e9b33eb31328349edd155a95806dac4378904e88527e5"
+ },
+ "candidate-vim.vim": {
+ "bytes": 334,
+ "sha256": "386d475e5297169cf7fcc425dcc0f6b0174c237ff86be03564b2d505c5d79797"
+ },
+ "candidate-tui.txt": {
+ "bytes": 17,
+ "sha256": "d9d3b8d10b660a808ece2b2c46b3767713ba4e74631c56b376b492eadf511dec"
+ },
+ "candidate-replies.bin": {
+ "bytes": 7,
+ "sha256": "39cb2fc06ace6ef92a7015a38ab2e7fe1f03a846af0313e27ec7cdceca6643ff"
+ },
+ "sample.json": {
+ "bytes": 6004,
+ "sha256": "1da51ee58c0342cc6c35ece841fe5ceb2c53d34886cc58f142eb2ea3665b584d"
+ }
+ },
+ "empty_input_file_is_not_a_complete_input_trace": false
+ },
+ {
+ "index": 1,
+ "status": "failed",
+ "failure_stage": 59,
+ "exit_code": 2,
+ "outer_timed_out": false,
+ "job_after": {
+ "active": 0,
+ "total": 7,
+ "terminated": 0
+ },
+ "job_after_cleanup": {
+ "active": 0,
+ "total": 7,
+ "terminated": 0
+ },
+ "desktop_gone": true,
+ "result": null,
+ "files": {
+ "candidate-input.bin": {
+ "bytes": 0,
+ "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
+ },
+ "candidate-insert-log.txt": {
+ "bytes": 221,
+ "sha256": "e6de4daeba1841783e7e22f81dbf87154f341c309dc5b54405e5fc2c2f3550a6"
+ },
+ "candidate-resize-log.txt": {
+ "bytes": 0,
+ "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
+ },
+ "candidate-startup-log.txt": {
+ "bytes": 6,
+ "sha256": "3dfa3fb239f56c778a1e9b33eb31328349edd155a95806dac4378904e88527e5"
+ },
+ "candidate-vim.vim": {
+ "bytes": 334,
+ "sha256": "386d475e5297169cf7fcc425dcc0f6b0174c237ff86be03564b2d505c5d79797"
+ },
+ "sample.json": {
+ "bytes": 2315,
+ "sha256": "e756a2193be5abaf109f8f1560088a9a107581ec3fb18ca2201a4877c004169f"
+ }
+ },
+ "empty_input_file_is_not_a_complete_input_trace": true
+ }
+ ],
+ "private_artifact_hashes": {
+ "identity.json": "fe45dbd34bb82fea0a9a401cdc8424bf7fab2ec04c112f8f59612953a621a4fd",
+ "outcome.json": "e4906807e67e3bd88cc49f9cd92e4304d17f8c839e91e76a6a48a6c677f0d569",
+ "unittest.log": "20433d14432af18e521d5419b02c90f33d485c2d279c6c0f61f79bb7dcfa6ca1"
+ }
+ },
+ {
+ "id": "base-method-0",
+ "variant": "base",
+ "started_utc": "2026-10-27T00:44:15.818364+00:00",
+ "runtime_sha256": "d9e490fdbe31c233eab6578168fb4f2bda84f53252be3898d0cdd0e8610db721",
+ "outcome": "stage59",
+ "test_success": false,
+ "tests_run": 1,
+ "skips": 0,
+ "original_assertions_offline_rechecked_for_successful_cases": true,
+ "samples": [
+ {
+ "index": 0,
+ "status": "failed",
+ "failure_stage": 59,
+ "exit_code": 2,
+ "outer_timed_out": false,
+ "job_after": {
+ "active": 0,
+ "total": 7,
+ "terminated": 0
+ },
+ "job_after_cleanup": {
+ "active": 0,
+ "total": 7,
+ "terminated": 0
+ },
+ "desktop_gone": true,
+ "result": null,
+ "files": {
+ "candidate-input.bin": {
+ "bytes": 0,
+ "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
+ },
+ "candidate-insert-log.txt": {
+ "bytes": 221,
+ "sha256": "e6de4daeba1841783e7e22f81dbf87154f341c309dc5b54405e5fc2c2f3550a6"
+ },
+ "candidate-resize-log.txt": {
+ "bytes": 0,
+ "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
+ },
+ "candidate-startup-log.txt": {
+ "bytes": 6,
+ "sha256": "3dfa3fb239f56c778a1e9b33eb31328349edd155a95806dac4378904e88527e5"
+ },
+ "candidate-vim.vim": {
+ "bytes": 334,
+ "sha256": "386d475e5297169cf7fcc425dcc0f6b0174c237ff86be03564b2d505c5d79797"
+ },
+ "sample.json": {
+ "bytes": 2315,
+ "sha256": "9bbb1c8b4112cb0bd4018fc1b84ae38ee6922f1eced471759e9504a0df3b0c62"
+ }
+ },
+ "empty_input_file_is_not_a_complete_input_trace": true
+ }
+ ],
+ "private_artifact_hashes": {
+ "identity.json": "9a99e3bd48c3170adaf9c8740bc997c0411409311e4baf5677ebe131343e951f",
+ "outcome.json": "b2daaab684843847a1fbc02fb4c951684aefb65a5367a6d66336ff3af02ae326",
+ "unittest.log": "1f06d393a95d0ce3a57280bfea3196b1e3fd3c3d341da71f1d25a016dee8a34d"
+ }
+ },
+ {
+ "id": "window-prefix-method-0",
+ "variant": "window-prefix",
+ "started_utc": "2026-10-27T00:48:45.063902+00:00",
+ "runtime_sha256": "dd792766fa976b031cbff0540744b6f3d2b3fc0d695ed764a01457b65eab6258",
+ "outcome": "green",
+ "test_success": true,
+ "tests_run": 1,
+ "skips": 0,
+ "original_assertions_offline_rechecked_for_successful_cases": true,
+ "samples": [
+ {
+ "index": 0,
+ "status": "passed",
+ "failure_stage": null,
+ "exit_code": 0,
+ "outer_timed_out": false,
+ "job_after": {
+ "active": 0,
+ "total": 9,
+ "terminated": 0
+ },
+ "job_after_cleanup": {
+ "active": 0,
+ "total": 9,
+ "terminated": 0
+ },
+ "desktop_gone": true,
+ "result": {
+ "valid": true,
+ "candidate_tui_start": true,
+ "candidate_tui": true,
+ "candidate_resize": true,
+ "candidate_replies": true,
+ "command_verified": true,
+ "exit_code": 37,
+ "active_children_after": 0,
+ "cleanup_complete": true,
+ "input_rejected": 0,
+ "columns": 60,
+ "rows": 12,
+ "presented_done": null
+ },
+ "files": {
+ "candidate-input.bin": {
+ "bytes": 115,
+ "sha256": "4bd689a84f1eb7336afb3b607dec760d117caef3d83f3e8e1b6b1f83d70b4b68"
+ },
+ "candidate-insert-log.txt": {
+ "bytes": 58,
+ "sha256": "3d07108bcc44f0831b31530265fac711c1d1e69194aa9309897e4440c26de65a"
+ },
+ "candidate-resize-log.txt": {
+ "bytes": 5,
+ "sha256": "2d3db728e657a0e1ab99b23acb6b2d08c586c4eaba6e65a66ab65e7fb47693b7"
+ },
+ "candidate-startup-log.txt": {
+ "bytes": 6,
+ "sha256": "3dfa3fb239f56c778a1e9b33eb31328349edd155a95806dac4378904e88527e5"
+ },
+ "candidate-vim.vim": {
+ "bytes": 334,
+ "sha256": "386d475e5297169cf7fcc425dcc0f6b0174c237ff86be03564b2d505c5d79797"
+ },
+ "candidate-tui.txt": {
+ "bytes": 17,
+ "sha256": "d9d3b8d10b660a808ece2b2c46b3767713ba4e74631c56b376b492eadf511dec"
+ },
+ "candidate-replies.bin": {
+ "bytes": 7,
+ "sha256": "39cb2fc06ace6ef92a7015a38ab2e7fe1f03a846af0313e27ec7cdceca6643ff"
+ },
+ "sample.json": {
+ "bytes": 6004,
+ "sha256": "34e6041be10d8d7fceb26fc8c20b2f5f4429787425d032a3ff01c31cda557c0d"
+ }
+ },
+ "empty_input_file_is_not_a_complete_input_trace": false
+ },
+ {
+ "index": 1,
+ "status": "passed",
+ "failure_stage": null,
+ "exit_code": 0,
+ "outer_timed_out": false,
+ "job_after": {
+ "active": 0,
+ "total": 9,
+ "terminated": 0
+ },
+ "job_after_cleanup": {
+ "active": 0,
+ "total": 9,
+ "terminated": 0
+ },
+ "desktop_gone": true,
+ "result": {
+ "valid": true,
+ "candidate_tui_start": true,
+ "candidate_tui": true,
+ "candidate_resize": true,
+ "candidate_replies": true,
+ "command_verified": true,
+ "exit_code": 37,
+ "active_children_after": 0,
+ "cleanup_complete": true,
+ "input_rejected": 0,
+ "columns": 60,
+ "rows": 12,
+ "presented_done": null
+ },
+ "files": {
+ "candidate-input.bin": {
+ "bytes": 115,
+ "sha256": "4bd689a84f1eb7336afb3b607dec760d117caef3d83f3e8e1b6b1f83d70b4b68"
+ },
+ "candidate-insert-log.txt": {
+ "bytes": 58,
+ "sha256": "3d07108bcc44f0831b31530265fac711c1d1e69194aa9309897e4440c26de65a"
+ },
+ "candidate-resize-log.txt": {
+ "bytes": 5,
+ "sha256": "2d3db728e657a0e1ab99b23acb6b2d08c586c4eaba6e65a66ab65e7fb47693b7"
+ },
+ "candidate-startup-log.txt": {
+ "bytes": 6,
+ "sha256": "3dfa3fb239f56c778a1e9b33eb31328349edd155a95806dac4378904e88527e5"
+ },
+ "candidate-vim.vim": {
+ "bytes": 334,
+ "sha256": "386d475e5297169cf7fcc425dcc0f6b0174c237ff86be03564b2d505c5d79797"
+ },
+ "candidate-tui.txt": {
+ "bytes": 17,
+ "sha256": "d9d3b8d10b660a808ece2b2c46b3767713ba4e74631c56b376b492eadf511dec"
+ },
+ "candidate-replies.bin": {
+ "bytes": 7,
+ "sha256": "39cb2fc06ace6ef92a7015a38ab2e7fe1f03a846af0313e27ec7cdceca6643ff"
+ },
+ "sample.json": {
+ "bytes": 6004,
+ "sha256": "f85f7d92aa9f83a148d5d6fc21073deaf5e8dad217c2e3dcaeba15c19bff1810"
+ }
+ },
+ "empty_input_file_is_not_a_complete_input_trace": false
+ }
+ ],
+ "private_artifact_hashes": {
+ "identity.json": "5fa7f66913bc8be1ce699e5bfa8eae126f2bc9d1cacea6e9c446b146fbd39550",
+ "outcome.json": "f444c8c30a9d9732aea35e120cbf6813205b65f90e7641ec9fcdc660b214ef37",
+ "unittest.log": "e40d466f8594611cc5a2653d807819bad8c30c9aba126cce1bd2a1b6a9818e12"
+ }
+ },
+ {
+ "id": "window-prefix-method-1",
+ "variant": "window-prefix",
+ "started_utc": "2026-10-27T00:49:03.977836+00:00",
+ "runtime_sha256": "dd792766fa976b031cbff0540744b6f3d2b3fc0d695ed764a01457b65eab6258",
+ "outcome": "green",
+ "test_success": true,
+ "tests_run": 1,
+ "skips": 0,
+ "original_assertions_offline_rechecked_for_successful_cases": true,
+ "samples": [
+ {
+ "index": 0,
+ "status": "passed",
+ "failure_stage": null,
+ "exit_code": 0,
+ "outer_timed_out": false,
+ "job_after": {
+ "active": 0,
+ "total": 9,
+ "terminated": 0
+ },
+ "job_after_cleanup": {
+ "active": 0,
+ "total": 9,
+ "terminated": 0
+ },
+ "desktop_gone": true,
+ "result": {
+ "valid": true,
+ "candidate_tui_start": true,
+ "candidate_tui": true,
+ "candidate_resize": true,
+ "candidate_replies": true,
+ "command_verified": true,
+ "exit_code": 37,
+ "active_children_after": 0,
+ "cleanup_complete": true,
+ "input_rejected": 0,
+ "columns": 60,
+ "rows": 12,
+ "presented_done": null
+ },
+ "files": {
+ "candidate-input.bin": {
+ "bytes": 115,
+ "sha256": "4bd689a84f1eb7336afb3b607dec760d117caef3d83f3e8e1b6b1f83d70b4b68"
+ },
+ "candidate-insert-log.txt": {
+ "bytes": 58,
+ "sha256": "3d07108bcc44f0831b31530265fac711c1d1e69194aa9309897e4440c26de65a"
+ },
+ "candidate-resize-log.txt": {
+ "bytes": 5,
+ "sha256": "2d3db728e657a0e1ab99b23acb6b2d08c586c4eaba6e65a66ab65e7fb47693b7"
+ },
+ "candidate-startup-log.txt": {
+ "bytes": 6,
+ "sha256": "3dfa3fb239f56c778a1e9b33eb31328349edd155a95806dac4378904e88527e5"
+ },
+ "candidate-vim.vim": {
+ "bytes": 334,
+ "sha256": "386d475e5297169cf7fcc425dcc0f6b0174c237ff86be03564b2d505c5d79797"
+ },
+ "candidate-tui.txt": {
+ "bytes": 17,
+ "sha256": "d9d3b8d10b660a808ece2b2c46b3767713ba4e74631c56b376b492eadf511dec"
+ },
+ "candidate-replies.bin": {
+ "bytes": 7,
+ "sha256": "39cb2fc06ace6ef92a7015a38ab2e7fe1f03a846af0313e27ec7cdceca6643ff"
+ },
+ "sample.json": {
+ "bytes": 6004,
+ "sha256": "9ccfd04084e5417ca36cc66c03748580f58e5a9cd355ee6c96cfbc4f1bdf5b6f"
+ }
+ },
+ "empty_input_file_is_not_a_complete_input_trace": false
+ },
+ {
+ "index": 1,
+ "status": "passed",
+ "failure_stage": null,
+ "exit_code": 0,
+ "outer_timed_out": false,
+ "job_after": {
+ "active": 0,
+ "total": 9,
+ "terminated": 0
+ },
+ "job_after_cleanup": {
+ "active": 0,
+ "total": 9,
+ "terminated": 0
+ },
+ "desktop_gone": true,
+ "result": {
+ "valid": true,
+ "candidate_tui_start": true,
+ "candidate_tui": true,
+ "candidate_resize": true,
+ "candidate_replies": true,
+ "command_verified": true,
+ "exit_code": 37,
+ "active_children_after": 0,
+ "cleanup_complete": true,
+ "input_rejected": 0,
+ "columns": 60,
+ "rows": 12,
+ "presented_done": null
+ },
+ "files": {
+ "candidate-input.bin": {
+ "bytes": 115,
+ "sha256": "4bd689a84f1eb7336afb3b607dec760d117caef3d83f3e8e1b6b1f83d70b4b68"
+ },
+ "candidate-insert-log.txt": {
+ "bytes": 58,
+ "sha256": "3d07108bcc44f0831b31530265fac711c1d1e69194aa9309897e4440c26de65a"
+ },
+ "candidate-resize-log.txt": {
+ "bytes": 5,
+ "sha256": "2d3db728e657a0e1ab99b23acb6b2d08c586c4eaba6e65a66ab65e7fb47693b7"
+ },
+ "candidate-startup-log.txt": {
+ "bytes": 6,
+ "sha256": "3dfa3fb239f56c778a1e9b33eb31328349edd155a95806dac4378904e88527e5"
+ },
+ "candidate-vim.vim": {
+ "bytes": 334,
+ "sha256": "386d475e5297169cf7fcc425dcc0f6b0174c237ff86be03564b2d505c5d79797"
+ },
+ "candidate-tui.txt": {
+ "bytes": 17,
+ "sha256": "d9d3b8d10b660a808ece2b2c46b3767713ba4e74631c56b376b492eadf511dec"
+ },
+ "candidate-replies.bin": {
+ "bytes": 7,
+ "sha256": "39cb2fc06ace6ef92a7015a38ab2e7fe1f03a846af0313e27ec7cdceca6643ff"
+ },
+ "sample.json": {
+ "bytes": 6006,
+ "sha256": "9a83660ad5eb603a378cf3db037dc92e78b98276c4159901b935e8d05803b76b"
+ }
+ },
+ "empty_input_file_is_not_a_complete_input_trace": false
+ }
+ ],
+ "private_artifact_hashes": {
+ "identity.json": "bfda2110a737353912cafed36e6b3c401e1eca36b840e39fcc9ad3dfb2db7e36",
+ "outcome.json": "a23be95c07a043b02f3a869d0ca403b0cf17f2168652e3783258978c07490c97",
+ "unittest.log": "143f43a9096edec23651fa9c4f968d76e7ad6509ce7d9976da9e84b9cfd6bc49"
+ }
+ }
+ ],
+ "limitations": [
+ "The toolchain differs from the distributed 2024 DLL; this is an independent source rebuild, not a byte-identical rebuild.",
+ "The sole intentional source change is the WINDOW_BUFFER_SIZE_EVENT branch; six build artifacts differ, including regenerated version metadata.",
+ "No API probe or loaded-module path observation was performed in this batch; input-boundary call evidence belongs to the earlier separate diagnostic.",
+ "Failed Vim input files are empty and unflushed; they do not prove absent input or a complete equal input trace.",
+ "Only the original Vim GUI method was run; MOUSE_EVENT, actual signal-handler longjmp, other applications and full CTest were not validated.",
+ "Signal delivery still unlocks/relocks structurally; that is not a longjmp regression test.",
+ "The existing ReadConsoleInputW error handling was not strengthened or fault-injected.",
+ "Four patched cases support the queue-prefix diagnosis; they do not establish universal reliability, performance equivalence or WindTerm parity.",
+ "No product runtime adoption, compatibility strategy or fixed-target acceptance change is made; issue 52 remains open."
+ ]
+}
diff --git a/research/msys-runtime-window-prefix/COPYING b/research/msys-runtime-window-prefix/COPYING
new file mode 100644
index 00000000..94a9ed02
--- /dev/null
+++ b/research/msys-runtime-window-prefix/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/research/msys-runtime-window-prefix/COPYING.LIB b/research/msys-runtime-window-prefix/COPYING.LIB
new file mode 100644
index 00000000..65c5ca88
--- /dev/null
+++ b/research/msys-runtime-window-prefix/COPYING.LIB
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/research/msys-runtime-window-prefix/CYGWIN_LICENSE b/research/msys-runtime-window-prefix/CYGWIN_LICENSE
new file mode 100644
index 00000000..dba58e8d
--- /dev/null
+++ b/research/msys-runtime-window-prefix/CYGWIN_LICENSE
@@ -0,0 +1,30 @@
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESSED OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+Unless stated otherwise, the sources under the cygwin subdirectory,
+as well as the sources under the cygserver subdirectory linked into
+the Cygwin DLL, are licensed under the Lesser Gnu Public License,
+version 3 or (at your option) any later version (LGPLv3+). See the
+COPYING.LIB file for the exact wording of that license.
+
+Unless stated otherwise, the sources under the cygserver subdir not
+linked into the Cygwin DLL, as well as the sources under the lsaauth
+and the utils subdirectories are licensed under the Gnu Public License,
+version 3 or (at your option) any later version (GPLv3+). See the
+COPYING file for the exact wording of that license.
+
+Parts of the sources in any subdirectory are licensed using a BSD-like
+license. The affected source files contain explicit copyright notices
+to that effect.
+
+Linking Exception:
+
+ As a special exception, the copyright holders of the Cygwin library
+ grant you additional permission to link libcygwin.a, crt0.o, and
+ gcrt0.o with independent modules to produce an executable, and to
+ convey the resulting executable under terms of your choice, without
+ any need to comply with the conditions of LGPLv3 section 4. An
+ independent module is a module which is not itself based on the
+ Cygwin library.
+
diff --git a/research/msys-runtime-window-prefix/README.md b/research/msys-runtime-window-prefix/README.md
new file mode 100644
index 00000000..01c8be97
--- /dev/null
+++ b/research/msys-runtime-window-prefix/README.md
@@ -0,0 +1,16 @@
+# MSYS resize 输入前缀研究补丁
+
+本目录保存 [#52](https://github.com/JavaZeroo/termforge/issues/52) 的外部运行库实验,结果与限制见[实验记录](../../docs/research/vim-msys-runtime-prototype.md)。这是公开 MSYS/Cygwin 源码的研究补丁,不是 WindTerm 源码;不进入 TermForge 的默认构建或发布包,也不表示选定新的产品依赖或兼容策略。
+
+## 来源与许可
+
+- 上游:[git-for-windows/msys2-runtime](https://github.com/git-for-windows/msys2-runtime/tree/2e2ef940151485490aff0c7b00c00965ef7a71a4),固定提交 `2e2ef940151485490aff0c7b00c00965ef7a71a4`。
+- 原文件:[winsup/cygwin/fhandler/console.cc](https://github.com/git-for-windows/msys2-runtime/blob/2e2ef940151485490aff0c7b00c00965ef7a71a4/winsup/cygwin/fhandler/console.cc),属于 Cygwin,文件头要求遵循 `CYGWIN_LICENSE`。
+- 本补丁的上下文和修改遵循该文件的上游许可,**不由 TermForge 根目录的 MIT 许可证覆盖**。固定版本的 [CYGWIN_LICENSE](CYGWIN_LICENSE) 将该子目录默认许可列为 LGPLv3 或更新版本,并保留其中的 Linking Exception;完整文本 [COPYING.LIB](COPYING.LIB) 和 [COPYING](COPYING) 随附,三份许可文件均原样来自同一上游提交的 `winsup/`。
+- 修改方:TermForge contributors;日期:2026-10-27。仅调整 `WINDOW_BUFFER_SIZE_EVENT` 分支的事件消费位置;保留 `send_winch_maybe` 的解锁、SIGWINCH 与再加锁。鼠标分支、信号处理器 longjmp 的实际回归及正式兼容方案均未由本补丁验收。
+
+## 核对补丁
+
+在上述固定上游 checkout 中运行 `git apply --check /path/to/window-prefix.patch`,然后应用补丁。原源与补丁源分别构建,不能拿新的二进制直接覆盖原验收目标并宣称通过。补丁 SHA-256 为 `e942c2d08b7cc5a294203bf0a52f7414b9b19f3cd675624644feadf907418c77`。
+
+本轮使用独立 SDK 和原 Vim 的隔离副本,TermForge 自身的产品代码、测试方法、输入、断言与期限未改;构建条件、实际样本及不能外推的边界见实验记录。DLL、原始终端输出、工作目录与工具日志仅保存在本地,没有随本目录发布。
diff --git a/research/msys-runtime-window-prefix/build-packages.txt b/research/msys-runtime-window-prefix/build-packages.txt
new file mode 100644
index 00000000..9e594974
--- /dev/null
+++ b/research/msys-runtime-window-prefix/build-packages.txt
@@ -0,0 +1,336 @@
+apr 1.7.6-2
+apr-util 1.6.5-1
+asciidoc 10.2.1-2
+autoconf-wrapper 20260320-3
+autoconf2.13 2.13-6
+autoconf2.69 2.69-4
+autoconf2.71 2.71-4
+autoconf2.72 2.72-4
+autoconf2.73 2.73-1
+autogen 5.18.16-6
+automake-wrapper 20260320-3
+automake1.11 1.11.6-6
+automake1.12 1.12.6-6
+automake1.13 1.13.4-7
+automake1.14 1.14.1-6
+automake1.15 1.15.1-4
+automake1.16 1.16.5-1
+automake1.17 1.17-2
+automake1.18 1.18.1-2
+automake1.19 1.19-1
+autotools 2026.08.04-1
+bash 5.3.015-2
+bash-completion 2.18.0-1
+binutils 2.47-1
+bison 3.8.2-5
+bsdcpio 3.8.10-2
+bsdtar 3.8.10-2
+bzip2 1.0.8-4
+ca-certificates 20260816-2
+cocom 0.996-6
+coreutils 8.32-5
+curl 8.23.0-1
+dash 0.5.13.5-1
+db 6.2.32-6
+diffstat 1.69-1
+diffutils 3.12-1
+docbook-xml 4.5-6
+docbook-xsl 1.79.2-3
+docbook-xsl-ns 1.79.2-2
+docx2txt 1.4-2
+dos2unix 7.5.7-1
+expat 2.9.0-1
+file 5.48-1
+filesystem 2026.10.17-1
+findutils 4.11.0-2
+flex 2.6.4-4
+gawk 5.4.1-1
+gcc 16.2.0-1
+gcc-libs 16.2.0-1
+gdb 18.1-2
+gdbm 1.26-1
+gettext 0.22.5-1
+gettext-devel 0.22.5-1
+git 2.56.0-1
+git-for-windows-keyring 1.1.4.a0be1ed4-1
+gmp 6.3.0-2
+gnupg 2.4.9-3
+gnutls 3.8.13-2
+grep 1~3.0-7
+groff 1.24.2-1
+gzip 1.15-1
+heimdal 7.8.0-5
+heimdal-libs 7.8.0-5
+help2man 1.49.3-2
+iconv 1.19-1
+info 7.2-3
+isl 0.28-1
+less 710-1
+libarchive 3.8.10-2
+libasprintf 0.22.5-1
+libassuan 3.0.2-1
+libbz2 1.0.8-4
+libcbor 0.11.0-1
+libcurl 8.23.0-1
+libdb 6.2.32-6
+libedit 20240808_3.1-1
+libexpat 2.9.0-1
+libffi 3.8.0-1
+libfido2 1.15.0-1
+libgc 8.2.12-1
+libgcrypt 1.12.4-1
+libgdbm 1.26-1
+libgettextpo 0.22.5-1
+libgnutls 3.8.13-2
+libgpg-error 1.61-1
+libguile 3.0.11-1
+libhogweed 4.0-1
+libiconv 1.19-1
+libiconv-devel 1.19-1
+libidn2 2.3.8-1
+libintl 0.22.5-1
+libksba 1.8.1-1
+libltdl 2.6.2-2
+liblz4 1.10.0-1
+liblzma 5.8.4-1
+libnettle 4.0-1
+libnghttp2 1.70.0-1
+libnpth 1.8-1
+libopenssl 3.5.9-1
+libp11-kit 0.26.5-1
+libpcre 8.45-5
+libpcre16 8.45-5
+libpcre2_16 10.49-1
+libpcre2_32 10.49-1
+libpcre2_8 10.49-1
+libpcre2posix 10.49-1
+libpcre32 8.45-5
+libpcrecpp 8.45-5
+libpcreposix 8.45-5
+libpipeline 1.5.8-1
+libpsl 0.23.2-1
+libreadline 8.3.006-1
+libsasl 2.1.28-5
+libserf 1.3.10-2
+libsqlite 3.54.0-1
+libssh2 1.11.1-1
+libtasn1 4.21.0-1
+libtool 2.6.2-2
+libunistring 1.4.2-1
+libunrar 7.3.1-1
+libutil-linux 2.40.2-2
+libxcrypt 4.5.2-1
+libxml2 2.15.4-1
+libxslt 1.1.45-1
+libxxhash 0.8.4-1
+libzstd 1.5.7-1
+lndir 1.0.6-1
+m4 1.4.21-1
+make 4.4.1-3
+man-db 2.13.1-2
+markdown 1.0.1-2
+mingw-w64-cross-common-binutils 2.47-1
+mingw-w64-cross-crt 14.0.0.r501.gb13721ccf-1
+mingw-w64-cross-gcc 16.2.0-3
+mingw-w64-cross-mingw32-binutils 2.47-1
+mingw-w64-cross-mingw32-crt 14.0.0.r501.gb13721ccf-1
+mingw-w64-cross-mingw32-gcc 16.2.0-3
+mingw-w64-cross-mingw32-headers 14.0.0.r501.gb13721ccf-1
+mingw-w64-cross-mingw32-windows-default-manifest 6.4-5
+mingw-w64-cross-mingw32-winpthreads 14.0.0.r501.gb13721ccf-1
+mingw-w64-cross-mingw32-zlib 1.3.2-2
+mingw-w64-cross-mingw64-binutils 2.47-1
+mingw-w64-cross-mingw64-crt 14.0.0.r501.gb13721ccf-1
+mingw-w64-cross-mingw64-gcc 16.2.0-3
+mingw-w64-cross-mingw64-headers 14.0.0.r501.gb13721ccf-1
+mingw-w64-cross-mingw64-windows-default-manifest 6.4-5
+mingw-w64-cross-mingw64-winpthreads 14.0.0.r501.gb13721ccf-1
+mingw-w64-cross-mingw64-zlib 1.3.2-2
+mingw-w64-cross-mingwarm64-zlib 1.3.2-2
+mingw-w64-cross-ucrt64-binutils 2.47-1
+mingw-w64-cross-ucrt64-crt 14.0.0.r501.gb13721ccf-1
+mingw-w64-cross-ucrt64-gcc 16.2.0-3
+mingw-w64-cross-ucrt64-headers 14.0.0.r501.gb13721ccf-1
+mingw-w64-cross-ucrt64-windows-default-manifest 6.4-5
+mingw-w64-cross-ucrt64-winpthreads 14.0.0.r501.gb13721ccf-1
+mingw-w64-cross-ucrt64-zlib 1.3.2-2
+mingw-w64-cross-zlib 1.3.2-2
+mingw-w64-ucrt-x86_64-7zip 26.05-1
+mingw-w64-ucrt-x86_64-antiword 0.37-3
+mingw-w64-ucrt-x86_64-asciidoctor 2.0.26-2
+mingw-w64-ucrt-x86_64-binutils 2.47-4
+mingw-w64-ucrt-x86_64-brotli 1.2.1-1
+mingw-w64-ucrt-x86_64-bzip2 1.0.8-4
+mingw-w64-ucrt-x86_64-c-ares 1.34.9-1
+mingw-w64-ucrt-x86_64-ca-certificates 20260816-3
+mingw-w64-ucrt-x86_64-cc-libs 16.2.0-6
+mingw-w64-ucrt-x86_64-connect 1.105-5
+mingw-w64-ucrt-x86_64-crt 14.0.0.r536.g7ce22f663-1
+mingw-w64-ucrt-x86_64-curl-openssl-alternate 8.23.0-1
+mingw-w64-ucrt-x86_64-curl-winssl 8.23.0-1
+mingw-w64-ucrt-x86_64-cv2pdb 0.53-1
+mingw-w64-ucrt-x86_64-docx2txt-rs 0.2.0-1
+mingw-w64-ucrt-x86_64-expat 2.9.0-1
+mingw-w64-ucrt-x86_64-gcc 16.2.0-6
+mingw-w64-ucrt-x86_64-gcc-libs 16.2.0-6
+mingw-w64-ucrt-x86_64-gdb 18.1-3
+mingw-w64-ucrt-x86_64-gdbm 1.26-1
+mingw-w64-ucrt-x86_64-gettext-libtextstyle 1.0-1
+mingw-w64-ucrt-x86_64-gettext-runtime 1.0-1
+mingw-w64-ucrt-x86_64-gettext-tools 1.0-1
+mingw-w64-ucrt-x86_64-git 2.56.0.4-1
+mingw-w64-ucrt-x86_64-git-credential-manager 2.9.1-1
+mingw-w64-ucrt-x86_64-git-credential-wincred 2.56.0.4-1
+mingw-w64-ucrt-x86_64-git-doc-html 2.56.0.4-1
+mingw-w64-ucrt-x86_64-git-extra 1.1.715.85f886165-1
+mingw-w64-ucrt-x86_64-git-for-windows-addons 2.56.0.4-1
+mingw-w64-ucrt-x86_64-git-gui 2.56.0.4-1
+mingw-w64-ucrt-x86_64-git-lfs 3.8.1-1
+mingw-w64-ucrt-x86_64-git-perl 2.56.0.4-1
+mingw-w64-ucrt-x86_64-git-send-email 2.56.0.4-1
+mingw-w64-ucrt-x86_64-git-subtree 2.56.0.4-1
+mingw-w64-ucrt-x86_64-git-svn 2.56.0.4-1
+mingw-w64-ucrt-x86_64-gitk 2.56.0.4-1
+mingw-w64-ucrt-x86_64-gmp 6.3.0-2
+mingw-w64-ucrt-x86_64-gnutls 3.8.13-3
+mingw-w64-ucrt-x86_64-headers 14.0.0.r536.g7ce22f663-1
+mingw-w64-ucrt-x86_64-isl 0.28-1
+mingw-w64-ucrt-x86_64-libatomic 16.2.0-6
+mingw-w64-ucrt-x86_64-libb2 0.98.1-3
+mingw-w64-ucrt-x86_64-libffi 3.8.0-1
+mingw-w64-ucrt-x86_64-libgcc 16.2.0-6
+mingw-w64-ucrt-x86_64-libgomp 16.2.0-6
+mingw-w64-ucrt-x86_64-libiconv 1.19-1
+mingw-w64-ucrt-x86_64-libidn2 2.3.8-4
+mingw-w64-ucrt-x86_64-libmangle 14.0.0.r536.g7ce22f663-1
+mingw-w64-ucrt-x86_64-libpsl 0.21.5-3
+mingw-w64-ucrt-x86_64-libquadmath 16.2.0-6
+mingw-w64-ucrt-x86_64-libssh2-wincng 1.11.1-2
+mingw-w64-ucrt-x86_64-libstdc++ 16.2.0-6
+mingw-w64-ucrt-x86_64-libsystre 1.0.2-3
+mingw-w64-ucrt-x86_64-libtasn1 4.21.0-1
+mingw-w64-ucrt-x86_64-libtre 0.9.0-2
+mingw-w64-ucrt-x86_64-libunistring 1.4.2-1
+mingw-w64-ucrt-x86_64-libwinpthread 14.0.0.r536.g7ce22f663-1
+mingw-w64-ucrt-x86_64-libyaml 0.2.5-2
+mingw-w64-ucrt-x86_64-libzip 1.12.1-1
+mingw-w64-ucrt-x86_64-mpc 1.4.1-1
+mingw-w64-ucrt-x86_64-mpdecimal 4.0.1-3
+mingw-w64-ucrt-x86_64-mpfr 4.2.2-3
+mingw-w64-ucrt-x86_64-ncurses 6.6-4
+mingw-w64-ucrt-x86_64-nettle 4.0-1
+mingw-w64-ucrt-x86_64-nghttp2 1.70.0-1
+mingw-w64-ucrt-x86_64-odt2txt 0.5-4
+mingw-w64-ucrt-x86_64-openssl 3.5.9-1
+mingw-w64-ucrt-x86_64-osslsigncode 2.14-1
+mingw-w64-ucrt-x86_64-p11-kit 0.26.5-1
+mingw-w64-ucrt-x86_64-pcre 8.45-2
+mingw-w64-ucrt-x86_64-pcre2 10.49-1
+mingw-w64-ucrt-x86_64-pkgconf 1~3.0.10-1
+mingw-w64-ucrt-x86_64-python 3.14.9-1
+mingw-w64-ucrt-x86_64-readline 8.3.003-1
+mingw-w64-ucrt-x86_64-ruby 4.0.9-1
+mingw-w64-ucrt-x86_64-sqlite3 3.54.0-1
+mingw-w64-ucrt-x86_64-tcl 8.6.18-1
+mingw-w64-ucrt-x86_64-termcap 1.3.1-8
+mingw-w64-ucrt-x86_64-tk 8.6.18-1
+mingw-w64-ucrt-x86_64-tools 14.0.0.r536.g7ce22f663-1
+mingw-w64-ucrt-x86_64-tzdata 2026e-1
+mingw-w64-ucrt-x86_64-windows-default-manifest 20260815-1
+mingw-w64-ucrt-x86_64-wineditline 2.208-1
+mingw-w64-ucrt-x86_64-winpthreads 14.0.0.r536.g7ce22f663-1
+mingw-w64-ucrt-x86_64-wintoast 1.0.0.275.a44fa02-1
+mingw-w64-ucrt-x86_64-xpdf-tools 4.06-1
+mingw-w64-ucrt-x86_64-xxhash 0.8.4-1
+mingw-w64-ucrt-x86_64-xz 5.8.4-1
+mingw-w64-ucrt-x86_64-zlib 1.3.2-3
+mingw-w64-ucrt-x86_64-zstd 1.5.7-2
+mintty 1~3.8.3-1
+mpc 1.4.1-1
+mpdecimal 4.0.1-1
+mpfr 4.2.2-1
+msys2-keyring 1~20260814-1
+msys2-launcher 1.5-3
+msys2-runtime 3.6.10-4
+msys2-runtime-devel 3.6.10-4
+msys2-w32api-headers 14.0.0.r0.g9b3dd0125-1
+msys2-w32api-runtime 14.0.0.r0.g9b3dd0125-1
+nano 9.2-1
+ncurses 6.6-2
+nettle 4.0-1
+openssh 10.6p1-1
+openssl 3.5.9-1
+p11-kit 0.26.5-1
+pacman 6.1.0-26
+pacman-contrib 1.10.6-2
+pacman-mirrors 20260129-1
+patch 2.8.1-1
+patchutils 0.4.3-1
+pcre 8.45-5
+pcre2 10.49-1
+perl 5.42.3-3
+perl-authen-sasl 2.2100-2
+perl-class-inspector 1.36-2
+perl-clone 0.51-1
+perl-convert-binhex 1.125-3
+perl-encode-locale 1.05-3
+perl-error 0.17030-3
+perl-file-listing 6.16-2
+perl-file-sharedir 1.118-2
+perl-html-parser 3.86-2
+perl-html-tagset 3.24-2
+perl-http-cookiejar 0.014-2
+perl-http-cookies 6.12-2
+perl-http-daemon 6.17-2
+perl-http-date 6.08-2
+perl-http-message 7.04-2
+perl-http-negotiate 6.01-4
+perl-inc-latest 0.500-3
+perl-io-html 1.004-3
+perl-io-socket-ssl 2.099-2
+perl-io-stringy 2.113-4
+perl-json 4.11-2
+perl-libwww 6.83-3
+perl-locale-gettext 1.07-14
+perl-lwp-mediatypes 6.05-2
+perl-mailtools 2.22-2
+perl-mime-tools 5.518-2
+perl-module-build 0.4234-3
+perl-net-http 6.24-2
+perl-net-smtp-ssl 1.04-3
+perl-net-ssleay 1.96-2
+perl-termreadkey 2.38-9
+perl-test-pod 1.52-3
+perl-timedate 2.35-2
+perl-try-tiny 0.32-2
+perl-uri 5.40-1
+perl-www-robotrules 6.03-2
+perl-xml-parser 2.59-2
+perl-yaml-syck 1.47-3
+pinentry 1.3.3-1
+pkgconf 1.7.4-1
+pkgfile 26-1
+popt 1.19-1
+python 3.12.15-1
+rebase 4.5.0-5
+rsync 3.5.1-2
+sed 4.9-1
+ssh-pageant 1.4.r15.gc804ba4-1
+subversion 1.14.5-3
+swig 4.5.1-1
+tar 1.35-3
+tig 2.6.1-1
+time 1.10-1
+tzcode 2026e-1
+unzip 6.0-3
+util-linux 2.40.2-2
+vim 9.2.1178-1
+which 2.25-1
+windows-default-manifest 20260815-1
+winpty 0.4.3-3
+xmlto 0.0.29-2
+xxhash 0.8.4-1
+xz 5.8.4-1
+zlib 1.3.2-1
+zlib-devel 1.3.2-1
+zstd 1.5.7-1
diff --git a/research/msys-runtime-window-prefix/window-prefix.patch b/research/msys-runtime-window-prefix/window-prefix.patch
new file mode 100644
index 00000000..92f2b91b
--- /dev/null
+++ b/research/msys-runtime-window-prefix/window-prefix.patch
@@ -0,0 +1,27 @@
+--- a/winsup/cygwin/fhandler/console.cc
++++ b/winsup/cygwin/fhandler/console.cc
+@@ -1486,12 +1486,18 @@
+ break;
+
+ case WINDOW_BUFFER_SIZE_EVENT:
+- if (send_winch_maybe ())
+- {
+- stat = input_winch;
+- goto out;
+- }
+- /* fall through */
++ {
++ /* Retire the peeked prefix while input_mutex still protects it.
++ send_winch_maybe releases that mutex for signal delivery, so
++ neither the queue prefix nor the remaining peek is valid after
++ it returns. A non-resizing event starts a fresh input pass. */
++ DWORD discarded = 0;
++ acquire_attach_mutex (mutex_timeout);
++ ReadConsoleInputW (get_handle (), input_rec, i + 1, &discarded);
++ release_attach_mutex ();
++ con.num_processed -= min (con.num_processed, discarded);
++ return send_winch_maybe () ? input_winch : stat;
++ }
+ default:
+ continue;
+ }