Commit Graph

28 Commits

Author SHA1 Message Date
rob 19c8019502 docs: update PROGRESS.md for Stage 3 completion (95%)
Stage 3 (Design Discussion) progress updated:
- Changed completion: 90% → 95%
- Milestone M2 progress: 40% → 45%
- Marked enhanced design_doc.md template as complete
- Marked end-to-end tests as complete (4 tests added)
- Documented completed work (2025-11-02)
- Updated remaining work section (5% polish remaining)

Completed items:
 14-section ADR-structured design document template
 End-to-end test suite (test_stage_promotion.py)
 Vote counting and threshold validation
 AI vote exclusion behavior testing

Only 5% remaining: Status update integration and production testing.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 20:16:30 -04:00
rob bde543530c docs: update progress tracking for AI normalization implementation
Updated PROGRESS.md:
- Changed Last Updated to 2025-11-02
- Updated Overall Completion to 57% (was 55%)
- Stage 2 Feature Discussion now explicitly notes AI normalization
- Added AI normalization details to Multi-Provider AI System section
- Documented two-tier architecture (AI primary, fallback secondary)

Updated DESIGN.md:
- Changed Updated date to 2025-11-02
- Added "Multi-Provider Fallback" to implemented features
- Added "AI Normalization" to implemented features
- Reflects current system capabilities

Both documents now accurately track the completed AI normalization work
that enables natural conversation in discussions without strict formatting.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 20:09:08 -04:00
rob 33b550ad5b docs: complete update for AI normalization architecture
Updated all documentation to reflect the new two-tier extraction system:

**workflow-marker-extraction.puml:**
- Completely rewritten to show AI normalization flow
- Documents agents.normalize_discussion() as primary method
- Shows simple line-start fallback for explicit markers
- Includes natural conversation examples vs. explicit markers
- Demonstrates resilience and cost-effectiveness

**AUTOMATION.md:**
- Restructured "Conversation Guidelines" section
- Emphasizes natural conversation as recommended approach
- Clarifies AI normalization extracts from conversational text
- Documents explicit markers as fallback when AI unavailable
- Explains two-tier architecture benefits

**diagrams-README.md:**
- Already updated in previous commit

All documentation now accurately reflects:
 AI-powered extraction (agents.py) for natural conversation
 Simple fallback parsing (workflow.py) for explicit markers
 Multi-provider resilience (claude → codex → gemini)
 No strict formatting requirements for participants

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 20:04:09 -04:00
rob 380c7b5d12 docs: update diagrams-README to reflect AI normalization architecture
Updated workflow-marker-extraction diagram description to emphasize:
- AI-powered normalization for natural conversation (agents.py)
- Simple line-start fallback for explicit markers (workflow.py)
- Two-tier extraction system design

Benefits of this approach:
- Participants write naturally without strict formatting rules
- Fast AI model handles conversation → structured data conversion
- Simple fallback code when AI unavailable
- Clear separation of concerns

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 18:52:00 -04:00
rob da726cb5bf refactor: simplify workflow.py to use AI normalization with minimal fallback
Simplified marker extraction architecture:
- AI normalization (agents.py) handles natural conversation
- Simple line-start matching for explicit markers as fallback
- Removed complex regex patterns (DECISION_PATTERN, QUESTION_PATTERN, ACTION_PATTERN)
- Participants can now write naturally without strict formatting rules

This implements the original design intent: fast AI model normalizes conversational
text into structured format, then simple parsing logic extracts it.

Benefits:
- More flexible for participants (no strict formatting required)
- Simpler code (startswith() instead of regex)
- Clear separation: AI for understanding, code for mechanical parsing
- Cost-effective (fast models for simple extraction task)

