Commit Graph
6 Commits
Author SHA1 Message Date
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 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 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 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 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