feat: Wire up created_by field for beads issues (gt-u6nri)
- Add CreatedBy field to Issue struct (matches beads GH#748) - Add Actor field to CreateOptions, pass --actor to bd create - Add ActorString() method to RoleInfo for identity formatting - Update all beads.Create() callers to pass Actor - Update direct bd create exec calls with --actor: - mail/router.go: uses sender identity - patrol_helpers.go: uses role name - doctor/patrol_check.go: uses "gt-doctor" - rig/manager.go: uses "gt-rig-init" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -230,6 +230,42 @@ func parseRoleString(s string) (Role, string, string) {
|
||||
}
|
||||
}
|
||||
|
||||
// ActorString returns the actor identity string for beads attribution.
|
||||
// Format matches beads created_by convention:
|
||||
// - Simple roles: "mayor", "deacon"
|
||||
// - Rig-specific: "gastown/witness", "gastown/refinery"
|
||||
// - Workers: "gastown/crew/max", "gastown/polecats/Toast"
|
||||
func (info RoleInfo) ActorString() string {
|
||||
switch info.Role {
|
||||
case RoleMayor:
|
||||
return "mayor"
|
||||
case RoleDeacon:
|
||||
return "deacon"
|
||||
case RoleWitness:
|
||||
if info.Rig != "" {
|
||||
return fmt.Sprintf("%s/witness", info.Rig)
|
||||
}
|
||||
return "witness"
|
||||
case RoleRefinery:
|
||||
if info.Rig != "" {
|
||||
return fmt.Sprintf("%s/refinery", info.Rig)
|
||||
}
|
||||
return "refinery"
|
||||
case RolePolecat:
|
||||
if info.Rig != "" && info.Polecat != "" {
|
||||
return fmt.Sprintf("%s/polecats/%s", info.Rig, info.Polecat)
|
||||
}
|
||||
return "polecat"
|
||||
case RoleCrew:
|
||||
if info.Rig != "" && info.Polecat != "" {
|
||||
return fmt.Sprintf("%s/crew/%s", info.Rig, info.Polecat)
|
||||
}
|
||||
return "crew"
|
||||
default:
|
||||
return string(info.Role)
|
||||
}
|
||||
}
|
||||
|
||||
// getRoleHome returns the canonical home directory for a role.
|
||||
func getRoleHome(role Role, rig, polecat, townRoot string) string {
|
||||
switch role {
|
||||
|
||||
Reference in New Issue
Block a user