Updated workflow-marker-extraction.puml to show patterns in notes
instead of inline text (fixes PlantUML syntax error).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 18:48:12 -04:00
rob f9297fc456 fix: correct PlantUML syntax in patcher-pipeline diagram
Added missing outer if statement for Claude output check to fix
"Cannot find if" syntax error. The else clause on line 56 now
properly matches the provider output check.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 13:22:25 -04:00
rob 038dbe8a3e docs: update PlantUML diagrams for multi-provider fallback and regex marker extraction
- Updated commit-workflow.puml to show claude→codex→gemini fallback chain
- Updated patcher-pipeline.puml with provider fallback logic and model hints
- Updated voting-system.puml for multi-stage promotions (READY_FOR_DESIGN)
- Created ai-provider-fallback.puml documenting provider chain in detail
- Created discussion-stages.puml showing complete feature lifecycle
- Created workflow-marker-extraction.puml documenting regex patterns
- Updated diagrams-README.md with all new diagrams and workflows
- Increased diagram count from 7 to 10 total
- All diagrams now reflect current system architecture

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 13:05:00 -04:00
rob 22944a2a49 docs: add comprehensive implementation progress tracker
Add docs/PROGRESS.md - a living document that tracks implementation
status across all milestones with detailed checklists.

**Structure:**
- Quick status overview table (Milestone completion %)
- Milestone-by-milestone breakdown (M0-M4)
- Checkbox lists for every deliverable
- Stage-by-stage breakdown for M2
- File/line references for verification
- Next steps sections for each component
- Update instructions for maintainers

**Key Features:**
- Visual progress tracking (  🚧)
- Completion percentages per section
- Specific missing items highlighted
- Clear next steps for each stage
- Easy to update (just check boxes)
- 431 lines covering all aspects

**Current Status Snapshot:**
- M0: Process Foundation - 100% 
- M1: Orchestrator MVP - 100% 
- M2: Stage Automation - 40% 🚧 (3/7 stages)
- M3: Gitea Integration - 0% 
- M4: Python Migration - 100% 
- Overall: ~55% complete

**Benefits:**
- No need to reassess entire project each time
- Quick reference for what's done vs. what's left
- Clear roadmap for contributors
- Tracks implementation vs. design intent
- Shows where to focus effort next

This replaces ad-hoc status assessments with a maintained living document.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 22:13:56 -03:00
rob 6135d42bc0 docs: comprehensive AI configuration documentation update
Major documentation updates to align with multi-provider AI system:

1. Update CLAUDE.md (lines 213-332)
   - Add new "AI Configuration System" section
   - Document config/ai.yml structure and three optimization levels
   - Explain model hint propagation pipeline (rule → runner → patcher)
   - Add provider setup table (Claude, Codex, Gemini)
   - Document Claude subagent setup with ./tools/setup_claude_agents.sh
   - List implementation modules with line number references
   - Explain environment variable overrides
   - Document fallback behavior when all providers fail

2. Update docs/DESIGN.md (lines 894-1077)
   - Add "Automation AI Configuration" section before Stage Model
   - Document configuration architecture with full YAML example
   - Explain model hint system with .ai-rules.yml examples
   - Detail execution flow through 4 steps (rule eval → prompt → chain → fallback)
   - Show example prompt with TASK COMPLEXITY hint injection
   - Add provider comparison table with fast/default/quality models
   - Document implementation modules with line references
   - Add cost optimization examples (93% savings on simple tasks)
   - Explain environment overrides and persistence

3. Update docs/AUTOMATION.md (lines 70-148)
   - Restructure Phase 2 requirements to emphasize config/ai.yml
   - Add full YAML configuration example with three chains
   - Explain how model hints work (fast vs quality)
   - Update Claude subagent documentation
   - Clarify auto-selection based on TASK COMPLEXITY
   - Move git config to deprecated status
   - Emphasize environment variables as optional overrides

4. Update README.md (line 10)
   - Add "Multi-Provider AI System" to key features
   - Brief mention of fallback chains and model selection

Impact:
- AI assistants can now discover the multi-provider system
- Users understand how to configure providers via config/ai.yml
- Clear explanation of cost optimization through model hints
- Complete documentation of the execution pipeline
- All major docs now reference the same configuration approach

