diff --git a/home/roles/development/default.nix b/home/roles/development/default.nix index 16681a8..96bfa97 100644 --- a/home/roles/development/default.nix +++ b/home/roles/development/default.nix @@ -41,11 +41,45 @@ let 'if AddressToIdentity(agentBeadToAddress(agent)) == AddressToIdentity(identity) {' # Fix agentBeadToAddress to use title field for hq- prefixed beads + # Title should contain the address (e.g., "java/crew/americano") substituteInPlace internal/mail/router.go \ --replace-fail \ 'return parseAgentAddressFromDescription(bead.Description)' \ 'if bead.Title != "" && strings.Contains(bead.Title, "/") { return bead.Title }; return parseAgentAddressFromDescription(bead.Description)' + # Fix agentBeadToAddress to handle rig-specific prefixes (j-, sc-, etc.) + # Bead IDs like j-java-crew-americano should map to java/crew/americano + substituteInPlace internal/mail/router.go \ + --replace-fail \ + '// Handle gt- prefixed IDs (legacy format) + if !strings.HasPrefix(id, "gt-") { + return "" // Not a valid agent bead ID + }' \ + '// Handle rig-specific prefixes: --- + // Examples: j-java-crew-americano -> java/crew/americano + idParts := strings.Split(id, "-") + if len(idParts) >= 3 { + for i, part := range idParts { + if part == "crew" || part == "polecat" || part == "polecats" { + if i >= 1 && i < len(idParts)-1 { + rig := idParts[i-1] + name := strings.Join(idParts[i+1:], "-") + return rig + "/" + part + "/" + name + } + } + if part == "witness" || part == "refinery" { + if i >= 1 { + return idParts[i-1] + "/" + part + } + } + } + } + + // Handle gt- prefixed IDs (legacy format) + if !strings.HasPrefix(id, "gt-") { + return "" // Not a valid agent bead ID + }' + # Fix crew/polecat home paths: remove incorrect /rig suffix substituteInPlace internal/cmd/role.go \ --replace-fail \