From a0b2110629748567ca52350c692b4679102a52ce Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Thu, 16 Oct 2025 12:50:32 -0700 Subject: [PATCH] Update issues.jsonl after bd-272 completion --- .beads/issues.jsonl | 706 ++++++++++++++++++++++---------------------- 1 file changed, 353 insertions(+), 353 deletions(-) diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 75b81d62..8715e66a 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -1,353 +1,353 @@ -{"id":"bd-1","title":"Critical bug","description":"","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-12T00:43:03.453438-07:00","updated_at":"2025-10-16T12:22:47.764644-07:00","closed_at":"2025-10-12T20:20:06.977679-07:00"} -{"id":"bd-10","title":"Add PostgreSQL backend","description":"Implement PostgreSQL storage backend as alternative to SQLite for larger teams","status":"closed","priority":3,"issue_type":"feature","created_at":"2025-10-12T14:32:19.163526-07:00","updated_at":"2025-10-16T12:22:47.776922-07:00","closed_at":"2025-10-12T15:07:47.937992-07:00","dependencies":[{"issue_id":"bd-10","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:35:59.213222-07:00","created_by":"stevey"}]} -{"id":"bd-100","title":"parallel_test_10","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.946477-07:00","updated_at":"2025-10-16T12:22:47.777153-07:00"} -{"id":"bd-101","title":"parallel_test_3","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.971429-07:00","updated_at":"2025-10-16T12:22:47.777753-07:00"} -{"id":"bd-102","title":"parallel_test_8","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.997449-07:00","updated_at":"2025-10-16T12:22:47.78786-07:00"} -{"id":"bd-103","title":"parallel_test_9","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.998608-07:00","updated_at":"2025-10-16T12:22:47.790883-07:00"} -{"id":"bd-104","title":"parallel_26","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.254662-07:00","updated_at":"2025-10-16T12:22:47.79129-07:00"} -{"id":"bd-105","title":"parallel_31","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.255055-07:00","updated_at":"2025-10-16T12:22:47.791488-07:00"} -{"id":"bd-106","title":"parallel_32","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.255348-07:00","updated_at":"2025-10-16T12:22:47.791679-07:00"} -{"id":"bd-107","title":"parallel_33","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.255454-07:00","updated_at":"2025-10-16T12:22:47.791861-07:00"} -{"id":"bd-108","title":"parallel_28","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.255731-07:00","updated_at":"2025-10-16T12:22:47.793047-07:00"} -{"id":"bd-109","title":"parallel_29","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.255867-07:00","updated_at":"2025-10-16T12:22:47.79674-07:00"} -{"id":"bd-11","title":"Test issue to verify fix","description":"This should be bd-11 if the fix works","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-12T14:40:21.419082-07:00","updated_at":"2025-10-16T12:22:47.797255-07:00","closed_at":"2025-10-12T14:40:32.963312-07:00"} -{"id":"bd-110","title":"parallel_27","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.255932-07:00","updated_at":"2025-10-16T12:22:47.797834-07:00"} -{"id":"bd-111","title":"parallel_30","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.258491-07:00","updated_at":"2025-10-16T12:22:47.798052-07:00"} -{"id":"bd-112","title":"parallel_35","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.258879-07:00","updated_at":"2025-10-16T12:22:47.798256-07:00"} -{"id":"bd-113","title":"parallel_34","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.265162-07:00","updated_at":"2025-10-16T12:22:47.800248-07:00"} -{"id":"bd-114","title":"stress_3","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.092233-07:00","updated_at":"2025-10-16T12:22:47.801046-07:00"} -{"id":"bd-115","title":"stress_5","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.092311-07:00","updated_at":"2025-10-16T12:22:47.801915-07:00"} -{"id":"bd-116","title":"stress_10","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.093319-07:00","updated_at":"2025-10-16T12:22:47.8022-07:00"} -{"id":"bd-117","title":"stress_2","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.093453-07:00","updated_at":"2025-10-16T12:22:47.802389-07:00"} -{"id":"bd-118","title":"stress_8","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.093516-07:00","updated_at":"2025-10-16T12:22:47.802564-07:00"} -{"id":"bd-119","title":"stress_13","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.094405-07:00","updated_at":"2025-10-16T12:22:47.802773-07:00"} -{"id":"bd-12","title":"Implement collision detection in import","description":"Create collision.go with detectCollisions() function. Compare incoming JSONL issues against DB state. Distinguish between: (1) exact match (idempotent), (2) ID match but different content (collision), (3) new issue. Return list of colliding issues.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-12T14:40:56.056588-07:00","updated_at":"2025-10-16T12:22:47.803076-07:00","closed_at":"2025-10-12T16:06:25.575038-07:00","dependencies":[{"issue_id":"bd-12","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:41:07.947358-07:00","created_by":"stevey"}]} -{"id":"bd-120","title":"stress_14","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.094519-07:00","updated_at":"2025-10-16T12:22:47.80422-07:00"} -{"id":"bd-121","title":"stress_1","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.095805-07:00","updated_at":"2025-10-16T12:22:47.807274-07:00"} -{"id":"bd-122","title":"stress_7","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.096461-07:00","updated_at":"2025-10-16T12:22:47.808224-07:00"} -{"id":"bd-123","title":"stress_17","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.096904-07:00","updated_at":"2025-10-16T12:22:47.8088-07:00"} -{"id":"bd-124","title":"stress_6","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.097331-07:00","updated_at":"2025-10-16T12:22:47.80919-07:00"} -{"id":"bd-125","title":"stress_19","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.098391-07:00","updated_at":"2025-10-16T12:22:47.809384-07:00"} -{"id":"bd-126","title":"stress_20","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.098827-07:00","updated_at":"2025-10-16T12:22:47.811138-07:00"} -{"id":"bd-127","title":"stress_15","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.099861-07:00","updated_at":"2025-10-16T12:22:47.812971-07:00"} -{"id":"bd-128","title":"stress_24","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.100328-07:00","updated_at":"2025-10-16T12:22:47.814201-07:00"} -{"id":"bd-129","title":"stress_18","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.100957-07:00","updated_at":"2025-10-16T12:22:47.815088-07:00"} -{"id":"bd-13","title":"Implement reference scoring algorithm","description":"Count references for each colliding issue: text mentions in descriptions/notes/design fields + dependency references. Sort collisions by score ascending (fewest refs first). This minimizes total updates during renumbering.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-12T14:40:56.204518-07:00","updated_at":"2025-10-16T12:22:47.815274-07:00","closed_at":"2025-10-12T16:26:46.572201-07:00","dependencies":[{"issue_id":"bd-13","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:41:07.951605-07:00","created_by":"stevey"}]} -{"id":"bd-130","title":"stress_22","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.101073-07:00","updated_at":"2025-10-16T12:22:47.815476-07:00"} -{"id":"bd-131","title":"stress_28","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.101635-07:00","updated_at":"2025-10-16T12:22:47.815678-07:00"} -{"id":"bd-132","title":"stress_25","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.101763-07:00","updated_at":"2025-10-16T12:22:47.815923-07:00"} -{"id":"bd-133","title":"stress_29","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.102151-07:00","updated_at":"2025-10-16T12:22:47.817247-07:00"} -{"id":"bd-134","title":"stress_26","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.102208-07:00","updated_at":"2025-10-16T12:22:47.817486-07:00"} -{"id":"bd-135","title":"stress_9","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.103216-07:00","updated_at":"2025-10-16T12:22:47.819185-07:00"} -{"id":"bd-136","title":"stress_30","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.103737-07:00","updated_at":"2025-10-16T12:22:47.823847-07:00"} -{"id":"bd-137","title":"stress_32","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.104085-07:00","updated_at":"2025-10-16T12:22:47.825646-07:00"} -{"id":"bd-138","title":"stress_16","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.104635-07:00","updated_at":"2025-10-16T12:22:47.825861-07:00"} -{"id":"bd-139","title":"stress_27","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.105136-07:00","updated_at":"2025-10-16T12:22:47.826081-07:00"} -{"id":"bd-14","title":"Implement ID remapping with reference updates","description":"Allocate new IDs for colliding issues. Update all text field references using word-boundary regex (\\bbd-10\\b). Update dependency records. Build id_mapping for reporting. Handle chain dependencies properly.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-12T14:40:56.367596-07:00","updated_at":"2025-10-16T12:22:47.826317-07:00","closed_at":"2025-10-12T16:35:13.159992-07:00","dependencies":[{"issue_id":"bd-14","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:41:07.956041-07:00","created_by":"stevey"}]} -{"id":"bd-140","title":"stress_31","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.105666-07:00","updated_at":"2025-10-16T12:22:47.826536-07:00"} -{"id":"bd-141","title":"stress_35","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.106196-07:00","updated_at":"2025-10-16T12:22:47.826726-07:00"} -{"id":"bd-142","title":"stress_37","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.106722-07:00","updated_at":"2025-10-16T12:22:47.826958-07:00"} -{"id":"bd-143","title":"stress_34","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.107203-07:00","updated_at":"2025-10-16T12:22:47.82717-07:00"} -{"id":"bd-144","title":"stress_36","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.108466-07:00","updated_at":"2025-10-16T12:22:47.827372-07:00"} -{"id":"bd-145","title":"stress_21","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.108868-07:00","updated_at":"2025-10-16T12:22:47.827559-07:00"} -{"id":"bd-146","title":"stress_38","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.109501-07:00","updated_at":"2025-10-16T12:22:47.827741-07:00"} -{"id":"bd-147","title":"stress_42","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.109907-07:00","updated_at":"2025-10-16T12:22:47.831936-07:00"} -{"id":"bd-148","title":"stress_43","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.109971-07:00","updated_at":"2025-10-16T12:22:47.834923-07:00"} -{"id":"bd-149","title":"stress_39","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.110079-07:00","updated_at":"2025-10-16T12:22:47.835528-07:00"} -{"id":"bd-15","title":"Add --resolve-collisions flag and user reporting","description":"Add import flags: --resolve-collisions (auto-fix) and --dry-run (preview). Display clear report: collisions detected, remappings applied (old→new with scores), reference counts updated. Default behavior: fail on collision (safe).","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-12T14:40:56.534721-07:00","updated_at":"2025-10-16T12:22:47.838946-07:00","closed_at":"2025-10-12T16:47:11.491645-07:00","dependencies":[{"issue_id":"bd-15","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:41:07.961157-07:00","created_by":"stevey"}]} -{"id":"bd-150","title":"stress_45","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.110194-07:00","updated_at":"2025-10-16T12:22:47.840732-07:00"} -{"id":"bd-151","title":"stress_46","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.110798-07:00","updated_at":"2025-10-16T12:22:47.840939-07:00"} -{"id":"bd-152","title":"stress_48","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.111726-07:00","updated_at":"2025-10-16T12:22:47.841157-07:00"} -{"id":"bd-153","title":"stress_44","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.111834-07:00","updated_at":"2025-10-16T12:22:47.84266-07:00"} -{"id":"bd-154","title":"stress_40","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.112308-07:00","updated_at":"2025-10-16T12:22:47.842843-07:00"} -{"id":"bd-155","title":"stress_41","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.113413-07:00","updated_at":"2025-10-16T12:22:47.843074-07:00"} -{"id":"bd-156","title":"stress_12","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.114106-07:00","updated_at":"2025-10-16T12:22:47.84379-07:00"} -{"id":"bd-157","title":"stress_47","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.114674-07:00","updated_at":"2025-10-16T12:22:47.843971-07:00"} -{"id":"bd-158","title":"stress_49","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.115792-07:00","updated_at":"2025-10-16T12:22:47.844313-07:00"} -{"id":"bd-159","title":"stress_50","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.115854-07:00","updated_at":"2025-10-16T12:22:47.844494-07:00"} -{"id":"bd-16","title":"Write comprehensive collision resolution tests","description":"Test cases: simple collision, multiple collisions, dependency updates, text reference updates, chain dependencies, edge cases (partial ID matches, case sensitivity, triple merges). Add to import_test.go and collision_test.go.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-12T14:40:56.702127-07:00","updated_at":"2025-10-16T12:22:47.844667-07:00","closed_at":"2025-10-12T16:54:25.273886-07:00","dependencies":[{"issue_id":"bd-16","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:41:07.965816-07:00","created_by":"stevey"}]} -{"id":"bd-160","title":"stress_33","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.117101-07:00","updated_at":"2025-10-16T12:22:47.846898-07:00"} -{"id":"bd-161","title":"stress_23","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.122506-07:00","updated_at":"2025-10-16T12:22:47.847105-07:00"} -{"id":"bd-162","title":"stress_11","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.13063-07:00","updated_at":"2025-10-16T12:22:47.847321-07:00"} -{"id":"bd-163","title":"stress_4","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.131872-07:00","updated_at":"2025-10-16T12:22:47.847594-07:00"} -{"id":"bd-164","title":"Add visual indicators for nodes with multiple parents in dep tree","description":"When a node appears in the dependency tree via multiple paths (diamond dependencies), add a visual indicator like (*) or (multiple parents) to help users understand the graph structure. This would make it clear when deduplication has occurred. Example: 'bd-503: Shared dependency (*) [P1] (open)'","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-14T03:10:49.222828-07:00","updated_at":"2025-10-16T12:22:47.848624-07:00","dependencies":[{"issue_id":"bd-164","depends_on_id":"bd-85","type":"discovered-from","created_at":"2025-10-14T03:11:00.326599-07:00","created_by":"stevey"}]} -{"id":"bd-165","title":"Add --show-all-paths flag to bd dep tree","description":"Currently bd dep tree deduplicates nodes when multiple paths exist (diamond dependencies). Add optional --show-all-paths flag to display the full graph with all paths, showing duplicates. Useful for debugging complex dependency structures and understanding all relationships.","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-14T03:10:50.337481-07:00","updated_at":"2025-10-16T12:22:47.850096-07:00","dependencies":[{"issue_id":"bd-165","depends_on_id":"bd-85","type":"discovered-from","created_at":"2025-10-14T03:11:00.3313-07:00","created_by":"stevey"}]} -{"id":"bd-166","title":"Make maxDepth configurable in bd dep tree command","description":"Currently maxDepth is hardcoded to 50 in GetDependencyTree. Add --max-depth flag to bd dep tree command to allow users to control recursion depth. Default should remain 50 for safety, but users with very deep trees or wanting shallow views should be able to configure it.","status":"open","priority":4,"issue_type":"feature","created_at":"2025-10-14T03:10:51.883256-07:00","updated_at":"2025-10-16T12:22:47.850382-07:00","dependencies":[{"issue_id":"bd-166","depends_on_id":"bd-85","type":"discovered-from","created_at":"2025-10-14T03:11:00.336267-07:00","created_by":"stevey"}]} -{"id":"bd-167","title":"Test issue with --deps flag","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T03:24:21.100585-07:00","updated_at":"2025-10-16T12:22:47.850583-07:00","closed_at":"2025-10-14T03:24:46.260976-07:00","dependencies":[{"issue_id":"bd-167","depends_on_id":"bd-343","type":"discovered-from","created_at":"2025-10-16T11:57:33.654976-07:00","created_by":"import-remap"},{"issue_id":"bd-167","depends_on_id":"bd-89","type":"discovered-from","created_at":"2025-10-16T11:57:33.876885-07:00","created_by":"import"}]} -{"id":"bd-168","title":"Another test with multiple deps","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:24:32.746757-07:00","updated_at":"2025-10-16T12:22:47.850789-07:00","closed_at":"2025-10-14T03:24:46.261275-07:00","dependencies":[{"issue_id":"bd-168","depends_on_id":"bd-90","type":"blocks","created_at":"2025-10-14T03:24:32.747181-07:00","created_by":"stevey"},{"issue_id":"bd-168","depends_on_id":"bd-343","type":"blocks","created_at":"2025-10-16T11:57:33.61424-07:00","created_by":"import-remap"},{"issue_id":"bd-168","depends_on_id":"bd-89","type":"blocks","created_at":"2025-10-16T11:57:33.877121-07:00","created_by":"import"}]} -{"id":"bd-169","title":"Fix: bd init --prefix test -q flag not recognized","description":"The init command doesn't recognize the -q flag. When running 'bd init --prefix test -q', it fails silently or behaves unexpectedly. The flag should either be implemented for quiet mode or removed from documentation if not supported.","status":"open","priority":2,"issue_type":"bug","created_at":"2025-10-14T12:33:51.614293-07:00","updated_at":"2025-10-16T12:22:47.856894-07:00"} -{"id":"bd-17","title":"Update documentation for collision resolution","description":"Update README.md with collision resolution section. Update CLAUDE.md with new workflow. Document --resolve-collisions and --dry-run flags. Add example scenarios showing branch merge workflows.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-12T14:40:56.866649-07:00","updated_at":"2025-10-16T12:22:47.857469-07:00","closed_at":"2025-10-12T17:06:14.930928-07:00","dependencies":[{"issue_id":"bd-17","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:41:07.970302-07:00","created_by":"stevey"}]} -{"id":"bd-170","title":"Add OAuth2 support","description":"Implement OAuth2 authentication flow with support for Google and GitHub providers.","design":"- Create OAuth2 provider interface\n- Implement Google provider\n- Implement GitHub provider\n- Add callback handler\n- Store tokens securely","acceptance_criteria":"- Users can authenticate with Google\n- Users can authenticate with GitHub\n- Tokens are stored securely in database\n- Token refresh works automatically","status":"closed","priority":1,"issue_type":"feature","assignee":"alice","created_at":"2025-10-14T12:40:30.990247-07:00","updated_at":"2025-10-16T12:22:47.857719-07:00","closed_at":"2025-10-14T12:40:50.292308-07:00","labels":["auth","high-priority","security"]} -{"id":"bd-171","title":"Add rate limiting to auth endpoints","description":"Auth endpoints are vulnerable to brute force attacks. Need to add rate limiting.","status":"closed","priority":0,"issue_type":"bug","assignee":"bob","created_at":"2025-10-14T12:40:30.996332-07:00","updated_at":"2025-10-16T12:22:47.857947-07:00","closed_at":"2025-10-14T12:40:50.293099-07:00","labels":["security","urgent"]} -{"id":"bd-172","title":"Improve session management","description":"Current session management is basic. Need to improve with better expiration handling.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T12:40:30.997104-07:00","updated_at":"2025-10-16T12:22:47.85815-07:00","closed_at":"2025-10-14T12:40:50.29329-07:00"} -{"id":"bd-173","title":"Refactor parseMarkdownFile to reduce cyclomatic complexity","description":"The parseMarkdownFile function in cmd/bd/markdown.go has a cyclomatic complexity of 38, which exceeds the recommended threshold of 30. This makes the function harder to understand, test, and maintain.","design":"Split the function into smaller, focused units:\n\n1. parseMarkdownFile(filepath) - Main entry point, handles file I/O\n2. parseMarkdownContent(scanner) - Core parsing logic\n3. processIssueSection(issue, section, content) - Handle section finalization (current switch statement)\n4. parseLabels(content) []string - Extract labels from content\n5. parseDependencies(content) []string - Extract dependencies from content\n6. parsePriority(content) int - Parse and validate priority\n\nBenefits:\n- Each function has a single responsibility\n- Easier to test individual components\n- Lower cognitive load when reading code\n- Better encapsulation of parsing logic","acceptance_criteria":"- parseMarkdownFile complexity \u003c 15\n- New helper functions each have complexity \u003c 10\n- All existing tests still pass\n- No change in functionality or behavior\n- Code coverage maintained or improved","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-14T12:51:21.241236-07:00","updated_at":"2025-10-16T12:22:47.858351-07:00","closed_at":"2025-10-14T12:55:35.140001-07:00","dependencies":[{"issue_id":"bd-173","depends_on_id":"bd-91","type":"discovered-from","created_at":"2025-10-14T12:51:21.24297-07:00","created_by":"stevey"}]} -{"id":"bd-174","title":"Add OAuth2 support","description":"Implement OAuth2 authentication flow with support for Google and GitHub providers.","design":"- Create OAuth2 provider interface\n- Implement Google provider\n- Implement GitHub provider\n- Add callback handler\n- Store tokens securely","acceptance_criteria":"- Users can authenticate with Google\n- Users can authenticate with GitHub\n- Tokens are stored securely in database\n- Token refresh works automatically","status":"closed","priority":1,"issue_type":"feature","assignee":"alice","created_at":"2025-10-14T12:55:09.226351-07:00","updated_at":"2025-10-16T12:22:47.858565-07:00","closed_at":"2025-10-14T12:55:17.818093-07:00","labels":["auth","high-priority","security"]} -{"id":"bd-175","title":"Add rate limiting to auth endpoints","description":"Auth endpoints are vulnerable to brute force attacks. Need to add rate limiting.","status":"closed","priority":0,"issue_type":"bug","assignee":"bob","created_at":"2025-10-14T12:55:09.228394-07:00","updated_at":"2025-10-16T12:22:47.858744-07:00","closed_at":"2025-10-14T12:55:17.819352-07:00","labels":["security","urgent"]} -{"id":"bd-176","title":"Improve session management","description":"Current session management is basic. Need to improve with better expiration handling.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T12:55:09.228919-07:00","updated_at":"2025-10-16T12:22:47.862385-07:00","closed_at":"2025-10-14T12:55:17.819557-07:00"} -{"id":"bd-177","title":"Add OAuth2 support","description":"Implement OAuth2 authentication flow with support for Google and GitHub providers.","design":"- Create OAuth2 provider interface\n- Implement Google provider\n- Implement GitHub provider\n- Add callback handler\n- Store tokens securely","acceptance_criteria":"- Users can authenticate with Google\n- Users can authenticate with GitHub\n- Tokens are stored securely in database\n- Token refresh works automatically","status":"closed","priority":1,"issue_type":"feature","assignee":"alice","created_at":"2025-10-14T13:01:35.935497-07:00","updated_at":"2025-10-16T12:22:47.862634-07:00","closed_at":"2025-10-14T13:01:35.950067-07:00","labels":["auth","high-priority","security"]} -{"id":"bd-178","title":"Add rate limiting to auth endpoints","description":"Auth endpoints are vulnerable to brute force attacks. Need to add rate limiting.","status":"closed","priority":0,"issue_type":"bug","assignee":"bob","created_at":"2025-10-14T13:01:35.937662-07:00","updated_at":"2025-10-16T12:22:47.863254-07:00","closed_at":"2025-10-14T13:01:35.950387-07:00","labels":["security","urgent"]} -{"id":"bd-179","title":"Improve session management","description":"Current session management is basic. Need to improve with better expiration handling.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T13:01:35.93812-07:00","updated_at":"2025-10-16T12:22:47.863941-07:00","closed_at":"2025-10-14T13:01:35.950517-07:00"} -{"id":"bd-18","title":"Add design/notes/acceptance_criteria fields to update command","description":"Currently bd update only supports status, priority, title, assignee. Add support for --design, --notes, --acceptance-criteria flags. This makes it easier to add detailed designs to issues after creation.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-12T14:40:57.032395-07:00","updated_at":"2025-10-16T12:22:47.864461-07:00","closed_at":"2025-10-12T17:10:53.958318-07:00"} -{"id":"bd-180","title":"Investigate vector/semantic search for issue discovery","description":"From GH issue #2 RFC discussion: Evaluate if vector/semantic search over issues would provide value for beads.\n\n**Use case:** Find semantically related issues (e.g., 'login broken' finds 'authentication failure', 'session expired').\n\n**Questions to answer:**\n1. What workflows would this enable that we can't do now?\n2. Is dataset size (typically 50-200 issues) large enough to benefit?\n3. Do structured features (deps, tags, types) already provide better relationships?\n4. What's the maintenance cost (embeddings, storage, recomputation)?\n\n**Alternatives to consider:**\n- Improve 'bd list' filtering with regex/boolean queries\n- Add 'bd related \u003cid\u003e' showing deps + mentions + same tags\n- Export to JSON and pipe to external AI tools\n\n**Decision:** Only implement if clear use case emerges. Don't add complexity for theoretical benefits.\n\n**Context:** Part of evaluating Turso RFC ideas (GH #2). Vector search was proposed but unclear if needed for typical beads usage.","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T14:16:51.769118-07:00","updated_at":"2025-10-16T12:22:47.86466-07:00"} -{"id":"bd-181","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":"open","priority":2,"issue_type":"feature","created_at":"2025-10-14T14:20:38.678143-07:00","updated_at":"2025-10-16T12:22:47.864835-07:00"} -{"id":"bd-182","title":"Investigate auto-export debounce not triggering","description":"Auto-export to JSONL did not trigger automatically after creating bd-180 and bd-181. 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-180 and bd-181 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-180 and bd-181.","notes":"**Investigation Results:**\n\nThe auto-export feature IS working correctly in the current codebase (v0.9.5). Testing shows:\n\n✅ Storage layer marks issues dirty correctly (lines 415-423, 593-601, 633-641 in sqlite.go)\n✅ CLI calls markDirtyAndScheduleFlush() after CRUD operations (lines 766, 1000, 1055 in main.go)\n✅ Debounce timer (5s) triggers and exports to JSONL successfully\n✅ Tested: Created bd-196, auto-exported within 6 seconds\n\n**Root Cause:**\nThe issue was caused by running an **old bd binary** that didn't have the complete auto-export implementation. After rebuilding (`go build -o bd ./cmd/bd`), auto-export works perfectly.\n\n**Resolution:**\nUsers experiencing this issue need to:\n1. Rebuild bd: `go build -o bd ./cmd/bd`\n2. Install updated binary: `sudo mv bd /usr/local/bin/` (or appropriate path)\n3. Verify: `bd version` should show 0.9.5+\n\n**Additional Notes:**\n- Auto-export uses 5-second debounce (configurable at main.go:36)\n- Exports are atomic (writes to .tmp, then renames)\n- Only dirty issues are exported (incremental updates)\n- Works correctly in production use\n\n**Follow-up:**\nConsider adding a version check warning if user's binary is outdated (bd-408).","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-14T14:25:22.256823-07:00","updated_at":"2025-10-16T12:22:47.865027-07:00","closed_at":"2025-10-16T11:01:26.847829-07:00"} -{"id":"bd-183","title":"Plugin manifest has invalid 'engines' field causing marketplace install failure","description":"The plugin.json manifest includes an 'engines' field that Claude Code doesn't recognize. This causes the plugin to fail validation when installed via /plugin marketplace add.\n\nError: Plugin beads has an invalid manifest file at .claude-plugin/plugin.json. Validation errors: : Unrecognized key(s) in object: 'engines'\n\nFix: Remove the 'engines' field from plugin.json\n\nThe engines field was added to specify minimum beads version requirements, but Claude Code's plugin manifest schema doesn't support it. We should document version requirements in PLUGIN.md instead.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-14T17:11:11.515979-07:00","updated_at":"2025-10-16T12:22:47.865224-07:00","closed_at":"2025-10-16T11:01:26.847981-07:00"} -{"id":"bd-184","title":"race_test_4","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.39436-07:00","updated_at":"2025-10-16T12:22:47.865441-07:00"} -{"id":"bd-185","title":"race_test_8","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.396837-07:00","updated_at":"2025-10-16T12:22:47.86563-07:00"} -{"id":"bd-186","title":"race_test_5","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.398506-07:00","updated_at":"2025-10-16T12:22:47.866556-07:00"} -{"id":"bd-187","title":"race_test_16","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.40014-07:00","updated_at":"2025-10-16T12:22:47.866717-07:00"} -{"id":"bd-188","title":"race_test_17","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.402127-07:00","updated_at":"2025-10-16T12:22:47.866891-07:00"} -{"id":"bd-189","title":"race_test_10","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.403758-07:00","updated_at":"2025-10-16T12:22:47.867212-07:00"} -{"id":"bd-19","title":"Fix import zero-value field handling","description":"Import uses zero-value checks (Priority != 0) to determine field updates. This prevents setting priority to 0 or clearing string fields. Export/import round-trip not fully idempotent for zero values. Consider JSON presence detection or explicit preserve-existing semantics. Location: cmd/bd/import.go:95-106","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-10-12T15:13:17.895083-07:00","updated_at":"2025-10-16T12:22:47.867524-07:00","closed_at":"2025-10-16T11:01:26.848131-07:00"} -{"id":"bd-190","title":"race_test_11","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.460348-07:00","updated_at":"2025-10-16T12:22:47.86805-07:00"} -{"id":"bd-191","title":"final_test_10","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:44:09.846149-07:00","updated_at":"2025-10-16T12:22:47.868971-07:00"} -{"id":"bd-192","title":"final_test_7","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:44:09.8493-07:00","updated_at":"2025-10-16T12:22:47.869142-07:00"} -{"id":"bd-193","title":"stress_test_5","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:44:27.558376-07:00","updated_at":"2025-10-16T12:22:47.86931-07:00"} -{"id":"bd-194","title":"stress_test_6","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:44:27.565808-07:00","updated_at":"2025-10-16T12:22:47.869532-07:00"} -{"id":"bd-195","title":"stress_test_1","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:44:27.614965-07:00","updated_at":"2025-10-16T12:22:47.869737-07:00"} -{"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:22:47.87094-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:22:47.873033-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:22:47.873244-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:22:47.873432-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:22:47.873602-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:22:47.873824-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:22:47.874023-07:00","closed_at":"2025-10-16T11:01:26.848815-07:00"} -{"id":"bd-201","title":"race_test_5","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.856079-07:00","updated_at":"2025-10-16T12:22:47.874186-07:00","closed_at":"2025-10-16T11:01:26.856079-07:00"} -{"id":"bd-202","title":"race_test_2","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.856235-07:00","updated_at":"2025-10-16T12:22:47.874484-07:00","closed_at":"2025-10-16T11:01:26.856235-07:00"} -{"id":"bd-203","title":"race_test_7","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.856357-07:00","updated_at":"2025-10-16T12:22:47.874665-07:00","closed_at":"2025-10-16T11:01:26.856357-07:00"} -{"id":"bd-204","title":"race_test_14","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.856652-07:00","updated_at":"2025-10-16T12:22:47.874833-07:00","closed_at":"2025-10-16T11:01:26.856652-07:00"} -{"id":"bd-205","title":"race_test_9","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.856856-07:00","updated_at":"2025-10-16T12:22:47.874991-07:00","closed_at":"2025-10-16T11:01:26.856856-07:00"} -{"id":"bd-206","title":"race_test_8","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.857005-07:00","updated_at":"2025-10-16T12:22:47.875214-07:00","closed_at":"2025-10-16T11:01:26.857005-07:00"} -{"id":"bd-207","title":"race_test_11","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.85717-07:00","updated_at":"2025-10-16T12:22:47.87536-07:00","closed_at":"2025-10-16T11:01:26.85717-07:00"} -{"id":"bd-208","title":"race_test_19","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.857304-07:00","updated_at":"2025-10-16T12:22:47.875542-07:00","closed_at":"2025-10-16T11:01:26.857304-07:00"} -{"id":"bd-209","title":"race_test_16","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.857433-07:00","updated_at":"2025-10-16T12:22:47.875683-07:00","closed_at":"2025-10-16T11:01:26.857433-07:00"} -{"id":"bd-21","title":"Simplify getNextID SQL query parameters","description":"Query passes prefix four times to same SQL query. Works but fragile if query changes. Consider simplifying SQL to require fewer parameters. Location: internal/storage/sqlite/sqlite.go:73-78","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-12T15:13:20.114733-07:00","updated_at":"2025-10-16T12:22:47.875822-07:00","closed_at":"2025-10-16T11:01:26.857598-07:00"} -{"id":"bd-210","title":"race_test_18","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.857722-07:00","updated_at":"2025-10-16T12:22:47.875959-07:00","closed_at":"2025-10-16T11:01:26.857722-07:00"} -{"id":"bd-211","title":"race_test_20","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.857845-07:00","updated_at":"2025-10-16T12:22:47.876098-07:00","closed_at":"2025-10-16T11:01:26.857845-07:00"} -{"id":"bd-212","title":"race_test_6","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.857966-07:00","updated_at":"2025-10-16T12:22:47.876253-07:00","closed_at":"2025-10-16T11:01:26.857966-07:00"} -{"id":"bd-213","title":"race_test_3","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858079-07:00","updated_at":"2025-10-16T12:22:47.876419-07:00","closed_at":"2025-10-16T11:01:26.858079-07:00"} -{"id":"bd-214","title":"race_test_12","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858197-07:00","updated_at":"2025-10-16T12:22:47.876553-07:00","closed_at":"2025-10-16T11:01:26.858197-07:00"} -{"id":"bd-215","title":"race_test_15","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858316-07:00","updated_at":"2025-10-16T12:22:47.876695-07:00","closed_at":"2025-10-16T11:01:26.858316-07:00"} -{"id":"bd-216","title":"race_test_13","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858454-07:00","updated_at":"2025-10-16T12:22:47.876824-07:00","closed_at":"2025-10-16T11:01:26.858454-07:00"} -{"id":"bd-217","title":"race_test_10","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858572-07:00","updated_at":"2025-10-16T12:22:47.876952-07:00","closed_at":"2025-10-16T11:01:26.858572-07:00"} -{"id":"bd-218","title":"race_test_17","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858681-07:00","updated_at":"2025-10-16T12:22:47.87709-07:00","closed_at":"2025-10-16T11:01:26.858681-07:00"} -{"id":"bd-219","title":"verification_","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858794-07:00","updated_at":"2025-10-16T12:22:47.87724-07:00","closed_at":"2025-10-16T11:01:26.858794-07:00"} -{"id":"bd-22","title":"Add validation/warning for malformed issue IDs","description":"getNextID silently ignores non-numeric ID suffixes (e.g., bd-foo). CAST returns NULL for invalid strings. Consider detecting and warning about malformed IDs in database. Location: internal/storage/sqlite/sqlite.go:79-82","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-12T15:13:21.195975-07:00","updated_at":"2025-10-16T12:22:47.877404-07:00","closed_at":"2025-10-16T11:01:26.860645-07:00"} -{"id":"bd-220","title":"final_review_test_","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.860777-07:00","updated_at":"2025-10-16T12:22:47.877567-07:00","closed_at":"2025-10-16T11:01:26.860777-07:00"} -{"id":"bd-221","title":"P0: Transaction state corruption in first fix attempt","description":"First attempt at fixing bd-89 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: database/sql connection pooling. Without acquiring a dedicated connection, subsequent queries could use different connections from the pool, breaking the transaction.\n\nCorrect fix: 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.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-16T11:01:26.860927-07:00","updated_at":"2025-10-16T12:22:47.877761-07:00","closed_at":"2025-10-16T11:01:26.860927-07:00"} -{"id":"bd-222","title":"P2: Consider batching API for bulk issue creation","description":"Current CreateIssue acquires a dedicated connection for each call. For bulk imports or agent workflows creating many issues, a batched API could improve performance:\n\nCreateIssues(ctx, issues []*Issue, actor string) error\n\nThis would:\n- Acquire one connection\n- Use one IMMEDIATE transaction\n- Insert all issues atomically\n- Reduce connection overhead\n\nNot urgent - current approach is correct and fast enough for typical use.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.861059-07:00","updated_at":"2025-10-16T12:22:47.877971-07:00","closed_at":"2025-10-16T11:01:26.861059-07:00"} -{"id":"bd-223","title":"P3: Consider early context check in CreateIssue","description":"CreateIssue starts an IMMEDIATE transaction before checking if context is cancelled. If a client cancels early, we've already acquired the write lock.\n\nConsider adding:\n if err := ctx.Err(); err != nil {\n return err\n }\n\nBetween validation (line 318) and acquiring connection (line 331).\n\nLow priority - the busy_timeout and deferred cleanup handle this gracefully, but an early check would be slightly more efficient.","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-16T11:01:26.861599-07:00","updated_at":"2025-10-16T12:22:47.878133-07:00"} -{"id":"bd-224","title":"Data model allows inconsistent status/closed_at states","description":"Issue bd-89 demonstrates a data model inconsistency: an issue can have status='open' but also have a closed_at timestamp set. This creates a liminal state that violates the expected invariant that closed_at should only be set when status='closed'.\n\nRoot causes:\n1. Import (bd import) updates status field independently from closed_at field\n2. UpdateIssue allows status changes without managing closed_at\n3. No database constraint enforcing the invariant\n4. Export includes both fields independently in JSONL\n\nCurrent behavior:\n- bd close: Sets status='closed' AND closed_at (correct)\n- bd update --status open: Sets status='open' but leaves closed_at unchanged (creates inconsistency)\n- bd import: Can import inconsistent data from JSONL\n\nImpact:\n- 'bd ready' shows issues that appear closed (have closed_at)\n- Confusing for users and downstream tools\n- Stats may be inaccurate\n\nPotential solutions:\nA) Add CHECK constraint: (status = 'closed') = (closed_at IS NOT NULL)\nB) Update import/update logic to enforce invariant in application code\nC) Add a 'reopened' event that explicitly clears closed_at\nD) Remove closed_at field entirely (calculate from events or use status only)\n\nSee bd-89 for concrete example.","notes":"Label management fully implemented with comprehensive test coverage (10 test cases). Provides foundation for better data organization and filtering.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-16T11:01:26.861757-07:00","updated_at":"2025-10-16T12:22:47.878346-07:00","closed_at":"2025-10-16T11:01:26.861757-07:00","dependencies":[{"issue_id":"bd-224","depends_on_id":"bd-222","type":"blocks","created_at":"2025-10-16T11:01:27.051703-07:00","created_by":"auto-import"}]} -{"id":"bd-225","title":"Ultrathink: Choose solution for status/closed_at inconsistency (bd-224)","description":"Deep analysis of solution options for bd-224 data model inconsistency issue.\n\nContext:\n- Target users: individual devs and small teams\n- Future: swarms of agent workers\n- Brand-new codebase with few users (can break things)\n- Issue: status='open' with closed_at!=NULL creates liminal state\n\nOptions to evaluate:\nA) Database CHECK constraint\nB) Application-level enforcement \nC) Add explicit reopened event\nD) Remove closed_at field entirely\n\nAnalysis framework:\n1. Simplicity (mental model for devs)\n2. Robustness (hard to break, especially for agent swarms)\n3. Migration cost (schema changes, data cleanup)\n4. Future extensibility\n5. Performance\n6. Consistency guarantees\n\nNeed to determine best approach given tradeoffs.","notes":"Analysis complete. Recommendation: Hybrid approach with DB CHECK constraint + smart UpdateIssue + import enforcement + reopen command.\n\nKey insights:\n- DB constraint provides defense-in-depth perfect for agent swarms\n- Statistics calculation currently uses 'closed_at IS NOT NULL' which is BROKEN by inconsistent data\n- UpdateIssue and Import don't manage the invariant\n- EventReopened exists but is unused\n\nSee ULTRATHINK_BD224.md for full analysis.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.862544-07:00","updated_at":"2025-10-16T12:22:47.878515-07:00","closed_at":"2025-10-16T11:01:26.862544-07:00","dependencies":[{"issue_id":"bd-225","depends_on_id":"bd-224","type":"discovered-from","created_at":"2025-10-16T11:01:27.051946-07:00","created_by":"auto-import"}]} -{"id":"bd-226","title":"Epic: Fix status/closed_at inconsistency (bd-224 solution)","description":"Implement hybrid solution to enforce status/closed_at invariant:\n- Database CHECK constraint\n- Smart UpdateIssue logic\n- Import enforcement\n- Reopen command\n\nThis is a data integrity issue that affects statistics and will cause problems for agent swarms. The hybrid approach provides defense-in-depth.\n\nSee ULTRATHINK_BD224.md for full analysis and rationale.\n\nParent of all implementation tasks for this fix.","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-10-16T11:01:26.862695-07:00","updated_at":"2025-10-16T12:22:47.878716-07:00","closed_at":"2025-10-16T11:01:26.862695-07:00"} -{"id":"bd-227","title":"Audit and document all inconsistent issues in database","description":"Before we add the constraint, we need to know what data is inconsistent.\n\nSteps:\n1. Query database for status/closed_at mismatches\n2. Document each case (how many, which issues, patterns)\n3. Decide on cleanup strategy (trust status vs trust closed_at)\n4. Create SQL script for cleanup\n\nOutput: Document with counts and cleanup SQL ready to review.\n\nThis unblocks the migration work.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.862818-07:00","updated_at":"2025-10-16T12:22:47.878916-07:00","closed_at":"2025-10-16T11:01:26.862818-07:00","dependencies":[{"issue_id":"bd-227","depends_on_id":"bd-226","type":"parent-child","created_at":"2025-10-16T11:01:27.052119-07:00","created_by":"auto-import"}]} -{"id":"bd-228","title":"Critical: Auto-import silently overwrites local changes without collision detection","description":"## Problem\n\nAuto-import is silently overwriting local changes when pulling from Git, without using collision detection or warning the user.\n\n## Evidence\n\nIssue bd-89 timeline:\n1. 08:07:31 - Manual update: set status=in_progress\n2. 08:13:08 - Manual close: set status=closed, closed_at set\n3. 08:33:25 - **Auto-import silently overwrote to status=open** (discarded local change)\n4. 08:57:59 - Auto-import overwrote again\n5. 08:58:30 - Auto-import overwrote again\n\nQuery shows 10+ issues with multiple auto-import overwrites, including bd-198, bd-199, bd-200-206.\n\n## Root Cause Hypothesis\n\nWhen two clones both modify issue N:\n- Clone A: modifies bd-89, exports to JSONL, commits\n- Clone B: also modifies bd-89 differently, pulls from A\n- Auto-import uses UpdateIssue which **unconditionally overwrites**\n- Clone B's local changes are silently lost\n- No collision detection warning\n- References and work context corrupted\n\n## Impact\n\n- **Data loss**: Local changes silently discarded\n- **Corruption**: Issue state doesn't reflect actual work done\n- **Lost references**: Comments/deps referencing lost state are now wrong\n- **Trust**: Can't trust the database reflects reality\n- **Agent swarms**: Catastrophic for parallel workers\n\n## Expected Behavior\n\nAuto-import should:\n1. Detect collisions (same ID, different content)\n2. Warn user or fail import\n3. Offer resolution options (--resolve-collisions)\n4. Never silently overwrite without user confirmation\n\n## Current Behavior\n\nAuto-import silently overwrites using UpdateIssue, no collision detection.\n\n## Reproduction\n\n1. Clone A: bd update bd-1 --status in_progress\n2. Clone A: git add .beads/issues.jsonl \u0026\u0026 git commit \u0026\u0026 git push\n3. Clone B: bd update bd-1 --status closed \n4. Clone B: git pull (triggers auto-import)\n5. Result: bd-1 status silently reverted to in_progress, closed state lost\n\n## Files Involved\n\n- cmd/bd/main.go: auto-import trigger logic\n- cmd/bd/import.go: import without collision detection\n- internal/storage/sqlite/sqlite.go: UpdateIssue unconditionally overwrites","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-16T11:01:26.86787-07:00","updated_at":"2025-10-16T12:22:47.87912-07:00","closed_at":"2025-10-16T11:01:26.86787-07:00"} -{"id":"bd-229","title":"Investigate data recovery for issues overwritten by auto-import bug","description":"Auto-import bug (bd-228) has been silently overwriting local changes since the feature was introduced. We need to investigate if any important data was lost and if it can be recovered.\n\n## Data Sources for Recovery\n\n1. **Git history of .beads/issues.jsonl** - May contain older versions with lost changes\n2. **Events table** - Has full audit trail with old_value/new_value\n3. **Commit messages** - May reference work that was done but later overwritten\n\n## Investigation Steps\n\n1. Check events table for patterns:\n - Look for auto-import events that changed status from closed → open\n - Look for manual updates followed by auto-import reverts\n - Identify issues with suspicious event sequences\n\n2. Git archaeology:\n - Check git log for .beads/issues.jsonl\n - Look for commits where status=closed was changed to status=open\n - Compare git history vs current database state\n\n3. Document lost work:\n - Create list of issues that were closed but reverted to open\n - Identify any critical work that was marked done but lost\n - Check if any issue references are now broken\n\n## Recovery Actions\n\nIf significant data loss is found:\n- Create script to reconstruct lost state from events table\n- Manually review and restore critical closed issues\n- Document lessons learned for preventing future data loss\n\n## Example Query\n\n```sql\n-- Find issues where status was manually changed then reverted by auto-import\nSELECT \n issue_id,\n GROUP_CONCAT(event_type || ':' || actor, ' -\u003e ') as event_chain\nFROM events \nWHERE issue_id IN (\n SELECT DISTINCT issue_id \n FROM events \n WHERE actor = 'auto-import' AND event_type = 'status_changed'\n)\nGROUP BY issue_id\nHAVING event_chain LIKE '%stevey%auto-import%';\n```","notes":"Investigation complete. Successfully recovered 3 valuable issues (bd-232, bd-233) from 22 total lost. Historical context preserved in bd-89 notes. Auto-import collision detection (bd-228) now prevents future data loss.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.868107-07:00","updated_at":"2025-10-16T12:22:47.879304-07:00","closed_at":"2025-10-16T11:01:26.868107-07:00","dependencies":[{"issue_id":"bd-229","depends_on_id":"bd-228","type":"discovered-from","created_at":"2025-10-16T11:01:27.052302-07:00","created_by":"auto-import"}]} -{"id":"bd-23","title":"Optimize export dependency queries (N+1 problem)","description":"Export triggers separate GetDependencyRecords() per issue. For large DBs (1000+ issues), this is N+1 queries. Add GetAllDependencyRecords() to fetch all dependencies in one query. Location: cmd/bd/export.go:52-59, import.go:138-142","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-12T15:13:22.325113-07:00","updated_at":"2025-10-16T12:22:47.879476-07:00","closed_at":"2025-10-16T11:01:26.868262-07:00"} -{"id":"bd-230","title":"Code review: Auto-import collision detection fix (bd-228)","description":"Request thorough code review of the auto-import collision detection implementation.\n\n## Files Changed\n- cmd/bd/main.go: autoImportIfNewer() and new autoImportWithoutCollisionDetection()\n\n## Review Focus Areas\n\n### 1. Correctness\n- Does collision detection properly identify conflicts?\n- Are colliding issues correctly filtered from import?\n- Is the fallback function correct for non-SQLite backends?\n\n### 2. Edge Cases\n- What happens if DetectCollisions() fails?\n- What if all issues are collisions?\n- What if JSONL is malformed?\n- Race conditions with concurrent auto-imports?\n\n### 3. User Experience\n- Is the warning message clear and actionable?\n- Should we log to a file instead of/in addition to stderr?\n- Should there be a --auto-resolve flag?\n\n### 4. Performance\n- Does collision detection add significant latency?\n- Will this work with 1000+ issues?\n- Any unnecessary N+1 queries?\n\n### 5. Testing Gaps\n- Do we need integration tests for collision scenarios?\n- Should we test the warning output?\n- Test autoImportWithoutCollisionDetection() fallback?\n\n## Questions for Reviewer\n1. Should auto-import be more aggressive (auto-resolve) or more conservative (fail)?\n2. Should we add a counter for how many times collisions occurred?\n3. Should there be a config option to disable collision detection?\n4. Is the warning too verbose for typical workflows?\n\n## Current Behavior\n- Skips colliding issues (preserves local)\n- Prints warning to stderr\n- Suggests manual resolution command\n- Continues with non-colliding issues","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.868389-07:00","updated_at":"2025-10-16T12:22:47.879677-07:00","closed_at":"2025-10-16T11:01:26.868389-07:00","dependencies":[{"issue_id":"bd-230","depends_on_id":"bd-228","type":"discovered-from","created_at":"2025-10-16T11:01:27.052524-07:00","created_by":"auto-import"}]} -{"id":"bd-231","title":"Add integration tests for auto-import collision detection","description":"The auto-import collision detection fix (bd-228) needs comprehensive integration tests.\n\n## Test Scenarios Needed\n\n### 1. Basic Collision Detection\n```go\nTestAutoImportWithCollisions\n- Setup: Create issue in DB with status=closed\n- Simulate: Git pull with JSONL containing same issue with status=open\n- Verify: Local changes preserved, warning printed, issue still closed\n```\n\n### 2. Multiple Collisions\n```go\nTestAutoImportWithMultipleCollisions\n- Setup: 5 issues with local modifications\n- Simulate: JSONL with 3 colliding, 2 matching\n- Verify: 3 skipped, 2 updated, appropriate warnings\n```\n\n### 3. No Collisions (Happy Path)\n```go\nTestAutoImportWithoutCollisions\n- Setup: Clean database\n- Simulate: JSONL with new issues + exact matches\n- Verify: All imported successfully, no warnings\n```\n\n### 4. All Collisions\n```go\nTestAutoImportAllCollisions\n- Setup: Every issue has local modifications\n- Simulate: JSONL with conflicting versions\n- Verify: All skipped, warning lists all issues\n```\n\n### 5. Collision Detection Failure\n```go\nTestAutoImportCollisionDetectionError\n- Setup: Mock DetectCollisions() to return error\n- Verify: Import skipped entirely (safe failure mode)\n```\n\n### 6. Hash-Based Skip\n```go\nTestAutoImportHashUnchanged\n- Setup: JSONL hash matches last_import_hash\n- Verify: No collision detection runs, fast path\n```\n\n### 7. Fallback for Non-SQLite\n```go\nTestAutoImportWithoutCollisionDetection\n- Setup: Mock non-SQLite storage backend\n- Verify: Falls back to old behavior, no collision detection\n```\n\n## Test Infrastructure Needed\n\n1. **Helper functions:**\n - createTestDBWithIssues()\n - writeJSONLFile()\n - captureStderrWarnings()\n - simulateGitPull()\n\n2. **Fixtures:**\n - sample-collisions.jsonl\n - sample-exact-matches.jsonl\n - sample-mixed.jsonl\n\n3. **Assertions:**\n - assertIssueState(id, expectedStatus)\n - assertWarningContains(text)\n - assertCollisionCount(n)\n\n## Acceptance Criteria\n- All 7 test scenarios implemented\n- Tests pass consistently\n- Code coverage \u003e80% for autoImportIfNewer()\n- Tests run in \u003c5 seconds total\n- Clear test names and documentation","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.876585-07:00","updated_at":"2025-10-16T12:22:47.879937-07:00","closed_at":"2025-10-16T11:01:26.876585-07:00","dependencies":[{"issue_id":"bd-231","depends_on_id":"bd-230","type":"blocks","created_at":"2025-10-16T11:01:27.053027-07:00","created_by":"auto-import"}]} -{"id":"bd-232","title":"Consider batching API for bulk issue creation (recovered from bd-222)","description":"Current CreateIssue acquires a dedicated connection for each call. For bulk imports or agent workflows creating many issues, a batched API could improve performance:\n\nCreateIssues(ctx, issues []*Issue, actor string) error\n\nThis would:\n- Acquire one connection\n- Use one IMMEDIATE transaction\n- Insert all issues atomically\n- Reduce connection overhead\n\nNot urgent - current approach is correct and fast enough for typical use.\n\n**Recovered from:** bd-222 (lost in auto-import bug, see LOST_ISSUES_RECOVERY.md)","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.876727-07:00","updated_at":"2025-10-16T12:22:47.880086-07:00","closed_at":"2025-10-16T11:01:26.876727-07:00"} -{"id":"bd-233","title":"Consider early context check in CreateIssue (recovered from bd-223)","description":"CreateIssue starts an IMMEDIATE transaction before checking if context is cancelled. If a client cancels early, we've already acquired the write lock.\n\nConsider adding:\n if err := ctx.Err(); err != nil {\n return err\n }\n\nBetween validation (line 318) and acquiring connection (line 331).\n\nLow priority - the busy_timeout and deferred cleanup handle this gracefully, but an early check would be slightly more efficient.\n\n**Recovered from:** bd-223 (lost in auto-import bug, see LOST_ISSUES_RECOVERY.md)","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-16T11:01:26.876857-07:00","updated_at":"2025-10-16T12:22:47.88022-07:00"} -{"id":"bd-234","title":"Add database CHECK constraint for status/closed_at invariant","description":"Add database-level constraint to enforce: (status = 'closed') = (closed_at IS NOT NULL)\n\nPrerequisites: Clean existing inconsistent data first\n\nChanges:\n- Add migration to schema.go\n- Constraint prevents ANY code path from creating inconsistent state\n- Foundation for robust agent-proof system","design":"Migration SQL:\n```sql\n-- First clean up existing inconsistent data\nUPDATE issues SET closed_at = NULL\nWHERE status != 'closed' AND closed_at IS NOT NULL;\n\nUPDATE issues SET closed_at = CURRENT_TIMESTAMP\nWHERE status = 'closed' AND closed_at IS NULL;\n\n-- Add the constraint\nALTER TABLE issues ADD CONSTRAINT chk_closed_at_status\n CHECK ((status = 'closed') = (closed_at IS NOT NULL));\n```\n\nImplementation in schema.go migrations.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.87698-07:00","updated_at":"2025-10-16T12:22:47.880352-07:00","closed_at":"2025-10-16T11:01:26.87698-07:00","dependencies":[{"issue_id":"bd-234","depends_on_id":"bd-224","type":"parent-child","created_at":"2025-10-16T11:01:27.053276-07:00","created_by":"auto-import"},{"issue_id":"bd-234","depends_on_id":"bd-237","type":"blocks","created_at":"2025-10-16T11:01:27.053481-07:00","created_by":"auto-import"}]} -{"id":"bd-235","title":"Add 'bd reopen' command for explicit issue reopening","description":"Create cmd/bd/reopen.go with explicit reopen command that:\n- Sets status to 'open'\n- Automatically clears closed_at (via UpdateIssue)\n- Emits EventReopened\n- Optional --reason flag for explanation\n\nMakes reopening more explicit than 'bd update --status open'","design":"```go\nvar reopenCmd = \u0026cobra.Command{\n Use: \"reopen [id...]\",\n Short: \"Reopen one or more closed issues\",\n Args: cobra.MinimumNArgs(1),\n Run: func(cmd *cobra.Command, args []string) {\n ctx := context.Background()\n reason, _ := cmd.Flags().GetString(\"reason\")\n \n for _, id := range args {\n updates := map[string]interface{}{\n \"status\": \"open\",\n }\n if err := store.UpdateIssue(ctx, id, updates, getUser()); err != nil {\n fmt.Fprintf(os.Stderr, \"Error reopening %s: %v\\n\", id, err)\n continue\n }\n \n if reason != \"\" {\n store.AddComment(ctx, id, getUser(), reason)\n }\n }\n \n markDirtyAndScheduleFlush()\n },\n}\n```","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.877112-07:00","updated_at":"2025-10-16T12:22:47.880541-07:00","closed_at":"2025-10-16T11:01:26.877112-07:00","dependencies":[{"issue_id":"bd-235","depends_on_id":"bd-224","type":"parent-child","created_at":"2025-10-16T11:01:27.053705-07:00","created_by":"auto-import"}]} -{"id":"bd-236","title":"Add tests for status/closed_at invariant enforcement","description":"Comprehensive test suite for bd-224 invariant:\n- Test DB constraint rejects bad data\n- Test UpdateIssue auto-manages closed_at\n- Test Import normalizes data correctly\n- Test reopen command clears closed_at\n- Test Issue.Validate() catches errors","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.87725-07:00","updated_at":"2025-10-16T12:22:47.880743-07:00","closed_at":"2025-10-16T11:01:26.87725-07:00","dependencies":[{"issue_id":"bd-236","depends_on_id":"bd-224","type":"parent-child","created_at":"2025-10-16T11:01:27.053882-07:00","created_by":"auto-import"}]} -{"id":"bd-237","title":"Add Issue.Validate() closed_at invariant check","description":"Add validation logic to types.Issue.Validate() to check closed_at invariant before database operations.\n\nThis provides application-level validation that complements the database constraint.","design":"```go\nfunc (i *Issue) Validate() error {\n // ... existing validation ...\n\n // Enforce closed_at invariant (bd-224)\n if i.Status == StatusClosed \u0026\u0026 i.ClosedAt == nil {\n return fmt.Errorf(\"closed issues must have closed_at timestamp\")\n }\n if i.Status != StatusClosed \u0026\u0026 i.ClosedAt != nil {\n return fmt.Errorf(\"non-closed issues cannot have closed_at timestamp\")\n }\n\n return nil\n}\n```","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.877702-07:00","updated_at":"2025-10-16T12:22:47.880943-07:00","closed_at":"2025-10-16T11:01:26.877702-07:00","dependencies":[{"issue_id":"bd-237","depends_on_id":"bd-224","type":"parent-child","created_at":"2025-10-16T11:01:27.054054-07:00","created_by":"auto-import"},{"issue_id":"bd-237","depends_on_id":"bd-238","type":"blocks","created_at":"2025-10-16T11:01:27.054201-07:00","created_by":"auto-import"}]} -{"id":"bd-238","title":"Fix UpdateIssue to auto-manage closed_at on status changes","description":"Modify internal/storage/sqlite/sqlite.go UpdateIssue to automatically manage closed_at when status changes.\n\nWhen status changes TO closed: set closed_at = now()\nWhen status changes FROM closed: set closed_at = nil and emit EventReopened","design":"```go\nfunc (s *SQLiteStorage) UpdateIssue(ctx context.Context, id string, updates map[string]interface{}, actor string) error {\n // ... existing validation ...\n\n // Smart closed_at management based on status changes\n if statusVal, ok := updates[\"status\"]; ok {\n newStatus := statusVal.(string)\n\n if newStatus == string(types.StatusClosed) {\n // Changing to closed: ensure closed_at is set\n if _, hasClosedAt := updates[\"closed_at\"]; !hasClosedAt {\n updates[\"closed_at\"] = time.Now()\n }\n } else {\n // Changing from closed to something else: clear closed_at\n if oldIssue.Status == types.StatusClosed {\n updates[\"closed_at\"] = nil\n eventType = types.EventReopened\n }\n }\n }\n\n // ... rest of existing code ...\n}\n```","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.877891-07:00","updated_at":"2025-10-16T12:22:47.881105-07:00","closed_at":"2025-10-16T11:01:26.877891-07:00","dependencies":[{"issue_id":"bd-238","depends_on_id":"bd-224","type":"parent-child","created_at":"2025-10-16T11:01:27.0544-07:00","created_by":"auto-import"},{"issue_id":"bd-238","depends_on_id":"bd-239","type":"blocks","created_at":"2025-10-16T11:01:27.054559-07:00","created_by":"auto-import"}]} -{"id":"bd-239","title":"Fix import.go to normalize closed_at before creating issues","description":"Modify cmd/bd/import.go to enforce closed_at invariant before calling CreateIssue/CreateIssues.\n\nNormalize data: if status=closed, ensure closed_at is set; if status!=closed, ensure closed_at is nil.","design":"```go\nif _, ok := rawData[\"status\"]; ok {\n updates[\"status\"] = issue.Status\n\n // Enforce closed_at invariant\n if issue.Status == types.StatusClosed {\n // Status is closed: ensure closed_at is set\n if issue.ClosedAt == nil {\n now := time.Now()\n updates[\"closed_at\"] = now\n } else {\n updates[\"closed_at\"] = *issue.ClosedAt\n }\n } else {\n // Status is not closed: ensure closed_at is NULL\n updates[\"closed_at\"] = nil\n }\n}\n```","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.886475-07:00","updated_at":"2025-10-16T12:22:47.881265-07:00","closed_at":"2025-10-16T11:01:26.886475-07:00","dependencies":[{"issue_id":"bd-239","depends_on_id":"bd-224","type":"parent-child","created_at":"2025-10-16T11:01:27.054744-07:00","created_by":"auto-import"},{"issue_id":"bd-239","depends_on_id":"bd-240","type":"blocks","created_at":"2025-10-16T11:01:27.054886-07:00","created_by":"auto-import"}]} -{"id":"bd-24","title":"Support ID space partitioning for parallel worker agents","description":"Enable external orchestrators (like AI worker swarms) to control issue ID assignment. Add --id flag to 'bd create' for explicit ID specification. Optionally support 'bd config set next_id N' to set the starting point for auto-increment. Storage layer already supports pre-assigned IDs (sqlite.go:52-71), just need CLI wiring. This keeps beads simple while letting orchestrators implement their own ID partitioning strategies to minimize merge conflicts. Complementary to bd-9's collision resolution.","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-12T16:10:37.808226-07:00","updated_at":"2025-10-16T12:22:47.881428-07:00","closed_at":"2025-10-13T23:18:01.637695-07:00"} -{"id":"bd-240","title":"Add CreateIssues interface method to Storage","description":"Add CreateIssues to the Storage interface in storage/storage.go\n\nNon-breaking addition to interface for batch issue creation.","design":"```go\n// storage/storage.go\ntype Storage interface {\n CreateIssue(ctx context.Context, issue *types.Issue, actor string) error\n CreateIssues(ctx context.Context, issues []*types.Issue, actor string) error // NEW\n // ... rest unchanged\n}\n```","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.907052-07:00","updated_at":"2025-10-16T12:22:47.881578-07:00","closed_at":"2025-10-16T11:01:26.907052-07:00","dependencies":[{"issue_id":"bd-240","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.055061-07:00","created_by":"auto-import"},{"issue_id":"bd-240","depends_on_id":"bd-224","type":"blocks","created_at":"2025-10-16T11:01:27.055201-07:00","created_by":"auto-import"}]} -{"id":"bd-241","title":"Add comprehensive unit tests for CreateIssues","description":"Test coverage for CreateIssues:\n- Empty batch\n- Single issue\n- Multiple issues\n- Mixed ID assignment (explicit + auto-generated)\n- Validation errors\n- Duplicate ID errors\n- Rollback on error\n- Verify closed_at invariant enforced","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.907176-07:00","updated_at":"2025-10-16T12:22:47.881723-07:00","closed_at":"2025-10-16T11:01:26.907176-07:00","dependencies":[{"issue_id":"bd-241","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.055717-07:00","created_by":"auto-import"},{"issue_id":"bd-241","depends_on_id":"bd-240","type":"blocks","created_at":"2025-10-16T11:01:27.055881-07:00","created_by":"auto-import"}]} -{"id":"bd-242","title":"Update import.go to use CreateIssues for bulk imports","description":"Modify cmd/bd/import.go to use CreateIssues instead of CreateIssue loop.\n\nAfter bd-224, import already normalizes closed_at, so this is straightforward:\n1. Normalize all issues in batch (closed_at handling)\n2. Call CreateIssues once with full batch\n3. Much simpler than current loop","design":"```go\n// After normalizing all issues\nfor _, issue := range issues {\n if issue.Status == types.StatusClosed {\n if issue.ClosedAt == nil {\n now := time.Now()\n issue.ClosedAt = \u0026now\n }\n } else {\n issue.ClosedAt = nil\n }\n}\n\n// Single batch call (5-15x faster!)\nreturn store.CreateIssues(ctx, issues, \"import\")\n```","notes":"Completed: Replaced CreateIssue loop with single CreateIssues batch call. Added in-memory de-duplication for duplicate IDs within same import (last one wins). Fixed skip-existing logic to only apply to DB issues, not batch duplicates. All 14 import tests pass including performance, collisions, dependencies, and labels.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.919636-07:00","updated_at":"2025-10-16T12:22:47.881869-07:00","closed_at":"2025-10-16T11:01:26.919636-07:00","dependencies":[{"issue_id":"bd-242","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.056056-07:00","created_by":"auto-import"},{"issue_id":"bd-242","depends_on_id":"bd-240","type":"blocks","created_at":"2025-10-16T11:01:27.056192-07:00","created_by":"auto-import"}]} -{"id":"bd-243","title":"Document CreateIssues API and update EXTENDING.md","description":"Documentation updates:\n- Godoc for CreateIssues with usage guidance\n- Add batch import examples\n- Update EXTENDING.md with batch usage patterns\n- Performance notes in README.md\n- When to use CreateIssue vs CreateIssues","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.924212-07:00","updated_at":"2025-10-16T12:22:47.882027-07:00","closed_at":"2025-10-16T11:01:26.924212-07:00","dependencies":[{"issue_id":"bd-243","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.056368-07:00","created_by":"auto-import"},{"issue_id":"bd-243","depends_on_id":"bd-240","type":"blocks","created_at":"2025-10-16T11:01:27.056573-07:00","created_by":"auto-import"}]} -{"id":"bd-244","title":"Implement SQLiteStorage.CreateIssues with atomic ID range reservation","description":"Core implementation of CreateIssues in internal/storage/sqlite/sqlite.go\n\nKey optimizations:\n- Single connection + transaction\n- Atomic ID range reservation (generate N IDs in one counter update)\n- Prepared statement for bulk inserts\n- All-or-nothing atomicity\n\nExpected 5-10x speedup for N\u003e10 issues.","design":"Implementation phases per ULTRATHINK_BD222.md:\n\n1. **Validation**: Pre-validate all issues (calls Issue.Validate() which enforces closed_at invariant from bd-224)\n2. **Connection \u0026 Transaction**: BEGIN IMMEDIATE (same as CreateIssue)\n3. **Batch ID Generation**: Reserve range [nextID, nextID+N) in single counter update\n4. **Bulk Insert**: Prepared statement loop (defer multi-VALUE INSERT optimization)\n5. **Bulk Events**: Record creation events for all issues\n6. **Bulk Dirty**: Mark all issues dirty for export\n7. **Commit**: All-or-nothing transaction commit\n\nSee ULTRATHINK_BD222.md lines 344-541 for full implementation details.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.936631-07:00","updated_at":"2025-10-16T12:22:47.882179-07:00","closed_at":"2025-10-16T11:01:26.936631-07:00","dependencies":[{"issue_id":"bd-244","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.056938-07:00","created_by":"auto-import"},{"issue_id":"bd-244","depends_on_id":"bd-240","type":"blocks","created_at":"2025-10-16T11:01:27.057092-07:00","created_by":"auto-import"},{"issue_id":"bd-244","depends_on_id":"bd-241","type":"blocks","created_at":"2025-10-16T11:01:27.057592-07:00","created_by":"auto-import"},{"issue_id":"bd-244","depends_on_id":"bd-242","type":"blocks","created_at":"2025-10-16T11:01:27.060397-07:00","created_by":"auto-import"}]} -{"id":"bd-245","title":"Add concurrency tests for CreateIssues","description":"Concurrent testing:\n- Multiple goroutines creating batches in parallel\n- Verify no ID collisions\n- Mix CreateIssue and CreateIssues calls\n- Verify all issues created correctly","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.936844-07:00","updated_at":"2025-10-16T12:22:47.882352-07:00","closed_at":"2025-10-16T11:01:26.936844-07:00","dependencies":[{"issue_id":"bd-245","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.060891-07:00","created_by":"auto-import"},{"issue_id":"bd-245","depends_on_id":"bd-244","type":"blocks","created_at":"2025-10-16T11:01:27.063519-07:00","created_by":"auto-import"}]} -{"id":"bd-247","title":"Add performance benchmarks for CreateIssues","description":"Benchmark suite comparing CreateIssue loop vs CreateIssues batch:\n- 10, 100, 1000 issues\n- Expected: 5-10x speedup for N\u003e10\n- Measure connection, transaction, and insert overhead\n\nTarget: 100 issues in \u003c130ms (vs 900ms sequential)","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.93698-07:00","updated_at":"2025-10-16T12:22:47.882485-07:00","closed_at":"2025-10-16T11:01:26.93698-07:00","dependencies":[{"issue_id":"bd-247","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.063745-07:00","created_by":"auto-import"},{"issue_id":"bd-247","depends_on_id":"bd-244","type":"blocks","created_at":"2025-10-16T11:01:27.063883-07:00","created_by":"auto-import"}]} -{"id":"bd-248","title":"Test reopen command","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.942121-07:00","updated_at":"2025-10-16T12:22:47.882706-07:00","closed_at":"2025-10-16T11:01:26.942121-07:00"} -{"id":"bd-249","title":"Test reopen command","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.943007-07:00","updated_at":"2025-10-16T12:22:47.883038-07:00","closed_at":"2025-10-16T11:01:26.943007-07:00"} -{"id":"bd-25","title":"Add transaction support to storage layer for atomic multi-operation workflows","description":"Currently each storage method (CreateIssue, UpdateIssue, etc.) starts its own transaction. This makes it impossible to perform atomic multi-step operations like collision resolution. Add support for passing *sql.Tx through the storage interface, or create transaction-aware versions of methods. This would make remapCollisions and other batch operations truly atomic.","status":"closed","priority":4,"issue_type":"feature","created_at":"2025-10-12T16:39:00.66572-07:00","updated_at":"2025-10-16T12:22:47.8832-07:00","closed_at":"2025-10-13T22:53:56.401108-07:00"} -{"id":"bd-250","title":"Implement --format flag for bd list (from PR #46)","description":"PR #46 by tmc adds --format flag with Go template support for bd list, including presets for 'digraph' and 'dot' (Graphviz) output with status-based color coding. Unfortunately the PR is based on old main and would delete labels, reopen, and storage tests. Need to reimplement the feature atop current main.\n\nFeatures to implement:\n- --format flag for bd list\n- 'digraph' preset: basic 'from to' format for golang.org/x/tools/cmd/digraph\n- 'dot' preset: Graphviz compatible output with color-coded statuses\n- Custom Go template support with vars: IssueID, DependsOnID, Type, Issue, Dependency\n- Status-based colors: open=white, in_progress=lightyellow, blocked=lightcoral, closed=lightgray\n\nExamples:\n- bd list --format=digraph | digraph nodes\n- bd list --format=dot | dot -Tsvg -o deps.svg\n- bd list --format='{{.IssueID}} -\u003e {{.DependsOnID}} [{{.Type}}]'\n\nOriginal PR: https://github.com/steveyegge/beads/pull/46","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.945289-07:00","updated_at":"2025-10-16T12:22:47.883812-07:00","closed_at":"2025-10-16T11:01:26.945289-07:00","external_ref":"gh-46"} -{"id":"bd-251","title":"Epic: Add intelligent database compaction with Claude Haiku","description":"Implement multi-tier database compaction using Claude Haiku to semantically compress old, closed issues. This keeps the database lightweight and agent-friendly while preserving essential context.\n\nGoals:\n- 70-95% space reduction for eligible issues\n- Full restore capability via snapshots\n- Opt-in with dry-run safety\n- ~$1 per 1,000 issues compacted","acceptance_criteria":"- Schema migration with snapshots table\n- Haiku integration for summarization\n- Two-tier compaction (30d, 90d)\n- CLI with dry-run, restore, stats\n- Full test coverage\n- Documentation complete","status":"open","priority":2,"issue_type":"epic","created_at":"2025-10-16T11:01:26.94596-07:00","updated_at":"2025-10-16T12:22:47.884007-07:00"} -{"id":"bd-252","title":"Add compaction schema and migrations","description":"Add database schema support for issue compaction tracking and snapshot storage.","design":"Add three columns to `issues` table:\n- `compaction_level INTEGER DEFAULT 0` - 0=original, 1=tier1, 2=tier2\n- `compacted_at DATETIME` - when last compacted\n- `original_size INTEGER` - bytes before first compaction\n\nCreate `issue_snapshots` table:\n```sql\nCREATE TABLE issue_snapshots (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n issue_id TEXT NOT NULL,\n snapshot_time DATETIME NOT NULL,\n compaction_level INTEGER NOT NULL,\n original_size INTEGER NOT NULL,\n compressed_size INTEGER NOT NULL,\n original_content TEXT NOT NULL, -- JSON blob\n archived_events TEXT,\n FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE\n);\n```\n\nAdd indexes:\n- `idx_snapshots_issue` on `issue_id`\n- `idx_snapshots_level` on `compaction_level`\n\nAdd migration functions in `internal/storage/sqlite/sqlite.go`:\n- `migrateCompactionColumns(db *sql.DB) error`\n- `migrateSnapshotsTable(db *sql.DB) error`","acceptance_criteria":"- Existing databases migrate automatically\n- New databases include columns by default\n- Migration is idempotent (safe to run multiple times)\n- No data loss during migration\n- Tests verify migration on fresh and existing DBs","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.946087-07:00","updated_at":"2025-10-16T12:22:47.884178-07:00","closed_at":"2025-10-16T11:01:26.946087-07:00"} -{"id":"bd-253","title":"Add compaction configuration keys","description":"Add configuration keys for compaction behavior with sensible defaults.","design":"Add to `internal/storage/sqlite/schema.go` initial config:\n```sql\nINSERT OR IGNORE INTO config (key, value) VALUES\n ('compact_tier1_days', '30'),\n ('compact_tier1_dep_levels', '2'),\n ('compact_tier2_days', '90'),\n ('compact_tier2_dep_levels', '5'),\n ('compact_tier2_commits', '100'),\n ('compact_model', 'claude-3-5-haiku-20241022'),\n ('compact_batch_size', '50'),\n ('compact_parallel_workers', '5'),\n ('auto_compact_enabled', 'false');\n```\n\nAdd helper functions for loading config into typed struct.","acceptance_criteria":"- Config keys created on init\n- Existing DBs get defaults on migration\n- `bd config get/set` works with all keys\n- Type validation (days=int, enabled=bool)\n- Documentation in README.md","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.946235-07:00","updated_at":"2025-10-16T12:22:47.884329-07:00","closed_at":"2025-10-16T11:01:26.946235-07:00"} -{"id":"bd-254","title":"Implement candidate identification queries","description":"Write SQL queries to identify issues eligible for Tier 1 and Tier 2 compaction based on closure time and dependency status.","design":"Create `internal/storage/sqlite/compact.go` with:\n\n```go\ntype CompactionCandidate struct {\n IssueID string\n ClosedAt time.Time\n OriginalSize int\n EstimatedSize int\n DependentCount int\n}\n\nfunc (s *SQLiteStorage) GetTier1Candidates(ctx context.Context) ([]*CompactionCandidate, error)\nfunc (s *SQLiteStorage) GetTier2Candidates(ctx context.Context) ([]*CompactionCandidate, error)\nfunc (s *SQLiteStorage) CheckEligibility(ctx context.Context, issueID string, tier int) (bool, string, error)\n```\n\nUse recursive CTE for dependency depth checking (similar to ready_issues view).","acceptance_criteria":"- Tier 1 query filters by days and dependency depth\n- Tier 2 query includes commit/issue count checks\n- Dependency checking handles circular deps gracefully\n- Performance: \u003c100ms for 10,000 issue database\n- Tests cover edge cases (no deps, circular deps, mixed status)","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.946368-07:00","updated_at":"2025-10-16T12:22:47.884474-07:00","closed_at":"2025-10-16T11:01:26.946368-07:00"} -{"id":"bd-255","title":"Create Haiku client and prompt templates","description":"Implement Claude Haiku API client with template-based prompts for Tier 1 and Tier 2 summarization.","design":"Create `internal/compact/haiku.go`:\n\n```go\ntype HaikuClient struct {\n client *anthropic.Client\n model string\n}\n\nfunc NewHaikuClient(apiKey string) (*HaikuClient, error)\nfunc (h *HaikuClient) SummarizeTier1(ctx context.Context, issue *types.Issue) (string, error)\nfunc (h *HaikuClient) SummarizeTier2(ctx context.Context, issue *types.Issue) (string, error)\n```\n\nUse text/template for prompt rendering.\n\nTier 1 output format:\n```\n**Summary:** [2-3 sentences]\n**Key Decisions:** [bullet points]\n**Resolution:** [outcome]\n```\n\nTier 2 output format:\n```\nSingle paragraph ≤150 words covering what was built, why it mattered, lasting impact.\n```","acceptance_criteria":"- API key from env var or config (env takes precedence)\n- Prompts render correctly with templates\n- Rate limiting handled gracefully (exponential backoff)\n- Network errors retry up to 3 times\n- Mock tests for API calls","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.946495-07:00","updated_at":"2025-10-16T12:22:47.88464-07:00","closed_at":"2025-10-16T11:01:26.946495-07:00"} -{"id":"bd-256","title":"Implement snapshot creation and restoration","description":"Implement snapshot creation before compaction and restoration capability to undo compaction.","design":"Add to `internal/storage/sqlite/compact.go`:\n\n```go\nfunc (s *SQLiteStorage) CreateSnapshot(ctx context.Context, issue *types.Issue, level int) error\nfunc (s *SQLiteStorage) RestoreFromSnapshot(ctx context.Context, issueID string, level int) error\nfunc (s *SQLiteStorage) GetSnapshots(ctx context.Context, issueID string) ([]*Snapshot, error)\n```\n\nSnapshot JSON structure:\n```json\n{\n \"description\": \"...\",\n \"design\": \"...\",\n \"notes\": \"...\",\n \"acceptance_criteria\": \"...\",\n \"title\": \"...\"\n}\n```","acceptance_criteria":"- Snapshot created atomically with compaction\n- Restore returns exact original content\n- Multiple snapshots per issue supported (Tier 1 → Tier 2)\n- JSON encoding handles UTF-8 and special characters\n- Size calculation is accurate (UTF-8 bytes)","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.947733-07:00","updated_at":"2025-10-16T12:22:47.88481-07:00","closed_at":"2025-10-16T11:01:26.947733-07:00"} -{"id":"bd-257","title":"Implement Tier 1 compaction logic","description":"Implement the core Tier 1 compaction process: snapshot → summarize → update.","design":"Add to `internal/compact/compactor.go`:\n\n```go\ntype Compactor struct {\n store storage.Storage\n haiku *HaikuClient\n config *CompactConfig\n}\n\nfunc New(store storage.Storage, apiKey string, config *CompactConfig) (*Compactor, error)\nfunc (c *Compactor) CompactTier1(ctx context.Context, issueID string) error\nfunc (c *Compactor) CompactTier1Batch(ctx context.Context, issueIDs []string) error\n```\n\nProcess:\n1. Verify eligibility\n2. Calculate original size\n3. Create snapshot\n4. Call Haiku for summary\n5. Update issue (description=summary, clear design/notes/criteria)\n6. Set compaction_level=1, compacted_at=now, original_size\n7. Record EventCompacted\n8. Mark dirty for export","acceptance_criteria":"- Single issue compaction works end-to-end\n- Batch processing with parallel workers (5 concurrent)\n- Errors don't corrupt database (transaction rollback)\n- EventCompacted includes size savings\n- Dry-run mode (identify + size estimate only, no API calls)","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.947916-07:00","updated_at":"2025-10-16T12:22:47.884993-07:00","closed_at":"2025-10-16T11:01:26.947916-07:00"} -{"id":"bd-258","title":"Implement Tier 2 compaction logic","description":"Implement Tier 2 ultra-compression: more aggressive summarization and optional event pruning.","design":"Add to `internal/compact/compactor.go`:\n\n```go\nfunc (c *Compactor) CompactTier2(ctx context.Context, issueID string) error\nfunc (c *Compactor) CompactTier2Batch(ctx context.Context, issueIDs []string) error\n```\n\nProcess:\n1. Verify issue is at compaction_level = 1\n2. Check Tier 2 eligibility (days, deps, commits/issues)\n3. Create Tier 2 snapshot\n4. Call Haiku with ultra-compression prompt\n5. Update issue (description = single paragraph, clear all other fields)\n6. Set compaction_level = 2\n7. Optionally prune events (keep created/closed, archive rest to snapshot)","acceptance_criteria":"- Requires existing Tier 1 compaction\n- Git commit counting works (with fallback to issue counter)\n- Events optionally pruned (config: compact_events_enabled)\n- Archived events stored in snapshot JSON\n- Size reduction 90-95%","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.948482-07:00","updated_at":"2025-10-16T12:22:47.885163-07:00"} -{"id":"bd-259","title":"Add `bd compact` CLI command","description":"Implement the `bd compact` command with dry-run, batch processing, and progress reporting.","design":"Create `cmd/bd/compact.go`:\n\n```go\nvar compactCmd = \u0026cobra.Command{\n Use: \"compact\",\n Short: \"Compact old closed issues to save space\",\n}\n\nFlags:\n --dry-run Preview without compacting\n --tier int Compaction tier (1 or 2, default: 1)\n --all Process all candidates\n --id string Compact specific issue\n --force Force compact (bypass checks, requires --id)\n --batch-size int Issues per batch\n --workers int Parallel workers\n --json JSON output\n```","acceptance_criteria":"- `--dry-run` shows accurate preview with size estimates\n- `--all` processes all candidates\n- `--id` compacts single issue\n- `--force` bypasses eligibility checks (only with --id)\n- Progress bar for batches (e.g., [████████] 47/47)\n- JSON output with `--json`\n- Exit codes: 0=success, 1=error\n- Shows summary: count, size saved, cost, time","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.948941-07:00","updated_at":"2025-10-16T12:22:47.885305-07:00","closed_at":"2025-10-16T11:01:26.948941-07:00"} -{"id":"bd-26","title":"Optimize reference updates to avoid loading all issues into memory","description":"In updateReferences(), we call SearchIssues with no filter to get ALL issues for updating references. For large databases (10k+ issues), this loads everything into memory. Options: 1) Use batched processing with LIMIT/OFFSET, 2) Use SQL UPDATE with REPLACE() directly, 3) Stream results instead of loading all at once. Located in collision.go:266","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-12T16:39:10.327861-07:00","updated_at":"2025-10-16T12:22:47.885463-07:00"} -{"id":"bd-260","title":"Add `bd compact --restore` functionality","description":"Implement restore command to undo compaction from snapshots.","design":"Add to `cmd/bd/compact.go`:\n\n```go\nvar compactRestore string\n\ncompactCmd.Flags().StringVar(\u0026compactRestore, \"restore\", \"\", \"Restore issue from snapshot\")\n```\n\nProcess:\n1. Load snapshot for issue\n2. Parse JSON content\n3. Update issue with original content\n4. Set compaction_level = 0, compacted_at = NULL, original_size = NULL\n5. Record event (EventRestored or EventUpdated)\n6. Mark dirty for export","acceptance_criteria":"- Restores exact original content\n- Handles multiple snapshots (use latest by default)\n- `--level` flag to choose specific snapshot\n- Updates compaction_level correctly\n- Exports restored content to JSONL\n- Shows before/after in output","notes":"Won't fix - snapshots defeat the purpose of compaction","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.949239-07:00","updated_at":"2025-10-16T12:22:47.885627-07:00","closed_at":"2025-10-16T11:01:26.949239-07:00"} -{"id":"bd-261","title":"Add `bd compact --stats` command","description":"Add statistics command showing compaction status and potential savings.","design":"```go\nvar compactStats bool\n\ncompactCmd.Flags().BoolVar(\u0026compactStats, \"stats\", false, \"Show compaction statistics\")\n```\n\nOutput:\n- Total issues, by compaction level (0, 1, 2)\n- Current DB size vs estimated uncompacted size\n- Space savings (KB/MB and %)\n- Candidates for each tier with size estimates\n- Estimated API cost (Haiku pricing)","acceptance_criteria":"- Accurate counts by compaction_level\n- Size calculations include all text fields (UTF-8 bytes)\n- Shows candidates with eligibility reasons\n- Cost estimation based on current Haiku pricing\n- JSON output supported\n- Clear, readable table format","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.949378-07:00","updated_at":"2025-10-16T12:22:47.885775-07:00","closed_at":"2025-10-16T11:01:26.949378-07:00"} -{"id":"bd-262","title":"Add EventCompacted to event system","description":"Add new event type for tracking compaction in audit trail.","design":"1. Add to `internal/types/types.go`:\n```go\nconst EventCompacted EventType = \"compacted\"\n```\n\n2. Record event during compaction:\n```go\neventData := map[string]interface{}{\n \"tier\": tier,\n \"original_size\": originalSize,\n \"compressed_size\": compressedSize,\n \"reduction_pct\": (1 - float64(compressedSize)/float64(originalSize)) * 100,\n}\n```\n\n3. Update event display in `bd show`.","acceptance_criteria":"- Event includes tier, original_size, compressed_size, reduction_pct\n- Shows in event history (`bd events \u003cid\u003e`)\n- Exports to JSONL correctly\n- `bd show` displays compaction status and marker","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.949506-07:00","updated_at":"2025-10-16T12:22:47.885914-07:00","closed_at":"2025-10-16T11:01:26.949506-07:00"} -{"id":"bd-263","title":"Add compaction indicator to `bd show`","description":"Update `bd show` command to display compaction status prominently.","design":"Add to issue display:\n```\nbd-42: Fix authentication bug [CLOSED] 🗜️\n\nStatus: closed (compacted L1)\n...\n\n---\n💾 Restore: bd compact --restore bd-42\n📊 Original: 2,341 bytes | Compressed: 468 bytes (80% reduction)\n🗜️ Compacted: 2025-10-15 (Tier 1)\n```\n\nEmoji indicators:\n- Tier 1: 🗜️\n- Tier 2: 📦","acceptance_criteria":"- Compaction status visible in title line\n- Footer shows size savings when compacted\n- Restore command shown for compacted issues\n- Works with `--json` output (includes compaction fields)\n- Emoji optional (controlled by config or terminal detection)","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.949634-07:00","updated_at":"2025-10-16T12:22:47.88649-07:00","closed_at":"2025-10-16T11:01:26.949634-07:00"} -{"id":"bd-264","title":"Write compaction tests","description":"Comprehensive test suite for compaction functionality.","design":"Test coverage:\n\n1. **Candidate Identification:**\n - Eligibility by time\n - Dependency depth checking\n - Mixed status dependents\n - Edge cases (no deps, circular deps)\n\n2. **Snapshots:**\n - Create and restore\n - Multiple snapshots per issue\n - Content integrity (UTF-8, special chars)\n\n3. **Tier 1 Compaction:**\n - Single issue compaction\n - Batch processing\n - Error handling (API failures)\n\n4. **Tier 2 Compaction:**\n - Requires Tier 1\n - Events pruning\n - Commit counting fallback\n\n5. **CLI:**\n - All flag combinations\n - Dry-run accuracy\n - JSON output parsing\n\n6. **Integration:**\n - End-to-end flow\n - JSONL export/import\n - Restore verification","acceptance_criteria":"- Test coverage \u003e80%\n- All edge cases covered\n- Mock Haiku API in tests (no real API calls)\n- Integration tests pass\n- `go test ./...` passes\n- Benchmarks for performance-critical paths","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.949755-07:00","updated_at":"2025-10-16T12:22:47.886627-07:00","closed_at":"2025-10-16T11:01:26.949755-07:00"} -{"id":"bd-265","title":"Add compaction documentation","description":"Document compaction feature in README and create detailed COMPACTION.md guide.","design":"**Update README.md:**\n- Add to Features section\n- CLI examples (dry-run, compact, restore, stats)\n- Configuration guide\n- Cost analysis\n\n**Create COMPACTION.md:**\n- How compaction works (architecture overview)\n- When to use each tier\n- Detailed cost analysis with examples\n- Safety mechanisms (snapshots, restore, dry-run)\n- Troubleshooting guide\n- FAQ\n\n**Create examples/compaction/:**\n- `workflow.sh` - Example monthly compaction workflow\n- `cron-compact.sh` - Cron job setup\n- `auto-compact.sh` - Auto-compaction script","acceptance_criteria":"- README.md updated with compaction section\n- COMPACTION.md comprehensive and clear\n- Examples work as documented (tested)\n- Screenshots or ASCII examples included\n- API key setup documented (env var vs config)\n- Covers common questions and issues","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.949873-07:00","updated_at":"2025-10-16T12:22:47.886771-07:00","closed_at":"2025-10-16T11:01:26.949873-07:00"} -{"id":"bd-266","title":"Optional: Implement auto-compaction","description":"Implement automatic compaction triggered by certain operations when enabled via config.","design":"Trigger points (when `auto_compact_enabled = true`):\n1. `bd stats` - check and compact if candidates exist\n2. `bd export` - before exporting\n3. Configurable: on any read operation after N candidates accumulate\n\nAdd:\n```go\nfunc (s *SQLiteStorage) AutoCompact(ctx context.Context) error {\n enabled, _ := s.GetConfig(ctx, \"auto_compact_enabled\")\n if enabled != \"true\" {\n return nil\n }\n\n // Run Tier 1 compaction on all candidates\n // Limit to batch_size to avoid long operations\n // Log activity for transparency\n}\n```","acceptance_criteria":"- Respects auto_compact_enabled config (default: false)\n- Limits batch size to avoid blocking operations\n- Logs compaction activity (visible with --verbose)\n- Can be disabled per-command with `--no-auto-compact` flag\n- Only compacts Tier 1 (Tier 2 remains manual)\n- Doesn't run more than once per hour (rate limiting)","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-16T11:01:26.949992-07:00","updated_at":"2025-10-16T12:22:47.886916-07:00"} -{"id":"bd-267","title":"Optional: Add git commit counting","description":"Implement git commit counting for \"project time\" measurement as alternative to calendar time for Tier 2 eligibility.","design":"```go\nfunc getCommitsSince(closedAt time.Time) (int, error) {\n cmd := exec.Command(\"git\", \"rev-list\", \"--count\",\n fmt.Sprintf(\"--since=%s\", closedAt.Format(time.RFC3339)), \"HEAD\")\n output, err := cmd.Output()\n if err != nil {\n return 0, err // Not in git repo or git not available\n }\n return strconv.Atoi(strings.TrimSpace(string(output)))\n}\n```\n\nFallback strategies:\n1. Git commit count (preferred)\n2. Issue counter delta (store counter at close time, compare later)\n3. Pure time-based (90 days)","acceptance_criteria":"- Counts commits since closed_at timestamp\n- Handles git not available gracefully (falls back)\n- Fallback to issue counter delta works\n- Configurable via compact_tier2_commits config key\n- Tested with real git repo\n- Works in non-git environments","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-16T11:01:26.9501-07:00","updated_at":"2025-10-16T12:22:47.887072-07:00"} -{"id":"bd-268","title":"Explore in-memory embedded SQL alternatives to SQLite","description":"Investigate lightweight in-memory embedded SQL databases as alternative backends for environments where SQLite is problematic or considered too heavyweight. This would provide flexibility for different deployment scenarios.","design":"Research options:\n- modernc.org/sqlite (pure Go SQLite implementation, no cgo)\n- rqlite (distributed SQLite with Raft)\n- go-memdb (in-memory database by HashiCorp)\n- badger (embedded key-value store, would need SQL layer)\n- bbolt (embedded key-value store)\n- duckdb (lightweight analytical database)\n\nEvaluate on:\n- Memory footprint vs SQLite\n- cgo dependency (pure Go preferred)\n- SQL compatibility level\n- Transaction support\n- Performance characteristics\n- Maintenance/community status\n- Migration complexity from SQLite\n\nConsider creating a storage abstraction layer to support multiple backends.","acceptance_criteria":"- Document comparison of at least 3 alternatives\n- Benchmark memory usage and performance vs SQLite\n- Assess migration effort for each option\n- Recommendation on whether to support alternatives\n- If yes, prototype storage interface abstraction","notes":"Worth noting: modernc.org/sqlite is a pure Go implementation (no cgo) that might already address the \"heavyweight\" concern, since much of SQLite's overhead comes from cgo calls. Should evaluate this first before exploring completely different database technologies.","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-16T11:01:26.950225-07:00","updated_at":"2025-10-16T12:22:47.88723-07:00"} -{"id":"bd-269","title":"Add label and title filtering to bd list","description":"Add --label and --title flags to bd list command for better filtering. Labels backend already exists, just need CLI exposure. Title search needs both backend and CLI implementation.","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.950362-07:00","updated_at":"2025-10-16T12:22:47.887382-07:00","closed_at":"2025-10-16T11:01:26.950362-07:00","external_ref":"gh-45"} -{"id":"bd-27","title":"Cache compiled regexes in replaceIDReferences for performance","description":"replaceIDReferences() compiles the same regex patterns on every call. With 100 issues and 10 ID mappings, that's 1000 regex compilations. Pre-compile regexes once and reuse. Can use a struct with compiled regex, placeholder, and newID. Located in collision.go:329. Estimated performance improvement: 10-100x for large batches.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-12T16:39:18.305517-07:00","updated_at":"2025-10-16T12:22:47.887537-07:00","closed_at":"2025-10-13T23:50:25.865317-07:00"} -{"id":"bd-270","title":"Detect and handle Git merge conflicts in JSONL auto-import","description":"","design":"**Problem**: Git merge conflicts in .beads/issues.jsonl break auto-import silently. When JSONL contains conflict markers (\u003c\u003c\u003c\u003c\u003c\u003c\u003c HEAD, =======, \u003e\u003e\u003e\u003e\u003e\u003e\u003e), JSON parser fails and entire import is skipped. System only shows parse error but doesn't identify it as a merge conflict.\n\n**Impact**: Critical - blocks all auto-import until manually resolved.\n\n**Solution**:\n1. Add pre-parse merge conflict detection in autoImportIfNewer()\n2. Check for conflict markers before JSON parsing\n3. Provide helpful error message with resolution instructions\n4. Consider auto-resolution strategies:\n - Parse each section separately (HEAD vs incoming)\n - Detect collisions between sections\n - Auto-resolve with --resolve-collisions logic\n - OR abort with clear merge resolution instructions\n\n**Code locations**:\n- cmd/bd/main.go:autoImportIfNewer() (lines 164-398)\n- cmd/bd/import.go (manual import with better error handling)\n- internal/storage/sqlite/collision.go (collision detection)","acceptance_criteria":"- Pre-parse detection catches merge conflict markers\n- Clear error message identifies it as merge conflict\n- Error message includes resolution steps\n- Test case with synthetic merge conflict\n- Consider: automatic merge resolution (stretch goal)","status":"closed","priority":0,"issue_type":"bug","assignee":"amp","created_at":"2025-10-16T11:01:26.950648-07:00","updated_at":"2025-10-16T12:22:47.887678-07:00","closed_at":"2025-10-16T11:01:26.950648-07:00"} -{"id":"bd-271","title":"Epic: Git-Based Auto-Sync for Multi-Device Support","description":"Implement git-based auto-sync to enable multi-device workflows while maintaining beads' local-first, lightweight philosophy. Build on existing JSONL export/import infrastructure and collision detection.","design":"See DESIGN-GIT-SYNC.md for comprehensive architectural design.\n\nCore principle: Git + JSONL remains source of truth. No required server. Optional lightweight sync gateway for users who want push-button multi-device support.","acceptance_criteria":"- Phase 1: Enhanced git-based sync (no server) completed\n- Phase 2: Optional bd serve gateway implemented\n- Phase 3: Client gateway integration working\n- Phase 4: Production-ready with CRDT conflict resolution\n- All existing functionality preserved (backward compatible)\n- Documentation complete\n\n---","status":"open","priority":1,"issue_type":"epic","created_at":"2025-10-16T11:01:26.950785-07:00","updated_at":"2025-10-16T12:22:47.887833-07:00","dependencies":[{"issue_id":"bd-271","depends_on_id":"bd-272","type":"parent-child","created_at":"2025-10-16T11:01:27.064068-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-273","type":"parent-child","created_at":"2025-10-16T11:01:27.067101-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-274","type":"parent-child","created_at":"2025-10-16T11:01:27.067247-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-275","type":"parent-child","created_at":"2025-10-16T11:01:27.067378-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-276","type":"parent-child","created_at":"2025-10-16T11:01:27.067513-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-278","type":"parent-child","created_at":"2025-10-16T11:01:27.068474-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-277","type":"parent-child","created_at":"2025-10-16T11:01:27.068629-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-279","type":"parent-child","created_at":"2025-10-16T11:01:27.068761-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-280","type":"parent-child","created_at":"2025-10-16T11:01:27.068908-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-281","type":"parent-child","created_at":"2025-10-16T11:01:27.069053-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-282","type":"parent-child","created_at":"2025-10-16T11:01:27.069201-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-283","type":"parent-child","created_at":"2025-10-16T11:01:27.069352-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-284","type":"parent-child","created_at":"2025-10-16T11:01:27.069501-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-285","type":"parent-child","created_at":"2025-10-16T11:01:27.069651-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-286","type":"parent-child","created_at":"2025-10-16T11:01:27.0698-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-287","type":"parent-child","created_at":"2025-10-16T11:01:27.06995-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-288","type":"parent-child","created_at":"2025-10-16T11:01:27.070111-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-289","type":"parent-child","created_at":"2025-10-16T11:01:27.070297-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-290","type":"parent-child","created_at":"2025-10-16T11:01:27.070448-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-291","type":"parent-child","created_at":"2025-10-16T11:01:27.0706-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-292","type":"parent-child","created_at":"2025-10-16T11:01:27.070747-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-293","type":"parent-child","created_at":"2025-10-16T11:01:27.070898-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-294","type":"parent-child","created_at":"2025-10-16T11:01:27.071048-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-295","type":"parent-child","created_at":"2025-10-16T11:01:27.071198-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-296","type":"parent-child","created_at":"2025-10-16T11:01:27.071356-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-297","type":"parent-child","created_at":"2025-10-16T11:01:27.0715-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-298","type":"parent-child","created_at":"2025-10-16T11:01:27.071645-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-299","type":"parent-child","created_at":"2025-10-16T11:01:27.071789-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-300","type":"parent-child","created_at":"2025-10-16T11:01:27.071932-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-301","type":"parent-child","created_at":"2025-10-16T11:01:27.072076-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-302","type":"parent-child","created_at":"2025-10-16T11:01:27.072228-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-303","type":"parent-child","created_at":"2025-10-16T11:01:27.072387-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-304","type":"parent-child","created_at":"2025-10-16T11:01:27.072756-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-305","type":"parent-child","created_at":"2025-10-16T11:01:27.073568-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-306","type":"parent-child","created_at":"2025-10-16T11:01:27.073748-07:00","created_by":"auto-import"}]} -{"id":"bd-272","title":"Phase 1: Implement bd sync command","description":"Create bd sync command to manually synchronize with git remote in a single operation.","design":"Command should:\n1. Export pending changes to JSONL\n2. Commit changes to git\n3. Pull from remote (with conflict resolution)\n4. Push local commits to remote\n\nWraps the entire sync workflow in one command for better UX.","acceptance_criteria":"- bd sync command implemented\n- Exports dirty changes to JSONL automatically\n- Commits to git with descriptive message\n- Pulls and handles merge conflicts\n- Auto-imports updated JSONL\n- Pushes to remote\n- Error handling for git failures\n- Tests cover success and failure scenarios\n- Documentation in README.md\n\n---","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.95094-07:00","updated_at":"2025-10-16T12:22:48.022905-07:00","closed_at":"2025-10-16T12:22:48.022905-07:00","dependencies":[{"issue_id":"bd-272","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.073964-07:00","created_by":"auto-import"}]} -{"id":"bd-273","title":"Phase 1: Implement bd daemon command","description":"Create bd daemon command to run background sync process with configurable interval.","design":"Daemon should:\n- Run in background (fork or systemd service)\n- Poll for changes at configurable interval (default: 5 minutes)\n- Export dirty issues to JSONL\n- Auto-commit if --auto-commit flag set\n- Auto-push if --auto-push flag set\n- Pull remote changes periodically\n- Auto-import when remote changes detected\n- Log sync activity\n\nCommand flags:\n- --interval=5m (sync check interval)\n- --auto-commit (automatically commit changes)\n- --auto-push (automatically push commits)\n- --stop (stop running daemon)\n- --status (show daemon status)","acceptance_criteria":"- bd daemon command implemented\n- Background process management working\n- Configurable sync interval\n- Auto-commit functionality\n- Auto-push functionality\n- PID file for process management\n- Graceful shutdown on SIGTERM\n- Logging to file or syslog\n- Status command shows daemon state\n- Tests for daemon lifecycle\n- Documentation in README.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.951061-07:00","updated_at":"2025-10-16T12:22:47.888145-07:00","dependencies":[{"issue_id":"bd-273","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.074192-07:00","created_by":"auto-import"}]} -{"id":"bd-274","title":"Phase 1: Create enhanced git hooks examples","description":"Create comprehensive git hooks in examples/git-hooks/ for immediate sync without daemon.","design":"Hooks to create:\n1. post-commit: Force immediate export, amend commit with JSONL changes\n2. post-merge: Auto-import with collision resolution\n3. pre-push: Ensure JSONL is up-to-date\n4. post-checkout: Auto-import when switching branches\n\nInstallation script: examples/git-hooks/install.sh","acceptance_criteria":"- post-commit hook that auto-exports\n- post-merge hook that auto-imports with --resolve-collisions\n- pre-push hook validates JSONL is synced\n- post-checkout hook imports branch changes\n- install.sh script copies hooks to .git/hooks/\n- Documentation in examples/git-hooks/README.md\n- Hooks are executable\n- Error handling in all hooks\n- Tests verify hook behavior\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.951185-07:00","updated_at":"2025-10-16T12:22:47.888288-07:00","dependencies":[{"issue_id":"bd-274","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.074429-07:00","created_by":"auto-import"}]} -{"id":"bd-275","title":"Phase 1: Implement three-way merge for conflicts","description":"Implement three-way merge algorithm to intelligently resolve conflicts by comparing base, local, and remote versions.","design":"Three-way merge logic:\n- Get base version from git history (last common ancestor)\n- Compare local vs base: if same, use remote (remote changed)\n- Compare remote vs base: if same, use local (local changed)\n- If both changed: mark as conflict for manual resolution\n\nField-by-field merging for Issue type:\n- title, description, design, acceptance_criteria, notes (text fields)\n- status, priority, issue_type (enum fields)\n- labels (set merge - union)\n- dependencies (set merge - union)\n\nReturn MergeResult with:\n- MergedVersion (auto-merged fields)\n- Conflicts (list of fields requiring manual resolution)","acceptance_criteria":"- ThreeWayMerge function implemented\n- GetLastSyncedVersion retrieves git base version\n- Field-by-field merge logic for all Issue fields\n- Union merge for labels and dependencies\n- Conflict detection for incompatible changes\n- MergeResult type defined\n- Integration with import collision detection\n- Tests cover all merge scenarios\n- Documentation in DESIGN-GIT-SYNC.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.951296-07:00","updated_at":"2025-10-16T12:22:47.888436-07:00","dependencies":[{"issue_id":"bd-275","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.074631-07:00","created_by":"auto-import"}]} -{"id":"bd-276","title":"Phase 1: Add version vectors for causal ordering","description":"Add optional version vector metadata to Issues for detecting causal relationships and enabling better conflict resolution.","design":"Add sync_metadata to Issue JSON:\n```json\n{\n \"sync_metadata\": {\n \"version\": 3,\n \"last_modified_by\": \"device-a\",\n \"version_vector\": {\n \"device-a\": 2,\n \"device-b\": 1\n }\n }\n}\n```\n\nVersion vector tracks logical clock per device:\n- Incremented on each update\n- Used to determine causality (happened-before)\n- Enables automatic conflict resolution for concurrent edits\n\nOptional field - backward compatible with existing JSONL.","acceptance_criteria":"- SyncMetadata type defined\n- Version vector in Issue struct (optional)\n- Device ID generation and storage\n- Increment version on update\n- Version vector comparison functions\n- Causal ordering detection\n- Integration with collision detection\n- Backward compatible JSONL parsing\n- Tests for version vector logic\n- Documentation in DESIGN-GIT-SYNC.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.951434-07:00","updated_at":"2025-10-16T12:22:47.888586-07:00","dependencies":[{"issue_id":"bd-276","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.07483-07:00","created_by":"auto-import"}]} -{"id":"bd-277","title":"Phase 1: Improve collision UX with interactive resolution","description":"Enhance collision handling UX with interactive prompts for users to choose resolution strategy.","design":"When collision detected during sync, prompt:\n```\n⚠ Collision detected on bd-10 (conflicting fields: priority, title)\n\nOptions:\n 1. Keep local change\n 2. Accept remote change\n 3. Remap remote to new ID (recommended)\n 4. Resolve manually\n\nChoose [1-4]:\n```\n\nAdd bd resolve command for manual resolution:\n- Opens editor with three-way diff\n- User edits merged version\n- Validates and applies resolution","acceptance_criteria":"- Interactive collision prompt implemented\n- User can choose resolution strategy\n- bd resolve command implemented\n- Three-way diff display in editor\n- Manual edit and apply workflow\n- Validation of resolved version\n- Tests for all resolution paths\n- Documentation in README.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.951574-07:00","updated_at":"2025-10-16T12:22:47.888791-07:00","dependencies":[{"issue_id":"bd-277","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.075008-07:00","created_by":"auto-import"}]} -{"id":"bd-278","title":"Phase 1: Add sync state machine tracking","description":"Implement sync state tracking to show users current sync status and guide next actions.","design":"Sync states:\n- clean: DB = JSONL = Git (all synced)\n- dirty: DB ≠ JSONL (pending flush)\n- conflict: JSONL ≠ DB (collision detected)\n- ahead: Local commits not pushed\n- behind: Remote commits not pulled\n- diverged: Both ahead and behind\n\nAdd CheckSyncState() function that:\n- Checks dirty issues count\n- Runs git status to check ahead/behind\n- Compares JSONL hash with DB\n- Returns SyncState\n\nDisplay in bd status command.","acceptance_criteria":"- SyncState enum defined\n- CheckSyncState() implemented\n- Git status parsing (ahead/behind commits)\n- Dirty issues detection\n- JSONL hash comparison\n- bd status shows sync state\n- Color-coded status display\n- Guidance on next action\n- Tests for all states\n- Documentation in README.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.951689-07:00","updated_at":"2025-10-16T12:22:47.888937-07:00","dependencies":[{"issue_id":"bd-278","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.075194-07:00","created_by":"auto-import"}]} -{"id":"bd-279","title":"Phase 1: Add tests for concurrent edit scenarios","description":"Create comprehensive test suite for concurrent editing scenarios across multiple devices.","design":"Test scenarios:\n1. Two devices edit different fields (should merge cleanly)\n2. Two devices edit same field (collision)\n3. One device edits closed issue (local wins)\n4. Race condition: simultaneous push (git handles)\n5. Three-way merge with base version\n6. Version vector causal ordering\n7. Union merge for labels\n8. Dependency conflict resolution\n\nUse test fixtures with pre-created git history.","acceptance_criteria":"- Test suite in cmd/bd/sync_test.go\n- All 8+ concurrent edit scenarios covered\n- Test fixtures with git history\n- Mock git operations where needed\n- Tests verify correct merge behavior\n- Tests verify collision detection\n- Tests run in CI\n- Documentation in test comments\n\n---","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.951804-07:00","updated_at":"2025-10-16T12:22:47.889074-07:00","dependencies":[{"issue_id":"bd-279","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.075374-07:00","created_by":"auto-import"}]} -{"id":"bd-28","title":"Improve error handling in dependency removal during remapping","description":"In updateDependencyReferences(), RemoveDependency errors are caught and ignored with continue (line 392). Comment says 'if dependency doesn't exist' but this catches ALL errors including real failures. Should check error type with errors.Is(err, ErrDependencyNotFound) and only ignore not-found errors, returning other errors properly.","status":"open","priority":3,"issue_type":"bug","created_at":"2025-10-12T16:39:26.78219-07:00","updated_at":"2025-10-16T12:22:47.889213-07:00"} -{"id":"bd-280","title":"Phase 1: Document git-based sync workflow","description":"Add comprehensive documentation for git-based sync workflow to README.md and create dedicated SYNC.md guide.","design":"Documentation should cover:\n- Manual git workflow (current)\n- bd sync command usage\n- bd daemon for background sync\n- Git hooks installation\n- Conflict resolution strategies\n- Troubleshooting common issues\n- Best practices for multi-device work\n\nCreate SYNC.md with:\n- Quick start guide\n- Detailed workflow examples\n- Conflict resolution guide\n- FAQ section","acceptance_criteria":"- README.md updated with sync overview\n- SYNC.md created with detailed guide\n- Examples for all sync workflows\n- Conflict resolution examples\n- Troubleshooting section\n- FAQ section\n- Diagrams for workflows (optional)\n- Links from AGENTS.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.952098-07:00","updated_at":"2025-10-16T12:22:47.889338-07:00","dependencies":[{"issue_id":"bd-280","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.07555-07:00","created_by":"auto-import"}]} -{"id":"bd-281","title":"Phase 2: Implement bd serve command","description":"Create bd serve command to start HTTP API gateway server that wraps bd CLI commands.","design":"Gateway server provides:\n- REST API wrapping bd commands\n- WebSocket for real-time notifications\n- API key authentication\n- Auto-commit on changes\n- Periodic git pull\n- Webhook notifications to clients\n\nCommand flags:\n- --port=8080 (HTTP port)\n- --api-key=\u003ckey\u003e (auth key, auto-generated if not provided)\n- --auto-commit (commit changes immediately)\n- --auto-pull=5m (pull interval)\n- --allowed-ips=\u003clist\u003e (IP whitelist)\n\nArchitecture: Thin wrapper that executes bd CLI commands and manages git operations.","acceptance_criteria":"- bd serve command implemented\n- HTTP server with route handlers\n- API key authentication\n- Auto-commit on CRUD operations\n- Background git pull task\n- WebSocket server for notifications\n- Graceful shutdown on SIGTERM\n- Logging of all API requests\n- Tests for server lifecycle\n- Documentation in README.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.952216-07:00","updated_at":"2025-10-16T12:22:47.889479-07:00","dependencies":[{"issue_id":"bd-281","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.075733-07:00","created_by":"auto-import"}]} -{"id":"bd-282","title":"Phase 2: Implement REST API endpoints","description":"Implement REST API endpoints that wrap bd CLI commands for remote access.","design":"API endpoints:\n- GET /api/health - server status\n- GET /api/sync/status - git sync state\n- POST /api/sync/pull - trigger pull + import\n- POST /api/sync/push - trigger export + push\n- GET /api/issues - list issues\n- POST /api/issues - create issue\n- GET /api/issues/:id - get issue\n- PATCH /api/issues/:id - update issue\n- DELETE /api/issues/:id - close issue\n- POST /api/issues/:id/labels - add label\n- DELETE /api/issues/:id/labels/:l - remove label\n- POST /api/issues/:id/deps - add dependency\n- DELETE /api/issues/:id/deps/:d - remove dependency\n\nAll endpoints return JSON.\nAll mutations require authentication.\nAll responses include proper HTTP status codes.","acceptance_criteria":"- All API endpoints implemented\n- Handlers wrap bd CLI commands\n- JSON request/response format\n- Proper HTTP status codes\n- Error responses with details\n- Authentication on mutation endpoints\n- CORS headers for web clients\n- Rate limiting (optional)\n- API tests for all endpoints\n- OpenAPI/Swagger spec\n- Documentation in API.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.952325-07:00","updated_at":"2025-10-16T12:22:47.889641-07:00","dependencies":[{"issue_id":"bd-282","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.07595-07:00","created_by":"auto-import"}]} -{"id":"bd-283","title":"Phase 2: Implement WebSocket notifications","description":"Implement WebSocket server for real-time push notifications to connected clients.","design":"WebSocket protocol:\n- Client subscribes to events (issue.created, issue.updated, etc.)\n- Server pushes notifications when events occur\n- Clients can filter by status, priority, labels\n- Heartbeat to detect disconnections\n\nEvents:\n- issue.created\n- issue.updated\n- issue.closed\n- sync.required\n- sync.complete\n\nMessage format: JSON with type, timestamp, data.","acceptance_criteria":"- WebSocket server at /api/subscribe\n- Client subscription with filters\n- Event notification on CRUD ops\n- Heartbeat/ping-pong\n- Client disconnect handling\n- Reconnection support\n- Multiple concurrent clients\n- Tests for WebSocket protocol\n- Client library example (Go)\n- Documentation in API.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.952456-07:00","updated_at":"2025-10-16T12:22:47.88979-07:00","dependencies":[{"issue_id":"bd-283","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.076127-07:00","created_by":"auto-import"}]} -{"id":"bd-284","title":"Phase 2: Create Docker packaging for gateway","description":"Create Dockerfile and docker-compose.yml for easy gateway deployment.","design":"Multi-stage Dockerfile:\n1. Builder stage: compile Go binary\n2. Runtime stage: Alpine with git, sqlite\n3. Initialize git config\n4. Expose port 8080\n5. Volume mount for /data\n\ndocker-compose.yml:\n- Service: beads-gateway\n- Environment variables for config\n- Volume mount for persistence\n- Restart policy\n\nInclude .dockerignore for efficient builds.","acceptance_criteria":"- Dockerfile with multi-stage build\n- docker-compose.yml with config\n- .dockerignore file\n- Build script (scripts/docker-build.sh)\n- Environment variable configuration\n- Volume mount for data persistence\n- README.md with Docker instructions\n- Published to Docker Hub (optional)\n- Tests for Docker deployment\n- Documentation in DEPLOYMENT.md\n\n---","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.952578-07:00","updated_at":"2025-10-16T12:22:47.889933-07:00","dependencies":[{"issue_id":"bd-284","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.076295-07:00","created_by":"auto-import"}]} -{"id":"bd-285","title":"Phase 2: Implement API key authentication","description":"Implement secure API key authentication for gateway API access.","design":"Authentication:\n- Bearer token in Authorization header\n- Single API key for personal use\n- Optional IP whitelist for additional security\n- Generate secure random key on first start\n- Store hashed key in config file\n\nAPI key generation:\n- 32 bytes of crypto/rand\n- Base64 encoded\n- Display once on generation\n\nConfig storage:\n- ~/.beads/gateway-config.json\n- Contains hashed API key\n- Optional allowed_ips list","acceptance_criteria":"- API key generation function\n- Secure storage in config file\n- Bearer token authentication\n- Middleware for auth checking\n- IP whitelist support (optional)\n- 401 response for invalid auth\n- Key rotation support\n- Tests for authentication\n- Documentation in SECURITY.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.952692-07:00","updated_at":"2025-10-16T12:22:47.890104-07:00","dependencies":[{"issue_id":"bd-285","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.076463-07:00","created_by":"auto-import"}]} -{"id":"bd-286","title":"Phase 2: Add gateway stress tests","description":"Create stress tests to validate gateway performance under load and ensure it can handle production traffic.","design":"Test scenarios:\n1. Concurrent request handling (100+ clients)\n2. Large issue database (10,000+ issues)\n3. WebSocket connection limits\n4. Git lock contention\n5. Memory usage under load\n6. Response time percentiles (p50, p95, p99)\n\nUse Go testing tools:\n- testing.B for benchmarks\n- net/http/httptest for server testing\n- goroutines for concurrent clients","acceptance_criteria":"- Stress test suite in cmd/bd/serve_stress_test.go\n- Concurrent client test (100+ requests/sec)\n- Large database test (10k+ issues)\n- WebSocket stress test\n- Memory profiling test\n- Response time benchmarks\n- Git operation serialization test\n- Performance regression detection\n- Documentation in PERFORMANCE.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.960301-07:00","updated_at":"2025-10-16T12:22:47.89024-07:00","dependencies":[{"issue_id":"bd-286","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.076628-07:00","created_by":"auto-import"}]} -{"id":"bd-287","title":"Phase 2: Create API client library (Go)","description":"Create Go client library for accessing beads gateway API.","design":"Client library should provide:\n- Type-safe API calls\n- Authentication handling\n- Error handling and retries\n- WebSocket subscription\n- Automatic reconnection\n- Context support for cancellation\n\nPackage: github.com/steveyegge/beads/client\n\nExample usage:\n```go\nclient := beads.NewClient(\"http://gateway:8080\", \"api-key\")\nissue, err := client.GetIssue(ctx, \"bd-10\")\n```","acceptance_criteria":"- Go client library package\n- All API endpoints wrapped\n- Type-safe request/response\n- Authentication handling\n- Retry logic for transient errors\n- WebSocket client support\n- Context support\n- Example usage in examples/\n- Tests for client library\n- Documentation in CLIENT.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.962338-07:00","updated_at":"2025-10-16T12:22:47.89038-07:00","dependencies":[{"issue_id":"bd-287","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.076804-07:00","created_by":"auto-import"}]} -{"id":"bd-288","title":"Phase 2: Document gateway API","description":"Create comprehensive API documentation for gateway with examples and OpenAPI spec.","design":"Documentation should include:\n- Authentication guide\n- All endpoint descriptions\n- Request/response examples\n- Error codes and handling\n- WebSocket protocol\n- Rate limits\n- Best practices\n\nCreate OpenAPI 3.0 specification for:\n- Automated client generation\n- API testing tools\n- Documentation generation","acceptance_criteria":"- API.md with full documentation\n- OpenAPI 3.0 spec (api-spec.yaml)\n- Request/response examples for all endpoints\n- Authentication examples\n- WebSocket protocol documentation\n- Error response documentation\n- Code examples in multiple languages\n- Postman collection (optional)\n- Link from README.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.964881-07:00","updated_at":"2025-10-16T12:22:47.890509-07:00","dependencies":[{"issue_id":"bd-288","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.076965-07:00","created_by":"auto-import"}]} -{"id":"bd-289","title":"Phase 3: Implement bd config command for gateway","description":"Create bd config command to manage gateway configuration for transparent client-side gateway use.","design":"Config commands:\n- bd config set gateway \u003curl\u003e\n- bd config set api_key \u003ckey\u003e\n- bd config get gateway\n- bd config get api_key\n- bd config unset gateway\n- bd config list\n\nConfig storage: ~/.beads/config.json\n\nConfig keys:\n- gateway_url: URL of gateway server\n- api_key: Authentication key\n- auto_sync: Enable background sync\n- sync_interval: Sync check interval","acceptance_criteria":"- bd config command implemented\n- Set/get/unset/list subcommands\n- Config file at ~/.beads/config.json\n- Validation of config values\n- Secure storage of API key\n- Tests for config operations\n- Documentation in README.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.965442-07:00","updated_at":"2025-10-16T12:22:47.890668-07:00","dependencies":[{"issue_id":"bd-289","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.077136-07:00","created_by":"auto-import"}]} -{"id":"bd-29","title":"Use safer placeholder pattern in replaceIDReferences","description":"Currently uses __PLACEHOLDER_0__ which could theoretically collide with user text. Use a truly unique placeholder like null bytes: \\x00REMAP\\x00_0_\\x00 which are unlikely to appear in normal text. Located in collision.go:324. Very low probability issue but worth fixing for completeness.","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-12T16:39:33.665449-07:00","updated_at":"2025-10-16T12:22:47.890805-07:00"} -{"id":"bd-290","title":"Phase 3: Add transparent gateway detection","description":"Modify bd commands to transparently use gateway API when configured, with automatic fallback to local storage.","design":"Update storage layer to:\n1. Check for gateway config\n2. If gateway configured, use GatewayClient\n3. If gateway unavailable, fall back to local SQLite\n4. Cache gateway responses for offline use\n\nTransparent for these commands:\n- bd create\n- bd update\n- bd close\n- bd list\n- bd show\n- bd label\n- bd dep\n\nNo changes to command interface - works identically.","acceptance_criteria":"- Gateway detection in storage layer\n- GatewayClient wraps API calls\n- Automatic fallback to local on error\n- Response caching for offline mode\n- All CRUD commands work via gateway\n- Offline mode preserves functionality\n- Tests for gateway mode\n- Tests for fallback behavior\n- Documentation in README.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.968874-07:00","updated_at":"2025-10-16T12:22:47.890966-07:00","dependencies":[{"issue_id":"bd-290","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.077301-07:00","created_by":"auto-import"}]} -{"id":"bd-291","title":"Phase 3: Implement client-side sync daemon","description":"Create client-side background sync daemon for automatic synchronization with gateway.","design":"Sync daemon:\n- Runs in background\n- Polls gateway for updates every 30s\n- Pushes local changes to gateway\n- Handles sync conflicts\n- Logs sync activity\n\nCommands:\n- bd sync-daemon start\n- bd sync-daemon stop\n- bd sync-daemon status\n\nUses gateway WebSocket for real-time updates if available.","acceptance_criteria":"- Client sync daemon implemented\n- Background process management\n- Polling gateway for changes\n- Push local changes to gateway\n- WebSocket subscription for real-time\n- Conflict resolution\n- PID file management\n- Status command\n- Tests for sync daemon\n- Documentation in README.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.968995-07:00","updated_at":"2025-10-16T12:22:47.891126-07:00","dependencies":[{"issue_id":"bd-291","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.077474-07:00","created_by":"auto-import"}]} -{"id":"bd-292","title":"Phase 3: Add WebSocket subscription client","description":"Implement WebSocket client for subscribing to gateway notifications and receiving real-time updates.","design":"WebSocket client:\n- Connects to gateway /api/subscribe\n- Sends subscription request with filters\n- Receives event notifications\n- Handles disconnection and reconnection\n- Updates local DB on events\n\nIntegration with sync daemon:\n- Daemon subscribes to all events\n- On notification, triggers immediate sync\n- Reduces polling overhead","acceptance_criteria":"- WebSocket client implementation\n- Subscription with event filters\n- Event handler callbacks\n- Auto-reconnection logic\n- Integration with sync daemon\n- Local DB update on events\n- Connection state management\n- Tests for WebSocket client\n- Documentation in CLIENT.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.969144-07:00","updated_at":"2025-10-16T12:22:47.891318-07:00","dependencies":[{"issue_id":"bd-292","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.077641-07:00","created_by":"auto-import"}]} -{"id":"bd-293","title":"Phase 3: Add offline mode with local cache","description":"Implement offline mode that caches gateway responses locally for continued operation when gateway is unavailable.","design":"Offline cache:\n- SQLite cache of gateway responses\n- Automatic cache population on sync\n- Serve reads from cache when offline\n- Queue writes for later sync\n- Conflict detection on reconnect\n\nCache strategy:\n- Read-through: Check cache, then gateway\n- Write-behind: Queue, sync on reconnect\n- TTL for cache entries\n- Manual cache clear command","acceptance_criteria":"- Local cache database\n- Read-through caching\n- Write queue for offline writes\n- Sync queued writes on reconnect\n- Conflict detection after offline\n- Cache TTL and expiration\n- bd cache command (clear, status)\n- Tests for offline scenarios\n- Documentation in README.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.969275-07:00","updated_at":"2025-10-16T12:22:47.891508-07:00","dependencies":[{"issue_id":"bd-293","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.07781-07:00","created_by":"auto-import"}]} -{"id":"bd-294","title":"Phase 3: Create gateway integration tests","description":"Create end-to-end integration tests that verify gateway and client working together.","design":"Integration test scenarios:\n1. Client connects to gateway\n2. Create issue via gateway\n3. List issues via gateway\n4. Update issue via gateway\n5. WebSocket notification received\n6. Sync between multiple clients\n7. Offline mode and reconnect\n8. Conflict resolution\n\nUse Docker Compose to spin up gateway for tests.","acceptance_criteria":"- Integration test suite\n- Docker Compose for test environment\n- All CRUD operations tested\n- WebSocket notification test\n- Multi-client sync test\n- Offline/reconnect test\n- Conflict resolution test\n- Tests run in CI\n- Documentation in TESTING.md\n\n---","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.969397-07:00","updated_at":"2025-10-16T12:22:47.891652-07:00","dependencies":[{"issue_id":"bd-294","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.077996-07:00","created_by":"auto-import"}]} -{"id":"bd-295","title":"Phase 3: Document client gateway setup","description":"Create comprehensive documentation for setting up and using gateway mode.","design":"Documentation should cover:\n- Gateway deployment (Docker)\n- Client configuration (bd config)\n- Transparent gateway mode\n- Sync daemon setup\n- Offline mode\n- Troubleshooting\n- Best practices\n\nCreate GATEWAY.md with:\n- Quick start guide\n- Deployment options\n- Configuration reference\n- Usage examples\n- FAQ","acceptance_criteria":"- GATEWAY.md created\n- Quick start guide\n- Deployment instructions (Docker, binary)\n- Client setup instructions\n- Sync daemon guide\n- Offline mode documentation\n- Troubleshooting section\n- FAQ section\n- Links from README.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.970976-07:00","updated_at":"2025-10-16T12:22:47.894739-07:00","dependencies":[{"issue_id":"bd-295","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.078171-07:00","created_by":"auto-import"}]} -{"id":"bd-296","title":"Phase 4: Implement CRDT for automatic conflict resolution","description":"Implement Conflict-free Replicated Data Type (CRDT) semantics for automatic merge of concurrent edits without conflicts.","design":"CRDT strategies per field type:\n- Single-value fields (title, status): Last-Write-Wins with version vectors\n- Set fields (labels): G-Set (grow-only, union merge)\n- List fields (events): RGA (Replicated Growable Array)\n- Text fields: Operational transforms or delta-based\n\nAdd CRDT metadata:\n- Version vector per device\n- Logical clock per update\n- Tombstones for deletions\n\nRequires sync_metadata in JSONL (optional, backward compatible).","acceptance_criteria":"- CRDT logic for all field types\n- Last-Write-Wins for single-value\n- Union merge for sets\n- RGA for lists\n- Version vector comparison\n- Automatic conflict resolution\n- No manual resolution needed\n- Tests for concurrent updates\n- Documentation in DESIGN-GIT-SYNC.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.971359-07:00","updated_at":"2025-10-16T12:22:47.894963-07:00","dependencies":[{"issue_id":"bd-296","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.078345-07:00","created_by":"auto-import"}]} -{"id":"bd-297","title":"Phase 4: Add operational transforms for text fields","description":"Implement operational transforms (OT) for text fields to enable real-time collaborative editing of descriptions and notes.","design":"OT for text fields:\n- description\n- design\n- acceptance_criteria\n- notes\n\nOperations:\n- Insert(pos, text)\n- Delete(pos, len)\n- Transform operations for concurrent edits\n\nRequires real-time sync via WebSocket.\n\nAlternative: Use simpler delta-based approach with three-way merge.","acceptance_criteria":"- OT implementation for text fields\n- Insert/Delete operations\n- Transform function for concurrent ops\n- Integration with WebSocket sync\n- Tests for concurrent text edits\n- Performance acceptable for large text\n- Documentation in DESIGN-GIT-SYNC.md\n\n---","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-16T11:01:26.971505-07:00","updated_at":"2025-10-16T12:22:47.895138-07:00","dependencies":[{"issue_id":"bd-297","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.078532-07:00","created_by":"auto-import"}]} -{"id":"bd-298","title":"Phase 4: Add sync status to bd status command","description":"Enhance bd status command to show detailed sync status including gateway connection, sync state, and conflicts.","design":"bd status should display:\n- Sync state (clean/dirty/ahead/behind/diverged/conflict)\n- Gateway connection status (connected/offline)\n- Last sync timestamp\n- Pending changes count\n- Conflicts count\n- Sync daemon status (running/stopped)\n\nFormat:\n```\nSync Status:\n State: clean\n Gateway: connected (http://gateway:8080)\n Last sync: 2 minutes ago\n Pending: 0 issues\n Conflicts: 0\n Daemon: running (PID 12345)\n```","acceptance_criteria":"- Sync status in bd status output\n- Gateway connection check\n- Sync state display\n- Pending changes count\n- Conflicts list\n- Daemon status\n- Color-coded output\n- Tests for status display\n- Documentation in README.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.971631-07:00","updated_at":"2025-10-16T12:22:47.895294-07:00","dependencies":[{"issue_id":"bd-298","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.078721-07:00","created_by":"auto-import"}]} -{"id":"bd-299","title":"Phase 4: Add metrics and monitoring","description":"Add metrics collection and monitoring for gateway operations and sync performance.","design":"Metrics to collect:\n- API request count and latency\n- Sync operation count and duration\n- Conflict resolution count\n- WebSocket connection count\n- Git operation duration\n- Database query performance\n\nExpose metrics:\n- Prometheus format at /metrics\n- JSON format at /api/metrics\n\nOptional: Grafana dashboard template.","acceptance_criteria":"- Metrics collection implemented\n- Prometheus exposition format\n- Key metrics covered (requests, latency, sync)\n- /metrics endpoint\n- /api/metrics JSON endpoint\n- Grafana dashboard template\n- Documentation in MONITORING.md\n\n---","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-16T11:01:26.971795-07:00","updated_at":"2025-10-16T12:22:47.895455-07:00","dependencies":[{"issue_id":"bd-299","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.078895-07:00","created_by":"auto-import"}]} -{"id":"bd-3","title":"Normal task","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-12T00:43:03.461615-07:00","updated_at":"2025-10-16T12:22:47.895618-07:00"} -{"id":"bd-30","title":"Remove unused issueMap in scoreCollisions","description":"scoreCollisions() creates issueMap and populates it (lines 135-138) but never uses it. Either remove it or add a TODO comment explaining future use. Located in collision.go:135-138. Cosmetic cleanup.","status":"open","priority":4,"issue_type":"chore","created_at":"2025-10-12T16:39:40.101611-07:00","updated_at":"2025-10-16T12:22:47.895772-07:00"} -{"id":"bd-300","title":"Phase 4: Create performance benchmarks","description":"Create comprehensive performance benchmarks for sync operations and gateway API.","design":"Benchmarks for:\n1. JSONL import/export performance\n2. Collision detection performance\n3. Three-way merge performance\n4. Gateway API latency\n5. WebSocket throughput\n6. Concurrent client handling\n7. Large database operations (10k+ issues)\n\nUse Go benchmarking and profiling tools.\n\nTrack performance over time in CI.","acceptance_criteria":"- Benchmark suite implemented\n- All key operations benchmarked\n- CPU and memory profiling\n- Large database benchmarks\n- Concurrent operation benchmarks\n- CI integration for regression detection\n- Performance baseline documented\n- Documentation in PERFORMANCE.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.9723-07:00","updated_at":"2025-10-16T12:22:47.895936-07:00","dependencies":[{"issue_id":"bd-300","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.079094-07:00","created_by":"auto-import"}]} -{"id":"bd-301","title":"Phase 4: Add multi-gateway federation (optional)","description":"Add support for federating multiple gateway instances for distributed team workflows.","design":"Federation allows:\n- Multiple gateways sync with each other\n- Each gateway has authoritative set of issues\n- Peer-to-peer sync protocol\n- Conflict resolution across gateways\n\nArchitecture:\n- Gateway-to-gateway API\n- Peer discovery\n- Sync protocol between gateways\n- Distributed conflict resolution\n\nComplex feature - only if team usage emerges.","acceptance_criteria":"- Gateway federation protocol designed\n- Peer discovery mechanism\n- Gateway-to-gateway sync\n- Distributed conflict resolution\n- Tests for federation\n- Documentation in FEDERATION.md\n\n---","status":"open","priority":4,"issue_type":"feature","created_at":"2025-10-16T11:01:26.97242-07:00","updated_at":"2025-10-16T12:22:47.896125-07:00","dependencies":[{"issue_id":"bd-301","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.079569-07:00","created_by":"auto-import"}]} -{"id":"bd-302","title":"Phase 4: Create production deployment guide","description":"Create comprehensive production deployment guide for running gateway in production environments.","design":"Guide should cover:\n- Deployment options (Docker, Kubernetes, systemd)\n- Security best practices\n- Monitoring and alerting\n- Backup and recovery\n- Scaling considerations\n- Troubleshooting\n- Maintenance procedures","acceptance_criteria":"- DEPLOYMENT.md created\n- Docker deployment guide\n- Kubernetes manifests\n- Systemd service file\n- Security hardening checklist\n- Monitoring setup guide\n- Backup procedures\n- Troubleshooting section\n- Scaling recommendations\n- Links from README.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.972547-07:00","updated_at":"2025-10-16T12:22:47.896282-07:00","dependencies":[{"issue_id":"bd-302","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.082298-07:00","created_by":"auto-import"}]} -{"id":"bd-303","title":"Update README.md with git-sync overview","description":"Update main README.md to include overview of git-sync feature and link to detailed documentation.","design":"Add new section: \"Multi-Device Sync\"\n\nContent:\n- Brief overview of git-based sync\n- Link to SYNC.md for details\n- Link to GATEWAY.md for gateway mode\n- Quick start examples\n- Configuration options\n\nKeep brief - detailed docs in separate files.","acceptance_criteria":"- README.md updated with sync section\n- Links to SYNC.md and GATEWAY.md\n- Quick start examples\n- Configuration overview\n- Maintains existing structure\n- All links working\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.972663-07:00","updated_at":"2025-10-16T12:22:47.89644-07:00","dependencies":[{"issue_id":"bd-303","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.082489-07:00","created_by":"auto-import"}]} -{"id":"bd-304","title":"Create SYNC.md comprehensive guide","description":"Create detailed SYNC.md guide covering all aspects of git-based synchronization.","design":"Sections:\n1. Introduction\n2. Quick Start\n3. Manual Git Workflow\n4. bd sync Command\n5. bd daemon Background Sync\n6. Git Hooks\n7. Conflict Resolution\n8. Best Practices\n9. Troubleshooting\n10. FAQ\n\nInclude examples, code snippets, and diagrams.","acceptance_criteria":"- SYNC.md created with all sections\n- Quick start guide for new users\n- Detailed workflow examples\n- Conflict resolution guide\n- Best practices section\n- Troubleshooting with solutions\n- FAQ with common questions\n- Code examples working\n- Links from README.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.972791-07:00","updated_at":"2025-10-16T12:22:47.89755-07:00","dependencies":[{"issue_id":"bd-304","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.082869-07:00","created_by":"auto-import"}]} -{"id":"bd-305","title":"Create API.md for gateway API documentation","description":"Create comprehensive API.md documenting the gateway REST API and WebSocket protocol.","design":"Sections:\n1. Introduction\n2. Authentication\n3. REST Endpoints\n4. WebSocket Protocol\n5. Error Handling\n6. Rate Limits\n7. Examples\n\nFor each endpoint:\n- URL and method\n- Request parameters\n- Request body schema\n- Response schema\n- Error responses\n- Code example","acceptance_criteria":"- API.md created with all sections\n- All endpoints documented\n- Request/response schemas\n- WebSocket protocol docs\n- Error codes and handling\n- Rate limit documentation\n- Examples in multiple languages\n- Links from README.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.972924-07:00","updated_at":"2025-10-16T12:22:47.89858-07:00","dependencies":[{"issue_id":"bd-305","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.083087-07:00","created_by":"auto-import"}]} -{"id":"bd-306","title":"Close GH-11 (Docker support) or update with sync approach","description":"Resolve GitHub issue 11 about Docker support - either close as completed via gateway or update with new sync approach.","design":"Review GH-11 requirements:\n- User wants to use beads across multiple dev machines\n- Docker hosting was proposed solution\n\nNew approach:\n- Phase 1: Pure git-based sync (no Docker needed)\n- Phase 2: Optional Docker gateway for convenience\n- Addresses use case without mandating server\n\nUpdate GH-11 with:\n- Link to DESIGN-GIT-SYNC.md\n- Explain git-based approach\n- Note optional Docker gateway\n- Ask for feedback\n\nClose issue when sync features implemented.","acceptance_criteria":"- GH-11 reviewed and understood\n- Comment added explaining sync approach\n- Link to design document\n- User feedback requested\n- Issue closed when Phase 1-2 complete\n- Documentation cross-referenced","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.973135-07:00","updated_at":"2025-10-16T12:22:47.898838-07:00"} -{"id":"bd-307","title":"Fix circular dependency detection and prevention","description":"Implement robust detection, prevention, and user guidance for circular dependencies that cross edge types. Current system only prevents cycles within \"blocks\" type dependencies, allowing cross-type cycles (e.g., A blocks B, B parent-child A) that can hide work from ready list and confuse dependency visualization.","design":"Analysis shows that cycle prevention is type-specific (blocks only) while detection is type-agnostic. All current operations are safe from infinite loops (depth-limited), but semantic confusion and future maintenance hazards exist. Need validation, warnings, and potentially full cross-type prevention.","acceptance_criteria":"- Cross-type cycles are prevented or warned about\n- Semantic validation prevents child→parent dependencies\n- Users receive clear diagnostic messages\n- Documentation explains cycle handling behavior\n- All existing safe operations remain protected","status":"open","priority":1,"issue_type":"epic","created_at":"2025-10-16T11:01:26.973279-07:00","updated_at":"2025-10-16T12:22:47.898997-07:00"} -{"id":"bd-308","title":"Add semantic validation for parent-child dependency direction","description":"Prevent backwards parent-child dependencies where child tasks depend on their parent epics. This is semantically incorrect - parents should depend on children completing, not the reverse.","design":"Add validation in AddDependency that checks if dep.Type == DepParentChild and validates the direction is correct (parent depends on child, not child on parent). Reject with clear error message if direction is backwards.","acceptance_criteria":"- Child→parent dependencies are rejected with clear error\n- Parent→child dependencies work as expected\n- Error message explains correct direction\n- Tests cover both valid and invalid cases","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.9734-07:00","updated_at":"2025-10-16T12:22:47.899174-07:00","dependencies":[{"issue_id":"bd-308","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T11:01:27.083267-07:00","created_by":"auto-import"}]} -{"id":"bd-309","title":"Add diagnostic warnings when cycles are detected after dep add","description":"Run DetectCycles() after adding dependencies and warn users if cycles exist. Provide clear, actionable messages about which issues form the cycle and potential impact on ready work visibility.","design":"In bd dep add command, after successful dependency addition, call DetectCycles(). If cycles found, print warning to stderr showing cycle path and explanation. Include suggestion to run 'bd dep cycles' for full analysis.","acceptance_criteria":"- Warnings appear after dep add when cycles exist\n- Warning shows cycle path clearly\n- Explains impact on ready work calculation\n- Suggests next steps for user\n- Does not block operation (warning only)","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.973528-07:00","updated_at":"2025-10-16T12:22:47.899319-07:00","dependencies":[{"issue_id":"bd-309","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T11:01:27.08342-07:00","created_by":"auto-import"}]} -{"id":"bd-31","title":"Test issue for design field","description":"Testing the new update flags","design":"## Design Plan\\n- Add flags to update command\\n- Test thoroughly\\n- Document changes","acceptance_criteria":"- All three fields (design, notes, acceptance-criteria) can be updated\\n- Changes persist in database\\n- bd show displays the fields correctly","notes":"Implementation complete. All tests passing.","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-12T17:09:22.147446-07:00","updated_at":"2025-10-16T12:22:47.899482-07:00","closed_at":"2025-10-12T17:10:32.828906-07:00"} -{"id":"bd-310","title":"Document cycle handling behavior and limitations","description":"Add comprehensive documentation explaining which dependency types are checked for cycles, why cross-type cycles matter, what operations are safe, and how users should think about dependency design.","design":"Add comments to AddDependency explaining cycle checking logic. Update README.md with section on cycles. Add to DESIGN.md explaining technical decisions. Include examples of problematic and correct dependency patterns.","acceptance_criteria":"- Code comments explain cycle checking\n- README has user-facing cycle guidance\n- DESIGN.md has technical rationale\n- Examples show good and bad patterns\n- Explains ready work implications","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.976667-07:00","updated_at":"2025-10-16T12:22:47.899622-07:00","dependencies":[{"issue_id":"bd-310","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T11:01:27.083569-07:00","created_by":"auto-import"}]} -{"id":"bd-311","title":"Benchmark cycle detection performance on large dependency graphs","description":"Measure performance impact of cross-type cycle checking on large graphs (1000+ issues). Determine if optimization needed before enabling full prevention. Test various graph structures (sparse, dense, deeply nested).","design":"Create benchmark test with synthetic dependency graphs of varying sizes and structures. Measure AddDependency performance with type-specific vs all-types cycle checking. Document findings and optimization recommendations if needed.","acceptance_criteria":"- Benchmark test covers 100, 1000, 5000 issue graphs\n- Tests sparse and dense dependency patterns\n- Measures time for both checking approaches\n- Documents results in comments or DESIGN.md\n- Recommends optimization if \u003e100ms impact found","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.97681-07:00","updated_at":"2025-10-16T12:22:47.899783-07:00","dependencies":[{"issue_id":"bd-311","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T11:01:27.083721-07:00","created_by":"auto-import"}]} -{"id":"bd-312","title":"Implement cross-type cycle prevention in AddDependency","description":"Expand cycle detection to check ALL dependency types, not just \"blocks\" type. Currently A blocks B, B parent-child A is allowed but creates a cross-type cycle that hides work from ready list.","design":"Modify cycle check in AddDependency to traverse all dependency types using recursive CTE without type filter. Check if adding new dependency would create cycle across any combination of types. Include depth limit (100) to prevent infinite traversal.","acceptance_criteria":"- Cross-type cycles are prevented\n- Error message indicates cycle would be created\n- All dependency types are checked in traversal\n- Performance is acceptable (add benchmark)\n- Tests cover various cross-type cycle scenarios","notes":"Implementation complete with oracle feedback addressed:\n- Removed type filter from cycle detection (checks all types)\n- Extracted maxDependencyDepth=100 constant shared by AddDependency and DetectCycles\n- Moved cycle check before INSERT to avoid unnecessary write on failure\n- Added index verification (idx_dependencies_issue exists)\n- Added 6 comprehensive tests: self-dependency, related cycles (2-node, mixed), cross-type cycles (2-node, 3-node, discovered-from)\nAll tests pass.","status":"closed","priority":1,"issue_type":"task","assignee":"amp","created_at":"2025-10-16T11:01:26.976929-07:00","updated_at":"2025-10-16T12:22:47.899935-07:00","closed_at":"2025-10-16T11:01:26.976929-07:00","dependencies":[{"issue_id":"bd-312","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T11:01:27.084398-07:00","created_by":"auto-import"}]} -{"id":"bd-313","title":"stress_test_6","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.420341-07:00","updated_at":"2025-10-16T12:22:47.900097-07:00","closed_at":"2025-10-15T16:26:05.20809-07:00"} -{"id":"bd-314","title":"final_test_10","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.426442-07:00","updated_at":"2025-10-16T12:22:47.900251-07:00","closed_at":"2025-10-15T16:26:05.243566-07:00"} -{"id":"bd-315","title":"parallel_test_8","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.427791-07:00","updated_at":"2025-10-16T12:22:47.901536-07:00","closed_at":"2025-10-15T16:26:05.438754-07:00"} -{"id":"bd-316","title":"parallel_test_9","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.428643-07:00","updated_at":"2025-10-16T12:22:47.903025-07:00","closed_at":"2025-10-15T16:26:05.42663-07:00"} -{"id":"bd-317","title":"race_test_4","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.428918-07:00","updated_at":"2025-10-16T12:22:47.904907-07:00","closed_at":"2025-10-15T16:26:05.332082-07:00"} -{"id":"bd-318","title":"race_test_8","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.430681-07:00","updated_at":"2025-10-16T12:22:47.906003-07:00","closed_at":"2025-10-15T16:26:05.32001-07:00"} -{"id":"bd-319","title":"race_test_5","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.430908-07:00","updated_at":"2025-10-16T12:22:47.906755-07:00","closed_at":"2025-10-15T16:26:05.309177-07:00"} -{"id":"bd-32","title":"bd should auto-detect .beads/*.db in current directory","description":"When bd is run without --db flag, it defaults to beads' own database instead of looking for a .beads/*.db file in the current working directory. This causes confusion when working on other projects that use beads for issue tracking (like vc).\n\nExpected behavior: bd should search for .beads/*.db in cwd and use that if found, before falling back to default beads database.\n\nExample: Running 'bd ready' in /Users/stevey/src/vc/vc/ should automatically find and use .beads/vc.db without requiring --db flag every time.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-13T21:15:16.866255-07:00","updated_at":"2025-10-16T12:22:47.909129-07:00","closed_at":"2025-10-13T21:30:47.456341-07:00"} -{"id":"bd-320","title":"race_test_16","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.431212-07:00","updated_at":"2025-10-16T12:22:47.910778-07:00","closed_at":"2025-10-15T16:26:05.298238-07:00"} -{"id":"bd-321","title":"race_test_17","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.431475-07:00","updated_at":"2025-10-16T12:22:47.911385-07:00","closed_at":"2025-10-15T16:26:05.286761-07:00"} -{"id":"bd-322","title":"race_test_10","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.431704-07:00","updated_at":"2025-10-16T12:22:47.912701-07:00","closed_at":"2025-10-15T16:26:05.273032-07:00"} -{"id":"bd-323","title":"race_test_11","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.431947-07:00","updated_at":"2025-10-16T12:22:47.914209-07:00","closed_at":"2025-10-15T16:26:05.259986-07:00"} -{"id":"bd-324","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.","notes":"Awaiting user feedback - cannot reproduce locally, waiting for user to provide more details about environment and error message","status":"blocked","priority":1,"issue_type":"bug","created_at":"2025-10-16T11:57:33.433602-07:00","updated_at":"2025-10-16T12:22:47.91734-07:00","external_ref":"gh-3"} -{"id":"bd-325","title":"final_test_7","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.434103-07:00","updated_at":"2025-10-16T12:22:47.922684-07:00","closed_at":"2025-10-15T16:26:05.231737-07:00"} -{"id":"bd-326","title":"stress_test_5","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.434321-07:00","updated_at":"2025-10-16T12:22:47.923207-07:00","closed_at":"2025-10-15T16:26:05.220545-07:00"} -{"id":"bd-327","title":"parallel_test_3","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.434526-07:00","updated_at":"2025-10-16T12:22:47.924161-07:00","closed_at":"2025-10-15T16:26:05.451664-07:00"} -{"id":"bd-328","title":"parallel_test_10","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.434725-07:00","updated_at":"2025-10-16T12:22:47.924782-07:00","closed_at":"2025-10-15T16:26:05.46431-07:00"} -{"id":"bd-329","title":"parallel_test_2","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.434944-07:00","updated_at":"2025-10-16T12:22:47.925435-07:00","closed_at":"2025-10-15T16:26:05.345118-07:00"} -{"id":"bd-33","title":"Document or automate JSONL sync workflow for git collaboration","description":"When using beads across multiple machines/environments via git, there's a workflow gap:\n\n1. Machine A: Create issues → stored in .beads/project.db\n2. Machine A: bd export -o .beads/issues.jsonl\n3. Machine A: git add .beads/issues.jsonl \u0026\u0026 git commit \u0026\u0026 git push\n4. Machine B: git pull\n5. Machine B: ??? issues.jsonl exists but project.db is empty/stale\n\nThe missing step is: bd import --db .beads/project.db -i .beads/issues.jsonl\n\nThis needs to be either:\na) Documented clearly in workflow docs\nb) Automated (e.g., git hook, or bd auto-imports if jsonl is newer than db)\nc) Both\n\nReal-world impact: User had Claude Code on GCP VM create vc issues from BOOTSTRAP.md. They were exported to issues.jsonl and committed. But on local machine, vc.db was empty until manual import was run.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-13T21:15:30.271236-07:00","updated_at":"2025-10-16T12:22:47.92566-07:00","closed_at":"2025-10-13T22:47:51.587822-07:00"} -{"id":"bd-330","title":"parallel_test_5","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.435158-07:00","updated_at":"2025-10-16T12:22:47.925809-07:00","closed_at":"2025-10-15T16:26:05.358813-07:00"} -{"id":"bd-331","title":"stress_test_1","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.435529-07:00","updated_at":"2025-10-16T12:22:47.925951-07:00","closed_at":"2025-10-15T16:26:05.190223-07:00"} -{"id":"bd-332","title":"parallel_test_6","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.435801-07:00","updated_at":"2025-10-16T12:22:47.926624-07:00","closed_at":"2025-10-15T16:26:05.375985-07:00"} -{"id":"bd-333","title":"parallel_test_7","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.436019-07:00","updated_at":"2025-10-16T12:22:47.926806-07:00","closed_at":"2025-10-15T16:26:05.391941-07:00"} -{"id":"bd-334","title":"parallel_test_4","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.438273-07:00","updated_at":"2025-10-16T12:22:47.926941-07:00","closed_at":"2025-10-15T16:26:05.404261-07:00"} -{"id":"bd-335","title":"parallel_test_1","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.438508-07:00","updated_at":"2025-10-16T12:22:47.929353-07:00","closed_at":"2025-10-15T16:26:05.415413-07:00"} -{"id":"bd-336","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":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:57:33.438712-07:00","updated_at":"2025-10-16T12:22:47.932056-07:00","closed_at":"2025-10-15T17:14:14.451905-07:00"} -{"id":"bd-337","title":"Add performance benchmarks document","description":"Document actual performance metrics with hyperfine tests","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-16T11:57:33.43892-07:00","updated_at":"2025-10-16T12:22:47.932506-07:00","closed_at":"2025-10-15T20:59:04.025996-07:00","dependencies":[{"issue_id":"bd-337","depends_on_id":"bd-341","type":"parent-child","created_at":"2025-10-16T11:57:33.61498-07:00","created_by":"import-remap"}]} -{"id":"bd-338","title":"Add migration scripts for GitHub Issues","description":"Create scripts to import from GitHub Issues API or exported JSON","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:57:33.439174-07:00","updated_at":"2025-10-16T12:22:47.932905-07:00","closed_at":"2025-10-15T21:00:51.057232-07:00","dependencies":[{"issue_id":"bd-338","depends_on_id":"bd-341","type":"parent-child","created_at":"2025-10-16T11:57:33.608413-07:00","created_by":"import-remap"}]} -{"id":"bd-339","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","notes":"## Profiling Results (2025-10-15)\n\nCreated comprehensive profiling tests in cmd/bd/import_profile_test.go.\n\n### Key Findings\n\nImport performance is actually **very good** for the core phases:\n- 1000 issues: 883ms total (1,132 issues/sec)\n- 208 issues collision detection: 3.2ms (64,915 issues/sec)\n\n### Bottleneck Identified\n\n**Create/Update phase takes 95-98% of total time:**\n- 100 issues: 58ms (87.4%)\n- 500 issues: 214ms (95.8%) \n- 1000 issues: 866ms (98.1%)\n\nThis phase does N*2 individual queries (GetIssue + CreateIssue/UpdateIssue) with no transaction batching.\n\n### Next Steps\n\n1. Profile dependency import phase (not yet measured)\n2. Check for auto-flush lock contention\n3. Investigate WAL checkpoint blocking\n4. Consider transaction batching for bulk imports\n\n### Test Command\n\n```bash\ngo test -v -run TestImportPerformance ./cmd/bd/\n```\n\nSee test file for detailed instrumentation.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-16T11:57:33.439382-07:00","updated_at":"2025-10-16T12:22:47.933107-07:00","closed_at":"2025-10-15T02:49:22.700881-07:00"} -{"id":"bd-34","title":"Implement reserved database name _.db","description":"Auto-detection now skips .beads/_.db to prevent pollution when beads dogfoods itself. This allows beads to use its own issue tracker without interfering with other projects using beads in the same directory tree. Implementation includes filtering in findDatabase(), stopping directory walk when .beads/ is found, and documentation in README.md and CLAUDE.md.","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-13T21:46:15.189582-07:00","updated_at":"2025-10-16T12:22:47.933297-07:00","closed_at":"2025-10-13T21:54:26.388271-07:00"} -{"id":"bd-340","title":"Low priority chore","description":"","status":"closed","priority":4,"issue_type":"chore","created_at":"2025-10-16T11:57:33.439623-07:00","updated_at":"2025-10-16T12:22:47.933512-07:00","closed_at":"2025-10-15T20:58:30.418891-07:00","dependencies":[{"issue_id":"bd-340","depends_on_id":"bd-341","type":"parent-child","created_at":"2025-10-16T11:57:33.614623-07:00","created_by":"import-remap"}]} -{"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:22:47.933875-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:22:47.934516-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:22:47.935648-07:00","closed_at":"2025-10-15T02:52:17.500349-07:00","external_ref":"gh-6"} -{"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:22:47.936712-07:00","closed_at":"2025-10-13T22:22:38.359968-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:22:47.937375-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:22:47.939219-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:22:47.939421-07:00","closed_at":"2025-10-13T23:22:47.805211-07:00"} -{"id":"bd-39","title":"Optimize auto-flush to use incremental updates","description":"Every flush exports ALL issues and ALL dependencies, even if only one issue changed. For large projects (1000+ issues), this could be expensive. Current approach guarantees consistency, which is fine for MVP, but future optimization could track which issues changed and use incremental updates. Located in cmd/bd/main.go:255-276.","status":"closed","priority":3,"issue_type":"feature","created_at":"2025-10-13T22:34:59.26425-07:00","updated_at":"2025-10-16T12:22:47.939577-07:00","closed_at":"2025-10-14T00:08:51.834812-07:00"} -{"id":"bd-4","title":"Low priority chore","description":"","status":"open","priority":4,"issue_type":"chore","created_at":"2025-10-12T10:50:49.500051-07:00","updated_at":"2025-10-16T12:22:47.939711-07:00","dependencies":[{"issue_id":"bd-4","depends_on_id":"bd-8","type":"parent-child","created_at":"2025-10-16T11:57:33.880323-07:00","created_by":"import"}]} -{"id":"bd-40","title":"Make auto-flush debounce duration configurable","description":"flushDebounce is hardcoded to 5 seconds. Make it configurable via environment variable BEADS_FLUSH_DEBOUNCE (e.g., '500ms', '10s'). Current 5-second value is reasonable for interactive use, but CI/automated scenarios might want faster flush. Add getDebounceDuration() helper function. Located in cmd/bd/main.go:31.","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-13T22:35:06.126282-07:00","updated_at":"2025-10-16T12:22:47.940074-07:00"} -{"id":"bd-41","title":"Add godoc comments for auto-flush functions","description":"Add comprehensive godoc comments for findJSONLPath(), markDirtyAndScheduleFlush(), and flushToJSONL() explaining behavior, concurrency considerations, and error handling. Include notes about debouncing behavior (timer resets on each write, flush occurs 5s after LAST operation) and flush-on-exit guarantees. Located in cmd/bd/main.go:188-307.","status":"open","priority":4,"issue_type":"chore","created_at":"2025-10-13T22:35:13.518442-07:00","updated_at":"2025-10-16T12:22:47.940226-07:00"} -{"id":"bd-42","title":"Add test coverage for auto-flush feature","description":"Add comprehensive tests for auto-flush functionality:\\n- Test that markDirtyAndScheduleFlush() is called after CRUD operations\\n- Test debounce timing (rapid operations result in single flush)\\n- Test --no-auto-flush flag disables feature\\n- Test flush on program exit\\n- Test concurrent operations don't cause races\\n- Test error scenarios (disk full, permission denied, etc.)\\n- Test import command triggers auto-flush\\n\\nCurrent implementation has no test coverage for the auto-flush feature. Located in cmd/bd/main_test.go (to be created).","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-13T22:35:22.079794-07:00","updated_at":"2025-10-16T12:22:47.940381-07:00","closed_at":"2025-10-13T23:36:28.90411-07:00"} -{"id":"bd-43","title":"Test auto-sync feature","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-13T22:47:41.738165-07:00","updated_at":"2025-10-16T12:22:47.940543-07:00","closed_at":"2025-10-13T22:48:02.844213-07:00"} -{"id":"bd-44","title":"Regular auto-ID issue","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-13T23:16:29.970089-07:00","updated_at":"2025-10-16T12:22:47.944249-07:00","closed_at":"2025-10-13T23:16:45.231439-07:00"} -{"id":"bd-45","title":"Test flush tracking","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-13T23:22:18.472476-07:00","updated_at":"2025-10-16T12:22:47.94718-07:00","closed_at":"2025-10-13T23:22:31.397095-07:00"} -{"id":"bd-46","title":"Test export cancels timer","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-13T23:26:20.523923-07:00","updated_at":"2025-10-16T12:22:47.95396-07:00","closed_at":"2025-10-13T23:26:35.813165-07:00"} -{"id":"bd-47","title":"Test incremental export","description":"Testing bd-39 implementation","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T00:06:24.42044-07:00","updated_at":"2025-10-16T12:22:47.957087-07:00","closed_at":"2025-10-14T00:14:45.968261-07:00"} -{"id":"bd-48","title":"Test incremental 2","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T00:07:14.157987-07:00","updated_at":"2025-10-16T12:22:47.959027-07:00","closed_at":"2025-10-14T00:14:45.968593-07:00"} -{"id":"bd-49","title":"Final test","description":"Testing with new binary","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:07:46.650341-07:00","updated_at":"2025-10-16T12:22:47.959445-07:00","closed_at":"2025-10-14T00:14:45.968699-07:00"} -{"id":"bd-5","title":"Test issue","description":"Testing prefix","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-12T10:50:50.942964-07:00","updated_at":"2025-10-16T12:22:47.959611-07:00","closed_at":"2025-10-13T23:20:41.816853-07:00","dependencies":[{"issue_id":"bd-5","depends_on_id":"bd-341","type":"parent-child","created_at":"2025-10-16T11:57:33.662677-07:00","created_by":"import-remap"},{"issue_id":"bd-5","depends_on_id":"bd-8","type":"parent-child","created_at":"2025-10-16T11:57:33.88059-07:00","created_by":"import"}]} -{"id":"bd-50","title":"Test label dirty tracking","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T00:14:25.484565-07:00","updated_at":"2025-10-16T12:22:47.960171-07:00","closed_at":"2025-10-14T00:14:45.968771-07:00"} -{"id":"bd-51","title":"Test hash-based import","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T00:16:00.850055-07:00","updated_at":"2025-10-16T12:22:47.961974-07:00","closed_at":"2025-10-14T00:19:19.355078-07:00"} -{"id":"bd-52","title":"Create Claude Code plugin for beads","description":"Package beads as a Claude Code plugin for easy installation via /plugin command.\n\nContext: GitHub issue #28 - https://github.com/steveyegge/beads/issues/28\n\nCurrent state:\n- MCP server exists in integrations/beads-mcp/\n- No plugin packaging yet\n\nDeliverables:\n1. .claude-plugin/plugin.json with metadata\n2. .claude-plugin/marketplace.json for distribution\n3. Custom slash commands (/bd-ready, /bd-create, /bd-show, etc.)\n4. Bundle MCP server configuration\n5. Optional: Pre-configured hooks for auto-sync\n6. Documentation for installation and usage\n\nBenefits:\n- Makes beads instantly discoverable in Claude Code ecosystem\n- Single-command installation vs. manual setup\n- Bundled cohesive experience\n- Lowers adoption barrier significantly\n\nReferences:\n- https://www.anthropic.com/news/claude-code-plugins\n- https://docs.claude.com/en/docs/claude-code/plugins","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-14T00:21:46.229671-07:00","updated_at":"2025-10-16T12:22:47.963124-07:00","closed_at":"2025-10-14T00:29:31.174835-07:00"} -{"id":"bd-53","title":"Research Claude Code plugin structure and requirements","description":"Study the plugin format, required files, and best practices.\n\nTasks:\n- Review official plugin documentation\n- Examine example plugins if available\n- Document plugin.json schema\n- Understand marketplace.json requirements\n- Identify slash command format","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:21:47.327014-07:00","updated_at":"2025-10-16T12:22:47.963294-07:00","closed_at":"2025-10-14T00:29:31.179483-07:00","dependencies":[{"issue_id":"bd-53","depends_on_id":"bd-52","type":"parent-child","created_at":"2025-10-14T17:11:11.537724-07:00","created_by":"auto-import"}]} -{"id":"bd-54","title":"Create plugin metadata files","description":"Create .claude-plugin/plugin.json and marketplace.json.\n\nRequirements:\n- Name, description, version, author\n- MCP server configuration bundling\n- License and repository info\n- Installation instructions","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:21:48.404838-07:00","updated_at":"2025-10-16T12:22:47.963434-07:00","closed_at":"2025-10-14T00:32:51.521595-07:00","dependencies":[{"issue_id":"bd-54","depends_on_id":"bd-52","type":"parent-child","created_at":"2025-10-14T17:11:11.537903-07:00","created_by":"auto-import"}]} -{"id":"bd-55","title":"Design and implement slash commands","description":"Create useful slash commands for beads workflow.\n\nProposed commands:\n- /bd-ready - Show ready work\n- /bd-create - Create new issue interactively\n- /bd-show - Show issue details\n- /bd-update - Update issue status\n- /bd-close - Close issue\n- /bd-workflow - Show full agent workflow guide\n\nEach command should provide a good UX and leverage the MCP server tools.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:22:04.773185-07:00","updated_at":"2025-10-16T12:22:47.963596-07:00","closed_at":"2025-10-16T11:01:27.027801-07:00","dependencies":[{"issue_id":"bd-55","depends_on_id":"bd-52","type":"parent-child","created_at":"2025-10-14T17:11:11.538059-07:00","created_by":"auto-import"}]} -{"id":"bd-56","title":"Write plugin documentation","description":"Create comprehensive documentation for the plugin.\n\nContents:\n- Installation instructions\n- Available commands\n- MCP tools reference\n- Configuration options\n- Examples and workflows\n- Troubleshooting guide","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:22:05.619682-07:00","updated_at":"2025-10-16T12:22:47.96374-07:00","closed_at":"2025-10-14T00:35:43.188168-07:00","dependencies":[{"issue_id":"bd-56","depends_on_id":"bd-52","type":"parent-child","created_at":"2025-10-14T17:11:11.538197-07:00","created_by":"auto-import"}]} -{"id":"bd-57","title":"Test plugin installation and functionality","description":"Verify the plugin works end-to-end.\n\nTest cases:\n- Fresh installation via /plugin command\n- All slash commands work correctly\n- MCP server tools are accessible\n- Configuration options work\n- Documentation is accurate\n- Works in both terminal and VS Code","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:22:06.46476-07:00","updated_at":"2025-10-16T12:22:47.963894-07:00","closed_at":"2025-10-16T11:01:27.02947-07:00","dependencies":[{"issue_id":"bd-57","depends_on_id":"bd-52","type":"parent-child","created_at":"2025-10-14T17:11:11.538331-07:00","created_by":"auto-import"}]} -{"id":"bd-58","title":"Parent's blocker should block children in ready work calculation","description":"GitHub issue #19: If epic1 blocks epic2, children of epic2 should also be considered blocked when calculating ready work. Currently epic2's children show as ready even though their parent is blocked. This breaks the natural hierarchy of dependencies and can cause agents to work on tasks out of order.\n\nExpected: ready work calculation should traverse up parent-child hierarchy and check if any ancestor has blocking dependencies.\n\nSee: https://github.com/anthropics/claude-code/issues/19","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-14T00:22:07.567867-07:00","updated_at":"2025-10-16T12:22:47.964097-07:00","closed_at":"2025-10-16T11:01:27.030171-07:00"} -{"id":"bd-59","title":"Add composite index on dependencies(depends_on_id, type)","description":"The hierarchical blocking query does:\nJOIN dependencies d ON d.depends_on_id = bt.issue_id\nWHERE d.type = 'parent-child'\n\nCurrently we only have idx_dependencies_depends_on (line 41 in schema.go), which covers depends_on_id but not the type filter.\n\n**Impact:**\n- Query has to scan ALL dependencies for a given depends_on_id, then filter by type\n- With 10k+ issues and many dependencies, this could cause slowdowns\n- The blocker propagation happens recursively, amplifying the cost\n\n**Solution:**\nAdd composite index: CREATE INDEX idx_dependencies_depends_on_type ON dependencies(depends_on_id, type)\n\n**Testing:**\nRun EXPLAIN QUERY PLAN on GetReadyWork query before/after to verify index usage.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:22:08.949261-07:00","updated_at":"2025-10-16T12:22:47.966022-07:00","closed_at":"2025-10-16T11:01:27.03157-07:00"} -{"id":"bd-6","title":"Add migration scripts for GitHub Issues","description":"Create scripts to import from GitHub Issues API or exported JSON","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-12T10:50:52.140018-07:00","updated_at":"2025-10-16T12:22:47.966934-07:00","dependencies":[{"issue_id":"bd-6","depends_on_id":"bd-8","type":"parent-child","created_at":"2025-10-16T11:57:33.880917-07:00","created_by":"import"}]} -{"id":"bd-60","title":"Update ready_issues VIEW to use hierarchical blocking","description":"The ready_issues VIEW (schema.go:97-108) uses the OLD blocking logic that doesn't propagate through parent-child hierarchies.\n\n**Problem:**\n- GetReadyWork() function now uses recursive CTE with propagation\n- But the ready_issues VIEW still uses simple NOT EXISTS check\n- Any code using the VIEW will get DIFFERENT results than GetReadyWork()\n- This creates inconsistency and confusion\n\n**Impact:**\n- Unknown if the VIEW is actually used anywhere in the codebase\n- If it is used, it's returning incorrect results (showing children as ready when parent is blocked)\n\n**Solution:**\nEither:\n1. Update VIEW to match GetReadyWork logic (complex CTE in a view)\n2. Drop the VIEW entirely if unused\n3. Make VIEW call GetReadyWork as a function (if SQLite supports it)\n\n**Investigation needed:**\nGrep for 'ready_issues' to see if the view is actually used.","notes":"**Investigation results:**\nGrepped the codebase - the ready_issues VIEW appears in:\n- schema.go (definition)\n- WORKFLOW.md, DESIGN.md (documentation)\n- No actual Go code queries it directly\n\n**Conclusion:** The VIEW is defined but appears UNUSED by actual code. GetReadyWork() function is used instead.\n\n**Recommended solution:** Drop the VIEW entirely to avoid confusion. It serves no purpose if unused and creates a maintenance burden (needs to stay in sync with GetReadyWork logic).\n\n**Alternative:** If we want to keep it for direct SQL access, update the VIEW definition to match the new recursive CTE logic.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-14T00:22:19.075914-07:00","updated_at":"2025-10-16T12:22:47.96711-07:00","closed_at":"2025-10-16T11:01:27.032845-07:00"} -{"id":"bd-61","title":"Add test for deep hierarchy blocking (50+ levels)","description":"Current tests verify 2-level depth (grandparent → parent → child). The depth limit is hardcoded to 50 in the recursive CTE, but we don't test edge cases near that limit.\n\n**Test cases needed:**\n1. Verify 50-level deep hierarchy works correctly\n2. Verify depth limit prevents runaway recursion\n3. Measure performance impact of deep hierarchies\n4. Consider if 50 is the right limit (why not 100? why not 20?)\n\n**Rationale:**\n- Most hierarchies are 2-5 levels deep\n- But pathological cases (malicious or accidental) could create 50+ level nesting\n- Need to ensure graceful degradation, not catastrophic failure\n\n**Implementation:**\nAdd TestDeepHierarchyBlocking to ready_test.go","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T00:22:20.33128-07:00","updated_at":"2025-10-16T12:22:47.967466-07:00","closed_at":"2025-10-16T11:01:27.0337-07:00"} -{"id":"bd-62","title":"Document hierarchical blocking behavior in README","description":"The fix for bd-58 changes user-visible behavior: children of blocked epics are now automatically blocked.\n\n**What needs documenting:**\n1. README.md dependency section should explain blocking propagation\n2. Clarify that 'blocks' + 'parent-child' together create transitive blocking\n3. Note that 'related' and 'discovered-from' do NOT propagate blocking\n4. Add example showing epic → child blocking propagation\n\n**Example to add:**\n```bash\n# If epic is blocked, children are too\nbd create \"Epic 1\" -t epic -p 1\nbd create \"Task 1\" -t task -p 1\nbd dep add task-1 epic-1 --type parent-child\n\n# Block the epic\nbd create \"Blocker\" -t task -p 0\nbd dep add epic-1 blocker-1 --type blocks\n\n# Now both epic-1 AND task-1 are blocked\nbd ready # Neither will show up\n```","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T01:14:45.357198-07:00","updated_at":"2025-10-16T12:22:47.969332-07:00","closed_at":"2025-10-14T01:20:31.049608-07:00"} -{"id":"bd-63","title":"Add EXPLAIN QUERY PLAN tests for ready work query","description":"Verify that the hierarchical blocking query uses proper indexes and doesn't do full table scans.\n\n**Queries to analyze:**\n1. The recursive CTE (both base case and recursive case)\n2. The final SELECT with NOT EXISTS\n3. Impact of various filters (status, priority, assignee)\n\n**Implementation:**\nAdd test function that:\n- Runs EXPLAIN QUERY PLAN on GetReadyWork query\n- Parses output to verify no SCAN TABLE operations\n- Documents expected query plan in comments\n- Fails if query plan degrades\n\n**Benefits:**\n- Catch performance regressions in tests\n- Document expected query behavior\n- Ensure indexes are being used\n\nRelated to: bd-59 (composite index on depends_on_id, type)","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:19:37.745731-07:00","updated_at":"2025-10-16T12:22:47.971564-07:00"} -{"id":"bd-64","title":"Verify and test Claude Code plugin","description":"Address remaining items from code review:\n\nCritical:\n1. Test plugin installation locally with /plugin marketplace add\n2. Verify ${CLAUDE_PLUGIN_ROOT} variable works correctly\n3. Test each slash command works\n4. Test @task-agent execution\n5. Verify MCP server connects properly\n\nDocumentation:\n1. Clarify 'one-command installation' vs prerequisites\n2. Add note about plugin development status\n3. Verify all paths and examples work\n\nNice-to-have:\n1. Add icon for marketplace (optional)\n2. Add categories field to plugin.json\n3. Add engines field for version compatibility","notes":"PLUGIN IMPLEMENTATION COMPLETE - READY FOR TESTING\n\nWhat was built:\n✅ .claude-plugin/plugin.json - Plugin metadata with MCP server config\n✅ .claude-plugin/marketplace.json - Marketplace configuration\n✅ 9 slash commands in .claude-plugin/commands/:\n - bd-ready, bd-create, bd-show, bd-update, bd-close\n - bd-workflow, bd-init, bd-stats, bd-version\n✅ Task agent in .claude-plugin/agents/task-agent.md\n✅ PLUGIN.md - Comprehensive documentation\n✅ README.md - Updated with plugin section\n✅ Version sync - All components at 0.9.2\n\nTesting Instructions for Next Agent:\n=====================================\n\n1. INSTALL PLUGIN FROM GITHUB:\n /plugin marketplace add steveyegge/beads\n /plugin install beads\n \n2. RESTART CLAUDE CODE (required for MCP server)\n\n3. TEST SLASH COMMANDS:\n /bd-version # Check versions (should show 0.9.2)\n /bd-workflow # Show workflow guide\n /bd-stats # Show project stats\n /bd-ready # Find ready work\n /bd-create \"Test plugin\" task 2\n /bd-show bd-\u003cid\u003e\n \n4. TEST MCP SERVER:\n /mcp # Verify 'beads' server appears\n \n5. TEST TASK AGENT:\n @task-agent # If supported in Claude Code\n \n6. VERIFY:\n - All commands work without errors\n - MCP tools are accessible\n - Version checking works\n - Documentation is accurate\n\nExpected Issues:\n- May need to adjust MCP server path variable (${CLAUDE_PLUGIN_ROOT})\n- Task agent syntax might differ\n- Some commands may need refinement based on actual usage\n\nIf testing fails, check:\n- bd CLI is in PATH: which bd\n- uv is installed: which uv\n- MCP server logs in Claude Code\n- PLUGIN.md troubleshooting section\n\nCommit references:\n- 9f38375: feat: Add Claude Code plugin for beads\n- d25fc53: feat: Add version compatibility checking\n- c0f1044: fix: Sync all component versions to 0.9.2\n- a5c71f0: feat: Add version bump script\n- a612b92: docs: Add version management to CLAUDE.md","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T01:23:23.041743-07:00","updated_at":"2025-10-16T12:22:47.971844-07:00","closed_at":"2025-10-15T01:08:12.811809-07:00","dependencies":[{"issue_id":"bd-64","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.634172-07:00","created_by":"import-remap"},{"issue_id":"bd-64","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.881158-07:00","created_by":"import"}]} -{"id":"bd-65","title":"Document versioning and release strategy","description":"Create comprehensive versioning strategy for beads ecosystem.\n\nComponents to document:\n1. bd CLI (Go binary) - main version number\n2. Plugin (Claude Code) - tracks CLI version\n3. MCP server (Python) - bundled with plugin\n4. Release workflow - how to sync all three\n\nDecisions to make:\n- Should plugin.json auto-update from bd CLI version?\n- Should we have a VERSION file at repo root?\n- How to handle breaking changes across components?\n- What's the update notification strategy?\n\nReferences:\n- plugin.json engines field now requires bd \u003e=0.9.0\n- /bd-version command added for checking compatibility\n- PLUGIN.md now documents update workflow","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T01:23:32.02232-07:00","updated_at":"2025-10-16T12:22:47.97205-07:00","closed_at":"2025-10-14T01:32:38.263621-07:00","dependencies":[{"issue_id":"bd-65","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.611729-07:00","created_by":"import-remap"},{"issue_id":"bd-65","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.88143-07:00","created_by":"import"}]} -{"id":"bd-66","title":"Sync versions to 0.9.2 across all components","description":"Version mismatch discovered: bd CLI is 0.9.2 but other components still at 0.9.0 or 1.0.0.\n\nCurrent state:\n- bd CLI (cmd/bd/version.go): 0.9.2 ✓\n- Plugin (.claude-plugin/plugin.json): 0.9.0 ✗\n- MCP Server (integrations/beads-mcp): 1.0.0 ✗\n- README.md: 0.9.0 ✗\n\nFiles to update:\n1. .claude-plugin/plugin.json\n2. integrations/beads-mcp/pyproject.toml\n3. README.md (all mentions)\n4. PLUGIN.md (if any mentions)\n5. CHANGELOG.md (add 0.9.1 and 0.9.2 entries)\n\nRoot cause: Version bumps only updated version.go, not other components.\nSolution needed: Script or process to sync versions across all files.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-14T01:23:40.61527-07:00","updated_at":"2025-10-16T12:22:47.972227-07:00","closed_at":"2025-10-14T01:33:10.337387-07:00","dependencies":[{"issue_id":"bd-66","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.615657-07:00","created_by":"import-remap"},{"issue_id":"bd-66","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.881672-07:00","created_by":"import"}]} -{"id":"bd-67","title":"Create version bump script","description":"Create scripts/bump-version.sh to automate version syncing across all components.\n\nThe script should:\n1. Take a version number as argument (e.g., ./scripts/bump-version.sh 0.9.3)\n2. Update all version files:\n - cmd/bd/version.go (Version constant)\n - .claude-plugin/plugin.json (version field)\n - .claude-plugin/marketplace.json (plugins[].version)\n - integrations/beads-mcp/pyproject.toml (version field)\n - README.md (Alpha version mention)\n - PLUGIN.md (version requirements)\n3. Validate semantic versioning format\n4. Show diff preview before applying\n5. Optionally create git commit with standard message\n\nThis prevents the version mismatch issue that occurred when only version.go was updated.\n\nRelated: bd-66 (version sync issue)","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T01:23:48.488537-07:00","updated_at":"2025-10-16T12:22:47.972376-07:00","closed_at":"2025-10-14T01:33:52.447248-07:00","dependencies":[{"issue_id":"bd-67","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.666641-07:00","created_by":"import-remap"},{"issue_id":"bd-67","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.88189-07:00","created_by":"import"}]} -{"id":"bd-68","title":"Add system-wide/multi-repo support for beads","description":"GitHub issue #4 requests ability to use beads across multiple projects and for system-wide task tracking.\n\nCurrent limitation: beads is per-repository isolated. Each project has its own .beads/ directory and issues cannot reference issues in other projects.\n\nPotential approaches:\n1. Global beads instance in ~/.beads/global.db for cross-project work\n2. Project references - allow issues to link across repos\n3. Multi-project workspace support - one beads instance managing multiple repos\n4. Integration with existing MCP server to provide remote multi-project access\n\nUse cases:\n- System administrators tracking work across multiple machines/repos\n- Developers working on a dozen+ projects simultaneously\n- Cross-cutting concerns that span multiple repositories\n- Global todo list with project-specific subtasks\n\nRelated:\n- GitHub issue #4: https://github.com/steveyegge/beads/issues/4\n- Comparison to membank MCP which already supports multi-project via centralized server\n- MCP server at integrations/beads-mcp/ could be extended for this\n\nSee also: Testing framework for plugins (also from GH #4)","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-14T01:23:57.134825-07:00","updated_at":"2025-10-16T12:22:47.972632-07:00","dependencies":[{"issue_id":"bd-68","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.616067-07:00","created_by":"import-remap"},{"issue_id":"bd-68","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.883157-07:00","created_by":"import"}]} -{"id":"bd-69","title":"Add coverage threshold to CI pipeline","description":"Current CI runs tests with coverage but doesn't enforce minimum threshold. Add step to fail if coverage drops below target.\n\nCurrent coverage: 60%\nRecommended thresholds:\n- Warn: 55%\n- Fail: 50%\n\nThis prevents coverage regression while allowing gradual improvement toward 80% target for 1.0.\n\nImplementation:\n1. Add coverage check step after test run\n2. Use 'go tool cover -func=coverage.out' to get total\n3. Parse percentage and compare to threshold\n4. Optionally: Use codecov's built-in threshold features\n\nRelated to test coverage improvement work (upcoming issue).","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T01:24:06.079067-07:00","updated_at":"2025-10-16T12:22:47.974397-07:00","closed_at":"2025-10-16T11:01:27.036654-07:00","dependencies":[{"issue_id":"bd-69","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.61096-07:00","created_by":"import-remap"},{"issue_id":"bd-69","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.883553-07:00","created_by":"import"}]} -{"id":"bd-7","title":"Add performance benchmarks document","description":"Document actual performance metrics with hyperfine tests","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-12T10:50:53.294516-07:00","updated_at":"2025-10-16T12:22:47.9746-07:00","dependencies":[{"issue_id":"bd-7","depends_on_id":"bd-8","type":"parent-child","created_at":"2025-10-16T11:57:33.884234-07:00","created_by":"import"}]} -{"id":"bd-70","title":"Increase test coverage for auto-flush and auto-import features","description":"Critical features have 0% test coverage despite being core workflow functionality.\n\n**Uncovered areas (0% coverage):**\n\nAuto-flush/Auto-import (dirty tracking):\n- MarkIssueDirty / MarkIssuesDirty\n- GetDirtyIssues / GetDirtyIssueCount\n- ClearDirtyIssues / ClearDirtyIssuesByID\n- Auto-flush debouncing logic\n- Auto-import hash comparison\n\nDatabase/file discovery:\n- FindDatabasePath (finds .beads/*.db in directory tree)\n- FindJSONLPath (finds issues.jsonl)\n- findDatabaseInTree helper\n\nLabel operations:\n- AddLabel / RemoveLabel\n- GetLabels / GetIssuesByLabel\n\nEvents/Comments:\n- AddComment\n- GetEvents\n- GetStatistics\n\nMetadata storage:\n- SetMetadata / GetMetadata (used for import hash tracking)\n\nCLI output formatting:\n- outputJSON\n- printCollisionReport / printRemappingReport\n- createIssuesFromMarkdown\n\n**Priority areas:**\n1. Auto-flush/import (highest risk - core workflow)\n2. Database discovery (second - affects all operations)\n3. Labels/events (lower priority - less commonly used)\n\n**Test approach:**\n- Add unit tests for dirty tracking in sqlite package\n- Add integration tests for auto-flush timing and debouncing\n- Add tests for import hash detection and idempotency\n- Add tests for database discovery edge cases (permissions, nested dirs)\n\n**Target:** Get overall coverage from 60% → 75%, focus on cmd/bd (currently 24.1%)\n\n**Note:** These features work well in practice (dogfooding proves it) but edge cases (disk full, permissions, concurrent access, race conditions) are untested.","notes":"Test coverage significantly improved! Added comprehensive test suites:\n\n**Tests Added:**\n1. ✅ Dirty tracking (dirty_test.go): 8 tests\n - MarkIssueDirty, MarkIssuesDirty, GetDirtyIssues, ClearDirtyIssues\n - GetDirtyIssueCount, ClearDirtyIssuesByID\n - Ordering and timestamp update tests\n - Coverage: 75-100% for all functions\n\n2. ✅ Metadata storage (sqlite_test.go): 4 tests\n - SetMetadata, GetMetadata with various scenarios\n - Coverage: 100%\n\n3. ✅ Label operations (labels_test.go): 9 tests\n - AddLabel, RemoveLabel, GetLabels, GetIssuesByLabel\n - Duplicate handling, empty cases, dirty marking\n - Coverage: 71-82%\n\n4. ✅ Events \u0026 Comments (events_test.go): 7 tests\n - AddComment, GetEvents with limits\n - Timestamp updates, dirty marking\n - Multiple event types in history\n - Coverage: 73-92%\n\n5. ✅ Database/JSONL discovery (beads_test.go): 8 tests\n - FindDatabasePath with env var, tree search, home default\n - FindJSONLPath with existing files, defaults, multiple files\n - Coverage: 89-100%\n\n**Coverage Results:**\n- Overall: 70.3% (up from ~60%)\n- beads package: 90.6%\n- sqlite package: 74.7% (up from 60.8%)\n- types package: 100%\n\n**Impact:**\nAll priority 1 features now have solid test coverage. Auto-flush/import, metadata storage, labels, and events are thoroughly tested with edge cases covered.\n\nFiles created:\n- internal/storage/sqlite/dirty_test.go (8 tests)\n- internal/storage/sqlite/labels_test.go (9 tests)\n- internal/storage/sqlite/events_test.go (7 tests)\n- beads_test.go (8 tests)\n\nFiles modified:\n- internal/storage/sqlite/sqlite_test.go (added 4 metadata tests)\n\n**Next Steps (if desired):**\n- CLI output formatting tests (outputJSON, printCollisionReport, etc.)\n- Integration tests for auto-flush debouncing timing\n- More edge cases for concurrent access","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T01:24:15.473927-07:00","updated_at":"2025-10-16T12:22:47.974805-07:00","closed_at":"2025-10-15T01:16:00.571791-07:00","dependencies":[{"issue_id":"bd-70","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.608898-07:00","created_by":"import-remap"},{"issue_id":"bd-70","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.884452-07:00","created_by":"import"}]} -{"id":"bd-71","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":"Status update: All P0-P1 critical tasks completed! bd-64 (performance), bd-65 (migration), bd-66 (fatal error), bd-67 (comments) are all done. Atomic counter implementation is now production-ready. Remaining tasks are P2-P3 enhancements.","status":"open","priority":1,"issue_type":"epic","created_at":"2025-10-14T01:24:27.716237-07:00","updated_at":"2025-10-16T12:22:47.974974-07:00"} -{"id":"bd-72","title":"Test performance - issue 1","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T01:27:53.520056-07:00","updated_at":"2025-10-16T12:22:47.975126-07:00"} -{"id":"bd-73","title":"Performance test 1","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.931707-07:00","updated_at":"2025-10-16T12:22:47.975268-07:00"} -{"id":"bd-74","title":"Performance test 2","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.936642-07:00","updated_at":"2025-10-16T12:22:47.975411-07:00"} -{"id":"bd-75","title":"Performance test 3","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.941591-07:00","updated_at":"2025-10-16T12:22:47.975553-07:00"} -{"id":"bd-76","title":"Performance test 4","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.946053-07:00","updated_at":"2025-10-16T12:22:47.975694-07:00"} -{"id":"bd-77","title":"Performance test 5","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.950618-07:00","updated_at":"2025-10-16T12:22:47.97586-07:00"} -{"id":"bd-78","title":"Performance test 6","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.955773-07:00","updated_at":"2025-10-16T12:22:47.976911-07:00"} -{"id":"bd-79","title":"Performance test 7","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.96021-07:00","updated_at":"2025-10-16T12:22:47.977072-07:00"} -{"id":"bd-8","title":"Reach 1.0 release milestone","description":"Stabilize API, finalize documentation, comprehensive testing","status":"open","priority":1,"issue_type":"epic","created_at":"2025-10-12T10:50:54.457348-07:00","updated_at":"2025-10-16T12:22:47.977221-07:00"} -{"id":"bd-80","title":"Performance test 8","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.964861-07:00","updated_at":"2025-10-16T12:22:47.977623-07:00"} -{"id":"bd-81","title":"Performance test 9","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.969882-07:00","updated_at":"2025-10-16T12:22:47.977768-07:00"} -{"id":"bd-82","title":"Performance test 10","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.974738-07:00","updated_at":"2025-10-16T12:22:47.978437-07:00"} -{"id":"bd-83","title":"Add external_ref field for tracking GitHub issues","description":"Add optional external_ref field to issues table to track external references like 'gh-9', 'jira-ABC', etc. Includes schema migration, CLI flags (--external-ref for create/update), and tests. This enables linking bd issues to GitHub issues for better workflow integration.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-14T02:27:01.187087-07:00","updated_at":"2025-10-16T12:22:47.98408-07:00","closed_at":"2025-10-14T02:34:54.508385-07:00"} -{"id":"bd-84","title":"Auto-import fails in git workflows due to mtime issues","description":"The auto-import mechanism (autoImportIfNewer) relies on file modification time comparison between JSONL and DB. This breaks in git workflows because git does not preserve original file modification times - pulled files get fresh mtimes based on checkout time.\n\nRoot causes:\n1. Git checkout sets mtime to 'now', not original commit time\n2. Auto-import compares JSONL mtime vs DB mtime (line 181 in main.go)\n3. If DB was recently modified (agents working), mtime check fails\n4. Auto-import silently returns without feedback\n5. Agents continue with stale database state\n\nThis caused issues in VC project where 3 parallel agents:\n- Pulled updated .beads/issues.jsonl from git\n- Auto-import didn't trigger (JSONL appeared older than DB)\n- Agents couldn't find their assigned issues\n- Agents exported from wrong database, corrupting JSONL","design":"Recommended approach: Checksum-based sync (option 3 from original design)\n\n## Solution: Hash-based content comparison\n\nReplace mtime comparison with JSONL content hash comparison:\n\n1. **Compute JSONL hash on startup**:\n - SHA256 hash of .beads/issues.jsonl contents\n - Fast enough for typical repos (\u003c1MB = ~20ms)\n - Only computed once per command invocation\n\n2. **Store last import hash in DB**:\n - Add metadata table if not exists: CREATE TABLE IF NOT EXISTS metadata (key TEXT PRIMARY KEY, value TEXT)\n - Store hash after successful import: INSERT OR REPLACE INTO metadata (key, value) VALUES ('last_import_hash', '\u003chash\u003e')\n - Query on startup: SELECT value FROM metadata WHERE key = 'last_import_hash'\n\n3. **Compare hashes instead of mtimes**:\n - If JSONL hash != stored hash: auto-import (content changed)\n - If JSONL hash == stored hash: skip import (no changes)\n - If no stored hash: fall back to mtime comparison (backward compat)\n\n4. **Update autoImportIfNewer() in cmd/bd/main.go**:\n - Lines 155-279 currently use mtime comparison (line 181)\n - Replace with hash comparison\n - Keep mtime as fallback for old DBs without metadata table\n\n## Implementation Details\n\n### New storage interface method:\n```go\n// In internal/storage/storage.go\ntype Storage interface {\n // ... existing methods ...\n GetMetadata(ctx context.Context, key string) (string, error)\n SetMetadata(ctx context.Context, key, value string) error\n}\n```\n\n### Migration:\n```go\n// In internal/storage/sqlite/sqlite.go init\nCREATE TABLE IF NOT EXISTS metadata (\n key TEXT PRIMARY KEY,\n value TEXT NOT NULL\n);\n```\n\n### Updated autoImportIfNewer():\n```go\nfunc autoImportIfNewer() {\n jsonlPath := findJSONLPath()\n \n // Check if JSONL exists\n jsonlData, err := os.ReadFile(jsonlPath)\n if err != nil {\n return // No JSONL, skip\n }\n \n // Compute current hash\n hasher := sha256.New()\n hasher.Write(jsonlData)\n currentHash := hex.EncodeToString(hasher.Sum(nil))\n \n // Get last import hash from DB\n ctx := context.Background()\n lastHash, err := store.GetMetadata(ctx, \"last_import_hash\")\n if err != nil {\n // No metadata support (old DB) - fall back to mtime comparison\n autoImportIfNewerByMtime()\n return\n }\n \n // Compare hashes\n if currentHash == lastHash {\n return // No changes, skip import\n }\n \n // Content changed - import\n if err := importJSONLSilent(jsonlPath, jsonlData); err != nil {\n return // Import failed, skip\n }\n \n // Store new hash\n _ = store.SetMetadata(ctx, \"last_import_hash\", currentHash)\n}\n```\n\n## Benefits\n\n- **Git-proof**: Works regardless of file timestamps\n- **Universal**: Works with git, Dropbox, rsync, manual edits\n- **Backward compatible**: Falls back to mtime for old DBs\n- **Efficient**: SHA256 is fast (~20ms for 1MB)\n- **Accurate**: Only imports when content actually changed\n- **No user action**: Fully automatic, invisible\n\n## Performance Optimization\n\nFor very large repos (\u003e10MB JSONL):\n- Only hash if mtime changed (combine both checks)\n- Use incremental hashing if metadata table tracks line count\n- Consider sampling hash (first 1MB + last 1MB)\n\nBut start simple - full hash is fast enough for 99% of use cases.\n\n## Rollout Plan\n\n1. Add metadata table + Get/SetMetadata methods (backward compatible)\n2. Update autoImportIfNewer() with hash logic + mtime fallback\n3. Test with old and new DBs\n4. Ship in next minor version (v0.10.0)\n5. Document in CHANGELOG as \"more reliable auto-import\"\n6. Git hooks remain optional but unnecessary for most users","acceptance_criteria":"- Auto-import works correctly after git pull\n- Agents in parallel workflows see consistent database state\n- Clear feedback when import is needed\n- Performance acceptable for large databases\n- Works in both git and non-git workflows\n- Documentation updated with multi-agent best practices","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-14T02:37:34.073953-07:00","updated_at":"2025-10-16T12:22:47.984305-07:00","closed_at":"2025-10-16T11:06:31.156795-07:00"} -{"id":"bd-85","title":"GH-1: Fix bd dep tree graph display issues","description":"Tree display has several issues: 1) Epic items may not expand all sub-items, 2) Subitems repeat multiple times at same level, 3) Items with multiple blockers appear multiple times. The tree visualization doesn't properly handle graph structures with multiple dependencies.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-14T02:44:28.702222-07:00","updated_at":"2025-10-16T12:22:47.986904-07:00","closed_at":"2025-10-14T03:06:51.74719-07:00","external_ref":"gh-1"} -{"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:22:47.992301-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:22:47.994614-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:22:47.994804-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:22:47.994977-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:22:47.995201-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:22:47.995431-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:22:47.995784-07:00","closed_at":"2025-10-14T12:42:14.457949-07:00","external_ref":"gh-9"} -{"id":"bd-92","title":"GH-11: Add Docker support for hosted/shared instance","description":"Request for Docker container hosting to use beads across multiple dev machines. Would need to consider: centralized database (PostgreSQL?), authentication, concurrent access, API server, etc. This is a significant architectural change from the current local-first model.","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-14T02:44:58.469094-07:00","updated_at":"2025-10-16T12:22:47.99593-07:00","external_ref":"gh-11"} -{"id":"bd-93","title":"GH-18: Add --deps flag to bd create for one-command issue creation","description":"Request to add dependency specification to bd create command instead of requiring separate 'bd dep add' command. Proposed syntax: bd create 'Fix bug' --deps discovered-from=bd-20. This would be especially useful for aider integration and reducing command verbosity.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-14T02:44:59.610192-07:00","updated_at":"2025-10-16T12:22:47.996462-07:00","closed_at":"2025-10-14T03:26:59.536349-07:00","external_ref":"gh-18"} -{"id":"bd-94","title":"parallel_test_1","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.913771-07:00","updated_at":"2025-10-16T12:22:47.996626-07:00"} -{"id":"bd-95","title":"parallel_test_4","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.920107-07:00","updated_at":"2025-10-16T12:22:47.996785-07:00"} -{"id":"bd-96","title":"parallel_test_7","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.920612-07:00","updated_at":"2025-10-16T12:22:47.996914-07:00"} -{"id":"bd-97","title":"parallel_test_6","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.931334-07:00","updated_at":"2025-10-16T12:22:47.997863-07:00"} -{"id":"bd-98","title":"parallel_test_5","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.932369-07:00","updated_at":"2025-10-16T12:22:47.998912-07:00"} -{"id":"bd-99","title":"parallel_test_2","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.946379-07:00","updated_at":"2025-10-16T12:22:47.999084-07:00"} -{"id":"test-100","title":"Test issue with explicit ID","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-13T23:16:20.601292-07:00","updated_at":"2025-10-16T12:22:47.999228-07:00","closed_at":"2025-10-13T23:16:45.231096-07:00"} -{"id":"test-500","title":"Root issue for dep tree test","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:03:20.195117-07:00","updated_at":"2025-10-16T12:22:47.999614-07:00","closed_at":"2025-10-14T03:06:42.688954-07:00","dependencies":[{"issue_id":"test-500","depends_on_id":"test-501","type":"blocks","created_at":"2025-10-14T03:03:28.960169-07:00","created_by":"stevey"},{"issue_id":"test-500","depends_on_id":"test-502","type":"blocks","created_at":"2025-10-14T03:03:28.964808-07:00","created_by":"stevey"}]} -{"id":"test-501","title":"Dependency A","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:03:21.377968-07:00","updated_at":"2025-10-16T12:22:47.999781-07:00","closed_at":"2025-10-14T03:06:42.693557-07:00","dependencies":[{"issue_id":"test-501","depends_on_id":"test-503","type":"blocks","created_at":"2025-10-14T03:03:28.969145-07:00","created_by":"stevey"}]} -{"id":"test-502","title":"Dependency B","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:03:21.383498-07:00","updated_at":"2025-10-16T12:22:48.000088-07:00","closed_at":"2025-10-14T03:06:42.697908-07:00","dependencies":[{"issue_id":"test-502","depends_on_id":"test-503","type":"blocks","created_at":"2025-10-14T03:03:28.973659-07:00","created_by":"stevey"}]} -{"id":"test-503","title":"Shared dependency C","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:03:21.388441-07:00","updated_at":"2025-10-16T12:22:48.000229-07:00","closed_at":"2025-10-14T03:06:42.702632-07:00"} -{"id":"test-600","title":"Epic test","description":"","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-10-14T03:06:14.495832-07:00","updated_at":"2025-10-16T12:22:48.001188-07:00","closed_at":"2025-10-14T03:06:42.706851-07:00","dependencies":[{"issue_id":"test-600","depends_on_id":"test-601","type":"parent-child","created_at":"2025-10-14T03:06:15.846921-07:00","created_by":"stevey"},{"issue_id":"test-600","depends_on_id":"test-602","type":"parent-child","created_at":"2025-10-14T03:06:15.851564-07:00","created_by":"stevey"}]} -{"id":"test-601","title":"Task A under epic","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:06:14.500446-07:00","updated_at":"2025-10-16T12:22:48.002029-07:00","closed_at":"2025-10-14T03:06:42.71108-07:00","dependencies":[{"issue_id":"test-601","depends_on_id":"test-603","type":"blocks","created_at":"2025-10-14T03:06:15.856369-07:00","created_by":"stevey"}]} -{"id":"test-602","title":"Task B under epic","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:06:14.504917-07:00","updated_at":"2025-10-16T12:22:48.002172-07:00","closed_at":"2025-10-14T03:06:42.715283-07:00","dependencies":[{"issue_id":"test-602","depends_on_id":"test-604","type":"blocks","created_at":"2025-10-14T03:06:15.860979-07:00","created_by":"stevey"}]} -{"id":"test-603","title":"Sub-task under A","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:06:14.509748-07:00","updated_at":"2025-10-16T12:22:48.003504-07:00","closed_at":"2025-10-14T03:06:42.719842-07:00"} -{"id":"test-604","title":"Sub-task under B","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:06:14.514628-07:00","updated_at":"2025-10-16T12:22:48.004953-07:00","closed_at":"2025-10-14T03:06:42.724998-07:00"} -{"id":"worker2-500","title":"Another explicit ID","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-13T23:16:29.978183-07:00","updated_at":"2025-10-16T12:22:48.005097-07:00","closed_at":"2025-10-13T23:16:45.231376-07:00"} +{"id":"bd-1","title":"Critical bug","description":"","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-12T00:43:03.453438-07:00","updated_at":"2025-10-16T12:50:18.777342-07:00","closed_at":"2025-10-12T20:20:06.977679-07:00"} +{"id":"bd-10","title":"Add PostgreSQL backend","description":"Implement PostgreSQL storage backend as alternative to SQLite for larger teams","status":"closed","priority":3,"issue_type":"feature","created_at":"2025-10-12T14:32:19.163526-07:00","updated_at":"2025-10-16T12:50:18.787016-07:00","closed_at":"2025-10-12T15:07:47.937992-07:00","dependencies":[{"issue_id":"bd-10","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:35:59.213222-07:00","created_by":"stevey"}]} +{"id":"bd-100","title":"parallel_test_10","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.946477-07:00","updated_at":"2025-10-16T12:50:18.790127-07:00"} +{"id":"bd-101","title":"parallel_test_3","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.971429-07:00","updated_at":"2025-10-16T12:50:18.790674-07:00"} +{"id":"bd-102","title":"parallel_test_8","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.997449-07:00","updated_at":"2025-10-16T12:50:18.790951-07:00"} +{"id":"bd-103","title":"parallel_test_9","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.998608-07:00","updated_at":"2025-10-16T12:50:18.791204-07:00"} +{"id":"bd-104","title":"parallel_26","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.254662-07:00","updated_at":"2025-10-16T12:50:18.791439-07:00"} +{"id":"bd-105","title":"parallel_31","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.255055-07:00","updated_at":"2025-10-16T12:50:18.793099-07:00"} +{"id":"bd-106","title":"parallel_32","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.255348-07:00","updated_at":"2025-10-16T12:50:18.793573-07:00"} +{"id":"bd-107","title":"parallel_33","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.255454-07:00","updated_at":"2025-10-16T12:50:18.795507-07:00"} +{"id":"bd-108","title":"parallel_28","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.255731-07:00","updated_at":"2025-10-16T12:50:18.808748-07:00"} +{"id":"bd-109","title":"parallel_29","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.255867-07:00","updated_at":"2025-10-16T12:50:18.809317-07:00"} +{"id":"bd-11","title":"Test issue to verify fix","description":"This should be bd-11 if the fix works","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-12T14:40:21.419082-07:00","updated_at":"2025-10-16T12:50:18.814268-07:00","closed_at":"2025-10-12T14:40:32.963312-07:00"} +{"id":"bd-110","title":"parallel_27","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.255932-07:00","updated_at":"2025-10-16T12:50:18.814854-07:00"} +{"id":"bd-111","title":"parallel_30","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.258491-07:00","updated_at":"2025-10-16T12:50:18.815089-07:00"} +{"id":"bd-112","title":"parallel_35","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.258879-07:00","updated_at":"2025-10-16T12:50:18.815286-07:00"} +{"id":"bd-113","title":"parallel_34","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:51.265162-07:00","updated_at":"2025-10-16T12:50:18.815477-07:00"} +{"id":"bd-114","title":"stress_3","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.092233-07:00","updated_at":"2025-10-16T12:50:18.815685-07:00"} +{"id":"bd-115","title":"stress_5","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.092311-07:00","updated_at":"2025-10-16T12:50:18.81702-07:00"} +{"id":"bd-116","title":"stress_10","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.093319-07:00","updated_at":"2025-10-16T12:50:18.817273-07:00"} +{"id":"bd-117","title":"stress_2","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.093453-07:00","updated_at":"2025-10-16T12:50:18.823105-07:00"} +{"id":"bd-118","title":"stress_8","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.093516-07:00","updated_at":"2025-10-16T12:50:18.828605-07:00"} +{"id":"bd-119","title":"stress_13","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.094405-07:00","updated_at":"2025-10-16T12:50:18.833851-07:00"} +{"id":"bd-12","title":"Implement collision detection in import","description":"Create collision.go with detectCollisions() function. Compare incoming JSONL issues against DB state. Distinguish between: (1) exact match (idempotent), (2) ID match but different content (collision), (3) new issue. Return list of colliding issues.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-12T14:40:56.056588-07:00","updated_at":"2025-10-16T12:50:18.834194-07:00","closed_at":"2025-10-12T16:06:25.575038-07:00","dependencies":[{"issue_id":"bd-12","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:41:07.947358-07:00","created_by":"stevey"}]} +{"id":"bd-120","title":"stress_14","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.094519-07:00","updated_at":"2025-10-16T12:50:18.83439-07:00"} +{"id":"bd-121","title":"stress_1","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.095805-07:00","updated_at":"2025-10-16T12:50:18.834575-07:00"} +{"id":"bd-122","title":"stress_7","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.096461-07:00","updated_at":"2025-10-16T12:50:18.834769-07:00"} +{"id":"bd-123","title":"stress_17","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.096904-07:00","updated_at":"2025-10-16T12:50:18.842186-07:00"} +{"id":"bd-124","title":"stress_6","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.097331-07:00","updated_at":"2025-10-16T12:50:18.847044-07:00"} +{"id":"bd-125","title":"stress_19","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.098391-07:00","updated_at":"2025-10-16T12:50:18.851863-07:00"} +{"id":"bd-126","title":"stress_20","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.098827-07:00","updated_at":"2025-10-16T12:50:18.85271-07:00"} +{"id":"bd-127","title":"stress_15","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.099861-07:00","updated_at":"2025-10-16T12:50:18.852972-07:00"} +{"id":"bd-128","title":"stress_24","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.100328-07:00","updated_at":"2025-10-16T12:50:18.853914-07:00"} +{"id":"bd-129","title":"stress_18","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.100957-07:00","updated_at":"2025-10-16T12:50:18.854234-07:00"} +{"id":"bd-13","title":"Implement reference scoring algorithm","description":"Count references for each colliding issue: text mentions in descriptions/notes/design fields + dependency references. Sort collisions by score ascending (fewest refs first). This minimizes total updates during renumbering.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-12T14:40:56.204518-07:00","updated_at":"2025-10-16T12:50:18.854495-07:00","closed_at":"2025-10-12T16:26:46.572201-07:00","dependencies":[{"issue_id":"bd-13","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:41:07.951605-07:00","created_by":"stevey"}]} +{"id":"bd-130","title":"stress_22","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.101073-07:00","updated_at":"2025-10-16T12:50:18.854746-07:00"} +{"id":"bd-131","title":"stress_28","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.101635-07:00","updated_at":"2025-10-16T12:50:18.854996-07:00"} +{"id":"bd-132","title":"stress_25","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.101763-07:00","updated_at":"2025-10-16T12:50:18.855222-07:00"} +{"id":"bd-133","title":"stress_29","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.102151-07:00","updated_at":"2025-10-16T12:50:18.85545-07:00"} +{"id":"bd-134","title":"stress_26","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.102208-07:00","updated_at":"2025-10-16T12:50:18.855658-07:00"} +{"id":"bd-135","title":"stress_9","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.103216-07:00","updated_at":"2025-10-16T12:50:18.85586-07:00"} +{"id":"bd-136","title":"stress_30","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.103737-07:00","updated_at":"2025-10-16T12:50:18.85628-07:00"} +{"id":"bd-137","title":"stress_32","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.104085-07:00","updated_at":"2025-10-16T12:50:18.856542-07:00"} +{"id":"bd-138","title":"stress_16","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.104635-07:00","updated_at":"2025-10-16T12:50:18.856753-07:00"} +{"id":"bd-139","title":"stress_27","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.105136-07:00","updated_at":"2025-10-16T12:50:18.856974-07:00"} +{"id":"bd-14","title":"Implement ID remapping with reference updates","description":"Allocate new IDs for colliding issues. Update all text field references using word-boundary regex (\\bbd-10\\b). Update dependency records. Build id_mapping for reporting. Handle chain dependencies properly.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-12T14:40:56.367596-07:00","updated_at":"2025-10-16T12:50:18.857235-07:00","closed_at":"2025-10-12T16:35:13.159992-07:00","dependencies":[{"issue_id":"bd-14","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:41:07.956041-07:00","created_by":"stevey"}]} +{"id":"bd-140","title":"stress_31","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.105666-07:00","updated_at":"2025-10-16T12:50:18.857474-07:00"} +{"id":"bd-141","title":"stress_35","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.106196-07:00","updated_at":"2025-10-16T12:50:18.857722-07:00"} +{"id":"bd-142","title":"stress_37","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.106722-07:00","updated_at":"2025-10-16T12:50:18.858047-07:00"} +{"id":"bd-143","title":"stress_34","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.107203-07:00","updated_at":"2025-10-16T12:50:18.858435-07:00"} +{"id":"bd-144","title":"stress_36","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.108466-07:00","updated_at":"2025-10-16T12:50:18.858651-07:00"} +{"id":"bd-145","title":"stress_21","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.108868-07:00","updated_at":"2025-10-16T12:50:18.858921-07:00"} +{"id":"bd-146","title":"stress_38","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.109501-07:00","updated_at":"2025-10-16T12:50:18.859191-07:00"} +{"id":"bd-147","title":"stress_42","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.109907-07:00","updated_at":"2025-10-16T12:50:18.85949-07:00"} +{"id":"bd-148","title":"stress_43","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.109971-07:00","updated_at":"2025-10-16T12:50:18.859682-07:00"} +{"id":"bd-149","title":"stress_39","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.110079-07:00","updated_at":"2025-10-16T12:50:18.860138-07:00"} +{"id":"bd-15","title":"Add --resolve-collisions flag and user reporting","description":"Add import flags: --resolve-collisions (auto-fix) and --dry-run (preview). Display clear report: collisions detected, remappings applied (old→new with scores), reference counts updated. Default behavior: fail on collision (safe).","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-12T14:40:56.534721-07:00","updated_at":"2025-10-16T12:50:18.860367-07:00","closed_at":"2025-10-12T16:47:11.491645-07:00","dependencies":[{"issue_id":"bd-15","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:41:07.961157-07:00","created_by":"stevey"}]} +{"id":"bd-150","title":"stress_45","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.110194-07:00","updated_at":"2025-10-16T12:50:18.860709-07:00"} +{"id":"bd-151","title":"stress_46","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.110798-07:00","updated_at":"2025-10-16T12:50:18.86093-07:00"} +{"id":"bd-152","title":"stress_48","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.111726-07:00","updated_at":"2025-10-16T12:50:18.862128-07:00"} +{"id":"bd-153","title":"stress_44","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.111834-07:00","updated_at":"2025-10-16T12:50:18.86234-07:00"} +{"id":"bd-154","title":"stress_40","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.112308-07:00","updated_at":"2025-10-16T12:50:18.862538-07:00"} +{"id":"bd-155","title":"stress_41","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.113413-07:00","updated_at":"2025-10-16T12:50:18.862744-07:00"} +{"id":"bd-156","title":"stress_12","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.114106-07:00","updated_at":"2025-10-16T12:50:18.863072-07:00"} +{"id":"bd-157","title":"stress_47","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.114674-07:00","updated_at":"2025-10-16T12:50:18.863303-07:00"} +{"id":"bd-158","title":"stress_49","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.115792-07:00","updated_at":"2025-10-16T12:50:18.863641-07:00"} +{"id":"bd-159","title":"stress_50","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.115854-07:00","updated_at":"2025-10-16T12:50:18.86397-07:00"} +{"id":"bd-16","title":"Write comprehensive collision resolution tests","description":"Test cases: simple collision, multiple collisions, dependency updates, text reference updates, chain dependencies, edge cases (partial ID matches, case sensitivity, triple merges). Add to import_test.go and collision_test.go.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-12T14:40:56.702127-07:00","updated_at":"2025-10-16T12:50:18.864198-07:00","closed_at":"2025-10-12T16:54:25.273886-07:00","dependencies":[{"issue_id":"bd-16","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:41:07.965816-07:00","created_by":"stevey"}]} +{"id":"bd-160","title":"stress_33","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.117101-07:00","updated_at":"2025-10-16T12:50:18.864451-07:00"} +{"id":"bd-161","title":"stress_23","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.122506-07:00","updated_at":"2025-10-16T12:50:18.864664-07:00"} +{"id":"bd-162","title":"stress_11","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.13063-07:00","updated_at":"2025-10-16T12:50:18.864893-07:00"} +{"id":"bd-163","title":"stress_4","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:55.131872-07:00","updated_at":"2025-10-16T12:50:18.865617-07:00"} +{"id":"bd-164","title":"Add visual indicators for nodes with multiple parents in dep tree","description":"When a node appears in the dependency tree via multiple paths (diamond dependencies), add a visual indicator like (*) or (multiple parents) to help users understand the graph structure. This would make it clear when deduplication has occurred. Example: 'bd-503: Shared dependency (*) [P1] (open)'","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-14T03:10:49.222828-07:00","updated_at":"2025-10-16T12:50:18.865984-07:00","dependencies":[{"issue_id":"bd-164","depends_on_id":"bd-85","type":"discovered-from","created_at":"2025-10-14T03:11:00.326599-07:00","created_by":"stevey"}]} +{"id":"bd-165","title":"Add --show-all-paths flag to bd dep tree","description":"Currently bd dep tree deduplicates nodes when multiple paths exist (diamond dependencies). Add optional --show-all-paths flag to display the full graph with all paths, showing duplicates. Useful for debugging complex dependency structures and understanding all relationships.","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-14T03:10:50.337481-07:00","updated_at":"2025-10-16T12:50:18.86832-07:00","dependencies":[{"issue_id":"bd-165","depends_on_id":"bd-85","type":"discovered-from","created_at":"2025-10-14T03:11:00.3313-07:00","created_by":"stevey"}]} +{"id":"bd-166","title":"Make maxDepth configurable in bd dep tree command","description":"Currently maxDepth is hardcoded to 50 in GetDependencyTree. Add --max-depth flag to bd dep tree command to allow users to control recursion depth. Default should remain 50 for safety, but users with very deep trees or wanting shallow views should be able to configure it.","status":"open","priority":4,"issue_type":"feature","created_at":"2025-10-14T03:10:51.883256-07:00","updated_at":"2025-10-16T12:50:18.868602-07:00","dependencies":[{"issue_id":"bd-166","depends_on_id":"bd-85","type":"discovered-from","created_at":"2025-10-14T03:11:00.336267-07:00","created_by":"stevey"}]} +{"id":"bd-167","title":"Test issue with --deps flag","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T03:24:21.100585-07:00","updated_at":"2025-10-16T12:50:18.868825-07:00","closed_at":"2025-10-14T03:24:46.260976-07:00","dependencies":[{"issue_id":"bd-167","depends_on_id":"bd-343","type":"discovered-from","created_at":"2025-10-16T11:57:33.654976-07:00","created_by":"import-remap"},{"issue_id":"bd-167","depends_on_id":"bd-89","type":"discovered-from","created_at":"2025-10-16T11:57:33.876885-07:00","created_by":"import"}]} +{"id":"bd-168","title":"Another test with multiple deps","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:24:32.746757-07:00","updated_at":"2025-10-16T12:50:18.869082-07:00","closed_at":"2025-10-14T03:24:46.261275-07:00","dependencies":[{"issue_id":"bd-168","depends_on_id":"bd-90","type":"blocks","created_at":"2025-10-14T03:24:32.747181-07:00","created_by":"stevey"},{"issue_id":"bd-168","depends_on_id":"bd-343","type":"blocks","created_at":"2025-10-16T11:57:33.61424-07:00","created_by":"import-remap"},{"issue_id":"bd-168","depends_on_id":"bd-89","type":"blocks","created_at":"2025-10-16T11:57:33.877121-07:00","created_by":"import"}]} +{"id":"bd-169","title":"Fix: bd init --prefix test -q flag not recognized","description":"The init command doesn't recognize the -q flag. When running 'bd init --prefix test -q', it fails silently or behaves unexpectedly. The flag should either be implemented for quiet mode or removed from documentation if not supported.","status":"open","priority":2,"issue_type":"bug","created_at":"2025-10-14T12:33:51.614293-07:00","updated_at":"2025-10-16T12:50:18.869292-07:00"} +{"id":"bd-17","title":"Update documentation for collision resolution","description":"Update README.md with collision resolution section. Update CLAUDE.md with new workflow. Document --resolve-collisions and --dry-run flags. Add example scenarios showing branch merge workflows.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-12T14:40:56.866649-07:00","updated_at":"2025-10-16T12:50:18.869486-07:00","closed_at":"2025-10-12T17:06:14.930928-07:00","dependencies":[{"issue_id":"bd-17","depends_on_id":"bd-9","type":"parent-child","created_at":"2025-10-12T14:41:07.970302-07:00","created_by":"stevey"}]} +{"id":"bd-170","title":"Add OAuth2 support","description":"Implement OAuth2 authentication flow with support for Google and GitHub providers.","design":"- Create OAuth2 provider interface\n- Implement Google provider\n- Implement GitHub provider\n- Add callback handler\n- Store tokens securely","acceptance_criteria":"- Users can authenticate with Google\n- Users can authenticate with GitHub\n- Tokens are stored securely in database\n- Token refresh works automatically","status":"closed","priority":1,"issue_type":"feature","assignee":"alice","created_at":"2025-10-14T12:40:30.990247-07:00","updated_at":"2025-10-16T12:50:18.869694-07:00","closed_at":"2025-10-14T12:40:50.292308-07:00","labels":["auth","high-priority","security"]} +{"id":"bd-171","title":"Add rate limiting to auth endpoints","description":"Auth endpoints are vulnerable to brute force attacks. Need to add rate limiting.","status":"closed","priority":0,"issue_type":"bug","assignee":"bob","created_at":"2025-10-14T12:40:30.996332-07:00","updated_at":"2025-10-16T12:50:18.869892-07:00","closed_at":"2025-10-14T12:40:50.293099-07:00","labels":["security","urgent"]} +{"id":"bd-172","title":"Improve session management","description":"Current session management is basic. Need to improve with better expiration handling.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T12:40:30.997104-07:00","updated_at":"2025-10-16T12:50:18.870078-07:00","closed_at":"2025-10-14T12:40:50.29329-07:00"} +{"id":"bd-173","title":"Refactor parseMarkdownFile to reduce cyclomatic complexity","description":"The parseMarkdownFile function in cmd/bd/markdown.go has a cyclomatic complexity of 38, which exceeds the recommended threshold of 30. This makes the function harder to understand, test, and maintain.","design":"Split the function into smaller, focused units:\n\n1. parseMarkdownFile(filepath) - Main entry point, handles file I/O\n2. parseMarkdownContent(scanner) - Core parsing logic\n3. processIssueSection(issue, section, content) - Handle section finalization (current switch statement)\n4. parseLabels(content) []string - Extract labels from content\n5. parseDependencies(content) []string - Extract dependencies from content\n6. parsePriority(content) int - Parse and validate priority\n\nBenefits:\n- Each function has a single responsibility\n- Easier to test individual components\n- Lower cognitive load when reading code\n- Better encapsulation of parsing logic","acceptance_criteria":"- parseMarkdownFile complexity \u003c 15\n- New helper functions each have complexity \u003c 10\n- All existing tests still pass\n- No change in functionality or behavior\n- Code coverage maintained or improved","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-14T12:51:21.241236-07:00","updated_at":"2025-10-16T12:50:18.870266-07:00","closed_at":"2025-10-14T12:55:35.140001-07:00","dependencies":[{"issue_id":"bd-173","depends_on_id":"bd-91","type":"discovered-from","created_at":"2025-10-14T12:51:21.24297-07:00","created_by":"stevey"}]} +{"id":"bd-174","title":"Add OAuth2 support","description":"Implement OAuth2 authentication flow with support for Google and GitHub providers.","design":"- Create OAuth2 provider interface\n- Implement Google provider\n- Implement GitHub provider\n- Add callback handler\n- Store tokens securely","acceptance_criteria":"- Users can authenticate with Google\n- Users can authenticate with GitHub\n- Tokens are stored securely in database\n- Token refresh works automatically","status":"closed","priority":1,"issue_type":"feature","assignee":"alice","created_at":"2025-10-14T12:55:09.226351-07:00","updated_at":"2025-10-16T12:50:18.870487-07:00","closed_at":"2025-10-14T12:55:17.818093-07:00","labels":["auth","high-priority","security"]} +{"id":"bd-175","title":"Add rate limiting to auth endpoints","description":"Auth endpoints are vulnerable to brute force attacks. Need to add rate limiting.","status":"closed","priority":0,"issue_type":"bug","assignee":"bob","created_at":"2025-10-14T12:55:09.228394-07:00","updated_at":"2025-10-16T12:50:18.870672-07:00","closed_at":"2025-10-14T12:55:17.819352-07:00","labels":["security","urgent"]} +{"id":"bd-176","title":"Improve session management","description":"Current session management is basic. Need to improve with better expiration handling.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T12:55:09.228919-07:00","updated_at":"2025-10-16T12:50:18.870861-07:00","closed_at":"2025-10-14T12:55:17.819557-07:00"} +{"id":"bd-177","title":"Add OAuth2 support","description":"Implement OAuth2 authentication flow with support for Google and GitHub providers.","design":"- Create OAuth2 provider interface\n- Implement Google provider\n- Implement GitHub provider\n- Add callback handler\n- Store tokens securely","acceptance_criteria":"- Users can authenticate with Google\n- Users can authenticate with GitHub\n- Tokens are stored securely in database\n- Token refresh works automatically","status":"closed","priority":1,"issue_type":"feature","assignee":"alice","created_at":"2025-10-14T13:01:35.935497-07:00","updated_at":"2025-10-16T12:50:18.871037-07:00","closed_at":"2025-10-14T13:01:35.950067-07:00","labels":["auth","high-priority","security"]} +{"id":"bd-178","title":"Add rate limiting to auth endpoints","description":"Auth endpoints are vulnerable to brute force attacks. Need to add rate limiting.","status":"closed","priority":0,"issue_type":"bug","assignee":"bob","created_at":"2025-10-14T13:01:35.937662-07:00","updated_at":"2025-10-16T12:50:18.871245-07:00","closed_at":"2025-10-14T13:01:35.950387-07:00","labels":["security","urgent"]} +{"id":"bd-179","title":"Improve session management","description":"Current session management is basic. Need to improve with better expiration handling.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T13:01:35.93812-07:00","updated_at":"2025-10-16T12:50:18.871421-07:00","closed_at":"2025-10-14T13:01:35.950517-07:00"} +{"id":"bd-18","title":"Add design/notes/acceptance_criteria fields to update command","description":"Currently bd update only supports status, priority, title, assignee. Add support for --design, --notes, --acceptance-criteria flags. This makes it easier to add detailed designs to issues after creation.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-12T14:40:57.032395-07:00","updated_at":"2025-10-16T12:50:18.871856-07:00","closed_at":"2025-10-12T17:10:53.958318-07:00"} +{"id":"bd-180","title":"Investigate vector/semantic search for issue discovery","description":"From GH issue #2 RFC discussion: Evaluate if vector/semantic search over issues would provide value for beads.\n\n**Use case:** Find semantically related issues (e.g., 'login broken' finds 'authentication failure', 'session expired').\n\n**Questions to answer:**\n1. What workflows would this enable that we can't do now?\n2. Is dataset size (typically 50-200 issues) large enough to benefit?\n3. Do structured features (deps, tags, types) already provide better relationships?\n4. What's the maintenance cost (embeddings, storage, recomputation)?\n\n**Alternatives to consider:**\n- Improve 'bd list' filtering with regex/boolean queries\n- Add 'bd related \u003cid\u003e' showing deps + mentions + same tags\n- Export to JSON and pipe to external AI tools\n\n**Decision:** Only implement if clear use case emerges. Don't add complexity for theoretical benefits.\n\n**Context:** Part of evaluating Turso RFC ideas (GH #2). Vector search was proposed but unclear if needed for typical beads usage.","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T14:16:51.769118-07:00","updated_at":"2025-10-16T12:50:18.872043-07:00"} +{"id":"bd-181","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":"open","priority":2,"issue_type":"feature","created_at":"2025-10-14T14:20:38.678143-07:00","updated_at":"2025-10-16T12:50:18.874087-07:00"} +{"id":"bd-182","title":"Investigate auto-export debounce not triggering","description":"Auto-export to JSONL did not trigger automatically after creating bd-180 and bd-181. 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-180 and bd-181 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-180 and bd-181.","notes":"**Investigation Results:**\n\nThe auto-export feature IS working correctly in the current codebase (v0.9.5). Testing shows:\n\n✅ Storage layer marks issues dirty correctly (lines 415-423, 593-601, 633-641 in sqlite.go)\n✅ CLI calls markDirtyAndScheduleFlush() after CRUD operations (lines 766, 1000, 1055 in main.go)\n✅ Debounce timer (5s) triggers and exports to JSONL successfully\n✅ Tested: Created bd-196, auto-exported within 6 seconds\n\n**Root Cause:**\nThe issue was caused by running an **old bd binary** that didn't have the complete auto-export implementation. After rebuilding (`go build -o bd ./cmd/bd`), auto-export works perfectly.\n\n**Resolution:**\nUsers experiencing this issue need to:\n1. Rebuild bd: `go build -o bd ./cmd/bd`\n2. Install updated binary: `sudo mv bd /usr/local/bin/` (or appropriate path)\n3. Verify: `bd version` should show 0.9.5+\n\n**Additional Notes:**\n- Auto-export uses 5-second debounce (configurable at main.go:36)\n- Exports are atomic (writes to .tmp, then renames)\n- Only dirty issues are exported (incremental updates)\n- Works correctly in production use\n\n**Follow-up:**\nConsider adding a version check warning if user's binary is outdated (bd-408).","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-14T14:25:22.256823-07:00","updated_at":"2025-10-16T12:50:18.874344-07:00","closed_at":"2025-10-16T11:01:26.847829-07:00"} +{"id":"bd-183","title":"Plugin manifest has invalid 'engines' field causing marketplace install failure","description":"The plugin.json manifest includes an 'engines' field that Claude Code doesn't recognize. This causes the plugin to fail validation when installed via /plugin marketplace add.\n\nError: Plugin beads has an invalid manifest file at .claude-plugin/plugin.json. Validation errors: : Unrecognized key(s) in object: 'engines'\n\nFix: Remove the 'engines' field from plugin.json\n\nThe engines field was added to specify minimum beads version requirements, but Claude Code's plugin manifest schema doesn't support it. We should document version requirements in PLUGIN.md instead.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-14T17:11:11.515979-07:00","updated_at":"2025-10-16T12:50:18.874542-07:00","closed_at":"2025-10-16T11:01:26.847981-07:00"} +{"id":"bd-184","title":"race_test_4","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.39436-07:00","updated_at":"2025-10-16T12:50:18.874691-07:00"} +{"id":"bd-185","title":"race_test_8","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.396837-07:00","updated_at":"2025-10-16T12:50:18.874834-07:00"} +{"id":"bd-186","title":"race_test_5","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.398506-07:00","updated_at":"2025-10-16T12:50:18.874973-07:00"} +{"id":"bd-187","title":"race_test_16","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.40014-07:00","updated_at":"2025-10-16T12:50:18.875108-07:00"} +{"id":"bd-188","title":"race_test_17","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.402127-07:00","updated_at":"2025-10-16T12:50:18.875258-07:00"} +{"id":"bd-189","title":"race_test_10","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.403758-07:00","updated_at":"2025-10-16T12:50:18.875419-07:00"} +{"id":"bd-19","title":"Fix import zero-value field handling","description":"Import uses zero-value checks (Priority != 0) to determine field updates. This prevents setting priority to 0 or clearing string fields. Export/import round-trip not fully idempotent for zero values. Consider JSON presence detection or explicit preserve-existing semantics. Location: cmd/bd/import.go:95-106","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-10-12T15:13:17.895083-07:00","updated_at":"2025-10-16T12:50:18.875582-07:00","closed_at":"2025-10-16T11:01:26.848131-07:00"} +{"id":"bd-190","title":"race_test_11","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:43:42.460348-07:00","updated_at":"2025-10-16T12:50:18.875718-07:00"} +{"id":"bd-191","title":"final_test_10","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:44:09.846149-07:00","updated_at":"2025-10-16T12:50:18.87586-07:00"} +{"id":"bd-192","title":"final_test_7","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:44:09.8493-07:00","updated_at":"2025-10-16T12:50:18.876001-07:00"} +{"id":"bd-193","title":"stress_test_5","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:44:27.558376-07:00","updated_at":"2025-10-16T12:50:18.87614-07:00"} +{"id":"bd-194","title":"stress_test_6","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:44:27.565808-07:00","updated_at":"2025-10-16T12:50:18.876274-07:00"} +{"id":"bd-195","title":"stress_test_1","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T23:44:27.614965-07:00","updated_at":"2025-10-16T12:50:18.876406-07:00"} +{"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:50:18.87655-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:50:18.876714-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:50:18.876875-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:50:18.877028-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:50:18.877185-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:50:18.87733-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:50:18.877465-07:00","closed_at":"2025-10-16T11:01:26.848815-07:00"} +{"id":"bd-201","title":"race_test_5","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.856079-07:00","updated_at":"2025-10-16T12:50:18.8776-07:00","closed_at":"2025-10-16T11:01:26.856079-07:00"} +{"id":"bd-202","title":"race_test_2","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.856235-07:00","updated_at":"2025-10-16T12:50:18.877733-07:00","closed_at":"2025-10-16T11:01:26.856235-07:00"} +{"id":"bd-203","title":"race_test_7","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.856357-07:00","updated_at":"2025-10-16T12:50:18.877886-07:00","closed_at":"2025-10-16T11:01:26.856357-07:00"} +{"id":"bd-204","title":"race_test_14","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.856652-07:00","updated_at":"2025-10-16T12:50:18.878044-07:00","closed_at":"2025-10-16T11:01:26.856652-07:00"} +{"id":"bd-205","title":"race_test_9","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.856856-07:00","updated_at":"2025-10-16T12:50:18.878188-07:00","closed_at":"2025-10-16T11:01:26.856856-07:00"} +{"id":"bd-206","title":"race_test_8","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.857005-07:00","updated_at":"2025-10-16T12:50:18.878327-07:00","closed_at":"2025-10-16T11:01:26.857005-07:00"} +{"id":"bd-207","title":"race_test_11","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.85717-07:00","updated_at":"2025-10-16T12:50:18.878472-07:00","closed_at":"2025-10-16T11:01:26.85717-07:00"} +{"id":"bd-208","title":"race_test_19","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.857304-07:00","updated_at":"2025-10-16T12:50:18.878609-07:00","closed_at":"2025-10-16T11:01:26.857304-07:00"} +{"id":"bd-209","title":"race_test_16","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.857433-07:00","updated_at":"2025-10-16T12:50:18.878748-07:00","closed_at":"2025-10-16T11:01:26.857433-07:00"} +{"id":"bd-21","title":"Simplify getNextID SQL query parameters","description":"Query passes prefix four times to same SQL query. Works but fragile if query changes. Consider simplifying SQL to require fewer parameters. Location: internal/storage/sqlite/sqlite.go:73-78","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-12T15:13:20.114733-07:00","updated_at":"2025-10-16T12:50:18.879279-07:00","closed_at":"2025-10-16T11:01:26.857598-07:00"} +{"id":"bd-210","title":"race_test_18","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.857722-07:00","updated_at":"2025-10-16T12:50:18.879419-07:00","closed_at":"2025-10-16T11:01:26.857722-07:00"} +{"id":"bd-211","title":"race_test_20","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.857845-07:00","updated_at":"2025-10-16T12:50:18.879552-07:00","closed_at":"2025-10-16T11:01:26.857845-07:00"} +{"id":"bd-212","title":"race_test_6","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.857966-07:00","updated_at":"2025-10-16T12:50:18.87969-07:00","closed_at":"2025-10-16T11:01:26.857966-07:00"} +{"id":"bd-213","title":"race_test_3","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858079-07:00","updated_at":"2025-10-16T12:50:18.879827-07:00","closed_at":"2025-10-16T11:01:26.858079-07:00"} +{"id":"bd-214","title":"race_test_12","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858197-07:00","updated_at":"2025-10-16T12:50:18.879959-07:00","closed_at":"2025-10-16T11:01:26.858197-07:00"} +{"id":"bd-215","title":"race_test_15","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858316-07:00","updated_at":"2025-10-16T12:50:18.880109-07:00","closed_at":"2025-10-16T11:01:26.858316-07:00"} +{"id":"bd-216","title":"race_test_13","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858454-07:00","updated_at":"2025-10-16T12:50:18.880239-07:00","closed_at":"2025-10-16T11:01:26.858454-07:00"} +{"id":"bd-217","title":"race_test_10","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858572-07:00","updated_at":"2025-10-16T12:50:18.880379-07:00","closed_at":"2025-10-16T11:01:26.858572-07:00"} +{"id":"bd-218","title":"race_test_17","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858681-07:00","updated_at":"2025-10-16T12:50:18.880523-07:00","closed_at":"2025-10-16T11:01:26.858681-07:00"} +{"id":"bd-219","title":"verification_","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.858794-07:00","updated_at":"2025-10-16T12:50:18.880658-07:00","closed_at":"2025-10-16T11:01:26.858794-07:00"} +{"id":"bd-22","title":"Add validation/warning for malformed issue IDs","description":"getNextID silently ignores non-numeric ID suffixes (e.g., bd-foo). CAST returns NULL for invalid strings. Consider detecting and warning about malformed IDs in database. Location: internal/storage/sqlite/sqlite.go:79-82","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-12T15:13:21.195975-07:00","updated_at":"2025-10-16T12:50:18.88081-07:00","closed_at":"2025-10-16T11:01:26.860645-07:00"} +{"id":"bd-220","title":"final_review_test_","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.860777-07:00","updated_at":"2025-10-16T12:50:18.880966-07:00","closed_at":"2025-10-16T11:01:26.860777-07:00"} +{"id":"bd-221","title":"P0: Transaction state corruption in first fix attempt","description":"First attempt at fixing bd-89 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: database/sql connection pooling. Without acquiring a dedicated connection, subsequent queries could use different connections from the pool, breaking the transaction.\n\nCorrect fix: 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.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-16T11:01:26.860927-07:00","updated_at":"2025-10-16T12:50:18.881128-07:00","closed_at":"2025-10-16T11:01:26.860927-07:00"} +{"id":"bd-222","title":"P2: Consider batching API for bulk issue creation","description":"Current CreateIssue acquires a dedicated connection for each call. For bulk imports or agent workflows creating many issues, a batched API could improve performance:\n\nCreateIssues(ctx, issues []*Issue, actor string) error\n\nThis would:\n- Acquire one connection\n- Use one IMMEDIATE transaction\n- Insert all issues atomically\n- Reduce connection overhead\n\nNot urgent - current approach is correct and fast enough for typical use.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.861059-07:00","updated_at":"2025-10-16T12:50:18.881285-07:00","closed_at":"2025-10-16T11:01:26.861059-07:00"} +{"id":"bd-223","title":"P3: Consider early context check in CreateIssue","description":"CreateIssue starts an IMMEDIATE transaction before checking if context is cancelled. If a client cancels early, we've already acquired the write lock.\n\nConsider adding:\n if err := ctx.Err(); err != nil {\n return err\n }\n\nBetween validation (line 318) and acquiring connection (line 331).\n\nLow priority - the busy_timeout and deferred cleanup handle this gracefully, but an early check would be slightly more efficient.","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-16T11:01:26.861599-07:00","updated_at":"2025-10-16T12:50:18.881443-07:00"} +{"id":"bd-224","title":"Data model allows inconsistent status/closed_at states","description":"Issue bd-89 demonstrates a data model inconsistency: an issue can have status='open' but also have a closed_at timestamp set. This creates a liminal state that violates the expected invariant that closed_at should only be set when status='closed'.\n\nRoot causes:\n1. Import (bd import) updates status field independently from closed_at field\n2. UpdateIssue allows status changes without managing closed_at\n3. No database constraint enforcing the invariant\n4. Export includes both fields independently in JSONL\n\nCurrent behavior:\n- bd close: Sets status='closed' AND closed_at (correct)\n- bd update --status open: Sets status='open' but leaves closed_at unchanged (creates inconsistency)\n- bd import: Can import inconsistent data from JSONL\n\nImpact:\n- 'bd ready' shows issues that appear closed (have closed_at)\n- Confusing for users and downstream tools\n- Stats may be inaccurate\n\nPotential solutions:\nA) Add CHECK constraint: (status = 'closed') = (closed_at IS NOT NULL)\nB) Update import/update logic to enforce invariant in application code\nC) Add a 'reopened' event that explicitly clears closed_at\nD) Remove closed_at field entirely (calculate from events or use status only)\n\nSee bd-89 for concrete example.","notes":"Label management fully implemented with comprehensive test coverage (10 test cases). Provides foundation for better data organization and filtering.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-16T11:01:26.861757-07:00","updated_at":"2025-10-16T12:50:18.881633-07:00","closed_at":"2025-10-16T11:01:26.861757-07:00","dependencies":[{"issue_id":"bd-224","depends_on_id":"bd-222","type":"blocks","created_at":"2025-10-16T11:01:27.051703-07:00","created_by":"auto-import"}]} +{"id":"bd-225","title":"Ultrathink: Choose solution for status/closed_at inconsistency (bd-224)","description":"Deep analysis of solution options for bd-224 data model inconsistency issue.\n\nContext:\n- Target users: individual devs and small teams\n- Future: swarms of agent workers\n- Brand-new codebase with few users (can break things)\n- Issue: status='open' with closed_at!=NULL creates liminal state\n\nOptions to evaluate:\nA) Database CHECK constraint\nB) Application-level enforcement \nC) Add explicit reopened event\nD) Remove closed_at field entirely\n\nAnalysis framework:\n1. Simplicity (mental model for devs)\n2. Robustness (hard to break, especially for agent swarms)\n3. Migration cost (schema changes, data cleanup)\n4. Future extensibility\n5. Performance\n6. Consistency guarantees\n\nNeed to determine best approach given tradeoffs.","notes":"Analysis complete. Recommendation: Hybrid approach with DB CHECK constraint + smart UpdateIssue + import enforcement + reopen command.\n\nKey insights:\n- DB constraint provides defense-in-depth perfect for agent swarms\n- Statistics calculation currently uses 'closed_at IS NOT NULL' which is BROKEN by inconsistent data\n- UpdateIssue and Import don't manage the invariant\n- EventReopened exists but is unused\n\nSee ULTRATHINK_BD224.md for full analysis.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.862544-07:00","updated_at":"2025-10-16T12:50:18.88181-07:00","closed_at":"2025-10-16T11:01:26.862544-07:00","dependencies":[{"issue_id":"bd-225","depends_on_id":"bd-224","type":"discovered-from","created_at":"2025-10-16T11:01:27.051946-07:00","created_by":"auto-import"}]} +{"id":"bd-226","title":"Epic: Fix status/closed_at inconsistency (bd-224 solution)","description":"Implement hybrid solution to enforce status/closed_at invariant:\n- Database CHECK constraint\n- Smart UpdateIssue logic\n- Import enforcement\n- Reopen command\n\nThis is a data integrity issue that affects statistics and will cause problems for agent swarms. The hybrid approach provides defense-in-depth.\n\nSee ULTRATHINK_BD224.md for full analysis and rationale.\n\nParent of all implementation tasks for this fix.","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-10-16T11:01:26.862695-07:00","updated_at":"2025-10-16T12:50:18.88197-07:00","closed_at":"2025-10-16T11:01:26.862695-07:00"} +{"id":"bd-227","title":"Audit and document all inconsistent issues in database","description":"Before we add the constraint, we need to know what data is inconsistent.\n\nSteps:\n1. Query database for status/closed_at mismatches\n2. Document each case (how many, which issues, patterns)\n3. Decide on cleanup strategy (trust status vs trust closed_at)\n4. Create SQL script for cleanup\n\nOutput: Document with counts and cleanup SQL ready to review.\n\nThis unblocks the migration work.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.862818-07:00","updated_at":"2025-10-16T12:50:18.882156-07:00","closed_at":"2025-10-16T11:01:26.862818-07:00","dependencies":[{"issue_id":"bd-227","depends_on_id":"bd-226","type":"parent-child","created_at":"2025-10-16T11:01:27.052119-07:00","created_by":"auto-import"}]} +{"id":"bd-228","title":"Critical: Auto-import silently overwrites local changes without collision detection","description":"## Problem\n\nAuto-import is silently overwriting local changes when pulling from Git, without using collision detection or warning the user.\n\n## Evidence\n\nIssue bd-89 timeline:\n1. 08:07:31 - Manual update: set status=in_progress\n2. 08:13:08 - Manual close: set status=closed, closed_at set\n3. 08:33:25 - **Auto-import silently overwrote to status=open** (discarded local change)\n4. 08:57:59 - Auto-import overwrote again\n5. 08:58:30 - Auto-import overwrote again\n\nQuery shows 10+ issues with multiple auto-import overwrites, including bd-198, bd-199, bd-200-206.\n\n## Root Cause Hypothesis\n\nWhen two clones both modify issue N:\n- Clone A: modifies bd-89, exports to JSONL, commits\n- Clone B: also modifies bd-89 differently, pulls from A\n- Auto-import uses UpdateIssue which **unconditionally overwrites**\n- Clone B's local changes are silently lost\n- No collision detection warning\n- References and work context corrupted\n\n## Impact\n\n- **Data loss**: Local changes silently discarded\n- **Corruption**: Issue state doesn't reflect actual work done\n- **Lost references**: Comments/deps referencing lost state are now wrong\n- **Trust**: Can't trust the database reflects reality\n- **Agent swarms**: Catastrophic for parallel workers\n\n## Expected Behavior\n\nAuto-import should:\n1. Detect collisions (same ID, different content)\n2. Warn user or fail import\n3. Offer resolution options (--resolve-collisions)\n4. Never silently overwrite without user confirmation\n\n## Current Behavior\n\nAuto-import silently overwrites using UpdateIssue, no collision detection.\n\n## Reproduction\n\n1. Clone A: bd update bd-1 --status in_progress\n2. Clone A: git add .beads/issues.jsonl \u0026\u0026 git commit \u0026\u0026 git push\n3. Clone B: bd update bd-1 --status closed \n4. Clone B: git pull (triggers auto-import)\n5. Result: bd-1 status silently reverted to in_progress, closed state lost\n\n## Files Involved\n\n- cmd/bd/main.go: auto-import trigger logic\n- cmd/bd/import.go: import without collision detection\n- internal/storage/sqlite/sqlite.go: UpdateIssue unconditionally overwrites","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-16T11:01:26.86787-07:00","updated_at":"2025-10-16T12:50:18.882308-07:00","closed_at":"2025-10-16T11:01:26.86787-07:00"} +{"id":"bd-229","title":"Investigate data recovery for issues overwritten by auto-import bug","description":"Auto-import bug (bd-228) has been silently overwriting local changes since the feature was introduced. We need to investigate if any important data was lost and if it can be recovered.\n\n## Data Sources for Recovery\n\n1. **Git history of .beads/issues.jsonl** - May contain older versions with lost changes\n2. **Events table** - Has full audit trail with old_value/new_value\n3. **Commit messages** - May reference work that was done but later overwritten\n\n## Investigation Steps\n\n1. Check events table for patterns:\n - Look for auto-import events that changed status from closed → open\n - Look for manual updates followed by auto-import reverts\n - Identify issues with suspicious event sequences\n\n2. Git archaeology:\n - Check git log for .beads/issues.jsonl\n - Look for commits where status=closed was changed to status=open\n - Compare git history vs current database state\n\n3. Document lost work:\n - Create list of issues that were closed but reverted to open\n - Identify any critical work that was marked done but lost\n - Check if any issue references are now broken\n\n## Recovery Actions\n\nIf significant data loss is found:\n- Create script to reconstruct lost state from events table\n- Manually review and restore critical closed issues\n- Document lessons learned for preventing future data loss\n\n## Example Query\n\n```sql\n-- Find issues where status was manually changed then reverted by auto-import\nSELECT \n issue_id,\n GROUP_CONCAT(event_type || ':' || actor, ' -\u003e ') as event_chain\nFROM events \nWHERE issue_id IN (\n SELECT DISTINCT issue_id \n FROM events \n WHERE actor = 'auto-import' AND event_type = 'status_changed'\n)\nGROUP BY issue_id\nHAVING event_chain LIKE '%stevey%auto-import%';\n```","notes":"Investigation complete. Successfully recovered 3 valuable issues (bd-232, bd-233) from 22 total lost. Historical context preserved in bd-89 notes. Auto-import collision detection (bd-228) now prevents future data loss.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.868107-07:00","updated_at":"2025-10-16T12:50:18.88248-07:00","closed_at":"2025-10-16T11:01:26.868107-07:00","dependencies":[{"issue_id":"bd-229","depends_on_id":"bd-228","type":"discovered-from","created_at":"2025-10-16T11:01:27.052302-07:00","created_by":"auto-import"}]} +{"id":"bd-23","title":"Optimize export dependency queries (N+1 problem)","description":"Export triggers separate GetDependencyRecords() per issue. For large DBs (1000+ issues), this is N+1 queries. Add GetAllDependencyRecords() to fetch all dependencies in one query. Location: cmd/bd/export.go:52-59, import.go:138-142","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-12T15:13:22.325113-07:00","updated_at":"2025-10-16T12:50:18.882636-07:00","closed_at":"2025-10-16T11:01:26.868262-07:00"} +{"id":"bd-230","title":"Code review: Auto-import collision detection fix (bd-228)","description":"Request thorough code review of the auto-import collision detection implementation.\n\n## Files Changed\n- cmd/bd/main.go: autoImportIfNewer() and new autoImportWithoutCollisionDetection()\n\n## Review Focus Areas\n\n### 1. Correctness\n- Does collision detection properly identify conflicts?\n- Are colliding issues correctly filtered from import?\n- Is the fallback function correct for non-SQLite backends?\n\n### 2. Edge Cases\n- What happens if DetectCollisions() fails?\n- What if all issues are collisions?\n- What if JSONL is malformed?\n- Race conditions with concurrent auto-imports?\n\n### 3. User Experience\n- Is the warning message clear and actionable?\n- Should we log to a file instead of/in addition to stderr?\n- Should there be a --auto-resolve flag?\n\n### 4. Performance\n- Does collision detection add significant latency?\n- Will this work with 1000+ issues?\n- Any unnecessary N+1 queries?\n\n### 5. Testing Gaps\n- Do we need integration tests for collision scenarios?\n- Should we test the warning output?\n- Test autoImportWithoutCollisionDetection() fallback?\n\n## Questions for Reviewer\n1. Should auto-import be more aggressive (auto-resolve) or more conservative (fail)?\n2. Should we add a counter for how many times collisions occurred?\n3. Should there be a config option to disable collision detection?\n4. Is the warning too verbose for typical workflows?\n\n## Current Behavior\n- Skips colliding issues (preserves local)\n- Prints warning to stderr\n- Suggests manual resolution command\n- Continues with non-colliding issues","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.868389-07:00","updated_at":"2025-10-16T12:50:18.882799-07:00","closed_at":"2025-10-16T11:01:26.868389-07:00","dependencies":[{"issue_id":"bd-230","depends_on_id":"bd-228","type":"discovered-from","created_at":"2025-10-16T11:01:27.052524-07:00","created_by":"auto-import"}]} +{"id":"bd-231","title":"Add integration tests for auto-import collision detection","description":"The auto-import collision detection fix (bd-228) needs comprehensive integration tests.\n\n## Test Scenarios Needed\n\n### 1. Basic Collision Detection\n```go\nTestAutoImportWithCollisions\n- Setup: Create issue in DB with status=closed\n- Simulate: Git pull with JSONL containing same issue with status=open\n- Verify: Local changes preserved, warning printed, issue still closed\n```\n\n### 2. Multiple Collisions\n```go\nTestAutoImportWithMultipleCollisions\n- Setup: 5 issues with local modifications\n- Simulate: JSONL with 3 colliding, 2 matching\n- Verify: 3 skipped, 2 updated, appropriate warnings\n```\n\n### 3. No Collisions (Happy Path)\n```go\nTestAutoImportWithoutCollisions\n- Setup: Clean database\n- Simulate: JSONL with new issues + exact matches\n- Verify: All imported successfully, no warnings\n```\n\n### 4. All Collisions\n```go\nTestAutoImportAllCollisions\n- Setup: Every issue has local modifications\n- Simulate: JSONL with conflicting versions\n- Verify: All skipped, warning lists all issues\n```\n\n### 5. Collision Detection Failure\n```go\nTestAutoImportCollisionDetectionError\n- Setup: Mock DetectCollisions() to return error\n- Verify: Import skipped entirely (safe failure mode)\n```\n\n### 6. Hash-Based Skip\n```go\nTestAutoImportHashUnchanged\n- Setup: JSONL hash matches last_import_hash\n- Verify: No collision detection runs, fast path\n```\n\n### 7. Fallback for Non-SQLite\n```go\nTestAutoImportWithoutCollisionDetection\n- Setup: Mock non-SQLite storage backend\n- Verify: Falls back to old behavior, no collision detection\n```\n\n## Test Infrastructure Needed\n\n1. **Helper functions:**\n - createTestDBWithIssues()\n - writeJSONLFile()\n - captureStderrWarnings()\n - simulateGitPull()\n\n2. **Fixtures:**\n - sample-collisions.jsonl\n - sample-exact-matches.jsonl\n - sample-mixed.jsonl\n\n3. **Assertions:**\n - assertIssueState(id, expectedStatus)\n - assertWarningContains(text)\n - assertCollisionCount(n)\n\n## Acceptance Criteria\n- All 7 test scenarios implemented\n- Tests pass consistently\n- Code coverage \u003e80% for autoImportIfNewer()\n- Tests run in \u003c5 seconds total\n- Clear test names and documentation","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.876585-07:00","updated_at":"2025-10-16T12:50:18.88298-07:00","closed_at":"2025-10-16T11:01:26.876585-07:00","dependencies":[{"issue_id":"bd-231","depends_on_id":"bd-230","type":"blocks","created_at":"2025-10-16T11:01:27.053027-07:00","created_by":"auto-import"}]} +{"id":"bd-232","title":"Consider batching API for bulk issue creation (recovered from bd-222)","description":"Current CreateIssue acquires a dedicated connection for each call. For bulk imports or agent workflows creating many issues, a batched API could improve performance:\n\nCreateIssues(ctx, issues []*Issue, actor string) error\n\nThis would:\n- Acquire one connection\n- Use one IMMEDIATE transaction\n- Insert all issues atomically\n- Reduce connection overhead\n\nNot urgent - current approach is correct and fast enough for typical use.\n\n**Recovered from:** bd-222 (lost in auto-import bug, see LOST_ISSUES_RECOVERY.md)","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.876727-07:00","updated_at":"2025-10-16T12:50:18.883136-07:00","closed_at":"2025-10-16T11:01:26.876727-07:00"} +{"id":"bd-233","title":"Consider early context check in CreateIssue (recovered from bd-223)","description":"CreateIssue starts an IMMEDIATE transaction before checking if context is cancelled. If a client cancels early, we've already acquired the write lock.\n\nConsider adding:\n if err := ctx.Err(); err != nil {\n return err\n }\n\nBetween validation (line 318) and acquiring connection (line 331).\n\nLow priority - the busy_timeout and deferred cleanup handle this gracefully, but an early check would be slightly more efficient.\n\n**Recovered from:** bd-223 (lost in auto-import bug, see LOST_ISSUES_RECOVERY.md)","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-16T11:01:26.876857-07:00","updated_at":"2025-10-16T12:50:18.883272-07:00"} +{"id":"bd-234","title":"Add database CHECK constraint for status/closed_at invariant","description":"Add database-level constraint to enforce: (status = 'closed') = (closed_at IS NOT NULL)\n\nPrerequisites: Clean existing inconsistent data first\n\nChanges:\n- Add migration to schema.go\n- Constraint prevents ANY code path from creating inconsistent state\n- Foundation for robust agent-proof system","design":"Migration SQL:\n```sql\n-- First clean up existing inconsistent data\nUPDATE issues SET closed_at = NULL\nWHERE status != 'closed' AND closed_at IS NOT NULL;\n\nUPDATE issues SET closed_at = CURRENT_TIMESTAMP\nWHERE status = 'closed' AND closed_at IS NULL;\n\n-- Add the constraint\nALTER TABLE issues ADD CONSTRAINT chk_closed_at_status\n CHECK ((status = 'closed') = (closed_at IS NOT NULL));\n```\n\nImplementation in schema.go migrations.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.87698-07:00","updated_at":"2025-10-16T12:50:18.883422-07:00","closed_at":"2025-10-16T11:01:26.87698-07:00","dependencies":[{"issue_id":"bd-234","depends_on_id":"bd-224","type":"parent-child","created_at":"2025-10-16T11:01:27.053276-07:00","created_by":"auto-import"},{"issue_id":"bd-234","depends_on_id":"bd-237","type":"blocks","created_at":"2025-10-16T11:01:27.053481-07:00","created_by":"auto-import"}]} +{"id":"bd-235","title":"Add 'bd reopen' command for explicit issue reopening","description":"Create cmd/bd/reopen.go with explicit reopen command that:\n- Sets status to 'open'\n- Automatically clears closed_at (via UpdateIssue)\n- Emits EventReopened\n- Optional --reason flag for explanation\n\nMakes reopening more explicit than 'bd update --status open'","design":"```go\nvar reopenCmd = \u0026cobra.Command{\n Use: \"reopen [id...]\",\n Short: \"Reopen one or more closed issues\",\n Args: cobra.MinimumNArgs(1),\n Run: func(cmd *cobra.Command, args []string) {\n ctx := context.Background()\n reason, _ := cmd.Flags().GetString(\"reason\")\n \n for _, id := range args {\n updates := map[string]interface{}{\n \"status\": \"open\",\n }\n if err := store.UpdateIssue(ctx, id, updates, getUser()); err != nil {\n fmt.Fprintf(os.Stderr, \"Error reopening %s: %v\\n\", id, err)\n continue\n }\n \n if reason != \"\" {\n store.AddComment(ctx, id, getUser(), reason)\n }\n }\n \n markDirtyAndScheduleFlush()\n },\n}\n```","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.877112-07:00","updated_at":"2025-10-16T12:50:18.883584-07:00","closed_at":"2025-10-16T11:01:26.877112-07:00","dependencies":[{"issue_id":"bd-235","depends_on_id":"bd-224","type":"parent-child","created_at":"2025-10-16T11:01:27.053705-07:00","created_by":"auto-import"}]} +{"id":"bd-236","title":"Add tests for status/closed_at invariant enforcement","description":"Comprehensive test suite for bd-224 invariant:\n- Test DB constraint rejects bad data\n- Test UpdateIssue auto-manages closed_at\n- Test Import normalizes data correctly\n- Test reopen command clears closed_at\n- Test Issue.Validate() catches errors","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.87725-07:00","updated_at":"2025-10-16T12:50:18.88375-07:00","closed_at":"2025-10-16T11:01:26.87725-07:00","dependencies":[{"issue_id":"bd-236","depends_on_id":"bd-224","type":"parent-child","created_at":"2025-10-16T11:01:27.053882-07:00","created_by":"auto-import"}]} +{"id":"bd-237","title":"Add Issue.Validate() closed_at invariant check","description":"Add validation logic to types.Issue.Validate() to check closed_at invariant before database operations.\n\nThis provides application-level validation that complements the database constraint.","design":"```go\nfunc (i *Issue) Validate() error {\n // ... existing validation ...\n\n // Enforce closed_at invariant (bd-224)\n if i.Status == StatusClosed \u0026\u0026 i.ClosedAt == nil {\n return fmt.Errorf(\"closed issues must have closed_at timestamp\")\n }\n if i.Status != StatusClosed \u0026\u0026 i.ClosedAt != nil {\n return fmt.Errorf(\"non-closed issues cannot have closed_at timestamp\")\n }\n\n return nil\n}\n```","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.877702-07:00","updated_at":"2025-10-16T12:50:18.883899-07:00","closed_at":"2025-10-16T11:01:26.877702-07:00","dependencies":[{"issue_id":"bd-237","depends_on_id":"bd-224","type":"parent-child","created_at":"2025-10-16T11:01:27.054054-07:00","created_by":"auto-import"},{"issue_id":"bd-237","depends_on_id":"bd-238","type":"blocks","created_at":"2025-10-16T11:01:27.054201-07:00","created_by":"auto-import"}]} +{"id":"bd-238","title":"Fix UpdateIssue to auto-manage closed_at on status changes","description":"Modify internal/storage/sqlite/sqlite.go UpdateIssue to automatically manage closed_at when status changes.\n\nWhen status changes TO closed: set closed_at = now()\nWhen status changes FROM closed: set closed_at = nil and emit EventReopened","design":"```go\nfunc (s *SQLiteStorage) UpdateIssue(ctx context.Context, id string, updates map[string]interface{}, actor string) error {\n // ... existing validation ...\n\n // Smart closed_at management based on status changes\n if statusVal, ok := updates[\"status\"]; ok {\n newStatus := statusVal.(string)\n\n if newStatus == string(types.StatusClosed) {\n // Changing to closed: ensure closed_at is set\n if _, hasClosedAt := updates[\"closed_at\"]; !hasClosedAt {\n updates[\"closed_at\"] = time.Now()\n }\n } else {\n // Changing from closed to something else: clear closed_at\n if oldIssue.Status == types.StatusClosed {\n updates[\"closed_at\"] = nil\n eventType = types.EventReopened\n }\n }\n }\n\n // ... rest of existing code ...\n}\n```","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.877891-07:00","updated_at":"2025-10-16T12:50:18.884069-07:00","closed_at":"2025-10-16T11:01:26.877891-07:00","dependencies":[{"issue_id":"bd-238","depends_on_id":"bd-224","type":"parent-child","created_at":"2025-10-16T11:01:27.0544-07:00","created_by":"auto-import"},{"issue_id":"bd-238","depends_on_id":"bd-239","type":"blocks","created_at":"2025-10-16T11:01:27.054559-07:00","created_by":"auto-import"}]} +{"id":"bd-239","title":"Fix import.go to normalize closed_at before creating issues","description":"Modify cmd/bd/import.go to enforce closed_at invariant before calling CreateIssue/CreateIssues.\n\nNormalize data: if status=closed, ensure closed_at is set; if status!=closed, ensure closed_at is nil.","design":"```go\nif _, ok := rawData[\"status\"]; ok {\n updates[\"status\"] = issue.Status\n\n // Enforce closed_at invariant\n if issue.Status == types.StatusClosed {\n // Status is closed: ensure closed_at is set\n if issue.ClosedAt == nil {\n now := time.Now()\n updates[\"closed_at\"] = now\n } else {\n updates[\"closed_at\"] = *issue.ClosedAt\n }\n } else {\n // Status is not closed: ensure closed_at is NULL\n updates[\"closed_at\"] = nil\n }\n}\n```","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.886475-07:00","updated_at":"2025-10-16T12:50:18.884291-07:00","closed_at":"2025-10-16T11:01:26.886475-07:00","dependencies":[{"issue_id":"bd-239","depends_on_id":"bd-224","type":"parent-child","created_at":"2025-10-16T11:01:27.054744-07:00","created_by":"auto-import"},{"issue_id":"bd-239","depends_on_id":"bd-240","type":"blocks","created_at":"2025-10-16T11:01:27.054886-07:00","created_by":"auto-import"}]} +{"id":"bd-24","title":"Support ID space partitioning for parallel worker agents","description":"Enable external orchestrators (like AI worker swarms) to control issue ID assignment. Add --id flag to 'bd create' for explicit ID specification. Optionally support 'bd config set next_id N' to set the starting point for auto-increment. Storage layer already supports pre-assigned IDs (sqlite.go:52-71), just need CLI wiring. This keeps beads simple while letting orchestrators implement their own ID partitioning strategies to minimize merge conflicts. Complementary to bd-9's collision resolution.","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-12T16:10:37.808226-07:00","updated_at":"2025-10-16T12:50:18.884499-07:00","closed_at":"2025-10-13T23:18:01.637695-07:00"} +{"id":"bd-240","title":"Add CreateIssues interface method to Storage","description":"Add CreateIssues to the Storage interface in storage/storage.go\n\nNon-breaking addition to interface for batch issue creation.","design":"```go\n// storage/storage.go\ntype Storage interface {\n CreateIssue(ctx context.Context, issue *types.Issue, actor string) error\n CreateIssues(ctx context.Context, issues []*types.Issue, actor string) error // NEW\n // ... rest unchanged\n}\n```","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.907052-07:00","updated_at":"2025-10-16T12:50:18.884657-07:00","closed_at":"2025-10-16T11:01:26.907052-07:00","dependencies":[{"issue_id":"bd-240","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.055061-07:00","created_by":"auto-import"},{"issue_id":"bd-240","depends_on_id":"bd-224","type":"blocks","created_at":"2025-10-16T11:01:27.055201-07:00","created_by":"auto-import"}]} +{"id":"bd-241","title":"Add comprehensive unit tests for CreateIssues","description":"Test coverage for CreateIssues:\n- Empty batch\n- Single issue\n- Multiple issues\n- Mixed ID assignment (explicit + auto-generated)\n- Validation errors\n- Duplicate ID errors\n- Rollback on error\n- Verify closed_at invariant enforced","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.907176-07:00","updated_at":"2025-10-16T12:50:18.888317-07:00","closed_at":"2025-10-16T11:01:26.907176-07:00","dependencies":[{"issue_id":"bd-241","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.055717-07:00","created_by":"auto-import"},{"issue_id":"bd-241","depends_on_id":"bd-240","type":"blocks","created_at":"2025-10-16T11:01:27.055881-07:00","created_by":"auto-import"}]} +{"id":"bd-242","title":"Update import.go to use CreateIssues for bulk imports","description":"Modify cmd/bd/import.go to use CreateIssues instead of CreateIssue loop.\n\nAfter bd-224, import already normalizes closed_at, so this is straightforward:\n1. Normalize all issues in batch (closed_at handling)\n2. Call CreateIssues once with full batch\n3. Much simpler than current loop","design":"```go\n// After normalizing all issues\nfor _, issue := range issues {\n if issue.Status == types.StatusClosed {\n if issue.ClosedAt == nil {\n now := time.Now()\n issue.ClosedAt = \u0026now\n }\n } else {\n issue.ClosedAt = nil\n }\n}\n\n// Single batch call (5-15x faster!)\nreturn store.CreateIssues(ctx, issues, \"import\")\n```","notes":"Completed: Replaced CreateIssue loop with single CreateIssues batch call. Added in-memory de-duplication for duplicate IDs within same import (last one wins). Fixed skip-existing logic to only apply to DB issues, not batch duplicates. All 14 import tests pass including performance, collisions, dependencies, and labels.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.919636-07:00","updated_at":"2025-10-16T12:50:18.888476-07:00","closed_at":"2025-10-16T11:01:26.919636-07:00","dependencies":[{"issue_id":"bd-242","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.056056-07:00","created_by":"auto-import"},{"issue_id":"bd-242","depends_on_id":"bd-240","type":"blocks","created_at":"2025-10-16T11:01:27.056192-07:00","created_by":"auto-import"}]} +{"id":"bd-243","title":"Document CreateIssues API and update EXTENDING.md","description":"Documentation updates:\n- Godoc for CreateIssues with usage guidance\n- Add batch import examples\n- Update EXTENDING.md with batch usage patterns\n- Performance notes in README.md\n- When to use CreateIssue vs CreateIssues","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.924212-07:00","updated_at":"2025-10-16T12:50:18.888655-07:00","closed_at":"2025-10-16T11:01:26.924212-07:00","dependencies":[{"issue_id":"bd-243","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.056368-07:00","created_by":"auto-import"},{"issue_id":"bd-243","depends_on_id":"bd-240","type":"blocks","created_at":"2025-10-16T11:01:27.056573-07:00","created_by":"auto-import"}]} +{"id":"bd-244","title":"Implement SQLiteStorage.CreateIssues with atomic ID range reservation","description":"Core implementation of CreateIssues in internal/storage/sqlite/sqlite.go\n\nKey optimizations:\n- Single connection + transaction\n- Atomic ID range reservation (generate N IDs in one counter update)\n- Prepared statement for bulk inserts\n- All-or-nothing atomicity\n\nExpected 5-10x speedup for N\u003e10 issues.","design":"Implementation phases per ULTRATHINK_BD222.md:\n\n1. **Validation**: Pre-validate all issues (calls Issue.Validate() which enforces closed_at invariant from bd-224)\n2. **Connection \u0026 Transaction**: BEGIN IMMEDIATE (same as CreateIssue)\n3. **Batch ID Generation**: Reserve range [nextID, nextID+N) in single counter update\n4. **Bulk Insert**: Prepared statement loop (defer multi-VALUE INSERT optimization)\n5. **Bulk Events**: Record creation events for all issues\n6. **Bulk Dirty**: Mark all issues dirty for export\n7. **Commit**: All-or-nothing transaction commit\n\nSee ULTRATHINK_BD222.md lines 344-541 for full implementation details.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.936631-07:00","updated_at":"2025-10-16T12:50:18.88898-07:00","closed_at":"2025-10-16T11:01:26.936631-07:00","dependencies":[{"issue_id":"bd-244","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.056938-07:00","created_by":"auto-import"},{"issue_id":"bd-244","depends_on_id":"bd-240","type":"blocks","created_at":"2025-10-16T11:01:27.057092-07:00","created_by":"auto-import"},{"issue_id":"bd-244","depends_on_id":"bd-241","type":"blocks","created_at":"2025-10-16T11:01:27.057592-07:00","created_by":"auto-import"},{"issue_id":"bd-244","depends_on_id":"bd-242","type":"blocks","created_at":"2025-10-16T11:01:27.060397-07:00","created_by":"auto-import"}]} +{"id":"bd-245","title":"Add concurrency tests for CreateIssues","description":"Concurrent testing:\n- Multiple goroutines creating batches in parallel\n- Verify no ID collisions\n- Mix CreateIssue and CreateIssues calls\n- Verify all issues created correctly","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.936844-07:00","updated_at":"2025-10-16T12:50:18.889155-07:00","closed_at":"2025-10-16T11:01:26.936844-07:00","dependencies":[{"issue_id":"bd-245","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.060891-07:00","created_by":"auto-import"},{"issue_id":"bd-245","depends_on_id":"bd-244","type":"blocks","created_at":"2025-10-16T11:01:27.063519-07:00","created_by":"auto-import"}]} +{"id":"bd-247","title":"Add performance benchmarks for CreateIssues","description":"Benchmark suite comparing CreateIssue loop vs CreateIssues batch:\n- 10, 100, 1000 issues\n- Expected: 5-10x speedup for N\u003e10\n- Measure connection, transaction, and insert overhead\n\nTarget: 100 issues in \u003c130ms (vs 900ms sequential)","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.93698-07:00","updated_at":"2025-10-16T12:50:18.889307-07:00","closed_at":"2025-10-16T11:01:26.93698-07:00","dependencies":[{"issue_id":"bd-247","depends_on_id":"bd-222","type":"parent-child","created_at":"2025-10-16T11:01:27.063745-07:00","created_by":"auto-import"},{"issue_id":"bd-247","depends_on_id":"bd-244","type":"blocks","created_at":"2025-10-16T11:01:27.063883-07:00","created_by":"auto-import"}]} +{"id":"bd-248","title":"Test reopen command","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.942121-07:00","updated_at":"2025-10-16T12:50:18.88985-07:00","closed_at":"2025-10-16T11:01:26.942121-07:00"} +{"id":"bd-249","title":"Test reopen command","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.943007-07:00","updated_at":"2025-10-16T12:50:18.891414-07:00","closed_at":"2025-10-16T11:01:26.943007-07:00"} +{"id":"bd-25","title":"Add transaction support to storage layer for atomic multi-operation workflows","description":"Currently each storage method (CreateIssue, UpdateIssue, etc.) starts its own transaction. This makes it impossible to perform atomic multi-step operations like collision resolution. Add support for passing *sql.Tx through the storage interface, or create transaction-aware versions of methods. This would make remapCollisions and other batch operations truly atomic.","status":"closed","priority":4,"issue_type":"feature","created_at":"2025-10-12T16:39:00.66572-07:00","updated_at":"2025-10-16T12:50:18.891589-07:00","closed_at":"2025-10-13T22:53:56.401108-07:00"} +{"id":"bd-250","title":"Implement --format flag for bd list (from PR #46)","description":"PR #46 by tmc adds --format flag with Go template support for bd list, including presets for 'digraph' and 'dot' (Graphviz) output with status-based color coding. Unfortunately the PR is based on old main and would delete labels, reopen, and storage tests. Need to reimplement the feature atop current main.\n\nFeatures to implement:\n- --format flag for bd list\n- 'digraph' preset: basic 'from to' format for golang.org/x/tools/cmd/digraph\n- 'dot' preset: Graphviz compatible output with color-coded statuses\n- Custom Go template support with vars: IssueID, DependsOnID, Type, Issue, Dependency\n- Status-based colors: open=white, in_progress=lightyellow, blocked=lightcoral, closed=lightgray\n\nExamples:\n- bd list --format=digraph | digraph nodes\n- bd list --format=dot | dot -Tsvg -o deps.svg\n- bd list --format='{{.IssueID}} -\u003e {{.DependsOnID}} [{{.Type}}]'\n\nOriginal PR: https://github.com/steveyegge/beads/pull/46","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.945289-07:00","updated_at":"2025-10-16T12:50:18.891755-07:00","closed_at":"2025-10-16T11:01:26.945289-07:00","external_ref":"gh-46"} +{"id":"bd-251","title":"Epic: Add intelligent database compaction with Claude Haiku","description":"Implement multi-tier database compaction using Claude Haiku to semantically compress old, closed issues. This keeps the database lightweight and agent-friendly while preserving essential context.\n\nGoals:\n- 70-95% space reduction for eligible issues\n- Full restore capability via snapshots\n- Opt-in with dry-run safety\n- ~$1 per 1,000 issues compacted","acceptance_criteria":"- Schema migration with snapshots table\n- Haiku integration for summarization\n- Two-tier compaction (30d, 90d)\n- CLI with dry-run, restore, stats\n- Full test coverage\n- Documentation complete","status":"open","priority":2,"issue_type":"epic","created_at":"2025-10-16T11:01:26.94596-07:00","updated_at":"2025-10-16T12:50:18.892867-07:00"} +{"id":"bd-252","title":"Add compaction schema and migrations","description":"Add database schema support for issue compaction tracking and snapshot storage.","design":"Add three columns to `issues` table:\n- `compaction_level INTEGER DEFAULT 0` - 0=original, 1=tier1, 2=tier2\n- `compacted_at DATETIME` - when last compacted\n- `original_size INTEGER` - bytes before first compaction\n\nCreate `issue_snapshots` table:\n```sql\nCREATE TABLE issue_snapshots (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n issue_id TEXT NOT NULL,\n snapshot_time DATETIME NOT NULL,\n compaction_level INTEGER NOT NULL,\n original_size INTEGER NOT NULL,\n compressed_size INTEGER NOT NULL,\n original_content TEXT NOT NULL, -- JSON blob\n archived_events TEXT,\n FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE\n);\n```\n\nAdd indexes:\n- `idx_snapshots_issue` on `issue_id`\n- `idx_snapshots_level` on `compaction_level`\n\nAdd migration functions in `internal/storage/sqlite/sqlite.go`:\n- `migrateCompactionColumns(db *sql.DB) error`\n- `migrateSnapshotsTable(db *sql.DB) error`","acceptance_criteria":"- Existing databases migrate automatically\n- New databases include columns by default\n- Migration is idempotent (safe to run multiple times)\n- No data loss during migration\n- Tests verify migration on fresh and existing DBs","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.946087-07:00","updated_at":"2025-10-16T12:50:18.893132-07:00","closed_at":"2025-10-16T11:01:26.946087-07:00"} +{"id":"bd-253","title":"Add compaction configuration keys","description":"Add configuration keys for compaction behavior with sensible defaults.","design":"Add to `internal/storage/sqlite/schema.go` initial config:\n```sql\nINSERT OR IGNORE INTO config (key, value) VALUES\n ('compact_tier1_days', '30'),\n ('compact_tier1_dep_levels', '2'),\n ('compact_tier2_days', '90'),\n ('compact_tier2_dep_levels', '5'),\n ('compact_tier2_commits', '100'),\n ('compact_model', 'claude-3-5-haiku-20241022'),\n ('compact_batch_size', '50'),\n ('compact_parallel_workers', '5'),\n ('auto_compact_enabled', 'false');\n```\n\nAdd helper functions for loading config into typed struct.","acceptance_criteria":"- Config keys created on init\n- Existing DBs get defaults on migration\n- `bd config get/set` works with all keys\n- Type validation (days=int, enabled=bool)\n- Documentation in README.md","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.946235-07:00","updated_at":"2025-10-16T12:50:18.893305-07:00","closed_at":"2025-10-16T11:01:26.946235-07:00"} +{"id":"bd-254","title":"Implement candidate identification queries","description":"Write SQL queries to identify issues eligible for Tier 1 and Tier 2 compaction based on closure time and dependency status.","design":"Create `internal/storage/sqlite/compact.go` with:\n\n```go\ntype CompactionCandidate struct {\n IssueID string\n ClosedAt time.Time\n OriginalSize int\n EstimatedSize int\n DependentCount int\n}\n\nfunc (s *SQLiteStorage) GetTier1Candidates(ctx context.Context) ([]*CompactionCandidate, error)\nfunc (s *SQLiteStorage) GetTier2Candidates(ctx context.Context) ([]*CompactionCandidate, error)\nfunc (s *SQLiteStorage) CheckEligibility(ctx context.Context, issueID string, tier int) (bool, string, error)\n```\n\nUse recursive CTE for dependency depth checking (similar to ready_issues view).","acceptance_criteria":"- Tier 1 query filters by days and dependency depth\n- Tier 2 query includes commit/issue count checks\n- Dependency checking handles circular deps gracefully\n- Performance: \u003c100ms for 10,000 issue database\n- Tests cover edge cases (no deps, circular deps, mixed status)","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.946368-07:00","updated_at":"2025-10-16T12:50:18.893463-07:00","closed_at":"2025-10-16T11:01:26.946368-07:00"} +{"id":"bd-255","title":"Create Haiku client and prompt templates","description":"Implement Claude Haiku API client with template-based prompts for Tier 1 and Tier 2 summarization.","design":"Create `internal/compact/haiku.go`:\n\n```go\ntype HaikuClient struct {\n client *anthropic.Client\n model string\n}\n\nfunc NewHaikuClient(apiKey string) (*HaikuClient, error)\nfunc (h *HaikuClient) SummarizeTier1(ctx context.Context, issue *types.Issue) (string, error)\nfunc (h *HaikuClient) SummarizeTier2(ctx context.Context, issue *types.Issue) (string, error)\n```\n\nUse text/template for prompt rendering.\n\nTier 1 output format:\n```\n**Summary:** [2-3 sentences]\n**Key Decisions:** [bullet points]\n**Resolution:** [outcome]\n```\n\nTier 2 output format:\n```\nSingle paragraph ≤150 words covering what was built, why it mattered, lasting impact.\n```","acceptance_criteria":"- API key from env var or config (env takes precedence)\n- Prompts render correctly with templates\n- Rate limiting handled gracefully (exponential backoff)\n- Network errors retry up to 3 times\n- Mock tests for API calls","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.946495-07:00","updated_at":"2025-10-16T12:50:18.893649-07:00","closed_at":"2025-10-16T11:01:26.946495-07:00"} +{"id":"bd-256","title":"Implement snapshot creation and restoration","description":"Implement snapshot creation before compaction and restoration capability to undo compaction.","design":"Add to `internal/storage/sqlite/compact.go`:\n\n```go\nfunc (s *SQLiteStorage) CreateSnapshot(ctx context.Context, issue *types.Issue, level int) error\nfunc (s *SQLiteStorage) RestoreFromSnapshot(ctx context.Context, issueID string, level int) error\nfunc (s *SQLiteStorage) GetSnapshots(ctx context.Context, issueID string) ([]*Snapshot, error)\n```\n\nSnapshot JSON structure:\n```json\n{\n \"description\": \"...\",\n \"design\": \"...\",\n \"notes\": \"...\",\n \"acceptance_criteria\": \"...\",\n \"title\": \"...\"\n}\n```","acceptance_criteria":"- Snapshot created atomically with compaction\n- Restore returns exact original content\n- Multiple snapshots per issue supported (Tier 1 → Tier 2)\n- JSON encoding handles UTF-8 and special characters\n- Size calculation is accurate (UTF-8 bytes)","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.947733-07:00","updated_at":"2025-10-16T12:50:18.893945-07:00","closed_at":"2025-10-16T11:01:26.947733-07:00"} +{"id":"bd-257","title":"Implement Tier 1 compaction logic","description":"Implement the core Tier 1 compaction process: snapshot → summarize → update.","design":"Add to `internal/compact/compactor.go`:\n\n```go\ntype Compactor struct {\n store storage.Storage\n haiku *HaikuClient\n config *CompactConfig\n}\n\nfunc New(store storage.Storage, apiKey string, config *CompactConfig) (*Compactor, error)\nfunc (c *Compactor) CompactTier1(ctx context.Context, issueID string) error\nfunc (c *Compactor) CompactTier1Batch(ctx context.Context, issueIDs []string) error\n```\n\nProcess:\n1. Verify eligibility\n2. Calculate original size\n3. Create snapshot\n4. Call Haiku for summary\n5. Update issue (description=summary, clear design/notes/criteria)\n6. Set compaction_level=1, compacted_at=now, original_size\n7. Record EventCompacted\n8. Mark dirty for export","acceptance_criteria":"- Single issue compaction works end-to-end\n- Batch processing with parallel workers (5 concurrent)\n- Errors don't corrupt database (transaction rollback)\n- EventCompacted includes size savings\n- Dry-run mode (identify + size estimate only, no API calls)","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.947916-07:00","updated_at":"2025-10-16T12:50:18.895113-07:00","closed_at":"2025-10-16T11:01:26.947916-07:00"} +{"id":"bd-258","title":"Implement Tier 2 compaction logic","description":"Implement Tier 2 ultra-compression: more aggressive summarization and optional event pruning.","design":"Add to `internal/compact/compactor.go`:\n\n```go\nfunc (c *Compactor) CompactTier2(ctx context.Context, issueID string) error\nfunc (c *Compactor) CompactTier2Batch(ctx context.Context, issueIDs []string) error\n```\n\nProcess:\n1. Verify issue is at compaction_level = 1\n2. Check Tier 2 eligibility (days, deps, commits/issues)\n3. Create Tier 2 snapshot\n4. Call Haiku with ultra-compression prompt\n5. Update issue (description = single paragraph, clear all other fields)\n6. Set compaction_level = 2\n7. Optionally prune events (keep created/closed, archive rest to snapshot)","acceptance_criteria":"- Requires existing Tier 1 compaction\n- Git commit counting works (with fallback to issue counter)\n- Events optionally pruned (config: compact_events_enabled)\n- Archived events stored in snapshot JSON\n- Size reduction 90-95%","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.948482-07:00","updated_at":"2025-10-16T12:50:18.89575-07:00"} +{"id":"bd-259","title":"Add `bd compact` CLI command","description":"Implement the `bd compact` command with dry-run, batch processing, and progress reporting.","design":"Create `cmd/bd/compact.go`:\n\n```go\nvar compactCmd = \u0026cobra.Command{\n Use: \"compact\",\n Short: \"Compact old closed issues to save space\",\n}\n\nFlags:\n --dry-run Preview without compacting\n --tier int Compaction tier (1 or 2, default: 1)\n --all Process all candidates\n --id string Compact specific issue\n --force Force compact (bypass checks, requires --id)\n --batch-size int Issues per batch\n --workers int Parallel workers\n --json JSON output\n```","acceptance_criteria":"- `--dry-run` shows accurate preview with size estimates\n- `--all` processes all candidates\n- `--id` compacts single issue\n- `--force` bypasses eligibility checks (only with --id)\n- Progress bar for batches (e.g., [████████] 47/47)\n- JSON output with `--json`\n- Exit codes: 0=success, 1=error\n- Shows summary: count, size saved, cost, time","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.948941-07:00","updated_at":"2025-10-16T12:50:18.896858-07:00","closed_at":"2025-10-16T11:01:26.948941-07:00"} +{"id":"bd-26","title":"Optimize reference updates to avoid loading all issues into memory","description":"In updateReferences(), we call SearchIssues with no filter to get ALL issues for updating references. For large databases (10k+ issues), this loads everything into memory. Options: 1) Use batched processing with LIMIT/OFFSET, 2) Use SQL UPDATE with REPLACE() directly, 3) Stream results instead of loading all at once. Located in collision.go:266","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-12T16:39:10.327861-07:00","updated_at":"2025-10-16T12:50:18.897157-07:00"} +{"id":"bd-260","title":"Add `bd compact --restore` functionality","description":"Implement restore command to undo compaction from snapshots.","design":"Add to `cmd/bd/compact.go`:\n\n```go\nvar compactRestore string\n\ncompactCmd.Flags().StringVar(\u0026compactRestore, \"restore\", \"\", \"Restore issue from snapshot\")\n```\n\nProcess:\n1. Load snapshot for issue\n2. Parse JSON content\n3. Update issue with original content\n4. Set compaction_level = 0, compacted_at = NULL, original_size = NULL\n5. Record event (EventRestored or EventUpdated)\n6. Mark dirty for export","acceptance_criteria":"- Restores exact original content\n- Handles multiple snapshots (use latest by default)\n- `--level` flag to choose specific snapshot\n- Updates compaction_level correctly\n- Exports restored content to JSONL\n- Shows before/after in output","notes":"Won't fix - snapshots defeat the purpose of compaction","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.949239-07:00","updated_at":"2025-10-16T12:50:18.897419-07:00","closed_at":"2025-10-16T11:01:26.949239-07:00"} +{"id":"bd-261","title":"Add `bd compact --stats` command","description":"Add statistics command showing compaction status and potential savings.","design":"```go\nvar compactStats bool\n\ncompactCmd.Flags().BoolVar(\u0026compactStats, \"stats\", false, \"Show compaction statistics\")\n```\n\nOutput:\n- Total issues, by compaction level (0, 1, 2)\n- Current DB size vs estimated uncompacted size\n- Space savings (KB/MB and %)\n- Candidates for each tier with size estimates\n- Estimated API cost (Haiku pricing)","acceptance_criteria":"- Accurate counts by compaction_level\n- Size calculations include all text fields (UTF-8 bytes)\n- Shows candidates with eligibility reasons\n- Cost estimation based on current Haiku pricing\n- JSON output supported\n- Clear, readable table format","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.949378-07:00","updated_at":"2025-10-16T12:50:18.903907-07:00","closed_at":"2025-10-16T11:01:26.949378-07:00"} +{"id":"bd-262","title":"Add EventCompacted to event system","description":"Add new event type for tracking compaction in audit trail.","design":"1. Add to `internal/types/types.go`:\n```go\nconst EventCompacted EventType = \"compacted\"\n```\n\n2. Record event during compaction:\n```go\neventData := map[string]interface{}{\n \"tier\": tier,\n \"original_size\": originalSize,\n \"compressed_size\": compressedSize,\n \"reduction_pct\": (1 - float64(compressedSize)/float64(originalSize)) * 100,\n}\n```\n\n3. Update event display in `bd show`.","acceptance_criteria":"- Event includes tier, original_size, compressed_size, reduction_pct\n- Shows in event history (`bd events \u003cid\u003e`)\n- Exports to JSONL correctly\n- `bd show` displays compaction status and marker","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.949506-07:00","updated_at":"2025-10-16T12:50:18.909146-07:00","closed_at":"2025-10-16T11:01:26.949506-07:00"} +{"id":"bd-263","title":"Add compaction indicator to `bd show`","description":"Update `bd show` command to display compaction status prominently.","design":"Add to issue display:\n```\nbd-42: Fix authentication bug [CLOSED] 🗜️\n\nStatus: closed (compacted L1)\n...\n\n---\n💾 Restore: bd compact --restore bd-42\n📊 Original: 2,341 bytes | Compressed: 468 bytes (80% reduction)\n🗜️ Compacted: 2025-10-15 (Tier 1)\n```\n\nEmoji indicators:\n- Tier 1: 🗜️\n- Tier 2: 📦","acceptance_criteria":"- Compaction status visible in title line\n- Footer shows size savings when compacted\n- Restore command shown for compacted issues\n- Works with `--json` output (includes compaction fields)\n- Emoji optional (controlled by config or terminal detection)","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.949634-07:00","updated_at":"2025-10-16T12:50:18.909408-07:00","closed_at":"2025-10-16T11:01:26.949634-07:00"} +{"id":"bd-264","title":"Write compaction tests","description":"Comprehensive test suite for compaction functionality.","design":"Test coverage:\n\n1. **Candidate Identification:**\n - Eligibility by time\n - Dependency depth checking\n - Mixed status dependents\n - Edge cases (no deps, circular deps)\n\n2. **Snapshots:**\n - Create and restore\n - Multiple snapshots per issue\n - Content integrity (UTF-8, special chars)\n\n3. **Tier 1 Compaction:**\n - Single issue compaction\n - Batch processing\n - Error handling (API failures)\n\n4. **Tier 2 Compaction:**\n - Requires Tier 1\n - Events pruning\n - Commit counting fallback\n\n5. **CLI:**\n - All flag combinations\n - Dry-run accuracy\n - JSON output parsing\n\n6. **Integration:**\n - End-to-end flow\n - JSONL export/import\n - Restore verification","acceptance_criteria":"- Test coverage \u003e80%\n- All edge cases covered\n- Mock Haiku API in tests (no real API calls)\n- Integration tests pass\n- `go test ./...` passes\n- Benchmarks for performance-critical paths","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.949755-07:00","updated_at":"2025-10-16T12:50:18.910851-07:00","closed_at":"2025-10-16T11:01:26.949755-07:00"} +{"id":"bd-265","title":"Add compaction documentation","description":"Document compaction feature in README and create detailed COMPACTION.md guide.","design":"**Update README.md:**\n- Add to Features section\n- CLI examples (dry-run, compact, restore, stats)\n- Configuration guide\n- Cost analysis\n\n**Create COMPACTION.md:**\n- How compaction works (architecture overview)\n- When to use each tier\n- Detailed cost analysis with examples\n- Safety mechanisms (snapshots, restore, dry-run)\n- Troubleshooting guide\n- FAQ\n\n**Create examples/compaction/:**\n- `workflow.sh` - Example monthly compaction workflow\n- `cron-compact.sh` - Cron job setup\n- `auto-compact.sh` - Auto-compaction script","acceptance_criteria":"- README.md updated with compaction section\n- COMPACTION.md comprehensive and clear\n- Examples work as documented (tested)\n- Screenshots or ASCII examples included\n- API key setup documented (env var vs config)\n- Covers common questions and issues","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.949873-07:00","updated_at":"2025-10-16T12:50:18.914691-07:00","closed_at":"2025-10-16T11:01:26.949873-07:00"} +{"id":"bd-266","title":"Optional: Implement auto-compaction","description":"Implement automatic compaction triggered by certain operations when enabled via config.","design":"Trigger points (when `auto_compact_enabled = true`):\n1. `bd stats` - check and compact if candidates exist\n2. `bd export` - before exporting\n3. Configurable: on any read operation after N candidates accumulate\n\nAdd:\n```go\nfunc (s *SQLiteStorage) AutoCompact(ctx context.Context) error {\n enabled, _ := s.GetConfig(ctx, \"auto_compact_enabled\")\n if enabled != \"true\" {\n return nil\n }\n\n // Run Tier 1 compaction on all candidates\n // Limit to batch_size to avoid long operations\n // Log activity for transparency\n}\n```","acceptance_criteria":"- Respects auto_compact_enabled config (default: false)\n- Limits batch size to avoid blocking operations\n- Logs compaction activity (visible with --verbose)\n- Can be disabled per-command with `--no-auto-compact` flag\n- Only compacts Tier 1 (Tier 2 remains manual)\n- Doesn't run more than once per hour (rate limiting)","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-16T11:01:26.949992-07:00","updated_at":"2025-10-16T12:50:18.916176-07:00"} +{"id":"bd-267","title":"Optional: Add git commit counting","description":"Implement git commit counting for \"project time\" measurement as alternative to calendar time for Tier 2 eligibility.","design":"```go\nfunc getCommitsSince(closedAt time.Time) (int, error) {\n cmd := exec.Command(\"git\", \"rev-list\", \"--count\",\n fmt.Sprintf(\"--since=%s\", closedAt.Format(time.RFC3339)), \"HEAD\")\n output, err := cmd.Output()\n if err != nil {\n return 0, err // Not in git repo or git not available\n }\n return strconv.Atoi(strings.TrimSpace(string(output)))\n}\n```\n\nFallback strategies:\n1. Git commit count (preferred)\n2. Issue counter delta (store counter at close time, compare later)\n3. Pure time-based (90 days)","acceptance_criteria":"- Counts commits since closed_at timestamp\n- Handles git not available gracefully (falls back)\n- Fallback to issue counter delta works\n- Configurable via compact_tier2_commits config key\n- Tested with real git repo\n- Works in non-git environments","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-16T11:01:26.9501-07:00","updated_at":"2025-10-16T12:50:18.917317-07:00"} +{"id":"bd-268","title":"Explore in-memory embedded SQL alternatives to SQLite","description":"Investigate lightweight in-memory embedded SQL databases as alternative backends for environments where SQLite is problematic or considered too heavyweight. This would provide flexibility for different deployment scenarios.","design":"Research options:\n- modernc.org/sqlite (pure Go SQLite implementation, no cgo)\n- rqlite (distributed SQLite with Raft)\n- go-memdb (in-memory database by HashiCorp)\n- badger (embedded key-value store, would need SQL layer)\n- bbolt (embedded key-value store)\n- duckdb (lightweight analytical database)\n\nEvaluate on:\n- Memory footprint vs SQLite\n- cgo dependency (pure Go preferred)\n- SQL compatibility level\n- Transaction support\n- Performance characteristics\n- Maintenance/community status\n- Migration complexity from SQLite\n\nConsider creating a storage abstraction layer to support multiple backends.","acceptance_criteria":"- Document comparison of at least 3 alternatives\n- Benchmark memory usage and performance vs SQLite\n- Assess migration effort for each option\n- Recommendation on whether to support alternatives\n- If yes, prototype storage interface abstraction","notes":"Worth noting: modernc.org/sqlite is a pure Go implementation (no cgo) that might already address the \"heavyweight\" concern, since much of SQLite's overhead comes from cgo calls. Should evaluate this first before exploring completely different database technologies.","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-16T11:01:26.950225-07:00","updated_at":"2025-10-16T12:50:18.917504-07:00"} +{"id":"bd-269","title":"Add label and title filtering to bd list","description":"Add --label and --title flags to bd list command for better filtering. Labels backend already exists, just need CLI exposure. Title search needs both backend and CLI implementation.","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.950362-07:00","updated_at":"2025-10-16T12:50:18.917686-07:00","closed_at":"2025-10-16T11:01:26.950362-07:00","external_ref":"gh-45"} +{"id":"bd-27","title":"Cache compiled regexes in replaceIDReferences for performance","description":"replaceIDReferences() compiles the same regex patterns on every call. With 100 issues and 10 ID mappings, that's 1000 regex compilations. Pre-compile regexes once and reuse. Can use a struct with compiled regex, placeholder, and newID. Located in collision.go:329. Estimated performance improvement: 10-100x for large batches.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-12T16:39:18.305517-07:00","updated_at":"2025-10-16T12:50:18.917868-07:00","closed_at":"2025-10-13T23:50:25.865317-07:00"} +{"id":"bd-270","title":"Detect and handle Git merge conflicts in JSONL auto-import","description":"","design":"**Problem**: Git merge conflicts in .beads/issues.jsonl break auto-import silently. When JSONL contains conflict markers (\u003c\u003c\u003c\u003c\u003c\u003c\u003c HEAD, =======, \u003e\u003e\u003e\u003e\u003e\u003e\u003e), JSON parser fails and entire import is skipped. System only shows parse error but doesn't identify it as a merge conflict.\n\n**Impact**: Critical - blocks all auto-import until manually resolved.\n\n**Solution**:\n1. Add pre-parse merge conflict detection in autoImportIfNewer()\n2. Check for conflict markers before JSON parsing\n3. Provide helpful error message with resolution instructions\n4. Consider auto-resolution strategies:\n - Parse each section separately (HEAD vs incoming)\n - Detect collisions between sections\n - Auto-resolve with --resolve-collisions logic\n - OR abort with clear merge resolution instructions\n\n**Code locations**:\n- cmd/bd/main.go:autoImportIfNewer() (lines 164-398)\n- cmd/bd/import.go (manual import with better error handling)\n- internal/storage/sqlite/collision.go (collision detection)","acceptance_criteria":"- Pre-parse detection catches merge conflict markers\n- Clear error message identifies it as merge conflict\n- Error message includes resolution steps\n- Test case with synthetic merge conflict\n- Consider: automatic merge resolution (stretch goal)","status":"closed","priority":0,"issue_type":"bug","assignee":"amp","created_at":"2025-10-16T11:01:26.950648-07:00","updated_at":"2025-10-16T12:50:18.918275-07:00","closed_at":"2025-10-16T11:01:26.950648-07:00"} +{"id":"bd-271","title":"Epic: Git-Based Auto-Sync for Multi-Device Support","description":"Implement git-based auto-sync to enable multi-device workflows while maintaining beads' local-first, lightweight philosophy. Build on existing JSONL export/import infrastructure and collision detection.","design":"See DESIGN-GIT-SYNC.md for comprehensive architectural design.\n\nCore principle: Git + JSONL remains source of truth. No required server. Optional lightweight sync gateway for users who want push-button multi-device support.","acceptance_criteria":"- Phase 1: Enhanced git-based sync (no server) completed\n- Phase 2: Optional bd serve gateway implemented\n- Phase 3: Client gateway integration working\n- Phase 4: Production-ready with CRDT conflict resolution\n- All existing functionality preserved (backward compatible)\n- Documentation complete\n\n---","status":"open","priority":1,"issue_type":"epic","created_at":"2025-10-16T11:01:26.950785-07:00","updated_at":"2025-10-16T12:50:18.918875-07:00","dependencies":[{"issue_id":"bd-271","depends_on_id":"bd-272","type":"parent-child","created_at":"2025-10-16T11:01:27.064068-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-273","type":"parent-child","created_at":"2025-10-16T11:01:27.067101-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-274","type":"parent-child","created_at":"2025-10-16T11:01:27.067247-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-275","type":"parent-child","created_at":"2025-10-16T11:01:27.067378-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-276","type":"parent-child","created_at":"2025-10-16T11:01:27.067513-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-278","type":"parent-child","created_at":"2025-10-16T11:01:27.068474-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-277","type":"parent-child","created_at":"2025-10-16T11:01:27.068629-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-279","type":"parent-child","created_at":"2025-10-16T11:01:27.068761-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-280","type":"parent-child","created_at":"2025-10-16T11:01:27.068908-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-281","type":"parent-child","created_at":"2025-10-16T11:01:27.069053-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-282","type":"parent-child","created_at":"2025-10-16T11:01:27.069201-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-283","type":"parent-child","created_at":"2025-10-16T11:01:27.069352-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-284","type":"parent-child","created_at":"2025-10-16T11:01:27.069501-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-285","type":"parent-child","created_at":"2025-10-16T11:01:27.069651-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-286","type":"parent-child","created_at":"2025-10-16T11:01:27.0698-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-287","type":"parent-child","created_at":"2025-10-16T11:01:27.06995-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-288","type":"parent-child","created_at":"2025-10-16T11:01:27.070111-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-289","type":"parent-child","created_at":"2025-10-16T11:01:27.070297-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-290","type":"parent-child","created_at":"2025-10-16T11:01:27.070448-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-291","type":"parent-child","created_at":"2025-10-16T11:01:27.0706-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-292","type":"parent-child","created_at":"2025-10-16T11:01:27.070747-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-293","type":"parent-child","created_at":"2025-10-16T11:01:27.070898-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-294","type":"parent-child","created_at":"2025-10-16T11:01:27.071048-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-295","type":"parent-child","created_at":"2025-10-16T11:01:27.071198-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-296","type":"parent-child","created_at":"2025-10-16T11:01:27.071356-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-297","type":"parent-child","created_at":"2025-10-16T11:01:27.0715-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-298","type":"parent-child","created_at":"2025-10-16T11:01:27.071645-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-299","type":"parent-child","created_at":"2025-10-16T11:01:27.071789-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-300","type":"parent-child","created_at":"2025-10-16T11:01:27.071932-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-301","type":"parent-child","created_at":"2025-10-16T11:01:27.072076-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-302","type":"parent-child","created_at":"2025-10-16T11:01:27.072228-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-303","type":"parent-child","created_at":"2025-10-16T11:01:27.072387-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-304","type":"parent-child","created_at":"2025-10-16T11:01:27.072756-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-305","type":"parent-child","created_at":"2025-10-16T11:01:27.073568-07:00","created_by":"auto-import"},{"issue_id":"bd-271","depends_on_id":"bd-306","type":"parent-child","created_at":"2025-10-16T11:01:27.073748-07:00","created_by":"auto-import"}]} +{"id":"bd-272","title":"Phase 1: Implement bd sync command","description":"Create bd sync command to manually synchronize with git remote in a single operation.","design":"Command should:\n1. Export pending changes to JSONL\n2. Commit changes to git\n3. Pull from remote (with conflict resolution)\n4. Push local commits to remote\n\nWraps the entire sync workflow in one command for better UX.","acceptance_criteria":"- bd sync command implemented\n- Exports dirty changes to JSONL automatically\n- Commits to git with descriptive message\n- Pulls and handles merge conflicts\n- Auto-imports updated JSONL\n- Pushes to remote\n- Error handling for git failures\n- Tests cover success and failure scenarios\n- Documentation in README.md\n\n---","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.95094-07:00","updated_at":"2025-10-16T12:50:18.920045-07:00","closed_at":"2025-10-16T12:22:48.022905-07:00","dependencies":[{"issue_id":"bd-272","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.073964-07:00","created_by":"auto-import"}]} +{"id":"bd-273","title":"Phase 1: Implement bd daemon command","description":"Create bd daemon command to run background sync process with configurable interval.","design":"Daemon should:\n- Run in background (fork or systemd service)\n- Poll for changes at configurable interval (default: 5 minutes)\n- Export dirty issues to JSONL\n- Auto-commit if --auto-commit flag set\n- Auto-push if --auto-push flag set\n- Pull remote changes periodically\n- Auto-import when remote changes detected\n- Log sync activity\n\nCommand flags:\n- --interval=5m (sync check interval)\n- --auto-commit (automatically commit changes)\n- --auto-push (automatically push commits)\n- --stop (stop running daemon)\n- --status (show daemon status)","acceptance_criteria":"- bd daemon command implemented\n- Background process management working\n- Configurable sync interval\n- Auto-commit functionality\n- Auto-push functionality\n- PID file for process management\n- Graceful shutdown on SIGTERM\n- Logging to file or syslog\n- Status command shows daemon state\n- Tests for daemon lifecycle\n- Documentation in README.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.951061-07:00","updated_at":"2025-10-16T12:50:18.921413-07:00","dependencies":[{"issue_id":"bd-273","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.074192-07:00","created_by":"auto-import"}]} +{"id":"bd-274","title":"Phase 1: Create enhanced git hooks examples","description":"Create comprehensive git hooks in examples/git-hooks/ for immediate sync without daemon.","design":"Hooks to create:\n1. post-commit: Force immediate export, amend commit with JSONL changes\n2. post-merge: Auto-import with collision resolution\n3. pre-push: Ensure JSONL is up-to-date\n4. post-checkout: Auto-import when switching branches\n\nInstallation script: examples/git-hooks/install.sh","acceptance_criteria":"- post-commit hook that auto-exports\n- post-merge hook that auto-imports with --resolve-collisions\n- pre-push hook validates JSONL is synced\n- post-checkout hook imports branch changes\n- install.sh script copies hooks to .git/hooks/\n- Documentation in examples/git-hooks/README.md\n- Hooks are executable\n- Error handling in all hooks\n- Tests verify hook behavior\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.951185-07:00","updated_at":"2025-10-16T12:50:18.922496-07:00","dependencies":[{"issue_id":"bd-274","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.074429-07:00","created_by":"auto-import"}]} +{"id":"bd-275","title":"Phase 1: Implement three-way merge for conflicts","description":"Implement three-way merge algorithm to intelligently resolve conflicts by comparing base, local, and remote versions.","design":"Three-way merge logic:\n- Get base version from git history (last common ancestor)\n- Compare local vs base: if same, use remote (remote changed)\n- Compare remote vs base: if same, use local (local changed)\n- If both changed: mark as conflict for manual resolution\n\nField-by-field merging for Issue type:\n- title, description, design, acceptance_criteria, notes (text fields)\n- status, priority, issue_type (enum fields)\n- labels (set merge - union)\n- dependencies (set merge - union)\n\nReturn MergeResult with:\n- MergedVersion (auto-merged fields)\n- Conflicts (list of fields requiring manual resolution)","acceptance_criteria":"- ThreeWayMerge function implemented\n- GetLastSyncedVersion retrieves git base version\n- Field-by-field merge logic for all Issue fields\n- Union merge for labels and dependencies\n- Conflict detection for incompatible changes\n- MergeResult type defined\n- Integration with import collision detection\n- Tests cover all merge scenarios\n- Documentation in DESIGN-GIT-SYNC.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.951296-07:00","updated_at":"2025-10-16T12:50:18.924009-07:00","dependencies":[{"issue_id":"bd-275","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.074631-07:00","created_by":"auto-import"}]} +{"id":"bd-276","title":"Phase 1: Add version vectors for causal ordering","description":"Add optional version vector metadata to Issues for detecting causal relationships and enabling better conflict resolution.","design":"Add sync_metadata to Issue JSON:\n```json\n{\n \"sync_metadata\": {\n \"version\": 3,\n \"last_modified_by\": \"device-a\",\n \"version_vector\": {\n \"device-a\": 2,\n \"device-b\": 1\n }\n }\n}\n```\n\nVersion vector tracks logical clock per device:\n- Incremented on each update\n- Used to determine causality (happened-before)\n- Enables automatic conflict resolution for concurrent edits\n\nOptional field - backward compatible with existing JSONL.","acceptance_criteria":"- SyncMetadata type defined\n- Version vector in Issue struct (optional)\n- Device ID generation and storage\n- Increment version on update\n- Version vector comparison functions\n- Causal ordering detection\n- Integration with collision detection\n- Backward compatible JSONL parsing\n- Tests for version vector logic\n- Documentation in DESIGN-GIT-SYNC.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.951434-07:00","updated_at":"2025-10-16T12:50:18.924219-07:00","dependencies":[{"issue_id":"bd-276","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.07483-07:00","created_by":"auto-import"}]} +{"id":"bd-277","title":"Phase 1: Improve collision UX with interactive resolution","description":"Enhance collision handling UX with interactive prompts for users to choose resolution strategy.","design":"When collision detected during sync, prompt:\n```\n⚠ Collision detected on bd-10 (conflicting fields: priority, title)\n\nOptions:\n 1. Keep local change\n 2. Accept remote change\n 3. Remap remote to new ID (recommended)\n 4. Resolve manually\n\nChoose [1-4]:\n```\n\nAdd bd resolve command for manual resolution:\n- Opens editor with three-way diff\n- User edits merged version\n- Validates and applies resolution","acceptance_criteria":"- Interactive collision prompt implemented\n- User can choose resolution strategy\n- bd resolve command implemented\n- Three-way diff display in editor\n- Manual edit and apply workflow\n- Validation of resolved version\n- Tests for all resolution paths\n- Documentation in README.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.951574-07:00","updated_at":"2025-10-16T12:50:18.924408-07:00","dependencies":[{"issue_id":"bd-277","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.075008-07:00","created_by":"auto-import"}]} +{"id":"bd-278","title":"Phase 1: Add sync state machine tracking","description":"Implement sync state tracking to show users current sync status and guide next actions.","design":"Sync states:\n- clean: DB = JSONL = Git (all synced)\n- dirty: DB ≠ JSONL (pending flush)\n- conflict: JSONL ≠ DB (collision detected)\n- ahead: Local commits not pushed\n- behind: Remote commits not pulled\n- diverged: Both ahead and behind\n\nAdd CheckSyncState() function that:\n- Checks dirty issues count\n- Runs git status to check ahead/behind\n- Compares JSONL hash with DB\n- Returns SyncState\n\nDisplay in bd status command.","acceptance_criteria":"- SyncState enum defined\n- CheckSyncState() implemented\n- Git status parsing (ahead/behind commits)\n- Dirty issues detection\n- JSONL hash comparison\n- bd status shows sync state\n- Color-coded status display\n- Guidance on next action\n- Tests for all states\n- Documentation in README.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.951689-07:00","updated_at":"2025-10-16T12:50:18.92459-07:00","dependencies":[{"issue_id":"bd-278","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.075194-07:00","created_by":"auto-import"}]} +{"id":"bd-279","title":"Phase 1: Add tests for concurrent edit scenarios","description":"Create comprehensive test suite for concurrent editing scenarios across multiple devices.","design":"Test scenarios:\n1. Two devices edit different fields (should merge cleanly)\n2. Two devices edit same field (collision)\n3. One device edits closed issue (local wins)\n4. Race condition: simultaneous push (git handles)\n5. Three-way merge with base version\n6. Version vector causal ordering\n7. Union merge for labels\n8. Dependency conflict resolution\n\nUse test fixtures with pre-created git history.","acceptance_criteria":"- Test suite in cmd/bd/sync_test.go\n- All 8+ concurrent edit scenarios covered\n- Test fixtures with git history\n- Mock git operations where needed\n- Tests verify correct merge behavior\n- Tests verify collision detection\n- Tests run in CI\n- Documentation in test comments\n\n---","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.951804-07:00","updated_at":"2025-10-16T12:50:18.924759-07:00","dependencies":[{"issue_id":"bd-279","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.075374-07:00","created_by":"auto-import"}]} +{"id":"bd-28","title":"Improve error handling in dependency removal during remapping","description":"In updateDependencyReferences(), RemoveDependency errors are caught and ignored with continue (line 392). Comment says 'if dependency doesn't exist' but this catches ALL errors including real failures. Should check error type with errors.Is(err, ErrDependencyNotFound) and only ignore not-found errors, returning other errors properly.","status":"open","priority":3,"issue_type":"bug","created_at":"2025-10-12T16:39:26.78219-07:00","updated_at":"2025-10-16T12:50:18.925093-07:00"} +{"id":"bd-280","title":"Phase 1: Document git-based sync workflow","description":"Add comprehensive documentation for git-based sync workflow to README.md and create dedicated SYNC.md guide.","design":"Documentation should cover:\n- Manual git workflow (current)\n- bd sync command usage\n- bd daemon for background sync\n- Git hooks installation\n- Conflict resolution strategies\n- Troubleshooting common issues\n- Best practices for multi-device work\n\nCreate SYNC.md with:\n- Quick start guide\n- Detailed workflow examples\n- Conflict resolution guide\n- FAQ section","acceptance_criteria":"- README.md updated with sync overview\n- SYNC.md created with detailed guide\n- Examples for all sync workflows\n- Conflict resolution examples\n- Troubleshooting section\n- FAQ section\n- Diagrams for workflows (optional)\n- Links from AGENTS.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.952098-07:00","updated_at":"2025-10-16T12:50:18.926496-07:00","dependencies":[{"issue_id":"bd-280","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.07555-07:00","created_by":"auto-import"}]} +{"id":"bd-281","title":"Phase 2: Implement bd serve command","description":"Create bd serve command to start HTTP API gateway server that wraps bd CLI commands.","design":"Gateway server provides:\n- REST API wrapping bd commands\n- WebSocket for real-time notifications\n- API key authentication\n- Auto-commit on changes\n- Periodic git pull\n- Webhook notifications to clients\n\nCommand flags:\n- --port=8080 (HTTP port)\n- --api-key=\u003ckey\u003e (auth key, auto-generated if not provided)\n- --auto-commit (commit changes immediately)\n- --auto-pull=5m (pull interval)\n- --allowed-ips=\u003clist\u003e (IP whitelist)\n\nArchitecture: Thin wrapper that executes bd CLI commands and manages git operations.","acceptance_criteria":"- bd serve command implemented\n- HTTP server with route handlers\n- API key authentication\n- Auto-commit on CRUD operations\n- Background git pull task\n- WebSocket server for notifications\n- Graceful shutdown on SIGTERM\n- Logging of all API requests\n- Tests for server lifecycle\n- Documentation in README.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.952216-07:00","updated_at":"2025-10-16T12:50:18.926675-07:00","dependencies":[{"issue_id":"bd-281","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.075733-07:00","created_by":"auto-import"}]} +{"id":"bd-282","title":"Phase 2: Implement REST API endpoints","description":"Implement REST API endpoints that wrap bd CLI commands for remote access.","design":"API endpoints:\n- GET /api/health - server status\n- GET /api/sync/status - git sync state\n- POST /api/sync/pull - trigger pull + import\n- POST /api/sync/push - trigger export + push\n- GET /api/issues - list issues\n- POST /api/issues - create issue\n- GET /api/issues/:id - get issue\n- PATCH /api/issues/:id - update issue\n- DELETE /api/issues/:id - close issue\n- POST /api/issues/:id/labels - add label\n- DELETE /api/issues/:id/labels/:l - remove label\n- POST /api/issues/:id/deps - add dependency\n- DELETE /api/issues/:id/deps/:d - remove dependency\n\nAll endpoints return JSON.\nAll mutations require authentication.\nAll responses include proper HTTP status codes.","acceptance_criteria":"- All API endpoints implemented\n- Handlers wrap bd CLI commands\n- JSON request/response format\n- Proper HTTP status codes\n- Error responses with details\n- Authentication on mutation endpoints\n- CORS headers for web clients\n- Rate limiting (optional)\n- API tests for all endpoints\n- OpenAPI/Swagger spec\n- Documentation in API.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.952325-07:00","updated_at":"2025-10-16T12:50:18.926844-07:00","dependencies":[{"issue_id":"bd-282","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.07595-07:00","created_by":"auto-import"}]} +{"id":"bd-283","title":"Phase 2: Implement WebSocket notifications","description":"Implement WebSocket server for real-time push notifications to connected clients.","design":"WebSocket protocol:\n- Client subscribes to events (issue.created, issue.updated, etc.)\n- Server pushes notifications when events occur\n- Clients can filter by status, priority, labels\n- Heartbeat to detect disconnections\n\nEvents:\n- issue.created\n- issue.updated\n- issue.closed\n- sync.required\n- sync.complete\n\nMessage format: JSON with type, timestamp, data.","acceptance_criteria":"- WebSocket server at /api/subscribe\n- Client subscription with filters\n- Event notification on CRUD ops\n- Heartbeat/ping-pong\n- Client disconnect handling\n- Reconnection support\n- Multiple concurrent clients\n- Tests for WebSocket protocol\n- Client library example (Go)\n- Documentation in API.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.952456-07:00","updated_at":"2025-10-16T12:50:18.927016-07:00","dependencies":[{"issue_id":"bd-283","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.076127-07:00","created_by":"auto-import"}]} +{"id":"bd-284","title":"Phase 2: Create Docker packaging for gateway","description":"Create Dockerfile and docker-compose.yml for easy gateway deployment.","design":"Multi-stage Dockerfile:\n1. Builder stage: compile Go binary\n2. Runtime stage: Alpine with git, sqlite\n3. Initialize git config\n4. Expose port 8080\n5. Volume mount for /data\n\ndocker-compose.yml:\n- Service: beads-gateway\n- Environment variables for config\n- Volume mount for persistence\n- Restart policy\n\nInclude .dockerignore for efficient builds.","acceptance_criteria":"- Dockerfile with multi-stage build\n- docker-compose.yml with config\n- .dockerignore file\n- Build script (scripts/docker-build.sh)\n- Environment variable configuration\n- Volume mount for data persistence\n- README.md with Docker instructions\n- Published to Docker Hub (optional)\n- Tests for Docker deployment\n- Documentation in DEPLOYMENT.md\n\n---","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.952578-07:00","updated_at":"2025-10-16T12:50:18.92719-07:00","dependencies":[{"issue_id":"bd-284","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.076295-07:00","created_by":"auto-import"}]} +{"id":"bd-285","title":"Phase 2: Implement API key authentication","description":"Implement secure API key authentication for gateway API access.","design":"Authentication:\n- Bearer token in Authorization header\n- Single API key for personal use\n- Optional IP whitelist for additional security\n- Generate secure random key on first start\n- Store hashed key in config file\n\nAPI key generation:\n- 32 bytes of crypto/rand\n- Base64 encoded\n- Display once on generation\n\nConfig storage:\n- ~/.beads/gateway-config.json\n- Contains hashed API key\n- Optional allowed_ips list","acceptance_criteria":"- API key generation function\n- Secure storage in config file\n- Bearer token authentication\n- Middleware for auth checking\n- IP whitelist support (optional)\n- 401 response for invalid auth\n- Key rotation support\n- Tests for authentication\n- Documentation in SECURITY.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.952692-07:00","updated_at":"2025-10-16T12:50:18.927361-07:00","dependencies":[{"issue_id":"bd-285","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.076463-07:00","created_by":"auto-import"}]} +{"id":"bd-286","title":"Phase 2: Add gateway stress tests","description":"Create stress tests to validate gateway performance under load and ensure it can handle production traffic.","design":"Test scenarios:\n1. Concurrent request handling (100+ clients)\n2. Large issue database (10,000+ issues)\n3. WebSocket connection limits\n4. Git lock contention\n5. Memory usage under load\n6. Response time percentiles (p50, p95, p99)\n\nUse Go testing tools:\n- testing.B for benchmarks\n- net/http/httptest for server testing\n- goroutines for concurrent clients","acceptance_criteria":"- Stress test suite in cmd/bd/serve_stress_test.go\n- Concurrent client test (100+ requests/sec)\n- Large database test (10k+ issues)\n- WebSocket stress test\n- Memory profiling test\n- Response time benchmarks\n- Git operation serialization test\n- Performance regression detection\n- Documentation in PERFORMANCE.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.960301-07:00","updated_at":"2025-10-16T12:50:18.927715-07:00","dependencies":[{"issue_id":"bd-286","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.076628-07:00","created_by":"auto-import"}]} +{"id":"bd-287","title":"Phase 2: Create API client library (Go)","description":"Create Go client library for accessing beads gateway API.","design":"Client library should provide:\n- Type-safe API calls\n- Authentication handling\n- Error handling and retries\n- WebSocket subscription\n- Automatic reconnection\n- Context support for cancellation\n\nPackage: github.com/steveyegge/beads/client\n\nExample usage:\n```go\nclient := beads.NewClient(\"http://gateway:8080\", \"api-key\")\nissue, err := client.GetIssue(ctx, \"bd-10\")\n```","acceptance_criteria":"- Go client library package\n- All API endpoints wrapped\n- Type-safe request/response\n- Authentication handling\n- Retry logic for transient errors\n- WebSocket client support\n- Context support\n- Example usage in examples/\n- Tests for client library\n- Documentation in CLIENT.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.962338-07:00","updated_at":"2025-10-16T12:50:18.928288-07:00","dependencies":[{"issue_id":"bd-287","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.076804-07:00","created_by":"auto-import"}]} +{"id":"bd-288","title":"Phase 2: Document gateway API","description":"Create comprehensive API documentation for gateway with examples and OpenAPI spec.","design":"Documentation should include:\n- Authentication guide\n- All endpoint descriptions\n- Request/response examples\n- Error codes and handling\n- WebSocket protocol\n- Rate limits\n- Best practices\n\nCreate OpenAPI 3.0 specification for:\n- Automated client generation\n- API testing tools\n- Documentation generation","acceptance_criteria":"- API.md with full documentation\n- OpenAPI 3.0 spec (api-spec.yaml)\n- Request/response examples for all endpoints\n- Authentication examples\n- WebSocket protocol documentation\n- Error response documentation\n- Code examples in multiple languages\n- Postman collection (optional)\n- Link from README.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.964881-07:00","updated_at":"2025-10-16T12:50:18.929355-07:00","dependencies":[{"issue_id":"bd-288","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.076965-07:00","created_by":"auto-import"}]} +{"id":"bd-289","title":"Phase 3: Implement bd config command for gateway","description":"Create bd config command to manage gateway configuration for transparent client-side gateway use.","design":"Config commands:\n- bd config set gateway \u003curl\u003e\n- bd config set api_key \u003ckey\u003e\n- bd config get gateway\n- bd config get api_key\n- bd config unset gateway\n- bd config list\n\nConfig storage: ~/.beads/config.json\n\nConfig keys:\n- gateway_url: URL of gateway server\n- api_key: Authentication key\n- auto_sync: Enable background sync\n- sync_interval: Sync check interval","acceptance_criteria":"- bd config command implemented\n- Set/get/unset/list subcommands\n- Config file at ~/.beads/config.json\n- Validation of config values\n- Secure storage of API key\n- Tests for config operations\n- Documentation in README.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.965442-07:00","updated_at":"2025-10-16T12:50:18.929521-07:00","dependencies":[{"issue_id":"bd-289","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.077136-07:00","created_by":"auto-import"}]} +{"id":"bd-29","title":"Use safer placeholder pattern in replaceIDReferences","description":"Currently uses __PLACEHOLDER_0__ which could theoretically collide with user text. Use a truly unique placeholder like null bytes: \\x00REMAP\\x00_0_\\x00 which are unlikely to appear in normal text. Located in collision.go:324. Very low probability issue but worth fixing for completeness.","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-12T16:39:33.665449-07:00","updated_at":"2025-10-16T12:50:18.929701-07:00"} +{"id":"bd-290","title":"Phase 3: Add transparent gateway detection","description":"Modify bd commands to transparently use gateway API when configured, with automatic fallback to local storage.","design":"Update storage layer to:\n1. Check for gateway config\n2. If gateway configured, use GatewayClient\n3. If gateway unavailable, fall back to local SQLite\n4. Cache gateway responses for offline use\n\nTransparent for these commands:\n- bd create\n- bd update\n- bd close\n- bd list\n- bd show\n- bd label\n- bd dep\n\nNo changes to command interface - works identically.","acceptance_criteria":"- Gateway detection in storage layer\n- GatewayClient wraps API calls\n- Automatic fallback to local on error\n- Response caching for offline mode\n- All CRUD commands work via gateway\n- Offline mode preserves functionality\n- Tests for gateway mode\n- Tests for fallback behavior\n- Documentation in README.md\n\n---","status":"open","priority":1,"issue_type":"feature","created_at":"2025-10-16T11:01:26.968874-07:00","updated_at":"2025-10-16T12:50:18.929916-07:00","dependencies":[{"issue_id":"bd-290","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.077301-07:00","created_by":"auto-import"}]} +{"id":"bd-291","title":"Phase 3: Implement client-side sync daemon","description":"Create client-side background sync daemon for automatic synchronization with gateway.","design":"Sync daemon:\n- Runs in background\n- Polls gateway for updates every 30s\n- Pushes local changes to gateway\n- Handles sync conflicts\n- Logs sync activity\n\nCommands:\n- bd sync-daemon start\n- bd sync-daemon stop\n- bd sync-daemon status\n\nUses gateway WebSocket for real-time updates if available.","acceptance_criteria":"- Client sync daemon implemented\n- Background process management\n- Polling gateway for changes\n- Push local changes to gateway\n- WebSocket subscription for real-time\n- Conflict resolution\n- PID file management\n- Status command\n- Tests for sync daemon\n- Documentation in README.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.968995-07:00","updated_at":"2025-10-16T12:50:18.930095-07:00","dependencies":[{"issue_id":"bd-291","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.077474-07:00","created_by":"auto-import"}]} +{"id":"bd-292","title":"Phase 3: Add WebSocket subscription client","description":"Implement WebSocket client for subscribing to gateway notifications and receiving real-time updates.","design":"WebSocket client:\n- Connects to gateway /api/subscribe\n- Sends subscription request with filters\n- Receives event notifications\n- Handles disconnection and reconnection\n- Updates local DB on events\n\nIntegration with sync daemon:\n- Daemon subscribes to all events\n- On notification, triggers immediate sync\n- Reduces polling overhead","acceptance_criteria":"- WebSocket client implementation\n- Subscription with event filters\n- Event handler callbacks\n- Auto-reconnection logic\n- Integration with sync daemon\n- Local DB update on events\n- Connection state management\n- Tests for WebSocket client\n- Documentation in CLIENT.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.969144-07:00","updated_at":"2025-10-16T12:50:18.930349-07:00","dependencies":[{"issue_id":"bd-292","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.077641-07:00","created_by":"auto-import"}]} +{"id":"bd-293","title":"Phase 3: Add offline mode with local cache","description":"Implement offline mode that caches gateway responses locally for continued operation when gateway is unavailable.","design":"Offline cache:\n- SQLite cache of gateway responses\n- Automatic cache population on sync\n- Serve reads from cache when offline\n- Queue writes for later sync\n- Conflict detection on reconnect\n\nCache strategy:\n- Read-through: Check cache, then gateway\n- Write-behind: Queue, sync on reconnect\n- TTL for cache entries\n- Manual cache clear command","acceptance_criteria":"- Local cache database\n- Read-through caching\n- Write queue for offline writes\n- Sync queued writes on reconnect\n- Conflict detection after offline\n- Cache TTL and expiration\n- bd cache command (clear, status)\n- Tests for offline scenarios\n- Documentation in README.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.969275-07:00","updated_at":"2025-10-16T12:50:18.930632-07:00","dependencies":[{"issue_id":"bd-293","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.07781-07:00","created_by":"auto-import"}]} +{"id":"bd-294","title":"Phase 3: Create gateway integration tests","description":"Create end-to-end integration tests that verify gateway and client working together.","design":"Integration test scenarios:\n1. Client connects to gateway\n2. Create issue via gateway\n3. List issues via gateway\n4. Update issue via gateway\n5. WebSocket notification received\n6. Sync between multiple clients\n7. Offline mode and reconnect\n8. Conflict resolution\n\nUse Docker Compose to spin up gateway for tests.","acceptance_criteria":"- Integration test suite\n- Docker Compose for test environment\n- All CRUD operations tested\n- WebSocket notification test\n- Multi-client sync test\n- Offline/reconnect test\n- Conflict resolution test\n- Tests run in CI\n- Documentation in TESTING.md\n\n---","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.969397-07:00","updated_at":"2025-10-16T12:50:18.930784-07:00","dependencies":[{"issue_id":"bd-294","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.077996-07:00","created_by":"auto-import"}]} +{"id":"bd-295","title":"Phase 3: Document client gateway setup","description":"Create comprehensive documentation for setting up and using gateway mode.","design":"Documentation should cover:\n- Gateway deployment (Docker)\n- Client configuration (bd config)\n- Transparent gateway mode\n- Sync daemon setup\n- Offline mode\n- Troubleshooting\n- Best practices\n\nCreate GATEWAY.md with:\n- Quick start guide\n- Deployment options\n- Configuration reference\n- Usage examples\n- FAQ","acceptance_criteria":"- GATEWAY.md created\n- Quick start guide\n- Deployment instructions (Docker, binary)\n- Client setup instructions\n- Sync daemon guide\n- Offline mode documentation\n- Troubleshooting section\n- FAQ section\n- Links from README.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.970976-07:00","updated_at":"2025-10-16T12:50:18.931034-07:00","dependencies":[{"issue_id":"bd-295","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.078171-07:00","created_by":"auto-import"}]} +{"id":"bd-296","title":"Phase 4: Implement CRDT for automatic conflict resolution","description":"Implement Conflict-free Replicated Data Type (CRDT) semantics for automatic merge of concurrent edits without conflicts.","design":"CRDT strategies per field type:\n- Single-value fields (title, status): Last-Write-Wins with version vectors\n- Set fields (labels): G-Set (grow-only, union merge)\n- List fields (events): RGA (Replicated Growable Array)\n- Text fields: Operational transforms or delta-based\n\nAdd CRDT metadata:\n- Version vector per device\n- Logical clock per update\n- Tombstones for deletions\n\nRequires sync_metadata in JSONL (optional, backward compatible).","acceptance_criteria":"- CRDT logic for all field types\n- Last-Write-Wins for single-value\n- Union merge for sets\n- RGA for lists\n- Version vector comparison\n- Automatic conflict resolution\n- No manual resolution needed\n- Tests for concurrent updates\n- Documentation in DESIGN-GIT-SYNC.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.971359-07:00","updated_at":"2025-10-16T12:50:18.931945-07:00","dependencies":[{"issue_id":"bd-296","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.078345-07:00","created_by":"auto-import"}]} +{"id":"bd-297","title":"Phase 4: Add operational transforms for text fields","description":"Implement operational transforms (OT) for text fields to enable real-time collaborative editing of descriptions and notes.","design":"OT for text fields:\n- description\n- design\n- acceptance_criteria\n- notes\n\nOperations:\n- Insert(pos, text)\n- Delete(pos, len)\n- Transform operations for concurrent edits\n\nRequires real-time sync via WebSocket.\n\nAlternative: Use simpler delta-based approach with three-way merge.","acceptance_criteria":"- OT implementation for text fields\n- Insert/Delete operations\n- Transform function for concurrent ops\n- Integration with WebSocket sync\n- Tests for concurrent text edits\n- Performance acceptable for large text\n- Documentation in DESIGN-GIT-SYNC.md\n\n---","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-16T11:01:26.971505-07:00","updated_at":"2025-10-16T12:50:18.9335-07:00","dependencies":[{"issue_id":"bd-297","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.078532-07:00","created_by":"auto-import"}]} +{"id":"bd-298","title":"Phase 4: Add sync status to bd status command","description":"Enhance bd status command to show detailed sync status including gateway connection, sync state, and conflicts.","design":"bd status should display:\n- Sync state (clean/dirty/ahead/behind/diverged/conflict)\n- Gateway connection status (connected/offline)\n- Last sync timestamp\n- Pending changes count\n- Conflicts count\n- Sync daemon status (running/stopped)\n\nFormat:\n```\nSync Status:\n State: clean\n Gateway: connected (http://gateway:8080)\n Last sync: 2 minutes ago\n Pending: 0 issues\n Conflicts: 0\n Daemon: running (PID 12345)\n```","acceptance_criteria":"- Sync status in bd status output\n- Gateway connection check\n- Sync state display\n- Pending changes count\n- Conflicts list\n- Daemon status\n- Color-coded output\n- Tests for status display\n- Documentation in README.md\n\n---","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:01:26.971631-07:00","updated_at":"2025-10-16T12:50:18.935098-07:00","dependencies":[{"issue_id":"bd-298","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.078721-07:00","created_by":"auto-import"}]} +{"id":"bd-299","title":"Phase 4: Add metrics and monitoring","description":"Add metrics collection and monitoring for gateway operations and sync performance.","design":"Metrics to collect:\n- API request count and latency\n- Sync operation count and duration\n- Conflict resolution count\n- WebSocket connection count\n- Git operation duration\n- Database query performance\n\nExpose metrics:\n- Prometheus format at /metrics\n- JSON format at /api/metrics\n\nOptional: Grafana dashboard template.","acceptance_criteria":"- Metrics collection implemented\n- Prometheus exposition format\n- Key metrics covered (requests, latency, sync)\n- /metrics endpoint\n- /api/metrics JSON endpoint\n- Grafana dashboard template\n- Documentation in MONITORING.md\n\n---","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-16T11:01:26.971795-07:00","updated_at":"2025-10-16T12:50:18.936785-07:00","dependencies":[{"issue_id":"bd-299","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.078895-07:00","created_by":"auto-import"}]} +{"id":"bd-3","title":"Normal task","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-12T00:43:03.461615-07:00","updated_at":"2025-10-16T12:50:18.936957-07:00"} +{"id":"bd-30","title":"Remove unused issueMap in scoreCollisions","description":"scoreCollisions() creates issueMap and populates it (lines 135-138) but never uses it. Either remove it or add a TODO comment explaining future use. Located in collision.go:135-138. Cosmetic cleanup.","status":"open","priority":4,"issue_type":"chore","created_at":"2025-10-12T16:39:40.101611-07:00","updated_at":"2025-10-16T12:50:18.937147-07:00"} +{"id":"bd-300","title":"Phase 4: Create performance benchmarks","description":"Create comprehensive performance benchmarks for sync operations and gateway API.","design":"Benchmarks for:\n1. JSONL import/export performance\n2. Collision detection performance\n3. Three-way merge performance\n4. Gateway API latency\n5. WebSocket throughput\n6. Concurrent client handling\n7. Large database operations (10k+ issues)\n\nUse Go benchmarking and profiling tools.\n\nTrack performance over time in CI.","acceptance_criteria":"- Benchmark suite implemented\n- All key operations benchmarked\n- CPU and memory profiling\n- Large database benchmarks\n- Concurrent operation benchmarks\n- CI integration for regression detection\n- Performance baseline documented\n- Documentation in PERFORMANCE.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.9723-07:00","updated_at":"2025-10-16T12:50:18.937322-07:00","dependencies":[{"issue_id":"bd-300","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.079094-07:00","created_by":"auto-import"}]} +{"id":"bd-301","title":"Phase 4: Add multi-gateway federation (optional)","description":"Add support for federating multiple gateway instances for distributed team workflows.","design":"Federation allows:\n- Multiple gateways sync with each other\n- Each gateway has authoritative set of issues\n- Peer-to-peer sync protocol\n- Conflict resolution across gateways\n\nArchitecture:\n- Gateway-to-gateway API\n- Peer discovery\n- Sync protocol between gateways\n- Distributed conflict resolution\n\nComplex feature - only if team usage emerges.","acceptance_criteria":"- Gateway federation protocol designed\n- Peer discovery mechanism\n- Gateway-to-gateway sync\n- Distributed conflict resolution\n- Tests for federation\n- Documentation in FEDERATION.md\n\n---","status":"open","priority":4,"issue_type":"feature","created_at":"2025-10-16T11:01:26.97242-07:00","updated_at":"2025-10-16T12:50:18.937468-07:00","dependencies":[{"issue_id":"bd-301","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.079569-07:00","created_by":"auto-import"}]} +{"id":"bd-302","title":"Phase 4: Create production deployment guide","description":"Create comprehensive production deployment guide for running gateway in production environments.","design":"Guide should cover:\n- Deployment options (Docker, Kubernetes, systemd)\n- Security best practices\n- Monitoring and alerting\n- Backup and recovery\n- Scaling considerations\n- Troubleshooting\n- Maintenance procedures","acceptance_criteria":"- DEPLOYMENT.md created\n- Docker deployment guide\n- Kubernetes manifests\n- Systemd service file\n- Security hardening checklist\n- Monitoring setup guide\n- Backup procedures\n- Troubleshooting section\n- Scaling recommendations\n- Links from README.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.972547-07:00","updated_at":"2025-10-16T12:50:18.937622-07:00","dependencies":[{"issue_id":"bd-302","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.082298-07:00","created_by":"auto-import"}]} +{"id":"bd-303","title":"Update README.md with git-sync overview","description":"Update main README.md to include overview of git-sync feature and link to detailed documentation.","design":"Add new section: \"Multi-Device Sync\"\n\nContent:\n- Brief overview of git-based sync\n- Link to SYNC.md for details\n- Link to GATEWAY.md for gateway mode\n- Quick start examples\n- Configuration options\n\nKeep brief - detailed docs in separate files.","acceptance_criteria":"- README.md updated with sync section\n- Links to SYNC.md and GATEWAY.md\n- Quick start examples\n- Configuration overview\n- Maintains existing structure\n- All links working\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.972663-07:00","updated_at":"2025-10-16T12:50:18.937779-07:00","dependencies":[{"issue_id":"bd-303","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.082489-07:00","created_by":"auto-import"}]} +{"id":"bd-304","title":"Create SYNC.md comprehensive guide","description":"Create detailed SYNC.md guide covering all aspects of git-based synchronization.","design":"Sections:\n1. Introduction\n2. Quick Start\n3. Manual Git Workflow\n4. bd sync Command\n5. bd daemon Background Sync\n6. Git Hooks\n7. Conflict Resolution\n8. Best Practices\n9. Troubleshooting\n10. FAQ\n\nInclude examples, code snippets, and diagrams.","acceptance_criteria":"- SYNC.md created with all sections\n- Quick start guide for new users\n- Detailed workflow examples\n- Conflict resolution guide\n- Best practices section\n- Troubleshooting with solutions\n- FAQ with common questions\n- Code examples working\n- Links from README.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.972791-07:00","updated_at":"2025-10-16T12:50:18.938278-07:00","dependencies":[{"issue_id":"bd-304","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.082869-07:00","created_by":"auto-import"}]} +{"id":"bd-305","title":"Create API.md for gateway API documentation","description":"Create comprehensive API.md documenting the gateway REST API and WebSocket protocol.","design":"Sections:\n1. Introduction\n2. Authentication\n3. REST Endpoints\n4. WebSocket Protocol\n5. Error Handling\n6. Rate Limits\n7. Examples\n\nFor each endpoint:\n- URL and method\n- Request parameters\n- Request body schema\n- Response schema\n- Error responses\n- Code example","acceptance_criteria":"- API.md created with all sections\n- All endpoints documented\n- Request/response schemas\n- WebSocket protocol docs\n- Error codes and handling\n- Rate limit documentation\n- Examples in multiple languages\n- Links from README.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.972924-07:00","updated_at":"2025-10-16T12:50:18.938448-07:00","dependencies":[{"issue_id":"bd-305","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T11:01:27.083087-07:00","created_by":"auto-import"}]} +{"id":"bd-306","title":"Close GH-11 (Docker support) or update with sync approach","description":"Resolve GitHub issue 11 about Docker support - either close as completed via gateway or update with new sync approach.","design":"Review GH-11 requirements:\n- User wants to use beads across multiple dev machines\n- Docker hosting was proposed solution\n\nNew approach:\n- Phase 1: Pure git-based sync (no Docker needed)\n- Phase 2: Optional Docker gateway for convenience\n- Addresses use case without mandating server\n\nUpdate GH-11 with:\n- Link to DESIGN-GIT-SYNC.md\n- Explain git-based approach\n- Note optional Docker gateway\n- Ask for feedback\n\nClose issue when sync features implemented.","acceptance_criteria":"- GH-11 reviewed and understood\n- Comment added explaining sync approach\n- Link to design document\n- User feedback requested\n- Issue closed when Phase 1-2 complete\n- Documentation cross-referenced","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.973135-07:00","updated_at":"2025-10-16T12:50:18.938612-07:00"} +{"id":"bd-307","title":"Fix circular dependency detection and prevention","description":"Implement robust detection, prevention, and user guidance for circular dependencies that cross edge types. Current system only prevents cycles within \"blocks\" type dependencies, allowing cross-type cycles (e.g., A blocks B, B parent-child A) that can hide work from ready list and confuse dependency visualization.","design":"Analysis shows that cycle prevention is type-specific (blocks only) while detection is type-agnostic. All current operations are safe from infinite loops (depth-limited), but semantic confusion and future maintenance hazards exist. Need validation, warnings, and potentially full cross-type prevention.","acceptance_criteria":"- Cross-type cycles are prevented or warned about\n- Semantic validation prevents child→parent dependencies\n- Users receive clear diagnostic messages\n- Documentation explains cycle handling behavior\n- All existing safe operations remain protected","status":"open","priority":1,"issue_type":"epic","created_at":"2025-10-16T11:01:26.973279-07:00","updated_at":"2025-10-16T12:50:18.938776-07:00"} +{"id":"bd-308","title":"Add semantic validation for parent-child dependency direction","description":"Prevent backwards parent-child dependencies where child tasks depend on their parent epics. This is semantically incorrect - parents should depend on children completing, not the reverse.","design":"Add validation in AddDependency that checks if dep.Type == DepParentChild and validates the direction is correct (parent depends on child, not child on parent). Reject with clear error message if direction is backwards.","acceptance_criteria":"- Child→parent dependencies are rejected with clear error\n- Parent→child dependencies work as expected\n- Error message explains correct direction\n- Tests cover both valid and invalid cases","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.9734-07:00","updated_at":"2025-10-16T12:50:18.939575-07:00","dependencies":[{"issue_id":"bd-308","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T11:01:27.083267-07:00","created_by":"auto-import"}]} +{"id":"bd-309","title":"Add diagnostic warnings when cycles are detected after dep add","description":"Run DetectCycles() after adding dependencies and warn users if cycles exist. Provide clear, actionable messages about which issues form the cycle and potential impact on ready work visibility.","design":"In bd dep add command, after successful dependency addition, call DetectCycles(). If cycles found, print warning to stderr showing cycle path and explanation. Include suggestion to run 'bd dep cycles' for full analysis.","acceptance_criteria":"- Warnings appear after dep add when cycles exist\n- Warning shows cycle path clearly\n- Explains impact on ready work calculation\n- Suggests next steps for user\n- Does not block operation (warning only)","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-16T11:01:26.973528-07:00","updated_at":"2025-10-16T12:50:18.939719-07:00","dependencies":[{"issue_id":"bd-309","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T11:01:27.08342-07:00","created_by":"auto-import"}]} +{"id":"bd-31","title":"Test issue for design field","description":"Testing the new update flags","design":"## Design Plan\\n- Add flags to update command\\n- Test thoroughly\\n- Document changes","acceptance_criteria":"- All three fields (design, notes, acceptance-criteria) can be updated\\n- Changes persist in database\\n- bd show displays the fields correctly","notes":"Implementation complete. All tests passing.","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-12T17:09:22.147446-07:00","updated_at":"2025-10-16T12:50:18.940387-07:00","closed_at":"2025-10-12T17:10:32.828906-07:00"} +{"id":"bd-310","title":"Document cycle handling behavior and limitations","description":"Add comprehensive documentation explaining which dependency types are checked for cycles, why cross-type cycles matter, what operations are safe, and how users should think about dependency design.","design":"Add comments to AddDependency explaining cycle checking logic. Update README.md with section on cycles. Add to DESIGN.md explaining technical decisions. Include examples of problematic and correct dependency patterns.","acceptance_criteria":"- Code comments explain cycle checking\n- README has user-facing cycle guidance\n- DESIGN.md has technical rationale\n- Examples show good and bad patterns\n- Explains ready work implications","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.976667-07:00","updated_at":"2025-10-16T12:50:18.941102-07:00","dependencies":[{"issue_id":"bd-310","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T11:01:27.083569-07:00","created_by":"auto-import"}]} +{"id":"bd-311","title":"Benchmark cycle detection performance on large dependency graphs","description":"Measure performance impact of cross-type cycle checking on large graphs (1000+ issues). Determine if optimization needed before enabling full prevention. Test various graph structures (sparse, dense, deeply nested).","design":"Create benchmark test with synthetic dependency graphs of varying sizes and structures. Measure AddDependency performance with type-specific vs all-types cycle checking. Document findings and optimization recommendations if needed.","acceptance_criteria":"- Benchmark test covers 100, 1000, 5000 issue graphs\n- Tests sparse and dense dependency patterns\n- Measures time for both checking approaches\n- Documents results in comments or DESIGN.md\n- Recommends optimization if \u003e100ms impact found","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T11:01:26.97681-07:00","updated_at":"2025-10-16T12:50:18.941562-07:00","dependencies":[{"issue_id":"bd-311","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T11:01:27.083721-07:00","created_by":"auto-import"}]} +{"id":"bd-312","title":"Implement cross-type cycle prevention in AddDependency","description":"Expand cycle detection to check ALL dependency types, not just \"blocks\" type. Currently A blocks B, B parent-child A is allowed but creates a cross-type cycle that hides work from ready list.","design":"Modify cycle check in AddDependency to traverse all dependency types using recursive CTE without type filter. Check if adding new dependency would create cycle across any combination of types. Include depth limit (100) to prevent infinite traversal.","acceptance_criteria":"- Cross-type cycles are prevented\n- Error message indicates cycle would be created\n- All dependency types are checked in traversal\n- Performance is acceptable (add benchmark)\n- Tests cover various cross-type cycle scenarios","notes":"Implementation complete with oracle feedback addressed:\n- Removed type filter from cycle detection (checks all types)\n- Extracted maxDependencyDepth=100 constant shared by AddDependency and DetectCycles\n- Moved cycle check before INSERT to avoid unnecessary write on failure\n- Added index verification (idx_dependencies_issue exists)\n- Added 6 comprehensive tests: self-dependency, related cycles (2-node, mixed), cross-type cycles (2-node, 3-node, discovered-from)\nAll tests pass.","status":"closed","priority":1,"issue_type":"task","assignee":"amp","created_at":"2025-10-16T11:01:26.976929-07:00","updated_at":"2025-10-16T12:50:18.94214-07:00","closed_at":"2025-10-16T11:01:26.976929-07:00","dependencies":[{"issue_id":"bd-312","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T11:01:27.084398-07:00","created_by":"auto-import"}]} +{"id":"bd-313","title":"stress_test_6","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.420341-07:00","updated_at":"2025-10-16T12:50:18.942357-07:00","closed_at":"2025-10-15T16:26:05.20809-07:00"} +{"id":"bd-314","title":"final_test_10","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.426442-07:00","updated_at":"2025-10-16T12:50:18.942519-07:00","closed_at":"2025-10-15T16:26:05.243566-07:00"} +{"id":"bd-315","title":"parallel_test_8","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.427791-07:00","updated_at":"2025-10-16T12:50:18.942671-07:00","closed_at":"2025-10-15T16:26:05.438754-07:00"} +{"id":"bd-316","title":"parallel_test_9","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.428643-07:00","updated_at":"2025-10-16T12:50:18.942843-07:00","closed_at":"2025-10-15T16:26:05.42663-07:00"} +{"id":"bd-317","title":"race_test_4","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.428918-07:00","updated_at":"2025-10-16T12:50:18.942999-07:00","closed_at":"2025-10-15T16:26:05.332082-07:00"} +{"id":"bd-318","title":"race_test_8","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.430681-07:00","updated_at":"2025-10-16T12:50:18.943172-07:00","closed_at":"2025-10-15T16:26:05.32001-07:00"} +{"id":"bd-319","title":"race_test_5","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.430908-07:00","updated_at":"2025-10-16T12:50:18.943317-07:00","closed_at":"2025-10-15T16:26:05.309177-07:00"} +{"id":"bd-32","title":"bd should auto-detect .beads/*.db in current directory","description":"When bd is run without --db flag, it defaults to beads' own database instead of looking for a .beads/*.db file in the current working directory. This causes confusion when working on other projects that use beads for issue tracking (like vc).\n\nExpected behavior: bd should search for .beads/*.db in cwd and use that if found, before falling back to default beads database.\n\nExample: Running 'bd ready' in /Users/stevey/src/vc/vc/ should automatically find and use .beads/vc.db without requiring --db flag every time.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-13T21:15:16.866255-07:00","updated_at":"2025-10-16T12:50:18.945301-07:00","closed_at":"2025-10-13T21:30:47.456341-07:00"} +{"id":"bd-320","title":"race_test_16","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.431212-07:00","updated_at":"2025-10-16T12:50:18.945968-07:00","closed_at":"2025-10-15T16:26:05.298238-07:00"} +{"id":"bd-321","title":"race_test_17","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.431475-07:00","updated_at":"2025-10-16T12:50:18.94615-07:00","closed_at":"2025-10-15T16:26:05.286761-07:00"} +{"id":"bd-322","title":"race_test_10","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.431704-07:00","updated_at":"2025-10-16T12:50:18.946812-07:00","closed_at":"2025-10-15T16:26:05.273032-07:00"} +{"id":"bd-323","title":"race_test_11","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.431947-07:00","updated_at":"2025-10-16T12:50:18.947581-07:00","closed_at":"2025-10-15T16:26:05.259986-07:00"} +{"id":"bd-324","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.","notes":"Awaiting user feedback - cannot reproduce locally, waiting for user to provide more details about environment and error message","status":"blocked","priority":1,"issue_type":"bug","created_at":"2025-10-16T11:57:33.433602-07:00","updated_at":"2025-10-16T12:50:18.947753-07:00","external_ref":"gh-3"} +{"id":"bd-325","title":"final_test_7","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.434103-07:00","updated_at":"2025-10-16T12:50:18.947898-07:00","closed_at":"2025-10-15T16:26:05.231737-07:00"} +{"id":"bd-326","title":"stress_test_5","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.434321-07:00","updated_at":"2025-10-16T12:50:18.948056-07:00","closed_at":"2025-10-15T16:26:05.220545-07:00"} +{"id":"bd-327","title":"parallel_test_3","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.434526-07:00","updated_at":"2025-10-16T12:50:18.949958-07:00","closed_at":"2025-10-15T16:26:05.451664-07:00"} +{"id":"bd-328","title":"parallel_test_10","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.434725-07:00","updated_at":"2025-10-16T12:50:18.950629-07:00","closed_at":"2025-10-15T16:26:05.46431-07:00"} +{"id":"bd-329","title":"parallel_test_2","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.434944-07:00","updated_at":"2025-10-16T12:50:18.950785-07:00","closed_at":"2025-10-15T16:26:05.345118-07:00"} +{"id":"bd-33","title":"Document or automate JSONL sync workflow for git collaboration","description":"When using beads across multiple machines/environments via git, there's a workflow gap:\n\n1. Machine A: Create issues → stored in .beads/project.db\n2. Machine A: bd export -o .beads/issues.jsonl\n3. Machine A: git add .beads/issues.jsonl \u0026\u0026 git commit \u0026\u0026 git push\n4. Machine B: git pull\n5. Machine B: ??? issues.jsonl exists but project.db is empty/stale\n\nThe missing step is: bd import --db .beads/project.db -i .beads/issues.jsonl\n\nThis needs to be either:\na) Documented clearly in workflow docs\nb) Automated (e.g., git hook, or bd auto-imports if jsonl is newer than db)\nc) Both\n\nReal-world impact: User had Claude Code on GCP VM create vc issues from BOOTSTRAP.md. They were exported to issues.jsonl and committed. But on local machine, vc.db was empty until manual import was run.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-13T21:15:30.271236-07:00","updated_at":"2025-10-16T12:50:18.950956-07:00","closed_at":"2025-10-13T22:47:51.587822-07:00"} +{"id":"bd-330","title":"parallel_test_5","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.435158-07:00","updated_at":"2025-10-16T12:50:18.951105-07:00","closed_at":"2025-10-15T16:26:05.358813-07:00"} +{"id":"bd-331","title":"stress_test_1","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.435529-07:00","updated_at":"2025-10-16T12:50:18.954328-07:00","closed_at":"2025-10-15T16:26:05.190223-07:00"} +{"id":"bd-332","title":"parallel_test_6","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.435801-07:00","updated_at":"2025-10-16T12:50:18.96533-07:00","closed_at":"2025-10-15T16:26:05.375985-07:00"} +{"id":"bd-333","title":"parallel_test_7","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.436019-07:00","updated_at":"2025-10-16T12:50:18.965533-07:00","closed_at":"2025-10-15T16:26:05.391941-07:00"} +{"id":"bd-334","title":"parallel_test_4","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.438273-07:00","updated_at":"2025-10-16T12:50:18.965707-07:00","closed_at":"2025-10-15T16:26:05.404261-07:00"} +{"id":"bd-335","title":"parallel_test_1","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T11:57:33.438508-07:00","updated_at":"2025-10-16T12:50:18.965847-07:00","closed_at":"2025-10-15T16:26:05.415413-07:00"} +{"id":"bd-336","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":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:57:33.438712-07:00","updated_at":"2025-10-16T12:50:18.967673-07:00","closed_at":"2025-10-15T17:14:14.451905-07:00"} +{"id":"bd-337","title":"Add performance benchmarks document","description":"Document actual performance metrics with hyperfine tests","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-16T11:57:33.43892-07:00","updated_at":"2025-10-16T12:50:18.968347-07:00","closed_at":"2025-10-15T20:59:04.025996-07:00","dependencies":[{"issue_id":"bd-337","depends_on_id":"bd-341","type":"parent-child","created_at":"2025-10-16T11:57:33.61498-07:00","created_by":"import-remap"}]} +{"id":"bd-338","title":"Add migration scripts for GitHub Issues","description":"Create scripts to import from GitHub Issues API or exported JSON","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-16T11:57:33.439174-07:00","updated_at":"2025-10-16T12:50:18.968497-07:00","closed_at":"2025-10-15T21:00:51.057232-07:00","dependencies":[{"issue_id":"bd-338","depends_on_id":"bd-341","type":"parent-child","created_at":"2025-10-16T11:57:33.608413-07:00","created_by":"import-remap"}]} +{"id":"bd-339","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","notes":"## Profiling Results (2025-10-15)\n\nCreated comprehensive profiling tests in cmd/bd/import_profile_test.go.\n\n### Key Findings\n\nImport performance is actually **very good** for the core phases:\n- 1000 issues: 883ms total (1,132 issues/sec)\n- 208 issues collision detection: 3.2ms (64,915 issues/sec)\n\n### Bottleneck Identified\n\n**Create/Update phase takes 95-98% of total time:**\n- 100 issues: 58ms (87.4%)\n- 500 issues: 214ms (95.8%) \n- 1000 issues: 866ms (98.1%)\n\nThis phase does N*2 individual queries (GetIssue + CreateIssue/UpdateIssue) with no transaction batching.\n\n### Next Steps\n\n1. Profile dependency import phase (not yet measured)\n2. Check for auto-flush lock contention\n3. Investigate WAL checkpoint blocking\n4. Consider transaction batching for bulk imports\n\n### Test Command\n\n```bash\ngo test -v -run TestImportPerformance ./cmd/bd/\n```\n\nSee test file for detailed instrumentation.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-16T11:57:33.439382-07:00","updated_at":"2025-10-16T12:50:18.968672-07:00","closed_at":"2025-10-15T02:49:22.700881-07:00"} +{"id":"bd-34","title":"Implement reserved database name _.db","description":"Auto-detection now skips .beads/_.db to prevent pollution when beads dogfoods itself. This allows beads to use its own issue tracker without interfering with other projects using beads in the same directory tree. Implementation includes filtering in findDatabase(), stopping directory walk when .beads/ is found, and documentation in README.md and CLAUDE.md.","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-13T21:46:15.189582-07:00","updated_at":"2025-10-16T12:50:18.969228-07:00","closed_at":"2025-10-13T21:54:26.388271-07:00"} +{"id":"bd-340","title":"Low priority chore","description":"","status":"closed","priority":4,"issue_type":"chore","created_at":"2025-10-16T11:57:33.439623-07:00","updated_at":"2025-10-16T12:50:18.973099-07:00","closed_at":"2025-10-15T20:58:30.418891-07:00","dependencies":[{"issue_id":"bd-340","depends_on_id":"bd-341","type":"parent-child","created_at":"2025-10-16T11:57:33.614623-07:00","created_by":"import-remap"}]} +{"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:50:18.978236-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:50:18.987477-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:50:18.987892-07:00","closed_at":"2025-10-15T02:52:17.500349-07:00","external_ref":"gh-6"} +{"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:50:18.98819-07:00","closed_at":"2025-10-13T22:22:38.359968-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:50:18.988362-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:50:18.98851-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:50:18.992112-07:00","closed_at":"2025-10-13T23:22:47.805211-07:00"} +{"id":"bd-39","title":"Optimize auto-flush to use incremental updates","description":"Every flush exports ALL issues and ALL dependencies, even if only one issue changed. For large projects (1000+ issues), this could be expensive. Current approach guarantees consistency, which is fine for MVP, but future optimization could track which issues changed and use incremental updates. Located in cmd/bd/main.go:255-276.","status":"closed","priority":3,"issue_type":"feature","created_at":"2025-10-13T22:34:59.26425-07:00","updated_at":"2025-10-16T12:50:18.992951-07:00","closed_at":"2025-10-14T00:08:51.834812-07:00"} +{"id":"bd-4","title":"Low priority chore","description":"","status":"open","priority":4,"issue_type":"chore","created_at":"2025-10-12T10:50:49.500051-07:00","updated_at":"2025-10-16T12:50:18.993159-07:00","dependencies":[{"issue_id":"bd-4","depends_on_id":"bd-8","type":"parent-child","created_at":"2025-10-16T11:57:33.880323-07:00","created_by":"import"}]} +{"id":"bd-40","title":"Make auto-flush debounce duration configurable","description":"flushDebounce is hardcoded to 5 seconds. Make it configurable via environment variable BEADS_FLUSH_DEBOUNCE (e.g., '500ms', '10s'). Current 5-second value is reasonable for interactive use, but CI/automated scenarios might want faster flush. Add getDebounceDuration() helper function. Located in cmd/bd/main.go:31.","status":"open","priority":3,"issue_type":"feature","created_at":"2025-10-13T22:35:06.126282-07:00","updated_at":"2025-10-16T12:50:18.993304-07:00"} +{"id":"bd-41","title":"Add godoc comments for auto-flush functions","description":"Add comprehensive godoc comments for findJSONLPath(), markDirtyAndScheduleFlush(), and flushToJSONL() explaining behavior, concurrency considerations, and error handling. Include notes about debouncing behavior (timer resets on each write, flush occurs 5s after LAST operation) and flush-on-exit guarantees. Located in cmd/bd/main.go:188-307.","status":"open","priority":4,"issue_type":"chore","created_at":"2025-10-13T22:35:13.518442-07:00","updated_at":"2025-10-16T12:50:18.993446-07:00"} +{"id":"bd-42","title":"Add test coverage for auto-flush feature","description":"Add comprehensive tests for auto-flush functionality:\\n- Test that markDirtyAndScheduleFlush() is called after CRUD operations\\n- Test debounce timing (rapid operations result in single flush)\\n- Test --no-auto-flush flag disables feature\\n- Test flush on program exit\\n- Test concurrent operations don't cause races\\n- Test error scenarios (disk full, permission denied, etc.)\\n- Test import command triggers auto-flush\\n\\nCurrent implementation has no test coverage for the auto-flush feature. Located in cmd/bd/main_test.go (to be created).","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-13T22:35:22.079794-07:00","updated_at":"2025-10-16T12:50:18.995238-07:00","closed_at":"2025-10-13T23:36:28.90411-07:00"} +{"id":"bd-43","title":"Test auto-sync feature","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-13T22:47:41.738165-07:00","updated_at":"2025-10-16T12:50:19.003145-07:00","closed_at":"2025-10-13T22:48:02.844213-07:00"} +{"id":"bd-44","title":"Regular auto-ID issue","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-13T23:16:29.970089-07:00","updated_at":"2025-10-16T12:50:19.005425-07:00","closed_at":"2025-10-13T23:16:45.231439-07:00"} +{"id":"bd-45","title":"Test flush tracking","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-13T23:22:18.472476-07:00","updated_at":"2025-10-16T12:50:19.005583-07:00","closed_at":"2025-10-13T23:22:31.397095-07:00"} +{"id":"bd-46","title":"Test export cancels timer","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-13T23:26:20.523923-07:00","updated_at":"2025-10-16T12:50:19.013159-07:00","closed_at":"2025-10-13T23:26:35.813165-07:00"} +{"id":"bd-47","title":"Test incremental export","description":"Testing bd-39 implementation","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T00:06:24.42044-07:00","updated_at":"2025-10-16T12:50:19.014957-07:00","closed_at":"2025-10-14T00:14:45.968261-07:00"} +{"id":"bd-48","title":"Test incremental 2","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T00:07:14.157987-07:00","updated_at":"2025-10-16T12:50:19.041798-07:00","closed_at":"2025-10-14T00:14:45.968593-07:00"} +{"id":"bd-49","title":"Final test","description":"Testing with new binary","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:07:46.650341-07:00","updated_at":"2025-10-16T12:50:19.04807-07:00","closed_at":"2025-10-14T00:14:45.968699-07:00"} +{"id":"bd-5","title":"Test issue","description":"Testing prefix","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-12T10:50:50.942964-07:00","updated_at":"2025-10-16T12:50:19.062215-07:00","closed_at":"2025-10-13T23:20:41.816853-07:00","dependencies":[{"issue_id":"bd-5","depends_on_id":"bd-341","type":"parent-child","created_at":"2025-10-16T11:57:33.662677-07:00","created_by":"import-remap"},{"issue_id":"bd-5","depends_on_id":"bd-8","type":"parent-child","created_at":"2025-10-16T11:57:33.88059-07:00","created_by":"import"}]} +{"id":"bd-50","title":"Test label dirty tracking","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T00:14:25.484565-07:00","updated_at":"2025-10-16T12:50:19.065831-07:00","closed_at":"2025-10-14T00:14:45.968771-07:00"} +{"id":"bd-51","title":"Test hash-based import","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T00:16:00.850055-07:00","updated_at":"2025-10-16T12:50:19.06624-07:00","closed_at":"2025-10-14T00:19:19.355078-07:00"} +{"id":"bd-52","title":"Create Claude Code plugin for beads","description":"Package beads as a Claude Code plugin for easy installation via /plugin command.\n\nContext: GitHub issue #28 - https://github.com/steveyegge/beads/issues/28\n\nCurrent state:\n- MCP server exists in integrations/beads-mcp/\n- No plugin packaging yet\n\nDeliverables:\n1. .claude-plugin/plugin.json with metadata\n2. .claude-plugin/marketplace.json for distribution\n3. Custom slash commands (/bd-ready, /bd-create, /bd-show, etc.)\n4. Bundle MCP server configuration\n5. Optional: Pre-configured hooks for auto-sync\n6. Documentation for installation and usage\n\nBenefits:\n- Makes beads instantly discoverable in Claude Code ecosystem\n- Single-command installation vs. manual setup\n- Bundled cohesive experience\n- Lowers adoption barrier significantly\n\nReferences:\n- https://www.anthropic.com/news/claude-code-plugins\n- https://docs.claude.com/en/docs/claude-code/plugins","status":"closed","priority":1,"issue_type":"feature","created_at":"2025-10-14T00:21:46.229671-07:00","updated_at":"2025-10-16T12:50:19.066416-07:00","closed_at":"2025-10-14T00:29:31.174835-07:00"} +{"id":"bd-53","title":"Research Claude Code plugin structure and requirements","description":"Study the plugin format, required files, and best practices.\n\nTasks:\n- Review official plugin documentation\n- Examine example plugins if available\n- Document plugin.json schema\n- Understand marketplace.json requirements\n- Identify slash command format","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:21:47.327014-07:00","updated_at":"2025-10-16T12:50:19.066571-07:00","closed_at":"2025-10-14T00:29:31.179483-07:00","dependencies":[{"issue_id":"bd-53","depends_on_id":"bd-52","type":"parent-child","created_at":"2025-10-14T17:11:11.537724-07:00","created_by":"auto-import"}]} +{"id":"bd-54","title":"Create plugin metadata files","description":"Create .claude-plugin/plugin.json and marketplace.json.\n\nRequirements:\n- Name, description, version, author\n- MCP server configuration bundling\n- License and repository info\n- Installation instructions","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:21:48.404838-07:00","updated_at":"2025-10-16T12:50:19.066732-07:00","closed_at":"2025-10-14T00:32:51.521595-07:00","dependencies":[{"issue_id":"bd-54","depends_on_id":"bd-52","type":"parent-child","created_at":"2025-10-14T17:11:11.537903-07:00","created_by":"auto-import"}]} +{"id":"bd-55","title":"Design and implement slash commands","description":"Create useful slash commands for beads workflow.\n\nProposed commands:\n- /bd-ready - Show ready work\n- /bd-create - Create new issue interactively\n- /bd-show - Show issue details\n- /bd-update - Update issue status\n- /bd-close - Close issue\n- /bd-workflow - Show full agent workflow guide\n\nEach command should provide a good UX and leverage the MCP server tools.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:22:04.773185-07:00","updated_at":"2025-10-16T12:50:19.066877-07:00","closed_at":"2025-10-16T11:01:27.027801-07:00","dependencies":[{"issue_id":"bd-55","depends_on_id":"bd-52","type":"parent-child","created_at":"2025-10-14T17:11:11.538059-07:00","created_by":"auto-import"}]} +{"id":"bd-56","title":"Write plugin documentation","description":"Create comprehensive documentation for the plugin.\n\nContents:\n- Installation instructions\n- Available commands\n- MCP tools reference\n- Configuration options\n- Examples and workflows\n- Troubleshooting guide","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:22:05.619682-07:00","updated_at":"2025-10-16T12:50:19.067026-07:00","closed_at":"2025-10-14T00:35:43.188168-07:00","dependencies":[{"issue_id":"bd-56","depends_on_id":"bd-52","type":"parent-child","created_at":"2025-10-14T17:11:11.538197-07:00","created_by":"auto-import"}]} +{"id":"bd-57","title":"Test plugin installation and functionality","description":"Verify the plugin works end-to-end.\n\nTest cases:\n- Fresh installation via /plugin command\n- All slash commands work correctly\n- MCP server tools are accessible\n- Configuration options work\n- Documentation is accurate\n- Works in both terminal and VS Code","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:22:06.46476-07:00","updated_at":"2025-10-16T12:50:19.06718-07:00","closed_at":"2025-10-16T11:01:27.02947-07:00","dependencies":[{"issue_id":"bd-57","depends_on_id":"bd-52","type":"parent-child","created_at":"2025-10-14T17:11:11.538331-07:00","created_by":"auto-import"}]} +{"id":"bd-58","title":"Parent's blocker should block children in ready work calculation","description":"GitHub issue #19: If epic1 blocks epic2, children of epic2 should also be considered blocked when calculating ready work. Currently epic2's children show as ready even though their parent is blocked. This breaks the natural hierarchy of dependencies and can cause agents to work on tasks out of order.\n\nExpected: ready work calculation should traverse up parent-child hierarchy and check if any ancestor has blocking dependencies.\n\nSee: https://github.com/anthropics/claude-code/issues/19","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-14T00:22:07.567867-07:00","updated_at":"2025-10-16T12:50:19.067385-07:00","closed_at":"2025-10-16T11:01:27.030171-07:00"} +{"id":"bd-59","title":"Add composite index on dependencies(depends_on_id, type)","description":"The hierarchical blocking query does:\nJOIN dependencies d ON d.depends_on_id = bt.issue_id\nWHERE d.type = 'parent-child'\n\nCurrently we only have idx_dependencies_depends_on (line 41 in schema.go), which covers depends_on_id but not the type filter.\n\n**Impact:**\n- Query has to scan ALL dependencies for a given depends_on_id, then filter by type\n- With 10k+ issues and many dependencies, this could cause slowdowns\n- The blocker propagation happens recursively, amplifying the cost\n\n**Solution:**\nAdd composite index: CREATE INDEX idx_dependencies_depends_on_type ON dependencies(depends_on_id, type)\n\n**Testing:**\nRun EXPLAIN QUERY PLAN on GetReadyWork query before/after to verify index usage.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T00:22:08.949261-07:00","updated_at":"2025-10-16T12:50:19.067539-07:00","closed_at":"2025-10-16T11:01:27.03157-07:00"} +{"id":"bd-6","title":"Add migration scripts for GitHub Issues","description":"Create scripts to import from GitHub Issues API or exported JSON","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-12T10:50:52.140018-07:00","updated_at":"2025-10-16T12:50:19.067694-07:00","dependencies":[{"issue_id":"bd-6","depends_on_id":"bd-8","type":"parent-child","created_at":"2025-10-16T11:57:33.880917-07:00","created_by":"import"}]} +{"id":"bd-60","title":"Update ready_issues VIEW to use hierarchical blocking","description":"The ready_issues VIEW (schema.go:97-108) uses the OLD blocking logic that doesn't propagate through parent-child hierarchies.\n\n**Problem:**\n- GetReadyWork() function now uses recursive CTE with propagation\n- But the ready_issues VIEW still uses simple NOT EXISTS check\n- Any code using the VIEW will get DIFFERENT results than GetReadyWork()\n- This creates inconsistency and confusion\n\n**Impact:**\n- Unknown if the VIEW is actually used anywhere in the codebase\n- If it is used, it's returning incorrect results (showing children as ready when parent is blocked)\n\n**Solution:**\nEither:\n1. Update VIEW to match GetReadyWork logic (complex CTE in a view)\n2. Drop the VIEW entirely if unused\n3. Make VIEW call GetReadyWork as a function (if SQLite supports it)\n\n**Investigation needed:**\nGrep for 'ready_issues' to see if the view is actually used.","notes":"**Investigation results:**\nGrepped the codebase - the ready_issues VIEW appears in:\n- schema.go (definition)\n- WORKFLOW.md, DESIGN.md (documentation)\n- No actual Go code queries it directly\n\n**Conclusion:** The VIEW is defined but appears UNUSED by actual code. GetReadyWork() function is used instead.\n\n**Recommended solution:** Drop the VIEW entirely to avoid confusion. It serves no purpose if unused and creates a maintenance burden (needs to stay in sync with GetReadyWork logic).\n\n**Alternative:** If we want to keep it for direct SQL access, update the VIEW definition to match the new recursive CTE logic.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-14T00:22:19.075914-07:00","updated_at":"2025-10-16T12:50:19.067866-07:00","closed_at":"2025-10-16T11:01:27.032845-07:00"} +{"id":"bd-61","title":"Add test for deep hierarchy blocking (50+ levels)","description":"Current tests verify 2-level depth (grandparent → parent → child). The depth limit is hardcoded to 50 in the recursive CTE, but we don't test edge cases near that limit.\n\n**Test cases needed:**\n1. Verify 50-level deep hierarchy works correctly\n2. Verify depth limit prevents runaway recursion\n3. Measure performance impact of deep hierarchies\n4. Consider if 50 is the right limit (why not 100? why not 20?)\n\n**Rationale:**\n- Most hierarchies are 2-5 levels deep\n- But pathological cases (malicious or accidental) could create 50+ level nesting\n- Need to ensure graceful degradation, not catastrophic failure\n\n**Implementation:**\nAdd TestDeepHierarchyBlocking to ready_test.go","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T00:22:20.33128-07:00","updated_at":"2025-10-16T12:50:19.068053-07:00","closed_at":"2025-10-16T11:01:27.0337-07:00"} +{"id":"bd-62","title":"Document hierarchical blocking behavior in README","description":"The fix for bd-58 changes user-visible behavior: children of blocked epics are now automatically blocked.\n\n**What needs documenting:**\n1. README.md dependency section should explain blocking propagation\n2. Clarify that 'blocks' + 'parent-child' together create transitive blocking\n3. Note that 'related' and 'discovered-from' do NOT propagate blocking\n4. Add example showing epic → child blocking propagation\n\n**Example to add:**\n```bash\n# If epic is blocked, children are too\nbd create \"Epic 1\" -t epic -p 1\nbd create \"Task 1\" -t task -p 1\nbd dep add task-1 epic-1 --type parent-child\n\n# Block the epic\nbd create \"Blocker\" -t task -p 0\nbd dep add epic-1 blocker-1 --type blocks\n\n# Now both epic-1 AND task-1 are blocked\nbd ready # Neither will show up\n```","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T01:14:45.357198-07:00","updated_at":"2025-10-16T12:50:19.06822-07:00","closed_at":"2025-10-14T01:20:31.049608-07:00"} +{"id":"bd-63","title":"Add EXPLAIN QUERY PLAN tests for ready work query","description":"Verify that the hierarchical blocking query uses proper indexes and doesn't do full table scans.\n\n**Queries to analyze:**\n1. The recursive CTE (both base case and recursive case)\n2. The final SELECT with NOT EXISTS\n3. Impact of various filters (status, priority, assignee)\n\n**Implementation:**\nAdd test function that:\n- Runs EXPLAIN QUERY PLAN on GetReadyWork query\n- Parses output to verify no SCAN TABLE operations\n- Documents expected query plan in comments\n- Fails if query plan degrades\n\n**Benefits:**\n- Catch performance regressions in tests\n- Document expected query behavior\n- Ensure indexes are being used\n\nRelated to: bd-59 (composite index on depends_on_id, type)","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:19:37.745731-07:00","updated_at":"2025-10-16T12:50:19.068383-07:00"} +{"id":"bd-64","title":"Verify and test Claude Code plugin","description":"Address remaining items from code review:\n\nCritical:\n1. Test plugin installation locally with /plugin marketplace add\n2. Verify ${CLAUDE_PLUGIN_ROOT} variable works correctly\n3. Test each slash command works\n4. Test @task-agent execution\n5. Verify MCP server connects properly\n\nDocumentation:\n1. Clarify 'one-command installation' vs prerequisites\n2. Add note about plugin development status\n3. Verify all paths and examples work\n\nNice-to-have:\n1. Add icon for marketplace (optional)\n2. Add categories field to plugin.json\n3. Add engines field for version compatibility","notes":"PLUGIN IMPLEMENTATION COMPLETE - READY FOR TESTING\n\nWhat was built:\n✅ .claude-plugin/plugin.json - Plugin metadata with MCP server config\n✅ .claude-plugin/marketplace.json - Marketplace configuration\n✅ 9 slash commands in .claude-plugin/commands/:\n - bd-ready, bd-create, bd-show, bd-update, bd-close\n - bd-workflow, bd-init, bd-stats, bd-version\n✅ Task agent in .claude-plugin/agents/task-agent.md\n✅ PLUGIN.md - Comprehensive documentation\n✅ README.md - Updated with plugin section\n✅ Version sync - All components at 0.9.2\n\nTesting Instructions for Next Agent:\n=====================================\n\n1. INSTALL PLUGIN FROM GITHUB:\n /plugin marketplace add steveyegge/beads\n /plugin install beads\n \n2. RESTART CLAUDE CODE (required for MCP server)\n\n3. TEST SLASH COMMANDS:\n /bd-version # Check versions (should show 0.9.2)\n /bd-workflow # Show workflow guide\n /bd-stats # Show project stats\n /bd-ready # Find ready work\n /bd-create \"Test plugin\" task 2\n /bd-show bd-\u003cid\u003e\n \n4. TEST MCP SERVER:\n /mcp # Verify 'beads' server appears\n \n5. TEST TASK AGENT:\n @task-agent # If supported in Claude Code\n \n6. VERIFY:\n - All commands work without errors\n - MCP tools are accessible\n - Version checking works\n - Documentation is accurate\n\nExpected Issues:\n- May need to adjust MCP server path variable (${CLAUDE_PLUGIN_ROOT})\n- Task agent syntax might differ\n- Some commands may need refinement based on actual usage\n\nIf testing fails, check:\n- bd CLI is in PATH: which bd\n- uv is installed: which uv\n- MCP server logs in Claude Code\n- PLUGIN.md troubleshooting section\n\nCommit references:\n- 9f38375: feat: Add Claude Code plugin for beads\n- d25fc53: feat: Add version compatibility checking\n- c0f1044: fix: Sync all component versions to 0.9.2\n- a5c71f0: feat: Add version bump script\n- a612b92: docs: Add version management to CLAUDE.md","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T01:23:23.041743-07:00","updated_at":"2025-10-16T12:50:19.072012-07:00","closed_at":"2025-10-15T01:08:12.811809-07:00","dependencies":[{"issue_id":"bd-64","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.634172-07:00","created_by":"import-remap"},{"issue_id":"bd-64","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.881158-07:00","created_by":"import"}]} +{"id":"bd-65","title":"Document versioning and release strategy","description":"Create comprehensive versioning strategy for beads ecosystem.\n\nComponents to document:\n1. bd CLI (Go binary) - main version number\n2. Plugin (Claude Code) - tracks CLI version\n3. MCP server (Python) - bundled with plugin\n4. Release workflow - how to sync all three\n\nDecisions to make:\n- Should plugin.json auto-update from bd CLI version?\n- Should we have a VERSION file at repo root?\n- How to handle breaking changes across components?\n- What's the update notification strategy?\n\nReferences:\n- plugin.json engines field now requires bd \u003e=0.9.0\n- /bd-version command added for checking compatibility\n- PLUGIN.md now documents update workflow","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T01:23:32.02232-07:00","updated_at":"2025-10-16T12:50:19.07314-07:00","closed_at":"2025-10-14T01:32:38.263621-07:00","dependencies":[{"issue_id":"bd-65","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.611729-07:00","created_by":"import-remap"},{"issue_id":"bd-65","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.88143-07:00","created_by":"import"}]} +{"id":"bd-66","title":"Sync versions to 0.9.2 across all components","description":"Version mismatch discovered: bd CLI is 0.9.2 but other components still at 0.9.0 or 1.0.0.\n\nCurrent state:\n- bd CLI (cmd/bd/version.go): 0.9.2 ✓\n- Plugin (.claude-plugin/plugin.json): 0.9.0 ✗\n- MCP Server (integrations/beads-mcp): 1.0.0 ✗\n- README.md: 0.9.0 ✗\n\nFiles to update:\n1. .claude-plugin/plugin.json\n2. integrations/beads-mcp/pyproject.toml\n3. README.md (all mentions)\n4. PLUGIN.md (if any mentions)\n5. CHANGELOG.md (add 0.9.1 and 0.9.2 entries)\n\nRoot cause: Version bumps only updated version.go, not other components.\nSolution needed: Script or process to sync versions across all files.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-14T01:23:40.61527-07:00","updated_at":"2025-10-16T12:50:19.074231-07:00","closed_at":"2025-10-14T01:33:10.337387-07:00","dependencies":[{"issue_id":"bd-66","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.615657-07:00","created_by":"import-remap"},{"issue_id":"bd-66","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.881672-07:00","created_by":"import"}]} +{"id":"bd-67","title":"Create version bump script","description":"Create scripts/bump-version.sh to automate version syncing across all components.\n\nThe script should:\n1. Take a version number as argument (e.g., ./scripts/bump-version.sh 0.9.3)\n2. Update all version files:\n - cmd/bd/version.go (Version constant)\n - .claude-plugin/plugin.json (version field)\n - .claude-plugin/marketplace.json (plugins[].version)\n - integrations/beads-mcp/pyproject.toml (version field)\n - README.md (Alpha version mention)\n - PLUGIN.md (version requirements)\n3. Validate semantic versioning format\n4. Show diff preview before applying\n5. Optionally create git commit with standard message\n\nThis prevents the version mismatch issue that occurred when only version.go was updated.\n\nRelated: bd-66 (version sync issue)","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-14T01:23:48.488537-07:00","updated_at":"2025-10-16T12:50:19.083707-07:00","closed_at":"2025-10-14T01:33:52.447248-07:00","dependencies":[{"issue_id":"bd-67","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.666641-07:00","created_by":"import-remap"},{"issue_id":"bd-67","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.88189-07:00","created_by":"import"}]} +{"id":"bd-68","title":"Add system-wide/multi-repo support for beads","description":"GitHub issue #4 requests ability to use beads across multiple projects and for system-wide task tracking.\n\nCurrent limitation: beads is per-repository isolated. Each project has its own .beads/ directory and issues cannot reference issues in other projects.\n\nPotential approaches:\n1. Global beads instance in ~/.beads/global.db for cross-project work\n2. Project references - allow issues to link across repos\n3. Multi-project workspace support - one beads instance managing multiple repos\n4. Integration with existing MCP server to provide remote multi-project access\n\nUse cases:\n- System administrators tracking work across multiple machines/repos\n- Developers working on a dozen+ projects simultaneously\n- Cross-cutting concerns that span multiple repositories\n- Global todo list with project-specific subtasks\n\nRelated:\n- GitHub issue #4: https://github.com/steveyegge/beads/issues/4\n- Comparison to membank MCP which already supports multi-project via centralized server\n- MCP server at integrations/beads-mcp/ could be extended for this\n\nSee also: Testing framework for plugins (also from GH #4)","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-14T01:23:57.134825-07:00","updated_at":"2025-10-16T12:50:19.084197-07:00","dependencies":[{"issue_id":"bd-68","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.616067-07:00","created_by":"import-remap"},{"issue_id":"bd-68","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.883157-07:00","created_by":"import"}]} +{"id":"bd-69","title":"Add coverage threshold to CI pipeline","description":"Current CI runs tests with coverage but doesn't enforce minimum threshold. Add step to fail if coverage drops below target.\n\nCurrent coverage: 60%\nRecommended thresholds:\n- Warn: 55%\n- Fail: 50%\n\nThis prevents coverage regression while allowing gradual improvement toward 80% target for 1.0.\n\nImplementation:\n1. Add coverage check step after test run\n2. Use 'go tool cover -func=coverage.out' to get total\n3. Parse percentage and compare to threshold\n4. Optionally: Use codecov's built-in threshold features\n\nRelated to test coverage improvement work (upcoming issue).","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T01:24:06.079067-07:00","updated_at":"2025-10-16T12:50:19.084578-07:00","closed_at":"2025-10-16T11:01:27.036654-07:00","dependencies":[{"issue_id":"bd-69","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.61096-07:00","created_by":"import-remap"},{"issue_id":"bd-69","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.883553-07:00","created_by":"import"}]} +{"id":"bd-7","title":"Add performance benchmarks document","description":"Document actual performance metrics with hyperfine tests","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-12T10:50:53.294516-07:00","updated_at":"2025-10-16T12:50:19.084733-07:00","dependencies":[{"issue_id":"bd-7","depends_on_id":"bd-8","type":"parent-child","created_at":"2025-10-16T11:57:33.884234-07:00","created_by":"import"}]} +{"id":"bd-70","title":"Increase test coverage for auto-flush and auto-import features","description":"Critical features have 0% test coverage despite being core workflow functionality.\n\n**Uncovered areas (0% coverage):**\n\nAuto-flush/Auto-import (dirty tracking):\n- MarkIssueDirty / MarkIssuesDirty\n- GetDirtyIssues / GetDirtyIssueCount\n- ClearDirtyIssues / ClearDirtyIssuesByID\n- Auto-flush debouncing logic\n- Auto-import hash comparison\n\nDatabase/file discovery:\n- FindDatabasePath (finds .beads/*.db in directory tree)\n- FindJSONLPath (finds issues.jsonl)\n- findDatabaseInTree helper\n\nLabel operations:\n- AddLabel / RemoveLabel\n- GetLabels / GetIssuesByLabel\n\nEvents/Comments:\n- AddComment\n- GetEvents\n- GetStatistics\n\nMetadata storage:\n- SetMetadata / GetMetadata (used for import hash tracking)\n\nCLI output formatting:\n- outputJSON\n- printCollisionReport / printRemappingReport\n- createIssuesFromMarkdown\n\n**Priority areas:**\n1. Auto-flush/import (highest risk - core workflow)\n2. Database discovery (second - affects all operations)\n3. Labels/events (lower priority - less commonly used)\n\n**Test approach:**\n- Add unit tests for dirty tracking in sqlite package\n- Add integration tests for auto-flush timing and debouncing\n- Add tests for import hash detection and idempotency\n- Add tests for database discovery edge cases (permissions, nested dirs)\n\n**Target:** Get overall coverage from 60% → 75%, focus on cmd/bd (currently 24.1%)\n\n**Note:** These features work well in practice (dogfooding proves it) but edge cases (disk full, permissions, concurrent access, race conditions) are untested.","notes":"Test coverage significantly improved! Added comprehensive test suites:\n\n**Tests Added:**\n1. ✅ Dirty tracking (dirty_test.go): 8 tests\n - MarkIssueDirty, MarkIssuesDirty, GetDirtyIssues, ClearDirtyIssues\n - GetDirtyIssueCount, ClearDirtyIssuesByID\n - Ordering and timestamp update tests\n - Coverage: 75-100% for all functions\n\n2. ✅ Metadata storage (sqlite_test.go): 4 tests\n - SetMetadata, GetMetadata with various scenarios\n - Coverage: 100%\n\n3. ✅ Label operations (labels_test.go): 9 tests\n - AddLabel, RemoveLabel, GetLabels, GetIssuesByLabel\n - Duplicate handling, empty cases, dirty marking\n - Coverage: 71-82%\n\n4. ✅ Events \u0026 Comments (events_test.go): 7 tests\n - AddComment, GetEvents with limits\n - Timestamp updates, dirty marking\n - Multiple event types in history\n - Coverage: 73-92%\n\n5. ✅ Database/JSONL discovery (beads_test.go): 8 tests\n - FindDatabasePath with env var, tree search, home default\n - FindJSONLPath with existing files, defaults, multiple files\n - Coverage: 89-100%\n\n**Coverage Results:**\n- Overall: 70.3% (up from ~60%)\n- beads package: 90.6%\n- sqlite package: 74.7% (up from 60.8%)\n- types package: 100%\n\n**Impact:**\nAll priority 1 features now have solid test coverage. Auto-flush/import, metadata storage, labels, and events are thoroughly tested with edge cases covered.\n\nFiles created:\n- internal/storage/sqlite/dirty_test.go (8 tests)\n- internal/storage/sqlite/labels_test.go (9 tests)\n- internal/storage/sqlite/events_test.go (7 tests)\n- beads_test.go (8 tests)\n\nFiles modified:\n- internal/storage/sqlite/sqlite_test.go (added 4 metadata tests)\n\n**Next Steps (if desired):**\n- CLI output formatting tests (outputJSON, printCollisionReport, etc.)\n- Integration tests for auto-flush debouncing timing\n- More edge cases for concurrent access","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T01:24:15.473927-07:00","updated_at":"2025-10-16T12:50:19.086063-07:00","closed_at":"2025-10-15T01:16:00.571791-07:00","dependencies":[{"issue_id":"bd-70","depends_on_id":"bd-342","type":"parent-child","created_at":"2025-10-16T11:57:33.608898-07:00","created_by":"import-remap"},{"issue_id":"bd-70","depends_on_id":"bd-71","type":"parent-child","created_at":"2025-10-16T11:57:33.884452-07:00","created_by":"import"}]} +{"id":"bd-71","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":"Status update: All P0-P1 critical tasks completed! bd-64 (performance), bd-65 (migration), bd-66 (fatal error), bd-67 (comments) are all done. Atomic counter implementation is now production-ready. Remaining tasks are P2-P3 enhancements.","status":"open","priority":1,"issue_type":"epic","created_at":"2025-10-14T01:24:27.716237-07:00","updated_at":"2025-10-16T12:50:19.086264-07:00"} +{"id":"bd-72","title":"Test performance - issue 1","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T01:27:53.520056-07:00","updated_at":"2025-10-16T12:50:19.086432-07:00"} +{"id":"bd-73","title":"Performance test 1","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.931707-07:00","updated_at":"2025-10-16T12:50:19.086587-07:00"} +{"id":"bd-74","title":"Performance test 2","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.936642-07:00","updated_at":"2025-10-16T12:50:19.088797-07:00"} +{"id":"bd-75","title":"Performance test 3","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.941591-07:00","updated_at":"2025-10-16T12:50:19.08986-07:00"} +{"id":"bd-76","title":"Performance test 4","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.946053-07:00","updated_at":"2025-10-16T12:50:19.093642-07:00"} +{"id":"bd-77","title":"Performance test 5","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.950618-07:00","updated_at":"2025-10-16T12:50:19.094945-07:00"} +{"id":"bd-78","title":"Performance test 6","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.955773-07:00","updated_at":"2025-10-16T12:50:19.10083-07:00"} +{"id":"bd-79","title":"Performance test 7","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.96021-07:00","updated_at":"2025-10-16T12:50:19.102314-07:00"} +{"id":"bd-8","title":"Reach 1.0 release milestone","description":"Stabilize API, finalize documentation, comprehensive testing","status":"open","priority":1,"issue_type":"epic","created_at":"2025-10-12T10:50:54.457348-07:00","updated_at":"2025-10-16T12:50:19.108211-07:00"} +{"id":"bd-80","title":"Performance test 8","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.964861-07:00","updated_at":"2025-10-16T12:50:19.110186-07:00"} +{"id":"bd-81","title":"Performance test 9","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.969882-07:00","updated_at":"2025-10-16T12:50:19.115058-07:00"} +{"id":"bd-82","title":"Performance test 10","description":"","status":"open","priority":3,"issue_type":"task","created_at":"2025-10-14T01:27:59.974738-07:00","updated_at":"2025-10-16T12:50:19.115718-07:00"} +{"id":"bd-83","title":"Add external_ref field for tracking GitHub issues","description":"Add optional external_ref field to issues table to track external references like 'gh-9', 'jira-ABC', etc. Includes schema migration, CLI flags (--external-ref for create/update), and tests. This enables linking bd issues to GitHub issues for better workflow integration.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-14T02:27:01.187087-07:00","updated_at":"2025-10-16T12:50:19.115916-07:00","closed_at":"2025-10-14T02:34:54.508385-07:00"} +{"id":"bd-84","title":"Auto-import fails in git workflows due to mtime issues","description":"The auto-import mechanism (autoImportIfNewer) relies on file modification time comparison between JSONL and DB. This breaks in git workflows because git does not preserve original file modification times - pulled files get fresh mtimes based on checkout time.\n\nRoot causes:\n1. Git checkout sets mtime to 'now', not original commit time\n2. Auto-import compares JSONL mtime vs DB mtime (line 181 in main.go)\n3. If DB was recently modified (agents working), mtime check fails\n4. Auto-import silently returns without feedback\n5. Agents continue with stale database state\n\nThis caused issues in VC project where 3 parallel agents:\n- Pulled updated .beads/issues.jsonl from git\n- Auto-import didn't trigger (JSONL appeared older than DB)\n- Agents couldn't find their assigned issues\n- Agents exported from wrong database, corrupting JSONL","design":"Recommended approach: Checksum-based sync (option 3 from original design)\n\n## Solution: Hash-based content comparison\n\nReplace mtime comparison with JSONL content hash comparison:\n\n1. **Compute JSONL hash on startup**:\n - SHA256 hash of .beads/issues.jsonl contents\n - Fast enough for typical repos (\u003c1MB = ~20ms)\n - Only computed once per command invocation\n\n2. **Store last import hash in DB**:\n - Add metadata table if not exists: CREATE TABLE IF NOT EXISTS metadata (key TEXT PRIMARY KEY, value TEXT)\n - Store hash after successful import: INSERT OR REPLACE INTO metadata (key, value) VALUES ('last_import_hash', '\u003chash\u003e')\n - Query on startup: SELECT value FROM metadata WHERE key = 'last_import_hash'\n\n3. **Compare hashes instead of mtimes**:\n - If JSONL hash != stored hash: auto-import (content changed)\n - If JSONL hash == stored hash: skip import (no changes)\n - If no stored hash: fall back to mtime comparison (backward compat)\n\n4. **Update autoImportIfNewer() in cmd/bd/main.go**:\n - Lines 155-279 currently use mtime comparison (line 181)\n - Replace with hash comparison\n - Keep mtime as fallback for old DBs without metadata table\n\n## Implementation Details\n\n### New storage interface method:\n```go\n// In internal/storage/storage.go\ntype Storage interface {\n // ... existing methods ...\n GetMetadata(ctx context.Context, key string) (string, error)\n SetMetadata(ctx context.Context, key, value string) error\n}\n```\n\n### Migration:\n```go\n// In internal/storage/sqlite/sqlite.go init\nCREATE TABLE IF NOT EXISTS metadata (\n key TEXT PRIMARY KEY,\n value TEXT NOT NULL\n);\n```\n\n### Updated autoImportIfNewer():\n```go\nfunc autoImportIfNewer() {\n jsonlPath := findJSONLPath()\n \n // Check if JSONL exists\n jsonlData, err := os.ReadFile(jsonlPath)\n if err != nil {\n return // No JSONL, skip\n }\n \n // Compute current hash\n hasher := sha256.New()\n hasher.Write(jsonlData)\n currentHash := hex.EncodeToString(hasher.Sum(nil))\n \n // Get last import hash from DB\n ctx := context.Background()\n lastHash, err := store.GetMetadata(ctx, \"last_import_hash\")\n if err != nil {\n // No metadata support (old DB) - fall back to mtime comparison\n autoImportIfNewerByMtime()\n return\n }\n \n // Compare hashes\n if currentHash == lastHash {\n return // No changes, skip import\n }\n \n // Content changed - import\n if err := importJSONLSilent(jsonlPath, jsonlData); err != nil {\n return // Import failed, skip\n }\n \n // Store new hash\n _ = store.SetMetadata(ctx, \"last_import_hash\", currentHash)\n}\n```\n\n## Benefits\n\n- **Git-proof**: Works regardless of file timestamps\n- **Universal**: Works with git, Dropbox, rsync, manual edits\n- **Backward compatible**: Falls back to mtime for old DBs\n- **Efficient**: SHA256 is fast (~20ms for 1MB)\n- **Accurate**: Only imports when content actually changed\n- **No user action**: Fully automatic, invisible\n\n## Performance Optimization\n\nFor very large repos (\u003e10MB JSONL):\n- Only hash if mtime changed (combine both checks)\n- Use incremental hashing if metadata table tracks line count\n- Consider sampling hash (first 1MB + last 1MB)\n\nBut start simple - full hash is fast enough for 99% of use cases.\n\n## Rollout Plan\n\n1. Add metadata table + Get/SetMetadata methods (backward compatible)\n2. Update autoImportIfNewer() with hash logic + mtime fallback\n3. Test with old and new DBs\n4. Ship in next minor version (v0.10.0)\n5. Document in CHANGELOG as \"more reliable auto-import\"\n6. Git hooks remain optional but unnecessary for most users","acceptance_criteria":"- Auto-import works correctly after git pull\n- Agents in parallel workflows see consistent database state\n- Clear feedback when import is needed\n- Performance acceptable for large databases\n- Works in both git and non-git workflows\n- Documentation updated with multi-agent best practices","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-14T02:37:34.073953-07:00","updated_at":"2025-10-16T12:50:19.118424-07:00","closed_at":"2025-10-16T11:06:31.156795-07:00"} +{"id":"bd-85","title":"GH-1: Fix bd dep tree graph display issues","description":"Tree display has several issues: 1) Epic items may not expand all sub-items, 2) Subitems repeat multiple times at same level, 3) Items with multiple blockers appear multiple times. The tree visualization doesn't properly handle graph structures with multiple dependencies.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-14T02:44:28.702222-07:00","updated_at":"2025-10-16T12:50:19.118624-07:00","closed_at":"2025-10-14T03:06:51.74719-07:00","external_ref":"gh-1"} +{"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:50:19.118778-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:50:19.121354-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:50:19.121599-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:50:19.123258-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:50:19.125972-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:50:19.126443-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:50:19.127987-07:00","closed_at":"2025-10-14T12:42:14.457949-07:00","external_ref":"gh-9"} +{"id":"bd-92","title":"GH-11: Add Docker support for hosted/shared instance","description":"Request for Docker container hosting to use beads across multiple dev machines. Would need to consider: centralized database (PostgreSQL?), authentication, concurrent access, API server, etc. This is a significant architectural change from the current local-first model.","status":"open","priority":2,"issue_type":"feature","created_at":"2025-10-14T02:44:58.469094-07:00","updated_at":"2025-10-16T12:50:19.128797-07:00","external_ref":"gh-11"} +{"id":"bd-93","title":"GH-18: Add --deps flag to bd create for one-command issue creation","description":"Request to add dependency specification to bd create command instead of requiring separate 'bd dep add' command. Proposed syntax: bd create 'Fix bug' --deps discovered-from=bd-20. This would be especially useful for aider integration and reducing command verbosity.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-10-14T02:44:59.610192-07:00","updated_at":"2025-10-16T12:50:19.128967-07:00","closed_at":"2025-10-14T03:26:59.536349-07:00","external_ref":"gh-18"} +{"id":"bd-94","title":"parallel_test_1","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.913771-07:00","updated_at":"2025-10-16T12:50:19.129137-07:00"} +{"id":"bd-95","title":"parallel_test_4","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.920107-07:00","updated_at":"2025-10-16T12:50:19.129297-07:00"} +{"id":"bd-96","title":"parallel_test_7","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.920612-07:00","updated_at":"2025-10-16T12:50:19.129464-07:00"} +{"id":"bd-97","title":"parallel_test_6","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.931334-07:00","updated_at":"2025-10-16T12:50:19.129633-07:00"} +{"id":"bd-98","title":"parallel_test_5","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.932369-07:00","updated_at":"2025-10-16T12:50:19.129777-07:00"} +{"id":"bd-99","title":"parallel_test_2","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-14T02:55:46.946379-07:00","updated_at":"2025-10-16T12:50:19.12993-07:00"} +{"id":"test-100","title":"Test issue with explicit ID","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-13T23:16:20.601292-07:00","updated_at":"2025-10-16T12:50:19.130096-07:00","closed_at":"2025-10-13T23:16:45.231096-07:00"} +{"id":"test-500","title":"Root issue for dep tree test","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:03:20.195117-07:00","updated_at":"2025-10-16T12:50:19.130244-07:00","closed_at":"2025-10-14T03:06:42.688954-07:00","dependencies":[{"issue_id":"test-500","depends_on_id":"test-501","type":"blocks","created_at":"2025-10-14T03:03:28.960169-07:00","created_by":"stevey"},{"issue_id":"test-500","depends_on_id":"test-502","type":"blocks","created_at":"2025-10-14T03:03:28.964808-07:00","created_by":"stevey"}]} +{"id":"test-501","title":"Dependency A","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:03:21.377968-07:00","updated_at":"2025-10-16T12:50:19.130414-07:00","closed_at":"2025-10-14T03:06:42.693557-07:00","dependencies":[{"issue_id":"test-501","depends_on_id":"test-503","type":"blocks","created_at":"2025-10-14T03:03:28.969145-07:00","created_by":"stevey"}]} +{"id":"test-502","title":"Dependency B","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:03:21.383498-07:00","updated_at":"2025-10-16T12:50:19.130576-07:00","closed_at":"2025-10-14T03:06:42.697908-07:00","dependencies":[{"issue_id":"test-502","depends_on_id":"test-503","type":"blocks","created_at":"2025-10-14T03:03:28.973659-07:00","created_by":"stevey"}]} +{"id":"test-503","title":"Shared dependency C","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:03:21.388441-07:00","updated_at":"2025-10-16T12:50:19.130725-07:00","closed_at":"2025-10-14T03:06:42.702632-07:00"} +{"id":"test-600","title":"Epic test","description":"","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-10-14T03:06:14.495832-07:00","updated_at":"2025-10-16T12:50:19.130902-07:00","closed_at":"2025-10-14T03:06:42.706851-07:00","dependencies":[{"issue_id":"test-600","depends_on_id":"test-601","type":"parent-child","created_at":"2025-10-14T03:06:15.846921-07:00","created_by":"stevey"},{"issue_id":"test-600","depends_on_id":"test-602","type":"parent-child","created_at":"2025-10-14T03:06:15.851564-07:00","created_by":"stevey"}]} +{"id":"test-601","title":"Task A under epic","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:06:14.500446-07:00","updated_at":"2025-10-16T12:50:19.131046-07:00","closed_at":"2025-10-14T03:06:42.71108-07:00","dependencies":[{"issue_id":"test-601","depends_on_id":"test-603","type":"blocks","created_at":"2025-10-14T03:06:15.856369-07:00","created_by":"stevey"}]} +{"id":"test-602","title":"Task B under epic","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:06:14.504917-07:00","updated_at":"2025-10-16T12:50:19.131192-07:00","closed_at":"2025-10-14T03:06:42.715283-07:00","dependencies":[{"issue_id":"test-602","depends_on_id":"test-604","type":"blocks","created_at":"2025-10-14T03:06:15.860979-07:00","created_by":"stevey"}]} +{"id":"test-603","title":"Sub-task under A","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:06:14.509748-07:00","updated_at":"2025-10-16T12:50:19.131337-07:00","closed_at":"2025-10-14T03:06:42.719842-07:00"} +{"id":"test-604","title":"Sub-task under B","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-14T03:06:14.514628-07:00","updated_at":"2025-10-16T12:50:19.131501-07:00","closed_at":"2025-10-14T03:06:42.724998-07:00"} +{"id":"worker2-500","title":"Another explicit ID","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-13T23:16:29.978183-07:00","updated_at":"2025-10-16T12:50:19.131672-07:00","closed_at":"2025-10-13T23:16:45.231376-07:00"}