Skip to content

test(core): replay post-reflow CUP addressing after narrowing (#29) - #309

Merged
JavaZeroo merged 3 commits into
mainfrom
agent/resume-issue-29-336ac0d09719
Nov 3, 2026
Merged

JavaZeroo merged 3 commits into
mainfrom
agent/resume-issue-29-336ac0d09719

Conversation

@JavaZeroo-Bot

Copy link
Copy Markdown
Collaborator

问题与最终行为

承接 #29(接续 #27 / PR #308):补上正式接线前缺失的关键证据——缩窄使前方行显示重排后,继续 CUP 寻址写入、DSR、光标/文档位置与显示位置的对应关系。

本 PR 新增一个运行前冻结的直接 Telnet 观察切片:固定 WindTerm 2.7.0,91×20 → 61×20 → 91×20,四阶段,唯一动作 CSI 8;2H Q。初始正文在目标行之前写入一条 123 字符软折行,使缩窄后后续显示行整体 +1,而保留的源片段行号不变,从而区分"协议行=保留行"与"协议行=重排显示行"两种解释。

实测(一次独立原版运行,严格导出通过):Q 写入文档行 6(保留的缩放前源片段行),不是重排后的显示行 5;DSR 8;3、caret 同口径;窄屏可见矩形 (155,144),恢复后 (155,126)。因此协议/光标/DSR 行号跟随保留行,显示页独立重排,显示行号不能当协议行号。

该合同已落地为 reflow_addressing_core 字面回归门禁:16/16 阶段、0/620 断言;核心 CTest 35/35。没有生产源码改动(screen.hpp 与 main 0420137 字节一致):现有同 owner 保留 + 独立显示投影已与本原版样本一致,因此只补证据与门禁,不制造实现改动。默认 Screen::resize 与正式 Qt 仍走物理裁剪,本 PR 不切换、也不豁免 Qt 六阶段 B/CD 失败。

验证

原版(research/ui/results/2026-11-03-reflow-addressing-reference/shrink-reflow-cup.json):

  • 源码基点 2d27000(观察前冻结的协议与预期),10 文件执行源码清单、授权计划 SHA256 19006f…、公开 JSON SHA256 1bb625…;REA 6.7.0/frida、EXE 7b10531d…、4,047 文件清单 e459adf2…。
  • 只有一个计划被执行一次;首个 guest 请求在计划创建前因脚本引号失败(未启动原版、未写计划/attempt),已如实记录。
  • 原审计通过、严格导出通过;job_after.active=0,主动终止原版进程,不声称自然 GUI 退出。

离线/core:

python -B -X utf8 -m unittest research.ui.test_resize_addressing_reflow_reference research.ui.test_export_resize_addressing_reflow_reference -v
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release --target resize_reflow_addressing_test --parallel 4
& build/bin/Release/resize_reflow_addressing_test.exe
ctest --test-dir build -C Release -R "_core$" --output-on-failure

结果:11+10 个离线测试通过(不启动原版);resize_reflow_addressing_test 16/16 阶段、0/620 断言、退出 0;核心 CTest 35/35、4.11 s。门禁首跑 12/16 是测试自身阶段 3 预期分支笔误(非产品 RED),修正后 16/16,记录保留在 validation.json。

性能影响(如适用)

未测量,不声明性能。核心回放与 CTest 的总耗时是测试执行时间,不是性能结果。

来源与限制

  • 单例、固定 ASCII、单主屏、一个动作;不覆盖高度变化、备用/隐藏帧、连续 resize/在途输出、历史淘汰、宽字/结合字/Unicode、样式、margin/origin、保存光标、Qt/固定 ConPTY 或性能。
  • Qt 接入仍未完成:后续需把保留事务与显示投影接到正式 Qt,闭合显示光标、已有选择映射与 B/CD 失败,并补备用屏/高度/连续尺寸证据。
  • [R2-04][终端] 实现备用屏、滚动区域及关联模式 #27/[R2-06][终端] 定义并验证 resize、逻辑行与历史语义 #29 保持 OPEN;不声明完整 reflow、WindTerm 等价或 R2 完成。合并由用户决定,不启用自动合并、不请求 Codex 自动 review。

JavaZeroo-Bot and others added 3 commits November 3, 2026 10:56
Add a four-stage, one-action direct-Telnet observation that distinguishes
whether CUP addressing after narrowing follows the retained (pre-resize) rows
or the current reflowed display rows. The fixed body puts a 123-character
soft-wrapped line before the target rows, so narrowing shifts later display
rows by one while retained rows keep their numbering. The design document
records both competing interpretations and their independent expectations
before any original run; the exporter can publish either pre-registered
target row without choosing a policy. Offline peer, plan and exporter tests
only use in-memory/synthetic targets.

Co-authored-by: JavaZeroo <[email protected]>
One fixed direct-Telnet WindTerm 2.7.0 run (four stages, one CSI 8;2HQ
action) whose body places a 123-character soft-wrapped line before the
target rows. Narrowing 91 -> 61 shifts later display rows by one while the
retained rows keep their numbering. Result: Q lands on document line 6
(retained rows; the reflowed display row would be 5), DSR 8;3, narrow rect
(155,144) and restored (155,126). Strict offline export passed; one
original run, no retry.

Co-authored-by: JavaZeroo <[email protected]>
)

Add reflow_addressing_core, a literal regression gate for the observed
sample: four phases (91x20 -> 61x20 -> 91x20, one CSI 8;2HQ), each checked
under strict/recovery and whole/bytewise, covering protocol grid, DSR,
joined source logical rows and the reflowed display rows/marker positions.
16/16 phases, 0/620 assertions, exit 0; core CTest 35/35.

No production source change: screen.hpp bytes are identical to main, so
the existing retained-owner plus independent display-projection design
already matches the observation. Default Screen::resize and Qt still clip
physically; the evidence and docs state that separately.

Co-authored-by: JavaZeroo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants