Commit Graph

4 Commits

Author SHA1 Message Date
rob 188f6b3b16 fix: Handle empty AI diffs gracefully instead of raising errors
Changed approach from disabling outputs to properly handling AI's decision
not to generate changes (e.g., gated outputs, conditional rules).

Changes:

1. patcher.py - Allow empty diffs
   - sanitize_unified_patch() returns empty string instead of raising error
   - generate_output() returns early for empty patches (silent skip)
   - Common case: implementation_gate_writer when status != READY_FOR_IMPLEMENTATION
   - AI can now return explanatory text without a diff (no error)

2. features.ai-rules.yml - Override README rule
   - Add README.md → "readme_skip" association
   - Creates empty rule to disable README updates in Docs/features/
   - Prevents unnecessary AI calls during feature discussions
   - README automation still works in root directory

3. root.ai-rules.yml - Restore default README rule
   - Removed "enabled: false" flag (back to default enabled)
   - Features directory overrides this with empty rule

Benefits:
- implementation_gate now calls AI but AI returns empty diff (as designed)
- No more "[runner] error generating ...implementation.discussion.md"
- No more "[runner] error generating README.md"
- Clean separation: AI decides vs. config disables
- Instructions to AI are still executed, AI just chooses no changes

Testing:
Setup completes cleanly with no [runner] errors. The automation
runs and AI correctly returns no diff for implementation file
when status is OPEN.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 02:33:31 -03:00
rob 19d6119542 fix: Disable unnecessary automation outputs during initial setup
Disabled two outputs that were causing errors during first commit:

1. implementation_gate (features.ai-rules.yml)
   - Was trying to generate implementation.discussion.md on every request.md commit
   - Should only run when feature status = READY_FOR_IMPLEMENTATION
   - Error: "Sanitized patch missing diff header"
   - Fix: Set enabled: false by default
   - Users can enable in project .ai-rules.yml when needed

2. readme normalizer (root.ai-rules.yml)
   - Was trying to update README.md whenever policies.yml was staged
   - Caused errors during initial commit
   - Error: "Sanitized patch missing diff header"
   - Fix: Set enabled: false by default
   - Users can enable when they want AI to maintain README

Benefits:
- Clean setup with no [runner] errors
- Faster first commit (fewer AI calls)
- Users can enable features incrementally as needed
- Only essential automation runs by default (feature discussions)

Remaining warnings are expected:
- [agents] warnings: Claude CLI permission prompts (normal behavior)
- [summary] warnings: Template markers not found (handled gracefully)

Testing:
Setup now completes cleanly with only feature.discussion.md generated.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 01:44:18 -03:00
rob 4176f51e7d fix: Add YAML syntax fix and mock AI script for testing
- Fix missing space after colon in features.ai-rules.yml
- Add tools/mock_ai.sh for testing automation without real AI
- Ensures installer has valid YAML templates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 09:18:59 -03:00
rob a0b2816cc5 1st commit 2025-10-28 21:23:08 -03:00