fix: Use shared role beads consistently
All agent bead creation now uses shared role beads: - gt-mayor-role, gt-deacon-role - gt-witness-role, gt-refinery-role - gt-crew-role, gt-polecat-role Previous code created per-instance role bead references like gt-witness-gastown-role which is wrong. Role beads are shared class definitions, not per-instance. Files fixed: - internal/rig/manager.go - internal/doctor/agent_beads_check.go - internal/cmd/prime.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:
@@ -1096,14 +1096,14 @@ func getAgentFields(ctx RoleContext, state string) *beads.AgentFields {
|
||||
RoleType: "crew",
|
||||
Rig: ctx.Rig,
|
||||
AgentState: state,
|
||||
RoleBead: fmt.Sprintf("gt-crew-%s-%s-role", ctx.Rig, ctx.Polecat),
|
||||
RoleBead: "gt-crew-role",
|
||||
}
|
||||
case RolePolecat:
|
||||
return &beads.AgentFields{
|
||||
RoleType: "polecat",
|
||||
Rig: ctx.Rig,
|
||||
AgentState: state,
|
||||
RoleBead: fmt.Sprintf("gt-polecat-%s-%s-role", ctx.Rig, ctx.Polecat),
|
||||
RoleBead: "gt-polecat-role",
|
||||
}
|
||||
case RoleMayor:
|
||||
return &beads.AgentFields{
|
||||
@@ -1122,14 +1122,14 @@ func getAgentFields(ctx RoleContext, state string) *beads.AgentFields {
|
||||
RoleType: "witness",
|
||||
Rig: ctx.Rig,
|
||||
AgentState: state,
|
||||
RoleBead: fmt.Sprintf("gt-witness-%s-role", ctx.Rig),
|
||||
RoleBead: "gt-witness-role",
|
||||
}
|
||||
case RoleRefinery:
|
||||
return &beads.AgentFields{
|
||||
RoleType: "refinery",
|
||||
Rig: ctx.Rig,
|
||||
AgentState: state,
|
||||
RoleBead: fmt.Sprintf("gt-refinery-%s-role", ctx.Rig),
|
||||
RoleBead: "gt-refinery-role",
|
||||
}
|
||||
default:
|
||||
return nil
|
||||
|
||||
@@ -226,7 +226,7 @@ func (c *AgentBeadsCheck) Fix(ctx *CheckContext) error {
|
||||
RoleType: "witness",
|
||||
Rig: rigName,
|
||||
AgentState: "idle",
|
||||
RoleBead: witnessID + "-role",
|
||||
RoleBead: "gt-witness-role",
|
||||
}
|
||||
desc := fmt.Sprintf("Witness for %s - monitors polecat health and progress.", rigName)
|
||||
if _, err := bd.CreateAgentBead(witnessID, desc, fields); err != nil {
|
||||
@@ -240,7 +240,7 @@ func (c *AgentBeadsCheck) Fix(ctx *CheckContext) error {
|
||||
RoleType: "refinery",
|
||||
Rig: rigName,
|
||||
AgentState: "idle",
|
||||
RoleBead: refineryID + "-role",
|
||||
RoleBead: "gt-refinery-role",
|
||||
}
|
||||
desc := fmt.Sprintf("Refinery for %s - processes merge queue.", rigName)
|
||||
if _, err := bd.CreateAgentBead(refineryID, desc, fields); err != nil {
|
||||
@@ -257,7 +257,7 @@ func (c *AgentBeadsCheck) Fix(ctx *CheckContext) error {
|
||||
RoleType: "crew",
|
||||
Rig: rigName,
|
||||
AgentState: "idle",
|
||||
RoleBead: crewID + "-role",
|
||||
RoleBead: "gt-crew-role",
|
||||
}
|
||||
desc := fmt.Sprintf("Crew worker %s in %s - human-managed persistent workspace.", workerName, rigName)
|
||||
if _, err := bd.CreateAgentBead(crewID, desc, fields); err != nil {
|
||||
@@ -274,7 +274,7 @@ func (c *AgentBeadsCheck) Fix(ctx *CheckContext) error {
|
||||
RoleType: "deacon",
|
||||
Rig: "",
|
||||
AgentState: "idle",
|
||||
RoleBead: deaconID + "-role",
|
||||
RoleBead: "gt-deacon-role",
|
||||
}
|
||||
desc := "Deacon (daemon beacon) - receives mechanical heartbeats, runs town plugins and monitoring."
|
||||
if _, err := bd.CreateAgentBead(deaconID, desc, fields); err != nil {
|
||||
@@ -288,7 +288,7 @@ func (c *AgentBeadsCheck) Fix(ctx *CheckContext) error {
|
||||
RoleType: "mayor",
|
||||
Rig: "",
|
||||
AgentState: "idle",
|
||||
RoleBead: mayorID + "-role",
|
||||
RoleBead: "gt-mayor-role",
|
||||
}
|
||||
desc := "Mayor - global coordinator, handles cross-rig communication and escalations."
|
||||
if _, err := bd.CreateAgentBead(mayorID, desc, fields); err != nil {
|
||||
|
||||
@@ -454,15 +454,14 @@ func (m *Manager) initAgentBeads(rigPath, rigName, prefix string, isFirstRig boo
|
||||
continue // Already exists
|
||||
}
|
||||
|
||||
// RoleBead establishes the canonical bead ID for this agent's role definition.
|
||||
// The bead may not exist yet - this declares the naming convention so tooling
|
||||
// (like gt doctor) can check for missing role beads and scaffold them.
|
||||
// RoleBead points to the shared role definition bead for this agent type.
|
||||
// Role beads are shared: gt-witness-role, gt-refinery-role, etc.
|
||||
fields := &beads.AgentFields{
|
||||
RoleType: agent.roleType,
|
||||
Rig: agent.rig,
|
||||
AgentState: "idle",
|
||||
HookBead: "",
|
||||
RoleBead: agent.id + "-role",
|
||||
RoleBead: "gt-" + agent.roleType + "-role",
|
||||
}
|
||||
|
||||
if _, err := bd.CreateAgentBead(agent.id, agent.desc, fields); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user