Commit Graph
35 Commits
Author SHA1 Message Date
gurix 1aaa15de0b feat(02-01): implement synth config, oscillator, and layer
- synth/config.go: FreqConfig, HarmonicDef types; ClassFreqConfigs for all 11 traffic classes
  with frequencies in 60-800 Hz using musical intervals; pan positions per D-12
- synth/oscillator.go: phase-accumulator oscillator with additive harmonic synthesis
  and phase subtraction wrap (not math.Mod) per D-05
- synth/layer.go: EMA amplitude smoothing with tau-based alpha; whisper floor (0.03)
  prevents silence once class has been seen; UpdateTarget/AdvanceSample interface
- All 12 tests pass (TestAllClassesHaveConfig, TestFrequenciesUnique, TestEMAAmplitudeRise, etc.)
2026-03-26 11:58:44 +01:00
gurix bb13527281 test(02-01): add failing tests for synth config, oscillator, and layer
- TestAllClassesHaveConfig, TestFrequenciesInRange, TestFrequenciesUnique
- TestHarmonicsNonEmpty, TestPanPositionsInRange
- TestOscillatorAdvance, TestOscillatorPhaseWrap, TestOscillatorDistinctFreqs
- TestEMAAmplitudeRise, TestEMAAmplitudeDecay, TestWhisperFloor, TestWhisperFloorNotSeenIsZero
2026-03-26 11:57:43 +01:00
gurix dc7aed2498 chore(02-01): install gcc, ffprobe, and go-lame dependency
- Add github.com/sjzar/go-lame v0.0.9 to go.mod for MP3 encoding
- gcc and ffprobe available via apt (gcc 13.3.0, ffprobe 6.1.1)
- CGO_ENABLED=1 build verified successful
2026-03-26 11:56:43 +01:00
gurix 6cbf0366da fix(02): revise plans based on checker feedback 2026-03-26 11:44:32 +01:00
gurix 08f1a87a54 docs(02): create phase plan — 3 plans across 3 waves 2026-03-26 11:36:43 +01:00
gurixandClaude Sonnet 4.6 0e74f94782 docs(02): research audio synthesis engine phase
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 11:29:55 +01:00
gurix d80483835d docs(state): record phase 2 context session 2026-03-26 11:19:48 +01:00
gurix 339c03c4eb docs(02): capture phase context 2026-03-26 11:19:39 +01:00
gurix b1fbae0a23 docs(phase-01): evolve PROJECT.md after phase completion 2026-03-25 13:22:29 +01:00
gurix 58632cc318 docs(phase-01): complete phase execution 2026-03-25 13:22:08 +01:00
gurix b13e375509 chore: add .gitignore to exclude built netsynth binary 2026-03-25 13:18:37 +01:00
gurixandClaude Sonnet 4.6 b21d40318a docs(01-04): complete CLI integration plan — Phase 1 done
- Create 01-04-SUMMARY.md for Cobra CLI wiring plan
- Update STATE.md: advance to ready_for_verification, record decisions, session
- Update ROADMAP.md: Phase 1 all 4/4 plans complete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 13:18:27 +01:00
gurix 1be56a5a35 feat(01-04): wire Cobra CLI with capture-classify-aggregate pipeline
- cmd/netsynth/main.go: Cobra root command with -i, --list-interfaces, --verbose flags
- Signal handling via signal.NotifyContext for clean Ctrl+C shutdown
- 3-stage pipeline: capture.StartCapture -> classify.NewClassifier -> aggregate.Aggregate
- Permission errors surface platform-specific sudo/setcap hint (CAPT-04)
- --verbose flag wires aggregate.PrintWindowLine callback for per-window output
- Exit summary via aggregate.PrintSummary with dropped packet warning
- cmd/netsynth/main_test.go: 3 tests covering flag parsing and help output
- go.mod: cobra v1.10.2 and go-pcap promoted to direct dependencies
2026-03-25 12:22:10 +01:00
gurix 2b0d418ba7 docs(01-02): complete capture package plan
- Add 01-02-SUMMARY.md with capture package implementation details
- Mark requirements CAPT-01, CAPT-02, CAPT-04 complete in REQUIREMENTS.md
2026-03-25 12:19:54 +01:00
gurix 31564ba0f5 docs(01-03): complete aggregation and stats reporting plan
- Add 01-03-SUMMARY.md with window aggregator and formatting outcomes
- Advance STATE.md plan counter to 3/4, update progress to 75%
- Record execution metrics: 8min, 2 tasks, 4 files
- Mark CLAS-03 and CLAS-04 requirements complete in REQUIREMENTS.md
- Update ROADMAP.md phase 1 progress (3/4 summaries)
2026-03-25 12:19:04 +01:00
gurix f2bebaf554 feat(01-03): implement exit summary and verbose window output formatting
- Add PrintSummary writing per-protocol packet counts with percentages and TOTAL to io.Writer
- Add PrintWindowLine writing single verbose window activity line in [window N] CLASS:count format
- Add AccumulateTotals merging WindowSnapshot counts into cumulative totals map
- Output sorted alphabetically for deterministic display
- Add 6 tests: PrintSummary, PrintSummaryEmpty, PrintSummarySorted, PrintWindowLine, PrintWindowLineEmpty, AccumulateTotals
2026-03-25 12:17:28 +01:00
gurix 9446dd5c27 feat(01-02): implement capture package with OpenCapture, ListInterfaces, StartCapture
- ListInterfaces uses net.Interfaces() stdlib (no pcap dependency for listing)
- OpenCapture wraps packetcap/go-pcap with platform-specific permission error handling
- StartCapture uses buffered channel (512) with atomic drop counter
- Dynamic link type detection via layers.LinkType(handle.LinkType())
- Linux error shows setcap cap_net_raw+ep hint; macOS shows sudo hint
- Add github.com/packetcap/go-pcap v0.0.0-20251215 to go.mod
2026-03-25 12:17:16 +01:00
gurix 2a8fd7dd05 feat(01-03): implement ticker-driven window aggregator with TDD
- Add Aggregate function reading ClassifiedPackets, emitting WindowSnapshots per time window
- Add DefaultWindowMs=500 constant for configurable window duration
- Flush partial window on done channel close or closed events channel
- Call optional onSnapshot callback per window for verbose mode
- Add 5 tests: EmitsSnapshot, MultipleClasses, DoneFlushesPartial, EmptyWindow, WindowIndex
2026-03-25 12:16:36 +01:00
gurix 1eb1dd4104 test(01-02): add failing tests for capture package
- TestListInterfaces: verifies net.Interfaces() returns at least 1 interface
- TestListInterfacesFormat: verifies interface Name is non-empty
- TestIsPermissionError: table-driven positive cases for perm error detection
- TestIsPermissionErrorNegative: non-perm errors not flagged
- TestPermissionErrorMsg: verifies sudo + interface name + Linux setcap hint
2026-03-25 12:16:20 +01:00
gurix df5fea717b docs(01-01): complete bootstrap and protocol classification plan
- Add 01-01-SUMMARY.md documenting outcomes, commits, and decisions
- STATE.md: advance to plan 2/4, record metrics, add key decisions
- ROADMAP.md: update phase 1 progress (1/4 plans complete)
- REQUIREMENTS.md: mark CLAS-01 complete
2026-03-25 12:14:33 +01:00
gurix 25e0dc3ece chore(01-01): tidy go.mod after classifier implementation
- go mod tidy updates go.mod to reflect actual imports
- gopacket is now a direct dependency (used in classifier.go)
- go-pcap and cobra remain in go.sum for future plans
2026-03-25 12:13:01 +01:00
gurix 48ef6e53ad feat(01-01): implement config-driven classifier with 12 protocol rules
- Add classify/rules.go: Rule struct and DefaultRules slice with 12 rules
  (10 specific protocol rules + 2 catch-alls for other-TCP/other-UDP)