Resolves documentation gap identified in project review.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 21:48:25 -03:00
rob e9cc23685d docs: align claude setup references 2025-11-01 16:18:06 -03:00
rob d26c6c2210 fix: drop unsupported claude agent flag 2025-11-01 16:16:01 -03:00
rob 16c45ba415 feat: add claude subagent setup script and refine ai chain 2025-11-01 16:08:33 -03:00
rob ca73528068 feat: extend ai config with codex and gemini fallbacks 2025-11-01 14:59:45 -03:00
rob 4680f4b629 build: bundle shared ai config into installer 2025-11-01 14:44:25 -03:00
rob 3751796ecc docs: Add implementation status section to DESIGN.md
Added clear implementation status tracking to DESIGN.md to show what's
currently working vs. what's planned.

Changes:
- Updated document version to v2.1
- Added "Implementation Status (2025-11-01)" section at top
- Created DESIGN.md.old backup for easy comparison
- Categorized features into: Implemented, In Progress, Planned

Current Status:
 Implemented: Stages 1-2, cascading rules, AI patch generation, voting
🚧 In Progress: Stage 3 (Design Discussion Gate) - being implemented now
📋 Planned: Stages 4-7, moderator protocol, bug sub-cycles

The three-stage workflow (Feature → Design → Implementation) was always
documented correctly in DESIGN.md. The current implementation just skips
the Design stage, which we're now fixing.

This status section will be updated as each milestone is completed.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 11:39:16 -03:00
rob 53859e1631 updated uml diagrams 2025-10-31 23:19:35 -03:00
rob 44c8c9cab2 docs: Add comprehensive PlantUML architecture diagrams
Created 7 diagrams documenting the CascadingDev system:

1. architecture-overview.puml - High-level component diagram
2. commit-workflow.puml - Git commit sequence diagram
3. cascading-rules.puml - Configuration cascading system
4. patcher-pipeline.puml - AI patch generation flowchart
5. voting-system.puml - Feature promotion logic
6. file-lifecycle.puml - Complete feature workflow
7. directory-structure.puml - Project structure

Also added diagrams-README.md with viewing instructions and diagram index.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 22:52:02 -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 5944269ed8 refactor: Support CLI-based AI providers (Claude Code, Gemini, Codex)
Major refactoring to support flexible AI provider configuration instead of
requiring direct API access. Users can now use whatever AI CLI tool they have
installed (claude, gemini, codex, etc.) without API keys.

## Changes to automation/agents.py

**New Functions:**
- `get_ai_config()` - Reads config from env vars or git config
  - Environment: CDEV_AI_PROVIDER, CDEV_AI_COMMAND (highest priority)
  - Git config: cascadingdev.aiprovider, cascadingdev.aicommand
  - Default: claude-cli with "claude -p '{prompt}'"

- `call_ai_cli()` - Execute AI via CLI command
  - Passes content via temp file to avoid shell escaping
  - Supports {prompt} placeholder in command template
  - 60s timeout with error handling
  - Parses JSON from response (with/without code blocks)

- `call_ai_api()` - Direct API access (renamed from call_claude)
  - Unchanged functionality
  - Now used as fallback option

- `call_ai()` - Unified AI caller
  - Try CLI first (if configured)
  - Fall back to API (if ANTHROPIC_API_KEY set)
  - Graceful failure with warnings

**Updated Functions:**
- `normalize_discussion()` - calls call_ai() instead of call_claude()
- `track_questions()` - calls call_ai() instead of call_claude()
- `track_action_items()` - calls call_ai() instead of call_claude()
- `track_decisions()` - calls call_ai() instead of call_claude()

**Configuration Precedence:**
1. Environment variables (session-scoped)
2. Git config (repo-scoped)
3. Defaults (claude-cli)

## Changes to docs/AUTOMATION.md

**Updated Sections:**
- "Requirements" - Now lists CLI as Option 1 (recommended), API as Option 2
- "Configuration" - Complete rewrite with 5 provider examples:
  1. Claude CLI (default)
  2. Gemini CLI
  3. OpenAI Codex CLI
  4. Direct API (Anthropic)
  5. Custom AI command
- "Troubleshooting" - Added "AI command failed" section, updated error messages

**New Configuration Examples:**
```bash
# Claude Code (default)
git config cascadingdev.aicommand "claude -p '{prompt}'"

# Gemini
git config cascadingdev.aiprovider "gemini-cli"
git config cascadingdev.aicommand "gemini '{prompt}'"

# Custom
git config cascadingdev.aicommand "my-ai-tool --prompt '{prompt}' --format json"
```

