bd daemon sync: 2026-01-11 22:19:01

This commit is contained in:
beads/refinery
2026-01-11 22:19:01 -08:00
committed by Steve Yegge
parent 39de16cd1c
commit 5e942d4e68

View File

@@ -1405,6 +1405,7 @@
{"id":"bd-k82j1","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T19:44:22.376665-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T19:44:22.442307-08:00","closed_at":"2026-01-11T19:44:22.442307-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true}
{"id":"bd-k92d","title":"Critical: Beads deletes issues during sync (GH#464)","description":"# Findings\n\n## Root Cause 1: git-history-backfill deletes issues during repo ID mismatch\n\n**Location:** internal/importer/importer.go, purgeDeletedIssues()\n\nThe git-history-backfill mechanism checks git history to find deleted issues. When there's a repo ID mismatch (e.g., database from a different clone or after remote URL change), this can incorrectly treat local issues as deleted because they don't exist in the remote's git history.\n\n**Fix Applied:** Added safety guard at lines 971-987 in importer.go that:\n- Checks issue status before deletion via git-history-backfill\n- Prevents deletion of open/in_progress issues\n- Provides clear warning with actionable steps\n- Suggests using --no-git-history flag or bd delete for explicit deletion\n\n## Root Cause 2: Daemon sync race condition overwrites local unpushed changes\n\n**Location:** cmd/bd/daemon_sync.go, performAutoImport()\n\nThe daemon sync's auto-import function pulls from remote without checking for uncommitted local changes. This can overwrite local work that hasn't been pushed yet.\n\n**Fix Applied:** Added warning at lines 565-575 in daemon_sync.go that:\n- Checks for uncommitted changes before pulling\n- Warns user about potential overwrite\n- Suggests running 'bd sync' to commit/push first\n- Continues with pull but user is informed\n\n## Additional Safety Improvements\n\n1. Enhanced repo ID mismatch error message (daemon_sync.go:362-371)\n - Added warning about deletion risk\n - Clarified that mismatch can cause incorrect deletions\n\n2. Safety guard in deletions manifest processing (importer.go:886-902)\n - Prevents deletion of open/in_progress issues in deletions.jsonl\n - Provides diagnostic information\n - Suggests recovery options\n\n3. Updated tests (purge_test.go)\n - Changed test to use closed issue (safe to delete)\n - Verifies safety guard works correctly\n\n## Testing\n\nAll tests pass:\n- go test ./internal/importer/... ✓\n- go build ./cmd/bd/ ✓\n\nThe safety guards now prevent both root causes from deleting active work.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-12-14T23:00:19.36203-08:00","updated_at":"2025-12-14T23:07:43.311616-08:00","closed_at":"2025-12-14T23:07:43.311616-08:00"}
{"id":"bd-k9f1t","title":"Session ended: gt-beads-crew-emma","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-09T14:27:04.672799-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-09T14:27:04.71014-08:00","closed_at":"2026-01-09T14:27:04.71014-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true}
{"id":"bd-k9wf9","title":"Create /pr-list and /ghi-list skills for formatted tabular output","status":"open","priority":2,"issue_type":"task","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T22:19:00.55636-08:00","created_by":"gastown/crew/max","updated_at":"2026-01-11T22:19:00.55636-08:00"}
{"id":"bd-ka761","title":"Gate-based async molecule resume","description":"## Summary\n\nRefactor molecule execution to use gates for async coordination, eliminating spin-wait\nanti-patterns. When a polecat hits a gate step, it exits cleanly. The Deacon patrol\ndiscovers molecules with resolved gates and dispatches new polecats to continue.\n\n## Motivation\n\nThe beads-release formula has a `wait-ci` step that tells agents to poll GitHub Actions\nfor 5-10 minutes. This is wasteful and unreliable. We have gate infrastructure in beads\nbut no integration with molecule execution flow.\n\nDave ran a version bump to 0.46.0 without the release molecule - exactly because agents\ndon't know all the steps when there's no enforced workflow with proper async handling.\n\n## Design\n\n### Gate Steps in Formula Schema\n\n```toml\n[[steps]]\nid = \"wait-ci\"\ngate = \"gh:run\"\ngate_hint = \"release.yml\"\ntimeout = \"30m\"\n```\n\n### Flow\n\n1. `bd mol cook` creates gate beads for gate steps\n2. Polecat reaches gate step → checks if gate closed\n3. If open → `gt done --phase-complete --gate \u003cid\u003e` and exit\n4. Deacon patrol runs `bd gate check` → closes resolved gates\n5. Deacon discovers molecules with closed gates → slings to polecats\n6. New polecat continues from gate step\n\n### Key Principle\n\nDiscovery-based resume, not waiter-based. The molecule state IS the waiter.\nPatrol discovers reality each cycle. Nondeterministic idempotence.\n\n## Components\n\n- **Beads**: Formula parser, mol cook, mol ready --gated\n- **Gas Town**: Deacon patrol step for molecule dispatch\n- **Release formula**: Refactor to use gate step\n\n## References\n\n- Gate infrastructure: cmd/bd/gate.go\n- Current release formula: formulas/beads-release.formula.toml\n- Deacon patrol: mol-deacon-patrol.formula.toml","status":"closed","priority":1,"issue_type":"epic","assignee":"beads/crew/dave","created_at":"2026-01-08T20:53:10.34329-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-08T23:04:08.671651-08:00","closed_at":"2026-01-08T23:04:08.671653-08:00","close_reason":"All 5 child tasks completed: formula parser recognizes gate fields, mol cook creates gate beads, mol ready --gated finds gate-ready molecules, Deacon patrol dispatches them, and beads-release formula refactored to use gate steps"}
{"id":"bd-kazt","title":"Add tests for 3-way merge scenarios","description":"Comprehensive test coverage for merge logic.\n\n**Test cases**:\n- Simple field updates (left vs right)\n- Dependency merging (union + dedup)\n- Timestamp handling (max wins)\n- Deletion detection (deleted in one, modified in other)\n- Conflict generation (incompatible changes)\n- Issue resurrection prevention (bd-hv01 regression test)\n\n**Files**:\n- `internal/merge/merge_test.go`\n- `cmd/bd/merge_test.go`","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-05T18:42:20.472275-08:00","updated_at":"2025-11-06T15:52:41.863426-08:00","closed_at":"2025-11-06T15:52:41.863426-08:00","dependencies":[{"issue_id":"bd-kazt","depends_on_id":"bd-qqvw","type":"parent-child","created_at":"2025-11-05T18:42:28.740517-08:00","created_by":"daemon"},{"issue_id":"bd-kazt","depends_on_id":"bd-oif6","type":"blocks","created_at":"2025-11-05T18:42:35.469582-08:00","created_by":"daemon"}]}
{"id":"bd-kb4g","title":"TestHooksCheckGitHooks failing - version mismatch (0.23.0 vs 0.23.1)","description":"The test is checking embedded hook versions and expecting 0.23.1, but got 0.23.0. This appears to be a version consistency issue that needs investigation.\n\nTest output:\n```\nHook pre-commit version mismatch: got 0.23.0, want 0.23.1\nHook post-merge version mismatch: got 0.23.0, want 0.23.1\nHook pre-push version mismatch: got 0.23.0, want 0.23.1\n```\n\nThis is blocking the landing of GH #274 fix.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-11-09T14:13:14.138537-08:00","updated_at":"2025-11-20T18:54:56.496852-05:00","closed_at":"2025-11-10T10:46:09.94181-08:00"}