Uh oh!
There was an error while loading. Please reload this page.
Plan Mode 三项改进:指示器内联、必定可退出、bash 按副作用判定 - #31
Merged
Conversation
Allow quoted literal arguments and a narrow set of read-only search and inspection tools.\nKeep shell expansion, composition, unsafe flags, and unknown effects fail-closed so plan mode cannot mutate before approval.
The first pass added cluster handling twice: once inside scanArguments and once in a separate scanShortFlagClusters pass. The scanArguments branch was not gated by program, so it silently widened git and gh too. Collapse both into one opt-in parameter that only the file-inspection programs pass.
The leaner default layout from #26 leaves room for a single status to inline at width 80, so the old lines.length >= 2 assertion encoded placement rather than the property it meant to protect: the status must stay visible.
tt-a1iforce-pushed
the
plan-mode-improvements
branch
from
August 20, 2026 14:15
2735b01 to
6f6e2b8CompareUh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes#28 ・设计依据见 #27
①
fix(plan-mode):plan mode 一定退得出去原来裸
/plan在 planning 态只 notify 一句「已激活」,ready 态的选择菜单也只有 continue / implement / fresh —— 没有任何「关闭」入口,不知道/plan off这个确切写法的人就出不去了。PLAN_READY_ACTIONS增加off: "Turn plan mode off"/plan(planning 态)改为弹菜单:Continue planning / Finalize now / Turn plan mode off;非 UI 会话保持原有提示/plan off出口②
feat(footer):单条 status 空间够就内联plan mode · read-only→plan mode,plan mode · ready→plan readyrenderFooter():只有一条 status 且能塞进第一行剩余空隙时并入该行,否则维持独占行。多条 status(后台任务 + 子代理等)行为完全不变③
feat(plan-mode):bash 门禁从「语法」改为「副作用」原来靠语法黑名单一票否决:任何引号、
|、*、$、~都拒,程序只认git/gh。结果rg -l "pattern" --glob '*.ts'这种纯只读命令跑不了,只读调研在没有rg/fd工具的宿主会话里直接无解。对照 Claude Code 与 Codex,两者都允许带引号参数,按命令效果分类。$、反引号、\一律拒(无论是否在引号内);未加引号的元字符与 glob 仍拒;未配对引号拒;词首~拒但HEAD~3保留--glob '*.ts'由程序自己解析,shell 不展开),未加引号仍拒并在报错里告诉怎么改rg fd ls wc head tail,各自配 flag 允许表,沿用原有准入标准(只塑形输出,不能命名要执行的程序 / 要写的文件 / 不能永久阻塞):排除rg --pre/--pre-glob/-z、fd -x/-X、tail -fgit/gh的子命令与 flag 表完全不变,包括「子命令必须紧跟程序名」;短 flag 聚合(ls -la)只对新增的只读程序开放保留原有架构:fail-closed 允许列表、flag 级逃逸分析、子代理靠 harness 收窄工具。未做(#28 里标为可选):管道与
&&/;分段放行、tree-sitter 解析。验证
bun run test:719 + 29 全绿(基线 713 + 29)bun run check退出 0(仅剩file-search/src/binaries.ts的既存 lint warning)git checkout .、git push、git -C、git log -sp、rg foo | head、rg $(whoami)等仍被拒