feat: Add slot fields to Issue struct and set role slot on create

- Add HookBead and RoleBead fields to Issue struct for JSON unmarshal
- CreateAgentBead now calls bd slot set to set role slot properly
- This ensures role_bead is stored as a first-class field, not just
  embedded in description text

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-29 14:05:20 -08:00
parent c6ba5361ad
commit 52e9b48400

View File

@@ -78,6 +78,10 @@ type Issue struct {
Blocks []string `json:"blocks,omitempty"`
BlockedBy []string `json:"blocked_by,omitempty"`
// Agent bead slots (type=agent only)
HookBead string `json:"hook_bead,omitempty"` // Current work attached to agent's hook
RoleBead string `json:"role_bead,omitempty"` // Role definition bead (shared)
// Counts from list output
DependencyCount int `json:"dependency_count,omitempty"`
DependentCount int `json:"dependent_count,omitempty"`
@@ -624,6 +628,14 @@ func (b *Beads) CreateAgentBead(id, title string, fields *AgentFields) (*Issue,
return nil, fmt.Errorf("parsing bd create output: %w", err)
}
// Set the role slot if specified (this is the authoritative storage)
if fields != nil && fields.RoleBead != "" {
if _, err := b.run("slot", "set", id, "role", fields.RoleBead); err != nil {
// Non-fatal: warn but continue
fmt.Printf("Warning: could not set role slot: %v\n", err)
}
}
return &issue, nil
}