Commit Graph

124 Commits

Author SHA1 Message Date
Claude
49f0b0f68c feat(07-02): add animation test suite and re-apply main.py render wiring
- Create tests/test_firmware_animations.py with 30+ tests for all 7 animations
- Re-apply animation rendering to firmware/main.py (07-01 parallel agent reverted)
- Tests cover: _hsv_to_rgb, all animation classes, create_animation factory
- Full round-trip test: server encode -> firmware parse -> create -> render
2026-04-07 15:41:45 +00:00
Claude
8e521e5bfb feat(07-02): wire animation rendering into firmware/main.py
- Add import for create_animation from animations module
- Add current_anim_instance global for animation object
- Create animation instance in udp_listener_task on anim_cmd receipt
- Implement render loop in render_task using ticks_diff for timing
2026-04-07 15:40:43 +00:00
Claude
d14fa3ca78 feat(07-03): add FrameAssembler to firmware/protocol.py
- Add FrameAssembler class for multi-packet DNRGB reassembly
- 200ms timeout discards stale partial frames
- feed() returns complete frame list when all expected pixels received
- reset() clears buffer manually
2026-04-07 15:40:30 +00:00
Claude
053e1abd60 feat(07-02): add firmware animations.py with all 7 animation classes
- Port all 7 animations from lightsync/animations/*.py to MicroPython
- Inline _hsv_to_rgb (no colorsys in MicroPython)
- Use bytearray for FireAnimation heat buffer (avoids GC pressure)
- create_animation() factory maps parsed command dicts to instances
- No lightsync imports, no abc, no type hints
2026-04-07 15:40:02 +00:00
Claude
9a3370e71c docs(07): create phase 7 microcontroller firmware plans
Three sequential plans for MicroPython ESP32 firmware:
- 07-01: Scaffold (UDP listener, packet discriminator, LED drivers, config)
- 07-02: Animation renderer (all 7 types ported from lightsync)
- 07-03: Frame mode (DRGB/DRGBW/DNRGB parsing, reassembly, timeout)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 12:22:49 +00:00
Claude
b7b0673b43 docs(07): research microcontroller firmware phase 2026-04-07 12:16:29 +00:00
Claude
875be14a8d docs(phase-06): evolve PROJECT.md after phase completion 2026-04-07 11:53:39 +00:00
Claude
3877a00ba0 docs(phase-06): complete phase execution 2026-04-07 11:53:15 +00:00
Claude
6d8d4845c5 docs(06-03): complete AI sync plan — heuristic+LLM show generation
- 06-03-SUMMARY.md: full plan documentation
- STATE.md: position advanced, decisions logged, session updated
- ROADMAP.md: phase 06 marked complete (3/3 plans)
2026-04-07 11:48:39 +00:00
Claude
70b86f78ce feat(06-03): add AI Sync panel UI and frontend wiring
- Add AI SYNC button to timeline toolbar, panel hidden by default (D-08)
- Panel: feature toggles (BEATS, ONSETS, CHROMA, RMS), GENERATE button, USE LLM toggle
- GENERATE disabled until audio loaded; re-enables on loadedmetadata event
- LLM toggle enabled/disabled based on /api/sync/llm-available at page load
- D-07: confirmation dialog before replacing existing timeline blocks
- D-11: section_range passed when a segment is selected in the overlay
- Segment selection watcher (200ms interval) updates info text dynamically
- Add AI sync panel styles — flat terminal aesthetic, no border-radius
2026-04-07 11:47:14 +00:00
Claude
b6aacad9ce feat(06-03): add AI sync backend — heuristic mapper, LLM generator, API endpoint
- Create lightsync/api/sync.py with POST /api/sync/generate and GET /api/sync/llm-available
- heuristic_generate: intensity-to-animation mapping, chroma-to-color, beat-snapped block placement
- llm_generate: Anthropic claude-3-haiku with lazy init, JSON parse + validation
- section_range filtering for per-section generation (D-11)
- Register sync.router with prefix /api/sync in main.py
2026-04-07 11:45:49 +00:00
Claude
2fef43dcc3 docs(06-02): complete audio feature extraction and segment overlay plan
- Create 06-02-SUMMARY.md with full execution record
- Update STATE.md: plan advanced to 3/3, progress 95%, decisions logged
- Update ROADMAP.md: phase 6 now 2/3 summaries
- Mark SYNC-03 complete in REQUIREMENTS.md
2026-04-07 11:42:44 +00:00
Claude
48e15ee013 feat(06-02): add segment overlay canvas rendering and click interaction
- Create lightsync/frontend/timeline/segments.js with SegmentOverlay class
- Integrate SegmentOverlay into timeline.js render pipeline (between row banding and waveform)
- Add loadSegments method to TimelineCanvas
- Wire loadSegments call in app.js loadedmetadata handler
2026-04-07 11:41:41 +00:00
Claude
d339ba588d feat(06-02): add feature extraction and segmentation backend modules + API
- Create lightsync/audio/features.py with extract_features and extract_features_async
- Create lightsync/audio/segments.py with detect_segments via agglomerative clustering
- Add /api/audio/segments and /api/audio/features endpoints to audio.py
- Initialize app.state.segments cache in main.py lifespan
2026-04-07 11:40:29 +00:00
Claude
8c1f0a0fbc docs(06-01): complete YouTube audio loading plan
- Create 06-01-SUMMARY.md with full execution details
- Update STATE.md: advance to plan 2, 90% progress, add decisions
- Update ROADMAP.md: phase 6 showing 1/3 plans complete
2026-04-07 11:38:19 +00:00
Claude
dca1cb837b feat(06-01): add YouTube URL input with terminal progress bar
- Add yt-url input, FETCH button, and yt-progress span to transport bar
- Add fetchWithProgress() SSE ReadableStream reader function
- Add renderProgressBar() terminal-style block fill renderer (DOWNLOADING ████)
- Wire FETCH button click handler with D-02 disable-during-download behavior
- Auto-load audio into player after download (D-01 same pipeline as upload)
- Add .yt-url-input and .yt-progress CSS styles (flat, monospace, no border-radius)
- Enable yt-url input on page load via JS
2026-04-07 11:37:10 +00:00
Claude
d58ea8c633 feat(06-01): add YouTube download endpoint with SSE progress streaming
- POST /api/audio/fetch accepts {url: string}
- Spawns yt-dlp subprocess via sys.executable -m yt_dlp
- Streams SSE progress events with PROGRESS_RE line-by-line parsing
- Uses --newline flag for reliable progress output
- Uses yt_%(id)s.%(ext)s template for predictable filenames
- Runs beat analysis on completion and caches in app.state.beats
- Returns done event with path and filename on success
2026-04-07 11:36:19 +00:00
Claude
165cdb6f23 feat(06-01): add yt-dlp and anthropic dependencies
- Add yt-dlp>=2025.0.0 and anthropic>=0.40.0 to pyproject.toml
- Wire ANTHROPIC_API_KEY env var in docker-compose.prod.yml (empty default)
- Rebuilt Docker image, both packages importable in container
2026-04-07 11:35:33 +00:00
Claude
57bd91d4e7 docs(06-ai-sync): create phase plan 2026-04-07 11:31:04 +00:00
Claude
b88bd98c40 docs(06): research phase AI sync domain 2026-04-07 11:17:32 +00:00
Claude
b0e13bfab8 docs(06): capture phase context 2026-04-07 10:57:18 +00:00
Claude
c715369a65 docs(phase-05): evolve PROJECT.md after phase completion 2026-04-07 10:42:22 +00:00
Claude
c706d4c8dd docs(phase-05): complete phase execution 2026-04-07 10:41:54 +00:00
Claude
a6b8a2d591 docs(05-04): complete mouse play/pause WS fix plan — SUMMARY, STATE, ROADMAP updated
- 05-04-SUMMARY.md: gap closure complete, UDP cues fire for mouse playback
- STATE.md: plan advanced to 2/4, progress 100%, decision logged
- ROADMAP.md: Phase 05 marked Complete (4/4 plans)
2026-04-07 10:38:24 +00:00
Claude
ac0f3d52db feat(05-04): add WebSocket play/pause messages to wireAudio() event listeners
- audio 'play' listener now sends client.send({ type: 'play', position }) to server
- audio 'pause' listener now sends client.send({ type: 'pause', position }) to server
- Server is_playing flag now set correctly on mouse-initiated playback
- UDP cue scheduler fires for both mouse and keyboard playback
2026-04-07 10:37:18 +00:00
Claude
11cd0fce7b docs(05): add phase 5 verification report (9/11 truths, gaps identified)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 10:31:43 +00:00
Claude
4543f9b38d docs(05): add gap closure plan 05-04 for mouse play/pause WS fix 2026-04-07 10:31:12 +00:00
Claude
448bd34eb2 docs(05-03): complete keyboard shortcuts plan — SUMMARY, STATE, ROADMAP updated 2026-04-07 10:19:12 +00:00
Claude
3562652f2b feat(05-03): add wireKeyboard() with all 7 keyboard shortcuts
- Space toggles play/pause, sends play/pause msg to server
- ArrowLeft/ArrowRight seek +/-5s, send seek msg, clear preview strips
- Ctrl+Z calls timeline.history.undo()
- Ctrl+Shift+Z and Ctrl+Y both call timeline.history.redo()
- Ctrl+S prevents browser dialog, fetches show and POSTs to save
- All shortcuts suppressed when focus is on input/select/textarea
- Space skips when active element is a button (prevents double-toggle)
- wireKeyboard() called at init after wireAudio()
2026-04-07 10:18:19 +00:00
Claude
1499736fde docs(05-02): complete live preview panel plan — SUMMARY, STATE, ROADMAP updated 2026-04-07 10:16:48 +00:00
Claude
e064954b28 feat(05-02): wire preview_update handler, show selector, and preview strip builder
- Import setCurrentShowId from commands.js
- Add preview_update WebSocket message handler that calls updatePreviewStrip
- Add updatePreviewStrip() function to update device strip color and animation
- Add buildPreviewStrips() function to populate #live-preview from device list
- Call buildPreviewStrips() inside device fetch callback in initTimeline
- Add async refreshShows() to populate show-select dropdown from /api/shows
- Add btn-load-show click handler: loads show, populates tracks, sends WebSocket load msg
- Clear preview strips on seek (remove active class, reset color and anim label)
2026-04-07 10:15:34 +00:00
Claude
e0e412fcd1 feat(05-02): add live preview panel HTML and CSS styles
- Add #live-preview div between timeline-canvas and block-inspector
- Add show selector (show-select + btn-load-show) to transport bar
- Add keyboard-hint span at far right of transport bar
- Append .live-preview, .device-strip, .strip-label, .strip-color, .strip-anim, .keyboard-hint CSS styles
2026-04-07 10:14:16 +00:00
Claude
7809402d54 docs(05-01): complete cue scheduler plan — SUMMARY, STATE, ROADMAP updated
- 05-01-SUMMARY.md created with task commits, decisions, next-phase readiness
- STATE.md advanced to plan 2/3, progress 88%, decisions logged
- ROADMAP.md updated: phase 5 in progress (1/3 summaries)
- REQUIREMENTS.md: SHW-03 marked complete
2026-04-07 10:12:09 +00:00
Claude
64c49c9e64 feat(05-01): add cue scheduling loop and preview_update broadcast to tick handler
- LOOKAHEAD = 0.060 (60ms window per D-02)
- Scheduler iterates show.tracks/cues on each tick, gated on is_playing and show
- Cues within lookahead window fire UDP via encode_animation_cmd + UDPSender.send
- Past cues (>100ms behind) silently marked fired without UDP dispatch
- active_cue tracking per track enables preview state for already-fired blocks
- preview_update messages broadcast to all clients on each tick (D-07)
- Clear preview_update (animation: null) sent when no active cue on a device
2026-04-07 10:11:03 +00:00
Claude
3d36cc5754 feat(05-01): add per-connection show state and load handler to ws.py
- Import encode_animation_cmd and ShowModel at module level
- Add show, fired_ids, is_playing per-connection state variables
- Extend load handler to load show from show_store by show_id (D-04)
- play handler sets is_playing=True
- pause handler sets is_playing=False without touching fired_ids
- seek handler rebuilds fired_ids from show cues before seek position (D-03)
2026-04-07 10:10:23 +00:00
Claude
3c9575f915 docs(05): phase 5 execution plans — cue scheduler, live preview, keyboard shortcuts 2026-04-07 09:16:45 +00:00
Claude
6a1ec4e3b6 docs(05): create phase plan — 3 plans across 3 waves 2026-04-07 09:16:17 +00:00
Claude
02826b2c89 docs(05): fix UI-SPEC checker blocks — typography, spacing 2026-04-07 09:05:57 +00:00
Claude
f739c8fe19 docs(05): UI design contract
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 09:02:33 +00:00
Claude
2ac23c3297 docs(05): research phase domain 2026-04-07 08:59:07 +00:00
Claude
7b37f014d0 docs(state): record phase 5 context session 2026-04-07 08:48:39 +00:00
Claude
4ce9759055 docs(05): capture phase context 2026-04-07 08:48:34 +00:00
Claude
34077018a9 docs(phase-04): evolve PROJECT.md after phase completion 2026-04-07 00:00:51 +00:00
Claude
399b7a1e05 docs(phase-04): complete phase execution 2026-04-07 00:00:33 +00:00
Claude
3483de871e docs(04-04): complete block inspector plan — SUMMARY, STATE, ROADMAP updated
- BlockInspector with color/speed/direction/length param controls
- UpdateParamsCommand for full undo/redo param editing
- Phase 04 complete (4/4 plans), TL-04 requirement marked done
- Progress: 14/14 plans (100%)
2026-04-06 23:56:25 +00:00
Claude
8e084ca8dc feat(04-04): wire BlockInspector into timeline and app.js
- app.js imports BlockInspector and DeleteBlockCommand
- Inspector created with #block-inspector element and timeline.history
- timeline._onSelectBlock callback shows/hides inspector on block select
- inspector._onDelete fires DeleteBlockCommand and hides inspector
- inspector.tracks kept in sync after loadTracks() resolves
- timeline.js block rendering uses blockColor + '1a' for color accent fill
- undo/redo handlers re-trigger _onSelectBlock to refresh inspector values
2026-04-06 23:54:22 +00:00
Claude
e82fc4a775 feat(04-04): add UpdateParamsCommand + BlockInspector module
- UpdateParamsCommand with execute/undo for color/speed/direction/length
- Uses module-level currentShowId (not this._showId) matching existing pattern
- BlockInspector renders compact strip with animation label, color swatch,
  speed input, direction select, length input, and remove button
- Color change committed on 'change' event (not 'input') to avoid command flood
- _onDelete callback wired to remove button for app.js to handle
2026-04-06 23:51:48 +00:00
Claude
d1965dcefc docs(04-03): complete BeatGrid plan summary and update state 2026-04-06 23:49:44 +00:00
Claude
287fe16a56 feat(04-03): BeatGrid module + enhanced beat rendering + loading states
- Create beats.js with BeatGrid class: load(), getCalibratedBeats(), getCalibratedOnsets(), snap(), hasBeats getter
- BeatGrid manages calibrationOffset and snapEnabled state
- snap() uses 100ms threshold against calibrated beat positions
- Handles API field variants: beats/beat_times, tempo/tempo_bpm
- Refactor timeline.js: replace beatTimes/calibrationOffset/snapEnabled with this.beatGrid
- Add getters/setters for calibrationOffset and snapEnabled (backward compat with app.js)
- render() now shows DETECTING BEATS... loading indicator and error state
- render() draws beat marks via getCalibratedBeats(), onset ticks via getCalibratedOnsets()
- snapToBeat() delegates to beatGrid.snap()
- app.js chains BPM label update after loadBeats() resolves
2026-04-06 23:48:27 +00:00
Claude
c37fa6d1f6 docs(04-02): complete block interactions plan — SUMMARY, STATE, ROADMAP updated
- CommandHistory + 4 command classes + backend CRUD endpoints
- Full mouse interactions: drag-place, move, resize, delete, undo/redo
- Requirements TL-02, TL-03, TL-06 marked complete
- Progress: 86% (12/14 plans)
2026-04-06 23:46:05 +00:00