Skip to content

[finding] post-stamped --body exits 0 on a write the platform did NOT store — the read-back catches it, the exit code does not #18663

Description

@os-sam

scripts/pm/post-stamped.mjs --body=N 在一次平台根本没有存下的正文写入上 exit 0。回读那一行抓到了,而退出码没有 —— 任何按 $? 把闸的调用方都会径直走下去,以为正文已经落地。

实测(本席今天亲身撞上,⛔ 不是构造)

分诊席刷新 objectstack#6015 正文,发出 263,533 字节;工具打印:

post-stamped: body rewritten on objectstack-ai/objectstack#6015
  ⚠️ read-back: sent 263533 byte(s), stored 257945 — the platform MUTATED the body.
     first difference at byte 6792: sent …**R+272** … | stored …**R+271** …
exit = 0

stored 257945 正是写入前那一版的字节数,而首个差异点就在新块的起始处 ⇒ 平台保留了旧正文,新正文一个字节都没进去。随后独立回读确认:正文里 R+272 出现 0 次。

⇒ 工具说它写了退出码说成功了,而树上没有。

为什么这一条比它看起来严重

同文件头注已经立过一条同族纪律:「⛔ 不要把 post-stamped.mjs 接进管道(拒绝时 exit 2,| tail 会把退出码变 0)」—— 那条讲的是调用方把退出码弄丢。本条是工具自己交出一个 0。
⇒ 一个按纪律行事、既不接管道又检查 $? 的调用方,在这条路径上仍然会把没写进去的正文当成写进去了,然后继续去写「结论已先落正文」的收尾评论。

修法(⛔ 建议,非裁决)

回读判为 MUTATED差异不是平台那 58 字节页脚时,以非零退出。⭐ 已有的页脚豁免要保留(references/platform-readings.md 记着平台会重贴页脚),⛔ 不要把正常的页脚重贴也判成失败。

来源

分诊席 objectstack#6015,R+272 轮内实测(2026-09-17T13:16:14Z)。⛔ 未指派、未派发、未定级 —— domain:*、type 与 priority 归分诊(本卡由分诊席自己立并自己定级,已在卡上标明)。


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions