Implement discovery and git conflict resolution - #4
Conversation
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
Automated commit by ralph.sh
- Clear task_6.log after rebase - Update git/06-conflict.md status to complete and fix formatting Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a315746030
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if len(remaining) == 0 { | ||
| // Continue rebase | ||
| if err := continueRebase(ctx, worktreePath); err != nil { | ||
| return err |
There was a problem hiding this comment.
Handle subsequent conflicts after rebase --continue
When git rebase --continue hits another conflicting commit, it exits with an error and leaves the rebase paused. This code returns that error immediately, so ResolveConflicts never loops back to invoke Claude for the next conflict set, causing multi-conflict rebases to fail even though they could be resolved iteratively. Consider detecting conflict errors from continueRebase (or re-checking getConflictedFiles after --continue) and re-entering the resolution loop.
Useful? React with 👍 / 👎.
| _, err = m.Claude.Invoke(ctx, InvokeOptions{ | ||
| Prompt: prompt, | ||
| Model: "", | ||
| MaxTurns: 0, | ||
| }) |
There was a problem hiding this comment.
Guard against nil Claude client in conflict resolution
ResolveConflicts unconditionally calls m.Claude.Invoke, but NewMergeManager allows a nil Claude client (tests construct managers with nil). If a conflict occurs while Claude is not configured, this will panic on a nil interface instead of returning a clear error. A nil check with an explicit error would prevent the runtime crash.
Useful? React with 👍 / 👎.
- Add nil check for Claude client before invoking conflict resolution - Handle subsequent conflicts when continueRebase hits another conflicting commit - Add isConflictError helper to detect conflict-related errors Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* ralph: cli/#1 - Root Command and App Struct Automated commit by ralph.sh * ralph: cli/#2 - Display Formatting Automated commit by ralph.sh * ralph: cli/#3 - Signal Handling Automated commit by ralph.sh * ralph: cli/#4 - Version Command Automated commit by ralph.sh * ralph: cli/#5 - Status Command Automated commit by ralph.sh * ralph: cli/#6 - Run Command Automated commit by ralph.sh * ralph: cli/#7 - Resume Command Automated commit by ralph.sh * ralph: cli/#8 - Cleanup Command Automated commit by ralph.sh * ralph: cli/#9 - Component Wiring Automated commit by ralph.sh * ralph: config/#1 - Core Config Types Automated commit by ralph.sh * ralph: config/#2 - Config Defaults Automated commit by ralph.sh * ralph: config/#3 - Environment Variable Overrides Automated commit by ralph.sh * ralph: config/#4 - Config Validation Automated commit by ralph.sh * ralph: config/#5 - GitHub Auto-Detection Automated commit by ralph.sh * ralph: config/#6 - LoadConfig Function Automated commit by ralph.sh * ralph: git/#1 - Git Command Execution Utilities Automated commit by ralph.sh * ralph: git/#2 - Worktree Management Automated commit by ralph.sh * ralph: git/#3 - Branch Naming via Claude Automated commit by ralph.sh * ralph: git/#4 - Commit Operations Automated commit by ralph.sh * ralph: git/#5 - Merge Serialization Automated commit by ralph.sh * ralph: git/#6 - Conflict Resolution with Claude Implement conflict resolution using Claude CLI with up to 3 retry attempts. Includes ResolveConflicts method on MergeManager, comprehensive test suite covering success, retry, max attempts, and no-conflict scenarios. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * fix: address PR review feedback - Remove merge conflict markers from internal/events/bus.go - Add Worktree field to Branch struct - Implement full merge flow in Merge() function including rebase, conflict resolution, force push, and branch deletion scheduling Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * chore: remove .ralph logs from git tracking These files are gitignored and should not be tracked. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
* specs update * feat: feature-discovery (#27) * feat(feature-discovery): complete task #1 - Core Types * feat(feature-discovery): complete task #2 - Event Types * feat(feature-discovery): complete task #3 - Frontmatter Parser * feat(feature-discovery): complete task #4 - PRD Parser * feat(feature-discovery): complete task #5 - PRD Validator * feat(feature-discovery): complete task #6 - Discovery Functions * feat(feature-discovery): complete task #7 - PRD Repository --------- Co-authored-by: Test User <test@test.com> * feat: spec-review (#29) * feat(spec-review): complete task #1 - Review Core Types * feat(spec-review): complete task #2 - Schema Validation * feat(spec-review): complete task #3 - Review Criteria Definitions * feat(spec-review): complete task #4 - Review Event Types * feat(spec-review): complete task #5 - Feedback Application * feat(spec-review): complete task #6 - Review Loop Orchestration --------- Co-authored-by: Test User <test@test.com> * feat: feature-prioritizer (#31) * feat(feature-prioritizer): complete task #1 - Prioritization Types * feat(feature-prioritizer): complete task #2 - PRD Loader * feat(feature-prioritizer): complete task #4 - Response Parser * feat(feature-prioritizer): complete task #3 - Prioritizer Core * feat(feature-prioritizer): complete task #5 - CLI Command --------- Co-authored-by: Test User <test@test.com> * feat: feature-workflow (#32) * feat(feature-workflow): complete task #1 - Feature Status States * feat(feature-workflow): complete task #2 - Spec Commit Operations * feat(feature-workflow): complete task #3 - Drift Detection * feat(feature-workflow): complete task #4 - Auto-Triggered Completion * feat(feature-workflow): complete task #5 - Review Cycle Management * feat(feature-workflow): complete task #6 - Workflow Orchestration --------- Co-authored-by: Test User <test@test.com> * feat: feature-branch (#30) * feat(feature-branch): complete task #1 - Feature Types * feat(feature-branch): complete task #3 - Feature Config * feat(feature-branch): complete task #2 - Branch Manager * chore: update status frontmatter --------- Co-authored-by: Test User <test@test.com> * fix: orchestrator reliability and UX improvements - Add terminal state guard in scheduler.Complete() to prevent infinite loop when UnitCompleted events are re-emitted - Fix PR existence check to handle empty JSON array response from gh CLI - Add worktree-aware status refresh so `choo status` shows correct progress - Auto-detect current branch as default target (instead of always 'main') - Auto-push target branch if not on remote - Reorganize PRD docs into docs/prds/ directory Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: resolve type conflicts from merged feature PRs - Remove duplicate Client type from git/commit.go (use exec.go's Client) - Add WorktreePath alias to git.Client for worktree operations - Rename feature.Status to LifecycleStatus to avoid collision with states.go - Rename PRD in drift.go to DriftPRD to avoid collision with types.go - Add NewDriftDetectorFromPRD helper for type conversion - Remove placeholder BranchManager from workflow.go (use branch.go's impl) - Add Units field to canonical PRD type for completion tracking Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: update tests for DriftPRD type change - Update drift_test.go to use DriftPRD and DriftUnit types - Add SetBody method to DriftDetector for testing - Update workflow_test.go to use drift.SetBody() Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(feature-cli): complete task #1 - Feature State Types * feat(feature-cli): complete task #2 - PRD Store * feat(feature-cli): complete task #3 - Feature Parent Command * feat(feature-cli): complete task #4 - Feature Start Command * feat(feature-cli): complete task #5 - Feature Status Command * feat(feature-cli): complete task #6 - Feature Resume Command * feat: replace PR workflow with local merge for unit branches This simplifies the orchestrator flow by merging unit branches directly to the feature branch locally instead of creating PRs. Key changes: - Remove PR-related states (pr_open, in_review, merging) from scheduler - Simplify unit lifecycle: pending -> in_progress -> complete - Replace createPR() with mergeToFeatureBranch() in worker - Merge happens locally in main repo (no remote push during execution) - Add backwards compatibility for old PR status values - Add UnitMerged event for tracking merge operations Benefits: - Dependent units immediately see predecessor code (no PR merge delay) - Faster execution (no network operations during merge) - User controls when to push feature branch to remote Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address PR review feedback for feature workflow system - Rename docs/prds to docs/prd (singular) and update all references - Fix PRD ID usage: use prd.ID instead of prd.Body in completion.go and workflow.go - Fix spec commit scope: stage only specsDir instead of entire worktree - Add git.StagePath() for staging specific paths - Fix nil agent invoker: add agentInvoker field to App and return clear error - Add clarifying comment about RepoRoot branch checkout assumption in worker.go - Update all tests to use correct PRD ID field Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: resolve golangci-lint issues - Fix errcheck: handle error returns in review.go - Remove unused functions: getTargetBranch, cleanup - Fix S1009: remove unnecessary nil check before len() - Fix SA5011: use t.Fatal for nil checks in tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: add baseline checks configuration to .choo.yaml Mirror CI workflow checks (build, vet, lint, test) in the baseline configuration for local validation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Test User <test@test.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* specs update * feat: feature-discovery (#27) * feat(feature-discovery): complete task #1 - Core Types * feat(feature-discovery): complete task #2 - Event Types * feat(feature-discovery): complete task #3 - Frontmatter Parser * feat(feature-discovery): complete task #4 - PRD Parser * feat(feature-discovery): complete task #5 - PRD Validator * feat(feature-discovery): complete task #6 - Discovery Functions * feat(feature-discovery): complete task #7 - PRD Repository --------- Co-authored-by: Test User <test@test.com> * feat: spec-review (#29) * feat(spec-review): complete task #1 - Review Core Types * feat(spec-review): complete task #2 - Schema Validation * feat(spec-review): complete task #3 - Review Criteria Definitions * feat(spec-review): complete task #4 - Review Event Types * feat(spec-review): complete task #5 - Feedback Application * feat(spec-review): complete task #6 - Review Loop Orchestration --------- Co-authored-by: Test User <test@test.com> * feat: feature-prioritizer (#31) * feat(feature-prioritizer): complete task #1 - Prioritization Types * feat(feature-prioritizer): complete task #2 - PRD Loader * feat(feature-prioritizer): complete task #4 - Response Parser * feat(feature-prioritizer): complete task #3 - Prioritizer Core * feat(feature-prioritizer): complete task #5 - CLI Command --------- Co-authored-by: Test User <test@test.com> * feat: feature-workflow (#32) * feat(feature-workflow): complete task #1 - Feature Status States * feat(feature-workflow): complete task #2 - Spec Commit Operations * feat(feature-workflow): complete task #3 - Drift Detection * feat(feature-workflow): complete task #4 - Auto-Triggered Completion * feat(feature-workflow): complete task #5 - Review Cycle Management * feat(feature-workflow): complete task #6 - Workflow Orchestration --------- Co-authored-by: Test User <test@test.com> * feat: feature-branch (#30) * feat(feature-branch): complete task #1 - Feature Types * feat(feature-branch): complete task #3 - Feature Config * feat(feature-branch): complete task #2 - Branch Manager * chore: update status frontmatter --------- Co-authored-by: Test User <test@test.com> * fix: orchestrator reliability and UX improvements - Add terminal state guard in scheduler.Complete() to prevent infinite loop when UnitCompleted events are re-emitted - Fix PR existence check to handle empty JSON array response from gh CLI - Add worktree-aware status refresh so `choo status` shows correct progress - Auto-detect current branch as default target (instead of always 'main') - Auto-push target branch if not on remote - Reorganize PRD docs into docs/prds/ directory Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: resolve type conflicts from merged feature PRs - Remove duplicate Client type from git/commit.go (use exec.go's Client) - Add WorktreePath alias to git.Client for worktree operations - Rename feature.Status to LifecycleStatus to avoid collision with states.go - Rename PRD in drift.go to DriftPRD to avoid collision with types.go - Add NewDriftDetectorFromPRD helper for type conversion - Remove placeholder BranchManager from workflow.go (use branch.go's impl) - Add Units field to canonical PRD type for completion tracking Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: update tests for DriftPRD type change - Update drift_test.go to use DriftPRD and DriftUnit types - Add SetBody method to DriftDetector for testing - Update workflow_test.go to use drift.SetBody() Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(feature-cli): complete task #1 - Feature State Types * feat(feature-cli): complete task #2 - PRD Store * feat(feature-cli): complete task #3 - Feature Parent Command * feat(feature-cli): complete task #4 - Feature Start Command * feat(feature-cli): complete task #5 - Feature Status Command * feat(feature-cli): complete task #6 - Feature Resume Command * feat: replace PR workflow with local merge for unit branches This simplifies the orchestrator flow by merging unit branches directly to the feature branch locally instead of creating PRs. Key changes: - Remove PR-related states (pr_open, in_review, merging) from scheduler - Simplify unit lifecycle: pending -> in_progress -> complete - Replace createPR() with mergeToFeatureBranch() in worker - Merge happens locally in main repo (no remote push during execution) - Add backwards compatibility for old PR status values - Add UnitMerged event for tracking merge operations Benefits: - Dependent units immediately see predecessor code (no PR merge delay) - Faster execution (no network operations during merge) - User controls when to push feature branch to remote Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address PR review feedback for feature workflow system - Rename docs/prds to docs/prd (singular) and update all references - Fix PRD ID usage: use prd.ID instead of prd.Body in completion.go and workflow.go - Fix spec commit scope: stage only specsDir instead of entire worktree - Add git.StagePath() for staging specific paths - Fix nil agent invoker: add agentInvoker field to App and return clear error - Add clarifying comment about RepoRoot branch checkout assumption in worker.go - Update all tests to use correct PRD ID field Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: resolve golangci-lint issues - Fix errcheck: handle error returns in review.go - Remove unused functions: getTargetBranch, cleanup - Fix S1009: remove unnecessary nil check before len() - Fix SA5011: use t.Fatal for nil checks in tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: add baseline checks configuration to .choo.yaml Mirror CI workflow checks (build, vet, lint, test) in the baseline configuration for local validation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Test User <test@test.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* specs update * feat: feature-discovery (#27) * feat(feature-discovery): complete task #1 - Core Types * feat(feature-discovery): complete task #2 - Event Types * feat(feature-discovery): complete task #3 - Frontmatter Parser * feat(feature-discovery): complete task #4 - PRD Parser * feat(feature-discovery): complete task #5 - PRD Validator * feat(feature-discovery): complete task #6 - Discovery Functions * feat(feature-discovery): complete task #7 - PRD Repository --------- Co-authored-by: Test User <test@test.com> * feat: spec-review (#29) * feat(spec-review): complete task #1 - Review Core Types * feat(spec-review): complete task #2 - Schema Validation * feat(spec-review): complete task #3 - Review Criteria Definitions * feat(spec-review): complete task #4 - Review Event Types * feat(spec-review): complete task #5 - Feedback Application * feat(spec-review): complete task #6 - Review Loop Orchestration --------- Co-authored-by: Test User <test@test.com> * feat: feature-prioritizer (#31) * feat(feature-prioritizer): complete task #1 - Prioritization Types * feat(feature-prioritizer): complete task #2 - PRD Loader * feat(feature-prioritizer): complete task #4 - Response Parser * feat(feature-prioritizer): complete task #3 - Prioritizer Core * feat(feature-prioritizer): complete task #5 - CLI Command --------- Co-authored-by: Test User <test@test.com> * feat: feature-workflow (#32) * feat(feature-workflow): complete task #1 - Feature Status States * feat(feature-workflow): complete task #2 - Spec Commit Operations * feat(feature-workflow): complete task #3 - Drift Detection * feat(feature-workflow): complete task #4 - Auto-Triggered Completion * feat(feature-workflow): complete task #5 - Review Cycle Management * feat(feature-workflow): complete task #6 - Workflow Orchestration --------- Co-authored-by: Test User <test@test.com> * feat: feature-branch (#30) * feat(feature-branch): complete task #1 - Feature Types * feat(feature-branch): complete task #3 - Feature Config * feat(feature-branch): complete task #2 - Branch Manager * chore: update status frontmatter --------- Co-authored-by: Test User <test@test.com> * fix: orchestrator reliability and UX improvements - Add terminal state guard in scheduler.Complete() to prevent infinite loop when UnitCompleted events are re-emitted - Fix PR existence check to handle empty JSON array response from gh CLI - Add worktree-aware status refresh so `choo status` shows correct progress - Auto-detect current branch as default target (instead of always 'main') - Auto-push target branch if not on remote - Reorganize PRD docs into docs/prds/ directory Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: resolve type conflicts from merged feature PRs - Remove duplicate Client type from git/commit.go (use exec.go's Client) - Add WorktreePath alias to git.Client for worktree operations - Rename feature.Status to LifecycleStatus to avoid collision with states.go - Rename PRD in drift.go to DriftPRD to avoid collision with types.go - Add NewDriftDetectorFromPRD helper for type conversion - Remove placeholder BranchManager from workflow.go (use branch.go's impl) - Add Units field to canonical PRD type for completion tracking Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: update tests for DriftPRD type change - Update drift_test.go to use DriftPRD and DriftUnit types - Add SetBody method to DriftDetector for testing - Update workflow_test.go to use drift.SetBody() Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(feature-cli): complete task #1 - Feature State Types * feat(feature-cli): complete task #2 - PRD Store * feat(feature-cli): complete task #3 - Feature Parent Command * feat(feature-cli): complete task #4 - Feature Start Command * feat(feature-cli): complete task #5 - Feature Status Command * feat(feature-cli): complete task #6 - Feature Resume Command * feat: replace PR workflow with local merge for unit branches This simplifies the orchestrator flow by merging unit branches directly to the feature branch locally instead of creating PRs. Key changes: - Remove PR-related states (pr_open, in_review, merging) from scheduler - Simplify unit lifecycle: pending -> in_progress -> complete - Replace createPR() with mergeToFeatureBranch() in worker - Merge happens locally in main repo (no remote push during execution) - Add backwards compatibility for old PR status values - Add UnitMerged event for tracking merge operations Benefits: - Dependent units immediately see predecessor code (no PR merge delay) - Faster execution (no network operations during merge) - User controls when to push feature branch to remote Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address PR review feedback for feature workflow system - Rename docs/prds to docs/prd (singular) and update all references - Fix PRD ID usage: use prd.ID instead of prd.Body in completion.go and workflow.go - Fix spec commit scope: stage only specsDir instead of entire worktree - Add git.StagePath() for staging specific paths - Fix nil agent invoker: add agentInvoker field to App and return clear error - Add clarifying comment about RepoRoot branch checkout assumption in worker.go - Update all tests to use correct PRD ID field Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: resolve golangci-lint issues - Fix errcheck: handle error returns in review.go - Remove unused functions: getTargetBranch, cleanup - Fix S1009: remove unnecessary nil check before len() - Fix SA5011: use t.Fatal for nil checks in tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: add baseline checks configuration to .choo.yaml Mirror CI workflow checks (build, vet, lint, test) in the baseline configuration for local validation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Test User <test@test.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* specs update * feat: feature-discovery (#27) * feat(feature-discovery): complete task #1 - Core Types * feat(feature-discovery): complete task #2 - Event Types * feat(feature-discovery): complete task #3 - Frontmatter Parser * feat(feature-discovery): complete task #4 - PRD Parser * feat(feature-discovery): complete task #5 - PRD Validator * feat(feature-discovery): complete task #6 - Discovery Functions * feat(feature-discovery): complete task #7 - PRD Repository --------- Co-authored-by: Test User <test@test.com> * feat: spec-review (#29) * feat(spec-review): complete task #1 - Review Core Types * feat(spec-review): complete task #2 - Schema Validation * feat(spec-review): complete task #3 - Review Criteria Definitions * feat(spec-review): complete task #4 - Review Event Types * feat(spec-review): complete task #5 - Feedback Application * feat(spec-review): complete task #6 - Review Loop Orchestration --------- Co-authored-by: Test User <test@test.com> * feat: feature-prioritizer (#31) * feat(feature-prioritizer): complete task #1 - Prioritization Types * feat(feature-prioritizer): complete task #2 - PRD Loader * feat(feature-prioritizer): complete task #4 - Response Parser * feat(feature-prioritizer): complete task #3 - Prioritizer Core * feat(feature-prioritizer): complete task #5 - CLI Command --------- Co-authored-by: Test User <test@test.com> * feat: feature-workflow (#32) * feat(feature-workflow): complete task #1 - Feature Status States * feat(feature-workflow): complete task #2 - Spec Commit Operations * feat(feature-workflow): complete task #3 - Drift Detection * feat(feature-workflow): complete task #4 - Auto-Triggered Completion * feat(feature-workflow): complete task #5 - Review Cycle Management * feat(feature-workflow): complete task #6 - Workflow Orchestration --------- Co-authored-by: Test User <test@test.com> * feat: feature-branch (#30) * feat(feature-branch): complete task #1 - Feature Types * feat(feature-branch): complete task #3 - Feature Config * feat(feature-branch): complete task #2 - Branch Manager * chore: update status frontmatter --------- Co-authored-by: Test User <test@test.com> * fix: orchestrator reliability and UX improvements - Add terminal state guard in scheduler.Complete() to prevent infinite loop when UnitCompleted events are re-emitted - Fix PR existence check to handle empty JSON array response from gh CLI - Add worktree-aware status refresh so `choo status` shows correct progress - Auto-detect current branch as default target (instead of always 'main') - Auto-push target branch if not on remote - Reorganize PRD docs into docs/prds/ directory Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: resolve type conflicts from merged feature PRs - Remove duplicate Client type from git/commit.go (use exec.go's Client) - Add WorktreePath alias to git.Client for worktree operations - Rename feature.Status to LifecycleStatus to avoid collision with states.go - Rename PRD in drift.go to DriftPRD to avoid collision with types.go - Add NewDriftDetectorFromPRD helper for type conversion - Remove placeholder BranchManager from workflow.go (use branch.go's impl) - Add Units field to canonical PRD type for completion tracking Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: update tests for DriftPRD type change - Update drift_test.go to use DriftPRD and DriftUnit types - Add SetBody method to DriftDetector for testing - Update workflow_test.go to use drift.SetBody() Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(feature-cli): complete task #1 - Feature State Types * feat(feature-cli): complete task #2 - PRD Store * feat(feature-cli): complete task #3 - Feature Parent Command * feat(feature-cli): complete task #4 - Feature Start Command * feat(feature-cli): complete task #5 - Feature Status Command * feat(feature-cli): complete task #6 - Feature Resume Command * feat: replace PR workflow with local merge for unit branches This simplifies the orchestrator flow by merging unit branches directly to the feature branch locally instead of creating PRs. Key changes: - Remove PR-related states (pr_open, in_review, merging) from scheduler - Simplify unit lifecycle: pending -> in_progress -> complete - Replace createPR() with mergeToFeatureBranch() in worker - Merge happens locally in main repo (no remote push during execution) - Add backwards compatibility for old PR status values - Add UnitMerged event for tracking merge operations Benefits: - Dependent units immediately see predecessor code (no PR merge delay) - Faster execution (no network operations during merge) - User controls when to push feature branch to remote Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address PR review feedback for feature workflow system - Rename docs/prds to docs/prd (singular) and update all references - Fix PRD ID usage: use prd.ID instead of prd.Body in completion.go and workflow.go - Fix spec commit scope: stage only specsDir instead of entire worktree - Add git.StagePath() for staging specific paths - Fix nil agent invoker: add agentInvoker field to App and return clear error - Add clarifying comment about RepoRoot branch checkout assumption in worker.go - Update all tests to use correct PRD ID field Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: resolve golangci-lint issues - Fix errcheck: handle error returns in review.go - Remove unused functions: getTargetBranch, cleanup - Fix S1009: remove unnecessary nil check before len() - Fix SA5011: use t.Fatal for nil checks in tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: add baseline checks configuration to .choo.yaml Mirror CI workflow checks (build, vet, lint, test) in the baseline configuration for local validation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Test User <test@test.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add daemon architecture specs with consistency fixes Add comprehensive specs and tasks for the daemon subsystem: - DAEMON-CORE: Process lifecycle, job manager, resume logic - DAEMON-CLI: CLI commands for daemon and job management - DAEMON-CLIENT: gRPC client wrapper for CLI communication - DAEMON-GRPC: Protocol buffer definitions and server implementation - DAEMON-DB: SQLite persistence layer for state storage Key consistency fixes applied during review: - Standardized socket path to ~/.choo/daemon.sock across all specs - Aligned gRPC RPC name to WatchJob (was StreamEvents in DAEMON-CORE) - Simplified UnitStatus enum: removed pr_open, aligned naming (running vs in_progress, completed vs complete) - Added fromSeq parameter to WatchJob for sequence-based resumption - Fixed DefaultConfig() to return error for home directory lookup - Added DaemonVersion field to Run record for resume validation Also moves completed feature specs to specs/completed/ directory. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(daemon-db): complete task #1 - Types and Constants * feat(daemon-db): complete task #2 - Connection and Migrations * feat(daemon-db): complete task #3 - Run CRUD Operations * feat(daemon-db): complete task #4 - Unit CRUD Operations * feat(daemon-db): complete task #5 - Event Logging Operations * feat(daemon-db): complete task #6 - Integration Tests * feat(daemon-grpc): complete task #1 - Protocol Buffer Definitions * feat(daemon-grpc): complete task #2 - gRPC Server Types * feat(daemon-grpc): complete task #3 - Job Lifecycle RPCs * feat(daemon-grpc): complete task #4 - WatchJob Event Streaming * feat(daemon-grpc): complete task #5 - Daemon Lifecycle RPCs * specs * feat(daemon-grpc): complete task #6 - Unix Domain Socket Server * feat(daemon-grpc): complete task #7 - Integration Tests * ideas for future work and issues * feat(daemon-grpc): complete task #1 - Protocol Buffer Definitions * feat(daemon-grpc): complete task #2 - gRPC Server Types * feat(daemon-grpc): complete task #3 - Job Lifecycle RPCs * feat(daemon-grpc): complete task #4 - WatchJob Event Streaming * feat(daemon-grpc): complete task #5 - Daemon Lifecycle RPCs * feat(daemon-grpc): complete task #6 - Unix Domain Socket Server * feat(daemon-grpc): complete task #7 - Integration Tests * feat(daemon-client): complete task #1 - Client Types * feat(daemon-client): complete task #2 - Protobuf Conversion * feat(daemon-client): complete task #3 - Connection Management * feat(daemon-client): complete task #4 - Job Lifecycle Methods * feat(daemon-client): complete task #6 - Health and Shutdown * feat(daemon-client): complete task #5 - Event Streaming * feat(daemon-grpc): complete task #1 - Protocol Buffer Definitions * feat(daemon-grpc): complete task #2 - gRPC Server Types * feat(daemon-grpc): complete task #3 - Job Lifecycle RPCs * feat(daemon-grpc): complete task #4 - WatchJob Event Streaming * feat(daemon-grpc): complete task #5 - Daemon Lifecycle RPCs * feat(daemon-grpc): complete task #6 - Unix Domain Socket Server * feat(daemon-grpc): complete task #7 - Integration Tests * feat(daemon-core): complete task #1 - Daemon Configuration * feat(daemon-core): complete task #2 - PID File Utilities * feat(daemon-core): complete task #3 - Job Manager Types * feat(daemon-core): complete task #4 - Job Manager Core * feat(daemon-core): complete task #5 - Job Event Subscription * feat(daemon-core): complete task #6 - Job Resume Logic * feat(daemon-core): complete task #7 - Daemon Lifecycle * feat(daemon-grpc): complete task #1 - Protocol Buffer Definitions * feat(daemon-grpc): complete task #2 - gRPC Server Types * feat(daemon-grpc): complete task #3 - Job Lifecycle RPCs * feat(daemon-grpc): complete task #4 - WatchJob Event Streaming * feat(daemon-grpc): complete task #5 - Daemon Lifecycle RPCs * feat(daemon-grpc): complete task #6 - Unix Domain Socket Server * feat(daemon-grpc): complete task #7 - Integration Tests * ideas for future work and issues * feat(daemon-client): complete task #1 - Client Types * feat(daemon-client): complete task #2 - Protobuf Conversion * feat(daemon-client): complete task #3 - Connection Management * feat(daemon-client): complete task #4 - Job Lifecycle Methods * feat(daemon-client): complete task #6 - Health and Shutdown * feat(daemon-client): complete task #5 - Event Streaming * feat(daemon-core): complete task #1 - Daemon Configuration * feat(daemon-core): complete task #2 - PID File Utilities * feat(daemon-core): complete task #3 - Job Manager Types * feat(daemon-core): complete task #4 - Job Manager Core * feat(daemon-core): complete task #5 - Job Event Subscription * feat(daemon-core): complete task #6 - Job Resume Logic * feat(daemon-core): complete task #7 - Daemon Lifecycle * feat(daemon-cli): complete task #1 - Display Helpers * feat(daemon-cli): complete task #2 - Daemon Commands * feat(daemon-cli): complete task #3 - Jobs Command * feat(daemon-cli): complete task #4 - Watch Command * feat(daemon-cli): complete task #5 - Stop Command * feat(daemon-cli): complete task #6 - Run Command Daemon Mode * fix(cli): add --use-daemon=false to TestRunCmd_Integration The test was failing because it tried to connect to the daemon by default (--use-daemon=true is the default) but no daemon was running. Adding --use-daemon=false makes the test use inline mode like TestRunCmd_UseDaemonFalse. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: resolve lint errors from golangci-lint - Fix errcheck: handle tx.Rollback() error in db/events.go - Fix errcheck: handle pidFile.Release() error in daemon.go - Fix unused: remove unused Subscription struct and cancel field in job_events.go - Fix unused: remove unused formatDuration function in daemon_display.go - Fix gosimple S1000: use for range instead of for { select {} } in grpc.go - Fix staticcheck SA1019: replace deprecated grpc.Dial with grpc.NewClient - Fix staticcheck SA9003: add explicit no-op in empty select branch - Fix staticcheck SA4011: use labeled break for outer loop in test Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: resolve remaining staticcheck SA9003 and SA4011 warnings - Add comments to empty default branches in select statements to make intent explicit (SA9003): - orchestrator.go: continue - not shutting down - integration_test.go: no error yet - continue checking - socket.go: continue accepting connections - workflow_test.go: channel full - drop event - Fix ineffective break in pusher.go by using labeled break (SA4011) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: upgrade golangci-lint to v2.8.0 for Go 1.24 support - Update CI to use go-version-file instead of hardcoded version - Migrate .golangci.yml to v2 format (requires version: "2") - Add Makefile lint targets for local development - Configure staticcheck to only run SA checks (not ST/QF) - Add exclude-functions for common unchecked errors - Fix SA9003 empty branch in resume.go Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: resolve CI failures - Update golangci-lint-action from v6 to v7 (required for golangci-lint v2.x) - Fix data race in mockJobManager by adding mutex synchronization - Add setJobStatus method for thread-safe status updates in tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: add pre-push hook and check target - Add scripts/pre-push hook that runs build, vet, lint, and test - Add 'make check' target to run all CI checks locally - Add 'make install-hooks' to configure git to use scripts/ as hooks path - Add 'make vet' target Run 'make install-hooks' to enable pre-push checks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Test User <test@test.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* specs * feat(reviewer-interface): complete task #1 - Reviewer Interface and Types * feat(review-config): complete task #2 - CodeReviewConfig Validation and Integration * feat(codex-reviewer): complete task #2 - Codex Output Parser * feat(claude-reviewer): complete task #2 - Review Prompt Builder * feat(claude-reviewer): complete task #1 - ClaudeReviewer Implementation * feat(claude-reviewer): complete task #3 - JSON Extraction and Output Parsing * feat(review-worker): complete task #1 - Code Review Event Types * feat(review-worker): complete task #2 - Review Orchestration * feat(review-worker): complete task #3 - Review Fix Loop * feat(review-worker): complete task #4 - Commit and Cleanup Operations * feat(review-wiring): complete task #1 - Reviewer Resolution and Injection * feat(review-wiring): replace logReviewPlaceholder with runCodeReview in merge flow * test(review-wiring): add integration tests for review in merge flow * fix(review-wiring): update TestRunCodeReview_IssuesFound to expect fix_attempt event * feat(review-wiring): mark task #2 as complete * fix(claude-reviewer): return errors for parsing failures instead of Passed:true Parsing failures in the Claude reviewer were incorrectly marked as Passed:true, which masked failures and caused CodeReviewPassed events to be emitted instead of CodeReviewFailed. This could skip fix attempts when they should have been triggered. Now parseOutput returns errors for: - No JSON found in review output - JSON unmarshaling failures The caller in review.go already handles these gracefully by logging the error, emitting CodeReviewFailed, and proceeding to merge. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(worker): prevent tests from running git commands on actual repo - Add guard to cleanupWorktree() to skip when worktreePath is empty - Add Bus.Wait() and EventCollector for thread-safe event collection in tests - Update review_test.go and worker_test.go to use new thread-safe patterns - Add PRD for safe git operations interface refactoring Root cause: Tests with MaxFixIterations>0 but no worktreePath would trigger cleanupWorktree(), which ran git checkout/reset/clean in the current working directory (the actual repo), reverting uncommitted changes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(prd): mark code-review as completed, add frontmatter to safe-git-operations - CODE-REVIEW.md: status changed to completed - safe-git-operations.md: added proper frontmatter and document info Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * test: use setupTestRepo for review fix loop --------- Co-authored-by: Test User <test@test.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* specs * feat(gitops): complete task #1 - Error Types and Option Types * feat(gitops): complete task #2 - Result Types and Option Structs * feat(gitops): complete task #3 - Per-Repo Write Lock * feat(gitops): complete task #4 - GitOps Interface and Constructor * feat(gitops): complete task #5 - Read Operations * feat(gitops): complete task #6 - Write Operations * feat(gitops): complete task #7 - Destructive, Remote, and Merge Operations * feat(gitops-mock): complete task #1 - Mock Structure and Constructors * feat(gitops-mock): complete task #2 - Method Implementations * feat(gitops-mock): complete task #3 - Safety Simulation * feat(gitops-mock): complete task #4 - Assertion Helpers * feat(gitops-worker): complete task #1 - Worker Struct Updates * feat(gitops-worker): complete task #2 - Constructor Updates * feat(gitops-worker): complete task #3 - cleanupWorktree Migration * feat(gitops-worker): complete task #4 - commitReviewFixes and hasUncommittedChanges Migration * feat(gitops-worker): complete task #5 - Test Migration * docs: update spec skill formatting and enhance gitops PRD - Fix markdown code block formatting in spec.md skill - Improve path comparison in NewGitOps using filepath.Clean for toplevel - Use filepath.Rel for worktree base validation instead of string prefix - Add remote URL validation to validateBranchGuard - Pass remote parameter to branch guard for Push operations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Harden pre-push checks and mock git in tests * Fix lint in legacy cleanup * Fix legacy cleanup lint and restore prNumber * Fix test paths and cleanup expectations --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Test User <test@example.com>
Summary
All backpressure tests pass.
🤖 Generated with Claude Code