feat(namepool): auto-select theme per rig based on name hash

Each rig now gets a deterministic theme based on its name instead of
always defaulting to mad-max. Uses a prime multiplier hash (×31) for
good distribution across themes. Same rig name always gets the same
theme. Users can still override with `gt namepool set`.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/joe
2026-01-16 15:35:10 -08:00
committed by Steve Yegge
parent fbc67e89e1
commit 74050cd0ab
3 changed files with 51 additions and 12 deletions

View File

@@ -529,8 +529,9 @@ func TestReconcilePoolWith(t *testing.T) {
defer func() { _ = os.RemoveAll(tmpDir) }()
// Create rig and manager (nil tmux for unit test)
// Use "myrig" which hashes to mad-max theme
r := &rig.Rig{
Name: "testrig",
Name: "myrig",
Path: tmpDir,
}
m := NewManager(r, nil, nil)
@@ -591,8 +592,9 @@ func TestReconcilePoolWith_Allocation(t *testing.T) {
}
defer func() { _ = os.RemoveAll(tmpDir) }()
// Use "myrig" which hashes to mad-max theme
r := &rig.Rig{
Name: "testrig",
Name: "myrig",
Path: tmpDir,
}
m := NewManager(r, nil, nil)
@@ -627,8 +629,9 @@ func TestReconcilePoolWith_OrphanDoesNotBlockAllocation(t *testing.T) {
}
defer func() { _ = os.RemoveAll(tmpDir) }()
// Use "myrig" which hashes to mad-max theme
r := &rig.Rig{
Name: "testrig",
Name: "myrig",
Path: tmpDir,
}
m := NewManager(r, nil, nil)