Commit Graph
129 Commits
Author SHA1 Message Date
gurix ceba57ed0e docs(08): research phase test and constant cleanup 2026-03-27 08:46:43 +01:00
gurix 5a7855f3ff docs(state): record phase 8 context session 2026-03-27 08:43:14 +01:00
gurix 467d415e94 docs(08): capture phase context 2026-03-27 08:43:01 +01:00
gurixandClaude Opus 4.6 8e565ec640 docs: create milestone v1.2 roadmap (4 phases, 18 requirements)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:38:08 +01:00
gurixandClaude Opus 4.6 47b6e171c4 docs: define milestone v1.2 requirements (18 requirements)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:29:46 +01:00
gurix 6b26be825c docs: complete project research 2026-03-27 08:25:02 +01:00
gurixandClaude Opus 4.6 6de2fcbb99 docs: start milestone v1.2 Extended Protocol Coverage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:07:14 +01:00
gurixandClaude Opus 4.6 6610366c2f chore: archive v1.1 phase directories to milestones
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 22:06:36 +01:00
gurixandClaude Opus 4.6 175ff96404 chore: complete v1.1 milestone — Custom Sound Mappings
Archive roadmap and requirements to milestones/, update PROJECT.md
with shipped state, collapse ROADMAP.md, update retrospective.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v1.1
2026-03-26 22:05:09 +01:00
gurixandClaude Opus 4.6 5391207b37 docs(phase-07): evolve PROJECT.md after phase completion
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 21:56:40 +01:00
gurixandClaude Opus 4.6 072773c0df docs(phase-07): complete phase execution
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 21:56:10 +01:00
gurix 3eebb0f590 docs(07-02): complete print-config and LoadResult wiring plan
- SUMMARY.md for plan 02: PrintConfig + CLI wiring
- STATE.md: updated progress (100%), metrics, decisions, session
- ROADMAP.md: Phase 7 marked Complete (2/2 summaries)
- REQUIREMENTS.md: CFG-06 marked complete
2026-03-26 21:52:44 +01:00
gurix b52e36b579 feat(07-02): implement PrintConfig function with comment annotations
- Add AutoClasses map[TrafficClass]bool to LoadResult for tracking auto-assigned classes
- PrintConfig() returns commented TOML with header (source, date), [[rules]] section, [sounds.*] section
- waveformString() helper converts WaveformType back to string
- classAnnotation() returns default/override/auto-assigned per class
- Built-in classes emitted in AllClasses() order; user-defined classes sorted alphabetically
- Rules section emits [[rules]] blocks; port omitted when DstPort==0
- Tests: TestPrintConfigContainsAllClasses, TestPrintConfigSourcePath, TestPrintConfigNoSourcePath,
  TestPrintConfigContainsRules, TestPrintConfigRuleNoPort, TestPrintConfigDefaultAnnotation,
  TestPrintConfigOverrideAnnotation, TestPrintConfigAutoAssignedAnnotation
