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
撤掉改动后会失败的断言:tool:read guidance must not reach a scope that hides it、the grep cross-reference to the hidden read must not survive verbatim、the hidden read keeps an executable alternative in the assembly、the hidden names contribute no provider guidance bytes。
Activity
Thatgfsj commentedon Nov 19, 2026
983 / main@58f6e28 / src/publication/replacements.ts、test/ptc-guidance-cleanup.test.mjs(新增)、docs/native-output.md、docs/CHANGELOG.md / 第一个失败样例:挂真实 dsh-tool-fs/dsh-tool-fs-search 后 ops-ptc 隐藏 read/glob/grep,装配仍输出宿主
tool:read段正文 "Use the read tool",tool:grep仍教 "Use read on a matched file"——指向已隐藏名字的死指针Thatgfsj commentedon Nov 19, 2026
完成(Refs #961):清除指向已隐藏官方文件工具的系统指引。
载体:补充 commit
1d15083(fix(ptc): retire guidance that names hidden official file tools)fast-forward 推到 Nicholas023/dsh-ops 的fix-ptc-hide-official(PR #961 head 2fc5540 → 1d15083,未 force、未改写历史)。分支p4-guidance-cleanup。修改前结果(红,基线 2fc5540,真实 dsh-tool-fs/-fs-search fixture):
tool:read全文 "Use the read tool — not shell commands like cat…"(断言tool:read guidance must not reach a scope that hides it失败);tool:grep仍教 "Use read on a matched file",且无可执行替代断言失败;首跑 3 fail / 6。
修改后(绿):ptc-guidance-cleanup 6/6。实现位于
src/publication/replacements.ts:隐藏判定提取为 shadowwhen与装配共用的同一hiddenByPtc;在受支持的system-prompt/assemble瀑布中,PTC 呈现下移除已隐藏名字的宿主tool:*段;保留工具的段含死指针时整段移除并补一行指名可执行 OPS 替代(dsh-ops:replaced-official:<mode>);不含死指针的保留段(tool:glob、tool:write、tool:edit)原样存活。撤下模式行后宿主文案逐字恢复(含 grep 对 read 的交叉引用一并回归);hideOfficialTools:false与 Native 子作用域不受影响。不改宿主注册表、不做字符串替换;#866 的 Native 侧保持开放。撤掉改动后会失败的断言:
tool:read guidance must not reach a scope that hides it、the grep cross-reference to the hidden read must not survive verbatim、the hidden read keeps an executable alternative in the assembly、the hidden names contribute no provider guidance bytes。定向验证(Linux,DSH_OPS_WORKER_BIN=runtime/linux-x64/dsh-ops-worker,sha256 前缀 2b5f988d;先 npm run build 重建 lib):ptc-guidance-cleanup 6/6;回归 ptc-hide-official 13、native-guidance 2、replacements-admission 11、replace-concurrency 2、replace-size 3、mode-contract-audit 4、modes 12、prompt-budget 1 全绿;check:size 通过(823 文件,最长 930 行)。release-tar-modes 在未改动基线同样失败(本机 npm bundled tar 缺失,环境问题,与本次无关)。
分项字节差(同一 fixture 隐藏 − 未隐藏,只报相对差):SDK −2,011 B(与 #978 记录一致);宿主指引段 tool:read/tool:glob/tool:grep −338 B;其他 system 段 0 B;外层 wire 0 B(两种状态都只有 run_code)。
文档:docs/native-output.md 与 docs/Native输出.md 的 #866 依赖段补记 PTC 侧收口及边界;docs/CHANGELOG.md
## [Unreleased]增双语条目。Thatgfsj commentedon Nov 20, 2026
已由 #1033 合入 main 交付(18 张卡并集,见 PR 描述与 docs/CHANGELOG.md 的 Unreleased 条目)。