beads/internal/routing
matt wilkie ca1ae15d02
Fix init leaving beads.role unset in edge cases (GH#2950) (#2964)
Root cause: multiple code paths in bd init could skip setting beads.role:
- BEADS_DIR set → git init skipped → isGitRepo() false → role block skipped
- promptContributorMode() fails → role never set
- Non-interactive without explicit --role → only sets if not already present

Fix: Add safety net at end of init that checks isGitRepo() && !hasRole
and defaults to 'maintainer' (or --role value). This guarantees every
init leaves beads.role configured.

Also:
- Improve routing.go warning to show one-command fix
- Update doctor check fix to use 'git config' directly (simpler)
- Add TestInitNonInteractiveAlwaysSetsRole regression test

Amp-Thread-ID: https://ampcode.com/threads/T-019d4a99-63c8-779f-bb8e-ee8522b61cdf

Co-authored-by: Amp <amp@ampcode.com>
2026-04-01 17:00:41 -07:00
..
routing.go Fix init leaving beads.role unset in edge cases (GH#2950) (#2964) 2026-04-01 17:00:41 -07:00
routing_test.go refactor: remove multi-rig routing from beads 2026-03-27 19:53:13 -07:00