Skip to content

feat: shell discipline in dag block contracts - #432

Merged
LeXwDeX merged 6 commits into
mainfrom
feat/431-shell-discipline-in
Aug 24, 2026
Merged

feat: shell discipline in dag block contracts#432
LeXwDeX merged 6 commits into
mainfrom
feat/431-shell-discipline-in

Conversation

@LeXwDeX

Copy link
Copy Markdown
Owner

Closes#431

Why

check-freshness-delivery 会话中的事故链:ad-hoc 组装的 DAG 里,agent 执行 `pnpm exec vitest … | tail -15`——管道全缓冲导致命令全程零输出,pnpm/vitest 冷启动 15s+ 无声,操作者两度 ESC 中断(日志 cancel session.id ×2),agent 收到 abort 后又换参重试。归因结论:无任何一层约束长耗时/静默命令的 shell 纪律;且该路径是 ad-hoc draft,配置模板层覆盖不到。本交付把纪律做成共享常量植入块契约(explore/debug/coding/verify 四类执行必经点),单点覆盖模板与 ad-hoc 全部路径。

What changed

  • blocks.ts:新增 SHELL_DISCIPLINE 常量并拼接进四类命令密集块的契约
  • shell.ts:取消文案消歧——"User aborted" 改为注明可能是客户端中断或会话取消,消除事后排查困惑

Evidence

  • 待门禁运行后填写

Checklist

  • Why, What changed, and Evidence are filled in.
  • specgit finish exits 0.

Follow-up

  • S1 引擎-工具层兜底(静默期检测/默认超时)另行立项探索
  • dev 系 specgit-accept 本地 npm install 撞根 catalog 的潜在 bug

A delivery-freshness session ran `pnpm exec vitest … | tail -15`: the pipe
buffers everything, pnpm/vitest cold start stayed silent past 15s, the
operator interrupted twice, and the abort label "User aborted the command"
sent the postmortem chasing a phantom manual cancel.
- BLOCK_CONTRACTS gains a shared SHELL_DISCIPLINE sentence appended to the
four command-heavy kinds (explore/debug/coding/verify) so both curated
templates and ad-hoc drafts inherit it from one source of truth
- shell.ts and session/prompt.ts now share one exported SHELL_ABORT_NOTE;
its wording names the two possible interrupt origins instead of blaming
the user, and repeats the bounding advice at the moment it matters
- test assertions updated to the shared wording
@LeXwDeX
LeXwDeX marked this pull request as ready for review August 24, 2026 08:18
@LeXwDeX
LeXwDeX merged commit 27f0d2c into mainAug 24, 2026
9 checks passed
@LeXwDeX
LeXwDeX deleted the feat/431-shell-discipline-in branch August 24, 2026 11:01
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: shell discipline in dag block contracts

1 participant

@LeXwDeX