diff --git a/.beads/beads.jsonl b/.beads/beads.jsonl index e42b9522..3fb02a97 100644 --- a/.beads/beads.jsonl +++ b/.beads/beads.jsonl @@ -15,7 +15,7 @@ {"id":"bd-0e1f2b1b","content_hash":"c0b1677fe3f4aa3f395ae4d79bff5362632d5db26477bf571c09f9177b8741ef","title":"Event-driven daemon architecture","description":"Replace 5-second polling sync loop with event-driven architecture that reacts instantly to changes. Eliminates stale data issues while reducing CPU ~60%. Key components: FileWatcher (fsnotify), Debouncer (500ms), RPC mutation events, optional git hooks. Target latency: \u003c500ms (vs 5000ms). See event_driven_daemon.md for full design.","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-10-28T16:20:02.430479-07:00","updated_at":"2025-10-30T17:12:58.221424-07:00","closed_at":"2025-10-28T16:30:26.631191-07:00"} {"id":"bd-0e74","content_hash":"d8ab25b7a6ac1ba0e5012677cac3ac1320d3ca1059df97c979aab8c43ecb579d","title":"Comprehensive testing for separate branch workflow","description":"Comprehensive testing for separate branch workflow including unit tests, integration tests, and performance testing.\n\nTasks:\n- Unit tests for worktree management\n- Unit tests for config parsing\n- Integration tests: create/update/close → beads branch\n- Integration test: merge beads → main\n- Integration test: protected branch scenario\n- Integration test: network failure recovery\n- Integration test: config change handling\n- Manual testing guide\n- Performance testing (worktree overhead)\n\nTest scenarios: fresh setup, issue operations, merge workflow, protected branch, error handling, migration, multiple workspaces, sparse checkout\n\nEstimated effort: 4-5 days","acceptance_criteria":"- All unit tests pass\n- All integration tests pass\n- Manual testing guide works\n- No data loss in any scenario\n- Performance acceptable (\u003c 100ms overhead per commit)","notes":"Completed comprehensive test coverage. Added 4 new integration tests: config change handling, multiple concurrent clones (3-way), performance testing (avg 77ms \u003c 150ms target), and network failure recovery. All tests pass. Coverage includes fresh setup, issue ops, error handling, multiple workspaces, sparse checkout, config changes, network failures, and performance.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-02T15:22:35.580741-08:00","updated_at":"2025-11-02T18:44:12.433152-08:00","closed_at":"2025-11-02T18:44:12.433158-08:00","dependencies":[{"issue_id":"bd-0e74","depends_on_id":"bd-a101","type":"parent-child","created_at":"2025-11-02T15:22:51.348226-08:00","created_by":"stevey"}]} {"id":"bd-1022","content_hash":"0b712a337844711597d2dd950d27d4c032a3b746a27f44326d62db740f5944e9","title":"Use external_ref as primary matching key for import updates","description":"Enable re-syncing from external systems (Jira, GitHub, Linear) by using external_ref as the primary matching key during imports. Currently imports treat any content change as a collision, making it impossible to sync updates from external systems without creating duplicates.\n\nSee GH #142 for detailed proposal and implementation plan.\n\nKey changes needed:\n1. Add findByExternalRef() query function\n2. Update DetectCollisions() to match by external_ref first\n3. Update import_shared.go to update existing issues when external_ref matches\n4. Add index on external_ref for performance\n5. Preserve local issues (no external_ref) from being overwritten\n\nThis enables hybrid workflows: import external backlog, break down with local tasks, re-sync anytime.","notes":"## Code Review Complete ✅\n\n**Overall Assessment**: EXCELLENT - Production ready\n\n### Implementation Quality\n- ✓ Clean architecture with proper interface extension\n- ✓ Dual backend support (SQLite + Memory)\n- ✓ Smart matching priority: external_ref → ID → content hash\n- ✓ O(1) lookups with database index\n- ✓ Timestamp-based conflict resolution\n- ✓ Comprehensive test coverage (11 test cases)\n\n### Follow-up Issues Filed\nHigh Priority (P2):\n- bd-897a: Add UNIQUE constraint on external_ref column\n- bd-7315: Add validation for duplicate external_ref in batch imports\n\nMedium Priority (P3):\n- bd-f9a1: Add index usage verification test\n- bd-3f6a: Add concurrent import race condition tests\n\nLow Priority (P4):\n- bd-e166: Improve timestamp comparison readability\n- bd-9e23: Optimize Memory backend with index\n- bd-537e: Add external_ref change tracking\n- bd-df11: Add import metrics\n- bd-9f4a: Document external_ref in content hash\n\n### Key Features\n✅ External systems (Jira, GitHub, Linear) can re-sync without duplicates\n✅ Hybrid workflows: import external backlog, add local tasks, re-sync anytime\n✅ Local issues protected from being overwritten\n✅ Timestamp checking ensures only newer updates applied\n✅ Performance optimized with database index\n\n**Confidence Level**: 95% - Ship it! 🚀","status":"closed","priority":0,"issue_type":"feature","created_at":"2025-11-02T14:55:56.355813-08:00","updated_at":"2025-11-02T15:52:05.786625-08:00","closed_at":"2025-11-02T15:52:05.78663-08:00"} -{"id":"bd-1048","content_hash":"9f877ba70b4cfdc0356abe358b14a876a367d03f63e74f8a259056936566cd0a","title":"Daemon crashes silently on RPC query after startup","description":"The daemon fails to handle 'show' RPC commands when:\n1) JSONL is newer than database (needs import)\n2) git pull fails due to uncommitted changes\n\nSymptoms:\n- Daemon appears to run (ps shows process)\n- 'bd list' and other commands work fine \n- 'bd show \u003cid\u003e' returns \"failed to read response: EOF\"\n- No panic or error logged in daemon.log\n\nRoot cause likely: auto-import deadlock or state corruption when import is blocked by git conflicts.\n\nWorkaround: \n- Restart daemon after syncing git state (commit/push changes)\n- OR use --no-daemon flag for all commands\n\nThe panic recovery added in server_lifecycle_conn.go:183 didn't catch any panics, confirming this isn't a panic-based crash.","notes":"## Investigation findings (2025-11-02)\n\n**Reproduced**: Yes, confirmed returns EOF with daemon but works with .\n\n**Symptoms**:\n- returns \"failed to read response: EOF\" after ~30s timeout\n- \nFound 257 issues:\n\nbd-8507 [P0] [task] open\n Publish bd-wasm to npm\n\nbd-374e [P0] [task] open\n WASM integration testing\n\nbd-cc03 [P0] [task] open\n Build Node.js CLI wrapper for WASM\n\nbd-1c77 [P0] [task] open\n Implement filesystem shims for WASM\n\nbd-c77d [P0] [task] open\n Test SQLite WASM compatibility\n\nbd-197b [P0] [task] open\n Set up WASM build pipeline\n\nbd-44d0 [P0] [epic] open\n WASM port of bd for Claude Code Web sandboxes\n\nbd-8931 [P0] [bug] open\n Daemon gets stuck when auto-import blocked by git conflicts\n\nbd-1048 [P0] [bug] in_progress\n Daemon crashes silently on RPC query after startup\n\nbd-1022 [P0] [feature] closed\n Use external_ref as primary matching key for import updates\n\nbd-1231 [P0] [bug] closed\n CI failing on all 3/4 test jobs despite individual tests passing\n\nbd-4ff2 [P0] [bug] closed\n Fix CI failures before 0.21.3 release\n\nbd-89e2 [P0] [bug] closed\n Daemon race condition: stale export overwrites recent DB changes\n\nbd-2530 [P0] [feature] closed\n Issue with labels\n Labels: [bug critical]\n\nbd-eb3c [P0] [epic] closed\n UX nightmare: multiple ways daemon can fail with misleading messages\n\nbd-373c [P0] [bug] closed\n Daemon crashes silently when multiple .db files exist in .beads/\n\nbd-763c [P0] [bug] closed\n ~/src/beads daemon has 'sql: database is closed' errors - zombie daemon\n\nbd-12c2 [P0] [task] closed\n Add comprehensive tests for show.go commands (show, update, edit, close)\n\nbd-27ea [P0] [task] closed\n Improve cmd/bd test coverage from 21% to 40% (multi-session effort)\n\nbd-70419816 [P0] [bug] closed\n Export deduplication breaks when JSONL and export_hashes table diverge\n\nbd-5dae5504 [P0] [bug] closed\n Export deduplication breaks when JSONL and export_hashes table diverge\n\nbd-325da116 [P0] [epic] closed\n Fix N-way collision convergence\n\nbd-4ba5908b [P0] [task] closed\n Implement content-hash based collision resolution for deterministic convergence\n\nbd-3d844c58 [P0] [task] closed\n Implement content-hash based collision resolution for deterministic convergence\n\nbd-71107098 [P0] [epic] closed\n Make two-clone workflow actually work (no hacks)\n\nbd-0134cc5a [P0] [bug] closed\n Fix auto-import creating duplicates instead of updating issues\n\nbd-09b5f2f5 [P0] [epic] closed\n Daemon fails to auto-import after git pull updates JSONL\n\nbd-36870264 [P0] [bug] closed\n Enforce daemon singleton per workspace with file locking\n\nbd-ad5e [P1] [feature] closed\n Add AI planning docs management guidance to bd onboard (GH-196)\n\nbd-caa9 [P1] [task] open\n Migration tool for existing users\n\nbd-6545 [P1] [task] closed\n Update daemon commit logic for separate branch\n\nbd-5ce8 [P1] [task] closed\n Document protected branch workflow\n\nbd-3396 [P1] [task] closed\n Add merge helper commands (bd sync --merge)\n\nbd-0e74 [P1] [task] closed\n Comprehensive testing for separate branch workflow\n\nbd-a4b5 [P1] [task] closed\n Implement git worktree management\n\nbd-b7d2 [P1] [task] closed\n Add sync.branch configuration\n\nbd-a101 [P1] [epic] in_progress\n Support separate branch for beads commits\n\nbd-0d9c [P1] [bug] closed\n YABB: Spurious issue updates during normal operations\n\nbd-627d [P1] [epic] closed\n AI-supervised database migrations for safer schema evolution\n\nbd-8a39 [P1] [bug] closed\n Fix Windows-specific test failures in CI\n\nbd-3e3b [P1] [feature] closed\n Add circular dependency detection to bd doctor\n\nbd-d9e0 [P1] [task] closed\n Extract validation functions to validators.go\n\nbd-1f28 [P1] [task] closed\n Extract migration functions to migrations.go\n\nbd-90a5 [P1] [task] closed\n Extract hash ID generation functions to hash_ids.go\n\nbd-3b7f [P1] [task] closed\n Add tests for extracted modules\n\nbd-c796 [P1] [task] closed\n Extract batch operations to batch_ops.go\n\nbd-fc2d [P1] [epic] closed\n Refactor sqlite.go (2298 lines)\n\nbd-fd56 [P1] [task] closed\n Wrap git operations in GitClient interface\n\nbd-1445 [P1] [task] closed\n Create shared insert/event/dirty helpers\n\nbd-0702 [P1] [task] closed\n Consolidate ID generation and validation into ids.go\n\nbd-05a1 [P1] [task] closed\n Isolate RPC server startup into rpc_server.go\n\nbd-0458 [P1] [task] closed\n Consolidate export/import/commit/push into sync.go\n\nbd-d33c [P1] [task] closed\n Separate process/lock/PID concerns into process.go\n\nbd-b245 [P1] [task] closed\n Add migration registry and simplify New()\n\nbd-b5a3 [P1] [task] closed\n Extract Daemon struct and config into internal/daemonrunner\n\nbd-1b0a [P1] [task] closed\n Add transaction helper to replace manual COMMIT/ROLLBACK\n\nbd-5f26 [P1] [epic] closed\n Refactor daemon.go into internal/daemonrunner\n\nbd-fb05 [P1] [epic] closed\n Refactor sqlite.go into focused modules\n\nbd-ef85 [P1] [feature] closed\n Add --json flags to all bd commands for agent-friendly output\n\nbd-2b34.8 [P1] [task] closed\n Extract daemon lifecycle functions to daemon_lifecycle.go\n\nbd-2b34.7 [P1] [task] closed\n Add tests for daemon config module\n\nbd-2b34.6 [P1] [task] closed\n Add tests for daemon lifecycle module\n\nbd-2b34.5 [P1] [task] closed\n Add tests for daemon sync module\n\nbd-2b34.4 [P1] [task] closed\n Extract daemon config functions to daemon_config.go\n\nbd-2b34.3 [P1] [task] closed\n Extract daemon sync functions to daemon_sync.go\n\nbd-2b34.2 [P1] [task] closed\n Extract daemon server functions to daemon_server.go\n\nbd-2b34.1 [P1] [task] closed\n Extract daemon logger functions to daemon_logger.go\n\nbd-2b34 [P1] [epic] closed\n Refactor cmd/bd/daemon.go for testability and maintainability\n\nbd-9e8d [P1] [bug] closed\n Test Issue\n\nbd-40a0 [P1] [feature] closed\n bd doctor should check for multiple DBs, multiple JSONLs, daemon health\n\nbd-11e0 [P1] [bug] closed\n Database import silently fails when daemon version != CLI version\n\nbd-07af [P1] [feature] closed\n Need comprehensive daemon health check command (bd daemon doctor?)\n\nbd-6c68 [P1] [bug] closed\n bd info shows 'auto_start_disabled' even when daemon is crashed/missing\n\nbd-e652 [P1] [bug] closed\n bd doctor doesn't detect version mismatches or stale daemons\n\nbd-e55c [P1] [bug] closed\n Import overwrites newer local issues with older remote versions\n\nbd-e1085716 [P1] [task] open\n bd validate - Comprehensive health check\n\nbd-1f4086c5 [P1] [epic] closed\n Event-driven daemon architecture\n\nbd-2752a7a2 [P1] [task] closed\n Create cmd/bd/daemon_watcher.go (~150 LOC)\n\nbd-f8b764c9.1 [P1] [task] closed\n Dogfood: Migrate beads repo to hash IDs\n\nbd-f8b764c9.2 [P1] [task] closed\n Update MCP server for hash IDs\n\nbd-f8b764c9.3 [P1] [task] closed\n Test: N-clone scenario with hash IDs (no collisions)\n\nbd-f8b764c9.4 [P1] [task] closed\n Migration tool: sequential → hash IDs\n\nbd-f8b764c9.5 [P1] [task] closed\n Delete collision resolution code\n\nbd-f8b764c9.6 [P1] [task] closed\n Implement alias conflict resolution\n\nbd-f8b764c9.7 [P1] [task] closed\n CLI accepts both hash IDs and aliases\n\nbd-f8b764c9.8 [P1] [task] closed\n Update JSONL format to use hash IDs\n\nbd-f8b764c9.9 [P1] [task] closed\n Implement hash ID generation in CreateIssue\n\nbd-f8b764c9.10 [P1] [task] closed\n Add alias field to database schema\n\nbd-f8b764c9.11 [P1] [task] closed\n Design hash ID generation algorithm\n\nbd-f8b764c9 [P1] [epic] closed\n Hash-based IDs with aliasing system\n\nbd-98c4e1fa [P1] [epic] closed\n Event-driven daemon architecture\n\nbd-eef03e0a [P1] [task] closed\n Stress test: event storm handling\n\nbd-7c5915ae [P1] [task] closed\n Run final validation and cleanup checks\n\nbd-581b80b3 [P1] [task] open\n bd find-duplicates - AI-powered duplicate detection\n\nbd-a1691807 [P1] [task] closed\n Integration test: mutation to export latency\n\nbd-1f4086c5.1 [P1] [task] closed\n Integration test: mutation to export latency\n\nbd-833559b3 [P1] [task] open\n bd validate - Comprehensive health check\n\nbd-a40f374f [P1] [task] closed\n bd validate - Comprehensive health check\n\nbd-7c831c51 [P1] [task] closed\n Run final validation and cleanup checks\n\nbd-b501fcc1 [P1] [task] closed\n Unit tests for Debouncer\n\nbd-36320a04 [P1] [task] closed\n Add mutation channel to internal/rpc/server.go\n\nbd-83f0bb64 [P1] [task] closed\n Platform tests: Linux, macOS, Windows\n\nbd-69bce74a [P1] [task] closed\n Platform tests: Linux, macOS, Windows\n\nbd-a5a8bec0 [P1] [task] closed\n bd find-duplicates - AI-powered duplicate detection\n\nbd-df190564 [P1] [task] closed\n bd repair-deps - Orphaned dependency cleaner\n\nbd-4e21b5ad [P1] [task] closed\n Add test case for symmetric collision (both clones create same ID simultaneously)\n\nbd-0447029c [P1] [task] closed\n bd find-duplicates - AI-powered duplicate detection\n\nbd-31aab707 [P1] [task] closed\n Unit tests for FileWatcher\n\nbd-e6d71828 [P1] [task] closed\n Add transaction + retry logic for N-way collision resolution\n\nbd-cbed9619.1 [P1] [task] closed\n Fix multi-round convergence for N-way collisions\n\nbd-5f483051 [P1] [task] open\n Implement bd resolve-conflicts (git merge conflicts in JSONL)\n\nbd-7e7ddffa [P1] [epic] closed\n Repair Commands \u0026 AI-Assisted Tooling\n\nbd-cbed9619.2 [P1] [task] closed\n Implement content-first idempotent import\n\nbd-cbed9619.3 [P1] [task] closed\n Implement global N-way collision resolution algorithm\n\nbd-cbed9619.4 [P1] [task] closed\n Make DetectCollisions read-only (separate detection from modification)\n\nbd-cbed9619.5 [P1] [task] closed\n Add content-addressable identity to Issue type\n\nbd-64c05d00.1 [P1] [task] closed\n Fix TestTwoCloneCollision to compare content not timestamps\n\nbd-64c05d00 [P1] [epic] closed\n Multi-clone collision resolution testing and documentation\n\nbd-317ddbbf [P1] [task] closed\n Add BEADS_DAEMON_MODE flag handling\n\nbd-0650a73b [P1] [task] closed\n Create cmd/bd/daemon_debouncer.go (~60 LOC)\n\nbd-0e1f2b1b [P1] [epic] closed\n Event-driven daemon architecture\n\nbd-da4d8951 [P1] [task] closed\n Replace getStorageForRequest with Direct Access\n\nbd-3b2fe268 [P1] [task] open\n Add fsnotify dependency to go.mod\n\nbd-6ada971e [P1] [task] closed\n Create cmd/bd/daemon_event_loop.go (~200 LOC)\n\nbd-96142dec [P1] [task] closed\n Add fallback to polling on watcher failure\n\nbd-7e7ddffa.1 [P1] [task] open\n bd resolve-conflicts - Git merge conflict resolver\n\nbd-9f1fce5d [P1] [task] open\n Add internal/ai package for LLM integration\n\nbd-5314bddf [P1] [task] open\n bd detect-pollution - Test pollution detector\n\nbd-4aeed709 [P1] [task] closed\n bd resolve-conflicts - Git merge conflict resolver\n\nbd-6214875c [P1] [task] closed\n Split internal/rpc/server.go into focused modules\n\nbd-2f388ca7 [P1] [bug] closed\n Fix TestTwoCloneCollision timeout\n\nbd-c947dd1b [P1] [epic] closed\n Remove Daemon Storage Cache\n\nbd-06aec0c3 [P1] [task] closed\n Integration Testing\n\nbd-cb64c226.1 [P1] [task] closed\n Performance Validation\n\nbd-08e556f2 [P1] [task] closed\n Remove Cache Configuration Docs\n\nbd-3e9ddc31 [P1] [task] closed\n Replace getStorageForRequest with Direct Access\n\nbd-bc2c6191 [P1] [task] open\n Audit Current Cache Usage\n\nbd-381d7f6c [P1] [task] closed\n Audit Current Cache Usage\n\nbd-cb64c226.6 [P1] [task] closed\n Verify MCP Server Compatibility\n\nbd-cb64c226.8 [P1] [task] closed\n Update Metrics and Health Endpoints\n\nbd-cb64c226.9 [P1] [task] closed\n Remove Cache-Related Tests\n\nbd-cb64c226.10 [P1] [task] closed\n Delete server_cache_storage.go\n\nbd-cb64c226.12 [P1] [task] closed\n Remove Storage Cache from Server Struct\n\nbd-cb64c226.13 [P1] [task] closed\n Audit Current Cache Usage\n\nbd-fb95094c.1 [P1] [task] closed\n Run final validation and cleanup checks\n Labels: [phase-4 validation]\n\nbd-fb95094c.2 [P1] [task] closed\n Delete skipped tests for \"old buggy behavior\"\n Labels: [cleanup dead-code phase-1 test-cleanup]\n\nbd-3ee2c7e9 [P1] [epic] closed\n Add \"bd daemons\" command for multi-daemon management\n\nbd-e16b [P2] [feature] closed\n Replace BEADS_DB with BEADS_DIR environment variable\n\nbd-28db [P2] [feature] open\n Add 'bd status' command for issue database overview\n\nbd-d3f0 [P2] [feature] open\n Add 'bd comment' as alias for 'bd comments add'\n\nbd-23a8 [P2] [task] closed\n Test simple issue\n\nbd-6049 [P2] [bug] closed\n bd doctor --json flag not working\n\nbd-7bd2 [P2] [task] closed\n Complete remaining sync branch daemon tests\n\nbd-502e [P2] [task] closed\n Add comprehensive tests for sync branch daemon logic\n\nbd-e05d [P2] [task] closed\n Investigate and optimize test suite performance\n\nbd-7315 [P2] [task] closed\n Add validation for duplicate external_ref in batch imports\n\nbd-897a [P2] [task] closed\n Add UNIQUE constraint on external_ref column\n\nbd-d3e5 [P2] [task] closed\n Test issue 2\n\nbd-879d [P2] [task] closed\n Test issue 1\n\nbd-0a90 [P2] [bug] closed\n bd show --json doesn't include dependency type field\n\nbd-63e9 [P2] [bug] closed\n Fix Nix flake build test failures\n\nbd-7fe8 [P2] [chore] closed\n Fix linting error in migrate.go\n\nbd-cdf7 [P2] [task] closed\n Add tests for DetectCycles to improve coverage from 29.6%\n\nbd-c01f [P2] [epic] closed\n Implement bd stale command to find abandoned/forgotten issues\n\nbd-5e1f [P2] [bug] closed\n Issue with desc\n\nbd-b6b2 [P2] [feature] closed\n Feature with design\n\nbd-1ece [P2] [chore] closed\n Remove obsolete renumber.go command (hash IDs eliminated need)\n\nbd-5599 [P2] [bug] closed\n Fix TestListCommand duplicate dependency constraint violation\n\nbd-7eed [P2] [chore] closed\n Remove obsolete stale.go command (executor tables never implemented)\n\nbd-d355a07d [P2] [bug] open\n Import validation falsely reports data loss on collision resolution\n\nbd-98c4e1fa.1 [P2] [task] open\n Update AGENTS.md with event-driven mode\n\nbd-22e0bde9 [P2] [task] closed\n Add TestNWayCollision for 5+ clones\n\nbd-a03d5e36 [P2] [epic] open\n Improve integration test coverage for stateful features\n\nbd-f8b764c9.12 [P2] [task] closed\n Update documentation for hash IDs and aliases\n\nbd-f8b764c9.13 [P2] [task] closed\n Add bd alias command for manual alias control\n\nbd-1863608e [P2] [task] closed\n Add TestNWayCollision for 5+ clones\n\nbd-81abb639 [P2] [task] closed\n Investigate jujutsu VCS as potential solution for conflict-free merging\n\nbd-7a2b58fc [P2] [feature] open\n Implement clone-scoped ID allocation to prevent N-way collisions\n\nbd-5aad5a9c [P2] [task] closed\n Add TestNWayCollision for 5+ clones\n\nbd-9a9530d8 [P2] [task] closed\n Add TestNWayCollision for 5+ clones\n\nbd-3e307cd4 [P2] [task] closed\n File change test issue\n\nbd-a5251b1a [P2] [task] closed\n Test RPC mutation event\n\nbd-5b40a0bf [P2] [task] closed\n Batch test 5\n\nbd-dcd6f14b [P2] [task] closed\n Batch test 4\n\nbd-e8be4224 [P2] [task] closed\n Batch test 3\n\nbd-17fa2d21 [P2] [task] closed\n Batch test 2\n\nbd-f0d9bcf2 [P2] [task] closed\n Batch test 1\n\nbd-7da9437e [P2] [task] closed\n Latency test\n\nbd-8900f145 [P2] [task] closed\n Testing event-driven mode!\n\nbd-3f80d9e0 [P2] [task] open\n Improve internal/daemon test coverage (currently 22.5%)\n\nbd-6221bdcd [P2] [task] open\n Improve cmd/bd test coverage (currently 20.2%)\n\nbd-4d7fca8a [P2] [task] open\n Add tests for internal/utils package\n\nbd-0dcea000 [P2] [task] open\n Add tests for internal/importer package\n\nbd-85487065 [P2] [task] open\n Add tests for internal/autoimport package\n\nbd-9ae788be [P2] [feature] open\n Implement clone-scoped ID allocation to prevent N-way collisions\n\nbd-ef72b864 [P2] [task] closed\n Add MCP server functions for repair commands\n\nbd-7bbc4e6a [P2] [task] open\n Add MCP server functions for repair commands\n\nbd-c9a482db [P2] [task] open\n Add internal/ai package for AI-assisted repairs\n\nbd-b55e2ac2 [P2] [task] open\n Fix autoimport tests for content-hash collision scoring\n\nbd-dd6f6d26 [P2] [task] closed\n Fix autoimport tests for content-hash collision scoring\n\nbd-64c05d00.2 [P2] [task] open\n Document 3-clone ID non-determinism in collision resolution\n\nbd-64c05d00.3 [P2] [task] closed\n Add TestThreeCloneCollision for regression protection\n\nbd-6fe4622f [P2] [task] open\n Remove unreachable utility functions\n\nbd-29c128e8 [P2] [task] closed\n Update AGENTS.md with event-driven mode\n\nbd-89f89fc0 [P2] [task] open\n Remove unreachable RPC methods\n\nbd-c825f867 [P2] [task] open\n Add docs/architecture/event_driven.md\n\nbd-ce37850f [P2] [task] open\n Add embedding generation for duplicate detection\n\nbd-d4ec5a82 [P2] [task] open\n Add MCP functions for repair commands\n\nbd-cf349eb3 [P2] [task] closed\n Update LINTING.md with current baseline\n\nbd-fb95094c [P2] [epic] open\n Code Health \u0026 Technical Debt Cleanup\n Labels: [cleanup epic]\n\nbd-fb95094c.3 [P2] [task] open\n Update documentation after code health cleanup\n Labels: [documentation phase-4]\n\nbd-fb95094c.4 [P2] [task] open\n Audit and consolidate collision test coverage\n Labels: [phase-4 test-cleanup]\n\nbd-fb95094c.5 [P2] [task] open\n Centralize BD_DEBUG logging into debug package\n Labels: [deduplication logging phase-3 refactor]\n\nbd-fb95094c.6 [P2] [task] open\n Extract normalizeLabels to shared utility package\n Labels: [deduplication phase-3 refactor]\n\nbd-fb95094c.7 [P2] [task] open\n Extract SQLite migrations into separate files\n Labels: [database phase-2 refactor]\n\nbd-fb95094c.8 [P2] [task] closed\n Remove unreachable utility functions\n Labels: [cleanup dead-code phase-1]\n\nbd-fb95094c.9 [P2] [task] closed\n Remove unreachable RPC methods\n Labels: [cleanup dead-code phase-1 rpc]\n\nbd-aec5439f [P2] [task] open\n Update LINTING.md with current baseline\n\nbd-bdaf24d5 [P2] [task] closed\n Final validation test\n\nbd-46381404 [P2] [task] closed\n Test database naming\n\nbd-69fbe98e [P2] [task] open\n Implement \"bd daemons logs\" subcommand\n\nbd-e98221b3 [P2] [task] open\n Update AGENTS.md and README.md with \"bd daemons\" documentation\n\nbd-fd8753d9 [P2] [task] open\n Document bd edit command and verify MCP exclusion\n\nbd-248bdc3e [P2] [task] open\n Add optional post-merge git hook example for bd sync\n\nbd-b47c034e [P2] [task] closed\n Address gosec security warnings (102 issues)\n\nbd-a9699011 [P2] [bug] open\n GH#146: No color showing in terminal for some users\n\nbd-4d80b7b1 [P2] [task] open\n Investigate and upgrade to modernc.org/sqlite 1.39.1+\n\nbd-9063acda [P2] [epic] closed\n Clean up linter errors (914 total issues)\n\nbd-ce75 [P3] [task] closed\n Test parent issue\n\nbd-c362 [P3] [chore] open\n Extract database search logic into helper function\n\nbd-efe8 [P3] [chore] open\n Refactor path canonicalization into helper function\n\nbd-736d [P3] [chore] open\n Refactor path canonicalization into helper function\n\nbd-3f6a [P3] [task] closed\n Add concurrent import race condition tests\n\nbd-f9a1 [P3] [task] closed\n Add index usage verification test for external_ref lookups\n\nbd-08fd [P3] [task] closed\n Test child issue\n\nbd-9f20 [P3] [bug] closed\n DetectCycles SQL query has bug preventing cycle detection\n\nbd-2e80 [P3] [chore] closed\n Document shared memory test isolation pattern in test_helpers.go\n\nbd-d68f [P3] [task] closed\n Add tests for Comments API (AddIssueComment, GetIssueComments)\n\nbd-4f582ec8 [P3] [task] closed\n Test auto-start in fred\n\nbd-9826b69a [P3] [feature] closed\n CRDT-based architecture for guaranteed convergence (v2.0)\n\nbd-6d7efe32 [P3] [feature] closed\n CRDT-based architecture for guaranteed convergence (v2.0)\n\nbd-942469b8 [P3] [task] open\n Rapid 5\n\nbd-e1d645e8 [P3] [task] open\n Rapid 4\n\nbd-d7e88238 [P3] [task] open\n Rapid 3\n\nbd-7a00c94e [P3] [task] open\n Rapid 2\n\nbd-6bebe013 [P3] [task] open\n Rapid 1\n\nbd-710a4916 [P3] [feature] open\n CRDT-based architecture for guaranteed convergence (v2.0)\n\nbd-7e0d6660 [P3] [task] closed\n Handle unchecked errors (errcheck - 683 issues)\n\nbd-589c7c1e [P3] [task] closed\n Fix revive style issues (78 issues)\n\nbd-fb95094c.10 [P3] [task] open\n Consider central serialization package for JSON handling\n Labels: [deduplication optional phase-3 refactor serialization]\n\nbd-1c63eb84 [P3] [task] open\n Investigate jujutsu integration for beads\n\nbd-9f4a [P4] [task] open\n Document external_ref in content hash behavior\n\nbd-df11 [P4] [chore] open\n Add import metrics for external_ref matching statistics\n\nbd-537e [P4] [feature] open\n Add external_ref change tracking and auditing\n\nbd-9e23 [P4] [chore] open\n Optimize Memory backend GetIssueByExternalRef with index\n\nbd-e166 [P4] [chore] open\n Improve timestamp comparison readability in import\n\nbd-5b6e [P4] [task] open\n Add tests for helper functions (GetDirtyIssueHash, GetAllDependencyRecords, export hashes), \n📋 Ready work (10 issues with no blockers):\n\n1. [P0] bd-44d0: WASM port of bd for Claude Code Web sandboxes\n2. [P1] bd-caa9: Migration tool for existing users\n3. [P2] bd-d3f0: Add 'bd comment' as alias for 'bd comments add'\n4. [P2] bd-28db: Add 'bd status' command for issue database overview\n5. [P3] bd-736d: Refactor path canonicalization into helper function\n6. [P3] bd-efe8: Refactor path canonicalization into helper function\n7. [P3] bd-c362: Extract database search logic into helper function\n8. [P4] bd-5b6e: Add tests for helper functions (GetDirtyIssueHash, GetAllDependencyRecords, export hashes)\n9. [P4] bd-e166: Improve timestamp comparison readability in import\n10. [P4] bd-9e23: Optimize Memory backend GetIssueByExternalRef with index, \n📊 Beads Statistics:\n\nTotal Issues: 257\nOpen: 69\nIn Progress: 2\nClosed: 186\nBlocked: 9\nReady: 60\nAvg Lead Time: 21.5 hours all work fine with daemon\n- works perfectly\n- Client connects successfully (health check passes) but times out waiting for response\n- No errors in daemon logs, no debug messages reaching logs\n\n**What works**:\n- Health checks (daemon responds)\n- All other RPC operations (list, ready, stats, create, update, close)\n- bd show with --no-daemon flag\n\n**What fails**:\n- ALL commands when using daemon (any issue ID)\n\n**Code investigation**:\n1. Client timeout = 30s (internal/rpc/client.go:56)\n2. Auto-import timeout = 5s (after fix attempt, was 30s)\n3. handleShow calls GetLabels, GetDependencies, GetDependents (unlike list)\n4. Daemon stderr redirected to /dev/null, debug logging not visible\n5. No debug messages in logs means request may not reach handleRequest\n\n**Attempted fixes**:\n- Reduced auto-import timeout from 30s to 5s (didn't help)\n- Manually imported JSONL to sync state (didn't help)\n- Restarted daemon after import (didn't help)\n- Added debug logging (not visible due to stderr → /dev/null)\n\n**Next steps**:\n- Need visible logging (redirect to log file or use daemon logger)\n- Investigate if GetDependencies/GetDependents causing database lock\n- Check if handleConnection even receives show requests\n- Consider async auto-import to avoid blocking\n- Test with completely empty database to rule out data issues","status":"in_progress","priority":0,"issue_type":"bug","created_at":"2025-11-02T17:05:03.658333-08:00","updated_at":"2025-11-02T22:12:06.857797-08:00"} +{"id":"bd-1048","content_hash":"8102b10a9ea48cc9135d79c61ee1bb4af57b8334c068a941f9a8d48f9a47e8cc","title":"Daemon crashes silently on RPC query after startup","description":"The daemon fails to handle 'show' RPC commands when:\n1) JSONL is newer than database (needs import)\n2) git pull fails due to uncommitted changes\n\nSymptoms:\n- Daemon appears to run (ps shows process)\n- 'bd list' and other commands work fine \n- 'bd show \u003cid\u003e' returns \"failed to read response: EOF\"\n- No panic or error logged in daemon.log\n\nRoot cause likely: auto-import deadlock or state corruption when import is blocked by git conflicts.\n\nWorkaround: \n- Restart daemon after syncing git state (commit/push changes)\n- OR use --no-daemon flag for all commands\n\nThe panic recovery added in server_lifecycle_conn.go:183 didn't catch any panics, confirming this isn't a panic-based crash.","notes":"Root cause found and fixed: Two bugs - (1) nil pointer check missing in handleShow causing panic, (2) double JSON encoding in show.go ID resolution. Both fixed. bd show now works with daemon.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-11-02T17:05:03.658333-08:00","updated_at":"2025-11-02T22:22:47.872169-08:00","closed_at":"2025-11-02T22:22:47.872169-08:00"} {"id":"bd-11e0","content_hash":"591db3f5674cf7f79b1f50d6b8d83fe60e495f02a21e181c9c63d8da88308d58","title":"Database import silently fails when daemon version != CLI version","description":"","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-31T21:08:09.096749-07:00","updated_at":"2025-11-01T19:29:35.267817-07:00","closed_at":"2025-11-01T19:29:35.267817-07:00"} {"id":"bd-1231","content_hash":"c9545032de3b8fb5da54edc4951253d7ac47e5c96677fc412b8c785e56ec8f32","title":"CI failing on all 3/4 test jobs despite individual tests passing","description":"CI has been broken for a day+ with mysterious test failures. Issue #173 on GitHub tracks this.\n\n## Current Status\n- **Lint job**: ✅ PASSING\n- **Test (Linux)**: ❌ FAILING (exit code 1)\n- **Test (Windows)**: ❌ FAILING (exit code 1)\n- **Test Nix Flake**: ❌ FAILING (exit code 1)\n\n## Key Observations\nAll three failing jobs show identical pattern:\n- Individual test output shows PASS for every test\n- Final result: `FAIL github.com/steveyegge/beads/cmd/bd`\n- Exit code 1 despite no visible test failures\n- Last visible test output before failure: \"No Reason Issue\" test (TestCloseCommand/close_without_reason)\n\n## Investigation So Far\n1. All tests appear to pass when examined individually\n2. Likely causes:\n - Race detector finding data races during test cleanup (`-race` flag)\n - Panic/error occurring after main tests complete\n - Test harness issue not reporting actual failure\n - Possible regression from PR #203 (dependency_type changes)\n\n## Recent CI Runs\n- Run 19015040655 (latest): 3/4 failing\n- Multiple recent commits tried to fix Windows/lint issues\n- Agent on rrnewton/beads fork attempting fixes (2/4 passing there)\n\n## Next Steps\n1. Run tests locally with `-race -v` to see full output\n2. Check for unreported test failures or panics\n3. Examine test cleanup/teardown code\n4. Review recent changes around close command tests\n5. Consider if race detector is too sensitive or catching real issues","notes":"## Progress Update\n\n### ✅ Fixed (commits 09bd4d3, 21a29bc)\n1. **Daemon auto-import** - Always recompute content_hash in importer to avoid stale hashes\n2. **TestScripts failures** - Added bd binary to PATH for shell subprocess tests\n3. **Test infrastructure** - Added .gitignore to test repos, fixed last_import_time metadata\n\n### ✅ CI Status (Run 19015638968)\n- **Test (Linux)**: ✅ SUCCESS - All tests passing\n- **Test (Windows)**: ❌ FAILURE - Pre-existing Windows test failures\n- **Test Nix Flake**: ❌ FAILURE - Build fails with same test errors\n- **Lint**: ❌ FAILURE - Pre-existing issue in migrate.go:647\n\n### ❌ Remaining Issues (not related to original bd-1231)\n\n**Windows failures:**\n- TestFindDatabasePathEnvVar\n- TestHashIDs_MultiCloneConverge \n- TestHashIDs_IdenticalContentDedup\n- TestDatabaseReinitialization (5 subtests)\n- TestFindBeadsDir_NotFound\n- TestMetricsSnapshot/uptime\n\n**Lint failure:**\n- cmd/bd/migrate.go:647:37: cleanupWALFiles - result 0 (error) is always nil (unparam)\n\n**Nix failure:**\n- Build fails during test phase with same test errors\n\n### Next Steps\n1. Investigate Windows-specific test failures\n2. Fix linting issue in migrate.go\n3. Debug Nix build test failures","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-11-02T08:42:16.142128-08:00","updated_at":"2025-11-02T11:17:39.073861-08:00","closed_at":"2025-11-02T11:17:39.073861-08:00","external_ref":"https://github.com/steveyegge/beads/issues/173"} {"id":"bd-12c2","content_hash":"caa7a5f6e61a9b1c872f5462e53ed0ecdedc8835265ba6b7c7ef2100fa6448ae","title":"Add comprehensive tests for show.go commands (show, update, edit, close)","description":"Need to add tests for cmd/bd/show.go which contains show, update, edit, and close commands.\n\n**Challenge**: The existing test patterns use rootCmd.SetArgs() and rootCmd.Execute(), but the global `store` variable needs to match what the commands use. Initial attempt created tests that failed with \"no issue found\" because the test's store instance wasn't the same as the command's store.\n\n**Files to test**:\n- show.go (contains showCmd, updateCmd, editCmd, closeCmd)\n\n**Coverage needed**:\n- show command (single issue, multiple issues, JSON output, with dependencies, with labels, with compaction)\n- update command (status, priority, title, assignee, description, multiple fields, multiple issues)\n- edit command (requires $EDITOR, may need mocking)\n- close command (single issue, multiple issues, with reason, JSON output)\n\n**Test approach**:\n1. Study working test patterns in init_test.go, list_test.go, etc.\n2. Ensure BEADS_NO_DAEMON=1 is set\n3. Properly initialize database with bd init\n4. Use the command's global store, not a separate instance\n5. May need to reset global state between tests\n\n**Success criteria**: \n- All test functions pass\n- Coverage for show.go increases significantly\n- Tests follow existing patterns in cmd/bd/*_test.go","status":"closed","priority":0,"issue_type":"task","created_at":"2025-10-31T20:08:40.545173-07:00","updated_at":"2025-10-31T20:19:22.411066-07:00","closed_at":"2025-10-31T20:19:22.411066-07:00"} @@ -75,6 +75,7 @@ {"id":"bd-4d7fca8a","content_hash":"57a2b25548d175bdd495044afa0ddb0739118c7faa2fc0860b13aaabb2635c23","title":"Add tests for internal/utils package","description":"Currently 0.0% coverage. Need tests for utility functions including issue ID parsing and validation.","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-29T14:06:24.066403-07:00","updated_at":"2025-10-30T17:12:58.185474-07:00","dependencies":[{"issue_id":"bd-4d7fca8a","depends_on_id":"bd-cbed9619.5","type":"blocks","created_at":"2025-10-29T19:52:05.52888-07:00","created_by":"import-remap"},{"issue_id":"bd-4d7fca8a","depends_on_id":"bd-cbed9619.4","type":"blocks","created_at":"2025-10-29T19:52:05.529565-07:00","created_by":"import-remap"},{"issue_id":"bd-4d7fca8a","depends_on_id":"bd-0dcea000","type":"blocks","created_at":"2025-10-29T19:52:05.529982-07:00","created_by":"import-remap"}]} {"id":"bd-4d80b7b1","content_hash":"0cad3e22d722ff045a29f218962fb00bd8265a1cfc82c5b70f29ffe1a40e4088","title":"Investigate and upgrade to modernc.org/sqlite 1.39.1+","description":"We had to pin modernc.org/sqlite to v1.38.2 due to a FOREIGN KEY constraint regression in v1.39.1 (SQLite 3.50.4).\n\n**Issue:** [deleted:bd-cb64c226.2], GH #144\n\n**Symptom:** CloseIssue fails with \"FOREIGN KEY constraint failed (787)\" when called via MCP/daemon, but works fine via CLI.\n\n**Root Cause:** Unknown - likely stricter FK enforcement in SQLite 3.50.4 or modernc.org wrapper changes.\n\n**Workaround:** Pinned to v1.38.2 (SQLite 3.49.x)\n\n**TODO:**\n1. Monitor modernc.org/sqlite releases for fixes\n2. Check SQLite 3.50.5+ changelogs for FK-related fixes\n3. Investigate why daemon mode fails but CLI succeeds (connection reuse? transaction isolation?)\n4. Consider filing upstream issue with reproducible test case\n5. Upgrade when safe","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-24T11:49:12.836292-07:00","updated_at":"2025-10-30T17:12:58.211344-07:00"} {"id":"bd-4e21b5ad","content_hash":"8029d0c5b14261648d3d17d8bc26413183962eab2875772cd2585db92c0104a6","title":"Add test case for symmetric collision (both clones create same ID simultaneously)","description":"TestTwoCloneCollision demonstrates the problem, but we need a simpler unit test for the collision resolver itself.\n\nTest should verify:\n- Two issues with same ID, different content\n- Content hash determines winner deterministically \n- Result is same regardless of which clone imports first\n- No title swapping occurs\n\nThis can be a simpler test than the full integration test.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-29T17:46:10.046999-07:00","updated_at":"2025-10-31T12:00:43.196705-07:00","closed_at":"2025-10-31T12:00:43.196705-07:00"} +{"id":"bd-4ec8","content_hash":"64d140d382b4efd1a0d67cda9a0af9a0240c013cafc4aa61f3644b74b7b1cd94","title":"Widespread double JSON encoding bug in daemon mode RPC calls","description":"Multiple CLI commands had the same double JSON encoding bug found in bd-1048. All commands that called ResolveID via RPC used string(resp.Data) instead of properly unmarshaling the JSON response. This caused IDs to retain JSON quotes (\"bd-1048\" instead of bd-1048), which then got double-encoded when passed to subsequent RPC calls.\n\nAffected commands:\n- bd show (3 instances)\n- bd dep add/remove/tree (5 instances)\n- bd label add/remove/list (3 instances)\n- bd reopen (1 instance)\n\nRoot cause: resp.Data is json.RawMessage (already JSON-encoded), so string() conversion preserves quotes.\n\nFix: Replace all string(resp.Data) with json.Unmarshal(resp.Data, \u0026id) for proper deserialization.\n\nAll commands now tested and working correctly with daemon mode.","status":"open","priority":0,"issue_type":"bug","created_at":"2025-11-02T22:33:01.632691-08:00","updated_at":"2025-11-02T22:33:01.632691-08:00"} {"id":"bd-4f582ec8","content_hash":"02e00868aecbd17486f988a5927a68a07bc309978b33568361559a182eadb2cc","title":"Test auto-start in fred","description":"","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-30T17:46:16.668088-07:00","updated_at":"2025-10-31T12:00:43.185723-07:00","closed_at":"2025-10-31T12:00:43.185723-07:00"} {"id":"bd-4ff2","content_hash":"c245bd7fec00b7a899ace53a6f7f518252c93692fd2b74e5adf2a8b1c90f87b5","title":"Fix CI failures before 0.21.3 release","description":"CI is failing on multiple jobs:\n1. Nix flake: Tests fail due to missing git in build environment\n2. Windows tests: Need to check what's failing\n3. Linux tests: Need to check what's failing\n4. Linter errors: Many unchecked errors need fixing\n\nNeed to fix before tagging v0.21.3 release.","notes":"Fixed linter errors (errcheck, misspell), Nix flake git dependency, and import database discovery bug. Tests still failing - need to investigate further.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-11-01T23:52:09.244763-07:00","updated_at":"2025-11-02T12:32:23.45363-08:00","closed_at":"2025-11-02T12:32:23.45363-08:00"} {"id":"bd-502e","content_hash":"6580746d23abefb53c930801cea2cfbfdf323651a39e616ef667ae0d205acff8","title":"Add comprehensive tests for sync branch daemon logic","description":"The daemon sync branch functionality (bd-6545) was implemented but needs proper end-to-end testing.\n\nCurrent implementation:\n- daemon_sync_branch.go has syncBranchCommitAndPush() and syncBranchPull()\n- daemon_sync.go has been updated to use these functions when sync.branch is configured\n- All daemon tests pass, but no specific tests for sync branch behavior\n\nTesting needed:\n- Test that daemon commits to sync branch when sync.branch is configured\n- Test that daemon commits to current branch when sync.branch is NOT configured (backward compatibility)\n- Test that daemon pulls from sync branch and syncs JSONL back to main repo\n- Test worktree creation and health checks during daemon operations\n- Test error handling (missing branch, worktree corruption, etc.)\n\nKey challenge: Tests need to run in the context of the git repo (getGitRoot() uses current working directory), so test setup needs to properly change directory or mock the git root detection.\n\nReference existing daemon tests in daemon_test.go and daemon_autoimport_test.go for patterns.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-02T15:59:13.341491-08:00","updated_at":"2025-11-02T16:39:53.278313-08:00","closed_at":"2025-11-02T16:39:53.278313-08:00","dependencies":[{"issue_id":"bd-502e","depends_on_id":"bd-6545","type":"parent-child","created_at":"2025-11-02T15:59:13.342331-08:00","created_by":"daemon"}]} @@ -129,11 +130,11 @@ {"id":"bd-81abb639","content_hash":"5af6696b1bbfc76056771aa71ac6f72aaadb72e3fb139c09eb7680b86c9053c8","title":"Investigate jujutsu VCS as potential solution for conflict-free merging","description":"## Context\nCurrent N-way collision resolution struggles with Git line-based merge model. When 5+ clones create issues with same ID, Git merge conflicts require manual resolution, and our collision resolver can fail during convergence rounds.\n\n## Research Question\nCould jujutsu (jj) provide better conflict handling for JSONL files?\n\n## Jujutsu Overview\n- Next-gen VCS built on libgit2\n- Designed to handle conflicts as first-class citizens\n- Supports conflict-free replicated data types (CRDTs) in some scenarios\n- Better handling of concurrent edits\n- Can work with Git repos (compatible with existing infrastructure)\n\n## Investigation Tasks\n1. JSONL Merge Behavior - How does jj handle line-by-line JSONL conflicts?\n2. Integration Feasibility - Can beads use jj as backend while maintaining Git compatibility?\n3. Conflict Resolution Model - Does jj conflict model map to our collision resolution?\n4. Operational Transform Support - Does jj implement operational transforms?\n\n## Deliverables\n1. Technical report on jj merge algorithm for JSONL\n2. Proof-of-concept: 5-clone collision test using jj instead of Git\n3. Performance comparison: Git vs jj for beads workload\n4. Recommendation: Adopt, experiment further, or abandon\n\n## References\n- https://github.com/martinvonz/jj\n- Related to bd-e6d71828, bd-7a2b58fc","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-29T20:02:47.953008-07:00","updated_at":"2025-10-30T17:12:58.19464-07:00","closed_at":"2025-10-29T20:47:52.910985-07:00"} {"id":"bd-833559b3","content_hash":"9082c986207b9df7a7a4dc87a53007849e2b9f6e92f3bea41e22d6a14f1f6f42","title":"bd validate - Comprehensive health check","description":"Run all validation checks in one command.\n\nChecks:\n- Duplicates\n- Orphaned dependencies\n- Test pollution\n- Git conflicts\n\nSupports --fix-all for auto-repair.\n\nDepends on bd-cbed9619.1, bd-0dcea000, bd-2752a7a2, bd-9826b69a.\n\nFiles: cmd/bd/validate.go (new)","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-29T20:02:47.957692-07:00","updated_at":"2025-10-30T17:12:58.219095-07:00"} {"id":"bd-83f0bb64","content_hash":"c7be091ee7e713dd9c8ec0f9a498a9ae12adb09f8b7510a5ec10a815a05322e1","title":"Platform tests: Linux, macOS, Windows","description":"Test event-driven mode on all platforms. Verify inotify (Linux), FSEvents (macOS), ReadDirectoryChangesW (Windows). Test fallback behavior on each.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-29T19:42:29.857419-07:00","updated_at":"2025-10-31T12:00:43.197445-07:00","closed_at":"2025-10-31T12:00:43.197445-07:00"} -{"id":"bd-8507","content_hash":"51fb0926b232fb293c302b859731ce71198e0eb8a037c95bc4ae848c2df41a1d","title":"Publish bd-wasm to npm","description":"Package and publish WASM build to npm. Child of epic bd-44d0.\n\n## Tasks\n- [ ] Optimize WASM bundle (compression)\n- [ ] Create README for npm package\n- [ ] Set up npm publishing workflow\n- [ ] Publish v0.1.0-alpha\n- [ ] Test installation in clean environment\n- [ ] Update beads AGENTS.md with installation instructions\n\n## Package Name\nbd-wasm (or @beads/wasm-cli)","status":"open","priority":0,"issue_type":"task","created_at":"2025-11-02T18:33:31.371535-08:00","updated_at":"2025-11-02T18:33:31.371535-08:00","dependencies":[{"issue_id":"bd-8507","depends_on_id":"bd-197b","type":"blocks","created_at":"2025-11-02T18:33:31.372224-08:00","created_by":"daemon"}]} +{"id":"bd-8507","content_hash":"51fb0926b232fb293c302b859731ce71198e0eb8a037c95bc4ae848c2df41a1d","title":"Publish bd-wasm to npm","description":"Package and publish WASM build to npm. Child of epic bd-44d0.\n\n## Tasks\n- [ ] Optimize WASM bundle (compression)\n- [ ] Create README for npm package\n- [ ] Set up npm publishing workflow\n- [ ] Publish v0.1.0-alpha\n- [ ] Test installation in clean environment\n- [ ] Update beads AGENTS.md with installation instructions\n\n## Package Name\nbd-wasm (or @beads/wasm-cli)","status":"open","priority":0,"issue_type":"task","created_at":"2025-11-02T18:33:31.371535-08:00","updated_at":"2025-11-02T18:33:31.371535-08:00","dependencies":[{"issue_id":"bd-8507","depends_on_id":"bd-197b","type":"blocks","created_at":"2025-11-02T18:33:31.372224-08:00","created_by":"daemon"},{"issue_id":"bd-8507","depends_on_id":"bd-374e","type":"blocks","created_at":"2025-11-02T22:27:56.025207-08:00","created_by":"daemon"}]} {"id":"bd-85487065","content_hash":"637cbd56af122b175ff060b4df050871fe86124c5d883ba7f8a17f2f95479613","title":"Add tests for internal/autoimport package","description":"Currently 0.0% coverage. Need tests for auto-import functionality that detects and imports updated JSONL files.","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-29T14:06:18.154805-07:00","updated_at":"2025-10-30T17:12:58.182987-07:00"} {"id":"bd-879d","content_hash":"2f291ca2adead5ee3fb7fade39c088165b5467780599f9a719dcaebc87455ae3","title":"Test issue 1","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-02T09:44:12.538697729Z","updated_at":"2025-11-02T09:45:20.76214671Z","closed_at":"2025-11-02T09:45:20.76214671Z","dependencies":[{"issue_id":"bd-879d","depends_on_id":"bd-d3e5","type":"discovered-from","created_at":"2025-11-02T09:44:22.103468321Z","created_by":"mrdavidlaing"}]} {"id":"bd-8900f145","content_hash":"4a07f36a9e5d24aaffb092c89e2273cb58f9de357d24eeb01fcde6a4079ba775","title":"Testing event-driven mode!","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-29T15:28:33.564871-07:00","updated_at":"2025-10-30T17:12:58.186325-07:00","closed_at":"2025-10-29T19:12:54.43368-07:00"} -{"id":"bd-8931","content_hash":"2704ca79397fd2db14741b466d18346110d6c054dfdb4d69331941c33227df7c","title":"Daemon gets stuck when auto-import blocked by git conflicts","description":"CRITICAL: The daemon enters a corrupt state that breaks RPC commands when auto-import is triggered but git pull fails due to uncommitted changes.\n\nImpact: This is a data integrity and usability issue that could cause users to lose trust in Beads. The daemon silently fails for certain commands while appearing healthy.\n\nReproduction:\n1. Make local changes to issues (creates uncommitted .beads/beads.jsonl)\n2. Remote has updates (JSONL newer, triggers auto-import)\n3. Daemon tries to pull but fails: 'cannot pull with rebase: You have unstaged changes'\n4. Daemon enters bad state - 'bd show' and other commands return EOF\n5. 'bd list' still works, daemon process is running, no errors logged\n\nTechnical details:\n- Auto-import check runs in handleRequest() before processing RPC commands\n- When import is blocked, it appears to corrupt daemon state\n- Likely: deadlock, unclosed transaction, or storage handle corruption\n- Panic recovery (server_lifecycle_conn.go:183) didn't catch anything - not a panic\n\nRequired fix:\n- Auto-import must not block RPC command execution\n- Handle git pull failures gracefully without corrupting state\n- Consider: skip auto-import if git is dirty, queue import for later, or use separate goroutine\n- Add timeout/circuit breaker for import operations\n- Log clear warnings when auto-import is skipped\n\nWithout this fix, users in collaborative environments will frequently encounter mysterious EOF errors that require daemon restarts.","design":"Options to fix:\n\n1. Skip auto-import when git is dirty (safest, simplest)\n - Check git status before pull\n - Log warning and continue without import\n - User must manually import after cleaning git state\n\n2. Async import with timeout (better UX)\n - Run auto-import in background goroutine\n - Don't block RPC command execution\n - Timeout after 5s, log error if stuck\n - Use sync.Once or similar to prevent concurrent imports\n\n3. Transactional import with rollback\n - Wrap import in database transaction\n - Rollback if git operations fail\n - Ensure storage is never left in bad state\n\nRecommended: Combine #1 and #2\n- Check git status first, skip if dirty\n- If clean, do async import with timeout\n- Add metrics to track import success/failure rates","status":"open","priority":0,"issue_type":"bug","created_at":"2025-11-02T17:15:25.181425-08:00","updated_at":"2025-11-02T17:15:25.181425-08:00","dependencies":[{"issue_id":"bd-8931","depends_on_id":"bd-1048","type":"blocks","created_at":"2025-11-02T17:15:25.181857-08:00","created_by":"stevey"}]} +{"id":"bd-8931","content_hash":"2704ca79397fd2db14741b466d18346110d6c054dfdb4d69331941c33227df7c","title":"Daemon gets stuck when auto-import blocked by git conflicts","description":"CRITICAL: The daemon enters a corrupt state that breaks RPC commands when auto-import is triggered but git pull fails due to uncommitted changes.\n\nImpact: This is a data integrity and usability issue that could cause users to lose trust in Beads. The daemon silently fails for certain commands while appearing healthy.\n\nReproduction:\n1. Make local changes to issues (creates uncommitted .beads/beads.jsonl)\n2. Remote has updates (JSONL newer, triggers auto-import)\n3. Daemon tries to pull but fails: 'cannot pull with rebase: You have unstaged changes'\n4. Daemon enters bad state - 'bd show' and other commands return EOF\n5. 'bd list' still works, daemon process is running, no errors logged\n\nTechnical details:\n- Auto-import check runs in handleRequest() before processing RPC commands\n- When import is blocked, it appears to corrupt daemon state\n- Likely: deadlock, unclosed transaction, or storage handle corruption\n- Panic recovery (server_lifecycle_conn.go:183) didn't catch anything - not a panic\n\nRequired fix:\n- Auto-import must not block RPC command execution\n- Handle git pull failures gracefully without corrupting state\n- Consider: skip auto-import if git is dirty, queue import for later, or use separate goroutine\n- Add timeout/circuit breaker for import operations\n- Log clear warnings when auto-import is skipped\n\nWithout this fix, users in collaborative environments will frequently encounter mysterious EOF errors that require daemon restarts.","design":"Options to fix:\n\n1. Skip auto-import when git is dirty (safest, simplest)\n - Check git status before pull\n - Log warning and continue without import\n - User must manually import after cleaning git state\n\n2. Async import with timeout (better UX)\n - Run auto-import in background goroutine\n - Don't block RPC command execution\n - Timeout after 5s, log error if stuck\n - Use sync.Once or similar to prevent concurrent imports\n\n3. Transactional import with rollback\n - Wrap import in database transaction\n - Rollback if git operations fail\n - Ensure storage is never left in bad state\n\nRecommended: Combine #1 and #2\n- Check git status first, skip if dirty\n- If clean, do async import with timeout\n- Add metrics to track import success/failure rates","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-11-02T17:15:25.181425-08:00","updated_at":"2025-11-02T22:28:03.069444-08:00","closed_at":"2025-11-02T22:28:03.069444-08:00","dependencies":[{"issue_id":"bd-8931","depends_on_id":"bd-1048","type":"blocks","created_at":"2025-11-02T17:15:25.181857-08:00","created_by":"stevey"}]} {"id":"bd-897a","content_hash":"ae488407bf5e71242535f4c35b59b0981d2b8b338d1701f19acba2c8e93049f0","title":"Add UNIQUE constraint on external_ref column","description":"The external_ref column should have a UNIQUE constraint to prevent multiple issues from having the same external reference. This ensures data integrity when syncing from external systems (Jira, GitHub, Linear).\n\nCurrent behavior:\n- Multiple issues can have the same external_ref\n- GetIssueByExternalRef returns first match (non-deterministic with duplicates)\n\nProposed solution:\n- Add UNIQUE constraint to external_ref column\n- Add migration to check for and resolve existing duplicates\n- Update tests to verify constraint enforcement\n\nRelated: bd-1022","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-02T15:31:54.718005-08:00","updated_at":"2025-11-02T16:40:01.020314-08:00","closed_at":"2025-11-02T16:40:01.020314-08:00"} {"id":"bd-89e2","content_hash":"ddf4626e586440f379ff19872eac29941cecb925d0a4aae8a6f9c08c969ca05d","title":"Daemon race condition: stale export overwrites recent DB changes","description":"**Symptom:**\nMerged bd-fc2d into bd-fb05 in ~/src/beads (commit ce4d756), pushed to remote. The ~/src/fred/beads daemon then exported its stale DB state and committed (8cc1bb4), reverting bd-fc2d back to \"open\" status.\n\n**Timeline:**\n1. 21:45:12 - Merge committed from ~/src/beads (ce4d756): bd-fc2d closed\n2. 21:49:42 - Daemon in ~/src/fred/beads exported stale state (8cc1bb4): bd-fc2d open again\n\n**Root cause:**\nThe fred/beads daemon had a stale database (bd-fc2d still open) and didn't auto-import the newer JSONL before exporting. When it exported, it overwrote the merge with its stale state.\n\n**Expected behavior:**\nDaemon should detect that JSONL is newer than its last export and import before exporting.\n\n**Actual behavior:**\nDaemon exported stale DB state, creating a conflicting commit that reverted upstream changes.\n\n**Impact:**\nMulti-workspace setups with daemons can silently lose changes if one daemon has stale state and exports.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-11-01T21:53:07.930819-07:00","updated_at":"2025-11-01T22:01:25.54126-07:00","closed_at":"2025-11-01T22:01:25.54126-07:00"} {"id":"bd-89f89fc0","content_hash":"235c3bdeb45e3069167f81e7b4e798fc98547478bb16df40556100478c5e505a","title":"Remove unreachable RPC methods","description":"Several RPC server and client methods are unreachable and should be removed:\n\nServer methods (internal/rpc/server.go):\n- `Server.GetLastImportTime` (line 2116)\n- `Server.SetLastImportTime` (line 2123)\n- `Server.findJSONLPath` (line 2255)\n\nClient methods (internal/rpc/client.go):\n- `Client.Import` (line 311) - RPC import not used (daemon uses autoimport)\n\nEvidence:\n```bash\ngo run golang.org/x/tools/cmd/deadcode@latest -test ./...\n```\n\nImpact: Removes ~80 LOC of unused RPC code","acceptance_criteria":"- Remove the 4 unreachable methods (~80 LOC total)\n- Verify no callers: `grep -r \"GetLastImportTime\\|SetLastImportTime\\|findJSONLPath\" .`\n- All tests pass: `go test ./internal/rpc/...`\n- Daemon functionality works: test daemon start/stop/operations","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-28T16:20:02.432202-07:00","updated_at":"2025-10-30T17:12:58.222655-07:00"} diff --git a/cmd/bd/dep.go b/cmd/bd/dep.go index e4b2ca79..c4a49600 100644 --- a/cmd/bd/dep.go +++ b/cmd/bd/dep.go @@ -3,6 +3,7 @@ package main import ( "context" + "encoding/json" "fmt" "os" "strings" @@ -38,7 +39,10 @@ var depAddCmd = &cobra.Command{ fmt.Fprintf(os.Stderr, "Error resolving issue ID %s: %v\n", args[0], err) os.Exit(1) } - fromID = string(resp.Data) + if err := json.Unmarshal(resp.Data, &fromID); err != nil { + fmt.Fprintf(os.Stderr, "Error unmarshaling resolved ID: %v\n", err) + os.Exit(1) + } resolveArgs = &rpc.ResolveIDArgs{ID: args[1]} resp, err = daemonClient.ResolveID(resolveArgs) @@ -46,7 +50,10 @@ var depAddCmd = &cobra.Command{ fmt.Fprintf(os.Stderr, "Error resolving dependency ID %s: %v\n", args[1], err) os.Exit(1) } - toID = string(resp.Data) + if err := json.Unmarshal(resp.Data, &toID); err != nil { + fmt.Fprintf(os.Stderr, "Error unmarshaling resolved ID: %v\n", err) + os.Exit(1) + } } else { var err error fromID, err = utils.ResolvePartialID(ctx, store, args[0]) @@ -159,7 +166,10 @@ var depRemoveCmd = &cobra.Command{ fmt.Fprintf(os.Stderr, "Error resolving issue ID %s: %v\n", args[0], err) os.Exit(1) } - fromID = string(resp.Data) + if err := json.Unmarshal(resp.Data, &fromID); err != nil { + fmt.Fprintf(os.Stderr, "Error unmarshaling resolved ID: %v\n", err) + os.Exit(1) + } resolveArgs = &rpc.ResolveIDArgs{ID: args[1]} resp, err = daemonClient.ResolveID(resolveArgs) @@ -167,7 +177,10 @@ var depRemoveCmd = &cobra.Command{ fmt.Fprintf(os.Stderr, "Error resolving dependency ID %s: %v\n", args[1], err) os.Exit(1) } - toID = string(resp.Data) + if err := json.Unmarshal(resp.Data, &toID); err != nil { + fmt.Fprintf(os.Stderr, "Error unmarshaling resolved ID: %v\n", err) + os.Exit(1) + } } else { var err error fromID, err = utils.ResolvePartialID(ctx, store, args[0]) @@ -250,7 +263,10 @@ var depTreeCmd = &cobra.Command{ fmt.Fprintf(os.Stderr, "Error resolving issue ID %s: %v\n", args[0], err) os.Exit(1) } - fullID = string(resp.Data) + if err := json.Unmarshal(resp.Data, &fullID); err != nil { + fmt.Fprintf(os.Stderr, "Error unmarshaling resolved ID: %v\n", err) + os.Exit(1) + } } else { var err error fullID, err = utils.ResolvePartialID(ctx, store, args[0]) diff --git a/cmd/bd/label.go b/cmd/bd/label.go index dc122336..06ee8c2d 100644 --- a/cmd/bd/label.go +++ b/cmd/bd/label.go @@ -83,7 +83,10 @@ var labelAddCmd = &cobra.Command{ fmt.Fprintf(os.Stderr, "Error resolving %s: %v\n", id, err) continue } - fullID = string(resp.Data) + if err := json.Unmarshal(resp.Data, &fullID); err != nil { + fmt.Fprintf(os.Stderr, "Error unmarshaling resolved ID: %v\n", err) + continue + } } else { fullID, err = utils.ResolvePartialID(ctx, store, id) if err != nil { @@ -125,7 +128,10 @@ var labelRemoveCmd = &cobra.Command{ fmt.Fprintf(os.Stderr, "Error resolving %s: %v\n", id, err) continue } - fullID = string(resp.Data) + if err := json.Unmarshal(resp.Data, &fullID); err != nil { + fmt.Fprintf(os.Stderr, "Error unmarshaling resolved ID: %v\n", err) + continue + } } else { fullID, err = utils.ResolvePartialID(ctx, store, id) if err != nil { @@ -162,7 +168,10 @@ var labelListCmd = &cobra.Command{ fmt.Fprintf(os.Stderr, "Error resolving issue ID %s: %v\n", args[0], err) os.Exit(1) } - issueID = string(resp.Data) + if err := json.Unmarshal(resp.Data, &issueID); err != nil { + fmt.Fprintf(os.Stderr, "Error unmarshaling resolved ID: %v\n", err) + os.Exit(1) + } } else { var err error issueID, err = utils.ResolvePartialID(ctx, store, args[0]) diff --git a/cmd/bd/reopen.go b/cmd/bd/reopen.go index cb132b96..672a991e 100644 --- a/cmd/bd/reopen.go +++ b/cmd/bd/reopen.go @@ -30,7 +30,12 @@ This is more explicit than 'bd update --status open' and emits a Reopened event. fmt.Fprintf(os.Stderr, "Error resolving ID %s: %v\n", id, err) os.Exit(1) } - resolvedIDs = append(resolvedIDs, string(resp.Data)) + var resolvedID string + if err := json.Unmarshal(resp.Data, &resolvedID); err != nil { + fmt.Fprintf(os.Stderr, "Error unmarshaling resolved ID: %v\n", err) + os.Exit(1) + } + resolvedIDs = append(resolvedIDs, resolvedID) } } else { var err error diff --git a/cmd/bd/show.go b/cmd/bd/show.go index f36b85c3..b6acc8b7 100644 --- a/cmd/bd/show.go +++ b/cmd/bd/show.go @@ -31,7 +31,12 @@ var showCmd = &cobra.Command{ fmt.Fprintf(os.Stderr, "Error resolving ID %s: %v\n", id, err) os.Exit(1) } - resolvedIDs = append(resolvedIDs, string(resp.Data)) + var resolvedID string + if err := json.Unmarshal(resp.Data, &resolvedID); err != nil { + fmt.Fprintf(os.Stderr, "Error unmarshaling resolved ID: %v\n", err) + os.Exit(1) + } + resolvedIDs = append(resolvedIDs, resolvedID) } } else { // In direct mode, resolve via storage @@ -369,7 +374,12 @@ var updateCmd = &cobra.Command{ fmt.Fprintf(os.Stderr, "Error resolving ID %s: %v\n", id, err) os.Exit(1) } - resolvedIDs = append(resolvedIDs, string(resp.Data)) + var resolvedID string + if err := json.Unmarshal(resp.Data, &resolvedID); err != nil { + fmt.Fprintf(os.Stderr, "Error unmarshaling resolved ID: %v\n", err) + os.Exit(1) + } + resolvedIDs = append(resolvedIDs, resolvedID) } } else { var err error @@ -650,7 +660,12 @@ var closeCmd = &cobra.Command{ fmt.Fprintf(os.Stderr, "Error resolving ID %s: %v\n", id, err) os.Exit(1) } - resolvedIDs = append(resolvedIDs, string(resp.Data)) + var resolvedID string + if err := json.Unmarshal(resp.Data, &resolvedID); err != nil { + fmt.Fprintf(os.Stderr, "Error unmarshaling resolved ID: %v\n", err) + os.Exit(1) + } + resolvedIDs = append(resolvedIDs, resolvedID) } } else { var err error diff --git a/internal/rpc/server_export_import_auto.go b/internal/rpc/server_export_import_auto.go index cccf60bc..da6f5367 100644 --- a/internal/rpc/server_export_import_auto.go +++ b/internal/rpc/server_export_import_auto.go @@ -191,10 +191,8 @@ func (s *Server) checkAndAutoImportIfStale(req *Request) error { // If import is already running, skip and let the request proceed (bd-8931) // This prevents blocking RPC requests when import is in progress if !s.importInProgress.CompareAndSwap(false, true) { - fmt.Fprintf(os.Stderr, "Debug: auto-import already in progress, skipping (bd-1048)\n") return nil } - fmt.Fprintf(os.Stderr, "Debug: acquired import lock, proceeding with auto-import (bd-1048)\n") // Track whether we should release the lock via defer // Set to false if we manually release early to avoid double-release bug @@ -215,23 +213,16 @@ func (s *Server) checkAndAutoImportIfStale(req *Request) error { s.importInProgress.Store(false) shouldDeferRelease = false - if os.Getenv("BD_DEBUG") != "" { - fmt.Fprintf(os.Stderr, "Debug: skipping auto-import, .beads files have uncommitted changes\n") - } fmt.Fprintf(os.Stderr, "Warning: auto-import skipped - .beads files have uncommitted changes. Run 'bd import' manually after committing.\n") return nil } // Double-check staleness after acquiring lock (another goroutine may have imported) - fmt.Fprintf(os.Stderr, "Debug: checking staleness after lock acquisition (bd-1048)\n") isStale, err = autoimport.CheckStaleness(ctx, store, dbPath) if err != nil || !isStale { - fmt.Fprintf(os.Stderr, "Debug: staleness check returned: stale=%v err=%v (bd-1048)\n", isStale, err) return err } - fmt.Fprintf(os.Stderr, "Debug: daemon detected stale JSONL, auto-importing with timeout... (bd-1048)\n") - // Create timeout context for import operation (bd-8931, bd-1048) // This prevents daemon from hanging if import gets stuck // Use shorter timeout (5s) to ensure client doesn't timeout waiting for response diff --git a/internal/rpc/server_issues_epics.go b/internal/rpc/server_issues_epics.go index 4ab77002..71102142 100644 --- a/internal/rpc/server_issues_epics.go +++ b/internal/rpc/server_issues_epics.go @@ -385,6 +385,12 @@ func (s *Server) handleShow(req *Request) Response { Error: fmt.Sprintf("failed to get issue: %v", err), } } + if issue == nil { + return Response{ + Success: false, + Error: fmt.Sprintf("issue not found: %s", showArgs.ID), + } + } // Populate labels, dependencies, and dependents labels, _ := store.GetLabels(ctx, issue.ID) diff --git a/internal/rpc/server_lifecycle_conn.go b/internal/rpc/server_lifecycle_conn.go index 5f1c61c8..2e2210a3 100644 --- a/internal/rpc/server_lifecycle_conn.go +++ b/internal/rpc/server_lifecycle_conn.go @@ -178,9 +178,7 @@ func (s *Server) handleSignals() { } func (s *Server) handleConnection(conn net.Conn) { - fmt.Fprintf(os.Stderr, "Debug: handleConnection started (bd-1048)\n") defer func() { - fmt.Fprintf(os.Stderr, "Debug: handleConnection closing (bd-1048)\n") _ = conn.Close() }() @@ -196,19 +194,15 @@ func (s *Server) handleConnection(conn net.Conn) { writer := bufio.NewWriter(conn) for { - fmt.Fprintf(os.Stderr, "Debug: waiting for request (bd-1048)\n") // Set read deadline for the next request if err := conn.SetReadDeadline(time.Now().Add(s.requestTimeout)); err != nil { - fmt.Fprintf(os.Stderr, "Debug: SetReadDeadline error: %v (bd-1048)\n", err) return } line, err := reader.ReadBytes('\n') if err != nil { - fmt.Fprintf(os.Stderr, "Debug: ReadBytes error: %v (bd-1048)\n", err) return } - fmt.Fprintf(os.Stderr, "Debug: received request line (bd-1048)\n") var req Request if err := json.Unmarshal(line, &req); err != nil { @@ -219,18 +213,14 @@ func (s *Server) handleConnection(conn net.Conn) { s.writeResponse(writer, resp) continue } - fmt.Fprintf(os.Stderr, "Debug: parsed request operation: %s (bd-1048)\n", req.Operation) // Set write deadline for the response if err := conn.SetWriteDeadline(time.Now().Add(s.requestTimeout)); err != nil { - fmt.Fprintf(os.Stderr, "Debug: SetWriteDeadline error: %v (bd-1048)\n", err) return } resp := s.handleRequest(&req) - fmt.Fprintf(os.Stderr, "Debug: handleRequest returned, writing response (bd-1048)\n") s.writeResponse(writer, resp) - fmt.Fprintf(os.Stderr, "Debug: response written (bd-1048)\n") } } diff --git a/internal/rpc/server_routing_validation_diagnostics.go b/internal/rpc/server_routing_validation_diagnostics.go index 847eba0c..0ef192be 100644 --- a/internal/rpc/server_routing_validation_diagnostics.go +++ b/internal/rpc/server_routing_validation_diagnostics.go @@ -103,8 +103,6 @@ func (s *Server) validateDatabaseBinding(req *Request) error { } func (s *Server) handleRequest(req *Request) Response { - fmt.Fprintf(os.Stderr, "Debug: handleRequest called for operation: %s (bd-1048)\n", req.Operation) - // Track request timing start := time.Now() @@ -112,7 +110,6 @@ func (s *Server) handleRequest(req *Request) Response { defer func() { latency := time.Since(start) s.metrics.RecordRequest(req.Operation, latency) - fmt.Fprintf(os.Stderr, "Debug: handleRequest completed for operation: %s in %v (bd-1048)\n", req.Operation, latency) }() // Validate database binding (skip for health/metrics to allow diagnostics)