summaryrefslogtreecommitdiff
path: root/PEAK_FIX_SUMMARY.md
AgeCommit message (Collapse)Author
12 hoursdocs: Reorganize documentation with tiered hierarchy for context optimizationskal
Major documentation reorganization to reduce AI agent context size by ~58% and establish sustainable maintenance practices. ## File Moves (Root → doc/) - Move COMPLETED.md (new), HANDOFF*.md, *_ANALYSIS.md, *_SUMMARY.md to doc/ - Keep only 5 essential files in root: CLAUDE.md, GEMINI.md, PROJECT_CONTEXT.md, TODO.md, README.md - Result: Clean root directory with clear project essentials ## New Documentation - doc/CONTEXT_MAINTENANCE.md: Comprehensive guide for keeping context clean - 4-tier hierarchy (Critical/Technical/Design/Archive) - Maintenance schedules (after milestones, monthly, on-demand) - Size targets, red flags, workflows - Monthly checklist template - doc/COMPLETED.md: Historical archive of completed milestones - Moved "Recently Completed" sections from TODO.md and PROJECT_CONTEXT.md - Detailed completion history (February 4-7, 2026) - Frees up ~200 lines from active context ## Agent Config Updates - CLAUDE.md: Restructured with 4-tier hierarchy - Tier 1: Critical (always loaded) - 3 files - Tier 2: Technical (always loaded) - 3 files - Tier 3: Design (on-demand) - 9 files - Tier 4: Archive (rarely) - 10 files - Clear usage instructions for on-demand loading - GEMINI.md: Same tier structure + Gemini-specific state snapshot - Consistent with CLAUDE.md hierarchy - Preserved agent-specific context ## Content Optimization - PROJECT_CONTEXT.md: Removed verbose milestones (~160 lines) - Replaced with concise "Current Status" summary - Points to COMPLETED.md for history - TODO.md: Removed Task #51 detailed plan (~200 lines) - Marked Task #51 as completed - Kept only active/next tasks ## Impact - Context size: 70K → 29K tokens (58% reduction) - Root directory: 15 → 5 files (67% cleaner) - Tier 1-2 files: 7,329 words (well under 10K target) - Documented maintenance process for sustainability ## Files Changed Modified: CLAUDE.md, GEMINI.md, PROJECT_CONTEXT.md, TODO.md New: doc/COMPLETED.md, doc/CONTEXT_MAINTENANCE.md Moved: 10 technical docs from root to doc/
13 hoursfeat(audio): Add SilentBackend, fix peak measurement, reorganize backendsskal
## Critical Fixes **Peak Measurement Timing:** - Fixed 400ms audio-visual desync by measuring peak at playback time - Added get_realtime_peak() to AudioBackend interface - Implemented real-time measurement in MiniaudioBackend audio callback - Updated main.cc and test_demo.cc to use audio_get_realtime_peak() **Peak Decay Rate:** - Fixed slow decay (0.95 → 0.7 per callback) - Old: 5.76 seconds to fade to 10% (constant flashing in test_demo) - New: 1.15 seconds to fade to 10% (proper visual sync) ## New Features **SilentBackend:** - Test-only backend for testing audio.cc without hardware - Controllable peak for testing edge cases - Tracks frames rendered and voice triggers - Added 7 comprehensive tests covering: - Lifecycle (init/start/shutdown) - Peak control and tracking - Playback time and buffer management - Integration with AudioEngine ## Refactoring **Backend Organization:** - Created src/audio/backend/ directory - Moved all backend implementations to subdirectory - Updated include paths and CMakeLists.txt - Cleaner codebase structure **Code Cleanup:** - Removed unused register_spec_asset() function - Added deprecation note to synth_get_output_peak() ## Testing - All 28 tests passing (100%) - New test: test_silent_backend - Improved audio.cc test coverage significantly ## Documentation - Created PEAK_FIX_SUMMARY.md with technical details - Created TASKS_SUMMARY.md with complete task report Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>