Skip to content

fix: harden CLI receipts and preview watching - #314

Open
testikun wants to merge 1 commit into
tt-a1i:mainfrom
testikun:codex/priority-issues-311-305-310
Open

fix: harden CLI receipts and preview watching#314
testikun wants to merge 1 commit into
tt-a1i:mainfrom
testikun:codex/priority-issues-311-305-310

Conversation

@testikun

@testikun testikun commented Sep 5, 2026

Copy link
Copy Markdown

Summary

Fixes #311, #305, and #310:

  • Preserve validation output larger than 64 KB.
  • Reject invalid flags and extra positional arguments in check, examples, doctor, and demo.
  • Normalize the watched directory before starting the Windows preview watcher.

Validation

60 focused tests pass, including the CLI and preview regression suites. The required ablation experiment confirmed all three changes are necessary.

@sunsunsun-java

Copy link
Copy Markdown
Collaborator
  1. 更新分发 ZIP——需要修改
    本次修改了三个运行时文件,但 archify.zip 尚未同步。我们使用同一份输入验证:源码版校验成功,ZIP 解压版仍报 JSON at position 65536,因此通过 ZIP 安装的用户无法获得修复。请使用仓库规定的 Node 22 构建流程重建并提交 ZIP,同时验证解压后的实际安装包。

  2. 补充针对性回归测试——需要修改
    请为这三项行为修复补充能在修复前失败、修复后通过的回归测试。现有测试通过尚不能覆盖本次触发条件:

  1. 明确 1 MiB 容量边界——需要说明范围
    另外发现一个既有容量边界:runNode() 使用的 spawnSync 仍受默认 1 MiB 缓冲上限约束。实测 checker 返回 9/9 通过、回执为 1,148,021 字节时,validate、deliver、compare 均因内部 ENOBUFS 失败。
    这不是本 PR 引入的新回归,但意味着“不受回执大小影响”的要求尚未完全实现。请明确本 PR 是否同时处理该边界;若本次仅修复 process.exit() 导致的截断,建议在描述中注明剩余限制,并另行跟踪容量问题。

@YunyueLi

YunyueLi commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

The #311 portion of this PR is now superseded by the more focused PR #321, which includes dedicated large-receipt regressions, a rebuilt distribution ZIP, and passing cross-platform CI. This branch still has the same remaining >1 MiB spawnSync buffer boundary because its #311 change is also limited to replacing process.exit() with process.exitCode.

Independent reproduction against the #321 implementation produced a 1,084,196-byte valid checker receipt: direct file output exited 0, while the internal pipe returned ENOBUFS; validate, deliver, and compare all exited 1. The same runNode() path is unchanged here.

Recommendation:

This keeps the receipt fix reviewable and avoids merging overlapping implementations with different validation coverage.

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.

[Bug]: artifact-check receipt > 64 KB is truncated by process.exit() after console.log — validate/deliver/compare fail with "JSON at position 65536"

3 participants