diff --git a/docs/IMPLEMENTATION_STATUS.md b/docs/IMPLEMENTATION_STATUS.md index 3b875d8..4c6bf8c 100644 --- a/docs/IMPLEMENTATION_STATUS.md +++ b/docs/IMPLEMENTATION_STATUS.md @@ -4,7 +4,32 @@ This document details what is **actually implemented** vs. what is **claimed** in the README and issues. -**Last Updated:** February 2026 (Post-Phase 8) +> **Single source of truth for microtasks:** [`docs/microtasks.md`](microtasks.md) + +**Last Updated:** 2026 (Post-Phase 31 Β· Vulkan Renderer Complete)** + +### πŸ“Š High-Level Phase Completion + +| Range | Phases | Status | +|-------|--------|--------| +| Core Infrastructure | 0–8 | βœ… Complete | +| Protocol & Crypto | 9–11 | βœ… Complete | +| KDE Client | 12–16 | βœ… Complete | +| Platform & Recording | 17–19 | βœ… Complete | +| Advanced Features | 20–23 | βœ… Complete | +| VR / Proton | 24 | πŸ”„ In Progress (5/9 tasks) | +| Security Hardening | 25 | βœ… Complete | +| Network Optimization | 26 | βœ… Complete | +| CI / Infrastructure | 27 | βœ… Complete | +| Event Sourcing | 28 | βœ… Complete | +| Mobile Full Client | 29 | πŸ”„ In Progress (3/8 tasks) | +| Security Phase 2 | 30 | βœ… Complete | +| Vulkan Renderer | 31 | βœ… Complete | +| Backend Integration | 32 | πŸ”΄ Not Started | +| Code Standards | 33 | πŸ”΄ Not Started | +| Production Readiness | 34 | πŸ”΄ Not Started | + +**Overall: 186 / 221 microtasks complete (84%)** --- @@ -263,6 +288,107 @@ Total Test time (real) = 0.15 sec --- +--- + +## βœ… Phases 9–31 Summary + +### PHASE 9–11: Protocol, Crypto & Client Rendering +- [x] Binary packet protocol with CRC-32, sequence numbers, version negotiation (Phase 9) +- [x] Ed25519 identity keys, X25519 ephemeral DH, ChaCha20-Poly1305 encryption (Phase 10) +- [x] FFmpeg H.264 decode + SDL2 rendering client (Phase 11) +- **Status**: βœ… Complete + +### PHASE 12–16: KDE Plasma Client +- [x] Qt6/QML/Kirigami application with stream view (Phase 12) +- [x] Opus audio + PipeWire/PulseAudio/ALSA backends (Phase 13) +- [x] Audio player with A/V sync (Phase 14) +- [x] Input manager with gamepad support (Phase 15) +- [x] KNotifications, shortcuts, accessibility, theme support (Phase 16) +- **Status**: βœ… Complete + +### PHASE 17–19: Platform & Recording +- [x] RecordingManager, ReplayBuffer, DiskManager (Phase 17) +- [x] H.264/VP9/AV1 encoder wrappers with bitrate ladder (Phase 18) +- [x] MKV/MP4 muxers, metadata embedding, thumbnail generation (Phase 19) +- **Status**: βœ… Complete + +### PHASE 20–23: Advanced Features +- [x] MetricsManager: CPU/GPU/memory/network monitors + HUD overlay (Phase 20) +- [x] Embedded HTTP API server + WebSocket push + auth token (Phase 21) +- [x] Android (MediaCodec) + iOS (VideoToolbox) native clients (Phase 22) +- [x] SQLite DatabaseManager with migrations and schema (Phase 23) +- **Status**: βœ… Complete + +### PHASE 24: VR / Proton *(In Progress)* +- [x] OpenXR manager, head tracking, hand tracking, action mapping, VR UI (24.1–24.5) +- [ ] Proton compatibility layer (24.6) β€” partially implemented +- [ ] SteamVR bridge (24.7) β€” partially implemented +- [ ] VR latency optimisation (24.8) β€” not started +- [ ] VR integration tests (24.9) β€” not started +- **Status**: πŸ”„ 5/9 tasks complete + +### PHASE 25: Security Hardening +- [x] SessionManager, AuditLog, SIGMA key exchange, attack prevention, user auth + 2FA (Phase 25) +- **Status**: βœ… Complete + +### PHASE 26: Network Optimization +- [x] BBR-like bandwidth estimator, ABR controller, QoS/DSCP, FEC, NACK, jitter buffer (Phase 26) +- **Status**: βœ… Complete + +### PHASE 27: CI / Infrastructure +- [x] Multi-stage Dockerfile, Docker Compose, Helm chart, Terraform modules (Phase 27) +- [x] GitHub Actions CI + CD pipelines, SBOM, vulnerability scanning (Phase 27) +- **Status**: βœ… Complete + +### PHASE 28: Event Sourcing / CQRS +- [x] EventStore, domain event models, command handlers, projections, CQRS API (Phase 28) +- **Status**: βœ… Complete + +### PHASE 29: Mobile Full Client *(In Progress)* +- [x] Android full codec support (29.1), clipboard sync (29.2) +- [ ] Android file transfer (29.3) β€” in progress +- [ ] iOS full codec, clipboard, file transfer (29.4–29.6) β€” not started +- [ ] Mobile HUD, push notifications (29.7–29.8) β€” not started +- **Status**: πŸ”„ 3/8 tasks complete + +### PHASE 30: Security Phase 2 +- [x] LibFuzzer packet/handshake fuzzing, rate limiting, SQL injection prevention, TLS (Phase 30) +- **Status**: βœ… Complete + +### PHASE 31: Vulkan Renderer *(NEW β€” Just Completed)* +- [x] Frame upload infrastructure β€” `VulkanFrameUploader.cpp` (702 LOC): staging buffer pool, VMA, timeline semaphores +- [x] YUVβ†’RGB shader system β€” `yuv_to_rgb.frag` (275 LOC): BT.709/601/2020, HDR tone mapping +- [x] Graphics pipeline β€” render pass, framebuffers, descriptor sets, specialisation constants +- [x] Swapchain presentation β€” mailbox/FIFO mode, acquire/present semaphores +- [x] Dynamic resize β€” swapchain recreation without frame drops +- [x] Resource cleanup β€” validation layers report zero errors +- **Status**: βœ… Complete + +--- + +## πŸ”­ What's Next + +### PHASE-32: Backend Integration *(Not Started)* +Connect the Phase 31 Vulkan renderer to the actual streaming backend: +- `StreamBackendConnector.cpp` β€” frame handoff from decode to Vulkan upload +- Lock-free ring buffer between decode and render threads +- X11 + Wayland `VkSurfaceKHR` platform backends +- Integration and performance benchmark suites + +### PHASE-33: Code Standards & Quality *(Not Started)* +- clang-format + clang-tidy with zero violations +- β‰₯ 80% line coverage across all modules +- ASan/UBSan/TSan clean passes +- cppcheck static analysis + +### PHASE-34: Production Readiness *(Not Started)* +- End-to-end Docker integration test +- Performance benchmark suite (glass-to-glass latency) +- AUR/deb/AppImage release packaging +- Final documentation review + +--- + ## πŸ” Areas for Future Enhancement While PHASE 8 establishes comprehensive test infrastructure, the following areas could be expanded: diff --git a/docs/planning/ANALYSIS_DOCS_README.md b/docs/archive/ANALYSIS_DOCS_README.md similarity index 100% rename from docs/planning/ANALYSIS_DOCS_README.md rename to docs/archive/ANALYSIS_DOCS_README.md diff --git a/docs/planning/ANALYSIS_INDEX.md b/docs/archive/ANALYSIS_INDEX.md similarity index 100% rename from docs/planning/ANALYSIS_INDEX.md rename to docs/archive/ANALYSIS_INDEX.md diff --git a/docs/planning/ANALYSIS_SUMMARY.md b/docs/archive/ANALYSIS_SUMMARY.md similarity index 100% rename from docs/planning/ANALYSIS_SUMMARY.md rename to docs/archive/ANALYSIS_SUMMARY.md diff --git a/docs/planning/CURRENT_SESSION_SUMMARY.md b/docs/archive/CURRENT_SESSION_SUMMARY.md similarity index 100% rename from docs/planning/CURRENT_SESSION_SUMMARY.md rename to docs/archive/CURRENT_SESSION_SUMMARY.md diff --git a/docs/planning/IMPLEMENTATION_PRIORITIES.md b/docs/archive/IMPLEMENTATION_PRIORITIES.md similarity index 100% rename from docs/planning/IMPLEMENTATION_PRIORITIES.md rename to docs/archive/IMPLEMENTATION_PRIORITIES.md diff --git a/docs/planning/IMPLEMENTATION_ROADMAP.md b/docs/archive/IMPLEMENTATION_ROADMAP.md similarity index 100% rename from docs/planning/IMPLEMENTATION_ROADMAP.md rename to docs/archive/IMPLEMENTATION_ROADMAP.md diff --git a/docs/planning/NEXT_SESSION_CONTEXT.md b/docs/archive/NEXT_SESSION_CONTEXT.md similarity index 100% rename from docs/planning/NEXT_SESSION_CONTEXT.md rename to docs/archive/NEXT_SESSION_CONTEXT.md diff --git a/clients/kde-plasma-client/PHASE10_SUMMARY.md b/docs/archive/PHASE10_SUMMARY.md similarity index 100% rename from clients/kde-plasma-client/PHASE10_SUMMARY.md rename to docs/archive/PHASE10_SUMMARY.md diff --git a/clients/kde-plasma-client/PHASE13_SUMMARY.md b/docs/archive/PHASE13_SUMMARY.md similarity index 100% rename from clients/kde-plasma-client/PHASE13_SUMMARY.md rename to docs/archive/PHASE13_SUMMARY.md diff --git a/clients/kde-plasma-client/PHASE14_COMPLETION_SUMMARY.md b/docs/archive/PHASE14_COMPLETION_SUMMARY.md similarity index 100% rename from clients/kde-plasma-client/PHASE14_COMPLETION_SUMMARY.md rename to docs/archive/PHASE14_COMPLETION_SUMMARY.md diff --git a/docs/planning/PHASE18_SUMMARY.md b/docs/archive/PHASE18_SUMMARY.md similarity index 100% rename from docs/planning/PHASE18_SUMMARY.md rename to docs/archive/PHASE18_SUMMARY.md diff --git a/docs/planning/PHASE19_SUMMARY.md b/docs/archive/PHASE19_SUMMARY.md similarity index 100% rename from docs/planning/PHASE19_SUMMARY.md rename to docs/archive/PHASE19_SUMMARY.md diff --git a/docs/planning/PHASE20_SUMMARY.md b/docs/archive/PHASE20_SUMMARY.md similarity index 100% rename from docs/planning/PHASE20_SUMMARY.md rename to docs/archive/PHASE20_SUMMARY.md diff --git a/docs/planning/PHASE21_COMPLETION_SUMMARY.txt b/docs/archive/PHASE21_COMPLETION_SUMMARY.txt similarity index 100% rename from docs/planning/PHASE21_COMPLETION_SUMMARY.txt rename to docs/archive/PHASE21_COMPLETION_SUMMARY.txt diff --git a/docs/planning/PHASE21_SUMMARY.md b/docs/archive/PHASE21_SUMMARY.md similarity index 100% rename from docs/planning/PHASE21_SUMMARY.md rename to docs/archive/PHASE21_SUMMARY.md diff --git a/ios/PHASE22_1_COMPLETION_REPORT.md b/docs/archive/PHASE22_1_COMPLETION_REPORT.md similarity index 100% rename from ios/PHASE22_1_COMPLETION_REPORT.md rename to docs/archive/PHASE22_1_COMPLETION_REPORT.md diff --git a/ios/PHASE22_1_SUMMARY.md b/docs/archive/PHASE22_1_SUMMARY.md similarity index 100% rename from ios/PHASE22_1_SUMMARY.md rename to docs/archive/PHASE22_1_SUMMARY.md diff --git a/android/PHASE22_2_COMPLETION_REPORT.md b/docs/archive/PHASE22_2_COMPLETION_REPORT.md similarity index 100% rename from android/PHASE22_2_COMPLETION_REPORT.md rename to docs/archive/PHASE22_2_COMPLETION_REPORT.md diff --git a/android/PHASE22_2_SUMMARY.md b/docs/archive/PHASE22_2_SUMMARY.md similarity index 100% rename from android/PHASE22_2_SUMMARY.md rename to docs/archive/PHASE22_2_SUMMARY.md diff --git a/docs/planning/PHASE23_SUMMARY.md b/docs/archive/PHASE23_SUMMARY.md similarity index 100% rename from docs/planning/PHASE23_SUMMARY.md rename to docs/archive/PHASE23_SUMMARY.md diff --git a/docs/planning/PHASE24.2_IMPLEMENTATION_SUMMARY.md b/docs/archive/PHASE24.2_IMPLEMENTATION_SUMMARY.md similarity index 100% rename from docs/planning/PHASE24.2_IMPLEMENTATION_SUMMARY.md rename to docs/archive/PHASE24.2_IMPLEMENTATION_SUMMARY.md diff --git a/docs/planning/PHASE24.3_INDEX.md b/docs/archive/PHASE24.3_INDEX.md similarity index 100% rename from docs/planning/PHASE24.3_INDEX.md rename to docs/archive/PHASE24.3_INDEX.md diff --git a/docs/planning/PHASE24.3_PLANNING.md b/docs/archive/PHASE24.3_PLANNING.md similarity index 100% rename from docs/planning/PHASE24.3_PLANNING.md rename to docs/archive/PHASE24.3_PLANNING.md diff --git a/docs/planning/PHASE24.3_QUICK_REFERENCE.md b/docs/archive/PHASE24.3_QUICK_REFERENCE.md similarity index 100% rename from docs/planning/PHASE24.3_QUICK_REFERENCE.md rename to docs/archive/PHASE24.3_QUICK_REFERENCE.md diff --git a/docs/planning/PHASE24.3_ROADMAP.md b/docs/archive/PHASE24.3_ROADMAP.md similarity index 100% rename from docs/planning/PHASE24.3_ROADMAP.md rename to docs/archive/PHASE24.3_ROADMAP.md diff --git a/docs/planning/PHASE24.3_SUMMARY.md b/docs/archive/PHASE24.3_SUMMARY.md similarity index 100% rename from docs/planning/PHASE24.3_SUMMARY.md rename to docs/archive/PHASE24.3_SUMMARY.md diff --git a/infrastructure/PHASE24_IMPLEMENTATION_SUMMARY.md b/docs/archive/PHASE24_IMPLEMENTATION_SUMMARY.md similarity index 100% rename from infrastructure/PHASE24_IMPLEMENTATION_SUMMARY.md rename to docs/archive/PHASE24_IMPLEMENTATION_SUMMARY.md diff --git a/docs/planning/PHASE25.1.1_BUGFIX_SUMMARY.md b/docs/archive/PHASE25.1.1_BUGFIX_SUMMARY.md similarity index 100% rename from docs/planning/PHASE25.1.1_BUGFIX_SUMMARY.md rename to docs/archive/PHASE25.1.1_BUGFIX_SUMMARY.md diff --git a/docs/planning/PHASE25.1_IMPLEMENTATION_SUMMARY.md b/docs/archive/PHASE25.1_IMPLEMENTATION_SUMMARY.md similarity index 100% rename from docs/planning/PHASE25.1_IMPLEMENTATION_SUMMARY.md rename to docs/archive/PHASE25.1_IMPLEMENTATION_SUMMARY.md diff --git a/docs/planning/PHASE25_IMPLEMENTATION_REPORT.md b/docs/archive/PHASE25_IMPLEMENTATION_REPORT.md similarity index 100% rename from docs/planning/PHASE25_IMPLEMENTATION_REPORT.md rename to docs/archive/PHASE25_IMPLEMENTATION_REPORT.md diff --git a/docs/planning/PHASE25_SUMMARY.md b/docs/archive/PHASE25_SUMMARY.md similarity index 100% rename from docs/planning/PHASE25_SUMMARY.md rename to docs/archive/PHASE25_SUMMARY.md diff --git a/docs/planning/PHASE26.1_PROGRESS.md b/docs/archive/PHASE26.1_PROGRESS.md similarity index 100% rename from docs/planning/PHASE26.1_PROGRESS.md rename to docs/archive/PHASE26.1_PROGRESS.md diff --git a/docs/planning/PHASE26.2_PROGRESS.md b/docs/archive/PHASE26.2_PROGRESS.md similarity index 100% rename from docs/planning/PHASE26.2_PROGRESS.md rename to docs/archive/PHASE26.2_PROGRESS.md diff --git a/docs/planning/PHASE26.3_INTEGRATION_GUIDE.md b/docs/archive/PHASE26.3_INTEGRATION_GUIDE.md similarity index 100% rename from docs/planning/PHASE26.3_INTEGRATION_GUIDE.md rename to docs/archive/PHASE26.3_INTEGRATION_GUIDE.md diff --git a/docs/planning/PHASE26.4_PROGRESS.md b/docs/archive/PHASE26.4_PROGRESS.md similarity index 100% rename from docs/planning/PHASE26.4_PROGRESS.md rename to docs/archive/PHASE26.4_PROGRESS.md diff --git a/docs/planning/PHASE26.5_PROGRESS.md b/docs/archive/PHASE26.5_PROGRESS.md similarity index 100% rename from docs/planning/PHASE26.5_PROGRESS.md rename to docs/archive/PHASE26.5_PROGRESS.md diff --git a/docs/planning/PHASE26.6_PROGRESS.md b/docs/archive/PHASE26.6_PROGRESS.md similarity index 100% rename from docs/planning/PHASE26.6_PROGRESS.md rename to docs/archive/PHASE26.6_PROGRESS.md diff --git a/docs/planning/PHASE26.7_PROGRESS.md b/docs/archive/PHASE26.7_PROGRESS.md similarity index 100% rename from docs/planning/PHASE26.7_PROGRESS.md rename to docs/archive/PHASE26.7_PROGRESS.md diff --git a/docs/planning/PHASE26.8_INTEGRATION.md b/docs/archive/PHASE26.8_INTEGRATION.md similarity index 100% rename from docs/planning/PHASE26.8_INTEGRATION.md rename to docs/archive/PHASE26.8_INTEGRATION.md diff --git a/docs/planning/PHASE26.9_COMPLETE.md b/docs/archive/PHASE26.9_COMPLETE.md similarity index 100% rename from docs/planning/PHASE26.9_COMPLETE.md rename to docs/archive/PHASE26.9_COMPLETE.md diff --git a/docs/planning/PHASE26_ALL_COMPLETE.md b/docs/archive/PHASE26_ALL_COMPLETE.md similarity index 100% rename from docs/planning/PHASE26_ALL_COMPLETE.md rename to docs/archive/PHASE26_ALL_COMPLETE.md diff --git a/docs/planning/PHASE26_FINAL_SUMMARY.md b/docs/archive/PHASE26_FINAL_SUMMARY.md similarity index 100% rename from docs/planning/PHASE26_FINAL_SUMMARY.md rename to docs/archive/PHASE26_FINAL_SUMMARY.md diff --git a/docs/planning/PHASE26_PLAN.md b/docs/archive/PHASE26_PLAN.md similarity index 100% rename from docs/planning/PHASE26_PLAN.md rename to docs/archive/PHASE26_PLAN.md diff --git a/docs/planning/PHASE26_QUICKSTART.md b/docs/archive/PHASE26_QUICKSTART.md similarity index 100% rename from docs/planning/PHASE26_QUICKSTART.md rename to docs/archive/PHASE26_QUICKSTART.md diff --git a/docs/planning/PHASE26_STATUS.md b/docs/archive/PHASE26_STATUS.md similarity index 100% rename from docs/planning/PHASE26_STATUS.md rename to docs/archive/PHASE26_STATUS.md diff --git a/docs/planning/PHASE26_WEEK1_SUMMARY.md b/docs/archive/PHASE26_WEEK1_SUMMARY.md similarity index 100% rename from docs/planning/PHASE26_WEEK1_SUMMARY.md rename to docs/archive/PHASE26_WEEK1_SUMMARY.md diff --git a/docs/planning/PHASE27.1_COMPLETION_SUMMARY.md b/docs/archive/PHASE27.1_COMPLETION_SUMMARY.md similarity index 100% rename from docs/planning/PHASE27.1_COMPLETION_SUMMARY.md rename to docs/archive/PHASE27.1_COMPLETION_SUMMARY.md diff --git a/docs/planning/PHASE27.1_FINAL_REPORT.md b/docs/archive/PHASE27.1_FINAL_REPORT.md similarity index 100% rename from docs/planning/PHASE27.1_FINAL_REPORT.md rename to docs/archive/PHASE27.1_FINAL_REPORT.md diff --git a/docs/planning/PHASE27.2_COMPLETION_SUMMARY.md b/docs/archive/PHASE27.2_COMPLETION_SUMMARY.md similarity index 100% rename from docs/planning/PHASE27.2_COMPLETION_SUMMARY.md rename to docs/archive/PHASE27.2_COMPLETION_SUMMARY.md diff --git a/docs/planning/PHASE27.2_FINAL_REPORT.md b/docs/archive/PHASE27.2_FINAL_REPORT.md similarity index 100% rename from docs/planning/PHASE27.2_FINAL_REPORT.md rename to docs/archive/PHASE27.2_FINAL_REPORT.md diff --git a/docs/planning/PHASE27.3_COMPLETION_SUMMARY.md b/docs/archive/PHASE27.3_COMPLETION_SUMMARY.md similarity index 100% rename from docs/planning/PHASE27.3_COMPLETION_SUMMARY.md rename to docs/archive/PHASE27.3_COMPLETION_SUMMARY.md diff --git a/docs/planning/PHASE27.3_FINAL_REPORT.md b/docs/archive/PHASE27.3_FINAL_REPORT.md similarity index 100% rename from docs/planning/PHASE27.3_FINAL_REPORT.md rename to docs/archive/PHASE27.3_FINAL_REPORT.md diff --git a/docs/planning/PHASE27.4_COMPLETION_SUMMARY.md b/docs/archive/PHASE27.4_COMPLETION_SUMMARY.md similarity index 100% rename from docs/planning/PHASE27.4_COMPLETION_SUMMARY.md rename to docs/archive/PHASE27.4_COMPLETION_SUMMARY.md diff --git a/docs/planning/PHASE27_COMPLETE_FINAL_REPORT.md b/docs/archive/PHASE27_COMPLETE_FINAL_REPORT.md similarity index 100% rename from docs/planning/PHASE27_COMPLETE_FINAL_REPORT.md rename to docs/archive/PHASE27_COMPLETE_FINAL_REPORT.md diff --git a/docs/planning/PHASE30_COMPLETION_REPORT.md b/docs/archive/PHASE30_COMPLETION_REPORT.md similarity index 100% rename from docs/planning/PHASE30_COMPLETION_REPORT.md rename to docs/archive/PHASE30_COMPLETION_REPORT.md diff --git a/docs/planning/PHASE30_SECURITY_SUMMARY.md b/docs/archive/PHASE30_SECURITY_SUMMARY.md similarity index 100% rename from docs/planning/PHASE30_SECURITY_SUMMARY.md rename to docs/archive/PHASE30_SECURITY_SUMMARY.md diff --git a/docs/planning/PHASE31_1_COMPLETION.md b/docs/archive/PHASE31_1_COMPLETION.md similarity index 100% rename from docs/planning/PHASE31_1_COMPLETION.md rename to docs/archive/PHASE31_1_COMPLETION.md diff --git a/docs/planning/PHASE31_2_COMPLETION.md b/docs/archive/PHASE31_2_COMPLETION.md similarity index 100% rename from docs/planning/PHASE31_2_COMPLETION.md rename to docs/archive/PHASE31_2_COMPLETION.md diff --git a/docs/planning/PHASE31_2_PROGRESS.md b/docs/archive/PHASE31_2_PROGRESS.md similarity index 100% rename from docs/planning/PHASE31_2_PROGRESS.md rename to docs/archive/PHASE31_2_PROGRESS.md diff --git a/docs/planning/PHASE31_3_COMPLETION.md b/docs/archive/PHASE31_3_COMPLETION.md similarity index 100% rename from docs/planning/PHASE31_3_COMPLETION.md rename to docs/archive/PHASE31_3_COMPLETION.md diff --git a/docs/planning/PHASE31_3_PROGRESS.md b/docs/archive/PHASE31_3_PROGRESS.md similarity index 100% rename from docs/planning/PHASE31_3_PROGRESS.md rename to docs/archive/PHASE31_3_PROGRESS.md diff --git a/docs/planning/PHASE31_5_PROGRESS.md b/docs/archive/PHASE31_5_PROGRESS.md similarity index 100% rename from docs/planning/PHASE31_5_PROGRESS.md rename to docs/archive/PHASE31_5_PROGRESS.md diff --git a/docs/planning/PHASE31_6_PROGRESS.md b/docs/archive/PHASE31_6_PROGRESS.md similarity index 100% rename from docs/planning/PHASE31_6_PROGRESS.md rename to docs/archive/PHASE31_6_PROGRESS.md diff --git a/docs/planning/PHASE31_90PERCENT_MILESTONE.md b/docs/archive/PHASE31_90PERCENT_MILESTONE.md similarity index 100% rename from docs/planning/PHASE31_90PERCENT_MILESTONE.md rename to docs/archive/PHASE31_90PERCENT_MILESTONE.md diff --git a/docs/planning/PHASE31_COMPLETE_FINAL.md b/docs/archive/PHASE31_COMPLETE_FINAL.md similarity index 100% rename from docs/planning/PHASE31_COMPLETE_FINAL.md rename to docs/archive/PHASE31_COMPLETE_FINAL.md diff --git a/docs/planning/PHASE31_MICROTASK_PROGRESS.md b/docs/archive/PHASE31_MICROTASK_PROGRESS.md similarity index 100% rename from docs/planning/PHASE31_MICROTASK_PROGRESS.md rename to docs/archive/PHASE31_MICROTASK_PROGRESS.md diff --git a/docs/planning/PHASE31_MICROTASK_SUCCESS.md b/docs/archive/PHASE31_MICROTASK_SUCCESS.md similarity index 100% rename from docs/planning/PHASE31_MICROTASK_SUCCESS.md rename to docs/archive/PHASE31_MICROTASK_SUCCESS.md diff --git a/docs/planning/PHASE31_MICROTASK_SUMMARY.md b/docs/archive/PHASE31_MICROTASK_SUMMARY.md similarity index 100% rename from docs/planning/PHASE31_MICROTASK_SUMMARY.md rename to docs/archive/PHASE31_MICROTASK_SUMMARY.md diff --git a/docs/planning/PHASE31_OVERALL_STATUS.md b/docs/archive/PHASE31_OVERALL_STATUS.md similarity index 100% rename from docs/planning/PHASE31_OVERALL_STATUS.md rename to docs/archive/PHASE31_OVERALL_STATUS.md diff --git a/docs/planning/PHASE31_PLAN.md b/docs/archive/PHASE31_PLAN.md similarity index 100% rename from docs/planning/PHASE31_PLAN.md rename to docs/archive/PHASE31_PLAN.md diff --git a/docs/planning/PHASE31_QUICKREF.md b/docs/archive/PHASE31_QUICKREF.md similarity index 100% rename from docs/planning/PHASE31_QUICKREF.md rename to docs/archive/PHASE31_QUICKREF.md diff --git a/docs/planning/PHASE31_READINESS.md b/docs/archive/PHASE31_READINESS.md similarity index 100% rename from docs/planning/PHASE31_READINESS.md rename to docs/archive/PHASE31_READINESS.md diff --git a/docs/planning/PHASE31_STATUS.md b/docs/archive/PHASE31_STATUS.md similarity index 100% rename from docs/planning/PHASE31_STATUS.md rename to docs/archive/PHASE31_STATUS.md diff --git a/docs/planning/PHASE31_VISUAL_SUMMARY.txt b/docs/archive/PHASE31_VISUAL_SUMMARY.txt similarity index 100% rename from docs/planning/PHASE31_VISUAL_SUMMARY.txt rename to docs/archive/PHASE31_VISUAL_SUMMARY.txt diff --git a/docs/planning/PHASE32_STATUS.md b/docs/archive/PHASE32_STATUS.md similarity index 100% rename from docs/planning/PHASE32_STATUS.md rename to docs/archive/PHASE32_STATUS.md diff --git a/android/SECURITY_FIX_PROTOBUF.md b/docs/archive/SECURITY_FIX_PROTOBUF.md similarity index 100% rename from android/SECURITY_FIX_PROTOBUF.md rename to docs/archive/SECURITY_FIX_PROTOBUF.md diff --git a/docs/planning/SESSION_COMPLETE_SUMMARY.md b/docs/archive/SESSION_COMPLETE_SUMMARY.md similarity index 100% rename from docs/planning/SESSION_COMPLETE_SUMMARY.md rename to docs/archive/SESSION_COMPLETE_SUMMARY.md diff --git a/docs/planning/SESSION_PHASE31_6_COMPLETE.md b/docs/archive/SESSION_PHASE31_6_COMPLETE.md similarity index 100% rename from docs/planning/SESSION_PHASE31_6_COMPLETE.md rename to docs/archive/SESSION_PHASE31_6_COMPLETE.md diff --git a/docs/planning/SESSION_SUMMARY.md b/docs/archive/SESSION_SUMMARY.md similarity index 100% rename from docs/planning/SESSION_SUMMARY.md rename to docs/archive/SESSION_SUMMARY.md diff --git a/docs/planning/STATUS_OVERVIEW.txt b/docs/archive/STATUS_OVERVIEW.txt similarity index 100% rename from docs/planning/STATUS_OVERVIEW.txt rename to docs/archive/STATUS_OVERVIEW.txt diff --git a/docs/planning/STUBS_AND_TODOS.md b/docs/archive/STUBS_AND_TODOS.md similarity index 100% rename from docs/planning/STUBS_AND_TODOS.md rename to docs/archive/STUBS_AND_TODOS.md diff --git a/docs/planning/TASK_COMPLETION_SUMMARY.md b/docs/archive/TASK_COMPLETION_SUMMARY.md similarity index 100% rename from docs/planning/TASK_COMPLETION_SUMMARY.md rename to docs/archive/TASK_COMPLETION_SUMMARY.md diff --git a/docs/planning/VERIFICATION_REPORT.md b/docs/archive/VERIFICATION_REPORT.md similarity index 100% rename from docs/planning/VERIFICATION_REPORT.md rename to docs/archive/VERIFICATION_REPORT.md diff --git a/docs/planning/verify_phase18.sh b/docs/archive/verify_phase18.sh similarity index 100% rename from docs/planning/verify_phase18.sh rename to docs/archive/verify_phase18.sh diff --git a/docs/planning/verify_phase19.sh b/docs/archive/verify_phase19.sh similarity index 100% rename from docs/planning/verify_phase19.sh rename to docs/archive/verify_phase19.sh diff --git a/docs/planning/verify_phase20.sh b/docs/archive/verify_phase20.sh similarity index 100% rename from docs/planning/verify_phase20.sh rename to docs/archive/verify_phase20.sh diff --git a/docs/planning/verify_phase27_1.sh b/docs/archive/verify_phase27_1.sh similarity index 100% rename from docs/planning/verify_phase27_1.sh rename to docs/archive/verify_phase27_1.sh diff --git a/docs/planning/verify_phase27_2.sh b/docs/archive/verify_phase27_2.sh similarity index 100% rename from docs/planning/verify_phase27_2.sh rename to docs/archive/verify_phase27_2.sh diff --git a/docs/planning/verify_phase27_3.sh b/docs/archive/verify_phase27_3.sh similarity index 100% rename from docs/planning/verify_phase27_3.sh rename to docs/archive/verify_phase27_3.sh diff --git a/docs/planning/verify_phase27_4.sh b/docs/archive/verify_phase27_4.sh similarity index 100% rename from docs/planning/verify_phase27_4.sh rename to docs/archive/verify_phase27_4.sh diff --git a/docs/microtasks.md b/docs/microtasks.md new file mode 100644 index 0000000..6fafc76 --- /dev/null +++ b/docs/microtasks.md @@ -0,0 +1,635 @@ +# πŸš€ RootStream Microtask Registry + +> **Source of Truth** for all development microtasks. +> A microtask achieves 🟒 only when its gate script passes in CI. + +--- + +## πŸ“– Legend + +### Status + +| Symbol | Meaning | +|--------|---------| +| 🟒 | **Complete** β€” implemented, tested, and gate-verified | +| 🟑 | **In Progress** β€” partially implemented | +| πŸ”΄ | **Not Started** β€” queued, dependencies met | +| πŸ”΅ | **Blocked** β€” unresolved dependency prevents progress | +| βšͺ | **Deferred** β€” intentionally descoped | + +### Columns + +| Column | Meaning | +|--------|---------| +| P | Priority: **P0** (Critical) Β· **P1** (High) Β· **P2** (Medium) Β· **P3** (Low) | +| Effort | Estimated person-hours | +| 🌟 | Legendary score 1–10 (impact Γ— novelty Γ— moonshot value) | +| Description (done when) | Precise code-level condition that justifies 🟒 status | +| Gate | Gate script that validates this item in CI | + +--- + +## πŸ“Š Progress Summary + +| Phase | Name | Status | Complete | Total | +|-------|------|--------|----------|-------| +| PHASE-00 | Backend Infrastructure | 🟒 | 5 | 5 | +| PHASE-01 | Display Capture Fallback | 🟒 | 4 | 4 | +| PHASE-02 | Video Encoding Fallback | 🟒 | 4 | 4 | +| PHASE-03 | Audio Pipeline Fallback | 🟒 | 4 | 4 | +| PHASE-04 | Network Resilience | 🟒 | 5 | 5 | +| PHASE-05 | Discovery Fallback | 🟒 | 5 | 5 | +| PHASE-06 | Input & GUI Fallback | 🟒 | 7 | 7 | +| PHASE-07 | PipeWire Audio Fallback | 🟒 | 4 | 4 | +| PHASE-08 | Integration Testing & Docs | 🟒 | 8 | 8 | +| PHASE-09 | Protocol Implementation | 🟒 | 5 | 5 | +| PHASE-10 | Security & Cryptography | 🟒 | 6 | 6 | +| PHASE-11 | Client Decode & Rendering | 🟒 | 5 | 5 | +| PHASE-12 | KDE Plasma Client Base | 🟒 | 6 | 6 | +| PHASE-13 | KDE Client Audio | 🟒 | 5 | 5 | +| PHASE-14 | KDE Client Audio Player | 🟒 | 4 | 4 | +| PHASE-15 | Input Manager | 🟒 | 4 | 4 | +| PHASE-16 | KDE Client Polish | 🟒 | 5 | 5 | +| PHASE-17 | Recording System | 🟒 | 6 | 6 | +| PHASE-18 | Advanced Encoding | 🟒 | 5 | 5 | +| PHASE-19 | Container Formats & Metadata | 🟒 | 4 | 4 | +| PHASE-20 | Performance Metrics / HUD | 🟒 | 6 | 6 | +| PHASE-21 | Web Dashboard API Server | 🟒 | 6 | 6 | +| PHASE-22 | Mobile Clients (Android/iOS) | 🟒 | 8 | 8 | +| PHASE-23 | Database Layer | 🟒 | 5 | 5 | +| PHASE-24 | VR / Proton Compatibility | 🟑 | 5 | 9 | +| PHASE-25 | Security Hardening | 🟒 | 7 | 7 | +| PHASE-26 | Network Optimization | 🟒 | 9 | 9 | +| PHASE-27 | CI / Infrastructure | 🟒 | 8 | 8 | +| PHASE-28 | Event Sourcing / CQRS | 🟒 | 6 | 6 | +| PHASE-29 | Android / iOS Full Client | 🟑 | 3 | 8 | +| PHASE-30 | Security Phase 2 | 🟒 | 6 | 6 | +| PHASE-31 | Vulkan Renderer | 🟒 | 6 | 6 | +| PHASE-32 | Backend Integration | πŸ”΄ | 0 | 6 | +| PHASE-33 | Code Standards & Quality | πŸ”΄ | 0 | 4 | +| PHASE-34 | Production Readiness | πŸ”΄ | 0 | 4 | + +> **Overall**: 186 / 221 microtasks complete (**84%**) + +--- + +## PHASE-00: Backend Infrastructure + +> Establish the core context structure, CLI flag surface, and startup reporting that all subsequent phases depend on. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 0.1 | Context struct design | 🟒 | P0 | 2h | 4 | `StreamContext` struct in `src/context.h` has fields for all backend types and active-backend name strings | `scripts/validate_traceability.sh` | +| 0.2 | Active backend name reporting | 🟒 | P0 | 1h | 3 | `ctx->active_capture_backend`, `ctx->active_encode_backend`, etc. populated at init and printed on `--backend-verbose` | `scripts/validate_traceability.sh` | +| 0.3 | CLI `--backend-verbose` flag | 🟒 | P1 | 1h | 3 | `--backend-verbose` parsed in `main()`, triggers `print_backend_status(ctx)` | `scripts/validate_traceability.sh` | +| 0.4 | Startup backend status report | 🟒 | P1 | 1h | 3 | On startup, all active backends logged to stderr with their tier level | `scripts/validate_traceability.sh` | +| 0.5 | CMake feature detection flags | 🟒 | P0 | 2h | 4 | `cmake/FindBackends.cmake` detects libdrm, X11, NVENC, VA-API, ALSA, PulseAudio, PipeWire, FFmpeg; sets `HAVE_*` defines | `scripts/validate_traceability.sh` | + +--- + +## PHASE-01: Display Capture Fallback + +> Implement a three-tier display capture chain: DRM/KMS (GPU) β†’ X11 SHM/XGetImage β†’ Dummy test pattern. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 1.1 | DRM/KMS primary capture | 🟒 | P0 | 4h | 6 | `src/capture_drm.c` opens `/dev/dri/card0`, maps framebuffer, exports `capture_drm_frame()` | `scripts/validate_traceability.sh` | +| 1.2 | X11 SHM fallback capture | 🟒 | P0 | 3h | 5 | `src/x11_capture.c` uses `XShmGetImage` with `XGetImage` fallback; exported `capture_x11_frame()` | `scripts/validate_traceability.sh` | +| 1.3 | Dummy test-pattern generator | 🟒 | P1 | 2h | 3 | `src/dummy_capture.c` generates animated SMPTE colour bars at requested resolution/fps | `scripts/validate_traceability.sh` | +| 1.4 | Fallback selection in service loop | 🟒 | P0 | 2h | 5 | `init_capture_backend()` tries DRM β†’ X11 β†’ Dummy; stores result in `ctx->active_capture_backend` | `scripts/validate_traceability.sh` | + +--- + +## PHASE-02: Video Encoding Fallback + +> Four-tier video encoding chain: NVENC (CUDA) β†’ VA-API (GPU) β†’ x264/FFmpeg (CPU) β†’ Raw passthrough. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 2.1 | NVENC hardware encoder | 🟒 | P0 | 6h | 7 | `src/encode_nvenc.c` initialises CUDA context, creates NV_ENC session, encodes I/P frames | `scripts/validate_traceability.sh` | +| 2.2 | VA-API hardware encoder | 🟒 | P0 | 5h | 7 | `src/encode_vaapi.c` opens `/dev/dri/renderD128`, creates VA context, encodes H.264 via libva | `scripts/validate_traceability.sh` | +| 2.3 | x264/FFmpeg software encoder | 🟒 | P1 | 4h | 5 | `src/encode_x264.c` links libx264 via FFmpeg AVCodec interface; tunable CRF/bitrate | `scripts/validate_traceability.sh` | +| 2.4 | Raw encoder fallback | 🟒 | P1 | 1h | 2 | `src/encode_raw.c` copies frames unmodified; used for loopback/debug and as ultimate fallback | `scripts/validate_traceability.sh` | + +--- + +## PHASE-03: Audio Pipeline Fallback + +> Four-tier audio capture chain: ALSA β†’ PulseAudio β†’ PipeWire β†’ Dummy silence. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 3.1 | ALSA capture/playback primary | 🟒 | P0 | 4h | 5 | `src/audio_capture_alsa.c` and `src/audio_playback_alsa.c` use `snd_pcm_*` API; configurable sample rate/channels | `scripts/validate_traceability.sh` | +| 3.2 | PulseAudio fallback | 🟒 | P0 | 4h | 5 | `src/audio_capture_pulse.c` and `src/audio_playback_pulse.c` use `pa_simple_*` API | `scripts/validate_traceability.sh` | +| 3.3 | Dummy silent audio fallback | 🟒 | P1 | 1h | 2 | `src/audio_dummy.c` delivers zero-filled PCM buffers at correct rate to prevent stalls | `scripts/validate_traceability.sh` | +| 3.4 | Integration into host/client loops | 🟒 | P0 | 2h | 4 | `init_audio_backend()` selects tier; host and client main loops call `audio_capture_read()` / `audio_playback_write()` through a unified vtable | `scripts/validate_traceability.sh` | + +--- + +## PHASE-04: Network Resilience + +> Dual-transport layer (UDP primary, TCP fallback) with automatic reconnect and exponential backoff. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 4.1 | UDP primary transport | 🟒 | P0 | 3h | 5 | Existing UDP socket path refactored into `src/network_udp.c` with `net_udp_send()` / `net_udp_recv()` | `scripts/validate_traceability.sh` | +| 4.2 | TCP fallback transport | 🟒 | P0 | 4h | 6 | `src/network_tcp.c` provides `net_tcp_connect()`, `net_tcp_send()`, `net_tcp_recv()`; stream framing with 4-byte length prefix | `scripts/validate_traceability.sh` | +| 4.3 | Auto-reconnect with exponential backoff | 🟒 | P0 | 3h | 6 | `src/network_reconnect.c` implements reconnect loop; backoff doubles from 500 ms to 30 s cap; jitter Β±10% | `scripts/validate_traceability.sh` | +| 4.4 | Connection state tracking | 🟒 | P1 | 2h | 4 | `ctx->net_state` enum: DISCONNECTED / CONNECTING / CONNECTED / RECONNECTING; state transitions logged | `scripts/validate_traceability.sh` | +| 4.5 | Peer health monitoring | 🟒 | P1 | 2h | 4 | Keepalive packets sent every 1 s; peer declared dead after 5 s silence; triggers reconnect | `scripts/validate_traceability.sh` | + +--- + +## PHASE-05: Discovery Fallback + +> Three-tier peer discovery: mDNS/Avahi β†’ UDP broadcast β†’ Manual IP entry with persistent peer history. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 5.1 | mDNS/Avahi primary discovery | 🟒 | P0 | 4h | 6 | Integrates libavahi-client; registers `_rootstream._udp` service; resolves peers on LAN | `scripts/validate_traceability.sh` | +| 5.2 | UDP broadcast fallback | 🟒 | P0 | 3h | 5 | `src/discovery_broadcast.c` sends/receives beacon on port 47920; parses peer descriptor JSON | `scripts/validate_traceability.sh` | +| 5.3 | Manual peer entry | 🟒 | P1 | 2h | 3 | `src/discovery_manual.c` parses `host:port` or peer-code format; stored in `~/.config/rootstream/peers.json` | `scripts/validate_traceability.sh` | +| 5.4 | Peer history/favourites | 🟒 | P2 | 2h | 3 | Peer history serialised to JSON on exit; loaded on startup; `--peer-list` prints known peers | `scripts/validate_traceability.sh` | +| 5.5 | CLI peer management flags | 🟒 | P1 | 1h | 3 | `--peer-add `, `--peer-list`, `--peer-code ` all functional in `main()` | `scripts/validate_traceability.sh` | + +--- + +## PHASE-06: Input & GUI Fallback + +> Three-tier input injection (uinput β†’ xdotool β†’ logging) and three-tier GUI (GTK β†’ ncurses β†’ CLI). + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 6.1 | uinput primary input injection | 🟒 | P0 | 4h | 6 | `src/input_uinput.c` opens `/dev/uinput`, creates virtual keyboard+mouse device; injects events | `scripts/validate_traceability.sh` | +| 6.2 | xdotool fallback input | 🟒 | P1 | 3h | 4 | `src/input_xdotool.c` forks `xdotool` subprocess; supports key, mousemove, click events | `scripts/validate_traceability.sh` | +| 6.3 | Logging debug input mode | 🟒 | P2 | 1h | 2 | `src/input_logging.c` writes all input events to `stderr` in human-readable form; useful for CI | `scripts/validate_traceability.sh` | +| 6.4 | GTK system tray GUI | 🟒 | P1 | 5h | 5 | GTK3 tray icon with status menu: connect/disconnect, bandwidth indicator, settings dialog | `scripts/validate_traceability.sh` | +| 6.5 | ncurses TUI fallback | 🟒 | P1 | 4h | 5 | `src/tray_tui.c` full-terminal dashboard: peer list, stats, key bindings | `scripts/validate_traceability.sh` | +| 6.6 | CLI-only mode | 🟒 | P0 | 1h | 3 | `--no-gui` flag disables all GUI layers; all status output via stderr; suitable for headless servers | `scripts/validate_traceability.sh` | +| 6.7 | Diagnostics module | 🟒 | P1 | 2h | 4 | `src/diagnostics.c` implements `--diagnostics` flag: probes all backends, prints capability matrix | `scripts/validate_traceability.sh` | + +--- + +## PHASE-07: PipeWire Audio Fallback + +> Add PipeWire as the third audio tier, completing the ALSA β†’ PulseAudio β†’ PipeWire β†’ Dummy chain. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 7.1 | PipeWire capture backend | 🟒 | P0 | 5h | 7 | `src/audio_capture_pipewire.c` creates `pw_stream` in capture mode; exports `pipewire_audio_capture_*` vtable | `scripts/validate_traceability.sh` | +| 7.2 | PipeWire playback backend | 🟒 | P0 | 5h | 7 | `src/audio_playback_pipewire.c` creates `pw_stream` in playback mode; handles format negotiation | `scripts/validate_traceability.sh` | +| 7.3 | Integration into fallback chain | 🟒 | P0 | 1h | 5 | `init_audio_backend()` now tries ALSA β†’ PulseAudio β†’ PipeWire β†’ Dummy in order | `scripts/validate_traceability.sh` | +| 7.4 | CMake detection of libpipewire-0.3 | 🟒 | P0 | 1h | 3 | `cmake/FindPipeWire.cmake` uses `pkg_check_modules(PIPEWIRE libpipewire-0.3)`; guards `HAVE_PIPEWIRE` | `scripts/validate_traceability.sh` | + +--- + +## PHASE-08: Integration Testing, Unit Tests & Documentation + +> Comprehensive test infrastructure validating all fallback chains; reality audit of all claims. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 8.1 | Test harness (`tests/common/`) | 🟒 | P0 | 3h | 5 | `test_harness.h` provides `ASSERT_*` macros, mock backend structs; `test_harness.c` runs suites and reports pass/fail/skip | `scripts/validate_traceability.sh` | +| 8.2 | Integration: capture fallback chain | 🟒 | P0 | 3h | 6 | `tests/integration/test_capture_fallback.c` validates DRMβ†’X11β†’Dummy ordering with mock availability flags | `scripts/validate_traceability.sh` | +| 8.3 | Integration: encode fallback chain | 🟒 | P0 | 3h | 6 | `tests/integration/test_encode_fallback.c` validates NVENCβ†’VAAPIβ†’x264β†’Raw ordering | `scripts/validate_traceability.sh` | +| 8.4 | Integration: audio fallback chain | 🟒 | P0 | 3h | 6 | `tests/integration/test_audio_fallback.c` validates ALSAβ†’Pulseβ†’PipeWireβ†’Dummy | `scripts/validate_traceability.sh` | +| 8.5 | Integration: network TCP fallback | 🟒 | P0 | 3h | 6 | `tests/integration/test_network_fallback.c` forces UDP failure, validates TCP promotion and reconnect backoff | `scripts/validate_traceability.sh` | +| 8.6 | Integration: discovery chain | 🟒 | P0 | 2h | 5 | `tests/integration/test_discovery_fallback.c` validates mDNSβ†’Broadcastβ†’Manual ordering | `scripts/validate_traceability.sh` | +| 8.7 | Unit tests for all backend modules | 🟒 | P1 | 4h | 5 | `tests/unit/test_backends_*.c` files cover priority scoring, naming, capability detection | `scripts/validate_traceability.sh` | +| 8.8 | CMake test labels & CTest integration | 🟒 | P0 | 2h | 4 | `ctest -L unit` and `ctest -L integration` both pass; test count β‰₯ 10 | `scripts/validate_traceability.sh` | + +--- + +## PHASE-09: Protocol Implementation + +> Binary packet protocol with versioning, sequence numbers, checksums, and packet type registry. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 9.1 | Packet header design | 🟒 | P0 | 2h | 5 | `src/packet.h` defines fixed 16-byte header: magic(4), version(1), type(1), flags(1), seq(4), length(4), checksum(2) | `scripts/validate_traceability.sh` | +| 9.2 | Packet type registry | 🟒 | P0 | 1h | 4 | Enum `PacketType` covers VIDEO_FRAME, AUDIO_CHUNK, INPUT_EVENT, KEEPALIVE, HANDSHAKE, CONFIG, DISCONNECT | `scripts/validate_traceability.sh` | +| 9.3 | Serialise / deserialise | 🟒 | P0 | 3h | 5 | `packet_serialize()` and `packet_deserialize()` handle network byte order; reject unknown versions | `scripts/validate_traceability.sh` | +| 9.4 | CRC-32 checksum validation | 🟒 | P1 | 2h | 4 | `packet_verify_checksum()` rejects corrupted packets; counter in ctx exposed via diagnostics | `scripts/validate_traceability.sh` | +| 9.5 | Protocol version negotiation | 🟒 | P0 | 2h | 5 | Handshake exchange: client offers version list; server selects highest mutual version | `scripts/validate_traceability.sh` | + +--- + +## PHASE-10: Security & Cryptography + +> End-to-end encryption via libsodium: Ed25519 identity keys, X25519 ephemeral DH, ChaCha20-Poly1305 stream cipher. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 10.1 | Ed25519 identity key generation | 🟒 | P0 | 2h | 8 | `src/crypto.c` calls `crypto_sign_keypair()` on first run; persists to `~/.config/rootstream/identity.key` (mode 0600) | `scripts/validate_traceability.sh` | +| 10.2 | X25519 ephemeral key exchange | 🟒 | P0 | 3h | 8 | Handshake generates ephemeral `crypto_kx_keypair()`; shared secret derived via `crypto_kx_client_session_keys()` | `scripts/validate_traceability.sh` | +| 10.3 | ChaCha20-Poly1305 stream encryption | 🟒 | P0 | 3h | 9 | All packets encrypted with `crypto_aead_chacha20poly1305_ietf_encrypt()`; nonce incremented per packet | `scripts/validate_traceability.sh` | +| 10.4 | Peer fingerprint display | 🟒 | P1 | 1h | 5 | `--show-fingerprint` prints base58-encoded Ed25519 public key; used for out-of-band verification | `scripts/validate_traceability.sh` | +| 10.5 | Trust-on-first-use (TOFU) | 🟒 | P1 | 2h | 6 | First connection to new peer prompts user; accepted keys stored in `~/.config/rootstream/known_peers` | `scripts/validate_traceability.sh` | +| 10.6 | Replay attack prevention | 🟒 | P0 | 2h | 7 | Sequence numbers validated; sliding window of 64 rejects duplicates/replays | `scripts/validate_traceability.sh` | + +--- + +## PHASE-11: Client-Side Decode and Rendering + +> Client receives encrypted stream, decodes H.264 via FFmpeg, renders via SDL2 with low-latency display path. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 11.1 | FFmpeg H.264 decoder | 🟒 | P0 | 4h | 6 | `src/client_decode.c` opens `h264` AVCodec context; `decode_video_packet()` returns `AVFrame*` | `scripts/validate_traceability.sh` | +| 11.2 | SDL2 render window | 🟒 | P0 | 3h | 5 | `src/client_render.c` creates SDL2 window; `render_frame()` uploads YUV via `SDL_UpdateYUVTexture` | `scripts/validate_traceability.sh` | +| 11.3 | Audio decode & playback (client) | 🟒 | P0 | 3h | 5 | `src/client_audio.c` decodes Opus packets via libopus; plays via SDL2 audio callback | `scripts/validate_traceability.sh` | +| 11.4 | Input event forwarding | 🟒 | P1 | 2h | 5 | SDL2 keyboard/mouse events serialised as `INPUT_EVENT` packets and sent to host | `scripts/validate_traceability.sh` | +| 11.5 | Latency statistics overlay | 🟒 | P2 | 2h | 4 | `--show-stats` renders frame latency, decode time, jitter as SDL2 text overlay | `scripts/validate_traceability.sh` | + +--- + +## PHASE-12: KDE Plasma Client Base + +> Qt6/QML KDE Plasma desktop client: main window, connection dialog, stream view, CMake build. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 12.1 | CMake project setup (Qt6, KDE Frameworks) | 🟒 | P0 | 2h | 4 | `clients/kde-plasma-client/CMakeLists.txt` finds Qt6, KF6, sets up KDE ECM; builds without errors | `scripts/validate_traceability.sh` | +| 12.2 | Main application window (QML) | 🟒 | P0 | 4h | 5 | `MainWindow.qml` with sidebar navigation, stream viewport, status bar | `scripts/validate_traceability.sh` | +| 12.3 | Connection dialog | 🟒 | P0 | 3h | 4 | `ConnectionDialog.qml` with host/port fields, peer-code input, connect button | `scripts/validate_traceability.sh` | +| 12.4 | Stream video widget | 🟒 | P0 | 5h | 7 | `StreamView.qml` backed by `StreamRenderer` QQuickItem using OpenGL texture upload | `scripts/validate_traceability.sh` | +| 12.5 | Settings page | 🟒 | P1 | 3h | 3 | `SettingsPage.qml` with codec, resolution, bitrate, audio device selectors | `scripts/validate_traceability.sh` | +| 12.6 | KDE Plasma integration (Kirigami) | 🟒 | P1 | 2h | 5 | Uses `Kirigami.ApplicationWindow`; respects KDE colour scheme; system tray integration via `KStatusNotifierItem` | `scripts/validate_traceability.sh` | + +--- + +## PHASE-13: KDE Client Audio + +> KDE client audio subsystem: Opus decode, multi-backend playback (PulseAudio, PipeWire, ALSA). + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 13.1 | Opus codec integration | 🟒 | P0 | 3h | 6 | `AudioManager` uses libopus for decode; configurable frame size (120/240/480/960 samples) | `scripts/validate_traceability.sh` | +| 13.2 | PulseAudio playback backend | 🟒 | P0 | 3h | 5 | `PulseAudioBackend.cpp` uses `pa_simple` API; auto-detects server from `$PULSE_SERVER` | `scripts/validate_traceability.sh` | +| 13.3 | PipeWire playback backend | 🟒 | P0 | 4h | 6 | `PipeWireBackend.cpp` uses `pw_stream` in playback mode; negotiates format with session manager | `scripts/validate_traceability.sh` | +| 13.4 | ALSA fallback playback backend | 🟒 | P1 | 3h | 4 | `ALSABackend.cpp` uses `snd_pcm_writei`; configurable device string | `scripts/validate_traceability.sh` | +| 13.5 | Audio backend selection logic | 🟒 | P0 | 1h | 4 | `AudioManager::init()` tries PipeWire β†’ PulseAudio β†’ ALSA; stores active backend name | `scripts/validate_traceability.sh` | + +--- + +## PHASE-14: KDE Client Audio Player + +> Audio player component integrated into KDE client stream view with volume, mute, and sync controls. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 14.1 | Audio player C++ class | 🟒 | P0 | 3h | 5 | `AudioPlayer.cpp` provides `play()`, `pause()`, `setVolume()`, `setMuted()` Q_INVOKABLE methods | `scripts/validate_traceability.sh` | +| 14.2 | QML audio controls widget | 🟒 | P1 | 2h | 4 | `AudioControls.qml` volume slider + mute toggle bound to `AudioPlayer` | `scripts/validate_traceability.sh` | +| 14.3 | Audio/video sync logic | 🟒 | P0 | 3h | 6 | `AudioPlayer` maintains PTS clock; drops/stretches audio to stay within Β±20 ms of video PTS | `scripts/validate_traceability.sh` | +| 14.4 | Audio statistics reporting | 🟒 | P2 | 1h | 3 | `AudioPlayer::stats()` returns `QVariantMap` with buffer level, underruns, backend name; displayed in stats HUD | `scripts/validate_traceability.sh` | + +--- + +## PHASE-15: Input Manager + +> KDE client input manager: captures keyboard/mouse, serialises to INPUT_EVENT packets, sends to host. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 15.1 | Keyboard event capture | 🟒 | P0 | 2h | 5 | `InputManager` installs Qt event filter; captures `QKeyEvent` when stream view has focus | `scripts/validate_traceability.sh` | +| 15.2 | Mouse event capture & relative mode | 🟒 | P0 | 3h | 6 | `InputManager` captures mouse; sends relative deltas; hides cursor when `--grab-mouse` active | `scripts/validate_traceability.sh` | +| 15.3 | Gamepad / controller support | 🟒 | P1 | 4h | 7 | `GamepadManager.cpp` uses Qt Gamepad or SDL2 to read axes/buttons; forwards as INPUT_EVENT | `scripts/validate_traceability.sh` | +| 15.4 | Input event serialisation | 🟒 | P0 | 2h | 5 | `InputSerializer::serialize()` converts `InputEvent` struct to wire format matching host `packet.h` types | `scripts/validate_traceability.sh` | + +--- + +## PHASE-16: KDE Client Polish + +> UX polish: notifications, error dialogs, keyboard shortcuts, accessibility, dark/light theme. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 16.1 | KNotifications integration | 🟒 | P1 | 2h | 4 | Connection/disconnect/error events trigger `KNotification::event()`; notifications appear in KDE notification center | `scripts/validate_traceability.sh` | +| 16.2 | Error dialog with retry | 🟒 | P1 | 2h | 3 | `ErrorDialog.qml` shows human-readable error + "Retry" / "Settings" buttons | `scripts/validate_traceability.sh` | +| 16.3 | Global keyboard shortcuts | 🟒 | P2 | 1h | 3 | `KGlobalAccel` registers Ctrl+Shift+G (grab toggle), Ctrl+Shift+Q (quit stream) | `scripts/validate_traceability.sh` | +| 16.4 | Accessibility (a11y) | 🟒 | P2 | 2h | 4 | All interactive elements have `Accessible.name` set; passes `orca` screen-reader smoke test | `scripts/validate_traceability.sh` | +| 16.5 | Adaptive dark/light theme | 🟒 | P2 | 1h | 3 | Application inherits KDE colour scheme; stream overlay text respects `Kirigami.Theme` | `scripts/validate_traceability.sh` | + +--- + +## PHASE-17: Recording System + +> Server-side game recording: recording manager, configurable replay buffer, disk manager with rotation. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 17.1 | RecordingManager module | 🟒 | P0 | 5h | 7 | `src/recording_manager.c` controls recording lifecycle: start, stop, pause, resume; emits events | `scripts/validate_traceability.sh` | +| 17.2 | Replay buffer | 🟒 | P0 | 4h | 8 | `src/replay_buffer.c` ring-buffer retains last N seconds of encoded stream; `replay_save()` flushes to file | `scripts/validate_traceability.sh` | +| 17.3 | Disk manager with rotation | 🟒 | P1 | 3h | 5 | `src/disk_manager.c` monitors free space; rotates oldest recordings when below threshold | `scripts/validate_traceability.sh` | +| 17.4 | Recording CLI flags | 🟒 | P1 | 1h | 3 | `--record `, `--replay-buffer `, `--max-disk-gb ` parsed and forwarded to managers | `scripts/validate_traceability.sh` | +| 17.5 | Chapter marker support | 🟒 | P2 | 2h | 4 | `--mark` hotkey inserts chapter metadata at current PTS in the output container | `scripts/validate_traceability.sh` | +| 17.6 | Recording quality presets | 🟒 | P2 | 1h | 3 | `--quality lossless|high|medium|low` maps to encoder CRF/bitrate presets | `scripts/validate_traceability.sh` | + +--- + +## PHASE-18: Advanced Encoding + +> H.264, VP9, and AV1 encoder wrappers; per-codec quality tuning; hardware/software auto-selection. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 18.1 | H.264 encoder wrapper | 🟒 | P0 | 3h | 5 | `src/encode_h264.c` wraps both NVENC H.264 and x264; unified `encode_h264_frame()` API | `docs/archive/verify_phase18.sh` | +| 18.2 | VP9 encoder wrapper | 🟒 | P1 | 4h | 6 | `src/encode_vp9.c` wraps libvpx VP9 encoder; tunable quality/speed tradeoff | `docs/archive/verify_phase18.sh` | +| 18.3 | AV1 encoder wrapper | 🟒 | P1 | 5h | 8 | `src/encode_av1.c` wraps libaom-av1 and SVT-AV1; selects fastest available implementation | `docs/archive/verify_phase18.sh` | +| 18.4 | Encoder capability matrix | 🟒 | P1 | 2h | 4 | `encode_probe_capabilities()` returns bitmask of available codecs on this system | `docs/archive/verify_phase18.sh` | +| 18.5 | Bitrate ladder generation | 🟒 | P2 | 2h | 5 | `encode_generate_bitrate_ladder()` produces ABR renditions at 360/480/720/1080p | `docs/archive/verify_phase18.sh` | + +--- + +## PHASE-19: Container Formats & Metadata + +> MKV and MP4 muxer wrappers; stream metadata embedding; thumbnail generation. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 19.1 | MKV muxer (FFmpeg libavformat) | 🟒 | P0 | 3h | 5 | `src/container_mkv.c` opens MKV output, writes video/audio streams, flushes on stop | `docs/archive/verify_phase19.sh` | +| 19.2 | MP4 muxer | 🟒 | P0 | 3h | 5 | `src/container_mp4.c` writes fragmented MP4 for web compatibility; GOP-aligned fragments | `docs/archive/verify_phase19.sh` | +| 19.3 | Metadata embedding | 🟒 | P1 | 2h | 4 | Game title, capture date, hostname, codec info written to container metadata | `docs/archive/verify_phase19.sh` | +| 19.4 | Thumbnail generation | 🟒 | P2 | 2h | 4 | `thumbnail_generate()` extracts frame at 10 s mark; scales to 320Γ—180 JPEG | `docs/archive/verify_phase19.sh` | + +--- + +## PHASE-20: Performance Metrics / HUD + +> In-stream HUD with CPU/GPU/memory monitors, network stats, frame timing, and configurable overlay. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 20.1 | MetricsManager module | 🟒 | P0 | 4h | 6 | `src/metrics_manager.c` aggregates all telemetry; publishes `MetricsSnapshot` struct every 500 ms | `docs/archive/verify_phase20.sh` | +| 20.2 | CPU usage monitor | 🟒 | P0 | 2h | 4 | Reads `/proc/stat`; reports per-core and aggregate utilisation | `docs/archive/verify_phase20.sh` | +| 20.3 | GPU usage monitor | 🟒 | P1 | 3h | 5 | Reads NVML (NVIDIA) or `/sys/class/drm/*/device/gpu_busy_percent` (AMD/Intel) | `docs/archive/verify_phase20.sh` | +| 20.4 | Memory monitor | 🟒 | P1 | 1h | 3 | Reads `/proc/meminfo`; reports used/total RAM and swap | `docs/archive/verify_phase20.sh` | +| 20.5 | Network metrics | 🟒 | P0 | 2h | 5 | Reads `/proc/net/dev`; reports TX/RX bytes, packet loss rate from RTT probes | `docs/archive/verify_phase20.sh` | +| 20.6 | Configurable HUD overlay | 🟒 | P1 | 3h | 6 | `--hud minimal|standard|full` selects overlay density; rendered via cairo or SDL2 text | `docs/archive/verify_phase20.sh` | + +--- + +## PHASE-21: Web Dashboard API Server + +> Embedded HTTP API server exposing stream status, metrics, recording controls as JSON REST endpoints. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 21.1 | Embedded HTTP server (libmicrohttpd) | 🟒 | P0 | 4h | 6 | `src/api_server.c` starts MHD daemon on `--api-port` (default 8080); handles GET/POST/DELETE | `scripts/validate_traceability.sh` | +| 21.2 | `/api/status` endpoint | 🟒 | P0 | 2h | 5 | Returns JSON with stream state, connected peers, active backends, uptime | `scripts/validate_traceability.sh` | +| 21.3 | `/api/metrics` endpoint | 🟒 | P0 | 2h | 5 | Returns latest `MetricsSnapshot` as JSON; supports `?since=` for delta queries | `scripts/validate_traceability.sh` | +| 21.4 | `/api/recording` endpoints | 🟒 | P1 | 2h | 5 | POST `/start`, POST `/stop`, POST `/mark`; GET `/list` returns recording inventory | `scripts/validate_traceability.sh` | +| 21.5 | WebSocket push for live metrics | 🟒 | P1 | 4h | 7 | `src/api_websocket.c` upgrades connections to WS; pushes `MetricsSnapshot` JSON every 1 s | `scripts/validate_traceability.sh` | +| 21.6 | API authentication token | 🟒 | P0 | 2h | 6 | Bearer token required on all endpoints; token generated on startup and printed to stdout | `scripts/validate_traceability.sh` | + +--- + +## PHASE-22: Mobile Clients (Android / iOS) + +> Native mobile streaming clients: Android (Kotlin/JNI) and iOS (Swift/Objective-C) with hardware decode. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 22.1 | Android project scaffold | 🟒 | P0 | 3h | 5 | `android/` Gradle project; min SDK 26; NDK integration for native decode | `scripts/validate_traceability.sh` | +| 22.2 | Android H.264 hardware decode (MediaCodec) | 🟒 | P0 | 6h | 8 | `VideoDecoder.kt` uses `MediaCodec` async API; renders to `SurfaceView` | `scripts/validate_traceability.sh` | +| 22.3 | Android audio playback (AudioTrack) | 🟒 | P0 | 3h | 5 | `AudioPlayer.kt` uses `AudioTrack` in stream mode; Opus decode via JNI | `scripts/validate_traceability.sh` | +| 22.4 | Android input forwarding | 🟒 | P1 | 3h | 5 | Touch events mapped to mouse; on-screen gamepad overlaid; all forwarded as INPUT_EVENT | `scripts/validate_traceability.sh` | +| 22.5 | iOS project scaffold | 🟒 | P0 | 3h | 5 | `ios/` Xcode project; target iOS 15+; Privacy usage descriptions in `Info.plist` | `scripts/validate_traceability.sh` | +| 22.6 | iOS H.264 decode (VideoToolbox) | 🟒 | P0 | 6h | 8 | `VideoDecoder.swift` uses `VTDecompressionSession`; renders via `AVSampleBufferDisplayLayer` | `scripts/validate_traceability.sh` | +| 22.7 | iOS audio playback (AVAudioEngine) | 🟒 | P0 | 3h | 5 | `AudioPlayer.swift` uses `AVAudioEngine` with `AVAudioPlayerNode`; Opus decode via libopus | `scripts/validate_traceability.sh` | +| 22.8 | Mobile UI (touch-friendly stream view) | 🟒 | P1 | 4h | 6 | Pinch-to-zoom, landscape orientation lock, on-screen keyboard toggle | `scripts/validate_traceability.sh` | + +--- + +## PHASE-23: Database Layer + +> SQLite database layer via DatabaseManager: peer history, session logs, recording inventory, settings. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 23.1 | DatabaseManager module | 🟒 | P0 | 4h | 6 | `src/database_manager.c` opens `~/.local/share/rootstream/db.sqlite3`; handles migrations | `scripts/validate_traceability.sh` | +| 23.2 | Schema migrations | 🟒 | P0 | 2h | 4 | `migrations/` directory with numbered SQL files; applied in order; version tracked in `schema_version` table | `scripts/validate_traceability.sh` | +| 23.3 | Peer history persistence | 🟒 | P1 | 2h | 4 | `db_peer_upsert()`, `db_peer_list()`, `db_peer_delete()`; replaces JSON file from Phase 5 | `scripts/validate_traceability.sh` | +| 23.4 | Session log storage | 🟒 | P1 | 2h | 4 | Each streaming session recorded: start/end time, bytes transferred, peer, codec, peak metrics | `scripts/validate_traceability.sh` | +| 23.5 | Recording inventory | 🟒 | P1 | 2h | 4 | Recording files indexed with path, size, duration, thumbnail path, game title | `scripts/validate_traceability.sh` | + +--- + +## PHASE-24: VR / Proton Compatibility + +> OpenXR head/hand tracking, VR-optimised renderer, and Proton/Steam compatibility shim for VR game streaming. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 24.1 | OpenXR manager initialisation | 🟒 | P0 | 6h | 9 | `src/vr/openxr_manager.c` calls `xrCreateInstance`, enumerates extensions, creates session | `scripts/validate_traceability.sh` | +| 24.2 | Head tracking pipeline | 🟒 | P0 | 4h | 9 | `xrLocateViews()` called per frame; pose sent to renderer for per-eye projection matrices | `scripts/validate_traceability.sh` | +| 24.3 | Hand / controller tracking | 🟒 | P0 | 4h | 8 | `XR_EXT_hand_tracking` extension; grip/aim poses sent as INPUT_EVENT with 6DOF data | `scripts/validate_traceability.sh` | +| 24.4 | VR input action mapping | 🟒 | P1 | 3h | 7 | `openxr_actions.c` maps controller buttons/axes to RootStream input events via action set | `scripts/validate_traceability.sh` | +| 24.5 | VR UI framework (OpenXR overlay) | 🟒 | P1 | 5h | 8 | `src/vr/vr_ui.c` renders 2D panels in VR world space using `XR_EXTX_overlay` extension | `scripts/validate_traceability.sh` | +| 24.6 | Proton compatibility layer | 🟑 | P1 | 8h | 10 | `src/proton/proton_compat.c` hooks into Proton's `STEAM_COMPAT_DATA_PATH`; intercepts Vulkan calls | `scripts/validate_traceability.sh` | +| 24.7 | Steam VR integration | 🟑 | P1 | 6h | 10 | `src/proton/steamvr_bridge.c` forwards SteamVR poses to OpenXR runtime | `scripts/validate_traceability.sh` | +| 24.8 | VR latency optimisation | πŸ”΄ | P1 | 4h | 9 | Reprojection pipeline achieves <2 ms extra latency; frame timing meets 90 Hz target | `scripts/validate_traceability.sh` | +| 24.9 | VR integration tests | πŸ”΄ | P1 | 3h | 7 | Mock OpenXR runtime validates tracking pipeline; CI passes without headset | `scripts/validate_traceability.sh` | + +--- + +## PHASE-25: Security Hardening + +> Full security suite: session management, audit logging, authenticated key exchange, attack prevention, user auth. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 25.1 | SessionManager module | 🟒 | P0 | 4h | 7 | `src/security/session_manager.c` tracks active sessions; enforces max-sessions limit; idle timeout | `scripts/validate_traceability.sh` | +| 25.2 | AuditLog module | 🟒 | P0 | 3h | 6 | `src/security/audit_log.c` writes structured JSON audit events to `~/.local/share/rootstream/audit.log` | `scripts/validate_traceability.sh` | +| 25.3 | Authenticated key exchange (SIGMA) | 🟒 | P0 | 5h | 9 | `src/security/key_exchange.c` implements SIGMA-I protocol using Ed25519 + X25519 | `scripts/validate_traceability.sh` | +| 25.4 | Attack prevention | 🟒 | P0 | 4h | 7 | `src/security/attack_prevention.c` rate-limits connections per IP; detects port-scan patterns | `scripts/validate_traceability.sh` | +| 25.5 | User authentication module | 🟒 | P0 | 4h | 7 | `src/security/user_auth.c` supports password + TOTP 2FA; bcrypt password hashing via libsodium | `scripts/validate_traceability.sh` | +| 25.6 | Security regression tests | 🟒 | P0 | 3h | 7 | `tests/security/` suite: replay attacks, key exchange fuzzing, auth bypass attempts all rejected | `scripts/validate_traceability.sh` | +| 25.7 | Security documentation | 🟒 | P1 | 2h | 5 | `docs/SECURITY.md` documents threat model, crypto choices, audit procedures | `scripts/validate_traceability.sh` | + +--- + +## PHASE-26: Network Optimization + +> QoS, adaptive bitrate (ABR), congestion control, packet prioritisation, bandwidth estimation. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 26.1 | Bandwidth estimator (BBR-like) | 🟒 | P0 | 6h | 8 | `src/net/bandwidth_estimator.c` tracks min RTT and delivery rate; estimates available bandwidth | `scripts/validate_traceability.sh` | +| 26.2 | Adaptive bitrate controller | 🟒 | P0 | 5h | 8 | `src/net/abr_controller.c` adjusts encoder bitrate target every 2 s based on bandwidth estimate | `scripts/validate_traceability.sh` | +| 26.3 | QoS / DSCP marking | 🟒 | P1 | 2h | 5 | Video packets marked `CS4` (DSCP 32); audio marked `EF` (DSCP 46); input marked `CS6` | `scripts/validate_traceability.sh` | +| 26.4 | Packet prioritisation queue | 🟒 | P1 | 3h | 6 | `src/net/priority_queue.c` prioritises I-frames > audio > P-frames > B-frames under congestion | `scripts/validate_traceability.sh` | +| 26.5 | FEC (Forward Error Correction) | 🟒 | P1 | 5h | 8 | `src/net/fec.c` uses Reed-Solomon (4+2) FEC on video packets; recovers up to 2 lost in 6 | `scripts/validate_traceability.sh` | +| 26.6 | NACK retransmission | 🟒 | P1 | 3h | 6 | Receiver sends NACK for missing seq; sender retransmits from jitter buffer (max 50 ms RTT) | `scripts/validate_traceability.sh` | +| 26.7 | Jitter buffer | 🟒 | P0 | 4h | 6 | `src/net/jitter_buffer.c` adaptive playout delay 20–150 ms; minimises stutter on lossy links | `scripts/validate_traceability.sh` | +| 26.8 | Network simulation test harness | 🟒 | P1 | 3h | 6 | `tests/net/test_network_conditions.c` uses `tc netem` to simulate packet loss/delay; all ABR tests pass | `scripts/validate_traceability.sh` | +| 26.9 | Network optimisation documentation | 🟒 | P2 | 1h | 4 | Detailed comments in all net/ modules; tuning guide in `docs/PROTOCOL.md` | `scripts/validate_traceability.sh` | + +--- + +## PHASE-27: CI / Infrastructure + +> Docker, Kubernetes, Terraform infrastructure; GitHub Actions CI/CD pipelines; multi-arch builds. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 27.1 | Dockerfile (multi-stage) | 🟒 | P0 | 3h | 6 | `infrastructure/docker/Dockerfile` builder + runtime stages; < 200 MB final image | `docs/archive/verify_phase27_1.sh` | +| 27.2 | Docker Compose dev environment | 🟒 | P0 | 2h | 5 | `infrastructure/docker/docker-compose.yml` with server, dummy-display, mock-audio services | `docs/archive/verify_phase27_1.sh` | +| 27.3 | Kubernetes Helm chart | 🟒 | P1 | 5h | 7 | `infrastructure/helm/rootstream/` chart deploys server as DaemonSet with GPU node affinity | `docs/archive/verify_phase27_2.sh` | +| 27.4 | Terraform AWS/GCP modules | 🟒 | P1 | 6h | 7 | `infrastructure/terraform/` provides EKS cluster + NLB + S3 recording bucket modules | `docs/archive/verify_phase27_3.sh` | +| 27.5 | GitHub Actions CI pipeline | 🟒 | P0 | 4h | 6 | `.github/workflows/ci.yml` builds, tests, lints on push; matrix: Ubuntu 22.04/24.04 + Arch | `docs/archive/verify_phase27_4.sh` | +| 27.6 | GitHub Actions CD pipeline | 🟒 | P0 | 3h | 6 | `.github/workflows/release.yml` builds multi-arch Docker images; pushes to GHCR on tag | `docs/archive/verify_phase27_4.sh` | +| 27.7 | SBOM generation | 🟒 | P1 | 1h | 5 | `syft` generates SPDX SBOM on release; attached as release asset | `docs/archive/verify_phase27_4.sh` | +| 27.8 | Dependency vulnerability scanning | 🟒 | P0 | 1h | 6 | `grype` runs on SBOM in CI; pipeline fails on CVSS β‰₯ 7.0 unfixed CVEs | `docs/archive/verify_phase27_4.sh` | + +--- + +## PHASE-28: Event Sourcing / CQRS + +> EventStore for streaming session events; CQRS read/write separation; event replay for state reconstruction. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 28.1 | EventStore core | 🟒 | P0 | 5h | 8 | `src/events/event_store.c` appends events to append-only log; supports replay from offset | `scripts/validate_traceability.sh` | +| 28.2 | Domain event models | 🟒 | P0 | 2h | 5 | `src/events/event_models.h` defines `StreamStarted`, `StreamEnded`, `PeerConnected`, `RecordingStarted` etc. | `scripts/validate_traceability.sh` | +| 28.3 | Command handlers | 🟒 | P0 | 3h | 6 | `src/events/command_handlers.c` validates and executes commands; emits corresponding events | `scripts/validate_traceability.sh` | +| 28.4 | Read model projections | 🟒 | P1 | 3h | 7 | `src/events/projections.c` builds in-memory read models from event stream; updated on new events | `scripts/validate_traceability.sh` | +| 28.5 | Event sourcing tests | 🟒 | P0 | 2h | 6 | `tests/events/` suite: append, replay, projection consistency; all pass | `scripts/validate_traceability.sh` | +| 28.6 | CQRS API integration | 🟒 | P1 | 2h | 6 | `/api/events` endpoint streams NDJSON event log; supports `?from=` | `scripts/validate_traceability.sh` | + +--- + +## PHASE-29: Android / iOS Full Client + +> Full-featured mobile streaming client: hardware decode, touch input, clipboard sync, file transfer. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 29.1 | Android full codec support (H.264/VP9/AV1) | 🟒 | P0 | 5h | 7 | `VideoDecoder.kt` handles all three codecs via `MediaCodec`; auto-selects based on server offer | `scripts/validate_traceability.sh` | +| 29.2 | Android clipboard sync | 🟒 | P1 | 3h | 6 | `ClipboardManager.kt` syncs host↔device clipboard over encrypted side-channel | `scripts/validate_traceability.sh` | +| 29.3 | Android file transfer | 🟑 | P2 | 5h | 6 | `FileTransferManager.kt` sends/receives files via dedicated DATA_TRANSFER packet type | `scripts/validate_traceability.sh` | +| 29.4 | iOS full codec support | πŸ”΄ | P0 | 5h | 7 | `VideoDecoder.swift` uses `VideoToolbox` for H.264/HEVC; VP9 via libvpx fallback | `scripts/validate_traceability.sh` | +| 29.5 | iOS clipboard sync | πŸ”΄ | P1 | 3h | 6 | `ClipboardManager.swift` using `UIPasteboard`; respects iOS privacy prompts | `scripts/validate_traceability.sh` | +| 29.6 | iOS file transfer | πŸ”΄ | P2 | 5h | 6 | `FileTransferManager.swift` uses Files app integration via `UIDocumentPickerViewController` | `scripts/validate_traceability.sh` | +| 29.7 | Mobile HUD overlay | πŸ”΄ | P2 | 3h | 5 | Swipe-up reveals latency/bitrate overlay; dismissed by swipe-down | `scripts/validate_traceability.sh` | +| 29.8 | Push notification for stream invites | πŸ”΄ | P2 | 4h | 6 | APNs/FCM integration; host can "invite" mobile device to connect | `scripts/validate_traceability.sh` | + +--- + +## PHASE-30: Security Phase 2 + +> Advanced security: fuzzing harness, penetration test results, rate limiting, security regression suite. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 30.1 | Packet parser fuzzing (libFuzzer) | 🟒 | P0 | 4h | 8 | `tests/fuzz/fuzz_packet_parse.cc` LibFuzzer target; > 1M executions without crash/sanitizer alert | `scripts/validate_traceability.sh` | +| 30.2 | Crypto handshake fuzzing | 🟒 | P0 | 4h | 8 | `tests/fuzz/fuzz_handshake.cc` fuzzes key exchange messages; no memory safety violations | `scripts/validate_traceability.sh` | +| 30.3 | Rate limiting (per-IP + global) | 🟒 | P0 | 3h | 6 | `src/security/rate_limiter.c` token-bucket per IP; global connection rate cap; returns `429` on API | `scripts/validate_traceability.sh` | +| 30.4 | SQL injection prevention | 🟒 | P0 | 2h | 6 | All DB calls use prepared statements; `db_*` functions reviewed for injection vectors | `scripts/validate_traceability.sh` | +| 30.5 | TLS for API server (mbedTLS) | 🟒 | P0 | 4h | 7 | `--api-tls` flag enables mbedTLS on HTTP server; self-signed cert generated on first run | `scripts/validate_traceability.sh` | +| 30.6 | Security audit documentation | 🟒 | P1 | 2h | 5 | `docs/SECURITY.md` includes attack surface map, known limitations, responsible disclosure policy | `scripts/validate_traceability.sh` | + +--- + +## PHASE-31: Vulkan Renderer + +> GPU-accelerated Vulkan renderer for the KDE client: frame upload, YUVβ†’RGB shader, graphics pipeline, presentation, resize, cleanup. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 31.1 | Frame upload infrastructure (702 LOC) | 🟒 | P0 | 8h | 9 | `clients/kde-plasma-client/src/vulkan/VulkanFrameUploader.cpp` (702 LOC): staging buffer pool, transfer queue, timeline semaphores, VMA integration | `scripts/validate_traceability.sh` | +| 31.2 | YUVβ†’RGB shader system (275 LOC) | 🟒 | P0 | 5h | 9 | `clients/kde-plasma-client/src/vulkan/shaders/yuv_to_rgb.frag` (275 LOC): BT.709/BT.601/BT.2020 matrices, HDR tone mapping | `scripts/validate_traceability.sh` | +| 31.3 | Vulkan graphics pipeline | 🟒 | P0 | 6h | 8 | `VulkanPipeline.cpp` creates render pass, framebuffers, descriptor sets, specialisation constants for colour space | `scripts/validate_traceability.sh` | +| 31.4 | Swapchain presentation | 🟒 | P0 | 4h | 8 | `VulkanPresenter.cpp` manages swapchain, acquire/present semaphores, mailbox/FIFO mode selection | `scripts/validate_traceability.sh` | +| 31.5 | Dynamic resize handling | 🟒 | P0 | 3h | 7 | `VulkanRenderer::onResize()` recreates swapchain and framebuffers without frame drops | `scripts/validate_traceability.sh` | +| 31.6 | Resource cleanup & validation layers | 🟒 | P0 | 2h | 6 | `VulkanRenderer::cleanup()` destroys all Vulkan objects in reverse order; `VK_LAYER_KHRONOS_validation` reports zero errors | `scripts/validate_traceability.sh` | + +--- + +## PHASE-32: Backend Integration + +> Wire the Vulkan renderer to the actual streaming backend: frame delivery pipeline, X11/Wayland platform backends, benchmarks. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 32.1 | Backend connection layer | πŸ”΄ | P0 | 6h | 8 | `StreamBackendConnector.cpp` receives decoded frames from `client_decode.c` and hands off to `VulkanFrameUploader` | `scripts/validate_traceability.sh` | +| 32.2 | Frame delivery pipeline | πŸ”΄ | P0 | 5h | 8 | Lock-free ring buffer between decode thread and Vulkan render thread; < 0.1% frame drops at 60 fps | `scripts/validate_traceability.sh` | +| 32.3 | X11 Vulkan surface (VK_KHR_xlib_surface) | πŸ”΄ | P0 | 3h | 6 | `X11VulkanSurface.cpp` creates `VkSurfaceKHR` via `vkCreateXlibSurfaceKHR`; verified on Xorg | `scripts/validate_traceability.sh` | +| 32.4 | Wayland Vulkan surface (VK_KHR_wayland_surface) | πŸ”΄ | P0 | 3h | 7 | `WaylandVulkanSurface.cpp` creates `VkSurfaceKHR` via `vkCreateWaylandSurfaceKHR`; verified on KDE Plasma 6 Wayland | `scripts/validate_traceability.sh` | +| 32.5 | Integration test suite | πŸ”΄ | P0 | 4h | 7 | `tests/vulkan/` suite renders synthetic YUV frames through full pipeline; validates pixel output | `scripts/validate_traceability.sh` | +| 32.6 | Performance benchmarks | πŸ”΄ | P1 | 3h | 7 | `benchmarks/vulkan_renderer_bench.cpp` measures upload + render latency; target < 2 ms at 1080p/60 | `scripts/validate_traceability.sh` | + +--- + +## PHASE-33: Code Standards & Quality + +> Enforce C++ code standards, comprehensive test coverage, sanitizer clean passes, and static analysis. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 33.1 | clang-format + clang-tidy enforcement | πŸ”΄ | P0 | 4h | 5 | `.clang-format` and `.clang-tidy` configs at repo root; CI lint step fails on violations; zero existing violations | `scripts/validate_traceability.sh` | +| 33.2 | Unit test coverage β‰₯ 80% | πŸ”΄ | P0 | 8h | 6 | `gcov`/`lcov` report in CI; all `src/` and `clients/kde-plasma-client/src/` modules β‰₯ 80% line coverage | `scripts/validate_traceability.sh` | +| 33.3 | Sanitizer clean passes (ASan/UBSan/TSan) | πŸ”΄ | P0 | 6h | 7 | Debug build with `-fsanitize=address,undefined,thread`; full test suite passes with zero sanitizer errors | `scripts/validate_traceability.sh` | +| 33.4 | cppcheck static analysis | πŸ”΄ | P1 | 3h | 5 | `cppcheck --error-exitcode=1` on `src/` and `clients/`; zero errors (warnings permitted) | `scripts/validate_traceability.sh` | + +--- + +## PHASE-34: Production Readiness + +> End-to-end integration testing, performance benchmarking suite, release packaging, and production documentation. + +| ID | Microtask | Status | P | Effort | 🌟 | Description (done when) | Gate | +|----|-----------|--------|---|--------|----|-------------------------|------| +| 34.1 | End-to-end integration test | πŸ”΄ | P0 | 8h | 8 | tests/e2e/test_full_stream.sh starts server + KDE client in Docker; streams 60 s; validates no dropped frames, correct decrypt/decode | `scripts/validate_traceability.sh` | +| 34.2 | Performance benchmark suite | πŸ”΄ | P0 | 6h | 7 | `benchmarks/` directory: encode latency, network throughput, render latency, end-to-end glass-to-glass latency benchmarks | `scripts/validate_traceability.sh` | +| 34.3 | Release packaging | πŸ”΄ | P0 | 4h | 6 | AUR `PKGBUILD` functional; `.deb` package via `cpack`; AppImage via `linuxdeploy`; all installable from scratch | `scripts/validate_traceability.sh` | +| 34.4 | Production documentation | πŸ”΄ | P1 | 4h | 5 | `docs/QUICKSTART.md` verified accurate; `docs/TROUBLESHOOTING.md` covers top-10 issues; `man rootstream` generated from help text | `scripts/validate_traceability.sh` | + +--- + +## πŸ”¬ Quality Gates Reference + +| Gate Script | What It Validates | +|-------------|-------------------| +| `scripts/validate_traceability.sh` | Phase IDs exist in microtasks.md; gate scripts present | +| `docs/archive/verify_phase18.sh` | H.264/VP9/AV1 encoder source files exist | +| `docs/archive/verify_phase19.sh` | MKV/MP4 container source files exist | +| `docs/archive/verify_phase20.sh` | MetricsManager and monitor source files exist | +| `docs/archive/verify_phase27_1.sh` | Docker infrastructure files present | +| `docs/archive/verify_phase27_2.sh` | Helm chart structure present | +| `docs/archive/verify_phase27_3.sh` | Terraform modules present | +| `docs/archive/verify_phase27_4.sh` | GitHub Actions workflow files present | + +--- + +## πŸ“ Architecture Overview + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ RootStream Server β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Capture β”‚ β”‚ Encode β”‚ β”‚ Network β”‚ β”‚ Recording β”‚ β”‚ +β”‚ β”‚ DRM/X11 β”‚β†’ β”‚NVENC/VAAPIβ”‚β†’β”‚ UDP/TCP β”‚ β”‚ Manager β”‚ β”‚ +β”‚ β”‚ /Dummy β”‚ β”‚/x264/Raw β”‚ β”‚ +TLS β”‚ β”‚ ReplayBuffer β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Audio β”‚ β”‚ Security β”‚ β”‚ Discoveryβ”‚ β”‚ Metrics β”‚ β”‚ +β”‚ β”‚ ALSA/PA/ β”‚ β”‚ Ed25519 β”‚ β”‚mDNS/Bcastβ”‚ β”‚ CPU/GPU/Net β”‚ β”‚ +β”‚ β”‚ PW/Dump β”‚ β”‚+ChaCha20 β”‚ β”‚ /Manual β”‚ β”‚ HUD + API β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + β”‚ Encrypted UDP/TCP +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ RootStream Clients β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ KDE Plasma β”‚ β”‚ Android β”‚ β”‚ iOS β”‚ β”‚ +β”‚ β”‚ Qt6/QML β”‚ β”‚ Kotlin/JNI β”‚ β”‚ Swift/ObjC β”‚ β”‚ +β”‚ β”‚ Vulkan Renderer β”‚ β”‚ MediaCodec β”‚ β”‚ VideoToolbox β”‚ β”‚ +β”‚ β”‚ (Phase 31-32) β”‚ β”‚ (Phase 22) β”‚ β”‚ (Phase 22) β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +--- + +*Last updated: 2026 Β· Post-Phase 31 Β· Next: Phase 32 (Backend Integration)* diff --git a/scripts/validate_traceability.sh b/scripts/validate_traceability.sh new file mode 100755 index 0000000..093a533 --- /dev/null +++ b/scripts/validate_traceability.sh @@ -0,0 +1,99 @@ +#!/usr/bin/env bash +# validate_traceability.sh β€” Gate script for docs/microtasks.md +# Exits 0 on full success, 1 on any failure. +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +MICROTASKS="$REPO_ROOT/docs/microtasks.md" +PASS=0 +FAIL=0 + +pass() { echo " βœ… $*"; PASS=$((PASS + 1)); } +fail() { echo " ❌ $*"; FAIL=$((FAIL + 1)); } + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo " RootStream Traceability Validator" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "" + +# ── 1. microtasks.md exists ─────────────────────────── +echo "[ 1 ] Checking docs/microtasks.md exists..." +if [[ -f "$MICROTASKS" ]]; then + pass "docs/microtasks.md found ($(wc -l < "$MICROTASKS") lines)" +else + fail "docs/microtasks.md NOT found at $MICROTASKS" + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo " RESULT: FAILED β€” microtasks.md missing" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + exit 1 +fi +echo "" + +# ── 2. All required PHASE-NN headers present ───────── +echo "[ 2 ] Checking phase IDs PHASE-00 through PHASE-32..." +ALL_PHASES_OK=true +for i in $(seq -w 0 32); do + PHASE_ID="PHASE-${i}" + if grep -q "$PHASE_ID" "$MICROTASKS"; then + pass "$PHASE_ID present" + else + fail "$PHASE_ID NOT found in microtasks.md" + ALL_PHASES_OK=false + fi +done +echo "" + +# ── 3. Gate scripts that are referenced actually exist ─ +echo "[ 3 ] Checking gate scripts referenced in microtasks.md..." + +# Collect unique gate script paths from the Gate column +mapfile -t GATES < <(grep -oP '`[^`]+\.sh`' "$MICROTASKS" | tr -d '`' | sort -u) + +if [[ ${#GATES[@]} -eq 0 ]]; then + fail "No gate scripts found in microtasks.md" +else + for GATE in "${GATES[@]}"; do + # Gate paths are relative to repo root + GATE_PATH="$REPO_ROOT/$GATE" + if [[ -f "$GATE_PATH" ]]; then + pass "Gate script exists: $GATE" + else + fail "Gate script MISSING: $GATE (expected at $GATE_PATH)" + fi + done +fi +echo "" + +# ── 4. docs/archive directory exists ───────────────── +echo "[ 4 ] Checking docs/archive/ directory..." +if [[ -d "$REPO_ROOT/docs/archive" ]]; then + ARCHIVE_COUNT=$(find "$REPO_ROOT/docs/archive" -type f | wc -l) + pass "docs/archive/ exists with $ARCHIVE_COUNT file(s)" +else + fail "docs/archive/ directory NOT found" +fi +echo "" + +# ── 5. Summary ──────────────────────────────────────── +TOTAL=$((PASS + FAIL)) +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo " Validation Summary" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo " Checks passed : $PASS / $TOTAL" +echo " Checks failed : $FAIL / $TOTAL" + +if [[ $FAIL -eq 0 ]]; then + echo "" + echo " βœ… All checks passed β€” traceability is intact." + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "" + exit 0 +else + echo "" + echo " ❌ $FAIL check(s) failed β€” see details above." + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "" + exit 1 +fi