You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One raw control byte makes grep treat the whole file as binary: zero matches, no signal, and the rule you just wrote becomes invisible to every agent that greps for it.
这是该段唯一给出的理由,而它只对 NUL 成立。门禁脚本头(scripts/check-nul-bytes.mjs,#5157 段)早就实测并写明了这点:「GNU grep 3.11 and ripgrep 14.1 report 'binary file matches' for a file carrying 0x00, and keep matching normally for one carrying 0x01 or 0x03」。本单在容器内独立复现,结论一致(grep 3.11 + ripgrep,样本均为「一枚控制字节 + 一行可搜索文本」,用 printf 生成,未粘贴裸字节):
样本字节
grep -n searchable(不加 -a)
rg -n searchable
U+0000
binary file matches(不打印行内容)
binary file matches (found "\0" byte around offset 6)
发现于 #5484(PR #5577)的实施:那一单只裁定补字符类,本条按 Prime Directive #10 单独记录,未在该 PR 里扩大范围。
事实
.claude/agents/os-dev.md「Byte discipline」段(按内容 grep 定位,现约 :269-271)把危害陈述成:这是该段唯一给出的理由,而它只对 NUL 成立。门禁脚本头(
scripts/check-nul-bytes.mjs,#5157 段)早就实测并写明了这点:「GNU grep 3.11 and ripgrep 14.1 report 'binary file matches' for a file carrying 0x00, and keep matching normally for one carrying 0x01 or 0x03」。本单在容器内独立复现,结论一致(grep 3.11 + ripgrep,样本均为「一枚控制字节 + 一行可搜索文本」,用printf生成,未粘贴裸字节):grep -n searchable(不加-a)rg -n searchablebinary file matches(不打印行内容)binary file matches (found "\0" byte around offset 6)2:searchable line2:searchable line2:searchable line2:searchable line即:门禁扫描面里除 NUL 之外的每个字节(含 #5460 刚纳入、#5484 刚补进自扫字符类的 U+007F),都不会让文件被当成二进制。
为什么这不只是文字不精确
这条指令的读者是 agent,而 agent 会做一致性推理:
门禁脚本头恰好把真正适用于全字节类的三条危害写清楚了(渲染为空、两种拼写都搜不到、事故源不挑字节值),
os-dev.md一条都没搬 —— 它搬的是唯一那条不适用的。这与 #5484 是同一族问题的另一半:同一事实手抄多处,门禁那侧修了,指令这侧没跟。顺带两处同段陈旧(建议一并核,不单独开单):
0x01thatcheck:nul-bytesdoes not scan for (check:nul-bytes 只扫 NUL(0x00)—— 0x01-0x08 等控制字节不在扫描面,#5140 实测一个 0x01 会从 NUL-only 修复下溜走 #5157)」:现在时读法已错 —— check:nul-bytes 只扫 NUL(0x00)—— 0x01-0x08 等控制字节不在扫描面,#5140 实测一个 0x01 会从 NUL-only 修复下溜走 #5157 正是把 U+0001 纳入扫描面的那一单。处置建议(仅供分诊参考,未实施)
把该段的危害句改成与门禁脚本头一致的口径:NUL 那条危害点名 NUL,其余字节引用「渲染为空 / 两种拼写都不可搜 / 事故源不挑字节」三条(可压成一句,该文件是 prompt,每个词都进每次派单的 token 预算)。顺带修正上面两处陈旧计数与时态。
归类
observation-class:今天没有用户会撞到;它降低的是 agent 遵循这条指令的可靠性,且只有在 agent 恰好写出一枚非 NUL 控制字节时才发作。故只打
finding,不打pm:queue,不指派 —— 严重度交分诊轮判。Generated by Claude Code