Commit Graph
83 Commits
Author SHA1 Message Date
gurix 5e31da5442 docs(05-01): complete waveform types plan summary and state updates 2026-03-26 17:35:54 +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
gurix de43a132fb docs(state): record phase 5 context session 2026-03-26 17:11:17 +01:00
gurix 7ced25ae70 docs(05): capture phase context 2026-03-26 17:11:11 +01:00
gurix 8cb5120666 docs: create milestone v1.1 roadmap (3 phases) 2026-03-26 17:04:26 +01:00
gurix c5478d962d docs: define milestone v1.1 requirements 2026-03-26 17:00:58 +01:00
gurix d413d1243f docs: complete project research 2026-03-26 16:54:31 +01:00
gurix 8651c47b0f docs: start milestone v1.1 Custom Sound Mappings 2026-03-26 16:44:15 +01:00
gurixandClaude Opus 4.6 41e22788fc docs: add README with usage, architecture, and build instructions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:29:14 +01:00
gurixandClaude Opus 4.6 1230fd1b9d chore: archive v1.0 MVP milestone
Archive roadmap and requirements to milestones/, reorganize ROADMAP.md,
evolve PROJECT.md with shipped state, create retrospective.

4 phases, 11 plans, 16/16 requirements — all complete.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:23:04 +01:00
gurix c8659d0579 docs(phase-04): evolve PROJECT.md after phase completion 2026-03-26 14:45:59 +01:00
gurix a1c2c5431d docs(phase-04): complete phase execution 2026-03-26 14:45:36 +01:00
gurix c139d68352 docs(04-02): complete CLI flag wiring plan summary and state updates
- 04-02-SUMMARY.md: --filter and --read flags wired, pcap mode, deriveOutputPath
- STATE.md: advanced to plan 2/2, updated decisions, session record
- ROADMAP.md: phase 4 marked Complete (2/2 plans)
2026-03-26 14:42:33 +01:00
gurix 4adb3c4cb2 feat(04-02): wire --filter and --read flags into CLI with branching run logic
- Add bpfFilter and readPath global vars with flag registration
- Add deriveOutputPath helper: capture.pcap -> capture.mp3 (D-05)
- run() validates mutual exclusion of --read and -i (D-03)
- run() pre-validates BPF filter via capture.ValidateBPFFilter before capture (CAPT-05)
- runLiveMode: extracts existing live pipeline, passes bpfFilter to StartCapture
- runPcapMode: reads pcap with ReadPcapFile, classifies with timestamps, AggregatePcap, encodes
- Bookend messages: 'Reading <file>...' at start, 'Saved...' at end (D-06)
- --verbose supported in pcap mode via onSnapshot callback (D-07)
- Empty pcap produces clear error with file path (Pitfall 4)
2026-03-26 14:41:02 +01:00
gurix 09e78bf151 test(04-02): add failing tests for --filter, --read flags, mutual exclusion, deriveOutputPath
- TestFlagMutualExclusion: --read and -i together returns mutually exclusive error
- TestMissingSource: no source returns interface required error mentioning --read
- TestDeriveOutputPath: pcap->mp3 filename derivation
- TestFilterFlagRegistered: --filter flag present
- TestReadFlagRegistered: --read flag present
- TestInvalidBPFFilter: invalid BPF filter errors before capture
- TestHelpOutputNewFlags: --help shows --filter and --read
2026-03-26 14:39:05 +01:00
gurix 0f15d9fca4 docs(04-01): complete BPF/pcap-reader plan summary and state updates
- Create 04-01-SUMMARY.md for BPF validation, pcap reading, timestamp aggregation
- Update STATE.md: advance plan, record metrics, add decisions, update session
- Update ROADMAP.md: phase 4 progress to 1/2 plans complete
- Mark CAPT-05, CAPT-06 requirements complete in REQUIREMENTS.md
2026-03-26 14:36:07 +01:00
gurix d13844f219 feat(04-01): add AggregatePcap with timestamp-based windowing and gap-filling
- Add AggregatePcap to aggregate/window.go: reads ClassifiedPackets from channel,
  assigns to time windows using Timestamp field (D-01), fills gaps with empty
  snapshots (D-02: silence), fires onSnapshot callback per window (D-07)
