Replace /mode [name] with same-named no-argument commands such as /plan. Update the TUI and ACP snapshots, and validate mode names against command syntax.
Master PR #263 (scoped-layers-store): one conflict in the regenerated
docs/architecture.i18n.yaml pairing record — took master's and re-recorded
the pair over both sides' merged architecture.md/zh.md (the ctx.modes rows
merged cleanly on both).
The master merge (windows-runtime) shifted TuiConfig's source line without
regenerating docs/config-catalog.md, and its Windows stdout pin for
workspace-edit was recorded on master without dsh-mode — the session/new
result lacked the modes advertisement and the command list lacked /mode.
Both lines carry no filesystem paths, so the POSIX pin's bytes are correct
on Windows too; graft them verbatim.
The remaining red CI on this PR head (windows coverage/static LSP failures,
the web-search live e2e) reproduces on master's own HEAD 32ccc405b and is
not a branch regression.
CI caught two gaps in the review-fix commit: the two post-next() flush
listeners were literal clones (jscpd), and the disposed-skip branch inside
them had no covering test. Extract one shared flushAfter wrapper and pin the
skip with a captured-continuation disposal test (a downstream listener
disposes the fiber mid-waterfall; the resumed wrapper appends nothing).
Four ds-review-bot findings:
- examples/tui-agent composed dsh-mode without the now-required
modes.plan.section, so the TUI leaf failed at Loader startup (the keyless
smoke only asserts the banner and missed it); graft the same deployment
plan instructions the ACP leaf carries.
- The prompt-submit and turn-continuation flushes ran before next(), so a
session/set_mode arriving while a downstream async listener (the shipped
hooks listeners' shape) awaited applied one request late; both listeners
now prepend and flush after next(), matching the request-error wrapper,
with a regression test pinning the ordering.
- An HMR unload during the exit_plan_mode review let a later approval write
into the disposed service and claim an exit whose flush could never land;
the execute path now checks the fiber lifetime after the await and fails
the call (the mode stays plan; the model re-presents).
- resolveConfig accepted empty/untrimmed mode names that list()/ACP then
advertised while the package invariant rejected their selection,
desynchronizing the picker; names are validated non-empty and trimmed at
load, the same shape the invariant enforces.
Master arrivals re-grafted onto the plan-mode surfaces:
- Package invariant runtime contracts: every package owns ./invariant —
added the dsh-mode companion (mode/set payload validation: non-empty
trimmed name), its unit spec, exports/peer wiring, and the mode group in
the tsconfig invariant paths glob.
- Interception waterfalls gained an AbortSignal parameter
(agent/prompt-submit, agent/turn-continuation) and ToolExecutionInput.signal
became required: listeners and test dispatch updated; the exit tool now
forwards exec.signal unconditionally.
- TUI question dialog: master's position/unanswered header layout kept,
the plan-review detail block re-grafted between question and answers.
- LSP capability family arrived: lsp tool joins the catalog pin, dsh-lsp
examples deps beside dsh-mode; lsp-definition snapshot refreshed with
the mode command and modes advertisement.
- docs/architecture.md and packages/README.md regenerated tables re-grafted
(ctx.modes row, mode package row) and condensed within word ceilings.
- examples/acp-agent cordis.yml: kept the deployment-owned plan instructions
(incl. the conversational-agreement sentence) beside master's routed-model
compaction comment; snapshot expected outputs refreshed keyless and noise
fixtures restored.
Real-session evidence (Zed, 2026-07-21): in plan mode the model asked for
deletion confirmation through ask_user_question, took the user's follow-up
"对的" as approval, and attempted the rm directly — the independent
read-only sandbox contained it, and the one-shot escalation was rejected.
The plan instructions covered imperative execution requests but not a
confirming answer to the model's own question, so add the missing sentence:
conversational agreement approves nothing and does not end plan mode; the
confirmed decision belongs in the exit_plan_mode plan. Codex's plan template
carries the equivalent rule ("Plan Mode is not changed by user intent").
The plan-mode system-prompt pin refreshes with the section text.