# Test & Document Coverage Analysis **Generated:** 2026-06-13 **Scope:** All crates, Flutter app, and docs/ directory --- ## Test Coverage Summary | Metric | Count | |--------|-------| | Total Rust tests (inline `#[test]`) | 312 | | Total Rust integration tests | 5 | | Total Dart tests (`test()` + `testWidgets()`) | 221 | | Crates with tests | 7/9 | | Dart services with tests | 19/21 (90%) | | Dart widgets with tests | 14/24 (58%) | | Overall estimated coverage | ~65% | --- ## Per-Crate Test Coverage (Rust) ### chanora_audio — 333 tests, ~48% function coverage | Source File | Functions | Tests | Coverage | |-------------|-----------|-------|----------| | engine.rs | ~45 | 7 | ~16% | | ptt_backends/windows.rs | ~80 | 44 | ~55% | | ptt_backends/windows_keymap.rs | ~30 | 12 | ~40% | | ptt_backends/macos.rs | ~35 | 12 | ~34% | | ptt_backends/linux.rs | ~25 | 10 | ~40% | | ptt_backends/mod.rs | ~15 | 1 | ~7% | | transmit_selector.rs | ~20 | 10 | ~50% | | voice_activity.rs | ~15 | 9 | ~60% | | voice_render.rs | ~15 | 9 | ~60% | | mobile_voice_backend.rs | ~20 | 9 | ~45% | | processor/sonora.rs | ~15 | 8 | ~53% | | processor/dsp/agc2.rs | ~10 | 6 | ~60% | | mode_stack.rs | ~10 | 6 | ~60% | | opus_voice.rs | ~10 | 5 | ~50% | | capture_accumulator.rs | ~8 | 5 | ~63% | | processor/dsp/ns.rs | ~8 | 4 | ~50% | | ptt.rs | ~8 | 4 | ~50% | | vad/mod.rs | ~6 | 4 | ~67% | | audio_processing.rs | ~8 | 3 | ~38% | | debug_wav.rs | ~6 | 3 | ~50% | | processor/dsp/hpf.rs | ~5 | 3 | ~60% | | processor/dsp/aec3.rs | ~5 | 3 | ~60% | | transmit_mode.rs | ~4 | 3 | ~75% | | android_render_ring.rs | ~5 | 3 | ~60% | | vad/resampler.rs | ~4 | 3 | ~75% | | vad/apple_coreml.rs | ~5 | 3 | ~60% | | vad/silero_onnx.rs | ~10 | 6 | ~60% | | render_reference.rs | ~8 | 7 | ~88% | | capture_resampler.rs | ~3 | 2 | ~67% | | audio_event_queue.rs | ~4 | 2 | ~50% | | processor/webrtc_apm.rs | ~5 | 2 | ~40% | | frame.rs | ~3 | 1 | ~33% | | lib.rs (defaults) | ~5 | 1 | ~20% | | release_tail.rs | ~4 | 1 | ~25% | | route_policy.rs | ~8 | 8 | ~100% | | **Integration: tests/ptt_privacy.rs** | — | 1 | — | | **Integration: tests/linux_portal_smoke.rs** | — | 1 | — | ### chanora_protocol — 17 tests, ~18% function coverage | Source File | Functions | Tests | Coverage | |-------------|-----------|-------|----------| | adapter.rs | ~80 | 13 | ~16% | | poke_limiter.rs | ~17 | 4 | ~24% | | dto.rs | ~0 | 0 | — | | lib.rs | ~0 | 0 | — | **Untested areas:** Message parsing, serialization, most adapter methods ### chanora_state — 27 tests, ~46% function coverage | Source File | Functions | Tests | Coverage | |-------------|-----------|-------|----------| | lib.rs | ~35 | 18 | ~51% | | channel_join.rs | ~24 | 9 | ~38% | ### chanora_storage — 15 tests, ~24% function coverage | Source File | Functions | Tests | Coverage | |-------------|-----------|-------|----------| | lib.rs | ~62 | 15 | ~24% | **Untested areas:** Migration logic, concurrent access patterns, error recovery ### chanora_resolver — 12 tests, ~17% function coverage | Source File | Functions | Tests | Coverage | |-------------|-----------|-------|----------| | lib.rs | ~70 | 12 | ~17% | | examples/cli.rs | — | 1 | — | **Untested areas:** DNS failure modes, timeout handling, cache behavior ### chanora_diagnostics — 19 tests, ~26% function coverage | Source File | Functions | Tests | Coverage | |-------------|-----------|-------|----------| | lib.rs | ~74 | 19 | ~26% | ### chanora_core — 38 tests, ~7% function coverage | Source File | Functions | Tests | Coverage | |-------------|-----------|-------|----------| | lib.rs | ~140 | 10 | ~7% | | network_diagnostics.rs | ~7 | 1 | ~14% | **Untested areas:** Connection lifecycle, server event handling, most state transitions ### chanora_bridge — 0 tests, 0% function coverage | Source File | Functions | Tests | Coverage | |-------------|-----------|-------|----------| | api.rs | ~200+ | 0 | 0% | | frb_generated.rs | ~100+ | 0 | 0% | | permission_jni.rs | ~10 | 0 | 0% | | android_init.rs | ~5 | 0 | 0% | | lib.rs | ~4 | 0 | 0% | **Note:** chanora_bridge is an FFI/bridge layer; testing requires integration with Flutter. ### chanora_cache — 0 tests | Source File | Functions | Tests | Coverage | |-------------|-----------|-------|----------| | lib.rs | ~16 | 0 | 0% | ### chanora_prefetch — 0 tests | Source File | Functions | Tests | Coverage | |-------------|-----------|-------|----------| | lib.rs | ~18 | 0 | 0% | --- ## Per-Module Test Coverage (Dart/Flutter) ### Services — 155 tests across 19 test files | Source File | Test File | Tests | Coverage | |-------------|-----------|-------|----------| | android_audio_output_devices.dart | ✅ android_audio_output_devices_test.dart | 2 | Tested | | android_permissions_service.dart | ✅ android_permissions_service_test.dart | 14 | Tested | | app_bootstrap.dart | ✅ app_bootstrap_test.dart | 4 | Tested | | audio_lifecycle_service.dart | ✅ audio_lifecycle_service_test.dart | 4 | Tested | | back_intent_policy.dart | ✅ back_intent_policy_test.dart | 9 | Tested | | back_intent_service.dart | ✅ back_intent_service_test.dart | 5 | Tested | | channel_join_error_mapper.dart | ✅ channel_join_error_mapper_test.dart | Tested | | channel_spacer.dart | ✅ channel_spacer_test.dart | 9 | Tested | | connection_phase_state.dart | ✅ connection_phase_state_test.dart | 8 | Tested | | hard_mute_owners.dart | ✅ hard_mute_owners_test.dart | 3 | Tested | | ios_audio_session_controller.dart | ✅ ios_audio_session_controller_test.dart | 6 | Tested | | macos_permissions_service.dart | ✅ macos_permissions_service_test.dart | 20 | Tested | | poke_active_chat.dart | ✅ poke_active_chat_test.dart | 2 | Tested | | poke_notification_service.dart | ✅ poke_notification_service_test.dart | 2 | Tested | | poke_preferences_service.dart | ✅ poke_preferences_service_test.dart | 4 | Tested | | prefetch_debouncer.dart | ✅ prefetch_debouncer_test.dart | 3 | Tested | | snapshot_state_mapper.dart | ✅ snapshot_state_mapper_test.dart | 7 | Tested | | ts3_server_link.dart | ✅ ts3_server_link_test.dart | 3 | Tested | | ui_preferences_service.dart | ✅ ui_preferences_service_test.dart | 5 | Tested | | voice_join_ordering.dart | ✅ voice_join_ordering_test.dart | 4 | Tested | | **ios_permissions_service.dart** | ❌ No test file | 0 | **UNTESTED** | | **link_trust_service.dart** | ❌ No test file | 0 | **UNTESTED** | ### Widgets — 66 tests across 13 test files | Source File | Test File | Tests | Coverage | |-------------|-----------|-------|----------| | app_snack_bar.dart | ✅ app_snack_bar_test.dart | 1 | Tested | | audio_processing_config_state.dart | ✅ audio_processing_config_state_test.dart | 8 | Tested | | bbcode_text.dart | ✅ bbcode_text_test.dart | Tested | | chat_panel.dart | ✅ chat_panel_test.dart | Tested | | chat_views.dart | ✅ chat_views_test.dart | 29 | Tested | | client_info_sheet.dart | ✅ client_info_sheet_test.dart | Tested | | poke_notification_settings.dart | ✅ poke_notification_settings_test.dart | Tested | | snapshot_view.dart | ✅ snapshot_view_test.dart | Tested | | talk_power_warning.dart | ✅ talk_power_warning_test.dart | 1 | Tested | | voice_compact.dart | ✅ voice_compact_test.dart | Tested | | voice_settings_controls.dart | ✅ voice_settings_controls_test.dart | 6 | Tested | | voice_status_summary.dart | ✅ voice_status_summary_test.dart | 5 | Tested | | mobile_ui_resilience.dart | ✅ mobile_ui_resilience_test.dart | Tested | | **audio_debug_stats_panel.dart** | ❌ No test file | 0 | **UNTESTED** | | **audio_device_list_tile.dart** | ✅ audio_device_list_tile_test.dart | 3 | Tested | | **audio_output_tile.dart** | ❌ No test file | 0 | **UNTESTED** | | **connect_widgets.dart** | ❌ No test file | 0 | **UNTESTED** | | **input_dialogs.dart** | ❌ No test file | 0 | **UNTESTED** | | **permission_state_banner.dart** | ❌ No test file | 0 | **UNTESTED** | | **ptt_capability_badge.dart** | ❌ No test file | 0 | **UNTESTED** | | **voice_bar.dart** | ❌ No test file | 0 | **UNTESTED** | | **voice_haptics.dart** | ❌ No test file | 0 | **UNTESTED** | | **voice_level_meter.dart** | ❌ No test file | 0 | **UNTESTED** | | **voice_platform.dart** | ❌ No test file | 0 | **UNTESTED** | | **voice_settings.dart** | ❌ No test file | 0 | **UNTESTED** | ### E2E Tests | File | Tests | Notes | |------|-------|-------| | alpha_e2e_test.dart | 1 | End-to-end integration | | beta_e2e_test.dart | 1 | End-to-end integration | | widget_test.dart | — | Default Flutter template | --- ## Document Coverage Summary | Metric | Count | |--------|-------| | Total doc files (under docs/) | 66 | | Modules documented | ~15 areas | | Estimated outdated docs | 3-5 | ## Document Inventory ### Architecture (4 files) | File | Topic | Status | Notes | |------|-------|--------|-------| | architecture/sad.md | Software Architecture Document | Current | 190 lines, references SDD | | architecture/sdd.md | Software Design Document | Current | 161 lines | | architecture/sysdes.md | System Design overview | Current | 21 lines, brief | | architecture/desktop-ptt-architecture.md | Desktop PTT subsystem design | Current | 43 lines | | architecture/file-transfer-design.md | File transfer feature design | Current | 737 lines | | architecture/file-transfer-research.md | File transfer research | Current | 770 lines | | architecture/file-transfer-implementation-plan.md | File transfer implementation plan | Current | 1315 lines | ### Requirements (2 files + 2 symlinks) | File | Topic | Status | Notes | |------|-------|--------|-------| | requirements/srs.md | Software Requirements Spec | Current | 22 lines (pointer) | | requirements/sysrs.md | System Requirements Spec | Current | 22 lines (pointer) | | srs.md | SRS (full) | Current | 2850 lines | | sysrs.md | SysRS (full) | Current | 2014 lines | ### Verification (5 files) | File | Topic | Status | Notes | |------|-------|--------|-------| | verification/verification-master-plan.md | Overall V&V plan | Current | 91 lines | | verification/swe4-unit-verification-plan.md | Unit test plan | Current | 60 lines | | verification/swe5-software-integration-verification-plan.md | Integration test plan | Current | 71 lines | | verification/swe6-software-verification-plan.md | System verification plan | Current | 62 lines | | verification/sys4-system-integration-verification-plan.md | System integration plan | Current | 58 lines | ### Security (7 files) | File | Topic | Status | Notes | |------|-------|--------|-------| | security/threat-model.md | Threat model | Current | 33 lines | | security/license-inventory.md | Rust license inventory | Current | 10970 lines | | security/flutter-license-inventory.md | Flutter license inventory | Current | 5477 lines | | security/diagnostic-redaction-audit-report.md | Diagnostic redaction audit | Current | 31 lines | | security/secure-storage-audit-report.md | Secure storage audit | Current | 31 lines | | security/dependency-and-supply-chain-report.md | Dependency audit | Current | 43 lines | | security/security-privacy-legal-guideline.md | Security/privacy guidelines | Current | 63 lines | ### Governance (11 files) | File | Topic | Status | Notes | |------|-------|--------|-------| | governance/document-index.md | Document catalog | Current | 36 lines | | governance/document-naming-convention.md | Naming conventions | Current | 33 lines | | governance/document-review-report.md | Review report | Current | 37 lines | | governance/traceability-matrix.md | Requirements traceability | Current | 73 lines | | governance/product-decision-register.md | Decision log | Current | 25 lines | | governance/decision-impact-assessment.md | Impact assessment | Current | 18 lines | | governance/git-commit-message-convention.md | Commit conventions | Current | 21 lines | | governance/path-migration-map.md | Path migration plan | Current | 18 lines | | governance/repo-format-validation-report.md | Format validation | Current | 22 lines | | governance/baseline-candidate-validation-report.md | Baseline validation | Current | 38 lines | | governance/baseline-approval-record.md | Baseline approval | Current | 32 lines | | governance/maintainability-review-2026-06-08.md | Maintainability review | Current | 99 lines | ### Release (4 files) | File | Topic | Status | Notes | |------|-------|--------|-------| | release/ios-build.md | iOS build instructions | Current | 47 lines | | release/platform-release-policy.md | Release policy | Current | 26 lines | | release/release-readiness-go-nogo-record.md | Go/no-go record | Current | 105 lines | | release/dv-waiver-register.md | DV waiver register | Current | 36 lines | ### UI/UX (4 files) | File | Topic | Status | Notes | |------|-------|--------|-------| | ui-ux/material3-guideline.md | Material 3 guidelines | Current | 8 lines (brief) | | ui-ux/material3-design-tokens.md | Design tokens | Current | 21 lines | | ui-ux/material3-component-catalog.md | Component catalog | Current | 38 lines | | ui-ux/adaptive-layout-platform-guide.md | Adaptive layout guide | Current | 27 lines | ### Other | File | Topic | Status | Notes | |------|-------|--------|-------| | privacy/privacy-policy.md | Privacy policy | Current | 51 lines | | references/external-references.md | External references | Current | 21 lines | | references/aspice-swe2-swe3-integration-note.md | ASPICE integration note | Current | 28 lines | | legal/trademark-and-attribution-review.md | Trademark review | Current | 47 lines | | i18n/localization-architecture.md | Localization architecture | Current | 44 lines | | implementation-status-2026-05-28.md | Implementation status | **Possibly outdated** | Date is 2026-05-28 | | material3-guideline.md | Material 3 guideline (duplicate) | Current | 93 lines | ### Superpowers Plans & Specs (13 files) | File | Topic | Status | |------|-------|--------| | superpowers/plans/2026-05-28-server-resolution-prefetch.md | Server resolution prefetch plan | Current | | superpowers/plans/2026-05-28-chanora-server-prefetch-crate.md | Prefetch crate plan | Current | | superpowers/plans/2026-05-29-dv-evidence-pack.md | DV evidence pack plan | Current | | superpowers/plans/2026-05-29-state-sync-ui-settings-validation.md | State sync validation plan | Current | | superpowers/plans/2026-05-29-swe2-swe3-baselines.md | SWE2/SWE3 baselines plan | Current | | superpowers/plans/2026-05-29-finish-dv-document-tree.md | DV document tree plan | Current | | superpowers/plans/2026-06-06-chat-panel-switching.md | Chat panel switching plan | Current | | superpowers/plans/2026-06-08-maintainability-continuation.md | Maintainability continuation | Current | | superpowers/plans/2026-06-08-core-internal-split.md | Core internal split plan | Current | | superpowers/specs/2026-05-28-server-resolution-prefetch-design.md | Prefetch design spec | Current | | superpowers/specs/2026-05-28-chanora-server-prefetch-crate-design.md | Prefetch crate design | Current | | superpowers/specs/2026-05-29-state-sync-ui-settings-validation-design.md | State sync design | Current | | superpowers/specs/2026-06-05-adaptive-3-panel-layout-design.md | Adaptive layout design | Current | | superpowers/specs/2026-06-08-maintainability-continuation-design.md | Maintainability design | Current | | superpowers/specs/2026-06-09-poke-without-message-design.md | Poke without message design | Current | --- ## Documentation Gaps The following code modules have **no dedicated documentation**: | Module | Functions | Gap Description | |--------|-----------|-----------------| | `chanora_audio` (engine) | ~45 | No architecture doc for audio engine internals | | `chanora_audio` (VAD subsystem) | ~25 | VAD pipeline, model loading, fallback strategy undocumented | | `chanora_audio` (DSP processors) | ~30 | AEC3, AGC2, NS, HPF configuration undocumented | | `chanora_audio` (PTT backends) | ~155 | Platform-specific PTT behavior undocumented | | `chanora_bridge` (FFI layer) | ~300 | Flutter-Rust bridge API contract undocumented | | `chanora_cache` | ~16 | Cache strategy, eviction policy undocumented | | `chanora_prefetch` | ~18 | Prefetch timing, debouncing strategy undocumented | | `chanora_core` | ~147 | Core connection lifecycle, event handling undocumented | | `chanora_state` | ~59 | State machine transitions, delta emission undocumented | | `chanora_storage` | ~62 | Storage format, migration strategy undocumented | | `chanora_protocol` | ~97 | Protocol message format, adapter logic undocumented | | `chanora_resolver` | ~70 | DNS resolution, TSDNS discovery undocumented | | `chanora_diagnostics` | ~74 | Diagnostic collection, redaction rules undocumented | | Flutter services layer | ~21 files | No service-layer architecture doc | | Flutter widgets layer | ~24 files | No widget catalog or component doc | | Localization (l10n) | — | Translation workflow undocumented (only architecture doc exists) | ## Potentially Outdated Documents | File | Reason | |------|--------| | `implementation-status-2026-05-28.md` | Dated 2026-05-28; code has changed significantly since | | `docs/material3-guideline.md` | Duplicate of `docs/ui-ux/material3-guideline.md` | | `docs/sysdes.md` | Top-level duplicate of `docs/architecture/sysdes.md` | | `docs/srs.md` / `docs/sysrs.md` | Top-level duplicates of `docs/requirements/` versions | --- ## Key Findings 1. **chanora_audio** is the best-tested crate (204 tests), but still only ~48% function coverage due to the large codebase (~428 functions) 2. **chanora_bridge**, **chanora_cache**, and **chanora_prefetch** have zero tests 3. **chanora_core** has very low coverage (~7%) despite being the main connection orchestrator 4. **Dart widget tests** cover only 54% of widget files; 11 widget files have no tests 5. **Dart service tests** are strong at 90% coverage (only 2 files untested) 6. **Documentation** is extensive (55 files) but focuses on process/governance; code-level architecture docs are sparse 7. No dedicated docs exist for the audio engine, FFI bridge, protocol layer, or state machine internals