refactor: use hq- prefix for role bead references

Migrate all role bead references from gt-*-role to hq-*-role using
beads.RoleBeadIDTown() function. Role beads are stored in town beads
(~/gt/.beads/) with the hq- prefix.

Changes:
- internal/cmd/prime.go: Use RoleBeadIDTown() for all roles
- internal/doctor/agent_beads_check.go: Use RoleBeadIDTown() for rig agents
- internal/polecat/manager.go: Use RoleBeadIDTown("polecat")
- internal/cmd/crew_add.go: Use RoleBeadIDTown("crew")
- internal/beads/beads.go: Update comments to document hq- convention
- Templates: Update bd show gt-deacon to bd show hq-deacon

Note: Tmux session names remain as gt-* (runtime identifiers).
Bead IDs use hq-* for town-level agents (persistent storage).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
scrotus
2026-01-04 13:17:39 -08:00
committed by Steve Yegge
parent a0e5831f69
commit 4de5a96400
7 changed files with 26 additions and 21 deletions

View File

@@ -108,7 +108,7 @@ func runCrewAdd(cmd *cobra.Command, args []string) error {
RoleType: "crew",
Rig: rigName,
AgentState: "idle",
RoleBead: "gt-crew-role",
RoleBead: beads.RoleBeadIDTown("crew"),
}
desc := fmt.Sprintf("Crew worker %s in %s - human-managed persistent workspace.", name, rigName)
if _, err := bd.CreateAgentBead(crewID, desc, fields); err != nil {

View File

@@ -1204,40 +1204,40 @@ func getAgentFields(ctx RoleContext, state string) *beads.AgentFields {
RoleType: "crew",
Rig: ctx.Rig,
AgentState: state,
RoleBead: "gt-crew-role",
RoleBead: beads.RoleBeadIDTown("crew"),
}
case RolePolecat:
return &beads.AgentFields{
RoleType: "polecat",
Rig: ctx.Rig,
AgentState: state,
RoleBead: "gt-polecat-role",
RoleBead: beads.RoleBeadIDTown("polecat"),
}
case RoleMayor:
return &beads.AgentFields{
RoleType: "mayor",
AgentState: state,
RoleBead: "gt-mayor-role",
RoleBead: beads.RoleBeadIDTown("mayor"),
}
case RoleDeacon:
return &beads.AgentFields{
RoleType: "deacon",
AgentState: state,
RoleBead: "gt-deacon-role",
RoleBead: beads.RoleBeadIDTown("deacon"),
}
case RoleWitness:
return &beads.AgentFields{
RoleType: "witness",
Rig: ctx.Rig,
AgentState: state,
RoleBead: "gt-witness-role",
RoleBead: beads.RoleBeadIDTown("witness"),
}
case RoleRefinery:
return &beads.AgentFields{
RoleType: "refinery",
Rig: ctx.Rig,
AgentState: state,
RoleBead: "gt-refinery-role",
RoleBead: beads.RoleBeadIDTown("refinery"),
}
default:
return nil