2026-03-26 21:51:27 +01:00
gurix d43914f869 feat(07-02): wire LoadResult into main.go and add --print-config flag
- Add printConfig bool var and --print-config flag registration
- runPrintConfig() early-exit before interface-required check (CFG-06)
- runLiveMode and runPcapMode accept config.LoadResult; user rules prepend via append(result.UserRules, classify.DefaultRules...)
- Remove unused synth import from main.go
- Add TestPrintConfigFlagRegistered, TestPrintConfigNoInterface, TestPrintConfigWithConfigFile
- newTestCmd() wires --print-config and --config flags through PersistentPreRunE
2026-03-26 21:51:19 +01:00
gurix 9e71a805b8 docs(07-01): complete config rule parsing and LoadResult plan
- Add 07-01-SUMMARY.md
- Advance STATE.md to plan 2 of 2, progress 83%
- Update ROADMAP.md: phase 7 in progress (1/2 summaries)
- Mark RULE-01, RULE-02, RULE-03 complete in REQUIREMENTS.md
2026-03-26 21:46:13 +01:00
gurix 4b365cd5f4 feat(07-01): add RawRule, LoadResult, validation, auto-freq to config package
- Add RawRule struct with Port *uint16, Protocol, Class fields
- Add LoadResult struct with FreqCfgs, UserRules, ConfigPath fields
- Change Load() signature to return LoadResult instead of bare map
- Add validateRules: checks protocol required, class required, valid protocols
- Add convertRules: converts RawRule slices to classify.Rule slices
- Add autoAssignFreq: FNV-32a deterministic Hz in [1200-2350] range
- Add addAutoFreqEntries: creates FreqConfig for new class names, skips built-ins
- Reorder ops: addAutoFreqEntries before merge so sounds overrides apply to user classes
- Update main.go call site to use LoadResult.FreqCfgs
- Update all 8 existing tests to use LoadResult return type
- Add 13 new tests covering rule parsing, validation, auto-freq, and LoadResult
2026-03-26 21:44:53 +01:00
gurix 006e465b1e docs(07): create phase plan 2026-03-26 21:38:56 +01:00
gurixandClaude Opus 4.6 050d67d9f1 docs(phase-07): add research and validation strategy
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 21:34:27 +01:00
gurixandClaude Sonnet 4.6 e15972055d docs(07): research phase domain
Research for Phase 7 custom rules and print-config. Covers TOML array-of-tables parsing behavior, LoadResult struct design, FNV-32a auto-frequency algorithm, and print-config implementation patterns. All verified against existing source code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 21:33:11 +01:00
gurix 6cbfb66ef2 docs(state): record phase 7 context session 2026-03-26 21:27:34 +01:00
gurix fe372c8dc8 docs(07): capture phase context 2026-03-26 21:27:29 +01:00
gurixandClaude Opus 4.6 dddfb1b444 docs: update README and PROJECT.md to reflect Phase 6 completion
Add custom sound configuration section covering TOML config files,
auto-discovery, available waveforms, and validation behavior. Update
flags table, project structure, dependencies, and sound design table
with accurate frequencies. Add README update step to evolution checklist.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 21:14:30 +01:00
gurix c3d78624ba docs(phase-06): evolve PROJECT.md after phase completion 2026-03-26 21:09:02 +01:00
gurix 6065bfcd90 docs(phase-06): complete phase execution 2026-03-26 21:08:49 +01:00
gurix e3487c5c94 docs(06-02): complete CLI config wiring plan summary and state updates 2026-03-26 21:05:50 +01:00
gurix 413cceb1eb feat(06-02): wire --config flag and config.Load into CLI pipeline
- Add configPath string var and --config flag to Cobra command
- Import config and synth packages in main.go
- Call config.Load(configPath) in run() before capture (D-11 fail fast)
- Change runLiveMode and runPcapMode signatures to accept freqCfgs map
- Pass freqCfgs to encode.RunSynthesis in both live and pcap modes
2026-03-26 21:04:11 +01:00
gurix 3dfcbbeaf5 feat(06-02): add freqCfgs parameter to RunSynthesis
- Change RunSynthesis signature to accept injected config map (D-10)
- Replace hardcoded synth.ClassFreqConfigs with passed-in freqCfgs
- Update all three RunSynthesis calls in encode tests to pass synth.ClassFreqConfigs
2026-03-26 21:02:35 +01:00
gurix 936aeeafd8 merge: resolve STATE.md conflict from wave 1 (keep executor version) 2026-03-26 21:00:15 +01:00
gurix 1986e8fc2e docs(06-01): complete config package plan summary and state updates
- 06-01-SUMMARY.md: TOML config loader with partial merge and unknown-key detection
- STATE.md: advanced to Plan 1 complete, added Phase 06-01 decisions and metrics
- ROADMAP.md: updated Phase 6 plan progress (1/2 plans complete)
- REQUIREMENTS.md: marked CFG-01, CFG-02, CFG-04, CFG-05 complete
2026-03-26 20:59:46 +01:00
gurix 1f877e7574 feat(06-01): implement config package with TOML load, merge, validate
- Load() discovers, parses, validates, and merges TOML config over defaults
- SoundOverride struct with *float64/*string pointer fields for partial-merge (CFG-04)
- parseFile uses BurntSushi/toml DecodeFile + Undecoded() for unknown-key errors (CFG-05)
- discoverPath probes ./netsynth.toml then ~/.config/netsynth/config.toml (CFG-02)
- merge applies non-nil overrides per class; warns on unknown class names (D-09)
- parseWaveform maps sine/square/sawtooth/triangle strings to WaveformType
- Harmonics regenerated via WaveformPresetHarmonics when waveform/frequency changes
- All 9 tests pass; go vet clean
2026-03-26 20:57:00 +01:00
gurix b9ec05aebc test(06-01): add failing tests for config package TOML load, merge, validate
- 9 table-driven tests covering CFG-01 through CFG-05
- TestLoadPartialOverrideFrequency, TestLoadPartialOverrideWaveform, TestLoadBothOverrides
- TestLoadUnknownKey, TestLoadNoConfig, TestLoadExplicitMissing
- TestLoadUnknownClass, TestLoadInvalidWaveform, TestLoadAllDefaultsPresent
- Stub config.Load returns nil,nil — all tests fail (RED)
2026-03-26 20:56:03 +01:00
gurix 0d9508e920 docs(06): create phase plan 2026-03-26 20:51:07 +01:00
gurix ece532b053 docs(phase-6): add validation strategy 2026-03-26 20:46:43 +01:00
gurix 21ebc5cdda docs(06): research phase domain 2026-03-26 20:45:56 +01:00
gurix 34f922cf95 docs(state): record phase 6 context session 2026-03-26 20:39:17 +01:00
gurix c1ab8e1777 docs(06): capture phase context 2026-03-26 20:39:08 +01:00
gurix 4ec9c64ee1 docs(phase-05): evolve PROJECT.md after phase completion 2026-03-26 17:42:52 +01:00
gurix d915c3cd11 docs(phase-05): complete phase execution 2026-03-26 17:42:35 +01:00
gurix d436ef154d Merge branch 'worktree-agent-a9867cbf' 2026-03-26 17:40:03 +01:00
gurix 8e357cf432 docs(05-02): complete bank-decoupling plan — SUMMARY, STATE, ROADMAP updated 2026-03-26 17:39:48 +01:00
gurix b2b5ab679b test(05-02): update tests for new NewBank signature and dynamic gain
- All NewBank calls updated to two-argument form passing ClassFreqConfigs
- TestMixerNoClip iterates ClassFreqConfigs keys instead of classify.AllClasses()
- TestNewBankDynamicGain verifies gainPerLayer=1/N for 3-class custom config
- TestNewBankCustomConfigNoClip verifies no-clip guarantee with 2-class config
- TestNumLayersMatchesAllClasses now asserts len(ClassFreqConfigs) == len(AllClasses())
2026-03-26 17:38:37 +01:00
gurix 43307c31d5 feat(05-02): decouple NewBank from global config and fix dynamic GainPerLayer
- NewBank now accepts (tau float64, cfgs map[classify.TrafficClass]FreqConfig)
- gainPerLayer field added to OscillatorBank, computed as 1.0/float64(len(cfgs))
- RenderWindow UpdateTarget loop iterates b.layers (not classify.AllClasses())
- RenderWindow render loop uses b.gainPerLayer (not GainPerLayer constant)
- encode/mp3.go updated to pass synth.ClassFreqConfigs as default config map
2026-03-26 17:37:44 +01:00
gurix a94ffdd8ef Merge branch 'worktree-agent-a46f9aac' 2026-03-26 17:36:22 +01:00
gurix 5e31da5442 docs(05-01): complete waveform types plan summary and state updates 2026-03-26 17:35:54 +01:00
gurix 7f6471426f feat(05-01): wire waveform resolution into NewLayer at construction time
- NewLayer resolves WaveformPresetHarmonics when cfg.WaveformType != WaveformCustom
- Preset harmonics stored in Layer.Config so AdvanceSample uses them unchanged
- WaveformCustom path preserves existing hand-tuned harmonics (backward compatible)
- TestNewLayerResolvesWaveformPreset: verifies preset fills harmonics on construction
- TestNewLayerPreservesCustomHarmonics: verifies hand-tuned harmonics are untouched
- TestSineRegressionVsCustomHarmonics: verifies WaveformSine == {Ratio:1,Amp:1.0}
- All 41 synth tests pass, encode tests unaffected
2026-03-26 17:34:45 +01:00
gurix 82d1e37d0f feat(05-01): add WaveformType enum and WaveformPresetHarmonics function
- WaveformType int with five constants: WaveformCustom (0), WaveformSine,
  WaveformSquare, WaveformSawtooth, WaveformTriangle
- WaveformPresetHarmonics generates bandlimited harmonic series for each type
- WaveformCustom returns nil to preserve existing hand-tuned harmonics
- All generated harmonics are below Nyquist (sampleRate/2)
- FreqConfig gains WaveformType field (zero value = WaveformCustom)
- ClassFreqConfigs converted to named fields (required for new struct field)
- All existing synth tests continue to pass (38 tests total)
2026-03-26 17:34:02 +01:00
gurix 88dee31264 test(05-01): add failing tests for WaveformType and WaveformPresetHarmonics
- TestWaveformPresetHarmonics_Sine: expects exactly {Ratio:1, Amplitude:1.0}
- TestWaveformPresetHarmonics_Square: expects odd harmonics with 1/k amplitude below Nyquist
- TestWaveformPresetHarmonics_Sawtooth: expects all harmonics with 1/k amplitude below Nyquist
- TestWaveformPresetHarmonics_Triangle: expects odd harmonics with alternating 1/k^2 amplitude
- TestWaveformPresetHarmonics_Custom: expects nil return
- TestBandlimitedHarmonicsNoAliasing: checks all ClassFreqConfigs entries at all waveform types
- TestWaveformPresetHarmonics_SquareOddOnly: odd ratios only
- TestWaveformPresetHarmonics_TriangleOddOnly: odd ratios only
- TestWaveformPresetHarmonics_SawtoothConsecutive: consecutive ratios starting at 1
2026-03-26 17:33:03 +01:00
gurix 716ffa82ee docs(05): create phase plan 2026-03-26 17:26:46 +01:00
gurix 9fe5d37f1e docs(phase-5): add validation strategy 2026-03-26 17:22:13 +01:00
gurix f0821f062d docs(05): research phase domain 2026-03-26 17:21:21 +01:00