fix(mail): use slash-based identity format for addresses

Changes mail identity format from hyphenated (gastown-Toast) to
slash-based (gastown/polecats/Toast) to:
- Match directory structure (REST-like)
- Distinguish from hyphenated bead IDs (gt-xyz) and molecule names

Updated:
- addressToIdentity(): preserve slashes instead of replacing with dashes
- identityToAddress(): simplified, identity == address now
- detectSender(): include /polecats/ in polecat addresses
- Tests updated for new format

Closes gt-cxtu: shared beads architecture verified working.

🤖 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-21 14:27:58 -08:00
parent 00612f6949
commit a3da3302a3
4 changed files with 28 additions and 51 deletions

View File

@@ -554,14 +554,14 @@ func detectSender() string {
return "mayor/"
}
// If in a rig's polecats directory, extract address
// If in a rig's polecats directory, extract address (format: rig/polecats/name)
if strings.Contains(cwd, "/polecats/") {
parts := strings.Split(cwd, "/polecats/")
if len(parts) >= 2 {
rigPath := parts[0]
polecatPath := strings.Split(parts[1], "/")[0]
rigName := filepath.Base(rigPath)
return fmt.Sprintf("%s/%s", rigName, polecatPath)
return fmt.Sprintf("%s/polecats/%s", rigName, polecatPath)
}
}