Q4-strict-mode:30 分钟无 task 自动 hard 提醒
优先级
P2
类型
新功能
状态
草稿
负责人
@小敏 (Claude Code)
关联组件:ea152ad7-acb7-4643-add1-3d4176f8a38b
📝 描述
把 spec §4 Q4 决策落地:session 启动 30 分钟后若 task_history 仍为空,自动 hard 提醒 AI 必须建 task。新增 state 字段 strict_no_task_min,新 env CLAUDE_CIRCUIT_STRICT_NO_TASK_MIN(默认 30,0 关闭)。
IN-SCOPE: 改 init.sh 加新字段 / 改 circuit-breaker.sh 在 PreToolUse 分支 3 顶部加触发判断 / 区分 mode:soft 用 additionalContext、strict 用 exit 2 / 新增断言 (e) 30min 无 task 提醒 (f) 建 task 后提醒消失。
OUT-OF-SCOPE: 改 task_history schema / 改 TaskCreate 检测分支 / 改 TaskUpdate 检测分支 / 改 §5 实施步骤。
设计依据:$HOME/.claude/specs/circuit-breaker-task-scope.md §3.7(2026-06-29 增量)。
**关联**:本 REQ 是 REQ 65f1d3c5(v2 task-lifetime 改造)的延续,实施于 version 1.1.0。
👤 用户故事
As an AI assistant, I want automatic hard reminder after 30 min session with no task, so that I am forced to use TaskCreate per CLAUDE.md 熔断原则 (task is the budget atomic unit), instead of bypassing the circuit-breaker by simply not creating tasks.
✅ 验收标准 (3 项)
-
Given circuit-breaker.sh 部署完成,session 已启动 30 分钟,task_history 为空
When AI 调用任意 tool
Then soft 模式:additionalContext 注入 hard 文案,提醒 AI 必须建 task;strict 模式:exit 2 阻止 tool 执行,AI 必须先 TaskCreate
-
Given 已触发 hard 提醒
When AI 立即 TaskCreate
Then task_history 不再为空,后续 tool 不再 hard 提醒
-
Given env CLAUDE_CIRCUIT_STRICT_NO_TASK_MIN=0
When session 启动 30min 无 task
Then 不触发任何 hard 提醒(strict-mode 关闭)
⚙️ 非功能需求
| performance | PreToolUse 钩子 < 50ms |
| reliability | strict 模式 exit 2 不可被吞 |
🏷️ 标签
circuit-breaker Q4-strict 熔断原则 自动化
🔄 推进状态
🔗 关联反馈 (1 个)
创建于 2026-06-28 20:25