|
|
|
|
@@ -22,8 +22,8 @@
|
|
|
|
|
{"id":"bd-29","title":"Remove Daemon Storage Cache","description":"The daemon's multi-repo storage cache is the root cause of stale data bugs. Since global daemon is deprecated, we only ever serve one repository, making the cache unnecessary complexity. This epic removes the cache entirely for simpler, more reliable direct storage access.","design":"For local daemon (single repository), eliminate the cache entirely:\n- Use s.storage field directly (opened at daemon startup)\n- Remove getStorageForRequest() routing logic\n- Remove server_cache_storage.go entirely (~300 lines)\n- Remove cache-related tests\n- Simplify Server struct\n\nBenefits:\n✅ No staleness bugs: Always using live SQLite connection\n✅ Simpler code: Remove ~300 lines of cache management\n✅ Easier debugging: Direct storage access, no cache indirection\n✅ Same performance: Cache was always 1 entry for local daemon anyway","acceptance_criteria":"- Daemon has no storage cache code\n- All tests pass\n- MCP integration works\n- No stale data bugs\n- Documentation updated\n- Performance validated","status":"open","priority":1,"issue_type":"epic","created_at":"2025-10-27T22:55:10.388648-07:00","updated_at":"2025-10-27T22:55:10.388648-07:00"}
|
|
|
|
|
{"id":"bd-3","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-47], 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-27T22:22:23.813745-07:00"}
|
|
|
|
|
{"id":"bd-30","title":"Audit Current Cache Usage","description":"Understand exactly what code depends on the storage cache","acceptance_criteria":"- Document showing all cache dependencies\n- Confirmation that removing cache won't break MCP\n- List of tests that need updating\n\nFiles to examine:\n- internal/rpc/server_cache_storage.go (cache implementation)\n- internal/rpc/client.go (how req.Cwd is set)\n- internal/rpc/server_*.go (all getStorageForRequest calls)\n- integrations/beads-mcp/ (MCP multi-repo logic)\n\nTasks:\n- Document all callers of getStorageForRequest()\n- Verify req.Cwd is only set by RPC client for database discovery\n- Confirm MCP server doesn't rely on multi-repo cache behavior\n- Check if any tests assume multi-repo routing\n- Review environment variables: BEADS_DAEMON_MAX_CACHE_SIZE, BEADS_DAEMON_CACHE_TTL, BEADS_DAEMON_MEMORY_THRESHOLD_MB","notes":"AUDIT COMPLETE\n\ngetStorageForRequest() callers: 17 production + 11 test\n- server_issues_epics.go: 8 calls\n- server_labels_deps_comments.go: 4 calls \n- server_export_import_auto.go: 2 calls\n- server_compact.go: 2 calls\n- server_routing_validation_diagnostics.go: 1 call\n- server_eviction_test.go: 11 calls (DELETE entire file)\n\nPattern everywhere: store, err := s.getStorageForRequest(req) → store := s.storage\n\nreq.Cwd usage: Only for multi-repo routing. Local daemon always serves 1 repo, so routing is unused.\n\nMCP server: Uses separate daemons per repo (no req.Cwd usage found). NOT affected by cache removal.\n\nCache env vars to deprecate:\n- BEADS_DAEMON_MAX_CACHE_SIZE (used in server_core.go:63)\n- BEADS_DAEMON_CACHE_TTL (used in server_core.go:72)\n- BEADS_DAEMON_MEMORY_THRESHOLD_MB (used in server_cache_storage.go:47)\n\nServer struct fields to remove:\n- storageCache, cacheMu, maxCacheSize, cacheTTL, cleanupTicker, cacheHits, cacheMisses\n\nTests to delete:\n- server_eviction_test.go (entire file - 9 tests)\n- limits_test.go cache assertions\n\nSpecial consideration: ValidateDatabase endpoint uses findDatabaseForCwd() outside cache. Verify if used, then remove or inline.\n\nSafe to proceed with removal - cache always had 1 entry in local daemon model.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-27T22:55:19.3723-07:00","updated_at":"2025-10-27T23:04:55.127012-07:00","closed_at":"2025-10-27T23:02:41.30653-07:00","dependencies":[{"issue_id":"bd-30","depends_on_id":"bd-29","type":"parent-child","created_at":"2025-10-27T22:55:19.373816-07:00","created_by":"stevey"}]}
|
|
|
|
|
{"id":"bd-31","title":"Remove Storage Cache from Server Struct","description":"Eliminate cache fields and use s.storage directly","acceptance_criteria":"- Server struct has no cache fields\n- NewServer() doesn't initialize cache\n- Start() doesn't run cache cleanup goroutines\n- Stop() only closes single s.storage\n\nChanges needed:\n- Remove cache-related fields from Server struct in server_core.go\n- Remove cache size/TTL parsing from env vars in NewServer()\n- Remove cleanup ticker goroutine from Start()\n- Remove cache cleanup logic from Stop()","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-27T22:55:25.474412-07:00","updated_at":"2025-10-27T22:55:25.474412-07:00","dependencies":[{"issue_id":"bd-31","depends_on_id":"bd-29","type":"parent-child","created_at":"2025-10-27T22:55:25.475344-07:00","created_by":"stevey"}]}
|
|
|
|
|
{"id":"bd-32","title":"Replace getStorageForRequest with Direct Access","description":"Replace all getStorageForRequest(req) calls with s.storage","acceptance_criteria":"- No references to getStorageForRequest() in codebase (except in deleted file)\n- All handlers use s.storage directly\n- Code compiles without errors\n\nFiles to update:\n- internal/rpc/server_issues_epics.go (~8 calls)\n- internal/rpc/server_labels_deps_comments.go (~4 calls)\n- internal/rpc/server_compact.go (~2 calls)\n- internal/rpc/server_export_import_auto.go (~2 calls)\n- internal/rpc/server_routing_validation_diagnostics.go (~1 call)\n\nPattern: store, err := s.getStorageForRequest(req) → store := s.storage","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-27T22:55:33.196818-07:00","updated_at":"2025-10-27T22:55:33.196818-07:00","dependencies":[{"issue_id":"bd-32","depends_on_id":"bd-29","type":"parent-child","created_at":"2025-10-27T22:55:33.19824-07:00","created_by":"stevey"},{"issue_id":"bd-32","depends_on_id":"bd-31","type":"blocks","created_at":"2025-10-27T22:55:33.198782-07:00","created_by":"stevey"}]}
|
|
|
|
|
{"id":"bd-31","title":"Remove Storage Cache from Server Struct","description":"Eliminate cache fields and use s.storage directly","acceptance_criteria":"- Server struct has no cache fields\n- NewServer() doesn't initialize cache\n- Start() doesn't run cache cleanup goroutines\n- Stop() only closes single s.storage\n\nChanges needed:\n- Remove cache-related fields from Server struct in server_core.go\n- Remove cache size/TTL parsing from env vars in NewServer()\n- Remove cleanup ticker goroutine from Start()\n- Remove cache cleanup logic from Stop()","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-27T22:55:25.474412-07:00","updated_at":"2025-10-27T23:06:57.205442-07:00","closed_at":"2025-10-27T23:06:57.205442-07:00","dependencies":[{"issue_id":"bd-31","depends_on_id":"bd-29","type":"parent-child","created_at":"2025-10-27T22:55:25.475344-07:00","created_by":"stevey"}]}
|
|
|
|
|
{"id":"bd-32","title":"Replace getStorageForRequest with Direct Access","description":"Replace all getStorageForRequest(req) calls with s.storage","acceptance_criteria":"- No references to getStorageForRequest() in codebase (except in deleted file)\n- All handlers use s.storage directly\n- Code compiles without errors\n\nFiles to update:\n- internal/rpc/server_issues_epics.go (~8 calls)\n- internal/rpc/server_labels_deps_comments.go (~4 calls)\n- internal/rpc/server_compact.go (~2 calls)\n- internal/rpc/server_export_import_auto.go (~2 calls)\n- internal/rpc/server_routing_validation_diagnostics.go (~1 call)\n\nPattern: store, err := s.getStorageForRequest(req) → store := s.storage","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-27T22:55:33.196818-07:00","updated_at":"2025-10-27T23:12:20.944306-07:00","closed_at":"2025-10-27T23:12:20.944306-07:00","dependencies":[{"issue_id":"bd-32","depends_on_id":"bd-29","type":"parent-child","created_at":"2025-10-27T22:55:33.19824-07:00","created_by":"stevey"},{"issue_id":"bd-32","depends_on_id":"bd-31","type":"blocks","created_at":"2025-10-27T22:55:33.198782-07:00","created_by":"stevey"}]}
|
|
|
|
|
{"id":"bd-33","title":"Delete server_cache_storage.go","description":"Remove the entire cache implementation file (~286 lines)","acceptance_criteria":"- File deleted from repository\n- No compilation errors\n- No references to deleted functions\n\nFunctions being removed:\n- StorageCacheEntry struct\n- evictStaleStorage() - LRU eviction\n- evictCacheBasedOnMemory() - memory pressure eviction\n- getStorageForRequest() - cache lookup and routing\n- findDatabaseForCwd() - database discovery\n- evictStorageForRequest() - manual eviction","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-27T22:55:38.729299-07:00","updated_at":"2025-10-27T22:55:38.729299-07:00","dependencies":[{"issue_id":"bd-33","depends_on_id":"bd-29","type":"parent-child","created_at":"2025-10-27T22:55:38.730254-07:00","created_by":"stevey"},{"issue_id":"bd-33","depends_on_id":"bd-32","type":"blocks","created_at":"2025-10-27T22:55:38.730747-07:00","created_by":"stevey"}]}
|
|
|
|
|
{"id":"bd-34","title":"Remove Cache-Related Tests","description":"Delete or update tests that assume multi-repo caching","acceptance_criteria":"- server_eviction_test.go deleted\n- limits_test.go updated (no cache assertions)\n- All tests pass: go test ./internal/rpc/...\n\nTests to delete:\n- TestCacheEviction\n- TestMemoryPressureEviction\n- TestMtimeInvalidation\n- TestConcurrentCacheAccess\n- TestSubdirectoryCanonicalization\n- TestManualEviction\n- TestLRUEviction\n\nFiles to update:\n- internal/rpc/server_eviction_test.go (DELETE entire file)\n- internal/rpc/limits_test.go (remove cache assertions)","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-27T22:55:44.511897-07:00","updated_at":"2025-10-27T22:55:44.511897-07:00","dependencies":[{"issue_id":"bd-34","depends_on_id":"bd-29","type":"parent-child","created_at":"2025-10-27T22:55:44.512885-07:00","created_by":"stevey"},{"issue_id":"bd-34","depends_on_id":"bd-32","type":"blocks","created_at":"2025-10-27T22:55:44.51336-07:00","created_by":"stevey"}]}
|
|
|
|
|
{"id":"bd-35","title":"Update Metrics and Health Endpoints","description":"Remove cache-related metrics from health/metrics endpoints","acceptance_criteria":"- bd daemon --health output has no cache fields\n- bd daemon --metrics output has no cache fields\n- No compilation errors\n\nChanges needed:\n- Remove cache_size from health endpoint in server_routing_validation_diagnostics.go\n- Remove cache_size, cache_hits, cache_misses from metrics endpoint\n- Remove CacheHits and CacheMisses fields from internal/rpc/metrics.go","status":"open","priority":1,"issue_type":"task","created_at":"2025-10-27T22:55:49.212047-07:00","updated_at":"2025-10-27T22:55:49.212047-07:00","dependencies":[{"issue_id":"bd-35","depends_on_id":"bd-29","type":"parent-child","created_at":"2025-10-27T22:55:49.213529-07:00","created_by":"stevey"},{"issue_id":"bd-35","depends_on_id":"bd-32","type":"blocks","created_at":"2025-10-27T22:55:49.214149-07:00","created_by":"stevey"}]}
|
|
|
|
|
|