- Add classify/classifier.go: Classifier with NewClassifier and Classify methods
- Config-driven slice (not switch) per D-02; first-match-wins ordering
- Returns ClassUnknown for non-TCP/UDP/ICMP traffic per D-03
- All 14 tests pass covering all 11 traffic classes
2026-03-25 12:12:47 +01:00
gurix f233e80f4b test(01-01): add failing tests for all 11 protocol classification classes
- Tests for ICMP, DNS/UDP, DNS/TCP, HTTPS, HTTP, SSH, SMTP, NTP, DHCP(67/68),
  other-TCP, other-UDP, unknown
- Test for order-dependent first-match-wins rule behavior
- Uses gopacket SerializeLayers to build synthetic packets
2026-03-25 12:12:01 +01:00
gurix 15e8143389 feat(01-01): install Go 1.24, initialize module, create shared types
- Initialize Go module github.com/netsynth/netsynth with Go 1.24.1
- Create classify/types.go with 11 TrafficClass constants (ICMP, DNS, HTTPS,
  HTTP, SSH, SMTP, NTP, DHCP, other-TCP, other-UDP, unknown)
- Add ClassifiedPacket and WindowSnapshot shared types
- Add Phase 1 dependencies: gopacket v1.5.0, go-pcap, cobra v1.10.2
2026-03-25 12:11:02 +01:00
gurix 46422dfa29 Initial project setup with planning artifacts 2026-03-25 12:08:45 +01:00
gurix 5d657342d3 docs(01-capture-and-classification): create phase plan 2026-03-25 11:30:21 +01:00
gurix dc5716db25 docs(phase-1): add validation strategy 2026-03-25 11:23:37 +01:00
gurixandClaude Sonnet 4.6 55f74b66cb docs(phase-01): research capture and classification phase
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 11:22:54 +01:00
gurix dc45e97431 docs(state): record phase 1 context session 2026-03-25 11:14:58 +01:00
gurix d043180f88 docs(01): capture phase context 2026-03-25 11:14:49 +01:00
gurix 012791cb6f docs: create roadmap (4 phases) 2026-03-24 22:43:51 +01:00
gurix 4e4bc6ce0f docs: define v1 requirements 2026-03-24 22:41:08 +01:00
gurix e8ec6ad6b6 docs: complete project research 2026-03-24 22:36:28 +01:00
gurix 2898b787b2 chore: add project config 2026-03-24 22:29:00 +01:00
gurix 4a183cdb65 docs: initialize project 2026-03-24 22:27:26 +01:00