From 52d6fd8deb74a0811274d051c79c2660bd62f9b3 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Tue, 21 Oct 2025 14:10:19 -0700 Subject: [PATCH] Sync issue updates: close bd-189, create bd-188 --- .beads/issues.jsonl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index f815525c..77d54556 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -94,7 +94,7 @@ {"id":"bd-186","title":"Add rule-based compaction (e.g., compact children of closed epics)","description":"Support semantic compaction rules beyond just time-based, such as:\n- Compact all children of closed epics\n- Compact by priority level (e.g., all P3/P4 closed issues)\n- Compact by label (e.g., all issues labeled 'archive')\n- Compact by type (e.g., all closed chores)\n\nThis would allow smarter database size management based on semantic meaning rather than just age.","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-21T14:00:37.867512-07:00","updated_at":"2025-10-21T14:00:37.867512-07:00"} {"id":"bd-187","title":"Add compact --dry-run that shows size savings estimates","description":"When running 'bd compact --dry-run', show estimated database size reduction in KB/MB and percentage, similar to what 'du -h' would show.\n\nExample output:\n Tier 1 candidates: 15 issues\n Current size: 2.4 MB\n After compaction: ~1.7 MB (70% reduction, 0.7 MB saved)\n \nThis helps users understand impact before compacting.","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-21T14:00:37.867512-07:00","updated_at":"2025-10-21T14:00:37.867512-07:00"} {"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-21T14:02:55.700392-07:00","updated_at":"2025-10-21T14:02:55.700392-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":"open","priority":1,"issue_type":"feature","created_at":"2025-10-21T14:03:38.315364-07:00","updated_at":"2025-10-21T14:03:38.315364-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-21T14:03:38.315364-07:00","updated_at":"2025-10-21T14:08:04.629408-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-21T14:00:37.867512-07:00","updated_at":"2025-10-21T14:00:37.867512-07:00","closed_at":"2025-10-17T23:46:22.447301-07:00"} {"id":"bd-2","title":"Sub-task under A","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-21T14:00:37.862355-07:00","updated_at":"2025-10-21T14:00:37.865543-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-21T14:00:37.867512-07:00","updated_at":"2025-10-21T14:00:37.867512-07:00","closed_at":"2025-10-20T16:02:06.049244-07:00"}