Town-level services (Mayor, Deacon) now use hq- prefix instead of gt-: - hq-mayor (was gt-mayor) - hq-deacon (was gt-deacon) This distinguishes town-level sessions from rig-level sessions which continue to use gt- prefix (gt-gastown-witness, gt-gastown-crew-max, etc). Changes: - session.MayorSessionName() returns "hq-mayor" - session.DeaconSessionName() returns "hq-deacon" - ParseSessionName() handles both hq- and gt- prefixes - categorizeSession() handles both prefixes - categorizeSessions() accepts both prefixes - Updated all tests and documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
35 lines
841 B
Go
35 lines
841 B
Go
package cmd
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestAddressToAgentBeadID(t *testing.T) {
|
|
tests := []struct {
|
|
address string
|
|
expected string
|
|
}{
|
|
// Mayor and deacon use hq- prefix (town-level)
|
|
{"mayor", "hq-mayor"},
|
|
{"deacon", "hq-deacon"},
|
|
{"gastown/witness", "gt-gastown-witness"},
|
|
{"gastown/refinery", "gt-gastown-refinery"},
|
|
{"gastown/alpha", "gt-gastown-polecat-alpha"},
|
|
{"gastown/crew/max", "gt-gastown-crew-max"},
|
|
{"beads/witness", "gt-beads-witness"},
|
|
{"beads/beta", "gt-beads-polecat-beta"},
|
|
// Invalid addresses should return empty string
|
|
{"invalid", ""},
|
|
{"", ""},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(tt.address, func(t *testing.T) {
|
|
got := addressToAgentBeadID(tt.address)
|
|
if got != tt.expected {
|
|
t.Errorf("addressToAgentBeadID(%q) = %q, want %q", tt.address, got, tt.expected)
|
|
}
|
|
})
|
|
}
|
|
}
|