bd sync: 2025-10-27 20:48:11
This commit is contained in:
@@ -64,7 +64,7 @@
|
||||
{"id":"bd-156","title":"bd create files issues in wrong project when multiple beads databases exist","description":"When working in a directory with a beads database (e.g., /Users/stevey/src/wyvern/.beads/wy.db), bd create can file issues in a different project's database instead of the current directory's database.\n\n## Steps to reproduce:\n1. Have multiple beads projects (e.g., ~/src/wyvern with wy.db, ~/vibecoder with vc.db)\n2. cd ~/src/wyvern\n3. Run bd create --title \"Test\" --type bug\n4. Observe issue created with wrong prefix (e.g., vc-1 instead of wy-1)\n\n## Expected behavior:\nbd create should respect the current working directory and use the beads database in that directory (.beads/ folder).\n\n## Actual behavior:\nbd create appears to use a different project's database, possibly the last accessed or a global default.\n\n## Impact:\nThis can cause issues to be filed in completely wrong projects, polluting unrelated issue trackers.\n\n## Suggested fix:\n- Always check for .beads/ directory in current working directory first\n- Add --project flag to explicitly specify which database to use\n- Show which project/database is being used in command output\n- Add validation/confirmation when creating issues if current directory doesn't match database project","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-10-26T17:02:30.578817-07:00","updated_at":"2025-10-26T17:08:43.009159-07:00","closed_at":"2025-10-26T17:08:43.009159-07:00","labels":["cli","project-context"]}
|
||||
{"id":"bd-157","title":"Implement \"bd daemons health\" subcommand","description":"Add health check command that pings each daemon and reports responsiveness. Should detect and report stale sockets, version mismatches, unresponsive daemons.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-26T17:09:51.138682-07:00","updated_at":"2025-10-26T17:47:47.958834-07:00","closed_at":"2025-10-26T17:47:47.958834-07:00","dependencies":[{"issue_id":"bd-157","depends_on_id":"bd-145","type":"parent-child","created_at":"2025-10-26T17:09:51.140111-07:00","created_by":"daemon"}]}
|
||||
{"id":"bd-158","title":"Implement \"bd daemons list\" subcommand","description":"Create the \"bd daemons list\" command that displays all running daemons in a table with: workspace path, PID, version, socket path, uptime, last activity, exclusive lock status. Include --json flag.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-26T17:09:51.140442-07:00","updated_at":"2025-10-26T17:47:47.929666-07:00","closed_at":"2025-10-26T17:47:47.929666-07:00","dependencies":[{"issue_id":"bd-158","depends_on_id":"bd-145","type":"parent-child","created_at":"2025-10-26T17:09:51.150077-07:00","created_by":"daemon"}]}
|
||||
{"id":"bd-159","title":"Timestamp-only changes still being exported despite dedup logic","description":"User observed timestamp-only changes in .beads/beads.jsonl causing dirty working tree. Example: bd-128's updated_at changed from 2025-10-25T23:51:09.811006-07:00 to 2025-10-26T14:12:45.207573-07:00 with no other field changes.\n\nThis should have been prevented by the export deduplication logic that's supposed to skip timestamp-only updates.\n\nNeed to investigate why timestamp-only changes are still being exported and fix the dedup logic.","status":"open","priority":1,"issue_type":"bug","created_at":"2025-10-26T17:58:15.41007-07:00","updated_at":"2025-10-26T17:58:15.41007-07:00"}
|
||||
{"id":"bd-159","title":"Timestamp-only changes still being exported despite dedup logic","description":"User observed timestamp-only changes in .beads/beads.jsonl causing dirty working tree. Example: bd-128's updated_at changed from 2025-10-25T23:51:09.811006-07:00 to 2025-10-26T14:12:45.207573-07:00 with no other field changes.\n\nThis should have been prevented by the export deduplication logic that's supposed to skip timestamp-only updates.\n\nNeed to investigate why timestamp-only changes are still being exported and fix the dedup logic.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-26T17:58:15.41007-07:00","updated_at":"2025-10-27T20:17:24.88576-07:00","closed_at":"2025-10-27T20:17:24.88576-07:00"}
|
||||
{"id":"bd-16","title":"Add lifecycle safety docs and tests for UnderlyingDB() method","description":"The new UnderlyingDB() method exposes the raw *sql.DB connection for extensions like VC to create their own tables. While database/sql is concurrency-safe, there are lifecycle and misuse risks that need documentation and testing.\n\n**What needs to be done:**\n\n1. **Enhanced documentation** - Expand UnderlyingDB() comments to warn:\n - Callers MUST NOT call Close() on returned DB\n - Do NOT change pool/driver settings (SetMaxOpenConns, SetConnMaxIdleTime)\n - Do NOT modify SQLite PRAGMAs (WAL mode, journal, etc.)\n - Expect errors after Storage.Close() - use contexts\n - Keep write transactions short to avoid blocking core storage\n\n2. **Add lifecycle tracking** - Implement closed flag:\n - Add atomic.Bool closed field to SQLiteStorage\n - Set flag in Close(), clear in New()\n - Optional: Add IsClosed() bool method\n\n3. **Add safety tests** (run with -race):\n - TestUnderlyingDB_ConcurrentAccess - N goroutines using UnderlyingDB() during normal storage ops\n - TestUnderlyingDB_AfterClose - Verify operations fail cleanly after storage closed\n - TestUnderlyingDB_CreateExtensionTables - Create VC table with FK to issues, verify FK enforcement\n - TestUnderlyingDB_LongTxDoesNotCorrupt - Ensure long read tx doesn't block writes indefinitely\n\n**Why this matters:**\nVC will use this to create tables in the same database. Need to ensure production-ready safety without over-engineering.\n\n**Estimated effort:** S+S+S = M total (1-3h)","design":"Oracle recommends \"simple path\": enhanced docs + minimal guardrails + focused tests. See oracle output for detailed rationale on concurrency safety, lifecycle risks, and when to consider advanced path (wrapping interface).","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-22T17:07:56.812983-07:00","updated_at":"2025-10-25T23:15:33.476053-07:00","closed_at":"2025-10-22T20:10:52.636372-07:00"}
|
||||
{"id":"bd-160","title":"Add database schema versioning","description":"Store beads version in SQLite database for version compatibility checking.\n\nImplementation:\n- Add metadata table with schema_version field (or use PRAGMA user_version)\n- Set on database creation (bd init)\n- Daemon validates on startup: schema version matches daemon version\n- Fail with clear error if mismatch: \"Database schema v0.17.5 but daemon is v0.18.0\"\n- Provide migration guidance in error message\n\nSchema version format:\n- Use semver (0.17.5)\n- Store in metadata table: CREATE TABLE metadata (key TEXT PRIMARY KEY, value TEXT)\n- Alternative: PRAGMA user_version (integer only)\n\nBenefits:\n- Detect version mismatches before corruption\n- Enable auto-migration in future\n- Clear error messages for users","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-26T19:41:11.098628-07:00","updated_at":"2025-10-26T19:41:11.115761-07:00","closed_at":"2025-10-26T19:04:07.843634-07:00","dependencies":[{"issue_id":"bd-160","depends_on_id":"bd-159","type":"parent-child","created_at":"2025-10-26T18:06:07.569191-07:00","created_by":"daemon"}]}
|
||||
{"id":"bd-161","title":"Update AGENTS.md and README.md with \"bd daemons\" documentation","description":"Document the new \"bd daemons\" command and all subcommands in AGENTS.md and README.md. Include examples and troubleshooting guidance.","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-26T19:41:11.099254-07:00","updated_at":"2025-10-26T19:41:11.099254-07:00","dependencies":[{"issue_id":"bd-161","depends_on_id":"bd-159","type":"parent-child","created_at":"2025-10-26T18:06:07.570687-07:00","created_by":"daemon"}]}
|
||||
@@ -118,9 +118,9 @@
|
||||
{"id":"bd-204","title":"Update LINTING.md with current baseline","description":"After cleanup, document the remaining acceptable baseline in LINTING.md so we can track regression.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-27T18:53:14.531787-07:00","updated_at":"2025-10-27T18:53:14.531787-07:00","closed_at":"2025-10-27T18:37:08.880971-07:00"}
|
||||
{"id":"bd-205","title":"Update LINTING.md with current baseline","description":"After cleanup, document the remaining acceptable baseline in LINTING.md so we can track regression.","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-27T18:53:14.532297-07:00","updated_at":"2025-10-27T18:53:14.532297-07:00"}
|
||||
{"id":"bd-206","title":"Import fails when updating open issue to closed without setting closed_at","description":"When importing JSONL, if an issue exists in the database as \"open\" but the JSONL has it as \"closed\", the import tries to UPDATE status to \"closed\" without setting the closed_at timestamp. This violates the CHECK constraint: (status = 'closed') = (closed_at IS NOT NULL).\n\n**Steps to reproduce:**\n1. Have issue bd-X in database with status=\"open\", closed_at=NULL\n2. JSONL has same issue with status=\"closed\", closed_at=\"2025-10-27T...\"\n3. Run bd import -i .beads/beads.jsonl --resolve-collisions\n4. Error: \"constraint failed: CHECK constraint failed: (status = 'closed') = (closed_at IS NOT NULL) (275)\"\n\n**Expected behavior:**\nImport should update both status AND closed_at when transitioning to closed.\n\n**Actual behavior:**\nImport only updates status field, leaving closed_at=NULL, violating constraint.\n\n**Observed during:**\nSyncing two workspaces where collision resolution remapped bd-45. One workspace had it open, the other had it closed. Import tried to update open→closed but didn't copy closed_at from JSONL.\n\n**Impact:**\n- Prevents successful import when JSONL has closed issues that DB has as open\n- Blocks multi-workspace sync scenarios\n- Forces manual database rebuilds\n\n**Suggested fix:**\nIn import code, when updating an issue, if status changes to \"closed\", ensure closed_at is set from JSONL. Similarly, if status changes from \"closed\" to \"open\", ensure closed_at is cleared.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-27T18:58:42.228957-07:00","updated_at":"2025-10-27T19:06:37.684793-07:00","closed_at":"2025-10-27T19:06:37.684793-07:00"}
|
||||
{"id":"bd-207","title":"Fix remaining test failures - database initialization errors","description":"36 tests in cmd/bd are failing with 'database not initialized: issue_prefix config is missing' errors.\n\nAlready fixed (24 tests):\n- ✅ autoimport_collision_test.go - updated createTestDBWithIssues helper\n- ✅ autostart_test.go - added config.Initialize() call\n- ✅ compact_test.go - added SetConfig calls \n- ✅ compactor_test.go - updated setupTestStorage and createClosedIssue\n- ✅ ready_test.go - using newTestStore helper\n\nStill failing (36 tests in cmd/bd):\n- merge_test.go (TestValidateMerge, TestValidateMergeMultipleSelfReferences, TestPerformMergeIdempotent, TestPerformMergePartialRetry)\n- main_test.go (various auto-import/export tests)\n- dep_test.go (TestDepAdd, TestDepRemove, TestDepTypes, TestDepCycleDetection)\n- export_import_test.go, import_*.go files (various import tests)\n- init_test.go (TestInitWithCustomDBPath)\n- integrity_test.go (TestCheckOrphanedDeps, TestCountDBIssues, TestValidatePreExport)\n\nSolution:\nUpdated test_helpers_test.go with newTestStore(t, dbPath) helper that:\n1. Creates directory structure\n2. Initializes SQLite store\n3. Sets issue_prefix config to 'test'\n4. Auto-cleanup via t.Cleanup()\n\nAll remaining tests need to replace manual sqlite.New() calls with newTestStore(t, dbPath).","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-27T19:36:16.764891-07:00","updated_at":"2025-10-27T19:54:31.429989-07:00","closed_at":"2025-10-27T19:54:31.429989-07:00"}
|
||||
{"id":"bd-208","title":"Timestamp-only changes still being exported despite dedup logic","description":"User observed timestamp-only changes in .beads/beads.jsonl causing dirty working tree. Example: bd-128's updated_at changed from 2025-10-25T23:51:09.811006-07:00 to 2025-10-26T14:12:45.207573-07:00 with no other field changes.\n\nThis should have been prevented by the export deduplication logic that's supposed to skip timestamp-only updates.\n\nNeed to investigate why timestamp-only changes are still being exported and fix the dedup logic.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-27T20:21:42.565266-07:00","updated_at":"2025-10-27T20:21:42.565266-07:00","closed_at":"2025-10-27T20:17:24.88576-07:00"}
|
||||
{"id":"bd-209","title":"Code Health \u0026 Technical Debt Cleanup","description":"Comprehensive codebase cleanup to remove dead code, refactor monolithic files, deduplicate utilities, and improve maintainability. Based on ultrathink code health analysis conducted 2025-10-27.\n\nGoals:\n- Remove ~1,500 LOC of dead/unreachable code\n- Split 2 monolithic files (server.go 2,273 LOC, sqlite.go 2,136 LOC) into focused modules\n- Deduplicate scattered utility functions (normalizeLabels, BD_DEBUG checks)\n- Consolidate test coverage (2,019 LOC of collision tests)\n- Improve code navigation and reduce merge conflicts\n\nImpact: Reduces codebase by ~6-8%, improves maintainability, faster CI/CD\n\nEstimated Effort: 11 days across 4 phases","acceptance_criteria":"- All unreachable code identified by `deadcode` analyzer is removed\n- RPC server split into \u003c500 LOC files with clear responsibilities\n- Duplicate utility functions centralized\n- Test coverage maintained or improved\n- All tests passing\n- Documentation updated","status":"open","priority":2,"issue_type":"epic","created_at":"2025-10-27T20:29:37.837243-07:00","updated_at":"2025-10-27T20:29:37.837243-07:00","labels":["cleanup","epic"]}
|
||||
{"id":"bd-207","title":"Timestamp-only changes still being exported despite dedup logic","description":"User observed timestamp-only changes in .beads/beads.jsonl causing dirty working tree. Example: bd-128's updated_at changed from 2025-10-25T23:51:09.811006-07:00 to 2025-10-26T14:12:45.207573-07:00 with no other field changes.\n\nThis should have been prevented by the export deduplication logic that's supposed to skip timestamp-only updates.\n\nNeed to investigate why timestamp-only changes are still being exported and fix the dedup logic.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-27T20:32:12.154712-07:00","updated_at":"2025-10-27T20:43:08.946027-07:00","closed_at":"2025-10-27T20:43:08.946027-07:00"}
|
||||
{"id":"bd-208","title":"Timestamp-only changes still being exported despite dedup logic","description":"User observed timestamp-only changes in .beads/beads.jsonl causing dirty working tree. Example: bd-128's updated_at changed from 2025-10-25T23:51:09.811006-07:00 to 2025-10-26T14:12:45.207573-07:00 with no other field changes.\n\nThis should have been prevented by the export deduplication logic that's supposed to skip timestamp-only updates.\n\nNeed to investigate why timestamp-only changes are still being exported and fix the dedup logic.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-27T20:39:22.221849-07:00","updated_at":"2025-10-27T20:39:22.236222-07:00","closed_at":"2025-10-27T19:54:31.429989-07:00"}
|
||||
{"id":"bd-209","title":"Code Health \u0026 Technical Debt Cleanup","description":"Comprehensive codebase cleanup to remove dead code, refactor monolithic files, deduplicate utilities, and improve maintainability. Based on ultrathink code health analysis conducted 2025-10-27.\n\nGoals:\n- Remove ~1,500 LOC of dead/unreachable code\n- Split 2 monolithic files (server.go 2,273 LOC, sqlite.go 2,136 LOC) into focused modules\n- Deduplicate scattered utility functions (normalizeLabels, BD_DEBUG checks)\n- Consolidate test coverage (2,019 LOC of collision tests)\n- Improve code navigation and reduce merge conflicts\n\nImpact: Reduces codebase by ~6-8%, improves maintainability, faster CI/CD\n\nEstimated Effort: 11 days across 4 phases","acceptance_criteria":"- All unreachable code identified by `deadcode` analyzer is removed\n- RPC server split into \u003c500 LOC files with clear responsibilities\n- Duplicate utility functions centralized\n- Test coverage maintained or improved\n- All tests passing\n- Documentation updated","status":"open","priority":2,"issue_type":"epic","created_at":"2025-10-27T20:39:22.22227-07:00","updated_at":"2025-10-27T20:39:22.236674-07:00","labels":["cleanup","epic"]}
|
||||
{"id":"bd-21","title":"Fix bd sync prefix mismatch error message suggesting non-existent flag","description":"GH #103: bd sync suggests using --rename-on-import flag that doesn't exist. Need to either implement the flag or fix the error message to suggest the correct workflow.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-10-22T17:54:24.473508-07:00","updated_at":"2025-10-25T23:15:33.481941-07:00","closed_at":"2025-10-22T17:57:46.973029-07:00"}
|
||||
{"id":"bd-210","title":"Delete cmd/bd/import_phases.go - entire file is dead code","description":"The file `cmd/bd/import_phases.go` (377 LOC) contains 7 functions that are all unreachable according to the deadcode analyzer. This appears to be an abandoned import refactoring that was never completed or has been replaced by the current implementation in `import.go`.\n\nUnreachable functions:\n- `getOrCreateStore` (line 15)\n- `handlePrefixMismatch` (line 43)\n- `handleCollisions` (line 87)\n- `upsertIssues` (line 155)\n- `importDependencies` (line 240)\n- `importLabels` (line 281)\n- `importComments` (line 316)\n\nEvidence:\n```bash\ngo run golang.org/x/tools/cmd/deadcode@latest -test ./...\n# Shows all 7 functions as unreachable\n```\n\nNo external callers found via:\n```bash\ngrep -r \"getOrCreateStore\\|handlePrefixMismatch\\|handleCollisions\\|upsertIssues\" cmd/bd/*.go\n# Only matches within import_phases.go itself\n```\n\nImpact: Removes 377 LOC, simplifies import logic","acceptance_criteria":"- Delete `cmd/bd/import_phases.go`\n- Verify all tests still pass: `go test ./cmd/bd/...`\n- Verify import functionality works: test `bd import` command\n- Run deadcode analyzer to confirm no new unreachable code","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-27T20:30:19.931508-07:00","updated_at":"2025-10-27T20:34:54.268126-07:00","closed_at":"2025-10-27T20:34:54.268126-07:00","labels":["cleanup","dead-code","phase-1"],"dependencies":[{"issue_id":"bd-210","depends_on_id":"bd-209","type":"parent-child","created_at":"2025-10-27T20:30:19.933155-07:00","created_by":"daemon"}]}
|
||||
{"id":"bd-211","title":"Remove deprecated rename functions from import_shared.go","description":"The file `cmd/bd/import_shared.go` contains deprecated and unreachable rename functions (~100 LOC) that are no longer used. The active implementation has moved to `internal/importer/importer.go`.\n\nFunctions to remove:\n- `renameImportedIssuePrefixes` (line 262) - wrapper function, unused\n- `renameImportedIssuePrefixesOld` (line 267) - marked Deprecated, 70 LOC\n- `replaceIDReferences` (line 332) - only called by deprecated function\n\nEvidence:\n```bash\ngo run golang.org/x/tools/cmd/deadcode@latest -test ./...\n# Shows these as unreachable\n```\n\nThe actual implementation is in:\n- `internal/importer/importer.go` - `RenameImportedIssuePrefixes`\n\nImpact: Removes ~100 LOC of deprecated code","acceptance_criteria":"- Remove lines 262-340 from `cmd/bd/import_shared.go`\n- Verify no callers exist: `grep -r \"renameImportedIssuePrefixes\\|replaceIDReferences\" cmd/bd/`\n- All tests pass: `go test ./cmd/bd/...`\n- Import with rename works: `bd import --rename-on-import`","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-27T20:30:19.948413-07:00","updated_at":"2025-10-27T20:38:13.769416-07:00","closed_at":"2025-10-27T20:38:13.769416-07:00","labels":["cleanup","dead-code","phase-1"],"dependencies":[{"issue_id":"bd-211","depends_on_id":"bd-209","type":"parent-child","created_at":"2025-10-27T20:30:19.950023-07:00","created_by":"daemon"}]}
|
||||
|
||||
Reference in New Issue
Block a user