bd daemon sync: 2026-01-11 20:37:21

This commit is contained in:
beads/refinery
2026-01-11 20:37:21 -08:00
committed by Steve Yegge
parent ce636d5896
commit b2eb53864e

View File

@@ -1771,6 +1771,7 @@
{"id":"bd-phin","title":"bd wisp create doesn't set Wisp flag on spawned issues","description":"When running 'bd wisp create \u003cproto\u003e', the spawned issues don't have Wisp: true set. They show up in 'bd ready' and get synced to JSONL.\n\nExample: gt-lqc6m and gt-wisp-ry9 are mol-deacon-patrol issues that should be wisps but have wisp: null.\n\nThis causes patrol cycles to pollute the issue database and show up as ready work.","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-12-27T00:34:06.684776-08:00","created_by":"mayor","updated_at":"2025-12-27T14:48:01.774826-08:00","closed_at":"2025-12-27T14:48:01.774826-08:00"}
{"id":"bd-phtv","title":"bd pin: pinned field overwritten by subsequent bd commands","description":"## Summary\n\nThe `bd pin` command correctly sets `pinned=1` in SQLite, but any subsequent `bd` command (including read-only commands like `bd show`) resets `pinned` to 0.\n\n## Reproduction Steps\n\n```bash\nbd --no-daemon pin \u003cissue-id\u003e --for=max\nsqlite3 .beads/beads.db \"SELECT id, pinned FROM issues WHERE id=\\\"\u003cissue-id\u003e\\\"\"\n# Shows pinned=1 ✓\n\nbd --no-daemon show \u003cissue-id\u003e --json\nsqlite3 .beads/beads.db \"SELECT id, pinned FROM issues WHERE id=\\\"\u003cissue-id\u003e\\\"\"\n# Shows pinned=0 ✗ WRONG\n```\n\n## Root Cause Investigation\n\n### Prime Suspects\n\n1. **JSONL import overwrites DB** - The `pinned` field has `omitempty` so false values arent in JSONL. When JSONL is imported, it overwrites the DB pinned=1 with default pinned=0.\n\n2. **Files to check:**\n - `internal/importer/importer.go` - ImportIssue() may unconditionally set all fields\n - `internal/storage/sqlite/issues.go` - UpsertIssue() may not preserve pinned\n - `cmd/bd/main.go` - ensureStoreActive() may trigger import\n\n### Debug Steps\n\n```bash\n# Add debug logging to track what is writing pinned=0\ngrep -rn \"pinned\" internal/storage/sqlite/*.go\ngrep -rn \"Pinned\" internal/importer/*.go\n```\n\n## Likely Fix\n\nIn `internal/importer/importer.go` or `internal/storage/sqlite/issues.go`:\n\n```go\n// When upserting from JSONL, preserve pinned field if already set\nfunc (s *SQLiteStorage) UpsertIssue(ctx context.Context, issue *types.Issue) error {\n // Check if issue exists and is pinned\n existing, _ := s.GetIssue(ctx, issue.ID)\n if existing != nil \u0026\u0026 existing.Pinned \u0026\u0026 !issue.Pinned {\n // Preserve existing pinned status\n issue.Pinned = existing.Pinned\n }\n // ... rest of upsert\n}\n```\n\nOR the import should skip fields that are omitempty and not present in JSONL:\n\n```go\n// In importer, only update fields that are explicitly set in JSONL\n// Pinned with omitempty means absent = dont change, not absent = false\n```\n\n## Testing\n\n```bash\n# After fix:\nbd --no-daemon pin \u003cissue-id\u003e --for=max\nbd --no-daemon show \u003cissue-id\u003e --json # Should not reset pinned\nbd list --pinned # Should show the pinned issue\nbd hook --agent max # Should show pinned work\n```\n\n## Files to Modify\n\n1. **internal/importer/importer.go** - Preserve pinned on import\n2. **internal/storage/sqlite/issues.go** - UpsertIssue preserve pinned\n3. **Add test** in internal/importer/importer_test.go\n\n## Success Criteria\n- `bd pin` survives subsequent bd commands\n- `bd list --pinned` shows pinned issues\n- `bd hook --agent X` shows pinned work\n- Existing tests still pass","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-12-23T12:32:20.046988-08:00","updated_at":"2025-12-23T13:47:49.936021-08:00","closed_at":"2025-12-23T13:47:49.936021-08:00","labels":["export:pinned-field-fix"],"dependencies":[{"issue_id":"bd-phtv","depends_on_id":"bd-iz5t","type":"parent-child","created_at":"2025-12-23T12:44:07.140151-08:00","created_by":"daemon"}]}
{"id":"bd-phwd","title":"Add timeout message for long-running git push operations","description":"When git push hangs waiting for credential/browser auth, show a periodic message to the user instead of appearing frozen. Add timeout messaging after N seconds of inactivity during git operations.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-21T11:44:57.318984535-07:00","updated_at":"2025-12-21T11:46:05.218023559-07:00","closed_at":"2025-12-21T11:46:05.218023559-07:00"}
{"id":"bd-phxh6","title":"Session ended: gt-beads-refinery","status":"closed","priority":2,"issue_type":"event","owner":"steve.yegge@gmail.com","created_at":"2026-01-11T20:37:21.002794-08:00","created_by":"beads/refinery","updated_at":"2026-01-11T20:37:21.067189-08:00","closed_at":"2026-01-11T20:37:21.067189-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true}
{"id":"bd-pi34h","title":"Session ended: gt-beads-witness","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-10T21:03:04.896388-08:00","created_by":"beads/witness","updated_at":"2026-01-10T21:03:04.94166-08:00","closed_at":"2026-01-10T21:03:04.94166-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true}
{"id":"bd-pi8yh","title":"Session ended: gt-beads-crew-fang","status":"closed","priority":2,"issue_type":"event","created_at":"2026-01-09T13:52:05.083333-08:00","created_by":"beads/crew/fang","updated_at":"2026-01-09T13:52:05.119062-08:00","closed_at":"2026-01-09T13:52:05.119062-08:00","close_reason":"auto-closed session cost wisp","ephemeral":true}
{"id":"bd-piywi","title":"Review PR #953: Fix --due/--defer in daemon mode","description":"dispatched_by: beads/crew/emma\n\nReview and verify PR #953 (steveyegge/beads)\n\nPR: https://github.com/steveyegge/beads/pull/953\nAuthor: peterkc\nFixes: #952, #950\n\nFixes daemon mode silently ignoring --due and --defer flags.\n- gh pr view 953 --repo steveyegge/beads\n- gh pr diff 953 --repo steveyegge/beads\n- If good: gh pr merge 953 --repo steveyegge/beads --squash","status":"closed","priority":2,"issue_type":"task","assignee":"beads/crew/wolf","created_at":"2026-01-08T14:30:25.036198-08:00","created_by":"beads/crew/emma","updated_at":"2026-01-08T14:37:01.629172-08:00","closed_at":"2026-01-08T14:37:01.629172-08:00","close_reason":"PR #953 merged. Fixes daemon mode ignoring --due/--defer flags (GH#952, GH#950)."}