Repository navigation
v0.4.4 — host-owned guard state via a wire projection + resume seed fix
v0.4.4 — one judge instead of two
The host now registers its verdict as a
contextGuardwire projection
(level / armed / turn / cooldown / ratio) and the browser half only renders it. The client's state machine,
its host-sync fetch and the settleTurn-on-button timer are gone;/statestays as a read-only debug mirror.Two live bugs fixed:
- a restored session never warned:
onResumereturned a signal but wrote nothing into the state, so a
67% session stayednonewhile the badge showed 67% (it readscontextPressure). It now folds the reading
into the state first, then decides whether to emit the resume signal (>= hardRatio only).- the mirror view never updated for restored sessions: it read the registry's folded state, which is only
driven by new events. It now reads the live engine state, cached by its five fields so unchanged values keep
the same reference.Build fix: the Windows CRLF worktree made the generated bundle differ from the Linux one (63,403 vs 62,533
chars), so CI's clean-tree gate always failed. Sources are now read through a CRLF→LF normalizer and the
bundle is written as LF.Tests: 80/80 (new
test/resume.test.mjspins the exact failure: a 67% resume must producelevel: hardin
both engine state and mirror view; 48% seeds warn without a resume signal; unknown reading changes nothing).
中文
v0.4.4 —— 一个裁判,而不是两个
宿主把判定结果注册成
contextGuardwire 投影(level / armed / turn / cooldown / ratio),浏览器只负责显示。
客户端的整台状态机、宿主同步 fetch、挂在按钮上的settleTurn全部删除;/state降级为只读调试镜像。修了两个真机 bug:
- 恢复的会话从不提示:
onResume只返回信号、不写状态,于是 67% 的会话在投影里是none
(徽标仍显示 67%,因为它读的是官方contextPressure)。现在先把读数折进状态,再决定是否发恢复信号。- 镜像对恢复的会话永远不更新:它读的是注册表那份只在新事件里更新的折叠态。现在读引擎当前判定,
按五字段缓存保证「值没变就返回同一引用」。构建修复:Windows 检出是 CRLF、脚本写 LF ⇒ 生成物字符数不同,CI 的 clean-tree 永远红。现在读写都归一成 LF。
测试:80/80(新增
test/resume.test.mjs把这次故障形状钉死)。