bd sync: 2025-12-24 13:02:54

This commit is contained in:
Steve Yegge
2025-12-24 13:02:54 -08:00
parent b53dbed757
commit 566e4f5225

View File

@@ -348,7 +348,7 @@
{"id":"bd-n777","title":"Timer beads for scheduled agent callbacks","description":"## Problem\n\nAgents frequently need to wait for external events (CI completion, PR reviews, artifact builds) but have no good mechanism:\n- `sleep N` blocks and is unreliable (often times out at 8+ minutes)\n- Polling wastes context and is easy to forget\n- No way to survive session restarts\n\n## Proposal: Timer Beads\n\nA new bead type or field that represents a scheduled callback:\n\n### Creating timers\n```bash\nbd timer create --in 30s --callback \"Check CI run 12345\" --issue bd-xyz\nbd timer create --at \"2025-12-20T08:00:00\" --callback \"Morning standup\"\nbd timer create --in 5m --on-expire \"tmux send-keys -t dave 'bd show bd-xyz'\"\n```\n\n### Timer storage\n- Store in beads (survives restarts)\n- Fields: `expires_at`, `callback_description`, `on_expire_command`, `linked_issue`\n- Status: pending, fired, cancelled\n\n### Deacon integration\nThe Deacon daemon monitors timer beads:\n1. Wakes on next timer expiry\n2. Executes `on_expire` command (e.g., tmux send-keys to interrupt agent)\n3. Marks timer as fired\n4. Optionally updates linked issue\n\n### Use cases\n- CI monitoring: \"ping me when build completes\"\n- PR reviews: \"check back in 1 hour\"\n- Scheduled tasks: \"remind me at EOD to sync\"\n- Blocking waits: agent registers callback instead of sleeping\n\n## Acceptance criteria\n- [ ] Timer bead type or field design\n- [ ] `bd timer create/list/cancel` commands\n- [ ] Deacon timer monitoring loop\n- [ ] tmux integration for agent interrupts\n- [ ] Survives daemon restarts","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-19T23:05:33.051861-08:00","updated_at":"2025-12-21T17:19:48.087482-08:00","closed_at":"2025-12-21T17:19:48.087482-08:00","close_reason":"Will not implement - Gas Town uses a different approach for timed events"}
{"id":"bd-ncwo","title":"Ghost resurrection: remote status:closed wins during git merge","description":"During bd sync, the 3-way git merge sometimes keeps remote's status:closed instead of local's status:tombstone. This causes ghost issues to resurrect even when tombstones exist.\n\nRoot cause: Git 3-way merge doesn't understand tombstone semantics. If base had closed, local changed to tombstone, and remote has closed, git might keep remote's version.\n\nThe early tombstone check in importer.go only prevents CREATION when tombstones exist in DB. But if applyDeletionsFromMerge hard-deletes the tombstones before import runs (because they're not in the merged result), the check doesn't help.\n\nPotential fixes:\n1. Make tombstones 'win' in the beads merge driver (internal/merge/merge.go)\n2. Don't hard-delete tombstones in applyDeletionsFromMerge if they're in the DB\n3. Export tombstones to a separate file that's not subject to merge\n\nGhost issues: bd-cb64c226.*, bd-cbed9619.*","status":"tombstone","priority":1,"issue_type":"bug","created_at":"2025-12-16T22:01:03.56423-08:00","updated_at":"2025-12-17T16:11:17.070763-08:00","deleted_at":"2025-12-17T16:11:17.070763-08:00","deleted_by":"batch delete","delete_reason":"batch delete","original_type":"bug"}
{"id":"bd-ndye","title":"mergeDependencies uses union instead of 3-way merge","description":"## Critical Bug\n\nThe `mergeDependencies` function in internal/merge/merge.go performs a UNION of left and right dependencies instead of a proper 3-way merge. This causes removed dependencies to be resurrected.\n\n### Root Cause\n\n```go\n// Current code (lines 795-816):\nfunc mergeDependencies(left, right []Dependency) []Dependency {\n // Just unions left + right\n // NEVER REMOVES anything\n // Doesn't even look at base!\n}\n```\n\nAnd `mergeIssue` (line 579) doesn't pass `base`:\n```go\nresult.Dependencies = mergeDependencies(left.Dependencies, right.Dependencies)\n```\n\n### Impact\n\nIf:\n- Base has dependency D\n- Left removes D (intentional)\n- Right still has D (stale)\n\nCurrent: D is in result (resurrection!)\nCorrect: Left removed it, D should NOT be in result\n\nThis breaks Gas Town's workflow and data integrity. Closed means closed.\n\n### Fix\n\nChange `mergeDependencies` to take `base` and do proper 3-way merge:\n- If dep was in base and removed by left → exclude (left wins)\n- If dep was in base and removed by right → exclude (right wins)\n- If dep wasn't in base and added by either → include\n- If dep was in base and both still have it → include\n\nKey principle: **REMOVALS ARE AUTHORITATIVE**\n\n### Files to Change\n\n1. internal/merge/merge.go:\n - `mergeDependencies(left, right)` → `mergeDependencies(base, left, right)`\n - `mergeIssue` line 579: pass `base.Dependencies`\n\n### Related\n\nThis also explains why `ProtectLocalExportIDs` in importer is defined but never used - the protection was never actually implemented.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-12-18T23:15:54.475872-08:00","updated_at":"2025-12-18T23:21:10.709571-08:00","closed_at":"2025-12-18T23:21:10.709571-08:00"}
{"id":"bd-nim5","title":"Detect/prevent child→parent dependency anti-pattern","description":"## Problem\n\nWhen filing issues with dependencies, it's easy to fall into the \"temporal trap\":\n- Thinking \"Phase 1 comes before Phase 2\"\n- Writing `bd dep add phase1 phase2`\n- But that means \"phase1 depends on phase2\" (backwards!)\n\nA specific variant: children depending on their parent epic. This is ALWAYS wrong because:\n1. Parent-child relationship already captures the dependency (parent closes when children done)\n2. Child→parent dep creates a block: child can't start because parent is \"open\"\n3. Parent can't close because children aren't done\n4. Deadlock\n\n## Solution\n\n### 1. Prevent at creation (`bd dep add`)\n\nWhen user runs `bd dep add X Y`:\n- Check if X is a child of Y (X.id starts with Y.id + \".\")\n- If so, error: \"Cannot add dependency: X is already a child of Y. Children inherit dependency on parent completion via hierarchy.\"\n\n### 2. Detect in `bd doctor`\n\nAdd a check that finds all cases where:\n- Issue A depends on Issue B\n- A.id matches pattern B.id + \".*\" (A is child of B)\n\nReport as: \"Child→parent dependency detected (anti-pattern)\"\nOffer repair: \"Remove N backwards dependencies? [y/N]\"\n\n## Implementation\n\n- `dep_add.go`: Add parent-child check before adding dependency\n- `doctor.go`: Add backwards-dep detection to health checks\n","status":"open","priority":2,"issue_type":"feature","created_at":"2025-12-24T12:51:15.788796-08:00","updated_at":"2025-12-24T12:51:15.788796-08:00"}
{"id":"bd-nim5","title":"Detect/prevent child→parent dependency anti-pattern","description":"## Problem\n\nWhen filing issues with dependencies, it's easy to fall into the \"temporal trap\":\n- Thinking \"Phase 1 comes before Phase 2\"\n- Writing `bd dep add phase1 phase2`\n- But that means \"phase1 depends on phase2\" (backwards!)\n\nA specific variant: children depending on their parent epic. This is ALWAYS wrong because:\n1. Parent-child relationship already captures the dependency (parent closes when children done)\n2. Child→parent dep creates a block: child can't start because parent is \"open\"\n3. Parent can't close because children aren't done\n4. Deadlock\n\n## Solution\n\n### 1. Prevent at creation (`bd dep add`)\n\nWhen user runs `bd dep add X Y`:\n- Check if X is a child of Y (X.id starts with Y.id + \".\")\n- If so, error: \"Cannot add dependency: X is already a child of Y. Children inherit dependency on parent completion via hierarchy.\"\n\n### 2. Detect in `bd doctor`\n\nAdd a check that finds all cases where:\n- Issue A depends on Issue B\n- A.id matches pattern B.id + \".*\" (A is child of B)\n\nReport as: \"Child→parent dependency detected (anti-pattern)\"\nOffer repair: \"Remove N backwards dependencies? [y/N]\"\n\n## Implementation\n\n- `dep_add.go`: Add parent-child check before adding dependency\n- `doctor.go`: Add backwards-dep detection to health checks\n","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-12-24T12:51:15.788796-08:00","updated_at":"2025-12-24T13:02:44.079093-08:00","closed_at":"2025-12-24T13:02:44.079093-08:00","close_reason":"Implemented child→parent dependency detection and prevention"}
{"id":"bd-nl2","title":"No logging/debugging for tombstone resurrection events","description":"Per the design document bd-zvg Open Question 1: Should resurrection log a warning? Recommendation was Yes. Currently, when an expired tombstone loses to a live issue (resurrection), there is no logging or debugging output. This makes it hard to understand why an issue reappeared. Recommendation: Add optional debug logging when resurrection occurs, e.g., Issue bd-abc resurrected (tombstone expired). Files: internal/merge/merge.go:359-366, 371-378, 400-405, 410-415","status":"open","priority":4,"issue_type":"feature","created_at":"2025-12-05T16:36:52.27525-08:00","updated_at":"2025-12-05T16:36:52.27525-08:00"}
{"id":"bd-nmch","title":"Add EntityRef type for structured entity references","description":"Create EntityRef struct with Name, Platform, Org, ID fields. This is the foundation for HOP entity tracking. Can render as entity://hop/\u003cplatform\u003e/\u003corg\u003e/\u003cid\u003e when needed. Add to internal/types/types.go.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-22T17:53:25.104328-08:00","updated_at":"2025-12-22T17:58:00.014103-08:00","closed_at":"2025-12-22T17:58:00.014103-08:00","close_reason":"Implemented EntityRef type with Name, Platform, Org, ID fields. Added URI(), IsEmpty(), String() methods and ParseEntityURI() function. Full test coverage.","dependencies":[{"issue_id":"bd-nmch","depends_on_id":"bd-7pwh","type":"parent-child","created_at":"2025-12-22T17:53:43.325405-08:00","created_by":"daemon"}]}
{"id":"bd-nqyp","title":"mol-beads-release","description":"Release checklist for beads version {{version}}.\n\nThis molecule ensures all release steps are completed properly.\nVariable: {{version}} - target version (e.g., 0.35.0)\n\n## Step: update-release-notes\nUpdate cmd/bd/info.go with release notes for {{version}}.\n\nAdd a new VersionChange entry at the top of versionChanges slice:\n```go\n{\n Version: \"{{version}}\",\n Date: \"YYYY-MM-DD\",\n Changes: []string{\n \"NEW: Feature description\",\n \"FIX: Bug fix description\",\n \"IMPROVED: Enhancement description\",\n },\n},\n```\n\nRun `git log --oneline v\u003cprevious\u003e..HEAD` to see what changed.\n\n## Step: update-changelog\nUpdate CHANGELOG.md with detailed release notes.\n\nAdd a new section after [Unreleased]:\n```markdown\n## [{{version}}] - YYYY-MM-DD\n\n### Added\n- **Feature name** (issue-id) - Description\n\n### Changed\n- **Change description** (issue-id)\n\n### Fixed\n- **Bug fix** (issue-id) - Description\n```\n\nSort by importance, not chronologically.\nNeeds: update-release-notes\n\n## Step: bump-version\nRun the version bump script.\n\n```bash\n./scripts/bump-version.sh {{version}}\n```\n\nThis updates version in all files:\n- cmd/bd/version.go\n- .claude-plugin/*.json\n- integrations/beads-mcp/pyproject.toml\n- npm-package/package.json\n- Hook templates\n\nNeeds: update-changelog\n\n## Step: run-tests\nRun tests and verify lint passes.\n\n```bash\ngo test -short ./...\n```\n\nCI will run full lint, but fix any obvious issues first.\nNeeds: bump-version\n\n## Step: commit-release\nCommit the release changes.\n\n```bash\ngit add -A\ngit commit -m \"chore: bump version to v{{version}}\"\n```\n\nNeeds: run-tests\n\n## Step: push-and-tag\nPush commit and create release tag.\n\n```bash\ngit push origin main\ngit tag v{{version}}\ngit push origin v{{version}}\n```\n\nThis triggers GitHub Actions release workflow.\nNeeds: commit-release\n\n## Step: wait-for-ci\nWait for GitHub Actions to complete.\n\nMonitor: https://github.com/steveyegge/beads/actions\n\nCI will:\n- Build binaries via GoReleaser\n- Create GitHub Release with assets\n- Publish to npm (@beads/bd)\n- Publish to PyPI (beads-mcp)\n- Update Homebrew tap\n\nWait until all jobs succeed (~5-10 min).\nNeeds: push-and-tag\n\n## Step: verify-release\nVerify the release is complete.\n\n```bash\n# Check GitHub release\ngh release view v{{version}}\n\n# Check Homebrew\nbrew update \u0026\u0026 brew info steveyegge/beads/bd\n\n# Check npm\nnpm view @beads/bd version\n\n# Check PyPI\npip index versions beads-mcp\n```\n\nNeeds: wait-for-ci\n\n## Step: update-local\nUpdate local installations.\n\n```bash\n# Upgrade Homebrew\nbrew upgrade steveyegge/beads/bd\n\n# Or install from source\n./scripts/bump-version.sh {{version}} --install\n\n# Install MCP locally\npip install -e integrations/beads-mcp\n\n# Restart daemons\npkill -f \"bd daemon\" || true\n```\n\nVerify: `bd --version` shows {{version}}\nNeeds: verify-release\n\n## Step: manual-publish\n(Optional) Manual publish if CI failed.\n\n```bash\n# npm (requires npm login)\n./scripts/bump-version.sh {{version}} --publish-npm\n\n# PyPI (requires TWINE credentials)\n./scripts/bump-version.sh {{version}} --publish-pypi\n\n# Or both\n./scripts/bump-version.sh {{version}} --publish-all\n```\n\nOnly needed if CI publishing failed.\nNeeds: wait-for-ci","status":"open","priority":2,"issue_type":"molecule","created_at":"2025-12-23T11:29:39.087936-08:00","updated_at":"2025-12-23T11:29:39.087936-08:00"}