refactor: migrate callers from deprecated MayorBeadID/DeaconBeadID to Town variants (gt-gbw0a)

Update all callers of deprecated MayorBeadID()/DeaconBeadID() to use
MayorBeadIDTown()/DeaconBeadIDTown() which return hq- prefix IDs for
town-level beads storage.

Changes:
- internal/daemon/lifecycle.go: identityToAgentBeadID and checkStaleAgents
- internal/cmd/prime.go: getAgentBeadID
- internal/cmd/molecule_status.go: buildAgentBeadID
- internal/cmd/prime_test.go: update expected values to hq-*
- Comments updated to reflect hq- prefix for town-level agents

The deprecated functions remain for backward compatibility and are used
by the migration tool (migrate_agents.go).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/george
2026-01-03 21:53:30 -08:00
committed by Steve Yegge
parent a5907685cd
commit 60ecf1ff76
5 changed files with 17 additions and 16 deletions

View File

@@ -18,9 +18,10 @@ import (
// buildAgentBeadID constructs the agent bead ID from an agent identity.
// Uses canonical naming: prefix-rig-role-name
// Town-level agents use hq- prefix; rig-level agents use rig's prefix.
// Examples:
// - "mayor" -> "gt-mayor"
// - "deacon" -> "gt-deacon"
// - "mayor" -> "hq-mayor"
// - "deacon" -> "hq-deacon"
// - "gastown/witness" -> "gt-gastown-witness"
// - "gastown/refinery" -> "gt-gastown-refinery"
// - "gastown/nux" (polecat) -> "gt-gastown-polecat-nux"
@@ -34,9 +35,9 @@ func buildAgentBeadID(identity string, role Role) string {
if role == RoleUnknown || role == Role("") {
switch {
case identity == "mayor":
return beads.MayorBeadID()
return beads.MayorBeadIDTown()
case identity == "deacon":
return beads.DeaconBeadID()
return beads.DeaconBeadIDTown()
case len(parts) == 2 && parts[1] == "witness":
return beads.WitnessBeadID(parts[0])
case len(parts) == 2 && parts[1] == "refinery":
@@ -57,9 +58,9 @@ func buildAgentBeadID(identity string, role Role) string {
switch role {
case RoleMayor:
return beads.MayorBeadID()
return beads.MayorBeadIDTown()
case RoleDeacon:
return beads.DeaconBeadID()
return beads.DeaconBeadIDTown()
case RoleWitness:
if len(parts) >= 1 {
return beads.WitnessBeadID(parts[0])