Feature Discussion #43
peterjthomson
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Ledger Strategic Directions Exploration
This document explores six potential feature directions, evaluating feasibility, architecture impact, and implementation approach based on Ledger's current codebase.---
Current Architecture Summary
graph TB subgraph Renderer["Renderer (React)"] CommitPanel[CommitCreatePanel] PRPanel[PRDetailPanel] WorktreePanel[WorktreeDetailPanel] end subgraph Main["Main Process (Node.js)"] GitService[git-service.ts] Settings[settings-service.ts] IPC[IPC Handlers] end subgraph External["External"] Git[git / simple-git] GH[gh CLI] end Renderer -->|IPC| Main GitService --> Git GitService --> GHKey integration points for AI/automation:
Direction 1: AI Embedded Everywhere (Haiku/Light Models)
Vision: Make Ledger feel "magical" with contextual AI assistance - commit message suggestions, commit explanations, diff summaries.Effort: Medium | Impact: High | Complexity: Low-Medium
Where AI Would Integrate
| Feature | Location | Model Use ||---------|----------|-----------|| Commit message suggestions |
CommitCreatePanel| Analyze staged diff, suggest message || "What does this commit do?" |DiffPanel/ git graph | Summarize changes in plain English || Branch name suggestions |CommitCreatePanel| Generate from commit context || PR description drafts | PR creation flow | Summarize branch changes || Conflict resolution hints | Merge conflicts | Explain conflicts simply |Proposed Architecture
graph LR subgraph Main["Main Process"] AIService[ai-service.ts] GitService[git-service.ts] end subgraph Providers["AI Providers"] Haiku[Claude Haiku] Local[Local/Ollama] end Renderer -->|"suggestCommitMessage(diff)"| AIService AIService -->|API| Providers AIService -->|cache| Cache[(LRU Cache)]New files needed:
lib/main/ai-service.ts- AI provider abstractionKey design decisions:
Direction 2: Pre-coding Workflow Integration (Notion/Linear)
Vision: Sync tickets from project management tools, link branches to tickets, see task context while coding.Effort: High | Impact: Medium-High | Complexity: High
Potential Integrations
| Service | Use Case | API Complexity ||---------|----------|----------------|| Linear | Link branches to issues, auto-update status | OAuth + GraphQL || Notion | Link to task pages, pull context | OAuth + REST || GitHub Issues | Already accessible via
gh| Low - use existing CLI || Jira | Enterprise workflow | Complex OAuth |Architecture Sketch
graph TB subgraph Integrations["Integration Services"] Linear[linear-service.ts] Notion[notion-service.ts] GitHub[gh CLI - existing] end subgraph UI["Ticket Panel"] TicketList[TicketList.tsx] TicketDetail[TicketDetail.tsx] end Settings -->|API keys| Integrations Integrations -->|fetch tickets| UI BranchList -->|"linked ticket"| TicketDetailChallenges:
Recommendation: Start with GitHub Issues (already have
ghCLI) before external services.---Direction 3: Advanced AI with Model Choice
Vision: Power users can select their preferred model - Claude Opus for complex tasks, GPT-4o, local Ollama, etc.Effort: Medium | Impact: Medium | Complexity: Medium
Model Provider Architecture
Settings UI Extension
Would extend existing settings infrastructure in settings-service.ts:
Trade-off: More flexibility vs. more configuration complexity. Consider a "just works" default (Haiku with built-in key for basic features) with power-user overrides.---
Direction 4: Agent Dispatcher (SDK Integration)
Vision: Dispatch coding agents to worktrees, track their work, manage multiple agents.Effort: High | Impact: High | Complexity: High
Current Agent Detection
Ledger already detects agent worktrees (from electron.d.ts):
Agent Dispatcher Architecture
graph TB subgraph Ledger["Ledger"] Dispatcher[AgentDispatcher] WorktreeManager[WorktreeManager] UI[Agent Control Panel] end subgraph Agents["Agent SDKs"] Claude[Claude Code SDK] Cursor[Cursor Agent API] Aider[Aider CLI] end subgraph Worktrees["Worktrees"] WT1[agent-1/] WT2[agent-2/] WT3[agent-3/] end UI -->|"dispatch task"| Dispatcher Dispatcher -->|"create"| WorktreeManager WorktreeManager --> Worktrees Dispatcher -->|"invoke"| Agents Agents -->|"work in"| WorktreesNew Capabilities Needed
SDKs to consider:
Direction 5: Running Worktrees (Dev Environment)
Vision: Each worktree can have running processes - test runners, dev servers, containerized environments.Effort: High | Impact: Very High | Complexity: High
Process Management Architecture
graph TB subgraph WorktreeEnv["Worktree Environment"] Detection[Environment Detection] Runners[Runner Registry] Processes[Process Manager] end subgraph Detected["Auto-detected"] Laravel[Laravel Herd] Node[Node/npm/pnpm] Rails[Rails/bundle] Electron[Electron-vite] Docker[Docker Compose] end Detection -->|"detect stack"| Detected Runners -->|"available commands"| UI Processes -->|"start/stop"| RunnersEnvironment Detection
UI Concept
Each worktree card could show:
Integration with Laravel Herd:
~/.config/herd/config.jsonDirection 6: Code Review Control (Bot Review Integration)
Vision: Extract bot reviews (CodeRabbit, Copilot, etc.) into dedicated UI, dispatch reviews, co-mingle with local analysis.Effort: Medium | Impact: Medium-High | Complexity: Medium
Current State
PRDetailPanel already has AI detection:
And filtering UI with "Show AI comments" toggle.
Enhanced Architecture
graph TB subgraph Sources["Review Sources"] GitHub[GitHub PR Reviews] CodeRabbit[CodeRabbit API] Local[Local Analysis] end subgraph ReviewPanel["Review Control Panel"] BotReviews[Bot Reviews Tab] HumanReviews[Human Reviews Tab] LocalInsights[Local Insights Tab] Actions[Review Actions] end Sources -->|"aggregate"| ReviewPanel Actions -->|"dispatch"| CodeRabbit Actions -->|"comment"| GitHubNew Features
CodeRabbit Integration
Recommended Priority
Based on effort/impact ratio and building blocks:| Priority | Direction | Rationale ||----------|-----------|-----------|| 1 | AI Embedded (Haiku) | Low complexity, high delight, enables other features || 2 | Code Review Control | Builds on existing PR UI, clear user value || 3 | Running Worktrees | High value for power users, complex but self-contained || 4 | Model Choice | Natural extension of #1 once AI service exists || 5 | Agent Dispatcher | Depends on external SDK maturity || 6 | Workflow Integration | High complexity, requires OAuth infrastructure |---
Questions to Clarify Direction
All reactions