Skip to content

docs: migrate agent-facing bd commands to gt bead equivalents#3524

Draft
mk-imagine wants to merge 10 commits intogastownhall:mainfrom
mk-imagine:docs/bd-to-gt-migration
Draft

docs: migrate agent-facing bd commands to gt bead equivalents#3524
mk-imagine wants to merge 10 commits intogastownhall:mainfrom
mk-imagine:docs/bd-to-gt-migration

Conversation

@mk-imagine
Copy link
Copy Markdown
Contributor

@mk-imagine mk-imagine commented Apr 5, 2026

Summary

Migrate ~285 agent-facing bd command references to gt / gt bead equivalents across role templates, message templates, and molecule formulas.

Why: bd (beads CLI) does not support Gas Town's prefix-based routing via routes.jsonl. When agents call bd show <prefix>-abc from the town root, it fails silently — bd only queries the local .beads/ database. gt wraps bd with routing. After this migration, the rule is simple: agents always use gt for bead operations.

Depends on: #3525 (gt bead command wrappers — adds gt bead create/update/dep/list/search)

Scope

  • 38 files (~285 references to migrate, ~10 kept)
  • 8 role templates, 4 message templates, ~24 formula files, 2 misc
  • No Go code changes — text-only

Migration Mapping

Old New
bd show <id> gt show <id> (existing)
bd close <id> gt close <id> (existing)
bd create gt bead create (#3525)
bd update gt bead update (#3525)
bd list gt bead list (#3525)
bd dep gt bead dep (#3525)
bd search gt bead search (#3525)
bd mol gt mol (existing)

Kept: bd prime, bd doctor, bd version

Test plan

  • grep for migrated commands returns zero in templates/formulas
  • go build ./... passes
  • Kept commands still present

@github-actions github-actions bot added the status/needs-triage Inbox — we haven't looked at it yet label Apr 5, 2026
mk-imagine and others added 10 commits April 4, 2026 20:08
…WIP)

Placeholder for draft PR. Adds 5 routed bd command wrappers under gt bead.
…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) <[email protected]>
…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) <[email protected]>
feat: add gt bead subcommands with prefix routing
…ing (WIP)

Placeholder for draft PR. Adds RouteForBead() method and migrates 11 call sites.
Add RouteForBead(beadID) method to the bdCmd builder that encapsulates
the Dir(resolveBeadDir(id)).StripBeadsDir() pattern into a single call.
Also adds RouteForPrefix(prefix) for commands that take a prefix.

Migrated call sites:
- sling_helpers.go: verifyBeadExists, getBeadInfo, storeFieldsInBead (x2)
- bead.go: moveBead source lookup
- hook.go: hookBead retry loop
- cat.go: bd show passthrough (converted from raw exec.Command)
- close.go: bd close passthrough, closeChildren query + close (converted)
- convoy_stage.go: bdShow, bdDepList helpers (converted)

Also fixes pre-existing compact_report_test.go build failure.
fix: add RouteForBead() to bdCmd builder, migrate 11 call sites
Placeholder for draft PR. Migration of ~285 bd command references
across 38 files to gt/gt bead equivalents with prefix routing.
…and formulas (hq-cg5)

Migrate ~289 bd command references across 40 template and formula files
to their gt equivalents:

- bd show/create/update/list/dep/search → gt bead <subcommand>
- bd close/ready/mol/formula/cat → gt <subcommand>
- bd new → gt bead create (new is an alias for create)

Commands without gt equivalents are intentionally kept as bd:
  sync, blocked, prime, merge-slot, doctor, stats, daemons,
  activity, info, gate, comment, children, cook, stub
@mk-imagine mk-imagine force-pushed the docs/bd-to-gt-migration branch from e50fc7d to 49ea80a Compare April 5, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/needs-triage Inbox — we haven't looked at it yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants