feat: add gt bead create/update/dep/list/search with prefix routing#3525
Draft
mk-imagine wants to merge 3 commits intogastownhall:mainfrom
Draft
feat: add gt bead create/update/dep/list/search with prefix routing#3525mk-imagine wants to merge 3 commits intogastownhall:mainfrom
mk-imagine wants to merge 3 commits intogastownhall:mainfrom
Conversation
…WIP) Placeholder for draft PR. Adds 5 routed bd command wrappers under gt bead.
3 tasks
…x6o) Replace repeated Dir(resolveBeadDir(id)).StripBeadsDir() pattern with a single RouteForBead(id) builder method on bdCmd. This prepares for adding 5 new gt bead subcommands that reuse the same routing logic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…hq-x6o) Add 5 new gt bead subcommands that proxy bd commands with automatic prefix-based routing to the correct rig database: - create: routes by --rig flag to target rig - update: routes by bead ID prefix - dep: routes by first bead ID prefix - list: routes by --rig flag to target rig - search: routes by --rig flag to target rig Also adds RouteForPrefix() builder method on bdCmd for commands that accept a prefix rather than a bead ID. Fixes variable shadowing in cat.go and close.go from the RouteForBead refactoring, and adds missing io import to convoy_stage.go. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add 5 new subcommands under
gt beadthat wrapbdcommands with prefix-based routing viaroutes.jsonl:gt bead create— routes by--prefixflag, captures stdout for bead ID relaygt bead update <id>— routes by bead ID prefixgt bead dep <subcmd> <id>— routes by bead ID, skips subcommand tokengt bead list— no routing (CWD context), pass-throughgt bead search— no routing (CWD context), pass-throughWhy:
bddoesn't support Gas Town'sroutes.jsonlprefix routing. Agents callingbd createfrom the wrong CWD write beads to an invisible local database.gt bead createresolves the prefix to the correct rig database before executingbd. This makes bead operations deterministic regardless of the agent's CWD.Pattern: Follows existing
gt showandgt closerouting pattern —resolveBeadDir()+ chdir + strip BEADS_DIR + execbd.Implementation Steps
6 steps, single phase:
listsyscall.Execpass-throughsearchsyscall.Execpass-throughupdatesyscall.Exec+ routingdepsyscall.Exec+ routingcreate--prefix)exec.Command(captures stdout)beadCmd.LongSteps 1+2 and 3+4 can be implemented in parallel.
Key Files
internal/cmd/bead.go— register new subcommandsinternal/cmd/bead_{list,search,update,dep}_unix.go— new, platform-specific execinternal/cmd/bead_routing_test.go— new, unit tests for routing logicTest plan
go build ./...passesgo test ./internal/cmd/... -run TestBeadpassesgolangci-lint runcleangt bead create --prefix <pfx> --title "test"from town root creates bead in correct rig databasegt bead update <pfx>-xxx --notes "test"from town root updates bead in correct rig database