bd create --repo <rig-root> silently misroutes and phantom-creates a bead when the rig has a stray duplicate .beads/ at its container root
gt rig add creates two .beads/ directories for a rig in some cases:
<rig>/.beads/(stray, localembeddeddoltbackend, no route entry)<rig>/mayor/rig/.beads/(real, routed workspace — matches routes.jsonl)
Reproduced on the gastown rig (created via gt rig add gastown [email protected]:gastownhall/gastown.git):
/gt/gastown/.beads/metadata.json -> {"backend":"dolt","dolt_mode":"embeddeddolt",...}
/gt/gastown/mayor/rig/.beads/ -> the real workspace, matches routes.jsonl entry
{"prefix":"gt-","path":"gastown/mayor/rig"}bd create <title> --repo /gt/gastown (the rig container root, the path gt rig add
itself prints as "Next steps: cd /gt/gastown/...") does NOT error and does NOT use
the stray local .beads it presumably finds there. Instead it:
- Prints a success line with a plausible-looking issue ID using the hq- prefix (the cwd's default town-level routing), e.g. "Created issue: hq-1x9 ..."
- Exit code 0.
- The bead does not actually exist:
bd show hq-1x9-> "not found", andbd history hq-1x9-> "No history found" (no trace at all, not even a deleted/purged record).
Reproduced twice in a row (hq-1x9, then hq-29f on retry), both phantom.
Switching --repo to the actually-routed path (/gt/gastown/mayor/rig) worked
correctly and produced a real, persistent gt-j5q.
This is a silent data-loss footgun: the operator sees a "success" message with a
real-looking ID and reasonably believes the issue was filed, but it vanishes
without any error, warning, or trace. Compounded by the fact that the rig root
(the misleading path) is exactly what gt rig add's own output tells the user to
cd into.
Likely related root cause: same species of stray-duplicate-.beads-directory issue
also seen on a sibling rig at creation time (an empty stray .beads/dolt/
directory that made bd/bd where misdetect the workspace as a "legacy Dolt
server workspace" until manually removed). Both point at gt rig add's init path
sometimes leaving behind a second, non-routed .beads/ next to the real one.
Suggested fixes (either or both):
a) gt rig add should not create/leave a second .beads/ at the rig container
root when the routed workspace lives at mayor/rig/.beads — or if intentional,
it should carry a route entry / redirect marker.
b) bd create --repo <path> should hard-error (not silently fall back to cwd's
default routing) when the given --repo path resolves to a workspace with no
route entry, or at minimum the printed "Created issue" confirmation must be
backed by a verified read-after-write before being shown as success.
Filed from beads issue gt-hi1.
Source: gastownhall/gastown