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:
committed by
Steve Yegge
parent
fbc67e89e1
commit
74050cd0ab
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user