Cannot determine project environment. Found conflicting signals or nothing at all.
Action: Ask the user. Do not guess. Present what was found and let user choose.
Grill reveals idea is unworkable (tech infeasible, self-contradictory).
Action: Terminate. Tell user why. Zero code generated -> zero loss.
Phase 1 completed or Phase 2 started without minimum grill questions via [[USER:ask]].
Action: Stop. Return to Phase 1 Step 2. Complete the full grill checklist (uncertainty scan, 4+ questions, internet search, MP search, grill summary). Do not discard REQs already written — use grill findings to supplement them, then merge into existing REQs.
Cannot reproduce the bug.
Action: Tell user. Don't guess. Do not write code based on a hunch. Ask user for more details about environment, input, and expected behavior.
Can't write a test that fails. Either the bug is too deep (infrastructure/env) or you can't reproduce it.
Action: Tell user. Don't skip the regression test.
TDD stuck on REQ-N. Previous REQs conflict with current.
Action: Stop. Re-grill (back to Phase 1 partial). Discard unverified code from failed REQ. Keep passing code.
Code works but has architectural/security issues.
Action: Retain code on branch (feature/xxx). Don't merge. Present options:
- Fix the issue -> continue on same branch
- Accept as tech debt -> mark in spec, merge with caveat
- Re-do from scratch -> discard and re-plan
Code has duplication, over-engineering, or documentation doesn't match new behavior.
Action: Fix immediately — no need to go back to earlier phases. This is cleanup, not redesign. Common fixes:
- Merge duplicated functions
- Remove dead code / unused imports
- Update README/CLAUDE.md to match new behavior
- Flatten unnecessary abstractions
Phase 6 is a self-correction step. If you find issues here, fix them and re-run Phase 6 until it passes. Do not report to user unless you find a fundamental design flaw that requires going back to Phase 1.
E2E tests fail after Review + Simplify. Simplify broke user-facing behavior.
Action: Don't panic — this is exactly why the loop exists. Debug which simplify change caused the regression, revert or fix it, re-run e2e. Loop up to 3 times. After 3 failures, escalate to user.
E2E tests pass but output doesn't match spec REQs. This means simplify changed behavior to something that works but isn't what the user asked for.
Action: Fix the code output to match spec. Never change the spec to match a broken output. Re-run e2e + spec alignment check. If fix requires significant rework, escalate to user.
Staged changes conflict or cannot be committed.
Action: Resolve the specific conflict (merge, rebase, or re-stage). Do not use --no-verify or --force to bypass hooks. If the commit itself reveals issues (e.g., pre-commit hook failures), fix them and retry. Do not roll back to earlier phases — this is a git operation, not a code quality issue.
Session restart with existing branch:
- MemPalace recovery (if available):
mempalace_diary_read agent_name="doit" last_n=3+mempalace_search query="<project>" wing="<project>" limit=5 - Read
.spec/current.mdfrom branch - Check REQ status table
- Resume at first non-DONE REQ
No spec, no branch -> start fresh from Phase 0.
If MemPalace tool calls error during any phase, skip silently. Filesystem (.doit/docs/, .spec/archive/) and codegraph remain as the primary persistence layers. The workflow never blocks on a missing memory layer.
Compact 压缩上下文后,TaskUpdate 可能因 taskId 丢失而报错:
InputValidationError: TaskUpdate failed due to the required parameter taskId is missing
根因: headroom_compress 压缩对话上下文,task 状态(taskId)从摘要中丢失。系统恢复阶段尝试调用 TaskUpdate 但参数不完整。
处理:
- 调用
TaskList检查当前状态 - 如有过期 task,标记为
deleted清理 - 不要重试
TaskUpdate— taskId 已丢失,重试无意义 - 如需新建 task,调用
TaskCreate重新创建
预防: Phase 10 结束必须运行 headroom_compress。Compact 后自动清理 task 列表,不要保留对旧 taskId 的引用。
当出现 InputValidationError 时,[LOAD] tool-params.md 查看工具签名。
| Error | Root Cause | Fix |
|---|---|---|
command is missing (Bash) |
Empty command param | [BASH PREFLIGHT] in thinking first |
file_path is missing (Read/Edit) |
Forgot absolute path | Use absolute path, Read before Edit |
old_string is missing (Edit) |
Forgot search string | Provide exact text from Read output |
description is missing (Agent) |
Missing description+prompt | Both description AND prompt required |
subject is missing (TaskCreate) |
Missing required fields | Both subject AND description required |
taskId is missing (TaskUpdate) |
Compact lost taskId | See "Compact 后 Task 丢失" above |
questions is missing ([[USER:ask]]) |
Missing questions array | Array of {question, header, options, multiSelect} |
path is missing (ctx_read) |
Missing file path | Use absolute path for ctx_read |
关键原则: 永远不要用相同参数重试失败的工具调用。先检查 tool-params.md 确认正确签名。