#4877·gastown

当 rig 容器根目录中存在一个遗失的重复 .beads 文件时, bd create --repo <rig-root> 会默默地重新路由并虚拟创建一个 bead

作者: fschaeffler创建于 2026年9月22日更新于 2026年9月22日
标签status/needs-triage

gt rig add creates two .beads/ directories for a rig in some cases:

  • <rig>/.beads/ (stray, local embeddeddolt backend, 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:
1. 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 ..."
2. Exit code 0.
3. The bead does not actually exist: `bd show hq-1x9` -> "not found", and
   `bd 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.

内容来源: gastownhall/gastown