bd sync: 2025-12-25 02:05:15

This commit is contained in:
Steve Yegge
2025-12-25 02:05:15 -08:00
parent fca9e540a3
commit 9451eeca03

View File

@@ -98,7 +98,7 @@
{"id":"bd-7b7h","title":"bd sync --merge fails due to chicken-and-egg: .beads/ always dirty","description":"## Problem\n\nWhen sync.branch is configured (e.g., beads-sync), the bd sync workflow creates a chicken-and-egg problem:\n\n1. `bd sync` commits changes to beads-sync via worktree\n2. `bd sync` copies JSONL to main working dir via `copyJSONLToMainRepo()` (sync.go line 364, worktree.go line 678-685)\n3. The copy is NOT committed to main - it just updates the working tree\n4. `bd sync --merge` checks for clean working dir (sync.go line 1547-1548)\n5. `bd sync --merge` FAILS because .beads/issues.jsonl is uncommitted!\n\n## Impact\n\n- sync.branch workflow is fundamentally broken\n- Users cannot periodically merge beads-sync → main\n- Main branch always shows as dirty\n- Creates confusion about git state\n\n## Root Cause\n\nsync.go:1547-1548:\n```go\nif len(strings.TrimSpace(string(statusOutput))) \u003e 0 {\n return fmt.Errorf(\"main branch has uncommitted changes, please commit or stash them first\")\n}\n```\n\nThis check blocks merge when ANY uncommitted changes exist, including the .beads/ changes that `bd sync` itself created.\n\n## Proposed Fix\n\nOption A: Exclude .beads/ from the clean check in `mergeSyncBranch`:\n```go\n// Check if there are non-beads uncommitted changes\nstatusCmd := exec.CommandContext(ctx, \"git\", \"status\", \"--porcelain\", \"--\", \":!.beads/\")\n```\n\nOption B: Auto-stash .beads/ changes before merge, restore after\n\nOption C: Change the workflow - do not copy JSONL to main working dir, instead always read from worktree\n\n## Files to Modify\n\n- cmd/bd/sync.go:1540-1549 (mergeSyncBranch function)\n- Possibly internal/syncbranch/worktree.go (copyJSONLToMainRepo)","notes":"## Fix Implemented\n\nModified cmd/bd/sync.go mergeSyncBranch function:\n\n1. **Exclude .beads/ from dirty check** (line 1543):\n Changed `git status --porcelain` to `git status --porcelain -- :!.beads/`\n This allows merge to proceed when only .beads/ has uncommitted changes.\n\n2. **Restore .beads/ to HEAD before merge** (lines 1553-1561):\n Added `git checkout HEAD -- .beads/` before merge to prevent\n \"Your local changes would be overwritten by merge\" errors.\n The .beads/ changes are redundant since they came FROM beads-sync.\n\n## Testing\n\n- All cmd/bd sync/merge tests pass\n- All internal/syncbranch tests pass\n- Manual verification needed for full workflow","status":"tombstone","priority":0,"issue_type":"bug","created_at":"2025-12-16T23:06:06.97703-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-7bbc4e6a","title":"Add MCP server functions for repair commands","description":"**Summary:** Added MCP server repair functions for agent dependency management, system validation, and pollution detection. Implemented across BdClientBase, BdCliClient, and daemon clients to enhance system diagnostics and self-healing capabilities.\n\n**Key Decisions:** \n- Expose repair_deps(), detect_pollution(), validate() via MCP server\n- Create abstract method stubs with fallback to CLI execution\n- Use @mcp.tool decorators for function registration\n\n**Resolution:** Successfully implemented comprehensive repair command infrastructure, enabling more robust system health monitoring and automated remediation with full CLI and daemon support.","notes":"Implemented all three MCP server functions:\n\n1. **repair_deps(fix=False)** - Find/fix orphaned dependencies\n2. **detect_pollution(clean=False)** - Detect/clean test issues \n3. **validate(checks=None, fix_all=False)** - Run comprehensive health checks\n\nChanges:\n- Added abstract methods to BdClientBase\n- Implemented in BdCliClient (CLI execution)\n- Added NotImplementedError stubs in BdDaemonClient (falls back to CLI)\n- Created wrapper functions in tools.py\n- Registered @mcp.tool decorators in server.py\n\nAll commands tested and working with --no-daemon flag.","status":"tombstone","priority":2,"issue_type":"task","created_at":"2025-10-28T19:37:55.72639-07: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":"task"}
{"id":"bd-7bs4","title":"Release v{{version}}","description":"Clean release workflow for beads. Variables: version (e.g., 0.37.0), date (YYYY-MM-DD)","status":"tombstone","priority":1,"issue_type":"epic","created_at":"2025-12-24T16:20:49.905172-08:00","updated_at":"2025-12-25T01:44:44.984673-08:00","labels":["molecule","template"],"dependencies":[{"issue_id":"bd-7bs4","depends_on_id":"bd-qqc","type":"supersedes","created_at":"2025-12-24T16:22:59.957519-08:00","created_by":"daemon"}],"deleted_at":"2025-12-25T01:44:44.984673-08:00","deleted_by":"daemon","delete_reason":"delete","original_type":"epic"}
{"id":"bd-7bs4.1","title":"Verify CI is green","description":"Check that CI is passing before starting release:\n```bash\ngh run list --limit 3\n```\nAll recent runs should show 'success'. If not, fix issues first.","status":"open","priority":1,"issue_type":"task","created_at":"2025-12-24T16:21:03.112-08:00","updated_at":"2025-12-24T16:21:03.112-08:00","dependencies":[{"issue_id":"bd-7bs4.1","depends_on_id":"bd-7bs4","type":"parent-child","created_at":"2025-12-24T16:21:03.112453-08:00","created_by":"daemon"}]}
{"id":"bd-7bs4.1","title":"Verify CI is green","description":"Check that CI is passing before starting release:\n```bash\ngh run list --limit 3\n```\nAll recent runs should show 'success'. If not, fix issues first.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-24T16:21:03.112-08:00","updated_at":"2025-12-25T01:53:13.505206-08:00","closed_at":"2025-12-25T01:53:13.505206-08:00","close_reason":"CI verified green - 5 recent runs all successful","dependencies":[{"issue_id":"bd-7bs4.1","depends_on_id":"bd-7bs4","type":"parent-child","created_at":"2025-12-24T16:21:03.112453-08:00","created_by":"daemon"}]}
{"id":"bd-7bs4.10","title":"Update Homebrew formula","description":"./scripts/update-homebrew.sh {{version}}","status":"open","priority":1,"issue_type":"task","created_at":"2025-12-24T16:22:20.238562-08:00","updated_at":"2025-12-24T16:22:20.238562-08:00","dependencies":[{"issue_id":"bd-7bs4.10","depends_on_id":"bd-7bs4","type":"parent-child","created_at":"2025-12-24T16:22:20.238936-08:00","created_by":"daemon"},{"issue_id":"bd-7bs4.10","depends_on_id":"bd-7bs4.9","type":"blocks","created_at":"2025-12-24T16:22:37.977163-08:00","created_by":"daemon"}]}
{"id":"bd-7bs4.11","title":"Upgrade Homebrew bd","description":"brew update \u0026\u0026 brew upgrade bd","status":"open","priority":1,"issue_type":"task","created_at":"2025-12-24T16:22:20.316818-08:00","updated_at":"2025-12-24T16:22:20.316818-08:00","dependencies":[{"issue_id":"bd-7bs4.11","depends_on_id":"bd-7bs4","type":"parent-child","created_at":"2025-12-24T16:22:20.317185-08:00","created_by":"daemon"},{"issue_id":"bd-7bs4.11","depends_on_id":"bd-7bs4.10","type":"blocks","created_at":"2025-12-24T16:22:38.045463-08:00","created_by":"daemon"}]}
{"id":"bd-7bs4.12","title":"Run go install","description":"go install ./cmd/bd","status":"open","priority":1,"issue_type":"task","created_at":"2025-12-24T16:22:20.39432-08:00","updated_at":"2025-12-24T16:22:20.39432-08:00","dependencies":[{"issue_id":"bd-7bs4.12","depends_on_id":"bd-7bs4","type":"parent-child","created_at":"2025-12-24T16:22:20.39468-08:00","created_by":"daemon"},{"issue_id":"bd-7bs4.12","depends_on_id":"bd-7bs4.6","type":"blocks","created_at":"2025-12-24T16:22:38.116749-08:00","created_by":"daemon"}]}
@@ -273,7 +273,7 @@
{"id":"bd-hlsw.4","title":"Sync branch integrity guards","description":"Track sync branch parent commit. If sync branch was force-pushed, warn user and require confirmation before proceeding. Add option to reset to remote if user accepts rebase. Prevents silent corruption from forced pushes.","status":"open","priority":3,"issue_type":"task","created_at":"2025-12-14T10:40:20.645402352-07:00","updated_at":"2025-12-14T10:40:20.645402352-07:00","dependencies":[{"issue_id":"bd-hlsw.4","depends_on_id":"bd-hlsw","type":"parent-child","created_at":"2025-12-14T10:40:20.646425761-07:00","created_by":"daemon","metadata":"{}"}]}
{"id":"bd-hlyr","title":"Merge: bd-m8ro","description":"branch: polecat/max\ntarget: main\nsource_issue: bd-m8ro\nrig: beads","status":"closed","priority":2,"issue_type":"merge-request","created_at":"2025-12-23T20:45:40.218445-08:00","updated_at":"2025-12-23T21:21:57.69886-08:00","closed_at":"2025-12-23T21:21:57.69886-08:00","close_reason":"stale - no code pushed"}
{"id":"bd-hnkg","title":"GH#540: Add silent quick-capture mode (bd q)","description":"Add bd q alias for quick capture that outputs only issue ID. Useful for piping/scripting. See GitHub issue #540.","status":"tombstone","priority":2,"issue_type":"feature","created_at":"2025-12-16T01:03:38.260135-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":"feature"}
{"id":"bd-hobo","title":"Distinct prefixes for protos, molecules, wisps","description":"Template/workflow entities should have visually distinct prefixes from regular issues.\n\n**Problem:**\n- Protos (bd-7bs4) look like regular issues - invites squashing\n- Molecules (poured instances) also use bd- prefix\n- Wisps are in separate DB but still use bd- when referenced\n\n**Proposed Prefixes:**\n- `proto-` for templates (e.g., proto-release, proto-review)\n- `mol-` for active molecules (poured from protos)\n- `wisp-` for ephemeral wisps (vapor phase)\n\n**Benefits:**\n- Instant visual recognition of entity type\n- Prevents accidental modification of templates\n- Clear lifecycle: proto → mol → wisp → digest\n\n**Implementation options:**\n1. Separate databases with different prefixes\n2. Issue type determines prefix generation\n3. Naming convention enforced by bd pour/wisp commands","status":"open","priority":2,"issue_type":"feature","assignee":"beads/crew/dave","created_at":"2025-12-24T16:45:24.940809-08:00","updated_at":"2025-12-24T19:59:51.525214-08:00","labels":["workflow"]}
{"id":"bd-hobo","title":"Distinct prefixes for protos, molecules, wisps","description":"Template/workflow entities should have visually distinct prefixes from regular issues.\n\n**Problem:**\n- Protos (bd-7bs4) look like regular issues - invites squashing\n- Molecules (poured instances) also use bd- prefix\n- Wisps are in separate DB but still use bd- when referenced\n\n**Proposed Prefixes:**\n- `proto-` for templates (e.g., proto-release, proto-review)\n- `mol-` for active molecules (poured from protos)\n- `wisp-` for ephemeral wisps (vapor phase)\n\n**Benefits:**\n- Instant visual recognition of entity type\n- Prevents accidental modification of templates\n- Clear lifecycle: proto → mol → wisp → digest\n\n**Implementation options:**\n1. Separate databases with different prefixes\n2. Issue type determines prefix generation\n3. Naming convention enforced by bd pour/wisp commands","status":"closed","priority":2,"issue_type":"feature","assignee":"beads/crew/zoey","created_at":"2025-12-24T16:45:24.940809-08:00","updated_at":"2025-12-25T02:04:52.459233-08:00","closed_at":"2025-12-25T02:04:52.459233-08:00","close_reason":"Implemented distinct prefixes: mol- for poured molecules, wisp- for ephemeral wisps. Added IDPrefix field to Issue, CloneOptions, and RPC CreateArgs. Storage layer now uses issue.IDPrefix when set, falling back to config prefix.","labels":["workflow"]}
{"id":"bd-hr39","title":"bd cook: needs field not converted to step dependencies","description":"When cooking a formula with `needs` fields on steps, the dependencies are not created between sibling steps.\n\n## Expected\n\nFormula:\n```yaml\nsteps:\n - id: inbox-check\n title: Check inbox\n - id: trigger-spawns\n title: Nudge polecats\n needs: [inbox-check]\n```\n\nShould create:\n- mol-foo.inbox-check (no deps)\n- mol-foo.trigger-spawns → depends on → mol-foo.inbox-check\n\n## Actual\n\nBoth steps only depend on the parent proto:\n- mol-foo.inbox-check → depends on → mol-foo\n- mol-foo.trigger-spawns → depends on → mol-foo\n\nThe `needs` field is ignored.\n\n## Impact\n\nThis breaks the step execution order. Steps that should wait for predecessors will run in parallel or out of order.\n\n## Reproduction\n\n```bash\nbd cook mol-deacon-patrol.formula.yaml\nbd show mol-deacon-patrol.trigger-pending-spawns\n# Shows: Depends on mol-deacon-patrol (parent only)\n# Should show: Depends on mol-deacon-patrol.inbox-check\n```","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-12-24T13:49:59.023514-08:00","updated_at":"2025-12-24T13:59:09.929298-08:00","closed_at":"2025-12-24T13:59:09.929298-08:00","close_reason":"Fixed in this session"}
{"id":"bd-hulf","title":"Molecule execution state management","description":"Implement molecule execution state tracking.\n\n## State Location\n\n```\n.beads/molecules/\u003cmol-id\u003e.state.yaml\n```\n\n## State Schema\n\n```yaml\nid: mol-deacon-patrol\nformula: mol-deacon-patrol # Source formula\nbonded_at: ISO timestamp\nbonded_by: entity who created it\n\n# Execution state\nstatus: running | paused | completed | failed\ncurrent_step: step-id\nstarted_at: ISO timestamp\ncompleted_at: ISO timestamp (if done)\n\n# Loop tracking\nreset_count: 0\nlast_reset_at: null\n\n# Per-step state\nsteps:\n inbox-check:\n status: completed | in_progress | pending\n started_at: ...\n completed_at: ...\n spawn-work:\n status: pending\n self-inspect:\n status: pending\n\n# Variables (from formula instantiation)\nvariables:\n rig: gastown\n issue_id: gt-xxx\n```\n\n## Operations\n\n- CreateState(molID, formula, variables) - Initialize state\n- LoadState(molID) - Read current state \n- SaveState(molID, state) - Write state\n- AdvanceStep(molID) - Mark current complete, find next\n- ResetState(molID) - Reset all steps to pending\n\n## Files\n\n- internal/mol/state.go\n- internal/mol/types.go","status":"closed","priority":0,"issue_type":"task","created_at":"2025-12-24T15:53:43.381634-08:00","updated_at":"2025-12-24T16:53:11.807645-08:00","closed_at":"2025-12-24T16:53:11.807645-08:00","close_reason":"REJECTED: Violates core architecture. Molecule execution state MUST be derived from which child beads are closed vs open - beads IS the ledger. No separate state.yaml files. See HOP CONTEXT.md: 'Git as blockchain' principle."}
{"id":"bd-hvng","title":"Merge: bd-w193","description":"branch: polecat/nux\ntarget: main\nsource_issue: bd-w193\nrig: beads","status":"closed","priority":2,"issue_type":"merge-request","created_at":"2025-12-19T23:23:47.496139-08:00","updated_at":"2025-12-20T23:17:26.996479-08:00","closed_at":"2025-12-20T23:17:26.996479-08:00","close_reason":"Branches nuked, MRs obsolete"}