bd sync: 2025-12-22 00:05:55

This commit is contained in:
Steve Yegge
2025-12-22 00:05:55 -08:00
parent 965644b0fe
commit 412418ff75

View File

@@ -419,11 +419,13 @@
{"id":"gt-ni6a","title":"Witness role template + CLAUDE.md","description":"Create the Witness agent's role context:\n\n1. internal/templates/roles/witness.md.tmpl\n - Witness responsibilities (polecat lifecycle)\n - Core loop description\n - Commands available (gt polecats, bd ready, etc)\n - Escalation protocol\n\n2. Generate CLAUDE.md for witness/ directories\n - Context about the rig\n - Mail address: \u003crig\u003e/witness\n - Startup protocol (gt prime, check inbox)\n\nThe Witness is the per-rig 'pit boss' - NOT a global coordinator. It manages polecats for ONE rig only.","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-20T03:14:18.617496-08:00","updated_at":"2025-12-20T03:54:13.697998-08:00","closed_at":"2025-12-20T03:54:13.697998-08:00","dependencies":[{"issue_id":"gt-ni6a","depends_on_id":"gt-53w6","type":"parent-child","created_at":"2025-12-20T03:14:37.105264-08:00","created_by":"daemon"}]}
{"id":"gt-njem","title":"Remove gt mail dependency on bd mail commands","description":"Replaced bd mail send/inbox/read/ack with bd create/list/show/close. Messages are now stored as beads issues with type=message.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-20T17:52:43.47722-08:00","updated_at":"2025-12-20T17:52:48.155447-08:00","closed_at":"2025-12-20T17:52:48.155447-08:00"}
{"id":"gt-njr","title":"Engineer session restart protocol","description":"Implement session restart flow for when the Engineer needs to split work:\n\n1. Engineer creates subtask(s) in Beads assigned to self\n2. Engineer sends handoff mail to self (🤝 HANDOFF)\n3. Engineer sends restart request to Witness\n4. Witness verifies:\n - Handoff mail exists in Engineer outbox/sent\n - Subtasks filed in Beads\n5. Witness restarts the Refinery session (new Engineer context)\n\nThis enables \"occasionally consistent, eventually convergent\" work patterns.\nThe Refinery continues; the Engineer gets fresh context.","status":"open","priority":1,"issue_type":"task","created_at":"2025-12-16T23:02:48.22994-08:00","updated_at":"2025-12-16T23:07:42.05363-08:00","dependencies":[{"issue_id":"gt-njr","depends_on_id":"gt-h5n","type":"blocks","created_at":"2025-12-16T23:02:56.148564-08:00","created_by":"daemon"}]}
{"id":"gt-nq6j","title":"Rename .beads-ephemeral to .beads-wisps in docs","description":"The wisp storage directory should be named `.beads-wisps/` not `.beads-ephemeral/`.\n\nAlso fix the architecture: Witness and Refinery share mayor/rig's beads and wisps.\nThey don't have separate ephemeral stores.\n\n## Files to update\n- docs/wisp-architecture.md\n- docs/architecture.md \n- ~/gt/docs/patrol-system-design.md\n- ~/gt/CLAUDE.md\n\n## Changes\n1. Rename `.beads-ephemeral/` → `.beads-wisps/` everywhere\n2. Remove incorrect references to witness/.beads-ephemeral/ and refinery/rig/.beads-ephemeral/\n3. Clarify that all rig-level patrols use mayor/rig/.beads-wisps/","status":"open","priority":1,"issue_type":"task","created_at":"2025-12-21T23:38:04.110859-08:00","updated_at":"2025-12-21T23:39:06.119721-08:00"}
{"id":"gt-nriy","title":"Test: Alpha to Beta","description":"Sibling communication test","status":"open","priority":2,"issue_type":"message","assignee":"gastown-beta","created_at":"2025-12-20T21:44:00.731578-08:00","updated_at":"2025-12-20T21:44:00.731578-08:00","labels":["thread:thread-d94865313b74"],"sender":"Steve Yegge","wisp":true}
{"id":"gt-nti8","title":"Polecats should not push branches to remote","description":"## Current Behavior\n\nPolecats push their branches to origin (e.g., `polecat/furiosa`), which pollutes the remote with many short-lived branches.\n\n## Desired Behavior\n\nPolecats should only commit locally. The Refinery handles all remote pushes:\n1. Polecat works on local `polecat/\u003cname\u003e` branch\n2. Polecat signals done (state → idle)\n3. Refinery pulls from local polecat branch\n4. Refinery runs tests, merges to main\n5. Refinery pushes main to remote\n6. If PR review needed, Refinery creates the PR\n\n## Benefits\n\n- Clean remote (no branch pollution)\n- Clear responsibility (Refinery is the quality gate)\n- Simpler cleanup (local branches deleted with worktree)\n- Less noise in GitHub UI\n\n## Trade-offs\n\n- If polecat crashes before Refinery merges, code is lost locally\n- But beads issue remains open, another polecat can redo the work\n- This is acceptable for ephemeral workers\n\n## Implementation\n\nIn polecat CLAUDE.md or landing protocol:\n- Remove `git push origin HEAD` from workflow\n- Replace with just `git commit` + signal done\n- Refinery handles the rest","status":"open","priority":2,"issue_type":"feature","created_at":"2025-12-21T14:13:48.804954-08:00","updated_at":"2025-12-21T14:13:48.804954-08:00"}
{"id":"gt-nz6t","title":"Remove unused style helper functions","description":"internal/style/style.go defines RenderSuccess, RenderWarning, RenderError, and RenderInfo helper functions that are never used. Code uses style.Success.Render() directly instead. Either use the helpers consistently or remove them.","status":"closed","priority":4,"issue_type":"task","created_at":"2025-12-21T21:34:43.822193-08:00","updated_at":"2025-12-21T21:50:45.224202-08:00","closed_at":"2025-12-21T21:50:45.224202-08:00","close_reason":"Removed 4 unused style helper functions (RenderSuccess, RenderWarning, RenderError, RenderInfo)"}
{"id":"gt-oc2","title":"Daemon: proper rig discovery","description":"Currently discovers rigs by scanning tmux session names for gt-*-witness pattern. Should instead:\n- Read rigs from mayor/rigs.json\n- Or scan town directory for .gastown subdirs\n- Handle rigs that exist but don't have running witnesses","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-18T13:38:15.825299-08:00","updated_at":"2025-12-19T17:22:52.554474-08:00","closed_at":"2025-12-19T16:28:39.497935-08:00","dependencies":[{"issue_id":"gt-oc2","depends_on_id":"gt-99m","type":"blocks","created_at":"2025-12-18T13:38:26.826697-08:00","created_by":"daemon"}]}
{"id":"gt-odvf","title":"Document bd mol bond/squash/burn CLI","description":"Create CLI reference documentation for molecule commands:\n\n## bd mol bond\n\nInstantiate a proto into a runnable molecule.\n\n```bash\nbd mol bond \u003cproto-id\u003e [--wisp] [--assignee=\u003caddr\u003e]\n```\n\n- Default: creates a Mol (durable, in main beads)\n- --wisp: creates a Wisp (ephemeral, in .beads-ephemeral/)\n- --assignee: who will execute this molecule\n\n## bd mol squash\n\nComplete a molecule and generate digest.\n\n```bash\nbd mol squash \u003cmol-id\u003e --summary='...'\n```\n\n- For Mol: creates digest in git history\n- For Wisp: evaporates (no permanent record)\n- --summary: required summary of what was accomplished\n\n## bd mol burn\n\nAbandon a molecule without completing.\n\n```bash\nbd mol burn \u003cmol-id\u003e [--reason='...']\n```\n\n- Discards molecule state\n- No digest created\n- Use when molecule is no longer needed","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-21T16:33:06.462105-08:00","updated_at":"2025-12-21T17:20:42.829495-08:00","dependencies":[{"issue_id":"gt-odvf","depends_on_id":"gt-62hm","type":"blocks","created_at":"2025-12-21T16:33:17.530156-08:00","created_by":"daemon"}]}
{"id":"gt-oiv0","title":"Remove bd sync instruction from polecat startup workflow","description":"Polecats are instructed to run `bd sync --from-main` on startup (spawn.go:634).\n\n## Problem\n- Spawn command already syncs beads before spawning (line 239)\n- Polecats share rig-level beads via `.beads/redirect`\n- Multiple polecats starting simultaneously all try to sync same shared beads\n- This causes git conflicts/failures when many polecats spawn at once\n\n## Observed\nUser reported: 'all polecats failing on beads sync on startup in one run'\n\n## Fix\nRemove line 634 from buildWorkAssignmentMail():\n```\nbody.WriteString(\"2. Run \\`bd sync --from-main\\` to get fresh beads\\n\")\n```\n\nPolecats only need to sync at END of work (already in steps 5/7).\n\n## Files\n- internal/cmd/spawn.go: buildWorkAssignmentMail() and buildSpawnContext()","status":"open","priority":1,"issue_type":"bug","created_at":"2025-12-21T23:45:52.25177-08:00","updated_at":"2025-12-21T23:45:52.25177-08:00"}
{"id":"gt-on46","title":"Work on gt-fix-bugs: Fix blocking infrastructure bugs. Se...","description":"Work on gt-fix-bugs: Fix blocking infrastructure bugs. See issue for details. Run 'bd show gt-fix-bugs' to see the full issue.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-20T03:47:14.322631-08:00","updated_at":"2025-12-20T03:52:16.049326-08:00","closed_at":"2025-12-20T03:52:16.049326-08:00"}
{"id":"gt-ouo","title":"gt swarm start: Does not spawn polecat sessions","description":"gt swarm start marks swarm as 'active' but doesn't start any polecat sessions.\n\nRepro:\n1. gt swarm create gastown --epic gt-hw6 --worker Toast --worker Nux\n2. gt swarm start gt-hw6\n3. gt session list - shows no new sessions\n\nExpected: Polecat sessions should start for each worker.\nActual: No sessions started, workers sit idle.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-12-17T22:25:43.430981-08:00","updated_at":"2025-12-17T22:31:58.849531-08:00","closed_at":"2025-12-17T22:31:58.849531-08:00"}
{"id":"gt-ov2","title":"Refinery agent: merge queue processing loop","description":"The Refinery agent processes the merge queue, merging polecat work to main.\n\n## Interface\n\n```go\ntype Refinery struct {\n rig *Rig\n queue *MergeQueue\n git *Git\n mail *Mailbox\n config RefineryConfig\n}\n\ntype RefineryConfig struct {\n AutoMerge bool // Auto-merge passing MRs\n RunTests bool // Run tests before merge\n TestCommand string // Command to run tests\n RequireReview bool // Require review before merge (future)\n}\n\nfunc NewRefinery(rig *Rig, ...) *Refinery\n\n// Lifecycle\nfunc (r *Refinery) Start() error\nfunc (r *Refinery) Stop() error\nfunc (r *Refinery) IsRunning() bool\n\n// Processing\nfunc (r *Refinery) ProcessQueue() error\nfunc (r *Refinery) ProcessMR(mr *MergeRequest) error\n```\n\n## Processing Loop\n\n1. Check queue for pending MRs\n2. For each pending MR:\n a. Fetch polecat branch\n b. Attempt merge to refinery/rig (local main)\n c. Run tests if configured\n d. If pass: push to origin, mark merged\n e. If fail: mark rejected, notify polecat\n3. Sleep, repeat\n\n## Merge Strategy\n\n- Fast-forward when possible\n- Merge commit when not\n- On conflict: reject MR, polecat must rebase\n\n## Test Integration\n\nIf tests configured:\n```bash\ncd refinery/rig\ngit merge polecat/branch\n\u003ctest_command\u003e # e.g., go test ./...\n```\nResult determines merge/reject.\n\n## Notifications\n\nOn merge success:\n- Mail to polecat: \"Your work merged\"\n- Update bead if issue tracked\n\nOn merge failure:\n- Mail to polecat: \"Merge failed: \u003creason\u003e\"\n- Include conflict details if applicable\n\n## Dependencies\n\nNeeds: Rig management, Git wrapper, Mail system, Merge queue","status":"closed","priority":0,"issue_type":"task","created_at":"2025-12-15T23:22:08.498771-08:00","updated_at":"2025-12-16T14:20:35.032221-08:00","closed_at":"2025-12-16T14:20:35.032221-08:00","dependencies":[{"issue_id":"gt-ov2","depends_on_id":"gt-u1j.14","type":"blocks","created_at":"2025-12-15T23:22:21.801826-08:00","created_by":"daemon"},{"issue_id":"gt-ov2","depends_on_id":"gt-u1j.6","type":"blocks","created_at":"2025-12-15T23:22:21.89716-08:00","created_by":"daemon"}]}
@@ -560,6 +562,7 @@
{"id":"gt-xicq","title":"Work on ga-lue: Implement Witness as Claude agent. Conver...","description":"Work on ga-lue: Implement Witness as Claude agent. Convert from shell script to Claude agent that monitors polecats, nudges idle ones, handles escalations. When done, submit MR (not PR) to integration branch for Refinery.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-19T22:58:08.310674-08:00","updated_at":"2025-12-19T23:24:36.692209-08:00","closed_at":"2025-12-19T23:24:36.692209-08:00"}
{"id":"gt-xkbm","title":"Merge: gt-g44u.1","description":"branch: polecat/Ace\ntarget: main\nsource_issue: gt-g44u.1\nrig: gastown","status":"closed","priority":0,"issue_type":"merge-request","created_at":"2025-12-19T16:04:14.367493-08:00","updated_at":"2025-12-19T17:35:38.210747-08:00","closed_at":"2025-12-19T17:35:38.210747-08:00"}
{"id":"gt-xnql","title":"Define constants for magic strings","description":"Several magic strings are hardcoded throughout the codebase:\n- \"mayor\" appears in 20+ places as a path component\n- \"main\" branch name appears in 20+ places\n- \"beads-sync\" branch name in multiple files\n- \"rigs.json\" filename\n\nThese should be constants in a central location for maintainability.","status":"closed","priority":3,"issue_type":"task","created_at":"2025-12-21T21:34:46.620322-08:00","updated_at":"2025-12-21T22:13:07.292513-08:00","closed_at":"2025-12-21T22:13:07.292513-08:00","close_reason":"Created internal/constants/constants.go with centralized definitions for:\n- Directory names (mayor, polecats, crew, etc.)\n- File names (rigs.json, town.json, state.json)\n- Git branches (main, beads-sync)\n- Session names (gt-mayor, gt-deacon)\n- Agent roles\n\nUpdated key files (rig_helpers.go, daemon.go, status.go) to use the new constants package. Full migration of all usages (~100 files) can be done incrementally."}
{"id":"gt-xp2s","title":"P0: Multiple agents can claim same worker identity","description":"Multiple Claude Code sessions running simultaneously all think they are 'dave' on beads/crew/dave. No detection or prevention of identity collision. This breaks the single-agent-per-worker assumption.\n\n## Fix Implemented\n\n1. **Lock Package** (`internal/lock/lock.go`):\n - PID-based lockfile at `\u003cworker\u003e/.gastown/agent.lock`\n - Contains PID, timestamp, session ID, hostname\n - Stale lock detection (checks if owning PID is dead)\n\n2. **Prevention in gt prime**:\n - Workers (crew/polecat) acquire identity lock before loading context\n - If another live process holds the lock, prime fails with clear error\n - Shows lock holder details and resolution steps\n\n3. **Detection with gt agents**:\n - `gt agents check` - scans for collisions and stale locks\n - `gt agents fix` - cleans stale locks\n - JSON output available for patrol tooling\n\n4. **Correction in gt doctor**:\n - New `identity-collision` check\n - `gt doctor --fix` cleans stale locks","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-12-21T23:55:56.649577-08:00","updated_at":"2025-12-22T00:05:07.309612-08:00","closed_at":"2025-12-22T00:05:07.309612-08:00","close_reason":"Implemented lock mechanism with prevention (gt prime), detection (gt agents check), and correction (gt doctor/agents fix)"}
{"id":"gt-xpq","title":"Add gt crew rename command","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-18T19:45:32.599846-08:00","updated_at":"2025-12-18T19:46:17.780981-08:00","closed_at":"2025-12-18T19:46:17.780981-08:00"}
{"id":"gt-xqdk","title":"Add molecule to update local go binary on push to main","description":"When pushing to main branch, automatically rebuild and install the gt binary on the local machine so changes are immediately available.","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-19T15:37:40.542228-08:00","updated_at":"2025-12-19T15:37:40.542228-08:00"}
{"id":"gt-xw7b","title":"Add --fart as easter egg alias for bd mol bond","description":"Add a hidden alias for the bond command:\n\n```bash\nbd mol fart mol-polecat-work --wisp\n# equivalent to:\nbd mol bond mol-polecat-work --wisp\n```\n\n## Context\nThe fart joke: instantiating a proto can produce either:\n- A Mol (solid/substantial output)\n- A Wisp (gas/ephemeral output)\n\n## Implementation\n- Add 'fart' as an alias in the mol subcommand\n- No documentation needed (easter egg)\n- Maybe a fun message: 'Bonding molecule...' or similar\n\nLow priority, just for fun.","status":"open","priority":4,"issue_type":"task","created_at":"2025-12-21T16:33:18.822868-08:00","updated_at":"2025-12-21T17:20:42.83232-08:00"}