Skip to content

v0.4.0

Choose a tag to compare

@zht7063 zht7063 released this 28 Oct 10:06
6cf512b

English

MWF 0.4.0 adds a Codex end-of-turn self-check, tighter per-event hook timeouts, and host load confirmation. Receipt version stays 3 (a confirmed receipt still parses with the 0.3.1 client schema).

Changes

  • Codex Stop hook handoff self-check (#32): at the end of each agent turn the Codex plugin asks the agent once to check whether the turn produced anything worth saving to .mwf/ (preference/decision/incident/task/knowledge, via mwf_add/mwf_propose) and whether there was substantive progress that needs a mwf_handoff save (read the revision, then save with expected_revision). Pure chat turns are skipped. stop_hook_active, disabled projects, timeouts and any failure (including empty/invalid input) let the stop through silently; a local (session_id, turn_id) marker makes sure a turn is blocked at most once.
  • Per-event hook timeouts and lock budget (issue #30, #33): SessionStart/UserPromptSubmit hooks.json timeout goes back from 15 s to 5 s (runner deadline 4.5 s); Stop keeps 15 s (14.5 s). The hook path no longer loads the o200k tokenizer (conservative approx_chars_v1 estimate instead), the tokenizer is loaded lazily on first exact count, identical mwf_recall requests within 30 s are served from a cache with file-fingerprint validation, and the project-lock wait on the hook path is capped at 2 s (withLockDeadline, fail-open with a "memory not restored" notice). New scripts/measure-hook.ts measures cold-start hook latency.
  • Host load confirmation (#34): after attach/rebind the integration is pending until the host actually loads it; the first Codex hook, Pi extension event (trusted project) or MCP tool call marks it confirmed.

Verification and limits

  • npm test: 198 pass, 0 fail; CI green on Node 22.19 and 24.
  • Release criteria linux-cli-harness/1: Codex CLI 0.163.0 and Pi 1.3.0 harness evidence both pass for the exact release commit; RELEASE-STATUS.json reports publishable: true.
  • Real-host testing is deferred to 1.0. The new hook timeouts (5 s / 15 s) are provisional and were not validated on a real Codex desktop or billed-model host; the harnesses use a synthetic model endpoint. Not verified: Codex desktop GUI, macOS hosts, performance report, real (billed) model hosts.

Artifacts

  • zht7063-mwf-0.4.0.tgz — npm package
  • mwf-codex-0.4.0.zip — Codex plugin
  • SHA256SUMS, RELEASE-STATUS.json

Verify with shasum -a 256 -c SHA256SUMS.

中文

MWF 0.4.0 新增 Codex 回合结束自检、按事件区分的 hook 超时与宿主加载确认。receipt 版本仍为 3(已确认的 receipt 仍可被 0.3.1 客户端 schema 解析)。

变更

  • Codex Stop hook 交接自检(#32): 每个 agent 回合结束时,Codex 插件提示 agent 一次:自检本回合是否有值得保存到 .mwf/ 的 preference/decision/incident/task/knowledge(经 mwf_add/mwf_propose 写入),以及是否有实质进展需要经 mwf_handoff 保存交接(先 read 取 revision,再以 expected_revision 保存)。纯聊天回合跳过。stop_hook_active、项目未启用、超时或任何失败(含空/非法输入)均静默放行;本地 (session_id, turn_id) 标记保证同一回合最多 block 一次。
  • 按事件 hook 超时与锁预算(issue #30、#33): SessionStart/UserPromptSubmit 的 hooks.json timeout 由 15 秒恢复为 5 秒(runner 截止 4.5 秒);Stop 保持 15 秒(14.5 秒)。hook 路径不再加载 o200k tokenizer(改用保守估算 approx_chars_v1),tokenizer 在首次精确计量时才懒加载,30 秒内相同的 mwf_recall 请求(含文件指纹校验)复用缓存,hook 路径项目锁等待上限为 2 秒(withLockDeadline,超时 fail-open 并提示“未恢复记忆”)。新增 scripts/measure-hook.ts 测量冷启动 hook 延迟。
  • 宿主加载确认(#34): attach/rebind 后集成状态为 pending,直到宿主真正加载;首次 Codex hook、Pi 扩展事件(受信任项目)或 MCP 工具调用将其标为 confirmed。

验证与限制

  • npm test:198 通过,0 失败;CI 在 Node 22.19 与 24 上通过。
  • 标准 linux-cli-harness/1:Codex CLI 0.163.0 与 Pi 1.3.0 的 harness 证据对本次发布 commit 均通过;RELEASE-STATUS.json 为 publishable: true。
  • 真机(真实宿主)测试推迟到 1.0。 新的 hook 超时(5 秒 / 15 秒)为暂定值,未在真实 Codex 桌面或计费模型宿主上验证;harness 使用合成模型端点。未验证:Codex 桌面 GUI、macOS 主机、性能报告、真实(计费)模型宿主。

产物

  • zht7063-mwf-0.4.0.tgz:npm 包
  • mwf-codex-0.4.0.zip:Codex 插件
  • SHA256SUMS、RELEASE-STATUS.json

用 shasum -a 256 -c SHA256SUMS 校验。