diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 00000000..9eaec2fc --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,65 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json + +# CodeRabbit Configuration +# Documentation: https://docs.coderabbit.ai/reference/configuration + +language: "en-US" + +reviews: + # Review profile: "chill" for fewer comments, "assertive" for more thorough feedback + profile: "assertive" + + # Generate high-level summary in PR description + high_level_summary: true + + # Automatic review settings + auto_review: + enabled: true + auto_incremental_review: true + # Target branches for review (in addition to default branch) + base_branches: + - develop + - "release/*" + - "hotfix/*" + # Skip review for PRs with these title keywords (case-insensitive) + ignore_title_keywords: + - "[WIP]" + - "WIP:" + - "DO NOT MERGE" + # Don't review draft PRs + drafts: false + + # Path filters - exclude generated/vendor files + path_filters: + - "!**/node_modules/**" + - "!**/.venv/**" + - "!**/dist/**" + - "!**/build/**" + - "!**/*.lock" + - "!**/package-lock.json" + - "!**/*.min.js" + - "!**/*.min.css" + + # Path-specific review instructions + path_instructions: + - path: "apps/backend/**/*.py" + instructions: | + Focus on Python best practices, type hints, and async patterns. + Check for proper error handling and security considerations. + Verify compatibility with Python 3.12+. + - path: "apps/frontend/**/*.{ts,tsx}" + instructions: | + Review React patterns and TypeScript type safety. + Check for proper state management and component composition. + - path: "tests/**" + instructions: | + Ensure tests are comprehensive and follow pytest conventions. + Check for proper mocking and test isolation. + +chat: + auto_reply: true + +knowledge_base: + opt_out: false + learnings: + scope: "auto" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb036c59..9e47df54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [main] + branches: [main, develop] pull_request: - branches: [main] + branches: [main, develop] jobs: # Python tests diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 76ad2e01..4eb25026 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,9 +2,9 @@ name: Lint on: push: - branches: [main] + branches: [main, develop] pull_request: - branches: [main] + branches: [main, develop] jobs: # Python linting diff --git a/.husky/pre-commit b/.husky/pre-commit index e79978be..9e7c5b0d 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,6 +2,55 @@ echo "Running pre-commit checks..." +# ============================================================================= +# VERSION SYNC - Keep all version references in sync with root package.json +# ============================================================================= + +# Check if package.json is staged +if git diff --cached --name-only | grep -q "^package.json$"; then + echo "package.json changed, syncing version to all files..." + + # Extract version from root package.json + VERSION=$(node -p "require('./package.json').version") + + if [ -n "$VERSION" ]; then + # Sync to apps/frontend/package.json + if [ -f "apps/frontend/package.json" ]; then + node -e " + const fs = require('fs'); + const pkg = require('./apps/frontend/package.json'); + if (pkg.version !== '$VERSION') { + pkg.version = '$VERSION'; + fs.writeFileSync('./apps/frontend/package.json', JSON.stringify(pkg, null, 2) + '\n'); + console.log(' Updated apps/frontend/package.json to $VERSION'); + } + " + git add apps/frontend/package.json + fi + + # Sync to apps/backend/__init__.py + if [ -f "apps/backend/__init__.py" ]; then + sed -i.bak "s/__version__ = \"[^\"]*\"/__version__ = \"$VERSION\"/" apps/backend/__init__.py + rm -f apps/backend/__init__.py.bak + git add apps/backend/__init__.py + echo " Updated apps/backend/__init__.py to $VERSION" + fi + + # Sync to README.md + if [ -f "README.md" ]; then + # Update version badge + sed -i.bak "s/version-[0-9]*\.[0-9]*\.[0-9]*-blue/version-$VERSION-blue/g" README.md + # Update download links + sed -i.bak "s/Auto-Claude-[0-9]*\.[0-9]*\.[0-9]*/Auto-Claude-$VERSION/g" README.md + rm -f README.md.bak + git add README.md + echo " Updated README.md to $VERSION" + fi + + echo "Version sync complete: $VERSION" + fi +fi + # ============================================================================= # BACKEND CHECKS (Python) - Run first, before frontend # ============================================================================= @@ -10,20 +59,33 @@ echo "Running pre-commit checks..." if git diff --cached --name-only | grep -q "^apps/backend/.*\.py$"; then echo "Python changes detected, running backend checks..." - # Run ruff linting - echo "Running ruff lint..." - ruff check apps/backend/ --fix - if [ $? -ne 0 ]; then - echo "Ruff lint failed. Please fix Python linting errors before committing." - exit 1 + # Determine ruff command (venv or global) + RUFF="" + if [ -f "apps/backend/.venv/bin/ruff" ]; then + RUFF="apps/backend/.venv/bin/ruff" + elif [ -f "apps/backend/.venv/Scripts/ruff.exe" ]; then + RUFF="apps/backend/.venv/Scripts/ruff.exe" + elif command -v ruff >/dev/null 2>&1; then + RUFF="ruff" fi - # Run ruff format check - echo "Running ruff format check..." - ruff format apps/backend/ --check - if [ $? -ne 0 ]; then - echo "Ruff format check failed. Run 'ruff format apps/backend/' to fix." - exit 1 + if [ -n "$RUFF" ]; then + # Run ruff linting (auto-fix) + echo "Running ruff lint..." + $RUFF check apps/backend/ --fix + if [ $? -ne 0 ]; then + echo "Ruff lint failed. Please fix Python linting errors before committing." + exit 1 + fi + + # Run ruff format (auto-fix) + echo "Running ruff format..." + $RUFF format apps/backend/ + + # Stage any files that were auto-fixed by ruff (POSIX-compliant) + find apps/backend -name "*.py" -type f -exec git add {} + 2>/dev/null || true + else + echo "Warning: ruff not found, skipping Python linting. Install with: uv pip install ruff" fi # Run pytest (skip slow/integration tests and Windows-incompatible tests for pre-commit speed) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e167c1d6..97c54a1a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,26 @@ repos: + # Version sync - propagate root package.json version to all files + - repo: local + hooks: + - id: version-sync + name: Version Sync + entry: bash -c ' + VERSION=$(node -p "require(\"./package.json\").version"); + if [ -n "$VERSION" ]; then + # Sync to apps/frontend/package.json + node -e "const fs=require(\"fs\");const p=require(\"./apps/frontend/package.json\");if(p.version!==\"$VERSION\"){p.version=\"$VERSION\";fs.writeFileSync(\"./apps/frontend/package.json\",JSON.stringify(p,null,2)+\"\n\");}"; + # Sync to apps/backend/__init__.py + sed -i.bak "s/__version__ = \"[^\"]*\"/__version__ = \"$VERSION\"/" apps/backend/__init__.py && rm -f apps/backend/__init__.py.bak; + # Sync to README.md + sed -i.bak "s/version-[0-9]*\.[0-9]*\.[0-9]*-blue/version-$VERSION-blue/g" README.md; + sed -i.bak "s/Auto-Claude-[0-9]*\.[0-9]*\.[0-9]*/Auto-Claude-$VERSION/g" README.md && rm -f README.md.bak; + git add apps/frontend/package.json apps/backend/__init__.py README.md 2>/dev/null || true; + fi + ' + language: system + files: ^package\.json$ + pass_filenames: false + # Python linting (apps/backend/) - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.8.3 @@ -10,11 +32,12 @@ repos: files: ^apps/backend/ # Python tests (apps/backend/) - skip slow/integration tests for pre-commit speed + # Tests to skip: graphiti (external deps), merge_file_tracker/service_orchestrator/worktree/workspace (Windows path/git issues) - repo: local hooks: - id: pytest name: Python Tests - entry: bash -c 'cd apps/backend && PYTHONPATH=. python -m pytest ../../tests/ -v --tb=short -x -m "not slow and not integration" --ignore=../../tests/test_graphiti.py' + entry: bash -c 'cd apps/backend && PYTHONPATH=. python -m pytest ../../tests/ -v --tb=short -x -m "not slow and not integration" --ignore=../../tests/test_graphiti.py --ignore=../../tests/test_merge_file_tracker.py --ignore=../../tests/test_service_orchestrator.py --ignore=../../tests/test_worktree.py --ignore=../../tests/test_workspace.py' language: system files: ^(apps/backend/.*\.py$|tests/.*\.py$) pass_filenames: false diff --git a/IMPLEMENTATION_SUMMARY.md b/IMPLEMENTATION_SUMMARY.md deleted file mode 100644 index 3db6a5af..00000000 --- a/IMPLEMENTATION_SUMMARY.md +++ /dev/null @@ -1,435 +0,0 @@ -# Ollama Download Progress + Batch Task Management - Implementation Summary - -**Branch:** `feature/ollama-and-batch-tasks` -**Based on:** `origin/develop` (v2.7.2 with apps restructure) -**Status:** ✅ Complete and Verified - -## Overview - -This implementation adds two major features to Auto-Claude: - -1. **Real-time Ollama Model Download Progress Tracking** (Frontend/UI) -2. **Batch Task Management CLI** (Backend/CLI) - -Both features are production-ready, fully tested, and integrated with the new `apps/` directory structure. - ---- - -## Commits - -| # | Hash | Message | Files | -|---|------|---------|-------| -| 1 | `9c5e82e` | feat(ollama): add real-time download progress tracking | 1 file modified | -| 2 | `7ff4654` | test: add focused test coverage for Ollama | 2 files created (223+196 lines) | -| 3 | `d0bac8c` | docs: add comprehensive JSDoc docstrings | 1 file modified | -| 4 | `fed2cdd` | feat: add batch task creation and management CLI | 2 files (1 new, 1 modified) | -| 5 | `b111005` | test: add batch task test file and checklist | 2 files created | -| 6 | `798e5f5` | chore: update package-lock.json | 1 file modified | -| 7 | `10a1bbb` | test: update checklist with verification results | 1 file modified | - -**Total:** 7 commits, 11 files modified/created - ---- - -## Feature 1: Ollama Download Progress Tracking - -### What It Does - -Provides real-time progress tracking UI for Ollama model downloads with: -- **Live speed calculation** (MB/s, KB/s, B/s) -- **Time remaining estimates** -- **Progress percentage** with animated bar -- **IPC communication** between main process and renderer -- **NDJSON parser** for streaming response handling - -### Files Modified - -**Frontend:** -- `apps/frontend/src/renderer/components/onboarding/OllamaModelSelector.tsx` (464 lines) - - Enhanced download progress UI - - Real-time progress state management - - Speed and time calculations - - IPC event listeners - -**Main Process:** -- `apps/frontend/src/main/ipc-handlers/memory-handlers.ts` (MODIFIED) - - NDJSON parser for Ollama API responses - - Progress event emission to renderer - -**Preload API:** -- `apps/frontend/src/preload/api/project-api.ts` (MODIFIED) - - Ollama API communication interface - - Model download and progress tracking - -### Test Coverage - -**Test Files Created:** 2 files, 420+ lines -1. `apps/frontend/src/main/__tests__/ndjson-parser.test.ts` (223 lines) - - NDJSON parsing unit tests - - Buffering and edge case tests - - Multi-line JSON handling - -2. `apps/frontend/src/renderer/components/__tests__/OllamaModelSelector.progress.test.ts` (196 lines) - - Progress calculation tests - - Speed calculation accuracy tests - - Time remaining estimation tests - - UI state management tests - -### Key Features - -✅ **Speed Calculation** -```javascript -// Accurately calculates download speed -const speedMBps = (bytesDownloaded / (elapsed / 1000)) / (1024 * 1024); -``` - -✅ **Time Remaining** -```javascript -// Estimates remaining time based on current speed -const remainingSeconds = (totalSize - downloaded) / speed; -``` - -✅ **Streaming Parser** -- Handles NDJSON (newline-delimited JSON) from Ollama API -- Buffers incomplete lines correctly -- Processes multiple JSON objects per response - -✅ **IPC Communication** -- Main process streams download progress to renderer -- No blocking operations -- Real-time UI updates - ---- - -## Feature 2: Batch Task Management CLI - -### What It Does - -Enables batch creation and management of multiple tasks via CLI with: -- **Batch create** from JSON file with automatic spec ID generation -- **Batch status** to view all specs with current state -- **Batch cleanup** to remove completed specs with dry-run mode - -### Files Created/Modified - -**New File:** -- `apps/backend/cli/batch_commands.py` (212 lines) - - 3 main functions: create, status, cleanup - - Full error handling - - Comprehensive JSDoc documentation - -**Modified File:** -- `apps/backend/cli/main.py` - - Import batch commands - - Add CLI arguments: `--batch-create`, `--batch-status`, `--batch-cleanup`, `--no-dry-run` - - Route handlers in main() function - -### CLI Commands - -```bash -# Create multiple tasks from JSON file -python apps/backend/run.py --batch-create batch_test.json - -# View status of all specs -python apps/backend/run.py --batch-status - -# Preview cleanup of completed specs -python apps/backend/run.py --batch-cleanup - -# Actually delete (default is dry-run) -python apps/backend/run.py --batch-cleanup --no-dry-run -``` - -### JSON Format - -```json -{ - "tasks": [ - { - "title": "Feature name", - "description": "What needs to be done", - "workflow_type": "feature", - "services": ["frontend"], - "priority": 8, - "complexity": "simple", - "estimated_hours": 2.0 - } - ] -} -``` - -### Batch Create Function - -```python -def handle_batch_create_command(batch_file: str, project_dir: str) -> bool -``` - -**What it does:** -1. Validates JSON file exists and is valid -2. Parses task list -3. Creates `.auto-claude/specs/{ID}-{name}/` directories -4. Generates `requirements.json` in each spec -5. Auto-increments spec IDs -6. Returns success status - -**Output:** -``` -[1/3] Created 001 - Add dark mode toggle -[2/3] Created 002 - Fix button styling -[3/3] Created 003 - Add loading spinner -Created 3 spec(s) successfully - -Next steps: - 1. Generate specs: spec_runner.py --continue - 2. Approve specs and build them - 3. Run: python run.py --spec to execute -``` - -### Batch Status Function - -```python -def handle_batch_status_command(project_dir: str) -> bool -``` - -**What it does:** -1. Scans `.auto-claude/specs/` directory -2. Reads requirements from each spec -3. Determines current status based on files present: - - `pending_spec` - No spec.md yet - - `spec_created` - spec.md exists - - `building` - implementation_plan.json exists - - `qa_approved` - qa_report.md exists -4. Displays with visual icons - -**Output:** -``` -Found 3 spec(s) - -⏳ 001-add-dark-mode-toggle Add dark mode toggle -📋 002-fix-button-styling Fix button styling -⚙️ 003-add-loading-spinner Add loading spinner -``` - -### Batch Cleanup Function - -```python -def handle_batch_cleanup_command(project_dir: str, dry_run: bool = True) -> bool -``` - -**What it does:** -1. Finds all completed specs (have qa_report.md) -2. Lists associated worktrees -3. Shows preview by default (dry-run) -4. Deletes when `--no-dry-run` is used - -**Output (dry-run):** -``` -Found 1 completed spec(s) - -Would remove: - - 001-add-dark-mode-toggle - └─ .worktrees/001-add-dark-mode-toggle/ - -Run with --no-dry-run to actually delete -``` - -### Test Data - -**File:** `batch_test.json` -```json -{ - "tasks": [ - { - "title": "Add dark mode toggle", - "description": "Add dark/light mode toggle to settings", - "workflow_type": "feature", - "services": ["frontend"], - "priority": 8, - "complexity": "simple", - "estimated_hours": 2.0 - }, - ... - ] -} -``` - ---- - -## Testing & Verification - -### Code Verification Results ✅ - -**Syntax Validation:** -- Python syntax: ✅ PASSED (`batch_commands.py`) -- JSON syntax: ✅ PASSED (`batch_test.json` - 3 valid tasks) -- TypeScript syntax: ✅ PASSED (imports, hooks, interfaces) - -**Architecture Validation:** -- ✅ File structure correct -- ✅ All imports valid -- ✅ CLI integration complete -- ✅ 3 batch functions implemented -- ✅ 4 CLI arguments added - -**File Inventory:** -| File | Status | Size | -|------|--------|------| -| `batch_commands.py` | NEW | 212 lines | -| `main.py` (batch integration) | MODIFIED | - | -| `OllamaModelSelector.tsx` | ENHANCED | 464 lines | -| `ndjson-parser.test.ts` | NEW | 223 lines | -| `OllamaModelSelector.progress.test.ts` | NEW | 196 lines | -| `batch_test.json` | NEW | 32 lines | -| `TESTING_CHECKLIST.md` | NEW | 153 lines | -| `package-lock.json` | UPDATED | - | - -### Testing Checklist - -#### Ollama Feature -- [ ] Electron window opens without errors -- [ ] DevTools (F12) shows no console errors -- [ ] OllamaModelSelector component loads -- [ ] Can enter Ollama base URL -- [ ] Download progress bar appears -- [ ] Speed displays correctly (MB/s, KB/s) -- [ ] Time remaining estimates shown -- [ ] Progress updates in real-time -- [ ] Download completes successfully - -#### Batch Tasks CLI -- [ ] `--batch-create batch_test.json` works -- [ ] Creates spec directories with auto-increment IDs -- [ ] `--batch-status` shows all specs -- [ ] `--batch-cleanup --dry-run` shows preview -- [ ] `--batch-cleanup --no-dry-run` deletes -- [ ] Error handling for missing files -- [ ] Error handling for invalid JSON - -### Ready for Testing - -The implementation is complete and ready for: - -1. **UI Testing** - Run `npm run dev` and test Ollama feature in onboarding -2. **CLI Testing** - Set up Python environment and test batch commands -3. **Integration Testing** - Test both features together -4. **Code Review** - See PR #141 on GitHub - ---- - -## Architecture & Integration - -### Directory Structure - -``` -Auto-Claude/ -├── apps/backend/ -│ ├── cli/ -│ │ ├── batch_commands.py (NEW) -│ │ ├── main.py (MODIFIED) -│ │ └── ... -│ └── ... -├── apps/frontend/ -│ ├── src/ -│ │ ├── main/ -│ │ │ ├── __tests__/ -│ │ │ │ └── ndjson-parser.test.ts (NEW) -│ │ │ └── ipc-handlers/ -│ │ │ └── memory-handlers.ts (MODIFIED) -│ │ ├── renderer/ -│ │ │ └── components/ -│ │ │ ├── onboarding/ -│ │ │ │ └── OllamaModelSelector.tsx (ENHANCED) -│ │ │ └── __tests__/ -│ │ │ └── OllamaModelSelector.progress.test.ts (NEW) -│ │ └── preload/ -│ │ └── api/ -│ │ └── project-api.ts (MODIFIED) -│ └── ... -├── batch_test.json (NEW) -├── TESTING_CHECKLIST.md (NEW) -└── ... -``` - -### Dependencies - -**No new dependencies added** - Uses existing project infrastructure: -- Frontend: React, TypeScript, Vitest -- Backend: Python standard library + existing Auto-Claude modules -- IPC: Electron built-in messaging - -### Compatibility - -✅ **Backward Compatible** -- No breaking changes to existing APIs -- New features are additive -- Existing workflows unaffected -- Old CLI commands still work - -✅ **Works with v2.7.2 Structure** -- Integrates with new `apps/` directory layout -- Uses existing worktree infrastructure -- Compatible with spec generation system -- Follows current architecture patterns - ---- - -## Key Metrics - -| Metric | Value | -|--------|-------| -| Total Commits | 7 | -| Files Created | 5 | -| Files Modified | 4 | -| Lines of Code Added | 900+ | -| Test Coverage | 420+ lines | -| Documentation | 300+ lines | -| No Breaking Changes | ✅ Yes | -| Production Ready | ✅ Yes | - ---- - -## Next Steps - -### Immediate (Testing Phase) -1. ✅ Verify code syntax and architecture (DONE) -2. ⏳ Start UI dev server: `npm run dev` -3. ⏳ Test Ollama UI feature in onboarding -4. ⏳ Test batch CLI commands with Python environment -5. ⏳ Update TESTING_CHECKLIST.md with results - -### Post-Testing -1. Fix any bugs discovered -2. Update PR #141 with final results -3. Request code review -4. Merge to `origin/develop` - -### Long-term -1. Feature included in next release -2. User documentation -3. Example batch task files in repo -4. Batch task templates for common workflows - ---- - -## GitHub PR - -**PR #141:** Ollama Download Progress + Batch Task Management -- **From:** `rayBlock/feature/ollama-and-batch-tasks` -- **To:** `AndyMik90/develop` -- **Status:** Created, awaiting testing and review - ---- - -## Summary - -This implementation successfully delivers: - -1. ✅ **Real-time Ollama model download progress tracking** with accurate speed calculation and time estimation -2. ✅ **Batch task management CLI** for creating and managing multiple tasks in one command -3. ✅ **Comprehensive test coverage** with 420+ lines of test code -4. ✅ **Full documentation** and testing checklist -5. ✅ **Clean architecture** that integrates seamlessly with existing codebase -6. ✅ **Production-ready code** with error handling and user-friendly output - -Both features are independent, well-tested, and ready for user testing and review. - diff --git a/NEXT_STEPS.md b/NEXT_STEPS.md deleted file mode 100644 index 1786a876..00000000 --- a/NEXT_STEPS.md +++ /dev/null @@ -1,281 +0,0 @@ -# Next Steps: Testing Phase - -**Status:** Implementation complete ✅ -**Date:** 2025-12-22 -**Branch:** feature/ollama-and-batch-tasks -**Ready to test:** YES - ---- - -## What's Done - -✅ 9 commits created -✅ 11 files created/modified -✅ 1,200+ lines of code -✅ 420+ lines of tests -✅ All code verified (syntax, architecture) -✅ Documentation complete -✅ Ready for testing - ---- - -## What Needs Testing - -### 1. Ollama Download Progress Feature (UI) -- **What:** Real-time progress bar for Ollama model downloads -- **Where:** Onboarding screen -- **How:** `npm run dev` then navigate to Ollama section -- **Success:** Shows speed, time remaining, progress updates - -### 2. Batch Task Management CLI -- **What:** Create multiple tasks from JSON file -- **Where:** Command line -- **How:** `python3 apps/backend/run.py --batch-create batch_test.json` -- **Success:** Creates spec directories with correct structure - ---- - -## Quick Start (5 minutes) - -```bash -cd /Users/ray/dev/decent/Auto-Claude - -# Verify setup -git branch -# Should show: * feature/ollama-and-batch-tasks - -git log --oneline -3 -# Should show latest 3 commits - -# You're ready to test! -``` - ---- - -## Full Testing (60 minutes) - -### Phase 1: UI Testing (30 minutes) - -**Terminal 1:** -```bash -npm run dev -``` - -**What to check:** -- [ ] Electron window opens -- [ ] Ollama option visible in onboarding -- [ ] Can enter base URL -- [ ] Can scan models -- [ ] Download progress shows -- [ ] Speed calculates (MB/s, KB/s) -- [ ] Time remaining shows -- [ ] Progress updates in real-time - -**See:** PHASE2_TESTING_GUIDE.md for detailed checklist - -### Phase 2: CLI Testing (20 minutes) - -**Terminal 2:** -```bash -# Test 1: Create -python3 apps/backend/run.py --batch-create batch_test.json - -# Test 2: Status -python3 apps/backend/run.py --batch-status - -# Test 3: Cleanup -python3 apps/backend/run.py --batch-cleanup -``` - -**What to check:** -- [ ] Creates 3 specs (001, 002, 003) -- [ ] Each has requirements.json -- [ ] Status shows all specs -- [ ] Cleanup shows preview -- [ ] Error handling works - -**See:** PHASE2_TESTING_GUIDE.md for detailed checklist - -### Phase 3: Document & Fix (10 minutes) - -1. **Fill in:** TESTING_CHECKLIST.md with results -2. **Note:** Any issues found -3. **Create commits:** For any bugs fixed -4. **Push:** `git push fork feature/ollama-and-batch-tasks` - ---- - -## Documents to Use - -| Document | Purpose | When to Use | -|----------|---------|------------| -| PHASE2_TESTING_GUIDE.md | Step-by-step procedures | During testing | -| TESTING_CHECKLIST.md | Interactive checklist | Check off as you test | -| batch_test.json | Sample data | For CLI testing | -| IMPLEMENTATION_SUMMARY.md | Feature overview | Reference during testing | - ---- - -## Testing Commands Cheat Sheet - -```bash -# Start UI -npm run dev - -# Test batch create -python3 apps/backend/run.py --batch-create batch_test.json - -# Check results -python3 apps/backend/run.py --batch-status - -# Preview cleanup -python3 apps/backend/run.py --batch-cleanup - -# View commits -git log --oneline -5 - -# Check status -git status -``` - ---- - -## Expected Results - -### UI Feature Success: -- ✅ Component loads without errors -- ✅ Progress bar animates smoothly -- ✅ Speed calculation accurate -- ✅ Time remaining reasonable -- ✅ No console errors - -### CLI Feature Success: -- ✅ Batch create generates 3 specs -- ✅ Each spec has correct structure -- ✅ Status shows all specs properly -- ✅ Cleanup shows/deletes correctly -- ✅ Error handling works - -### Code Quality Success: -- ✅ No TypeScript errors -- ✅ No Python errors -- ✅ Clean git history -- ✅ Documentation complete - ---- - -## If Issues Found - -### 1. Document the Issue -``` -What: [description] -Where: [file/feature] -Steps to reproduce: [how to see it] -Expected: [what should happen] -Actual: [what does happen] -``` - -### 2. Try to Fix -- Make the code change -- Test it works -- Commit: `git commit -am "fix: description"` - -### 3. Push Updates -```bash -git push fork feature/ollama-and-batch-tasks -``` - -PR auto-updates with new commits. - ---- - -## Success Indicators - -You'll know it's working when: - -✅ **UI Feature:** -``` -1. npm run dev opens without errors -2. Ollama component loads -3. Can enter a URL -4. Download shows progress -5. Speed and time remaining display -6. No console errors -``` - -✅ **CLI Feature:** -``` -1. Batch create generates 3 specs -2. Each spec in .auto-claude/specs/ -3. Each has requirements.json -4. Status shows all 3 specs -5. Can clean up without errors -``` - ---- - -## Estimated Timeline - -- **Phase 1 Setup:** 5 minutes -- **UI Testing:** 30 minutes -- **CLI Testing:** 20 minutes -- **Documentation:** 5 minutes -- **Fixes (if needed):** 10 minutes - -**Total:** 60-70 minutes - ---- - -## Still Have Questions? - -1. **About testing:** See PHASE2_TESTING_GUIDE.md -2. **About features:** See IMPLEMENTATION_SUMMARY.md -3. **About commands:** See TESTING_CHECKLIST.md -4. **About code:** See CLAUDE.md (project README) - ---- - -## Next After Testing - -Once testing is complete: - -1. Update TESTING_CHECKLIST.md with date and results -2. Push any fixes: `git push fork feature/ollama-and-batch-tasks` -3. Request code review on PR #141 -4. Prepare for merge to develop - ---- - -## Key Files to Know - -``` -Auto-Claude/ -├── PHASE2_TESTING_GUIDE.md ← Use this for testing -├── TESTING_CHECKLIST.md ← Fill this in during testing -├── IMPLEMENTATION_SUMMARY.md ← Reference guide -├── batch_test.json ← Sample data -├── apps/backend/cli/ -│ └── batch_commands.py ← Batch CLI code -└── apps/frontend/src/ - └── renderer/components/ - └── onboarding/ - └── OllamaModelSelector.tsx ← Ollama UI code -``` - ---- - -## You're All Set! 🚀 - -The implementation is complete and ready for testing. -Follow PHASE2_TESTING_GUIDE.md for step-by-step instructions. - -Start with: `npm run dev` in Terminal 1 - -Good luck! 🎉 - ---- - -**Created:** 2025-12-22 -**Status:** Ready to begin Phase 2 Testing -**Branch:** feature/ollama-and-batch-tasks -**Commits:** 9 ahead of origin/develop diff --git a/PHASE2_TESTING_GUIDE.md b/PHASE2_TESTING_GUIDE.md deleted file mode 100644 index c457e07c..00000000 --- a/PHASE2_TESTING_GUIDE.md +++ /dev/null @@ -1,458 +0,0 @@ -# Phase 2: Testing Guide - Ollama + Batch Features - -**Branch:** `feature/ollama-and-batch-tasks` -**Status:** Implementation complete, ready for testing -**Created:** 8 commits, 11 files modified/created -**Verified:** Code syntax, architecture, file structure ✅ - ---- - -## Quick Start - -### 1. Verify Branch & Code - -```bash -cd /Users/ray/dev/decent/Auto-Claude -git branch -# Should show: * feature/ollama-and-batch-tasks - -git log --oneline -3 -# Should show latest 3 commits -``` - -### 2. Test UI Feature (Ollama Download Progress) - -**Terminal 1 - Start Dev Server:** -```bash -cd /Users/ray/dev/decent/Auto-Claude -npm run dev -``` - -**Expected Output:** -- Electron window opens -- No console errors in DevTools (F12) -- Onboarding screen shows Ollama option - -**What to Look For:** -- ✅ OllamaModelSelector component loads -- ✅ Can enter Ollama base URL (e.g., http://localhost:11434) -- ✅ "Scan Models" button works -- ✅ If Ollama running: Shows available models -- ✅ Download button available -- ✅ Progress bar appears during download -- ✅ Speed displays (MB/s, KB/s) -- ✅ Time remaining estimated -- ✅ Progress updates in real-time -- ✅ Download completes without errors - -### 3. Test CLI Feature (Batch Tasks) - -**Terminal 2 - Test Batch Commands:** - -```bash -cd /Users/ray/dev/decent/Auto-Claude - -# Test 1: Create batch specs -python3 apps/backend/run.py --batch-create batch_test.json -# Should create 001, 002, 003 spec directories - -# Test 2: View specs -python3 apps/backend/run.py --batch-status -# Should show 3 specs with status icons - -# Test 3: Preview cleanup -python3 apps/backend/run.py --batch-cleanup -# Should show what would be deleted (dry-run by default) -``` - ---- - -## Detailed Testing Checklist - -### UI Testing (Ollama Feature) - -Use this checklist while testing `npm run dev`: - -#### Component Loading -- [ ] Electron window opens without crash -- [ ] No errors in DevTools console (F12) -- [ ] OllamaModelSelector component visible -- [ ] "Ollama Model Provider" heading shows - -#### URL Input -- [ ] Base URL input field present -- [ ] Can type in URL field -- [ ] Default value shows (if configured) -- [ ] Input field is responsive - -#### Model Scanning -- [ ] "Scan Models" button clickable -- [ ] Button shows loading state during scan -- [ ] Results appear (if Ollama running locally) -- [ ] Error message if Ollama not reachable -- [ ] Models list displays correctly - -#### Download Progress (NEW - Main Feature) -- [ ] Download button appears for models -- [ ] Click download initiates process -- [ ] Progress bar appears immediately -- [ ] Shows 0% → 100% progression -- [ ] Speed displays in appropriate unit (MB/s, KB/s, B/s) -- [ ] Speed updates as download progresses -- [ ] Time remaining shows and decreases -- [ ] Time remaining is reasonable estimate -- [ ] Download percentage updates frequently -- [ ] Progress bar animates smoothly -- [ ] Can cancel download -- [ ] Download completes successfully -- [ ] Success message shown - -#### UI Responsiveness -- [ ] UI remains responsive during download -- [ ] Can interact with other elements -- [ ] No frozen buttons or input fields -- [ ] Animations smooth (no jank) - -#### Error Handling -- [ ] Shows error for invalid URL -- [ ] Shows error for unreachable host -- [ ] Shows error for network timeout -- [ ] Error messages are helpful -- [ ] Can retry after error - -#### DevTools Analysis -Open DevTools (F12) and check: -- [ ] Console tab: No errors or warnings -- [ ] Network tab: Download requests visible -- [ ] Check IPC messages for progress events -- [ ] Memory usage doesn't grow excessively - ---- - -### CLI Testing (Batch Tasks) - -Use this checklist while testing batch commands: - -#### Batch Create - -```bash -python3 apps/backend/run.py --batch-create batch_test.json -``` - -**Expected Output:** -``` -[1/3] Created 001 - Add dark mode toggle -[2/3] Created 002 - Fix button styling -[3/3] Created 003 - Add loading spinner -Created 3 spec(s) successfully - -Next steps: - 1. Generate specs: spec_runner.py --continue - 2. Approve specs and build them - 3. Run: python run.py --spec to execute -``` - -**Verify:** -- [ ] Command completes without error -- [ ] Shows progress for each task -- [ ] Shows "Created 3 spec(s) successfully" -- [ ] Directories created: `.auto-claude/specs/001-*`, `002-*`, `003-*` -- [ ] Each directory has `requirements.json` -- [ ] `requirements.json` contains correct fields: - - [ ] `task_description` - - [ ] `description` - - [ ] `workflow_type` - - [ ] `services_involved` - - [ ] `priority` - - [ ] `complexity_inferred` - - [ ] `estimate` (with `estimated_hours`) -- [ ] All 3 tasks created with proper structure - -#### Batch Status - -```bash -python3 apps/backend/run.py --batch-status -``` - -**Expected Output:** -``` -Found 3 spec(s) - -⏳ 001-add-dark-mode-toggle Add dark mode toggle -📋 002-fix-button-styling Fix button styling -⚙️ 003-add-loading-spinner Add loading spinner -``` - -**Verify:** -- [ ] Command completes without error -- [ ] Shows "Found 3 spec(s)" -- [ ] Lists all 3 specs -- [ ] Shows status icons: - - [ ] ⏳ = pending_spec (no spec.md) - - [ ] 📋 = spec_created (has spec.md) - - [ ] ⚙️ = building (has implementation_plan.json) - - [ ] ✅ = qa_approved (has qa_report.md) -- [ ] Shows spec names and titles -- [ ] Formatting is readable and aligned - -#### Batch Cleanup - -```bash -python3 apps/backend/run.py --batch-cleanup -``` - -**Expected Output (dry-run):** -``` -No completed specs to clean up -``` -(Unless you've completed a spec build) - -**Verify:** -- [ ] Command completes without error -- [ ] Shows "No completed specs" or lists them -- [ ] Default is dry-run (doesn't delete) -- [ ] Shows what WOULD be deleted -- [ ] Shows associated worktrees that would be removed - -**Test with --no-dry-run:** -```bash -python3 apps/backend/run.py --batch-cleanup --no-dry-run -``` - -**Verify:** -- [ ] Actually deletes specs when flag used -- [ ] Removes spec directories -- [ ] Removes associated worktrees -- [ ] Returns to clean state - -#### Error Handling - -Test error cases: - -```bash -# Test 1: Missing file -python3 apps/backend/run.py --batch-create nonexistent.json -# Should show: "Batch file not found" - -# Test 2: Invalid JSON -echo "{ invalid json" > bad.json -python3 apps/backend/run.py --batch-create bad.json -# Should show: "Invalid JSON" - -# Test 3: Empty tasks -echo '{"tasks": []}' > empty.json -python3 apps/backend/run.py --batch-create empty.json -# Should show: "No tasks found" -``` - -**Verify:** -- [ ] Shows helpful error message -- [ ] Doesn't crash -- [ ] Suggests next steps - ---- - -## Architecture Verification - -If any issues found, verify the architecture is correct: - -### Files Created -```bash -ls -la apps/backend/cli/batch_commands.py -ls -la apps/frontend/src/main/__tests__/ndjson-parser.test.ts -ls -la apps/frontend/src/renderer/components/__tests__/OllamaModelSelector.progress.test.ts -ls -la batch_test.json -``` - -**All should exist.** - -### Files Modified -```bash -grep "batch_commands" apps/backend/cli/main.py -# Should show import and handler calls -``` - -### Code Quality -```bash -python3 -m py_compile apps/backend/cli/batch_commands.py -# Should exit with code 0 (success) -``` - ---- - -## Common Issues & Solutions - -### Issue: "command not found: npm" -**Solution:** Install Node.js or use full path to npm - -### Issue: "No module named 'claude_agent_sdk'" -**Solution:** Backend environment not set up. This is expected for CLI testing without full venv. - -### Issue: UI doesn't load -**Solution:** -1. Check that `npm run dev` output has no errors -2. Look at DevTools console (F12) -3. Check terminal for error messages - -### Issue: Download progress not showing -**Solution:** -1. Open DevTools (F12) -2. Check Network tab - should see Ollama requests -3. Check if Ollama is actually running locally -4. Try different Ollama URL - -### Issue: Batch create fails -**Solution:** -1. Verify `batch_test.json` exists in current directory -2. Check file is valid JSON: `python3 -c "import json; json.load(open('batch_test.json'))"` -3. Check `.auto-claude/specs/` directory permissions -4. Ensure no existing specs with same IDs - ---- - -## Testing Timeline - -**Estimated Time:** 30-60 minutes - -1. **Setup** (5 min) - - Open 2 terminals - - Verify branch and commits - -2. **UI Testing** (20-30 min) - - Start dev server - - Navigate to Ollama feature - - Test download (if possible with local Ollama) - - Check DevTools - - Test error cases - -3. **CLI Testing** (10-15 min) - - Test batch create - - Test batch status - - Test batch cleanup - - Test error cases - -4. **Documentation** (5 min) - - Fill in TESTING_CHECKLIST.md - - Note any issues found - - Record timing - ---- - -## What to Do If You Find Issues - -1. **Note the Issue** - - What were you doing? - - What happened? - - What did you expect? - - Screenshot/error message? - -2. **Check if It's a Blocker** - - Does it prevent core feature from working? - - Or just a minor UI issue? - -3. **Create a Summary** - - Write up in TESTING_CHECKLIST.md under "Notes" - - Include reproduction steps - - Include expected vs actual behavior - -4. **Fix the Bug** (if possible) - - Make the code change - - Test the fix - - Commit: `git commit -am "fix: description of fix"` - - Push: `git push fork feature/ollama-and-batch-tasks` - ---- - -## Success Criteria - -All of the following must be true: - -✅ **Ollama Feature:** -- Loads without errors -- Shows download progress -- Calculates speed correctly -- Estimates time remaining -- Downloads complete successfully -- No console errors - -✅ **Batch Tasks:** -- Create command works -- Creates correct spec structure -- Status command shows all specs -- Cleanup shows preview -- Error handling works - -✅ **Code Quality:** -- No syntax errors -- Clean git history -- All tests pass -- Documentation complete - ---- - -## After Testing - -1. **Update TESTING_CHECKLIST.md** - - Mark completed tests - - Note any issues - - Add observations - -2. **If Bugs Found** - - Fix the bug - - Create new commit - - Push to fork - - PR auto-updates - -3. **If All Good** - - Mark PR as ready for review - - Note completion date - - Summary of testing - -4. **Next Phase** - - Code review - - Merge to develop - - Create release notes - ---- - -## Files to Know - -| File | Purpose | Status | -|------|---------|--------| -| IMPLEMENTATION_SUMMARY.md | Feature overview | Reference | -| TESTING_CHECKLIST.md | Test guide | Update during testing | -| batch_test.json | Sample batch data | Use for testing | -| batch_commands.py | Batch CLI implementation | Verify during testing | -| OllamaModelSelector.tsx | Ollama UI component | Test with npm run dev | - ---- - -## Quick Reference - -```bash -# Start UI dev server -npm run dev - -# Test batch create -python3 apps/backend/run.py --batch-create batch_test.json - -# View batch status -python3 apps/backend/run.py --batch-status - -# Preview cleanup -python3 apps/backend/run.py --batch-cleanup - -# Check branch status -git branch && git log --oneline -3 - -# Push changes if needed -git push fork feature/ollama-and-batch-tasks -``` - ---- - -**Last Updated:** 2025-12-22 -**Testing Status:** Ready to start -**Expected Completion:** Ongoing - -Good luck with testing! 🚀 diff --git a/README.md b/README.md index b6ea25f9..6174a26d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ![Auto Claude Kanban Board](.github/assets/Auto-Claude-Kanban.png) -[![Version](https://img.shields.io/badge/version-2.8.0-blue?style=flat-square)](https://github.com/AndyMik90/Auto-Claude/releases/latest) +[![Version](https://img.shields.io/badge/version-2.7.2-blue?style=flat-square)](https://github.com/AndyMik90/Auto-Claude/releases/latest) [![License](https://img.shields.io/badge/license-AGPL--3.0-green?style=flat-square)](./agpl-3.0.txt) [![Discord](https://img.shields.io/badge/Discord-Join%20Community-5865F2?style=flat-square&logo=discord&logoColor=white)](https://discord.gg/KCXaPBr4Dj) [![CI](https://img.shields.io/github/actions/workflow/status/AndyMik90/Auto-Claude/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/AndyMik90/Auto-Claude/actions) @@ -17,11 +17,11 @@ Get the latest pre-built release for your platform: | Platform | Download | Notes | |----------|----------|-------| -| **Windows** | [Auto-Claude-2.8.0.exe](https://github.com/AndyMik90/Auto-Claude/releases/latest) | Installer (NSIS) | -| **macOS (Apple Silicon)** | [Auto-Claude-2.8.0-arm64.dmg](https://github.com/AndyMik90/Auto-Claude/releases/latest) | M1/M2/M3 Macs | -| **macOS (Intel)** | [Auto-Claude-2.8.0-x64.dmg](https://github.com/AndyMik90/Auto-Claude/releases/latest) | Intel Macs | -| **Linux** | [Auto-Claude-2.8.0.AppImage](https://github.com/AndyMik90/Auto-Claude/releases/latest) | Universal | -| **Linux (Debian)** | [Auto-Claude-2.8.0.deb](https://github.com/AndyMik90/Auto-Claude/releases/latest) | Ubuntu/Debian | +| **Windows** | [Auto-Claude-2.7.2.exe](https://github.com/AndyMik90/Auto-Claude/releases/latest) | Installer (NSIS) | +| **macOS (Apple Silicon)** | [Auto-Claude-2.7.2-arm64.dmg](https://github.com/AndyMik90/Auto-Claude/releases/latest) | M1/M2/M3 Macs | +| **macOS (Intel)** | [Auto-Claude-2.7.2-x64.dmg](https://github.com/AndyMik90/Auto-Claude/releases/latest) | Intel Macs | +| **Linux** | [Auto-Claude-2.7.2.AppImage](https://github.com/AndyMik90/Auto-Claude/releases/latest) | Universal | +| **Linux (Debian)** | [Auto-Claude-2.7.2.deb](https://github.com/AndyMik90/Auto-Claude/releases/latest) | Ubuntu/Debian | > All releases include SHA256 checksums and VirusTotal scan results for security verification. diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index 3978b063..00000000 --- a/RELEASE.md +++ /dev/null @@ -1,186 +0,0 @@ -# Release Process - -This document describes how to create a new release of Auto Claude. - -## Automated Release Process (Recommended) - -We provide an automated script that handles version bumping, git commits, and tagging to ensure version consistency. - -### Prerequisites - -- Clean git working directory (no uncommitted changes) -- You're on the branch you want to release from (usually `main`) - -### Steps - -1. **Run the version bump script:** - - ```bash - # Bump patch version (2.5.5 -> 2.5.6) - node scripts/bump-version.js patch - - # Bump minor version (2.5.5 -> 2.6.0) - node scripts/bump-version.js minor - - # Bump major version (2.5.5 -> 3.0.0) - node scripts/bump-version.js major - - # Set specific version - node scripts/bump-version.js 2.6.0 - ``` - - This script will: - - ✅ Update `apps/frontend/package.json` with the new version - - ✅ Create a git commit with the version change - - ✅ Create a git tag (e.g., `v2.5.6`) - - ⚠️ **NOT** push to remote (you control when to push) - -2. **Review the changes:** - - ```bash - git log -1 # View the commit - git show v2.5.6 # View the tag - ``` - -3. **Push to GitHub:** - - ```bash - # Push the commit - git push origin main - - # Push the tag - git push origin v2.5.6 - ``` - -4. **Create GitHub Release:** - - - Go to [GitHub Releases](https://github.com/AndyMik90/Auto-Claude/releases) - - Click "Draft a new release" - - Select the tag you just pushed (e.g., `v2.5.6`) - - Add release notes (describe what changed) - - Click "Publish release" - -5. **Automated builds will trigger:** - - - ✅ Version validation workflow will verify version consistency - - ✅ Tests will run (`test-on-tag.yml`) - - ✅ Native module prebuilds will be created (`build-prebuilds.yml`) - - ✅ Discord notification will be sent (`discord-release.yml`) - -## Manual Release Process (Not Recommended) - -If you need to create a release manually, follow these steps **carefully** to avoid version mismatches: - -1. **Update `apps/frontend/package.json`:** - - ```json - { - "version": "2.5.6" - } - ``` - -2. **Commit the change:** - - ```bash - git add apps/frontend/package.json - git commit -m "chore: bump version to 2.5.6" - ``` - -3. **Create and push tag:** - - ```bash - git tag -a v2.5.6 -m "Release v2.5.6" - git push origin main - git push origin v2.5.6 - ``` - -4. **Create GitHub Release** (same as step 4 above) - -## Version Validation - -A GitHub Action automatically validates that the version in `package.json` matches the git tag. - -If there's a mismatch, the workflow will **fail** with a clear error message: - -``` -❌ ERROR: Version mismatch detected! - -The version in package.json (2.5.0) does not match -the git tag version (2.5.5). - -To fix this: - 1. Delete this tag: git tag -d v2.5.5 - 2. Update package.json version to 2.5.5 - 3. Commit the change - 4. Recreate the tag: git tag -a v2.5.5 -m 'Release v2.5.5' -``` - -This validation ensures we never ship a release where the updater shows the wrong version. - -## Troubleshooting - -### Version Mismatch Error - -If you see a version mismatch error in GitHub Actions: - -1. **Delete the incorrect tag:** - ```bash - git tag -d v2.5.6 # Delete locally - git push origin :refs/tags/v2.5.6 # Delete remotely - ``` - -2. **Use the automated script:** - ```bash - node scripts/bump-version.js 2.5.6 - git push origin main - git push origin v2.5.6 - ``` - -### Git Working Directory Not Clean - -If the version bump script fails with "Git working directory is not clean": - -```bash -# Commit or stash your changes first -git status -git add . -git commit -m "your changes" - -# Then run the version bump script -node scripts/bump-version.js patch -``` - -## Release Checklist - -Use this checklist when creating a new release: - -- [ ] All tests passing on main branch -- [ ] CHANGELOG updated (if applicable) -- [ ] Run `node scripts/bump-version.js ` -- [ ] Review commit and tag -- [ ] Push commit and tag to GitHub -- [ ] Create GitHub Release with release notes -- [ ] Verify version validation passed -- [ ] Verify builds completed successfully -- [ ] Test the updater shows correct version - -## What Gets Released - -When you create a release, the following are built and published: - -1. **Native module prebuilds** - Windows node-pty binaries -2. **Electron app packages** - Desktop installers (triggered manually or via electron-builder) -3. **Discord notification** - Sent to the Auto Claude community - -## Version Numbering - -We follow [Semantic Versioning (SemVer)](https://semver.org/): - -- **MAJOR** version (X.0.0) - Breaking changes -- **MINOR** version (0.X.0) - New features (backward compatible) -- **PATCH** version (0.0.X) - Bug fixes (backward compatible) - -Examples: -- `2.5.5 -> 2.5.6` - Bug fix -- `2.5.6 -> 2.6.0` - New feature -- `2.6.0 -> 3.0.0` - Breaking change diff --git a/TESTING_CHECKLIST.md b/TESTING_CHECKLIST.md deleted file mode 100644 index c51468f8..00000000 --- a/TESTING_CHECKLIST.md +++ /dev/null @@ -1,232 +0,0 @@ -# Testing Checklist - Ollama + Batch Tasks - -## Quick Start - -```bash -# Terminal 1: Start dev UI -cd /Users/ray/dev/decent/Auto-Claude -npm run dev - -# Terminal 2: Test CLI -cd /Users/ray/dev/decent/Auto-Claude - -# Test batch task creation -python apps/backend/run.py --batch-create batch_test.json - -# View batch status -python apps/backend/run.py --batch-status - -# Preview cleanup -python apps/backend/run.py --batch-cleanup -``` - -## UI Testing (Ollama Feature) - -### Component Loading -- [ ] Electron window opens without errors -- [ ] No console errors in DevTools (F12) -- [ ] OllamaModelSelector component loads -- [ ] Base URL input field visible - -### Model Scanning -- [ ] Can enter Ollama base URL (e.g., http://localhost:11434) -- [ ] Scan models button works -- [ ] Models list displays (if local Ollama running) - -### Download Progress (NEW) -- [ ] Download button initiates model download -- [ ] Progress bar appears -- [ ] Speed displays (MB/s, KB/s, B/s) -- [ ] Time remaining calculated -- [ ] Percentage updates in real-time -- [ ] Progress bar animates smoothly -- [ ] Download completes successfully - -### IPC Communication -- [ ] F12 Console shows onDownloadProgress events -- [ ] No network errors -- [ ] Main process ↔ Renderer communication works -- [ ] Memory handlers process NDJSON correctly - -## CLI Testing (Batch Tasks) - -### Batch Creation -- [ ] File exists: `batch_test.json` -- [ ] Command: `python apps/backend/run.py --batch-create batch_test.json` -- [ ] Shows status for each task created -- [ ] Creates 3 new specs (001, 002, 003) -- [ ] Each spec has `requirements.json` -- [ ] Priority, complexity, services set correctly - -### Batch Status -- [ ] Command: `python apps/backend/run.py --batch-status` -- [ ] Lists all specs with status -- [ ] Shows titles for each spec -- [ ] Shows current state (pending_spec, spec_created, building, etc.) -- [ ] Formatted output is readable - -### Batch Cleanup -- [ ] Command: `python apps/backend/run.py --batch-cleanup` -- [ ] Shows preview of what would be deleted -- [ ] Lists completed specs (if any) -- [ ] Lists associated worktrees -- [ ] Dry-run mode (default) doesn't delete -- [ ] With `--no-dry-run` actually deletes - -## Integration Testing - -### Files Structure -- [ ] `.auto-claude/specs/001-*` directory exists -- [ ] `.auto-claude/specs/002-*` directory exists -- [ ] `.auto-claude/specs/003-*` directory exists -- [ ] Each has `requirements.json` -- [ ] Each has `memory/` subdirectory - -### CLI Integration -- [ ] Batch create works with old CLI structure -- [ ] Batch commands integrated into main.py -- [ ] Help text available: `python apps/backend/run.py --help` -- [ ] Error handling for missing files -- [ ] Error handling for invalid JSON - -### Ollama Feature Files -- [ ] OllamaModelSelector.tsx exists in correct location -- [ ] ndjson-parser.test.ts exists -- [ ] OllamaModelSelector.progress.test.ts exists -- [ ] All imports path correctly to new structure -- [ ] No broken dependencies - -## Edge Cases - -- [ ] Handle empty batch file -- [ ] Handle missing required fields in JSON -- [ ] Handle duplicate task titles -- [ ] Handle special characters in titles -- [ ] Large file downloads (>1GB) -- [ ] Network interruption during download -- [ ] Invalid Ollama base URL -- [ ] Cleanup with no specs - -## Performance - -- [ ] UI responsive during progress updates -- [ ] No memory leaks in progress tracking -- [ ] IPC events don't spam console -- [ ] Speed calculations accurate -- [ ] Time remaining estimates reasonable - -## Code Quality - -- [ ] No TypeScript errors -- [ ] No ESLint warnings -- [ ] No console errors/warnings -- [ ] Proper error handling -- [ ] User-friendly error messages - -## Test Results - -Date: 2025-12-22 (Code Verification Phase) -Updated: 2025-12-22 21:20 (Phase 2 Testing - Bug Fixes Applied) - -### Architecture Verification ✅ -- [x] ✅ batch_commands.py exists with 3 functions -- [x] ✅ CLI integration: --batch-create, --batch-status, --batch-cleanup -- [x] ✅ OllamaModelSelector.tsx (464 lines) with download/progress code -- [x] ✅ Test files created: ndjson-parser.test.ts (224 lines), OllamaModelSelector.progress.test.ts (197 lines) -- [x] ✅ batch_test.json valid with 3 test tasks -- [x] ✅ Python syntax validation passed -- [x] ✅ JSON validation passed - -### Code Quality ✅ -- [x] ✅ TypeScript imports correct -- [x] ✅ React hooks imported (useState, useEffect) -- [x] ✅ IPC communication setup present -- [x] ✅ Progress tracking code present -- [x] ✅ Download functionality implemented -- [x] ✅ Batch command functions all implemented -- [x] ✅ Error handling integrated -- [x] ✅ No syntax errors detected - -### Git Status ✅ -- [x] ✅ 6 commits on feature/ollama-and-batch-tasks branch -- [x] ✅ Last commit: chore: update package-lock.json to match v2.7.2 -- [x] ✅ All work committed (no uncommitted changes) -- [x] ✅ Branch is ahead of origin/develop by 5 commits - -### Files Created/Modified -- [x] ✅ apps/backend/cli/batch_commands.py (NEW - 212 lines) -- [x] ✅ apps/backend/cli/main.py (MODIFIED - batch integration) -- [x] ✅ apps/frontend/src/renderer/components/onboarding/OllamaModelSelector.tsx (MODIFIED) -- [x] ✅ apps/frontend/src/main/__tests__/ndjson-parser.test.ts (NEW) -- [x] ✅ apps/frontend/src/renderer/components/__tests__/OllamaModelSelector.progress.test.ts (NEW) -- [x] ✅ TESTING_CHECKLIST.md (NEW) -- [x] ✅ batch_test.json (NEW) - -### Ollama Feature -- [x] ✅ Component structure valid -- [x] ✅ React hooks setup correct -- [x] ✅ Progress tracking code present -- [x] ✅ Speed calculation implemented -- [x] ✅ Time remaining estimation code present -- [x] ✅ IPC event streaming setup -- [x] ✅ Test coverage: 197 lines of tests - -### Batch Tasks -- [x] ✅ Create function: Parses JSON, creates spec dirs, generates requirements.json -- [x] ✅ Status function: Lists all specs with current state and icons -- [x] ✅ Cleanup function: Identifies completed specs, preview mode by default -- [x] ✅ Error handling: Missing files, invalid JSON, edge cases -- [x] ✅ Test coverage: Comprehensive test file with 3 example tasks -- [x] ✅ Test data validation: batch_test.json parses correctly - -### Overall Status -- [x] ✅ All features implemented and integrated -- [x] ✅ Code passes syntax validation -- [x] ✅ Architecture verified -- [x] ✅ Git history clean -- [x] ✅ Documentation complete -- [x] ✅ Ready for PR review and testing - -## Notes - -### Verification Summary -All code has been verified for: -1. **Syntax Correctness** - Python and TypeScript files parse without errors -2. **Architecture Integrity** - Files in correct locations, imports valid, CLI integration complete -3. **Feature Completeness** - Both Ollama UI feature and batch task CLI feature fully implemented -4. **Test Coverage** - 420+ lines of test code for both features -5. **Documentation** - Comprehensive testing checklist and batch task test data provided - -### Phase 2 Testing - Bugs Found and Fixed ✅ - -During initial dev server startup, two critical bugs were discovered and fixed: - -**Bug #1: Merge Conflict in project-api.ts (Line 236)** -- Issue: Git merge conflict markers left from cherry-pick -- Error: "Expected identifier but found '<<'" during TypeScript compilation -- Resolution: Removed conflict markers, kept Ollama feature code -- Commit: 6a34a78 "fix: resolve merge conflict in project-api.ts from Ollama feature cherry-pick" -- Status: ✅ FIXED - -**Bug #2: Duplicate OLLAMA_CHECK_STATUS Handler Registration** -- Issue: Handler registered twice in memory-handlers.ts (lines 395-419 and 433-457) -- Error: "Attempted to register a second handler for 'ollama:checkStatus'" -- Resolution: Removed duplicate handler registration, kept original implementation -- Commit: eccf189 "fix: remove duplicate Ollama check status handler registration" -- Status: ✅ FIXED - -**Result After Fixes:** -- ✅ Dev server compiles successfully -- ✅ No build errors -- ✅ Electron window loads -- ✅ All IPC handlers register correctly -- ✅ Ready for manual UI and CLI testing - -### Ready for Next Phase -The implementation is complete and verified with bugs fixed. Ready for: -- ✅ Dev server running successfully -- [ ] Manual UI testing with `npm run dev` -- [ ] CLI testing with batch commands -- [ ] Full integration testing -- Code review in PR #141 - diff --git a/apps/backend/__init__.py b/apps/backend/__init__.py index b67bca87..05c23314 100644 --- a/apps/backend/__init__.py +++ b/apps/backend/__init__.py @@ -19,5 +19,5 @@ Quick Start: See README.md for full documentation. """ -__version__ = "2.5.5" +__version__ = "2.7.2" __author__ = "Auto Claude Team" diff --git a/apps/backend/cli/batch_commands.py b/apps/backend/cli/batch_commands.py index 0e294e21..28a82ea9 100644 --- a/apps/backend/cli/batch_commands.py +++ b/apps/backend/cli/batch_commands.py @@ -7,51 +7,53 @@ Commands for creating and managing multiple tasks from batch files. import json from pathlib import Path -from typing import Optional -from ui import print_status, success, error, highlight + +from ui import highlight, print_status def handle_batch_create_command(batch_file: str, project_dir: str) -> bool: """ Create multiple tasks from a batch JSON file. - + Args: batch_file: Path to JSON file with task definitions project_dir: Project directory - + Returns: True if successful """ batch_path = Path(batch_file) - + if not batch_path.exists(): print_status(f"Batch file not found: {batch_file}", "error") return False - + try: with open(batch_path) as f: batch_data = json.load(f) except json.JSONDecodeError as e: print_status(f"Invalid JSON in batch file: {e}", "error") return False - + tasks = batch_data.get("tasks", []) if not tasks: print_status("No tasks found in batch file", "warning") return False - + print_status(f"Creating {len(tasks)} tasks from batch file", "info") print() - + specs_dir = Path(project_dir) / ".auto-claude" / "specs" specs_dir.mkdir(parents=True, exist_ok=True) - + # Find next spec ID existing_specs = [d.name for d in specs_dir.iterdir() if d.is_dir()] - next_id = max([int(s.split("-")[0]) for s in existing_specs if s[0].isdigit()] or [0]) + 1 - + next_id = ( + max([int(s.split("-")[0]) for s in existing_specs if s[0].isdigit()] or [0]) + 1 + ) + created_specs = [] - + for idx, task in enumerate(tasks, 1): spec_id = f"{next_id:03d}" task_title = task.get("title", f"Task {idx}") @@ -59,7 +61,7 @@ def handle_batch_create_command(batch_file: str, project_dir: str) -> bool: spec_name = f"{spec_id}-{task_slug}" spec_dir = specs_dir / spec_name spec_dir.mkdir(exist_ok=True) - + # Create requirements.json requirements = { "task_description": task.get("description", task_title), @@ -72,69 +74,73 @@ def handle_batch_create_command(batch_file: str, project_dir: str) -> bool: "created_at": Path(spec_dir).stat().st_mtime, "estimate": { "estimated_hours": task.get("estimated_hours", 4.0), - "estimated_days": task.get("estimated_days", 0.5) - } + "estimated_days": task.get("estimated_days", 0.5), + }, } - + req_file = spec_dir / "requirements.json" with open(req_file, "w") as f: json.dump(requirements, f, indent=2, default=str) - - created_specs.append({ - "id": spec_id, - "name": spec_name, - "title": task_title, - "status": "pending_spec_creation" - }) - - print_status(f"[{idx}/{len(tasks)}] Created {spec_id} - {task_title}", "success") + + created_specs.append( + { + "id": spec_id, + "name": spec_name, + "title": task_title, + "status": "pending_spec_creation", + } + ) + + print_status( + f"[{idx}/{len(tasks)}] Created {spec_id} - {task_title}", "success" + ) next_id += 1 - + print() print_status(f"Created {len(created_specs)} spec(s) successfully", "success") print() - + # Show summary print(highlight("Next steps:")) print(" 1. Generate specs: spec_runner.py --continue ") print(" 2. Approve specs and build them") print(" 3. Run: python run.py --spec to execute") - + return True def handle_batch_status_command(project_dir: str) -> bool: """ Show status of all specs in project. - + Args: project_dir: Project directory - + Returns: True if successful """ specs_dir = Path(project_dir) / ".auto-claude" / "specs" - + if not specs_dir.exists(): print_status("No specs found in project", "warning") return True - + specs = sorted([d for d in specs_dir.iterdir() if d.is_dir()]) - + if not specs: print_status("No specs found", "warning") return True - + print_status(f"Found {len(specs)} spec(s)", "info") print() - + for spec_dir in specs: spec_name = spec_dir.name req_file = spec_dir / "requirements.json" - + status = "unknown" title = spec_name - + if req_file.exists(): try: with open(req_file) as f: @@ -142,7 +148,7 @@ def handle_batch_status_command(project_dir: str) -> bool: title = req.get("task_description", title) except json.JSONDecodeError: pass - + # Determine status if (spec_dir / "spec.md").exists(): status = "spec_created" @@ -152,50 +158,50 @@ def handle_batch_status_command(project_dir: str) -> bool: status = "qa_approved" else: status = "pending_spec" - + status_icon = { "pending_spec": "⏳", "spec_created": "📋", "building": "⚙️", "qa_approved": "✅", - "unknown": "❓" + "unknown": "❓", }.get(status, "❓") - + print(f"{status_icon} {spec_name:<40} {title}") - + return True def handle_batch_cleanup_command(project_dir: str, dry_run: bool = True) -> bool: """ Clean up completed specs and worktrees. - + Args: project_dir: Project directory dry_run: If True, show what would be deleted - + Returns: True if successful """ specs_dir = Path(project_dir) / ".auto-claude" / "specs" worktrees_dir = Path(project_dir) / ".worktrees" - + if not specs_dir.exists(): print_status("No specs directory found", "info") return True - + # Find completed specs completed = [] for spec_dir in specs_dir.iterdir(): if spec_dir.is_dir() and (spec_dir / "qa_report.md").exists(): completed.append(spec_dir.name) - + if not completed: print_status("No completed specs to clean up", "info") return True - + print_status(f"Found {len(completed)} completed spec(s)", "info") - + if dry_run: print() print("Would remove:") @@ -206,6 +212,5 @@ def handle_batch_cleanup_command(project_dir: str, dry_run: bool = True) -> bool print(f" └─ .worktrees/{spec_name}/") print() print("Run with --no-dry-run to actually delete") - - return True + return True diff --git a/apps/backend/cli/utils.py b/apps/backend/cli/utils.py index 006528bc..62672861 100644 --- a/apps/backend/cli/utils.py +++ b/apps/backend/cli/utils.py @@ -185,9 +185,9 @@ def get_project_dir(provided_dir: Path | None) -> Path: project_dir = Path.cwd() - # Auto-detect if running from within auto-claude directory (the source code) - if project_dir.name == "auto-claude" and (project_dir / "run.py").exists(): - # Running from within auto-claude/ source directory, go up 1 level - project_dir = project_dir.parent + # Auto-detect if running from within apps/backend directory (the source code) + if project_dir.name == "backend" and (project_dir / "run.py").exists(): + # Running from within apps/backend/ source directory, go up 2 levels + project_dir = project_dir.parent.parent return project_dir diff --git a/apps/frontend/eslint.config.mjs b/apps/frontend/eslint.config.mjs index 908d7123..2d453bfc 100644 --- a/apps/frontend/eslint.config.mjs +++ b/apps/frontend/eslint.config.mjs @@ -92,6 +92,6 @@ export default tseslint.config( } }, { - ignores: ['out/**', 'dist/**', '.eslintrc.cjs', 'eslint.config.mjs', 'node_modules/**', '**/*.cjs'] + ignores: ['out/**', 'dist/**', '.eslintrc.cjs', 'eslint.config.mjs', 'node_modules/**'] } ); diff --git a/apps/frontend/scripts/download-prebuilds.cjs b/apps/frontend/scripts/download-prebuilds.cjs index 4dc13530..40d50b3f 100644 --- a/apps/frontend/scripts/download-prebuilds.cjs +++ b/apps/frontend/scripts/download-prebuilds.cjs @@ -12,7 +12,6 @@ const path = require('path'); const { execSync } = require('child_process'); const GITHUB_REPO = 'AndyMik90/Auto-Claude'; -const GITHUB_API = 'https://api.github.com'; /** * Get the Electron ABI version for the installed Electron diff --git a/apps/frontend/src/main/__tests__/ndjson-parser.test.ts b/apps/frontend/src/main/__tests__/ndjson-parser.test.ts index bae20bf2..880db8cb 100644 --- a/apps/frontend/src/main/__tests__/ndjson-parser.test.ts +++ b/apps/frontend/src/main/__tests__/ndjson-parser.test.ts @@ -216,7 +216,7 @@ describe('NDJSON Parser', () => { chunk = '":200}\n'; results = parseNDJSON(chunk, bufferRef); expect(results).toHaveLength(1); - expect(results[0].other).toBe(200); + expect((results[0] as unknown as { other: number }).other).toBe(200); expect(bufferRef.current).toBe(''); }); }); diff --git a/apps/frontend/src/main/ipc-handlers/linear-handlers.ts b/apps/frontend/src/main/ipc-handlers/linear-handlers.ts index 62ee54e6..15668b89 100644 --- a/apps/frontend/src/main/ipc-handlers/linear-handlers.ts +++ b/apps/frontend/src/main/ipc-handlers/linear-handlers.ts @@ -50,13 +50,25 @@ export function registerLinearHandlers( method: 'POST', headers: { 'Content-Type': 'application/json', - 'Authorization': `Bearer ${apiKey}` + 'Authorization': apiKey }, body: JSON.stringify({ query, variables }) }); + // Check response.ok first, then try to parse JSON + // This handles cases where the API returns non-JSON errors (e.g., 503 from proxy) if (!response.ok) { - throw new Error(`Linear API error: ${response.status} ${response.statusText}`); + let errorMessage = response.statusText; + try { + const errorResult = await response.json(); + errorMessage = errorResult?.errors?.[0]?.message + || errorResult?.error + || errorResult?.message + || response.statusText; + } catch { + // JSON parsing failed - use status text as fallback + } + throw new Error(`Linear API error: ${response.status} - ${errorMessage}`); } const result = await response.json(); @@ -126,7 +138,7 @@ export function registerLinearHandlers( `; // Get approximate count const _issuesQuery = ` - query($teamId: String!) { + query($teamId: ID!) { issues(filter: { team: { id: { eq: $teamId } } }, first: 0) { pageInfo { hasNextPage @@ -139,7 +151,7 @@ export function registerLinearHandlers( // Simple count estimation - get first 250 issues const countData = await linearGraphQL(apiKey, ` - query($teamId: String!) { + query($teamId: ID!) { issues(filter: { team: { id: { eq: $teamId } } }, first: 250) { nodes { id } } @@ -226,7 +238,7 @@ export function registerLinearHandlers( try { const query = ` - query($teamId: String!) { + query($teamId: ID!) { team(id: $teamId) { projects { nodes { @@ -267,20 +279,28 @@ export function registerLinearHandlers( } try { - // Build filter based on provided parameters - const filters: string[] = []; + // Build filter using GraphQL variables for safety + const variables: Record = {}; + const filterParts: string[] = []; + const variableDeclarations: string[] = []; + if (teamId) { - filters.push(`team: { id: { eq: "${teamId}" } }`); + variables.teamId = teamId; + variableDeclarations.push('$teamId: ID!'); + filterParts.push('team: { id: { eq: $teamId } }'); } if (linearProjectId) { - filters.push(`project: { id: { eq: "${linearProjectId}" } }`); + variables.linearProjectId = linearProjectId; + variableDeclarations.push('$linearProjectId: ID!'); + filterParts.push('project: { id: { eq: $linearProjectId } }'); } - const filterClause = filters.length > 0 ? `filter: { ${filters.join(', ')} }` : ''; + const variablesDef = variableDeclarations.length > 0 ? `(${variableDeclarations.join(', ')})` : ''; + const filterClause = filterParts.length > 0 ? `filter: { ${filterParts.join(', ')} }, ` : ''; const query = ` - query { - issues(${filterClause}, first: 250, orderBy: updatedAt) { + query${variablesDef} { + issues(${filterClause}first: 250, orderBy: updatedAt) { nodes { id identifier @@ -317,7 +337,7 @@ export function registerLinearHandlers( } `; - const data = await linearGraphQL(apiKey, query) as { + const data = await linearGraphQL(apiKey, query, variables) as { issues: { nodes: Array<{ id: string; @@ -369,7 +389,7 @@ export function registerLinearHandlers( try { // First, fetch the full details of selected issues const query = ` - query($ids: [String!]!) { + query($ids: [ID!]!) { issues(filter: { id: { in: $ids } }) { nodes { id diff --git a/apps/frontend/src/renderer/components/ProjectSettings.tsx b/apps/frontend/src/renderer/components/ProjectSettings.tsx index 7ade4418..ef28746f 100644 --- a/apps/frontend/src/renderer/components/ProjectSettings.tsx +++ b/apps/frontend/src/renderer/components/ProjectSettings.tsx @@ -304,7 +304,7 @@ export function ProjectSettings({ project, open, onOpenChange }: ProjectSettings onOpenChange={setShowLinearImportModal} onImportComplete={(result) => { // Optionally refresh or notify - console.warn('Import complete:', result); + console.log('Import complete:', result); }} /> diff --git a/apps/frontend/src/renderer/components/linear-import/components/TeamProjectSelector.tsx b/apps/frontend/src/renderer/components/linear-import/components/TeamProjectSelector.tsx index 20dc225c..68402695 100644 --- a/apps/frontend/src/renderer/components/linear-import/components/TeamProjectSelector.tsx +++ b/apps/frontend/src/renderer/components/linear-import/components/TeamProjectSelector.tsx @@ -58,15 +58,15 @@ export function TeamProjectSelector({