Add epic bd-190 with 9 child tasks for merge command implementation
This commit is contained in:
@@ -96,6 +96,16 @@
|
||||
{"id":"bd-188","title":"Improve agent onboarding UX for fresh repo clones","description":"**Problem:** Agents in fresh clones don't realize they need to import from git first. The db/JSONL split creates confusion.\n\n**Current pain points:**\n1. Running bd commands on fresh clone shows 0 issues (misleading)\n2. No auto-detection that JSONL exists in git but DB is empty/missing\n3. Creating issues before import causes collisions\n4. AGENTS.md instructions weren't prominent enough (now fixed in this commit)\n\n**Potential improvements:**\n\n**Option 1: Auto-import on first command**\n- If .beads/*.db missing but .beads/issues.jsonl exists → auto-import with message\n- If DB empty but git has HEAD:.beads/issues.jsonl → prompt to import\n- Similar to daemon auto-start UX\n\n**Option 2: Better error messages**\n- 'bd ready' on empty DB: 'No issues found. Did you forget to import? Run: bd import -i .beads/issues.jsonl'\n- 'bd create' on empty DB when JSONL in git: 'Warning: JSONL exists in git. Import first to avoid collisions'\n\n**Option 3: Unified bd onboard command** (may already exist?)\n- Check if this is covered by bd-183 (bd quickstart)\n- One command that does: import from git + explain workflow + configure MCP\n\n**Option 4: Lazy DB initialization**\n- DB auto-creates from JSONL on first read operation\n- Makes JSONL truly the source of truth\n- DB becomes pure cache, always rebuildable\n\n**Recommendation:** Start with Option 2 (better errors) - low risk, immediate UX win.","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-21T15:27:00.189136-07:00","updated_at":"2025-10-21T15:27:00.189136-07:00"}
|
||||
{"id":"bd-189","title":"Auto-detect and prompt for import when query returns empty but git has issues","description":"**Problem:** Commands like 'bd list', 'bd ready', 'bd stats' return 0 issues in fresh clones, but don't hint that issues exist in git.\n\n**Proposal:** When a query command returns 0 issues, check if git has issues:\n```bash\n# If bd list returns 0 results:\ngit show HEAD:.beads/issues.jsonl | head -1 # Check if non-empty\n```\n\nIf git has issues, either:\n\n**Option A: Auto-import (recommended)**\n```\nFound 0 issues in database but 184 in git. Importing...\n[import happens automatically]\n[re-run the original query]\n```\n\n**Option B: Prompt**\n```\nFound 0 issues in database but 184 in git.\nImport now? [Y/n]\n```\n\n**Option C: Warning only**\n```\nFound 0 issues.\nHint: Found issues in git history. Run: bd import -i \u003c(git show HEAD:.beads/issues.jsonl)\n```\n\n**Implementation notes:**\n- Add helper function: hasIssuesInGit() → int (count from git)\n- Wrap in query commands: list, ready, stats, show (when ID not found)\n- Fast check: just `git show HEAD:.beads/issues.jsonl | wc -l` (10-20ms)\n- Only trigger on genuinely empty DB (not filtered results)\n- Respect --no-auto-import flag if needed\n\n**Why Option A (auto-import):**\n- Zero cognitive load for agents\n- JSONL is source of truth anyway\n- Similar to daemon auto-start philosophy\n- DB is just a cache - auto-rebuild is natural\n\n**Affected commands:**\n- bd list (most common)\n- bd ready (agents check this first)\n- bd stats (shows 0/0/0 misleadingly)\n- bd show \u003cid\u003e (ID not found - maybe in git?)\n\n**Benefits:**\n- Agents never see empty state in fresh clones\n- 'bd ready' becomes reliable first command\n- No more import instructions needed in AGENTS.md\n- Makes DB fully ephemeral/rebuildable\n\nRelated: bd-188 (broader onboarding UX), bd-183 (quickstart command)","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-21T15:27:00.189136-07:00","updated_at":"2025-10-21T15:27:00.189136-07:00","closed_at":"2025-10-21T14:08:04.629408-07:00"}
|
||||
{"id":"bd-19","title":"Implement storage driver interface for pluggable backends","description":"Create abstraction layer for storage to support multiple backends (SQLite, Postgres, Turso, in-memory testing, etc.).\n\n**Current state:** All storage logic hardcoded to SQLite in internal/storage/sqlite/sqlite.go\n\n**Proposed design:**\n\n```go\n// internal/storage/storage.go\ntype Store interface {\n // Issue CRUD\n CreateIssue(issue *Issue) error\n GetIssue(id string) (*Issue, error)\n UpdateIssue(id string, updates *Issue) error\n DeleteIssue(id string) error\n ListIssues(filter *Filter) ([]*Issue, error)\n \n // Dependencies\n AddDependency(from, to string, depType DependencyType) error\n RemoveDependency(from, to string, depType DependencyType) error\n GetDependencies(id string) ([]*Dependency, error)\n \n // Counters, stats\n GetNextID(prefix string) (string, error)\n GetStats() (*Stats, error)\n \n Close() error\n}\n```\n\n**Benefits:**\n- Better testing (mock/in-memory stores)\n- Future flexibility (Postgres, cloud APIs, etc.)\n- Clean architecture (business logic decoupled from storage)\n- Enable Turso or other backends without refactoring everything\n\n**Implementation steps:**\n1. Define Store interface in internal/storage/storage.go\n2. Refactor SQLiteStore to implement interface\n3. Update all commands to use interface, not concrete type\n4. Add MemoryStore for testing\n5. Add driver selection via config (storage.driver = sqlite|turso|postgres)\n6. Update tests to use interface\n\n**Note:** This is valuable even without adopting Turso. Good architecture practice.\n\n**Context:** From GH issue #2 RFC evaluation. Driver interface is low-cost, high-value regardless of whether we add alternative backends.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-21T15:27:00.189136-07:00","updated_at":"2025-10-21T15:27:00.189136-07:00","closed_at":"2025-10-17T23:46:22.447301-07:00"}
|
||||
{"id":"bd-190","title":"Implement bd merge command for combining duplicate issues","description":"Support merging duplicate issues identified either manually by users or automatically by AI agents.\n\nRequested in GitHub issue #93 by neongreen. User has multiple copies of the same issue and wants to merge them rather than just delete duplicates.\n\nRequirements:\n- Manual merge: User specifies which issues to merge (e.g., bd merge bd-42 bd-43 --into bd-42)\n- AI-assisted: Agent analyzes issues, identifies duplicates, then uses manual merge command\n- Auto-update all text references and dependencies to point to merged issue\n- No framework-side duplicate detection - delegate to agents\n\nThe merge command should:\n1. Combine issue data (prefer target issue's data, optionally merge descriptions)\n2. Migrate all dependencies to merged issue\n3. Update all text references in other issues (like \"see bd-43\" -\u003e \"see bd-42\")\n4. Mark merged issues as closed with reason \"Merged into bd-X\"","design":"Manual merge command:\n bd merge \u003csource-id\u003e... --into \u003ctarget-id\u003e [--json]\n\nAI-assisted workflow:\n 1. Agent runs: bd list --json\n 2. Agent analyzes for duplicates (title similarity, description, etc.)\n 3. Agent presents findings to user\n 4. User approves merge\n 5. Agent executes: bd merge bd-X bd-Y --into bd-X\n\nImplementation considerations:\n- Reuse text reference update logic from import collision resolution\n- Add merged_into field to track merge history\n- Update export/import to handle merge history\n- Consider showing merge history in bd show output","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-21T16:19:22.704722-07:00","updated_at":"2025-10-21T16:19:22.704722-07:00","dependencies":[{"issue_id":"bd-190","depends_on_id":"bd-191","type":"parent-child","created_at":"2025-10-21T16:26:19.45492-07:00","created_by":"daemon"},{"issue_id":"bd-190","depends_on_id":"bd-192","type":"parent-child","created_at":"2025-10-21T16:26:19.456742-07:00","created_by":"daemon"},{"issue_id":"bd-190","depends_on_id":"bd-193","type":"parent-child","created_at":"2025-10-21T16:26:19.458774-07:00","created_by":"daemon"},{"issue_id":"bd-190","depends_on_id":"bd-194","type":"parent-child","created_at":"2025-10-21T16:26:19.461185-07:00","created_by":"daemon"},{"issue_id":"bd-190","depends_on_id":"bd-195","type":"parent-child","created_at":"2025-10-21T16:26:19.463397-07:00","created_by":"daemon"},{"issue_id":"bd-190","depends_on_id":"bd-196","type":"parent-child","created_at":"2025-10-21T16:26:19.46573-07:00","created_by":"daemon"},{"issue_id":"bd-190","depends_on_id":"bd-197","type":"parent-child","created_at":"2025-10-21T16:26:19.468357-07:00","created_by":"daemon"},{"issue_id":"bd-190","depends_on_id":"bd-198","type":"parent-child","created_at":"2025-10-21T16:26:19.471008-07:00","created_by":"daemon"},{"issue_id":"bd-190","depends_on_id":"bd-199","type":"parent-child","created_at":"2025-10-21T16:26:19.473153-07:00","created_by":"daemon"}]}
|
||||
{"id":"bd-191","title":"Add merged_into field to database schema","description":"Add merged_into field to Issue struct and update database schema to support merge tracking","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-21T16:26:07.422876-07:00","updated_at":"2025-10-21T16:26:07.422876-07:00"}
|
||||
{"id":"bd-192","title":"Implement merge validation logic","description":"Validate merge operations: check for circular merges, self-merge, non-existent issues, and other edge cases","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-21T16:26:07.513032-07:00","updated_at":"2025-10-21T16:26:07.513032-07:00"}
|
||||
{"id":"bd-193","title":"Implement dependency migration for merge","description":"Migrate all dependencies from source issue(s) to target issue during merge, removing duplicates and preserving graph integrity","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-21T16:26:07.523056-07:00","updated_at":"2025-10-21T16:26:07.523056-07:00"}
|
||||
{"id":"bd-194","title":"Implement text reference scanning and replacement","description":"Scan all issues for text references to merged IDs (bd-X patterns) and update to target ID. Reuse logic from import collision resolution.","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-21T16:26:07.537254-07:00","updated_at":"2025-10-21T16:26:07.537254-07:00"}
|
||||
{"id":"bd-195","title":"Add CLI merge command and flags","description":"Implement bd merge command with: multiple sources, --into target, --dry-run, --json flags. Add interactive confirmation.","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-21T16:26:07.541709-07:00","updated_at":"2025-10-21T16:26:07.541709-07:00"}
|
||||
{"id":"bd-196","title":"Add transaction support for atomic merges","description":"Wrap all merge operations in SQLite transaction for atomicity. Implement rollback on failure.","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-21T16:26:07.551783-07:00","updated_at":"2025-10-21T16:26:07.551783-07:00"}
|
||||
{"id":"bd-197","title":"Update export/import for merge fields","description":"Include merged_into in JSONL export format. Handle merge relationships on import.","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-21T16:26:07.566079-07:00","updated_at":"2025-10-21T16:26:07.566079-07:00"}
|
||||
{"id":"bd-198","title":"Write tests for merge functionality","description":"Unit tests: validation, merge logic, data integrity. Integration tests: end-to-end workflow, export/import. Edge case tests: chains, circular refs, epics.","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-21T16:26:07.571061-07:00","updated_at":"2025-10-21T16:26:07.571061-07:00"}
|
||||
{"id":"bd-199","title":"Document merge command and AI integration","description":"Update README, AGENTS.md with merge command examples. Document AI agent duplicate detection workflow.","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-21T16:26:07.580564-07:00","updated_at":"2025-10-21T16:26:07.580564-07:00"}
|
||||
{"id":"bd-2","title":"Sub-task under A","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-21T15:27:00.189136-07:00","updated_at":"2025-10-21T15:27:00.189136-07:00","closed_at":"2025-10-16T10:07:34.129516-07:00"}
|
||||
{"id":"bd-20","title":"Investigate auto-export debounce not triggering","description":"Auto-export to JSONL did not trigger automatically after creating bd-33 and bd-17. Had to manually run 'bd export' to sync.\n\n**Expected behavior:** Auto-export should trigger ~5 seconds after CRUD operations (per CLAUDE.md documentation).\n\n**Actual behavior:** Issues bd-33 and bd-17 were created but JSONL was not updated until manual 'bd export' was run.\n\n**Investigation needed:**\n1. Check if auto-flush goroutine is running\n2. Verify debounce timer is being triggered on CreateIssue()\n3. Check for errors/panics in background export\n4. Verify auto-flush is enabled by default\n5. Check if there's a race condition with shutdown\n\n**Impact:** HIGH - Data loss risk if users create issues and don't realize they haven't synced to Git.\n\n**Testing:**\n```bash\n# Create issue and wait 10 seconds\nbd create \"Test\" -p 4\nsleep 10\ngrep \"Test\" .beads/issues.jsonl # Should find it\n```\n\n**Workaround:** Manually run 'bd export' after CRUD operations.\n\n**Context:** Discovered during GH issue #2 RFC evaluation while creating bd-33 and bd-17.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-21T15:27:00.189136-07:00","updated_at":"2025-10-21T15:27:00.189136-07:00","closed_at":"2025-10-20T16:02:06.049244-07:00"}
|
||||
{"id":"bd-21","title":"Another test with multiple deps","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-21T15:27:00.189136-07:00","updated_at":"2025-10-21T15:27:00.189136-07:00","closed_at":"2025-10-16T10:07:34.028111-07:00"}
|
||||
|
||||
Reference in New Issue
Block a user