## Benefits

1. **No API Key Required**: Use existing CLI tools (claude, gemini, etc.)
2. **Flexible Configuration**: Git config (persistent) or env vars (session)
3. **Provider Agnostic**: Works with any CLI that returns JSON
4. **Backward Compatible**: Still supports direct API if ANTHROPIC_API_KEY set
5. **User-Friendly**: Defaults to "claude -p" if available

## Testing

-  get_ai_config() tests:
  - Default: claude-cli with "claude -p '{prompt}'"
  - Git config override: gemini-cli with "gemini '{prompt}'"
  - Env var override: codex-cli with "codex '{prompt}'"
-  extract_mentions() still works (no AI required)
-  All 6 workflow tests pass

## Impact

Users with Claude Code installed can now use the automation without any
configuration - it just works! Same for users with gemini or codex CLIs.
Only requires git config setup if using non-default command.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 18:31:27 -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
rob 4e7ad11b4c feat: Implement vote parsing orchestrator and testing infrastructure
Major implementation milestone - core automation is now functional:

1. Add automation/workflow.py (Phase 1 - Vote Parsing)
   - Parse VOTE: lines from discussion files
   - Track latest vote per participant
   - Print human-readable vote summaries
   - Non-blocking (always exits 0)
   - Proper error handling for missing files/git failures
   - 158 lines of production-quality code

2. Add testing infrastructure
   - Create tests/ directory with pytest configuration
   - Add test_utils.py with actual version reading test
   - Add test_template_meta.py (stubs for META system tests)
   - Add test_build.py (stub for build verification)
   - Configure pytest in pyproject.toml (pythonpath)
   - All 4 tests passing

3. Add AGENTS.md - Developer guidelines
   - Project structure and module organization
   - Build, test, and development commands
   - Coding style and naming conventions
   - Testing guidelines
   - Commit and PR guidelines

4. Update docs/DESIGN.md
   - Document workflow.py implementation
   - Update automation status from "planned" to "implemented"
   - Clarify Phase 1 vs future phases

5. Code cleanup - Remove empty stub modules
   - Delete src/cascadingdev/feature_seed.py
   - Delete src/cascadingdev/fs_scaffold.py
   - Delete src/cascadingdev/ramble_integration.py
   - Delete src/cascadingdev/rules_seed.py

Impact:
- Users can now see vote counts in their commits
- Testing foundation enables safe refactoring
- Code is cleaner with only working modules
- Week 1 implementation goals complete

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 14:25:53 -03:00
rob 536d885b6b docs: Add CLAUDE.md and restructure DESIGN.md for clarity
Major documentation improvements:

1. Add CLAUDE.md
   - Comprehensive guide for AI assistants working in this repo
   - Repository architecture and directory structure
   - Common development commands and workflows
   - Build system explanation
   - Key concepts and design philosophy

2. Restructure DESIGN.md
   - Clarify three directory contexts: CascadingDev Repo, Install Bundle, User Project
   - Add clear section headers and visual separation
   - Mark future/unimplemented features with 🚧 emoji
   - Document undocumented wins: META system and Ramble providers
   - Add comprehensive Ramble documentation (mock and claude providers)
   - Document template META system with code examples

3. Fix setup_project.py
   - Correct error message path (was scripts/hooks/pre-commit, now assets/hooks/pre-commit)

These changes address confusion between tooling source, distribution bundle, and
generated user projects while highlighting sophisticated features like the
self-describing template system and multi-provider Ramble GUI.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 12:31:33 -03:00
rob d78b0d83c8 1st commit 2025-10-29 01:22:40 -03:00
rob a0b2816cc5 1st commit 2025-10-28 21:23:08 -03:00
rob e914caf15f 1st commit 2025-10-28 11:56:01 -03:00
rob 67a4415600 1st commit 2025-10-27 20:17:35 -03:00
rob ade5f91ad7 1st commit 2025-10-27 16:28:14 -03:00
rob a075472a98 1st commit 2025-10-27 16:24:50 -03:00