feat(agents): add analysis paralysis guard, exhaustive cross-check, and task-level TDD (#736)
- gsd-executor: Add <analysis_paralysis_guard> block after deviation_rules. If executor makes 5+ consecutive Read/Grep/Glob calls without any Edit/Write/Bash action, it must stop and either write or report blocked. Prevents infinite analysis loops that stall execution. - gsd-plan-checker: Add exhaustive cross-check in Step 4 requirement coverage. Checker now also reads PROJECT.md requirements (not just phase goal) to verify no relevant requirement is silently dropped. Unmapped requirements become automatic blockers listed explicitly in issues. - gsd-planner: Add task-level TDD guidance alongside existing TDD Detection. For code-producing tasks in standard plans, tdd="true" + <behavior> block makes test expectations explicit before implementation. Complements the existing dedicated TDD plan approach — both can coexist. Co-authored-by: CyPack <GITHUB_EMAIL_ADRESIN> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -171,6 +171,16 @@ Track auto-fix attempts per task. After 3 auto-fix attempts on a single task:
|
||||
- Do NOT restart the build to find more issues
|
||||
</deviation_rules>
|
||||
|
||||
<analysis_paralysis_guard>
|
||||
**During task execution, if you make 5+ consecutive Read/Grep/Glob calls without any Edit/Write/Bash action:**
|
||||
|
||||
STOP. State in one sentence why you haven't written anything yet. Then either:
|
||||
1. Write code (you have enough context), or
|
||||
2. Report "blocked" with the specific missing information.
|
||||
|
||||
Do NOT continue reading. Analysis without action is a stuck signal.
|
||||
</analysis_paralysis_guard>
|
||||
|
||||
<authentication_gates>
|
||||
**Auth errors during `type="auto"` execution are gates, not failures.**
|
||||
|
||||
|
||||
@@ -445,6 +445,8 @@ Session persists | 01 | 3 | COVERED
|
||||
|
||||
For each requirement: find covering task(s), verify action is specific, flag gaps.
|
||||
|
||||
**Exhaustive cross-check:** Also read PROJECT.md requirements (not just phase goal). Verify no PROJECT.md requirement relevant to this phase is silently dropped. Any unmapped requirement is an automatic blocker — list it explicitly in issues.
|
||||
|
||||
## Step 5: Validate Task Structure
|
||||
|
||||
Use gsd-tools plan-structure verification (already run in Step 2):
|
||||
|
||||
@@ -234,6 +234,26 @@ This prevents the "scavenger hunt" anti-pattern where executors explore the code
|
||||
|
||||
**Why TDD gets own plan:** TDD requires RED→GREEN→REFACTOR cycles consuming 40-50% context. Embedding in multi-task plans degrades quality.
|
||||
|
||||
**Task-level TDD** (for code-producing tasks in standard plans): When a task creates or modifies production code, add `tdd="true"` and a `<behavior>` block to make test expectations explicit before implementation:
|
||||
|
||||
```xml
|
||||
<task type="auto" tdd="true">
|
||||
<name>Task: [name]</name>
|
||||
<files>src/feature.ts, src/feature.test.ts</files>
|
||||
<behavior>
|
||||
- Test 1: [expected behavior]
|
||||
- Test 2: [edge case]
|
||||
</behavior>
|
||||
<action>[Implementation after tests pass]</action>
|
||||
<verify>
|
||||
<automated>npm test -- --filter=feature</automated>
|
||||
</verify>
|
||||
<done>[Criteria]</done>
|
||||
</task>
|
||||
```
|
||||
|
||||
Exceptions where `tdd="true"` is not needed: `type="checkpoint:*"` tasks, configuration-only files, documentation, migration scripts, glue code wiring existing tested components, styling-only changes.
|
||||
|
||||
## User Setup Detection
|
||||
|
||||
For tasks involving external services, identify human-required configuration:
|
||||
|
||||
Reference in New Issue
Block a user