rob
15b03e83d4
fix: suppress marker warnings for uninitialized summary files
...
- Only show marker missing warnings if file has OTHER markers
- If file has no markers at all, it's uninitialized and warnings are noise
- Prevents confusing warnings on first commit for new discussions
- All 41 tests passing
2025-11-04 22:37:08 -04:00
rob
3ec5fa67a5
updating
2025-11-04 13:33:39 -04:00
rob
f6ce763a49
fix: default missing status field to OPEN in question formatting
...
Fix question extraction bug where AI-generated questions were being
filtered out due to missing 'status' field.
**Root Cause:**
The AI agents module returns questions without a 'status' field:
{'participant': 'Bob', 'question': 'text', 'line': 'original'}
But format_questions_section() filtered for status == "OPEN":
open_questions = [q for q in questions if q.get("status") == "OPEN"]
Since AI questions had no status, q.get("status") returned None,
which didn't match "OPEN", so questions were filtered out.
**Fix:**
Default missing status to "OPEN" in the filter:
open_questions = [q for q in questions if q.get("status", "OPEN") == "OPEN"]
This makes the function defensive - questions without explicit status
are treated as OPEN, which matches the basic extraction behavior.
**Impact:**
- Questions extracted by AI agents now appear in summaries
- Maintains backward compatibility with basic extraction (has status)
- All 18 tests now pass (was 17/18)
**Testing:**
- Verified with test_run_status_updates_summary_sections
- Question "What is the rollout plan?" now correctly appears in summary
- No regressions in other tests
Resolves test failure identified in comprehensive project review.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 21:58:32 -03:00
rob
73bcccdecd
chore: clarify summary marker log
2025-11-01 14:21:54 -03:00
rob
70c3f6f80d
refactor: Clean up pre-commit hook and add comprehensive comments
...
Removed dead code and added detailed documentation:
1. Removed unused functions (61 lines deleted)
- resolve_template() - Template resolution now handled by config.py
- apply_patch_with_3way() - Patch application now handled by patcher.py
2. Added comprehensive function documentation
- check_append_only_discussion: Detailed docstring explaining validation logic
- ensure_summary: Explains companion file creation and auto-staging
3. Added execution flow documentation
- STEP 1: Collect staged files
- STEP 2: Process discussion files (validation + summary creation)
- STEP 3: Run AI automation (runner.py) with examples and debug info
- STEP 4: Run workflow automation (workflow.py) with vote tracking details
4. Improved inline comments
- Explained what each automation phase does
- Documented exit codes and behavior
- Added examples of file transformations
- Noted debug artifact locations
Result:
- Hook reduced from 141 lines to 109 lines (cleaner)
- Every section now clearly documented
- Easier for users to understand automation flow
- Better debugging guidance
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 01:08:00 -03:00
rob
72577bd30d
feat: Implement Phase 2 - AI-powered discussion automation
...
Complete implementation of the AI-enhanced automation system with 5 specialized agents:
## New Files
1. **automation/agents.py** (270 lines)
- Agent 1: normalize_discussion() - Extracts structured info from natural language
- Agent 2: track_questions() - Identifies questions and tracks answers (OPEN/PARTIAL/ANSWERED)
- Agent 3: track_action_items() - Manages TODO → ASSIGNED → DONE lifecycle
- Agent 4: track_decisions() - Logs ADR-style decisions with rationale
- extract_mentions() - Parses @Name and @all mentions (no API required)
- call_claude() - Anthropic API integration with JSON response parsing
2. **automation/summary.py** (289 lines)
- update_marker_block() - Non-destructive marker block updates
- format_votes_section() - Formats vote counts and participants
- format_questions_section() - Formats open/partial/answered questions
- format_action_items_section() - Formats TODO/ASSIGNED/DONE tasks
- format_decisions_section() - Formats ADR-style decisions
- format_awaiting_section() - Groups @mentions by target
- update_summary_file() - Orchestrates all section updates
3. **docs/AUTOMATION.md** (361 lines)
- Complete system documentation
- Phase 1 (basic) and Phase 2 (AI) explanations
- Conversation guidelines and markers
- Configuration and troubleshooting
## Enhanced Files
**automation/workflow.py** (enhanced to 349 lines, +132 lines)
- get_discussion_changes() - Git diff extraction for incremental processing
- update_summary_votes() - Marker block update for votes (Phase 1 fallback)
- process_discussion_with_ai() - Orchestrates all AI agents
- Enhanced _run_status() - Processes with AI when available, graceful fallback
- Dual import style for different execution contexts (pre-commit hook vs direct)
## Features
### Phase 1 (Always Enabled):
- ✅ Vote parsing and tracking (READY/CHANGES/REJECT)
- ✅ Latest vote per participant logic
- ✅ Summary file auto-update and staging
- ✅ Non-blocking git hook integration
### Phase 2 (Optional, requires ANTHROPIC_API_KEY):
- ✅ @Mention extraction and tracking
- ✅ Question identification and status tracking
- ✅ Action item lifecycle management
- ✅ Decision logging with rationale (ADR-style)
- ✅ Incremental processing via git diff
- ✅ Graceful degradation when API unavailable
## Architecture
- Modular design with separate concerns (agents, summary, workflow)
- Non-blocking operation (always exits 0)
- Dual-phase capability (basic + AI-enhanced)
- Graceful fallbacks at every level
- Comprehensive error handling
## Testing
- All 11 existing tests passing
- End-to-end testing in /tmp/cdev-test-phase2a confirmed:
- Vote tracking works correctly
- @Mentions extracted and grouped by target
- Summary files updated non-destructively
- Auto-staging of updated summaries
- Pre-commit hook integration functional
## Documentation
- AUTOMATION.md covers architecture, usage, and troubleshooting
- Code comments explain complex logic
- Example formats provided for all features
- Configuration and setup instructions included
This completes the Phase 2 automation milestone, providing a sophisticated
AI-powered discussion summarization system while maintaining full backward
compatibility with basic vote-only mode.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 18:12:48 -03:00