bd sync: 2025-12-25 12:42:51

This commit is contained in:
Steve Yegge
2025-12-25 12:42:51 -08:00
parent 09d053233e
commit df3a6bff43

View File

@@ -90,7 +90,7 @@
{"id":"bd-687v","title":"Consider caching external dep resolution results","description":"Each call to GetReadyWork re-checks all external dependencies by:\n1. Querying for external deps in the local database\n2. Opening each external project's database\n3. Querying for closed issues with provides: labels\n\nFor workloads with many external deps or slow external databases, this adds latency on every bd ready call.\n\nPotential optimizations:\n- In-memory TTL cache for external dep status (e.g., 60 second TTL)\n- Store resolved status in a local cache table with timestamp\n- Batch resolution of common project/capability pairs\n\nThis is not urgent - current implementation is correct and performant for typical workloads. Only becomes an issue with many external deps across many projects.","status":"deferred","priority":3,"issue_type":"task","created_at":"2025-12-21T23:45:16.360877-08:00","updated_at":"2025-12-23T12:27:02.223409-08:00","dependencies":[{"issue_id":"bd-687v","depends_on_id":"bd-zmmy","type":"discovered-from","created_at":"2025-12-21T23:45:16.361493-08:00","created_by":"daemon"}]}
{"id":"bd-68bf","title":"Code review: bd mol bond implementation","description":"Review the mol bond command implementation before shipping.\n\nFocus areas:\n1. runMolBond() - polymorphic dispatch logic correctness\n2. bondProtoProto() - compound proto creation, dependency wiring\n3. bondProtoMol() / bondMolProto() - spawn and attach logic\n4. bondMolMol() - joining molecules, lineage tracking\n5. BondRef usage - is lineage tracked correctly?\n6. Error handling - are all failure modes covered?\n7. Edge cases - what could go wrong?\n\nFile: cmd/bd/mol.go (lines 485-859)\nCommit: 386b513e","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-21T10:13:09.425229-08:00","updated_at":"2025-12-21T11:18:14.206869-08:00","closed_at":"2025-12-21T11:18:14.206869-08:00","close_reason":"Reviewed and fixed label persistence bug","dependencies":[{"issue_id":"bd-68bf","depends_on_id":"bd-o91r","type":"discovered-from","created_at":"2025-12-21T10:13:09.426471-08:00","created_by":"daemon"}]}
{"id":"bd-68e4","title":"doctor --fix should export when DB has more issues than JSONL","description":"When 'bd doctor' detects a count mismatch (DB has more issues than JSONL), it currently recommends 'bd sync --import-only', which imports JSONL into DB. But JSONL is the source of truth, not the DB.\n\n**Current behavior:**\n- Doctor detects: DB has 355 issues, JSONL has 292\n- Recommends: 'bd sync --import-only' \n- User runs it: Returns '0 created, 0 updated' (no-op, because JSONL hasn't changed)\n- User is stuck\n\n**Root cause:**\nThe doctor fix is one-directional (JSONL→DB) when it should be bidirectional. If DB has MORE issues, they haven't been exported yet - the fix should be 'bd export' (DB→JSONL), not import.\n\n**Desired fix:**\nIn fix.DBJSONLSync(), detect which has more data:\n- If DB \u003e JSONL: Run 'bd export' to sync JSONL (since DB is the working copy)\n- If JSONL \u003e DB: Run 'bd sync --import-only' to import (JSONL is source of truth)\n- If equal but timestamps differ: Detect based on file mtime\n\nThis makes 'bd doctor --fix' actually fix the problem instead of being a no-op.","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-12-21T11:17:20.994319182-07:00","updated_at":"2025-12-21T11:23:24.38523731-07:00","closed_at":"2025-12-21T11:23:24.38523731-07:00"}
{"id":"bd-6a5z","title":"Add stale molecule check to bd doctor","description":"Extend bd doctor to detect stale molecules.\n\n**New check:**\n- Name: 'Stale Molecules'\n- Category: Workflow\n- Severity: Warning (don't fail overall check)\n\n**Detection:**\nReuse logic from bd mol stale command:\n- Find mols where Completed \u003e= Total but root is open\n- Filter to orphaned (not assigned, not pinned)\n- Extra weight if blocking other work\n\n**Output:**\n```\n⚠ Stale Molecules\n Found 2 complete-but-unclosed molecules:\n - bd-xyz: Version bump v0.36.0 (blocking 1 issue)\n - bd-uvw: Old patrol (not blocking)\n Fix: bd close \u003cid\u003e or bd mol squash \u003cid\u003e\n```\n\n**--fix behavior:**\n- Auto-close stale mols (with reason 'Auto-closed by bd doctor')\n- Or prompt interactively with -i flag\n\nDepends on: bd mol stale command","status":"in_progress","priority":3,"issue_type":"task","created_at":"2025-12-24T18:23:24.549941-08:00","updated_at":"2025-12-25T12:37:15.966682-08:00","dependencies":[{"issue_id":"bd-6a5z","depends_on_id":"bd-anv2","type":"blocks","created_at":"2025-12-24T18:23:48.682552-08:00","created_by":"daemon"}]}
{"id":"bd-6a5z","title":"Add stale molecule check to bd doctor","description":"Extend bd doctor to detect stale molecules.\n\n**New check:**\n- Name: 'Stale Molecules'\n- Category: Workflow\n- Severity: Warning (don't fail overall check)\n\n**Detection:**\nReuse logic from bd mol stale command:\n- Find mols where Completed \u003e= Total but root is open\n- Filter to orphaned (not assigned, not pinned)\n- Extra weight if blocking other work\n\n**Output:**\n```\n⚠ Stale Molecules\n Found 2 complete-but-unclosed molecules:\n - bd-xyz: Version bump v0.36.0 (blocking 1 issue)\n - bd-uvw: Old patrol (not blocking)\n Fix: bd close \u003cid\u003e or bd mol squash \u003cid\u003e\n```\n\n**--fix behavior:**\n- Auto-close stale mols (with reason 'Auto-closed by bd doctor')\n- Or prompt interactively with -i flag\n\nDepends on: bd mol stale command","status":"closed","priority":3,"issue_type":"task","created_at":"2025-12-24T18:23:24.549941-08:00","updated_at":"2025-12-25T12:42:50.288442-08:00","closed_at":"2025-12-25T12:42:50.288442-08:00","close_reason":"Implemented stale molecules check in bd doctor","dependencies":[{"issue_id":"bd-6a5z","depends_on_id":"bd-anv2","type":"blocks","created_at":"2025-12-24T18:23:48.682552-08:00","created_by":"daemon"}]}
{"id":"bd-6fe4622f","title":"Remove unreachable utility functions","description":"Several small utility functions are unreachable:\n\nFiles to clean:\n1. `internal/storage/sqlite/hash.go` - `computeIssueContentHash` (line 17)\n - Check if entire file can be deleted if only contains this function\n\n2. `internal/config/config.go` - `FileUsed` (line 151)\n - Delete unused config helper\n\n3. `cmd/bd/git_sync_test.go` - `verifyIssueOpen` (line 300)\n - Delete dead test helper\n\n4. `internal/compact/haiku.go` - `HaikuClient.SummarizeTier2` (line 81)\n - Tier 2 summarization not implemented\n - Options: implement feature OR delete method\n\nImpact: Removes 50-100 LOC depending on decisions","status":"tombstone","priority":2,"issue_type":"task","created_at":"2025-10-28T16:20:02.434573-07:00","updated_at":"2025-12-25T01:21:01.952723-08:00","close_reason":"Closed","deleted_at":"2025-12-25T01:21:01.952723-08:00","deleted_by":"batch delete","delete_reason":"batch delete","original_type":"task"}
{"id":"bd-6gd","title":"Remove legacy MCP Agent Mail integration","description":"## Summary\n\nRemove the legacy MCP Agent Mail system that requires an external HTTP server. Keep the native `bd mail` system which stores messages as git-synced issues.\n\n## Background\n\nTwo mail systems exist in the codebase:\n1. **Legacy Agent Mail** (`bd message`) - External server dependency, complex setup\n2. **Native bd mail** (`bd mail`) - Built-in, git-synced, no dependencies\n\nThe legacy system causes confusion and is no longer needed. Gas Town's Town Mail will use the native `bd mail` system.\n\n## Files to Delete\n\n### CLI Command\n- [ ] `cmd/bd/message.go` - The `bd message` command implementation\n\n### MCP Integration\n- [ ] `integrations/beads-mcp/src/beads_mcp/mail.py` - HTTP wrapper for Agent Mail server\n- [ ] `integrations/beads-mcp/src/beads_mcp/mail_tools.py` - MCP tool definitions\n- [ ] `integrations/beads-mcp/tests/test_mail.py` - Tests for legacy mail\n\n### Documentation\n- [ ] `docs/AGENT_MAIL.md`\n- [ ] `docs/AGENT_MAIL_QUICKSTART.md`\n- [ ] `docs/AGENT_MAIL_DEPLOYMENT.md`\n- [ ] `docs/AGENT_MAIL_MULTI_WORKSPACE_SETUP.md`\n- [ ] `docs/adr/002-agent-mail-integration.md`\n\n## Code to Update\n\n- [ ] Remove `message` command registration from `cmd/bd/main.go`\n- [ ] Remove mail tool imports/registration from MCP server `__init__.py` or `server.py`\n- [ ] Check for any other references to Agent Mail in the codebase\n\n## Verification\n\n- [ ] `bd message` command no longer exists\n- [ ] `bd mail` command still works\n- [ ] MCP server starts without errors\n- [ ] Tests pass\n","status":"tombstone","priority":1,"issue_type":"task","created_at":"2025-12-17T23:04:04.099935-08:00","updated_at":"2025-12-25T01:21:01.952723-08:00","close_reason":"Removed legacy MCP Agent Mail integration. Kept native bd mail system.","deleted_at":"2025-12-25T01:21:01.952723-08:00","deleted_by":"batch delete","delete_reason":"batch delete","original_type":"task"}
{"id":"bd-6ns7","title":"test hook pin","status":"tombstone","priority":2,"issue_type":"task","assignee":"stevey","created_at":"2025-12-23T04:39:16.619755-08:00","updated_at":"2025-12-23T04:51:29.436788-08:00","deleted_at":"2025-12-23T04:51:29.436788-08:00","deleted_by":"daemon","delete_reason":"delete","original_type":"task"}
@@ -253,7 +253,7 @@
{"id":"bd-f616","title":"Digest: Version Bump: test-squash","description":"## Molecule Execution Summary\n\n**Molecule**: Version Bump: test-squash\n**Steps**: 8\n\n**Completed**: 0/8\n\n---\n\n### Steps\n\n1. **[open]** Verify release artifacts\n Check GitHub releases page - binaries for darwin/linux/windows should be available\n\n2. **[open]** Commit and push release\n git add -A \u0026\u0026 git commit \u0026\u0026 git push to trigger CI\n\n3. **[open]** Update CHANGELOG.md with release notes\n Add meaningful release notes to CHANGELOG.md describing what changed in test-squash\n\n4. **[open]** Wait for CI to pass\n Monitor GitHub Actions - all checks must pass before release artifacts are built\n\n5. **[open]** Restart running daemons\n Kill and restart any running bd daemons to pick up new version: pkill -f 'bd daemon' \u0026\u0026 bd daemon --start\n\n6. **[open]** Update local installation\n Run install script or brew upgrade to get new version locally: curl -fsSL .../install.sh | bash\n\n7. **[open]** Run bump-version.sh test-squash\n Run ./scripts/bump-version.sh test-squash to update version in all files\n\n8. **[open]** Update info.go versionChanges\n Add entry to versionChanges in cmd/bd/info.go with agent-actionable changes for test-squash\n\n","status":"tombstone","priority":1,"issue_type":"task","created_at":"2025-12-21T13:53:18.471919-08:00","updated_at":"2025-12-21T13:53:35.256043-08:00","close_reason":"Squashed from 8 ephemeral steps","deleted_at":"2025-12-21T13:53:35.256043-08:00","deleted_by":"stevey","delete_reason":"manual delete","original_type":"task"}
{"id":"bd-f7p1","title":"Add tests for mol spawn --attach","description":"Code review (bd-obep) found no tests for the spawn --attach functionality.\n\n**Test cases needed:**\n1. Basic attach - spawn proto with one --attach\n2. Multiple attachments - spawn with --attach A --attach B\n3. Attach types - verify sequential vs parallel bonding\n4. Error case: attaching non-proto (missing template label)\n5. Variable aggregation - vars from primary + attachments combined\n6. Dry-run output includes attachment info\n\n**Implementation notes:**\n- Tests should use in-memory storage\n- Create test protos, spawn with attachments, verify dependency structure\n- Check that sequential uses 'blocks' type, parallel uses 'parent-child'","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-21T10:58:16.766461-08:00","updated_at":"2025-12-21T21:33:12.136215-08:00","closed_at":"2025-12-21T21:33:12.136215-08:00","close_reason":"Added 6 tests for mol spawn --attach: basic attach, multiple attachments, sequential/parallel bond types, non-proto validation, variable aggregation, and dry-run output","dependencies":[{"issue_id":"bd-f7p1","depends_on_id":"bd-obep","type":"discovered-from","created_at":"2025-12-21T10:58:16.767616-08:00","created_by":"daemon"}]}
{"id":"bd-fcl1","title":"Merge: bd-au0.5","description":"branch: polecat/Searcher\ntarget: main\nsource_issue: bd-au0.5\nrig: beads","status":"closed","priority":1,"issue_type":"merge-request","created_at":"2025-12-23T13:39:11.946667-08:00","updated_at":"2025-12-23T19:12:08.346454-08:00","closed_at":"2025-12-23T19:12:08.346454-08:00","close_reason":"Stale merge-requests from orphaned polecat branches - refinery not processing"}
{"id":"bd-fej5","title":"bd hook: detect agent from cwd instead of defaulting to $USER","description":"**Problem:**\n`bd hook` without `--agent` defaults to `$USER` (e.g., \"stevey\") instead of detecting the agent identity from the current working directory.\n\n**Expected behavior:**\nWhen running from `/Users/stevey/gt/beads/crew/dave`, the agent should be detected as `beads/crew/dave`.\n\n**Current behavior:**\n```bash\n$ pwd\n/Users/stevey/gt/beads/crew/dave\n$ bd hook\nHook: stevey\n (empty)\n\n$ bd hook --agent beads/crew/dave\nHook: beads/crew/dave\n 📌 bd-hobo (mol) - open\n```\n\n**Fix:**\nbd hook should use the same cwd-based agent detection that other commands use (similar to how `gt mail` determines identity from cwd).","status":"open","priority":2,"issue_type":"bug","created_at":"2025-12-24T20:01:27.613892-08:00","updated_at":"2025-12-24T20:01:27.613892-08:00"}
{"id":"bd-fej5","title":"bd hook: detect agent from cwd instead of defaulting to $USER","description":"**Problem:**\n`bd hook` without `--agent` defaults to `$USER` (e.g., \"stevey\") instead of detecting the agent identity from the current working directory.\n\n**Expected behavior:**\nWhen running from `/Users/stevey/gt/beads/crew/dave`, the agent should be detected as `beads/crew/dave`.\n\n**Current behavior:**\n```bash\n$ pwd\n/Users/stevey/gt/beads/crew/dave\n$ bd hook\nHook: stevey\n (empty)\n\n$ bd hook --agent beads/crew/dave\nHook: beads/crew/dave\n 📌 bd-hobo (mol) - open\n```\n\n**Fix:**\nbd hook should use the same cwd-based agent detection that other commands use (similar to how `gt mail` determines identity from cwd).","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-12-24T20:01:27.613892-08:00","updated_at":"2025-12-25T12:41:10.65257-08:00","closed_at":"2025-12-25T12:41:10.65257-08:00","close_reason":"Obsolete: fix belongs in gastown - gt should set BD_ACTOR env var when spawning agents. bd already checks BD_ACTOR."}
{"id":"bd-ffjt","title":"Unify template.go and mol.go under bd mol","description":"Consolidate the two DAG-template systems into one under the mol command. mol.go (on rictus branch) has the right UX (catalog/show/bond), template.go has the mechanics. Merge them, deprecate bd template commands.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-20T23:52:13.208972-08:00","updated_at":"2025-12-21T00:01:59.283765-08:00","closed_at":"2025-12-21T00:01:59.283765-08:00","close_reason":"Implemented mol commands with deprecation for template commands"}
{"id":"bd-fgw3","title":"Update local installation","description":"Run install script or brew upgrade to get new version locally: curl -fsSL .../install.sh | bash","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-19T22:56:05.052016-08:00","updated_at":"2025-12-20T00:49:51.928221-08:00","closed_at":"2025-12-20T00:25:52.805029-08:00","dependencies":[{"issue_id":"bd-fgw3","depends_on_id":"bd-6s61","type":"parent-child","created_at":"2025-12-19T22:56:15.248427-08:00","created_by":"daemon"},{"issue_id":"bd-fgw3","depends_on_id":"bd-si4g","type":"blocks","created_at":"2025-12-19T22:56:23.497325-08:00","created_by":"daemon"}]}
{"id":"bd-fi05","title":"bd sync fails with orphaned issues and duplicate ID conflict","description":"After fixing the deleted_at TEXT column scanning bug (commit 18b1eb2), bd sync still fails with two issues:\n\n1. Orphan Detection Warning: 12 orphaned child issues whose parents no longer exist (bd-cb64c226.* and bd-cbed9619.*)\n\n2. Import Failure: UNIQUE constraint failed for bd-360 - this tombstone exists in both DB and JSONL\n\nError: \"Import failed: error creating depth-0 issues: bulk insert issues: failed to insert issue bd-360: sqlite3: constraint failed: UNIQUE constraint failed: issues.id\"\n\nFix options:\n- Delete orphaned child issues with bd delete\n- Resolve bd-360 duplicate (in deletions.jsonl vs tombstone in DB)\n- Reset sync branch: git branch -f beads-sync main \u0026\u0026 git push --force-with-lease origin beads-sync","notes":"Fixed tombstone constraint violation bug. When deleting closed issues, the CHECK constraint (status = 'closed') = (closed_at IS NOT NULL) was violated because CreateTombstone didn't clear closed_at. Fix: set closed_at = NULL in tombstone creation SQL.\n\nThe sync data corruption (orphaned issues in beads-sync branch) requires manual cleanup: reset sync branch with 'git branch -f beads-sync main \u0026\u0026 git push --force-with-lease origin beads-sync'","status":"tombstone","priority":2,"issue_type":"bug","created_at":"2025-12-13T07:14:33.831346-08:00","updated_at":"2025-12-25T01:21:01.952723-08:00","deleted_at":"2025-12-25T01:21:01.952723-08:00","deleted_by":"batch delete","delete_reason":"batch delete","original_type":"bug"}