diff --git a/.beads/beads.jsonl b/.beads/beads.jsonl index 326131ec..b80121ca 100644 --- a/.beads/beads.jsonl +++ b/.beads/beads.jsonl @@ -297,4 +297,5 @@ {"id":"bd-z528","content_hash":"807c7f1f9d3d15e510c14de34ca1536a971f00d324b7c8684c07cb32ac74ddba","title":"Prevent test pollution in production database","description":"The bd-vxdr cleanup revealed test issues were created during manual testing in the production workspace (Nov 2-4, template feature development).\n\n**Root cause:** Manual testing with `./bd create \"Test issue\"` pollutes the production .beads database.\n\n**Prevention strategies:**\n1. Use TEST_DB environment variable for manual testing\n2. Add warning when creating issues with \"Test\" prefix\n3. Improve developer docs about testing workflow\n4. Consider adding `bd test-mode` command for isolated testing","status":"open","priority":2,"issue_type":"task","created_at":"2025-11-07T16:07:28.255289-08:00","updated_at":"2025-11-07T16:07:28.255289-08:00","source_repo":"."} {"id":"bd-zbq2","content_hash":"3fec118fa6f489216810cbd5ba95a80799acc6d8dbeb12a3188695d649cb12c9","title":"bd export should verify JSONL line count matches database count","description":"After export completes, bd should verify that the JSONL file line count matches the number of issues exported. This would catch silent failures where the export appears to succeed but doesn't actually write all issues.\n\nReal-world scenario from VC project:\n- Ran direct SQL DELETE to remove 240 issues \n- Ran 'bd export -o .beads/issues.jsonl'\n- No error shown, appeared to succeed\n- But JSONL file was not updated (still had old line count)\n- Later session found all 240 issues still in JSONL\n- Had to repeat the cleanup\n\nIf export had verified line count, it would have immediately shown:\n Error: Export verification failed\n Expected: 276 issues\n JSONL file: 516 lines\n Mismatch indicates export failed to write all issues\n\nThis is especially important because:\n1. JSONL is source of truth in git\n2. Silent export failures cause data inconsistency\n3. Users assume export succeeded if no error shown\n4. The verification is cheap (just count lines)\n\nImplementation:\n- After writing JSONL, count lines in file\n- Compare to len(exportedIDs)\n- If mismatch, remove temp file and return error\n- Show clear error message with both counts","design":"In cmd/bd/export.go, after atomic rename (line ~301):\n\n1. Count lines in final JSONL file:\n - Read file and count newlines\n - Or reuse countIssuesInJSONL() helper (already exists)\n\n2. Compare to len(exportedIDs)\n\n3. If mismatch:\n - Log error with both counts\n - Optionally: remove the bad JSONL file (or leave for debugging?)\n - Return error (exit 1)\n\n4. Consider adding --skip-verify flag for edge cases\n\nEdge cases:\n- Partial line writes (corrupted file)\n- File system issues\n- Race conditions (another process modifying JSONL during export)\n\nThe countIssuesInJSONL() function already exists at line 20, can reuse it.","acceptance_criteria":"1. bd export verifies JSONL line count after write\n2. Clear error shown if mismatch detected\n3. Test case that simulates partial write failure\n4. Does not affect export performance significantly (line counting is fast)","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-05T14:24:56.278249-08:00","updated_at":"2025-11-05T14:31:24.494885-08:00","closed_at":"2025-11-05T14:31:24.494885-08:00","source_repo":"."} {"id":"bd-zkl","content_hash":"27227f7f9b8b03d312d483686711551bcf227c263f935d94d1a8f2c377969d2e","title":"Add tests for daemon vs non-daemon parity in list filters","description":"After bd-o43 RPC integration, we need tests to verify daemon mode behaves identically to direct mode for all new filter flags.\n\nTest coverage needed:\n- Pattern matching: --title-contains, --desc-contains, --notes-contains\n- Date ranges: all 6 date filter flags (created/updated/closed after/before)\n- Empty/null checks: --empty-description, --no-assignee, --no-labels\n- Priority ranges: --priority-min, --priority-max\n- Status normalization: --status all vs no status flag\n- Date parsing: YYYY-MM-DD, RFC3339, and error cases\n- Backward compat: deprecated --label flag still works\n\nOracle review findings (bd-o43):\n- Date parsing should support multiple formats\n- Status 'all' should be treated as unset\n- NoLabels field was missing from RPC protocol\n- Error messages should be clear and actionable\n\nTest approach:\n- Create RPC integration tests in internal/rpc/server_issues_epics_test.go\n- Compare daemon client.List() vs direct store.SearchIssues() for same filters\n- Verify error messages match between modes\n- Test with real daemon instance, not just unit tests","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-05T00:43:53.369457-08:00","updated_at":"2025-11-05T00:55:31.318526-08:00","closed_at":"2025-11-05T00:55:31.318526-08:00","source_repo":".","dependencies":[{"issue_id":"bd-zkl","depends_on_id":"bd-o43","type":"discovered-from","created_at":"2025-11-05T00:43:53.371274-08:00","created_by":"daemon"}]} +{"id":"bd-zpnq","content_hash":"1e523d6740960bb6f19365f496987e9dd5ae342cd107a410ba14e5004e37786d","title":"Daemons don't exit when parent process dies, causing accumulation and race conditions","description":"Multiple daemon processes accumulate over time because daemons don't automatically stop when their parent process (e.g., coding agent) is killed. This causes:\n\n1. Race conditions: 8+ daemons watching same .beads/beads.db, each with own 30s debounce timer\n2. Git conflicts: Multiple daemons racing to commit/push .beads/issues.jsonl\n3. Resource waste: Orphaned daemons from sessions days/hours old still running\n\nExample: User had 8 daemons from multiple sessions (12:37AM, 7:20PM, 7:22PM, 7:47PM, 9:19PM yesterday + 9:54AM, 10:55AM today).\n\nSolutions to consider:\n1. Track parent PID and exit when parent dies\n2. Use single global daemon instead of per-session\n3. Document manual cleanup: pkill -f \"bd daemon\"\n4. Add daemon lifecycle management (auto-cleanup of stale daemons)","notes":"Implementation complete:\n\n1. Added ParentPID field to DaemonLockInfo struct (stored in daemon.lock JSON)\n2. Daemon now tracks parent PID via os.Getppid() at startup\n3. Both event loops (polling and event-driven) check parent process every 10 seconds\n4. Daemon gracefully exits if parent process dies (detected via isProcessRunning check)\n5. Handles edge cases:\n - ParentPID=0: Older daemons without tracking (ignored)\n - ParentPID=1: Adopted by init means parent died (exits)\n - Otherwise checks if parent process is still running\n\nThe fix prevents daemon accumulation by ensuring orphaned daemons automatically exit within 10 seconds of parent death.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-11-07T18:48:41.65456-08:00","updated_at":"2025-11-07T18:53:26.382573-08:00","closed_at":"2025-11-07T18:53:26.382573-08:00","source_repo":"."} {"id":"bd-zwpw","content_hash":"f08173f44c8454bf15b265aa9d3242004e7ee2bc25867b02676746154a9cc6fe","title":"Test dependency child","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-05T11:23:05.998311-08:00","updated_at":"2025-11-05T11:23:30.389454-08:00","closed_at":"2025-11-05T11:23:30.389454-08:00","source_repo":".","dependencies":[{"issue_id":"bd-zwpw","depends_on_id":"bd-k0j9","type":"blocks","created_at":"2025-11-05T11:23:05.998981-08:00","created_by":"daemon"}]}