7.8 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 09-frequency-design-and-group-architecture | 02 | execute | 1 |
|
true |
|
|
Purpose: Per D-04, the auto-assign range must be pushed above all built-in frequencies (max 2449 Hz) to prevent collision. The 51 Hz buffer between 2449 and 2500 guarantees no overlap.
Output: Updated config/config.go constants, updated config/config_test.go assertion.
<execution_context> @$HOME/.claude/get-shit-done/workflows/execute-plan.md @$HOME/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/09-frequency-design-and-group-architecture/09-CONTEXT.md @.planning/phases/09-frequency-design-and-group-architecture/09-RESEARCH.md ```go func autoAssignFreq(className string) float64 { h := fnv.New32a() h.Write([]byte(className)) const ( baseHz = 1200.0 stepHz = 50.0 numSteps = uint32(24) ) return baseHz + float64(h.Sum32()%numSteps)*stepHz } ```func addAutoFreqEntries(cfgs map[classify.TrafficClass]synth.FreqConfig, userRules []classify.Rule, autoClasses map[classify.TrafficClass]bool) {
for _, rule := range userRules {
if _, exists := cfgs[rule.Class]; !exists {
baseHz := autoAssignFreq(string(rule.Class))
cfgs[rule.Class] = synth.FreqConfig{
BaseHz: baseHz,
WaveformType: synth.WaveformSine,
Harmonics: synth.WaveformPresetHarmonics(synth.WaveformSine, baseHz, synth.SampleRate),
Pan: 0.0,
}
autoClasses[rule.Class] = true
}
}
}
if cfg.BaseHz < 1200.0 || cfg.BaseHz > 2350.0 {
t.Errorf("GameServer BaseHz: got %v, want in [1200, 2350]", cfg.BaseHz)
}
a. Change the function comment from [1200, 2350] to [2500, 4000]:
// autoAssignFreq computes a deterministic frequency in [2500, 4000] Hz for a class name
b. Change the constants inside the function:
const (
baseHz = 2500.0
stepHz = 50.0
numSteps = uint32(31) // [2500, 4000] Hz in 50 Hz steps
)
Verification: 2500.0 + float64(30)*50.0 = 4000.0. With numSteps=31, the modulo produces values 0..30, yielding Hz values 2500, 2550, ..., 4000.
- Do NOT modify
addAutoFreqEntries. The Group field will be zero-value""for auto-assigned entries, which is correct — user-defined classes are not part of any built-in family. The struct literal in addAutoFreqEntries does not need aGroup:field because Go zero-initializes missing named fields. cd /home/dev/workspace/yoloyolo && go build ./config/... <acceptance_criteria>- config/config.go contains
baseHz = 2500.0(NOT 1200.0) - config/config.go contains
numSteps = uint32(31)(NOT 24) - config/config.go contains
// autoAssignFreq computes a deterministic frequency in [2500, 4000] Hz - config/config.go still contains
stepHz = 50.0(unchanged) go build ./config/...exits 0 </acceptance_criteria> autoAssignFreq produces frequencies in [2500, 4000] Hz range with 31 steps of 50 Hz
- config/config.go contains
Change from:
if cfg.BaseHz < 1200.0 || cfg.BaseHz > 2350.0 {
t.Errorf("GameServer BaseHz: got %v, want in [1200, 2350]", cfg.BaseHz)
}
To:
if cfg.BaseHz < 2500.0 || cfg.BaseHz > 4000.0 {
t.Errorf("GameServer BaseHz: got %v, want in [2500, 4000]", cfg.BaseHz)
}
-
Also update the test comment at the top of TestAutoFreqAssignment (around line 344-346) from:
// NO [sounds.GameServer] -> FreqCfgs contains "GameServer" entry with BaseHz in [1200, 2350]To:
// NO [sounds.GameServer] -> FreqCfgs contains "GameServer" entry with BaseHz in [2500, 4000] -
Check if
TestAutoFreqSkipsBuiltins(around line 563) referencesBaseHz == 175.0for HTTPS. After Plan 01 rebalances HTTPS to 150.0, this test will need its expected value updated from175.0to150.0. Find the assertion and update it.Search for
175.0in config_test.go and update to150.0wherever it references the built-in HTTPS BaseHz. cd /home/dev/workspace/yoloyolo && go test ./config/... -v -count=1 -run "TestAutoFreq" <acceptance_criteria>- config/config_test.go contains
cfg.BaseHz < 2500.0 || cfg.BaseHz > 4000.0(NOT 1200/2350) - config/config_test.go contains
want in [2500, 4000]in the error message - config/config_test.go contains
BaseHz in [2500, 4000]in the test comment - If HTTPS 175.0 was referenced, it is now 150.0
go test ./config/... -run TestAutoFreqAssignmentexits 0go test ./config/... -run TestAutoFreqDeterministicexits 0go test ./config/... -run TestAutoFreqSkipsBuiltinsexits 0 </acceptance_criteria> All auto-assign test assertions match new [2500, 4000] range; HTTPS built-in reference updated to 150.0 if applicable; all config tests pass
- config/config_test.go contains
<success_criteria>
- autoAssignFreq base is 2500.0 Hz, not 1200.0 (FREQ-04)
- numSteps is 31, producing range [2500, 4000] with 50 Hz steps
- No collision possible between built-in frequencies (max 2449 Hz) and auto-assign (min 2500 Hz)
- All config tests pass with updated assertions </success_criteria>