瀏覽代碼

docs: create v3 roadmap with single-phase CPU optimization

Phase 1: CPU Optimization
- 16 requirements covered (100%)
- QML logging cleanup, timer optimization, WebSocket, preview cache
- Target: <20% idle CPU on Pi 3B+, Pi 4, Pi 5

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris 1 周之前
父節點
當前提交
ca5e9a994d
共有 2 個文件被更改,包括 72 次插入27 次删除
  1. 57 14
      .planning/ROADMAP.md
  2. 15 13
      .planning/STATE.md

+ 57 - 14
.planning/ROADMAP.md

@@ -1,4 +1,59 @@
-# Roadmap
+# Roadmap — v3 Touch App CPU Optimization
+
+**Milestone goal:** Reduce idle CPU usage from 100%+ to under 20% on Pi 3B+, Pi 4, and Pi 5.
+
+---
+
+## Phase 1: CPU Optimization
+
+**Goal:** Eliminate all identified CPU hotspots and verify performance targets.
+
+**Requirements covered:**
+- REQ-LOG-01 through REQ-LOG-06 (QML logging cleanup)
+- REQ-TIMER-01, REQ-TIMER-02 (Timer optimization)
+- REQ-WS-01, REQ-WS-02 (WebSocket optimization)
+- REQ-CACHE-01, REQ-CACHE-02 (Preview cache)
+- REQ-VERIFY-01 through REQ-VERIFY-04 (Verification)
+
+**Success criteria:**
+- [ ] No console.log in main.qml mouse/touch handlers
+- [ ] No debug console.log in QML component files
+- [ ] Screen timeout uses event-driven scheduling (not 1-sec polling)
+- [ ] WebSocket handler only emits signals on actual value changes
+- [ ] Pattern preview paths are cached after first lookup
+- [ ] Idle CPU < 20% measured on Pi (any model available for testing)
+- [ ] UI remains responsive (no lag when scrolling patterns)
+
+**Research needed:** No — fixes are straightforward code changes.
+
+**Estimated scope:** Small (< 1 day) — mostly removing/modifying existing code.
+
+---
+
+## Requirement Coverage
+
+| Requirement | Phase |
+|-------------|-------|
+| REQ-LOG-01 | 1 |
+| REQ-LOG-02 | 1 |
+| REQ-LOG-03 | 1 |
+| REQ-LOG-04 | 1 |
+| REQ-LOG-05 | 1 |
+| REQ-LOG-06 | 1 |
+| REQ-TIMER-01 | 1 |
+| REQ-TIMER-02 | 1 |
+| REQ-WS-01 | 1 |
+| REQ-WS-02 | 1 |
+| REQ-CACHE-01 | 1 |
+| REQ-CACHE-02 | 1 |
+| REQ-VERIFY-01 | 1 |
+| REQ-VERIFY-02 | 1 |
+| REQ-VERIFY-03 | 1 |
+| REQ-VERIFY-04 | 1 |
+
+**Coverage:** 16/16 requirements (100%)
+
+---
 
 ## Completed Milestones
 
@@ -7,18 +62,6 @@
 | v1 | Backend Testing | 2026-01-24 | [v1-backend-testing.md](milestones/v1-backend-testing.md) |
 | v2 | Frontend Testing | 2026-01-25 | [v2-frontend-testing.md](milestones/v2-frontend-testing.md) |
 
-## Current Milestone
-
-*No active milestone. Run `/gsd:new-milestone` to start a new one.*
-
 ---
 
-## Project Test Coverage
-
-| Category | Tests |
-|----------|-------|
-| Backend (Python) | 17 |
-| Frontend Component | 42 |
-| Frontend Integration | 22 |
-| Frontend E2E | 13 |
-| **Total** | **94** |
+*Created: 2026-01-25*

+ 15 - 13
.planning/STATE.md

@@ -3,12 +3,12 @@
 ## Current Position
 
 Milestone: v3 Touch App CPU Optimization
-Phase: Not started (run /gsd:create-roadmap)
-Plan: 
-Status: Defining requirements
-Last activity: 2026-01-25 — Milestone v3 started
+Phase: 1 — CPU Optimization
+Plan: Not yet created (run /gsd:plan-phase 1)
+Status: Ready to plan
+Last activity: 2026-01-25 — Roadmap created
 
-Progress: N/A
+Progress: Phase 1 of 1
 
 ## Completed Milestones
 
@@ -37,6 +37,8 @@ Progress: N/A
 | Button finding via textContent | More reliable than getByRole for buttons with similar names | 2026-01-25 |
 | WebSocket mocking via routeWebSocket | Required to bypass blocking "Connecting to Backend" overlay | 2026-01-25 |
 | Dedicated port 5174 for E2E | Avoids conflict with other dev servers on 5173 | 2026-01-25 |
+| Remove debug logs (not flag) | Decided to remove all debug console.log rather than add conditional flag | 2026-01-25 |
+| Event-driven screen timeout | Replace 1-sec polling with event-driven timeout scheduling | 2026-01-25 |
 
 ## Blockers/Concerns
 
@@ -45,16 +47,16 @@ None currently.
 ## Session Continuity
 
 Last session: 2026-01-25
-Stopped at: Started v3 milestone - CPU optimization
+Stopped at: Created v3 roadmap
 Resume file: None
 
 ## v3 Milestone Context
 
-**Issues identified during audit:**
-1. `onPositionChanged` in main.qml logs every pixel of touch movement
-2. Screen timeout timer runs every 1 second continuously
-3. Debug console.log statements throughout QML components
-4. WebSocket message handler triggers multiple signals per message
-5. Pattern preview checks filesystem on every access
-
 **Target:** < 20% CPU when idle on Pi 3B+, Pi 4, Pi 5
+
+**Phase 1 covers all 16 requirements:**
+- QML logging cleanup (6 requirements)
+- Timer optimization (2 requirements)
+- WebSocket optimization (2 requirements)
+- Preview cache (2 requirements)
+- Verification (4 requirements)