## Objective Introduce isolated MIDI input and deterministic replay, converting timestamps into scheduler frames without requiring hardware in CI. ## Scope - [ ] Define backend/input/device/event interfaces and parsed note, CC, and pitch-bend messages. - [ ] Implement robust MIDI byte parsing, including note-on velocity zero. - [ ] Add Fedora ALSA sequencer input (or documented pinned backend), device enumeration, lifecycle, and disconnect events. - [ ] Convert monotonic input timestamps using audio-clock snapshots and configurable latency compensation. - [ ] Apply late events at the earliest available frame and report lateness; use bounded queues with explicit overflow. - [ ] Implement deterministic timestamped replay logs. - [ ] Add `lgs midi list [--json]`, `monitor`, `replay`, and doctor integration. - [ ] Add parser fuzzing, virtual/replay tests, statistics/traces, and Fedora behavior documentation. ## Acceptance criteria - [ ] Replay produces identical converted frames headlessly and malformed input cannot crash the process. - [ ] Device enumeration works when MIDI devices are available; missing hardware does not fail acceptance. - [ ] Late/drop/overflow behavior is explicit and observable. Spec: `phase-3.md` §§20, 22, 26, 30, 32–36, 39–40 (Milestone 8), 42.
Activity