diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index d67a8f36..9938f376 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -108,7 +108,7 @@ {"id":"bd-196","title":"Test2 auto-export","description":"","status":"closed","priority":4,"issue_type":"task","created_at":"2025-10-15T01:08:12.788761-07:00","updated_at":"2025-10-16T12:51:19.167381-07:00","closed_at":"2025-10-16T11:01:26.848268-07:00"} {"id":"bd-197","title":"Add version mismatch warning for outdated binaries","description":"When bd detects that the database was created/modified by a newer version, warn the user that they may be running an outdated binary.\n\n**Problem:** Users may run old bd binaries without realizing it, leading to confusing behavior (e.g., missing features like auto-export).\n\n**Solution:** Store schema version or bd version in metadata table, check on startup, warn if mismatch.\n\n**Implementation:**\n1. Add `schema_version` or `bd_version` to metadata table during init\n2. Check version in PersistentPreRun (cmd/bd/main.go)\n3. Warn if binary version \u003c DB version\n4. Suggest: 'Your bd binary (v0.9.3) is older than this database (v0.9.5). Rebuild: go build -o bd ./cmd/bd'\n\n**Edge cases:**\n- Dev builds (show commit hash?)\n- Backwards compatibility (older DBs should work with newer binaries)\n- Don't warn on every command (maybe once per session?)\n\n**Related:** Fixes confusion from bd-182 (auto-export not working with old binary)","notes":"**Implementation Complete:**\n\n✅ Added version metadata storage during `bd init` (init.go:59-63)\n✅ Added `checkVersionMismatch()` function (main.go:301-345)\n✅ Integrated version check into PersistentPreRun (main.go:98-99)\n✅ Tested both scenarios:\n - Outdated binary: Clear warning with rebuild instructions\n - Newer binary: Info message that DB will be auto-upgraded\n✅ No warnings on subsequent runs (version updated automatically)\n\n**How it works:**\n1. On `bd init`: Stores current version in metadata table\n2. On every command: Checks stored version vs binary version\n3. If mismatch:\n - Binary \u003c DB version → Warn: outdated binary\n - Binary \u003e DB version → Info: auto-upgrading DB\n4. Always updates stored version to current (future-proof)\n\n**Files modified:**\n- cmd/bd/init.go: Store version on init\n- cmd/bd/main.go: checkVersionMismatch() + integration\n\n**Testing:**\n```bash\n# Simulate old binary\nsqlite3 .beads/default.db \"UPDATE metadata SET value='0.9.99' WHERE key='bd_version';\"\nbd ready # Shows warning\n\n# Normal use (versions match)\nbd ready # No warning\n```\n\n**Edge cases handled:**\n- Empty version (old DB): Silently upgrade\n- Metadata errors: Skip check (defensive)\n- Dev builds: String comparison (works for 0.9.5 vs 0.9.6)\n\nFixes bd-182 confusion (users won't run outdated binaries unknowingly).","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-15T01:08:12.788913-07:00","updated_at":"2025-10-16T12:51:19.167542-07:00","closed_at":"2025-10-16T11:01:26.848416-07:00","dependencies":[{"issue_id":"bd-197","depends_on_id":"bd-182","type":"discovered-from","created_at":"2025-10-15T01:08:12.811298-07:00","created_by":"auto-import"}]} {"id":"bd-198","title":"Add label management commands to CLI","description":"Currently labels can only be managed programmatically via the storage API. Add CLI commands to add, remove, and filter by labels.","acceptance_criteria":"Can add/remove/list labels via CLI, can filter issues by label, labels persist to JSONL","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-15T01:50:18.575625-07:00","updated_at":"2025-10-16T12:51:19.167698-07:00"} -{"id":"bd-199","title":"Investigate and fix import timeout with 208 issues","description":"bd import times out after 2 minutes when importing 208 issues from JSONL. This is unacceptable for a tool designed to scale to 100k+ issues.","design":"\n## Reproduction\n```bash\ncd ~/src/beads\nbd import .beads/issues.jsonl # Hangs/times out after 2 minutes\n```\n\nCurrent database state:\n- 208 issues in bd.db (2MB)\n- 208 lines in issues.jsonl (100KB)\n- WAL mode enabled\n\n## Symptoms\n- Import starts but never completes\n- No error message, just hangs\n- Timeout after 2 minutes (artificially imposed in testing)\n- Happens even when database already contains the issues (idempotent import)\n\n## Likely Causes\n1. **Transaction size** - All 208 issues in one transaction?\n2. **Lock contention** - WAL checkpoint blocking?\n3. **N+1 queries** - Dependency checking for each issue?\n4. **Missing indexes** - Slow lookups during collision detection?\n5. **Auto-flush interaction** - Background flush goroutine conflicting?\n\n## Performance Target\nShould handle:\n- 1000 issues in \u003c 5 seconds\n- 10,000 issues in \u003c 30 seconds \n- 100,000 issues in \u003c 5 minutes\n\n## Investigation Steps\n1. Add timing instrumentation to import phases\n2. Profile the import operation\n3. Check for lock contention in WAL mode\n4. Review collision detection performance\n5. Test with PRAGMA synchronous = NORMAL\n6. Consider batching imports (e.g., 100 issues per transaction)\n","acceptance_criteria":"\n- Can import 208 issues in \u003c 5 seconds\n- Can import 1000 issues in \u003c 30 seconds\n- Add performance logging to identify bottlenecks\n- Add --batch-size flag for tuning\n- Document performance characteristics\n- Integration test with large import\n","status":"open","priority":0,"issue_type":"bug","created_at":"2025-10-15T01:56:41.546786-07:00","updated_at":"2025-10-16T12:51:19.167895-07:00"} +{"id":"bd-199","title":"Investigate and fix import timeout with 208 issues","description":"bd import times out after 2 minutes when importing 208 issues from JSONL. This is unacceptable for a tool designed to scale to 100k+ issues.","design":"\n## Reproduction\n```bash\ncd ~/src/beads\nbd import .beads/issues.jsonl # Hangs/times out after 2 minutes\n```\n\nCurrent database state:\n- 208 issues in bd.db (2MB)\n- 208 lines in issues.jsonl (100KB)\n- WAL mode enabled\n\n## Symptoms\n- Import starts but never completes\n- No error message, just hangs\n- Timeout after 2 minutes (artificially imposed in testing)\n- Happens even when database already contains the issues (idempotent import)\n\n## Likely Causes\n1. **Transaction size** - All 208 issues in one transaction?\n2. **Lock contention** - WAL checkpoint blocking?\n3. **N+1 queries** - Dependency checking for each issue?\n4. **Missing indexes** - Slow lookups during collision detection?\n5. **Auto-flush interaction** - Background flush goroutine conflicting?\n\n## Performance Target\nShould handle:\n- 1000 issues in \u003c 5 seconds\n- 10,000 issues in \u003c 30 seconds \n- 100,000 issues in \u003c 5 minutes\n\n## Investigation Steps\n1. Add timing instrumentation to import phases\n2. Profile the import operation\n3. Check for lock contention in WAL mode\n4. Review collision detection performance\n5. Test with PRAGMA synchronous = NORMAL\n6. Consider batching imports (e.g., 100 issues per transaction)\n","acceptance_criteria":"\n- Can import 208 issues in \u003c 5 seconds\n- Can import 1000 issues in \u003c 30 seconds\n- Add performance logging to identify bottlenecks\n- Add --batch-size flag for tuning\n- Document performance characteristics\n- Integration test with large import\n","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-15T01:56:41.546786-07:00","updated_at":"2025-10-16T13:15:03.880939-07:00","closed_at":"2025-10-16T13:15:03.880939-07:00"} {"id":"bd-2","title":"Verify auto-export works","description":"","status":"closed","priority":0,"issue_type":"task","created_at":"2025-10-12T00:43:03.457453-07:00","updated_at":"2025-10-16T12:51:19.168065-07:00","closed_at":"2025-10-12T14:15:04.00695-07:00"} {"id":"bd-20","title":"Add --strict flag for dependency import failures","description":"Currently dependency import errors are warnings (logged to stderr, execution continues). Missing targets or cycles may indicate JSONL corruption. Add --strict flag to fail on any dependency errors for data integrity validation. Location: cmd/bd/import.go:159-164","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-12T15:13:18.954834-07:00","updated_at":"2025-10-16T12:51:19.168235-07:00","closed_at":"2025-10-16T11:01:26.848689-07:00"} {"id":"bd-200","title":"race_test_4","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.848815-07:00","updated_at":"2025-10-16T12:51:19.168382-07:00","closed_at":"2025-10-16T11:01:26.848815-07:00"} @@ -269,7 +269,17 @@ {"id":"bd-341","title":"Reach 1.0 release milestone","description":"Stabilize API, finalize documentation, comprehensive testing","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-10-16T11:57:33.439852-07:00","updated_at":"2025-10-16T12:51:19.343194-07:00","closed_at":"2025-10-15T21:00:51.057137-07:00"} {"id":"bd-342","title":"Code review follow-up: Post-PR #8 merge improvements","description":"Follow-up tasks from the ultrathink code review of PR #8 merge (bd-62).\n\n**Context:** PR #8 successfully merged atomic counter + dirty tracking. Core functionality is solid but several improvements identified.\n\n**Critical (P0-P1):**\n- bd-64: Fix SyncAllCounters performance bottleneck (P0)\n- bd-65: Add migration for issue_counters table (P1)\n- bd-66: Make import counter sync failure fatal (P1)\n\n**Nice to have (P2-P3):**\n- bd-67: Update test comments (P2)\n- bd-68: Add performance benchmarks (P2)\n- bd-69: Add metrics/logging (P3)\n- bd-70: Add EXPLAIN QUERY PLAN tests (P3)\n\n**Overall assessment:** 4/5 stars - Excellent implementation with one critical performance issue. After bd-64 is fixed, this becomes 5/5.\n\n**Review document:** Available if needed","notes":"All tasks completed: bd-64 (performance), bd-65 (migration), bd-66 (version sync), bd-67 (version script), bd-69 (CI coverage), bd-70 (test coverage). Code review follow-up complete.","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-10-16T11:57:33.443835-07:00","updated_at":"2025-10-16T12:51:19.343342-07:00","closed_at":"2025-10-15T19:41:18.75038-07:00"} {"id":"bd-343","title":"GH-6: Fix race condition in parallel issue creation","description":"Creating multiple issues rapidly in parallel causes 'UNIQUE constraint failed: issues.id' error. The ID generation has a race condition. Reproducible with: for i in {26..35}; do ./bd create parallel_ 2\u003e\u00261 \u0026 done","notes":"**Historical context (recovered from lost issue bd-221):**\n\nFirst attempt at fixing this race condition had a critical flaw: used 'ROLLBACK; BEGIN IMMEDIATE' which executed as two separate statements. After ROLLBACK, the Go tx object was invalid but continued to be used, causing undefined behavior.\n\nRoot cause of failed fix: database/sql connection pooling. Without acquiring a dedicated connection, subsequent queries could use different connections from the pool, breaking the transaction.\n\nCorrect fix (the one that was merged): Use conn := s.db.Conn(ctx) to acquire a dedicated connection, then execute BEGIN IMMEDIATE, all operations, and COMMIT on that single connection.\n\nThis bug was caught during code review and fixed before merging.\n\nSee LOST_ISSUES_RECOVERY.md for details on bd-221.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-16T11:57:33.472977-07:00","updated_at":"2025-10-16T12:51:19.343528-07:00","closed_at":"2025-10-15T02:52:17.500349-07:00","external_ref":"gh-6"} +{"id":"bd-344","title":"parallel_test_5","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T13:13:39.752532-07:00","updated_at":"2025-10-16T13:13:39.752532-07:00"} +{"id":"bd-345","title":"parallel_test_3","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T13:13:39.753005-07:00","updated_at":"2025-10-16T13:13:39.753005-07:00"} +{"id":"bd-346","title":"parallel_test_1","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T13:13:39.753492-07:00","updated_at":"2025-10-16T13:13:39.753492-07:00"} +{"id":"bd-347","title":"parallel_test_9","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T13:13:39.753557-07:00","updated_at":"2025-10-16T13:13:39.753557-07:00"} +{"id":"bd-348","title":"parallel_test_8","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T13:13:39.752764-07:00","updated_at":"2025-10-16T13:13:39.752764-07:00"} +{"id":"bd-349","title":"parallel_test_2","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T13:13:39.753413-07:00","updated_at":"2025-10-16T13:13:39.753413-07:00"} {"id":"bd-35","title":"Auto-flush JSONL on CRUD operations with 5-second debounce","description":"Implemented automatic write-through from SQLite to JSONL with 5-second debouncing. After any CRUD operation (create, update, close, dep add/remove), changes are scheduled to flush to JSONL after 5 seconds of inactivity. On process exit, any pending changes are flushed immediately. This prevents .db and .jsonl from getting out of sync, solving the workflow gap where agents forget to run 'bd export'. Can be disabled with --no-auto-flush flag. Addresses bd-33.","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-13T22:21:13.94705-07:00","updated_at":"2025-10-16T12:51:19.343698-07:00","closed_at":"2025-10-13T22:22:38.359968-07:00"} +{"id":"bd-350","title":"parallel_test_10","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T13:13:39.870087-07:00","updated_at":"2025-10-16T13:13:39.870087-07:00"} +{"id":"bd-351","title":"parallel_test_7","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T13:13:39.753367-07:00","updated_at":"2025-10-16T13:13:39.753367-07:00"} +{"id":"bd-352","title":"parallel_test_6","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T13:13:39.753693-07:00","updated_at":"2025-10-16T13:13:39.753693-07:00"} +{"id":"bd-353","title":"parallel_test_4","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T13:13:39.752864-07:00","updated_at":"2025-10-16T13:13:39.752864-07:00"} {"id":"bd-36","title":"Handle missing JSONL directory in findJSONLPath","description":"findJSONLPath() assumes the database directory exists. If someone runs bd init to create a new database but the .beads directory doesn't exist yet, the glob operations might fail silently. Add os.MkdirAll(dbDir, 0755) to ensure directory exists before globbing. Located in cmd/bd/main.go:188-201.","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-10-13T22:34:35.944346-07:00","updated_at":"2025-10-16T12:51:19.344229-07:00","closed_at":"2025-10-13T22:50:53.269614-07:00"} {"id":"bd-37","title":"Refactor duplicate flush logic in PersistentPostRun","description":"PersistentPostRun contains a complete copy of the flush logic instead of calling flushToJSONL(). This violates DRY principle and makes maintenance harder. Refactor to use flushToJSONL() with a force parameter to bypass isDirty check, or extract shared logic into a helper function. Located in cmd/bd/main.go:104-138.","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-13T22:34:43.429201-07:00","updated_at":"2025-10-16T12:51:19.344391-07:00"} {"id":"bd-38","title":"Add visibility for auto-flush failures","description":"flushToJSONL() writes warnings to stderr when flush fails, but calling code has no way to know if flush succeeded or failed. This means a command could return success even though JSONL is now out of sync. Consider maintaining a 'last flush status' variable or counter for failed flushes, and warn user after multiple consecutive failures (e.g., 3+). Located in cmd/bd/main.go:227-307.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-13T22:34:52.440117-07:00","updated_at":"2025-10-16T12:51:19.344564-07:00","closed_at":"2025-10-13T23:22:47.805211-07:00"} @@ -328,7 +338,7 @@ {"id":"bd-86","title":"GH-2: Evaluate optional Turso backend for collaboration","description":"RFC proposal for optional Turso/libSQL backend to enable: database branching, near-real-time sync between agents/humans, native vector search, browser-ready persistence (WASM/OPFS), and concurrent writes. Would be opt-in, keeping current JSONL+SQLite as default. Requires storage driver interface.","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-14T02:44:51.932233-07:00","updated_at":"2025-10-16T12:51:19.400066-07:00","external_ref":"gh-2"} {"id":"bd-87","title":"GH-3: Debug zsh killed error on bd init","description":"User reports 'zsh: killed bd init' when running bd init or just bd command. Likely a crash or signal. Need to reproduce and investigate cause.","status":"open","priority":1,"issue_type":"bug","created_at":"2025-10-14T02:44:53.054411-07:00","updated_at":"2025-10-16T12:51:19.400227-07:00","external_ref":"gh-3"} {"id":"bd-88","title":"GH-4: Consider system-wide/multi-repo beads usage","description":"User wants to use beads across multiple repositories and for sysadmin tasks. Currently beads is project-scoped (.beads/ directory). Explore options for system-wide issue tracking that spans multiple repos. Related question: how does beads compare to membank MCP?","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-14T02:44:54.343447-07:00","updated_at":"2025-10-16T12:51:19.400359-07:00","external_ref":"gh-4"} -{"id":"bd-89","title":"GH-6: Fix race condition in parallel issue creation","description":"Creating multiple issues rapidly in parallel causes 'UNIQUE constraint failed: issues.id' error. The ID generation has a race condition. Reproducible with: for i in {26..35}; do ./bd create parallel_ 2\u003e\u00261 \u0026 done","status":"open","priority":0,"issue_type":"bug","created_at":"2025-10-14T02:44:55.510776-07:00","updated_at":"2025-10-16T12:51:19.40052-07:00","external_ref":"gh-6"} +{"id":"bd-89","title":"GH-6: Fix race condition in parallel issue creation","description":"Creating multiple issues rapidly in parallel causes 'UNIQUE constraint failed: issues.id' error. The ID generation has a race condition. Reproducible with: for i in {26..35}; do ./bd create parallel_ 2\u003e\u00261 \u0026 done","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-14T02:44:55.510776-07:00","updated_at":"2025-10-16T13:13:51.815863-07:00","closed_at":"2025-10-16T13:13:51.815863-07:00","external_ref":"gh-6"} {"id":"bd-9","title":"Build collision resolution tooling for distributed branch workflows","description":"When branches diverge and both create issues, auto-incrementing IDs collide on merge. Build excellent tooling to detect collisions during import, auto-renumber issues with fewer dependencies, update all references in descriptions and dependency links, and provide clear user feedback. Goal: keep beautiful brevity of numeric IDs (bd-302) while handling distributed creation gracefully.","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-12T13:39:34.608218-07:00","updated_at":"2025-10-16T12:51:19.401725-07:00","closed_at":"2025-10-16T11:01:27.044101-07:00"} {"id":"bd-90","title":"GH-7: Package available in AUR (beads-git)","description":"Community member created AUR package for Arch Linux: https://aur.archlinux.org/packages/beads-git. This is informational - no action needed, but good to track for release process and documentation.","status":"open","priority":4,"issue_type":"chore","created_at":"2025-10-14T02:44:56.4535-07:00","updated_at":"2025-10-16T12:51:19.402635-07:00","external_ref":"gh-7"} {"id":"bd-91","title":"GH-9: Support markdown files in bd create","description":"Request to support markdown files as input to bd create, which would parse the markdown and split it into multiple issues. Use case: developers keep feature drafts in markdown files in version control, then want to convert them into issues. Example: bd create -f feature-draft.md","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-14T02:44:57.405586-07:00","updated_at":"2025-10-16T12:51:19.403155-07:00","closed_at":"2025-10-14T12:42:14.457949-07:00","external_ref":"gh-9"}