feat(mayor): add delegation hierarchy guidance to role template
Add explicit guidance on the Mayor → Crew → Polecats delegation model: - Crew are coordinators for epics/goals needing decomposition - Polecats are executors for well-defined tasks - Include decision framework table for work type routing Closes: gt-9jd
This commit is contained in:
@@ -78,6 +78,7 @@ var (
|
||||
convoyCloseReason string
|
||||
convoyCloseNotify string
|
||||
convoyCheckDryRun bool
|
||||
convoyEpic string // --epic: link convoy to parent epic (Goals layer)
|
||||
)
|
||||
|
||||
var convoyCmd = &cobra.Command{
|
||||
|
||||
@@ -398,7 +398,7 @@ func runSling(cmd *cobra.Command, args []string) error {
|
||||
fmt.Printf("Would create convoy 'Work: %s'\n", info.Title)
|
||||
fmt.Printf("Would add tracking relation to %s\n", beadID)
|
||||
} else {
|
||||
convoyID, err := createAutoConvoy(beadID, info.Title)
|
||||
convoyID, err := createAutoConvoy(beadID, info.Title, slingEpic)
|
||||
if err != nil {
|
||||
// Log warning but don't fail - convoy is optional
|
||||
fmt.Printf("%s Could not create auto-convoy: %v\n", style.Dim.Render("Warning:"), err)
|
||||
|
||||
@@ -87,7 +87,7 @@ func runBatchSling(beadIDs []string, rigName string, townBeadsDir string) error
|
||||
if !slingNoConvoy {
|
||||
existingConvoy := isTrackedByConvoy(beadID)
|
||||
if existingConvoy == "" {
|
||||
convoyID, err := createAutoConvoy(beadID, info.Title)
|
||||
convoyID, err := createAutoConvoy(beadID, info.Title, slingEpic)
|
||||
if err != nil {
|
||||
fmt.Printf(" %s Could not create auto-convoy: %v\n", style.Dim.Render("Warning:"), err)
|
||||
} else {
|
||||
|
||||
@@ -61,8 +61,9 @@ func isTrackedByConvoy(beadID string) string {
|
||||
}
|
||||
|
||||
// createAutoConvoy creates an auto-convoy for a single issue and tracks it.
|
||||
// If epicID is provided, links the convoy to the parent epic.
|
||||
// Returns the created convoy ID.
|
||||
func createAutoConvoy(beadID, beadTitle string) (string, error) {
|
||||
func createAutoConvoy(beadID, beadTitle string, epicID string) (string, error) {
|
||||
townRoot, err := workspace.FindFromCwd()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("finding town root: %w", err)
|
||||
@@ -77,6 +78,9 @@ func createAutoConvoy(beadID, beadTitle string) (string, error) {
|
||||
// Create convoy with title "Work: <issue-title>"
|
||||
convoyTitle := fmt.Sprintf("Work: %s", beadTitle)
|
||||
description := fmt.Sprintf("Auto-created convoy tracking %s", beadID)
|
||||
if epicID != "" {
|
||||
description += fmt.Sprintf("\nParent-Epic: %s", epicID)
|
||||
}
|
||||
|
||||
createArgs := []string{
|
||||
"create",
|
||||
@@ -109,6 +113,19 @@ func createAutoConvoy(beadID, beadTitle string) (string, error) {
|
||||
fmt.Printf("%s Could not add tracking relation: %v\n", style.Dim.Render("Warning:"), err)
|
||||
}
|
||||
|
||||
// Link convoy to parent epic if specified (Goals layer)
|
||||
if epicID != "" {
|
||||
epicDepArgs := []string{"--no-daemon", "dep", "add", convoyID, epicID, "--type=child_of"}
|
||||
epicDepCmd := exec.Command("bd", epicDepArgs...)
|
||||
epicDepCmd.Dir = townBeads
|
||||
epicDepCmd.Stderr = os.Stderr
|
||||
|
||||
if err := epicDepCmd.Run(); err != nil {
|
||||
// Epic link failed - log warning but continue
|
||||
fmt.Printf("%s Could not link convoy to epic: %v\n", style.Dim.Render("Warning:"), err)
|
||||
}
|
||||
}
|
||||
|
||||
return convoyID, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user