- Add 7 tests covering basic, multiple windows, gaps, empty input, WindowIndex,
  class counts, and onSnapshot callback
- All tests pass
2026-03-26 14:34:43 +01:00
gurix 52c601019b feat(04-01): add BPF validation, pcap reading, Timestamp field, and filter support
- Add Timestamp time.Time field to ClassifiedPacket (classify/types.go)
- Create capture/bpf.go: ValidateBPFFilter and CompileSoftwareBPF
- Create capture/pcap_reader.go: ReadPcapFile with optional software BPF filter
- Update OpenCapture and StartCapture to accept filter string param
- Update cmd/netsynth/main.go to pass empty filter to StartCapture
- All new tests pass; existing tests unaffected
2026-03-26 14:33:29 +01:00
gurix 38c74415ed docs(04): create phase plan 2026-03-26 14:25:52 +01:00
gurix 5be2b48d1a docs(phase-4): add validation strategy 2026-03-26 14:19:56 +01:00
gurix 22b5ffe0f2 docs(04): research phase BPF filter and pcap file reading 2026-03-26 14:19:09 +01:00
gurix 080da82fa0 docs(state): record phase 4 context session 2026-03-26 14:09:16 +01:00
gurix 72702254b9 docs(04): capture phase context 2026-03-26 14:09:07 +01:00
gurix 0950216729 docs(phase-03): evolve PROJECT.md after phase completion 2026-03-26 13:47:58 +01:00
gurix 3a03606249 docs(phase-03): complete phase execution 2026-03-26 13:47:29 +01:00
gurix 5e60117f2b docs(03-02): complete pipeline-integration MVP plan
- Add 03-02-SUMMARY.md with end-to-end pipeline wiring results
- Update STATE.md: session, decisions, metrics, progress
- Update ROADMAP.md: phase 3 plan progress
- Mark CAPT-03 requirement complete in REQUIREMENTS.md
2026-03-26 13:16:55 +01:00
gurix 0ab2c6e316 feat(03-02): wire RunSynthesis and add encoding feedback messages
- Add encode import to cmd/netsynth/main.go
- Remove TODO(phase-3) stub and _ = collectedSnapshots
- Print protocol summary BEFORE encoding (D-08)
- Add 'Encoding N windows to path...' status message (D-07)
- Add 'Saved path (Xs, N KB, encoded in Xs)' confirmation (D-09)
- Update Long description: remove '(in future phases)' qualifier
- Audio duration uses float64 to avoid integer truncation (Pitfall 4)
2026-03-26 13:15:35 +01:00
gurix 7f560e89d2 docs(03-01): complete 14-class type system plan
- Add 03-01-SUMMARY.md with deviations and test results
- Update STATE.md: advance progress, record metrics and decisions
- Update ROADMAP.md: phase 3 plan progress
- Mark CLAS-02 requirement complete
2026-03-26 13:12:50 +01:00
gurix ff3ec7eb78 feat(03-01): extend TrafficClass to 14 classes with hash-bucketed unknowns
- Replace ClassUnknown with ClassUnknown1-4 (unknown-1 through unknown-4)
- AllClasses() now returns 14 elements
- Add hashBucket() function routing unrecognized traffic deterministically
- Update synth/config.go: NumLayers=14, 4 dissonant unknown tone configs at 862-1047 Hz
- Add TestAllClassesCount and TestHashBucketDistribution tests
- Add TestClassFreqConfigsComplete and TestNumLayersMatchesAllClasses to config_test.go
- Update TestNewBankHas14Layers, TestMixerNoClip for 14 classes
- All classify and synth tests pass
2026-03-26 13:11:24 +01:00
gurix c8536dac94 docs(03): create phase plan 2026-03-26 13:02:16 +01:00
gurixandClaude Opus 4.6 67753becaa docs(phase-03): add research and validation strategy
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:56:43 +01:00
gurixandClaude Sonnet 4.6 6015b0e4b9 docs(03): research phase domain for pipeline integration and MVP
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 12:55:13 +01:00
gurix a25c7b519d docs(state): record phase 3 context session 2026-03-26 12:36:53 +01:00
gurix 1bd6662b42 docs(03): capture phase context 2026-03-26 12:36:44 +01:00
gurix 01b56825ca docs(phase-02): evolve PROJECT.md after phase completion 2026-03-26 12:16:07 +01:00
gurix 41b34d3510 docs(phase-02): complete phase execution 2026-03-26 12:15:36 +01:00
gurix bb9f9a7944 docs(02-03): complete MP3 encoder and output flag plan
- Create 02-03-SUMMARY.md with TDD flow documentation
- Update STATE.md: advance to last plan, 100% progress, add decisions
- Update ROADMAP.md: phase 02 complete (3/3 plans)
- Mark requirements OUT-01, OUT-02, OUT-03 complete
2026-03-26 12:09:47 +01:00
gurix a65dfcd0ba feat(02-03): wire -o output flag and snapshot accumulator stub into CLI
- Add outputPath var and -o/--output Cobra flag (OUT-01)
- Default output path resolves to netsynth-<timestamp>.mp3 when -o not provided (D-15)
- Snapshot accumulator collects all WindowSnapshots for Phase 3 synthesis wiring
- TODO(phase-3) marker for encode.RunSynthesis integration
2026-03-26 12:08:13 +01:00
gurix f221963551 feat(02-03): implement MP3 encoder package with RunSynthesis orchestrator
- EncodeMP3: writes stereo PCM frames to MP3 via go-lame (44100 Hz, 128 kbps, stereo)
- RunSynthesis: renders WindowSnapshots through OscillatorBank then encodes to MP3
- Zero-packet guard before file creation returns descriptive error (OUT-03)
- InitParams called after all Set* calls per go-lame requirements
2026-03-26 12:06:41 +01:00
gurix ed3a5621f4 test(02-03): add failing tests for MP3 encoder and RunSynthesis
- TestMP3Valid: synthetic snapshots through full pipeline, ffprobe validation
- TestZeroPacketError: empty slice and zero-count snapshots return error, no file created
- TestEncodeMP3DirectBytes: direct frame encoding validated by ffprobe
2026-03-26 12:06:04 +01:00
gurix a979279735 docs(02-02): complete OscillatorBank and stereo mixer plan
- Created 02-02-SUMMARY.md with plan results and 14 test descriptions
- Updated STATE.md: advanced to plan 3 of 3, recorded metrics and decisions
- Updated ROADMAP.md: phase 02 showing 2/3 summaries complete
- Marked SYNTH-03 complete in REQUIREMENTS.md
2026-03-26 12:04:33 +01:00
gurix 23dcfdba1d feat(02-02): OscillatorBank multi-layer rendering from WindowSnapshot
- NewBank creates 11 layers from ClassFreqConfigs, one per TrafficClass
- RenderWindow transforms WindowSnapshot into SamplesPerWindow stereo frames
- GainPerLayer (1/11) applied per layer guarantees no clipping with all layers at max
- PanGains applied per layer for constant-power stereo positioning
- EMA amplitude smoothing provides temporal convergence across windows
- 7 bank tests: layer count, output length, silence, non-zero, no-clip, stereo pan, EMA convergence
2026-03-26 12:03:06 +01:00
gurix c9794cd4cd feat(02-02): stereo mixer utilities with constant-power pan law
- PanGains uses cos/sin constant-power pan law (D-11)
- StereoFramesToInt16Bytes converts stereo frames to interleaved LE int16 bytes
- clamp prevents int16 overflow for values outside [-1.0, 1.0]
- All 7 mixer tests pass (pan law, byte conversion, clamping)
2026-03-26 12:02:06 +01:00
gurix d7117a7e41 Merge branch 'worktree-agent-a56cb818' 2026-03-26 12:00:43 +01:00
gurix f02231a690 docs(02-01): update state and roadmap after synth foundation plan
- Advance to Plan 2 of 3 in Phase 02
- Mark SYNTH-01, SYNTH-02 requirements complete
- Record decisions: go-lame v0.0.9, no go-audio/wav
2026-03-26 12:00:20 +01:00
gurix fe998e2375 docs(02-01): complete synth foundation plan
- Add 02-01-SUMMARY.md documenting config, oscillator, layer implementation
2026-03-26 12:00:15 +01:00
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