Commit Graph

24 Commits

Author SHA1 Message Date
rob 2dbcbf1443 agent upgrade 2025-11-04 18:44:29 -04:00
rob e203323ac7 agents refactor 2025-11-04 17:45:11 -04:00
rob 3ec5fa67a5 updating 2025-11-04 13:33:39 -04:00
rob 0c9fba2d07 feat: comprehensive ADR-structured design document template
Created production-ready design document template with 14 comprehensive sections:

**Structure:**
1. Executive Summary & Context
2. Requirements (Functional & Non-Functional)
3. Options Considered (with pros/cons/cost analysis)
4. Decision & Rationale (trade-offs, assumptions, review triggers)
5. Architecture (diagrams, components, data models, API contracts)
6. Implementation Plan (phases, dependencies, resources)
7. Risks & Mitigations (threat model, compliance)
8. Testing Strategy (unit, integration, e2e, performance)
9. Monitoring & Observability (metrics, alerts, dashboards)
10. Documentation & Training
11. Rollout Plan (feature flags, staged rollout, rollback)
12. Future Enhancements & Technical Debt
13. Acceptance Criteria
14. Appendices (research, meeting notes, changelog)

**Features:**
- Industry-standard ADR format
- Comprehensive examples throughout
- SQL schema examples
- API contract specifications
- ASCII architecture diagrams
- Risk matrices and threat models
- Rollout and rollback procedures
- META tokens for AI placeholder replacement

This template guides teams through complete technical design documentation
from problem statement to production rollout.

Addresses PROGRESS.md Stage 3 requirement: "Enhanced template with ADR structure"

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 20:14:00 -04:00
rob 870308f9f6 feat: allow ramble codex and gemini providers 2025-11-02 00:46:36 -03:00
rob d6a88e483b fix: allow yaml header edits in append-only check 2025-11-01 23:05:27 -03:00
rob 372d24b30d feat: add multi-provider AI system with model hint optimization
Major automation enhancements for flexible AI provider configuration:

1. Add config/ai.yml - Centralized AI configuration
   - Three command chains: default, fast, quality
   - Multi-provider fallback (Claude → Codex → Gemini)
   - Configurable per optimization level
   - Sentinel token configuration

2. Extend automation/ai_config.py
   - Add RunnerSettings with three chain support
   - Add get_chain_for_hint() method
   - Load and validate all three command chains
   - Proper fallback to defaults

3. Update automation/runner.py
   - Read model_hint from .ai-rules.yml
   - Pass model_hint to generate_output()
   - Support output_type hint overrides

4. Update automation/patcher.py
   - Add model_hint parameter throughout pipeline
   - Inject TASK COMPLEXITY hint into prompts
   - ModelConfig.get_commands_for_hint() selects chain
   - Fallback mechanism tries all commands in chain

5. Add design discussion stage to features.ai-rules.yml
   - New design_gate_writer rule (model_hint: fast)
   - New design_discussion_writer rule (model_hint: quality)
   - Update feature_request to create design gate
   - Update feature_discussion to create design gate
   - Add design.discussion.md file associations
   - Proper status transitions: READY_FOR_DESIGN → READY_FOR_IMPLEMENTATION

6. Add assets/templates/design.discussion.md
   - Template for Stage 3 design discussions
   - META header with tokens support
   - Design goals and participation instructions

7. Update tools/setup_claude_agents.sh
   - Agent descriptions reference TASK COMPLEXITY hint
   - cdev-patch: "MUST BE USED when TASK COMPLEXITY is FAST"
   - cdev-patch-quality: "MUST BE USED when TASK COMPLEXITY is QUALITY"

8. Fix assets/hooks/pre-commit
   - Correct template path comment (process/templates not assets/templates)

9. Update tools/mock_ai.sh
   - Log prompts to /tmp/mock_ai_prompts.log for debugging

Impact:
- Users can configure AI providers via config/ai.yml
- Automatic fallback between Claude, Codex, Gemini
- Fast models for simple tasks (vote counting, gate checks)
- Quality models for complex tasks (design, implementation planning)
- Reduced costs through intelligent model selection
- Design stage now properly integrated into workflow

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 21:43:13 -03:00
rob 3eca60148c feat: align ramble defaults with shared ai config 2025-11-01 14:42:04 -03:00
rob bed219bf1b updated uml diagrams 2025-11-01 03:03:14 -03:00
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 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 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 05002b766b test: Add comprehensive workflow tests and improve template tests
Testing improvements completing Week 1 consolidation:

1. Add tests/test_workflow.py (6 comprehensive tests)
   - test_extract_vote_value: Vote value extraction
   - test_parse_votes_single_participant_single_vote: Basic parsing
   - test_parse_votes_single_participant_multiple_votes: Latest vote wins
   - test_parse_votes_multiple_participants: Multi-participant tracking
   - test_parse_votes_malformed_lines: Error handling
   - test_parse_votes_mixed_content: Real-world scenarios

2. Improve tests/test_template_meta.py
   - Replace stub tests with real implementations
   - test_find_template_fields: Field extraction from templates
   - test_render_request_from_template: Template rendering
   - test_render_request_from_template_with_existing_meta: Preserve existing data

3. Add __init__.py files for test imports
   - assets/__init__.py: Make assets importable
   - automation/__init__.py: Make automation importable
   - Enables tests to import workflow.py and create_feature.py

4. Update pyproject.toml pytest configuration
   - Add ".", "assets" to pythonpath
   - Allows tests to import from automation/ and assets/

Test Results:
- All 11 tests passing
- Coverage: workflow vote parsing, template rendering, utils
- Foundation ready for Stage 2 development

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 16:20:42 -03:00
rob 03bb4afdcc build: Bundle automation/ and update pre-commit hook comment
Integration fixes to make workflow.py available in user projects:

1. Bundle automation/ directory in installer
   - Add automation/ to build_installer.py copy process
   - Ensures workflow.py is available in generated projects
   - Pre-commit hook can now actually call workflow.py

2. Update pre-commit hook comment
   - Change from "planned feature...does not yet exist"
   - Update to "provides non-blocking vote status reporting"
   - Accurately describes current implementation

Verified:
- automation/workflow.py present in install bundle
- workflow.py executes successfully from bundle
- Pre-commit hook comment matches reality

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 14:24:32 -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 5506891a52 1st commit 2025-10-26 12:28:04 -03:00
rob 51a9bb0aa2 1st commit 2025-10-25 13:34:20 -03:00
rob 5425ce9fbb 1st commit 2025-10-25 02:30:38 -03:00
rob 5e3a7231f9 1st commit 2025-10-25 02:27:38 -03:00
rob c61c988966 1st commit 2025-10-25 02:24:55 -03:00