StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.
Kotlin iptv-player
docs: specify settings feature extraction
David Nashash0bdb1b77167e
diff --git a/docs/COMPOSE_REDUCTION_PHASE5_SETTINGS_REPORT.md b/docs/COMPOSE_REDUCTION_PHASE5_SETTINGS_REPORT.mdnew file mode 100644index 00000000..5694acd5--- /dev/null+++ b/docs/COMPOSE_REDUCTION_PHASE5_SETTINGS_REPORT.md@@ -0,0 +1,97 @@+# Compose Reduction Phase 5 — Settings Feature Report++Date: 2026-08-27++## Current status++The settings slice is **in progress**. A compilable, independently checked+`:feature:settings` module now owns the first behavior-preserving presentation+layers: shared settings contracts, backup-preview rendering, parental controls,+settings state models, preference mapping, backup/restore and EPG actions, and+the related feature tests. `:app` remains the composition root and continues to+own the platform adapters and the portions of the Settings screen that have+not yet moved.++This is not Phase 5 completion. Settings ViewModel orchestration, the remaining+screen/dialog/resource extraction, app adapter cleanup, full graph registration,+and runtime/manual acceptance are still open. The existing playback and+provider runtime gates remain open under their respective reports.++## Ownership and boundary evidence++- `:feature:settings` is registered and consumed by `:app` through the feature+ dependency; the app still owns root navigation and platform composition.+- The feature boundary allows only `:core:navigation`, `:core:ui`, `:domain`,+ temporary ledgered `:data`, and the audited `:player` dependency.+- The feature source has no `com.streamvault.app`, `NavController`,+ `NavHostController`, `MainActivity`, `:feature:provider`, or+ `:feature:playback` references.+- Feature-defined ports cover backup/restore, diagnostics, sync, pairing,+ update checks/downloads, and external settings actions. App adapters remain+ responsible for Android intents, workers, installers, and other platform+ operations.+- `ProviderBackupPreviewRequest` and `ProviderBackupPreviewContent` remain+ source-compatible; the provider flow can request the settings-owned preview+ without a provider implementation dependency.+- The nine direct settings `:data` implementation imports are recorded in+ `docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md`; the separate+ `AudioCompatibilityMemoryStore` audit is recorded there as a non-`:data`+ dependency.++## Delivered commits++- `e12f816f` — inventory and baseline evidence+- `1c0e6ae6` — settings feature module boundary+- `422c2810` — shared settings presentation contracts+- `e9a44e24` — settings platform service ports+- `58da5a74` — settings-owned backup preview rendering+- `0441d1e6` — parental controls extraction+- `20a3f3f5` — settings state and actions extraction+- `3090ad75` — feature lint fixes (network permission and Compose resource lookup)++The design/spec and detailed implementation plan are intentionally kept as+working-tree documentation for the ongoing slice:++- `docs/superpowers/specs/2026-08-27-phase-5-settings-feature-extraction-design.md`+- `docs/superpowers/plans/2026-08-27-settings-feature-extraction.md`++## Automated verification++The following command completed successfully with exit code 0 after the lint+fix:++```text+gradlew.bat :feature:settings:check --console=plain --warning-mode=none+BUILD SUCCESSFUL in 31s+```++The focused cross-module command also completed successfully with exit code 0:++```text+gradlew.bat :feature:settings:verifyFeatureSettingsBoundary \+ :feature:settings:testDebugUnitTest \+ :app:compileDebugKotlin \+ :app:compileDebugUnitTestKotlin \+ --console=plain --warning-mode=none+BUILD SUCCESSFUL in 5s+```++These checks cover the fail-closed source boundary, feature debug unit tests,+app Kotlin compilation, and app unit-test compilation. No runtime or connected+device claim is implied by these commands.++## Open work and gates++- Move the remaining Settings presentation and ViewModel orchestration while+ keeping routes, focus restoration, semantics, callbacks, persistence,+ launcher ordering, and error text unchanged.+- Finish feature resource/locale ownership and the settings graph registration;+ remove transitional app wildcard imports once all consumers move.+- Complete the DAO/concrete dependency audit and remove each ledger entry only+ after a domain-facing replacement exists.+- Add/refresh focused settings connected checks and perform manual TV journeys+ for parental controls, backup/restore, update, diagnostics, sync, and focus+ restoration when the required emulator/accounts/files are available.+- Do not treat the still-open playback/provider acceptance and performance+ gates as closed by this settings report.+diff --git a/docs/superpowers/plans/2026-08-27-settings-feature-extraction.md b/docs/superpowers/plans/2026-08-27-settings-feature-extraction.mdnew file mode 100644index 00000000..41be932c--- /dev/null+++ b/docs/superpowers/plans/2026-08-27-settings-feature-extraction.md@@ -0,0 +1,807 @@+# Settings Feature Module Extraction Implementation Plan++> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.++**Goal:** Move Settings, parental controls, backup/restore presentation, state, dialogs, resources, tests, and graph registration from `:app` into independently compiled `:feature:settings` without changing behavior.++**Architecture:** `:app` remains the root navigation and Android platform composition root. `:feature:settings` owns presentation and controller-free graph registration, consumes neutral core/domain contracts, and reaches app-only operations through feature-defined ports implemented by app adapters. Temporary `:data` imports are fail-closed and ledgered; the existing provider backup-preview request remains unchanged and is adapted by `AppNavHost`.++**Tech Stack:** Kotlin, Android library modules, Jetpack Compose/TV Material, Navigation Compose, Hilt/KSP, coroutines/StateFlow, JUnit4, Truth, Mockito-Kotlin, Robolectric, Compose UI tests, Kover, Gradle boundary tasks, Graphify.++**Spec:** `docs/superpowers/specs/2026-08-27-phase-5-settings-feature-extraction-design.md`++## Global Constraints++- Preserve the intentional working tree; never reset, clean, delete, or rewrite unrelated changes.+- This is a behavior-preserving Phase 5 extraction: preserve routes, arguments, focus, semantics, callbacks, persistence, launcher order, UI output, and error text.+- `:app` remains the root `NavHostController`, external-intent, route-codec, payload, manifest, worker, and platform composition root.+- `:feature:settings` may depend only on `:core:navigation`, `:core:ui`, `:domain`, temporary ledgered `:data`, and the audited `:player` dependency.+- `:feature:settings` must never depend on `:app`, `:feature:provider`, `:feature:playback`, `NavController`, `NavHostController`, or `MainActivity`.+- Keep `ProviderBackupPreviewContent` and `ProviderBackupPreviewRequest` source- and behavior-compatible; `:app` maps them to the settings-owned dialog.+- Do not begin Live, Catalog, or System extraction.+- Move files with `git mv` where practical; keep contract changes, mechanical moves, graph wiring, and cleanup in separate commits.+- Every direct settings `:data` implementation import must appear in `docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md`.+- Record unavailable runtime, credential, hardware, provider, account, performance, and physical-device gates as open rather than passing.+- After code changes, run `graphify update .` before reporting completion.++---++### Task 0: Freeze inventory, rollback point, and baseline obligations++**Files:**+- Create: `validation/phase5_settings/task0-inventory.md`+- Create: `validation/phase5_settings/source-inventory.txt`+- Create: `validation/phase5_settings/test-inventory.txt`+- Create: `validation/phase5_settings/resource-inventory.txt`+- Create: `validation/phase5_settings/dependency-inventory.txt`+- Create: `validation/phase5_settings/performance-protocol.md`+- Modify: `docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md`++**Interfaces:**+- Consumes: the approved spec, current branch status, current settings source/tests, Phase 5 roadmap, playback/provider reports.+- Produces: exact move inventory, pre-extraction SHA, dirty-tree record, nine-type `:data` allowlist, `AudioCompatibilityMemoryStore` audit entry, and reproducible measurement protocol.++- [ ] **Step 1: Capture the tree and exact source/test inventory**++Run:++```powershell+git status --short --branch+git rev-parse HEAD+rg --files app/src/main/java/com/streamvault/app/ui/screens/settings -g '*.kt' | Sort-Object+rg --files app/src/test/java/com/streamvault/app/ui/screens/settings -g '*.kt' | Sort-Object+```++Expected: 71 production Kotlin paths and 12 unit-test paths. Use `apply_patch` to record the exact command output in the inventory files and to record the SHA and every existing working-tree path in `task0-inventory.md`; do not modify or stage unrelated paths.++- [ ] **Step 2: Capture app/data/player/resource imports**++Run:++```powershell+rg '^import com\.streamvault\.(app|data|player)\.' app/src/main/java/com/streamvault/app/ui/screens/settings -g '*.kt' | Sort-Object+rg -o 'R\.(string|plurals|drawable)\.[A-Za-z0-9_]+' app/src/main/java/com/streamvault/app/ui/screens/settings -g '*.kt' | ForEach-Object { ($_ -split ':')[-1] } | Sort-Object -Unique+```++Expected: nine distinct `com.streamvault.data` types, one `com.streamvault.player.AudioCompatibilityMemoryStore`, and 665 unique resource references (660 strings, five plurals). Use `apply_patch` to save the outputs. If counts differ, record the fresh counts and use the saved inventories as source of truth.++- [ ] **Step 3: Add the settings ledger section**++Append explicit rows for `ProgramDao`, `XtreamIndexJobDao`, `XtreamLiveOnboardingDao`, `XtreamIndexJobEntity`, `XtreamLiveOnboardingStateEntity`, `DatabaseMaintenanceSnapshot`, `PreferencesRepository`, `ProviderSyncCommands`, and `SyncRepairSection`, with the removal directions from the spec. Add a separate audit note for `AudioCompatibilityMemoryStore`; do not describe it as a `:data` import.++- [ ] **Step 4: Write the paired measurement protocol**++Record five pre/post runs for a reversible settings source edit and five pre/post runs for a reversible settings test edit. Use the same Gradle daemon/cache state and commands on both refs:++```powershell+.\gradlew.bat :app:compileDebugKotlin --profile --console=plain --warning-mode=none+.\gradlew.bat :app:compileDebugUnitTestKotlin --profile --console=plain --warning-mode=none+.\gradlew.bat :app:assembleDebug --profile --console=plain --warning-mode=none+```++The post-extraction equivalents are `:feature:settings:compileDebugKotlin` and `:feature:settings:compileDebugUnitTestKotlin`. State that mixed dirty-tree timings are diagnostic only.++- [ ] **Step 5: Verify and commit only inventory artifacts**++Run:++```powershell+git diff --check+git diff -- docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md validation/phase5_settings+git add docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md validation/phase5_settings+git commit -m "docs: inventory settings feature extraction"+```++Expected: the commit contains documentation/evidence only.++### Task 1: Create `:feature:settings` and prove a fail-closed boundary++**Files:**+- Create: `feature/settings/build.gradle.kts`+- Create: `feature/settings/src/main/AndroidManifest.xml`+- Create: `feature/settings/src/test/java/com/streamvault/feature/settings/SettingsModuleBoundaryTest.kt`+- Create: `feature/settings/src/test/resources/boundary-fixtures/AppPackageImport.kt`+- Create: `feature/settings/src/test/resources/boundary-fixtures/FullyQualifiedAppReference.kt`+- Create: `feature/settings/src/test/resources/boundary-fixtures/MainActivityReference.java`+- Create: `feature/settings/src/test/resources/boundary-fixtures/RootNavigation.kt`+- Create: `feature/settings/src/test/resources/boundary-fixtures/RootNavigation.java`+- Create: `feature/settings/src/test/resources/boundary-fixtures/ProviderFeatureImport.kt`+- Create: `feature/settings/src/test/resources/boundary-fixtures/PlaybackFeatureImport.java`+- Modify: `settings.gradle.kts`+- Modify: `app/build.gradle.kts`++**Interfaces:**+- Consumes: exact allowed project dependency set from the spec.+- Produces: registered `:feature:settings`, `verifyFeatureSettingsBoundary`, and fixture-tested rejection of app/root-controller/feature-implementation imports.++- [ ] **Step 1: Write the failing app dependency assertion**++Add to the existing app Gradle/module structure test or create a focused assertion in `SettingsModuleBoundaryTest.kt` that resolves the module directory and requires the settings build script to exist:++```kotlin+@Test+fun settingsModuleDeclaresExpectedBoundary() {+ val buildFile = File("build.gradle.kts")+ assertThat(buildFile.isFile).isTrue()+ val text = buildFile.readText()+ assertThat(text).contains("verifyFeatureSettingsBoundary")+ assertThat(text).contains(":core:navigation")+ assertThat(text).doesNotContain("project(\":app\")")+}+```++- [ ] **Step 2: Run the test to verify red**++Run:++```powershell+.\gradlew.bat :feature:settings:testDebugUnitTest --tests "com.streamvault.feature.settings.SettingsModuleBoundaryTest" --console=plain+```++Expected: Gradle fails because project `:feature:settings` is not registered.++- [ ] **Step 3: Add module registration and library configuration**++Add `include(":feature:settings")` to `settings.gradle.kts`, add `implementation(project(":feature:settings"))` to `:app`, and model `feature/settings/build.gradle.kts` on `feature/provider/build.gradle.kts` with namespace `com.streamvault.feature.settings`. The exact allowed project dependency set is:++```kotlin+val allowedProjectDependencies = setOf(+ ":core:navigation",+ ":core:ui",+ ":domain",+ ":data",+ ":player",+)+```++Configure Compose, Hilt/KSP, Kover, Java/Kotlin 17, minSdk 25, compileSdk 36, unit-test dependencies, connected-test dependencies, `documentfile`, OkHttp, and the same Compose BOM used by provider.++- [ ] **Step 4: Add the boundary scan and fixtures**++Use the provider boundary implementation with these forbidden tokens:++```kotlin+val forbiddenFeatureSettingsSourceTokens = listOf(+ "import com.streamvault.app",+ "com.streamvault.app",+ "import com.streamvault.feature.provider",+ "import com.streamvault.feature.playback",+ "MainActivity",+ "NavHostController",+ "NavController",+)+```++Require every Kotlin and Java fixture above to be detected. Make `check` and all test tasks depend on `verifyFeatureSettingsBoundary`.++- [ ] **Step 5: Verify green**++Run:++```powershell+.\gradlew.bat :feature:settings:verifyFeatureSettingsBoundary :feature:settings:testDebugUnitTest :feature:settings:assembleDebug --console=plain --warning-mode=none+```++Expected: boundary fixtures are detected, main source has zero violations, and the empty module assembles.++- [ ] **Step 6: Commit the module shell**++```powershell+git add settings.gradle.kts app/build.gradle.kts feature/settings+git commit -m "build: add settings feature module boundary"+```++### Task 2: Neutralize shared UI and persisted presentation contracts++**Files:**+- Move: `app/src/main/java/com/streamvault/app/ui/components/SearchInput.kt` -> `core/ui/src/main/java/com/streamvault/core/ui/components/SearchInput.kt`+- Move: `app/src/main/java/com/streamvault/app/ui/components/TvEmptyState.kt` -> `core/ui/src/main/java/com/streamvault/core/ui/components/TvEmptyState.kt`+- Move: `app/src/main/java/com/streamvault/app/ui/components/dialogs/PinDialog.kt` -> `core/ui/src/main/java/com/streamvault/core/ui/components/dialogs/PinDialog.kt`+- Move: `app/src/main/java/com/streamvault/app/localization/AppLocaleSupport.kt` -> `core/ui/src/main/java/com/streamvault/core/ui/localization/AppLocaleSupport.kt`+- Move: `app/src/main/java/com/streamvault/app/ui/model/LiveTvChannelMode.kt` -> `domain/src/main/java/com/streamvault/domain/model/LiveTvChannelMode.kt`+- Move: `app/src/main/java/com/streamvault/app/ui/model/LiveTvQuickFilterVisibilityMode.kt` -> `domain/src/main/java/com/streamvault/domain/model/LiveTvQuickFilterVisibilityMode.kt`+- Move: `app/src/main/java/com/streamvault/app/ui/model/VodViewMode.kt` -> `domain/src/main/java/com/streamvault/domain/model/VodViewMode.kt`+- Move: `app/src/main/java/com/streamvault/app/ui/model/CategoryDisplayPreferences.kt` -> `domain/src/main/java/com/streamvault/domain/policy/CategoryDisplayPreferences.kt`+- Move: `app/src/main/java/com/streamvault/app/ui/screens/dashboard/DashboardShelfCustomizationDialog.kt` -> `feature/settings/src/main/java/com/streamvault/feature/settings/presentation/DashboardShelfCustomizationDialog.kt`+- Modify: every current importer returned by `rg -l 'com.streamvault.app.ui.(components.SearchInput|components.TvEmptyState|components.dialogs.PinDialog|model.LiveTvChannelMode|model.LiveTvQuickFilterVisibilityMode|model.VodViewMode|model.applyProviderCategoryDisplayPreferences)' app feature core domain -g '*.kt'`+- Test: existing `:core:ui`, `:domain`, and app model/policy tests discovered by `rg -l 'LiveTvChannelMode|LiveTvQuickFilterVisibilityMode|VodViewMode|applyProviderCategoryDisplayPreferences|PinDialog|SearchInput|TvEmptyState' --glob '*Test.kt'`++**Interfaces:**+- Consumes: existing component signatures and enum storage values.+- Produces: app-independent imports usable by settings, live, and catalog; no new feature-to-feature dependency.++- [ ] **Step 1: Move the existing model tests first**++For every existing parsing/policy test found by the command above, move it to the owning module and update only its package/import. Add this assertion if no enum test currently covers storage compatibility:++```kotlin+@Test+fun persistedDisplayModesKeepExistingStorageValues() {+ assertThat(VodViewMode.fromStorage("classic")).isEqualTo(VodViewMode.CLASSIC)+ assertThat(LiveTvChannelMode.fromStorage("PRO")).isEqualTo(LiveTvChannelMode.PRO)+ assertThat(LiveTvQuickFilterVisibilityMode.fromStorage("always"))+ .isEqualTo(LiveTvQuickFilterVisibilityMode.ALWAYS_VISIBLE)+}+```++- [ ] **Step 2: Verify red after changing test imports**++Run the moved test through `:domain:test` or `:core:ui:testDebugUnitTest` as appropriate.++Expected: compilation fails because the new package does not exist.++- [ ] **Step 3: Move production files mechanically and update all importers**++Use `git mv`. Change package declarations and imports only. Preserve enum members, storage strings, supported language tags and `iw`/`he` plus `in`/`id` canonicalization, component parameters, semantics, focus behavior, and rendering. Use existing `CoreAppScreenScaffold`, `NavigationChrome`, `UiDestination`, `LocalUiTimeFormat`, and `UiTimeFormat.createDateTimeFormat` rather than moving app shell/time adapters into the feature.++- [ ] **Step 4: Verify shared and app consumers**++Run:++```powershell+.\gradlew.bat :domain:test :core:ui:testDebugUnitTest :app:compileDebugKotlin :feature:provider:compileDebugKotlin :feature:playback:compileDebugKotlin --console=plain --warning-mode=none+```++Expected: all tasks pass and `rg` finds no old package import.++- [ ] **Step 5: Commit shared contract moves**++```powershell+git add core/ui domain app feature/settings+git commit -m "refactor: expose settings shared presentation contracts"+```++### Task 3: Define settings ports and app adapters++**Files:**+- Create: `feature/settings/src/main/java/com/streamvault/feature/settings/api/SettingsPlatformHost.kt`+- Create: `feature/settings/src/main/java/com/streamvault/feature/settings/api/SettingsBackupFileHost.kt`+- Create: `feature/settings/src/main/java/com/streamvault/feature/settings/api/SettingsSurfaceRefreshPort.kt`+- Create: `feature/settings/src/main/java/com/streamvault/feature/settings/api/SettingsDiagnosticsPort.kt`+- Create: `feature/settings/src/main/java/com/streamvault/feature/settings/api/SettingsAppUpdatePort.kt`+- Create: `app/src/main/java/com/streamvault/app/settings/AppSettingsPlatformHost.kt`+- Create: `app/src/main/java/com/streamvault/app/settings/AppSettingsBackupFileAdapter.kt`+- Create: `app/src/main/java/com/streamvault/app/settings/AppSettingsSurfaceRefreshAdapter.kt`+- Create: `app/src/main/java/com/streamvault/app/settings/AppSettingsDiagnosticsAdapter.kt`+- Create: `app/src/main/java/com/streamvault/app/settings/AppSettingsUpdateAdapter.kt`+- Create: `app/src/main/java/com/streamvault/app/settings/AppSettingsBindings.kt`+- Test: `app/src/test/java/com/streamvault/app/settings/AppSettingsAdaptersTest.kt`++**Interfaces:**+- Consumes: `BackupFileBridge`, `CrashReportStore`, app update services, Watch Next, recommendations, TV-input manager/worker, official-build verifier, and recording player handoff.+- Produces: the exact feature interfaces defined in the spec and app Hilt bindings for ViewModel-injected ports.++- [ ] **Step 1: Write failing adapter delegation tests**++Use internal operation interfaces in the app adapter file so tests assert delegation without Android singletons. Cover at least backup candidate mapping, surface refresh ordering, diagnostics mapping, release/download mapping, and recording playback field preservation:++```kotlin+@Test+fun recordingPlaybackAdapterPreservesRequestFields() {+ val request = SettingsRecordingPlaybackRequest(+ streamUrl = "content://recording/7",+ title = "News",+ internalId = 7L,+ providerId = 3L,+ contentType = "MOVIE",+ )+ platformHost.playRecording(request)+ assertThat(playbackOperations.requests).containsExactly(request)+}+```++- [ ] **Step 2: Run adapter tests to verify red**++Run:++```powershell+.\gradlew.bat :app:testDebugUnitTest --tests "com.streamvault.app.settings.AppSettingsAdaptersTest" --console=plain+```++Expected: compilation fails because settings API types/adapters do not exist.++- [ ] **Step 3: Define immutable feature value types and interfaces**++Implement the spec signatures. `SettingsBackupFileHost` must cover the current bridge behavior without exposing app types:++```kotlin+interface SettingsBackupFileHost {+ val jsonMimeType: String+ fun rememberManagedExport(uri: Uri)+ fun listManagedBackups(): List<SettingsBackupFileCandidate>+ fun listPickerFreeBackups(): List<SettingsBackupFileCandidate>+ fun listBackups(directory: File): List<SettingsBackupFileCandidate>+ fun createShareExportFile(): File+ fun createPickerFreeExportUri(): Uri?+ fun finishPickerFreeExport(uri: Uri, success: Boolean): Boolean+ fun createExportFile(directory: File): File+ fun delete(candidate: SettingsBackupFileCandidate): Boolean+ fun providerUri(file: File): Uri+}+```++`SettingsBackupFileCandidate` contains `uri`, `displayName`, `lastModifiedMs`, and `sizeBytes`. Update types mirror every field consumed by `SettingsAppUpdateActions`. `SettingsAppUpdatePort` also exposes+`fun isRemoteVersionNewer(remoteVersionCode: Int?, remoteVersionName: String, remotePublishedAt: String?): Boolean`; the app adapter delegates to the existing build/channel-aware policy. Feature-owned `SettingsUpdateCheckPolicy` preserves the current 24-hour success interval and 15-minute failure backoff, while feature-owned `SettingsUpdateActionState` and action selection preserve the current download/install decisions.++- [ ] **Step 4: Implement app adapters with no new policy**++Map app values field-for-field. `AppSettingsSurfaceRefreshAdapter` delegates to current Watch Next, recommendation, and TV-input operations. `AppSettingsUpdateAdapter` delegates to current checker/installer and retains their exact errors. Bind `SettingsSurfaceRefreshPort`, `SettingsDiagnosticsPort`, and `SettingsAppUpdatePort` from an app Hilt module; pass `SettingsPlatformHost` from `AppNavHost` because it performs route-owned Activity operations.++- [ ] **Step 5: Verify green and boundary safety**++Run:++```powershell+.\gradlew.bat :app:testDebugUnitTest --tests "com.streamvault.app.settings.AppSettingsAdaptersTest" :feature:settings:verifyFeatureSettingsBoundary :app:compileDebugKotlin --console=plain --warning-mode=none+```++Expected: adapter tests pass and feature source contains no app reference.++- [ ] **Step 6: Commit contracts and adapters**++```powershell+git add feature/settings/src/main/java/com/streamvault/feature/settings/api app/src/main/java/com/streamvault/app/settings app/src/test/java/com/streamvault/app/settings+git commit -m "refactor: add settings platform service ports"+```++### Task 4: Transfer backup-preview ownership without changing provider API++**Files:**+- Move: `app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsBackupImportPreviewDialog.kt` -> `feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsBackupImportPreviewDialog.kt`+- Create: `feature/settings/src/androidTest/java/com/streamvault/feature/settings/presentation/SettingsBackupPreviewTest.kt`+- Modify: `app/src/main/java/com/streamvault/app/navigation/AppNavHost.kt`+- Do not modify: `feature/provider/src/main/java/com/streamvault/feature/provider/api/ProviderBackupPreviewContent.kt`++**Interfaces:**+- Consumes: `BackupPreview`, `BackupImportPlan`, conflict strategy, import toggles, busy state, dismiss and confirm callbacks.+- Produces: public settings-owned `BackupImportPreviewDialog(...)` invoked by app composition; provider request remains byte-for-byte unchanged.++- [ ] **Step 1: Add the connected callback/semantics test first**++Render the dialog with a populated preview and assert section labels, strategy selection, one import toggle, dismiss, and confirm callbacks. Name the root semantics tag `settings.backup.preview` only if the existing dialog already has an equivalent stable tag; otherwise assert existing text/content descriptions without adding semantics.++- [ ] **Step 2: Run the test to verify red**++```powershell+.\gradlew.bat :feature:settings:compileDebugAndroidTestKotlin --console=plain+```++Expected: compilation fails because the dialog is not feature-owned.++- [ ] **Step 3: Move the dialog and its exact resources**++Use `git mv`, update package/R/device imports, and preserve layout, focus, row order, callbacks, and strings. Use `core.ui.device.rememberIsTelevisionDevice`.++- [ ] **Step 4: Rewire only the app renderer**++Keep the current `ProviderBackupPreviewRequest` mapping in `AppNavHost`; change only the dialog import to `com.streamvault.feature.settings.presentation.BackupImportPreviewDialog`. Confirm all request fields remain mapped exactly once.++- [ ] **Step 5: Verify provider compatibility**++```powershell+.\gradlew.bat :feature:provider:testDebugUnitTest :feature:provider:compileDebugKotlin :feature:settings:compileDebugAndroidTestKotlin :app:testDebugUnitTest --tests "com.streamvault.app.navigation.*" --console=plain --warning-mode=none+```++Expected: provider code compiles unchanged and app navigation tests pass.++- [ ] **Step 6: Commit the seam**++```powershell+git add app/src/main/java/com/streamvault/app/navigation/AppNavHost.kt feature/settings app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsBackupImportPreviewDialog.kt+git commit -m "refactor: move backup preview rendering to settings feature"+```++### Task 5: Move parental-control presentation and route state++**Files:**+- Move: `app/src/main/java/com/streamvault/app/ui/screens/settings/parental/ParentalControlGroupViewModel.kt` -> `feature/settings/src/main/java/com/streamvault/feature/settings/parental/ParentalControlGroupViewModel.kt`+- Move: `app/src/main/java/com/streamvault/app/ui/screens/settings/parental/ParentalControlGroupScreen.kt` -> `feature/settings/src/main/java/com/streamvault/feature/settings/parental/ParentalControlGroupScreen.kt`+- Create: `feature/settings/src/test/java/com/streamvault/feature/settings/parental/ParentalControlGroupViewModelTest.kt`++**Interfaces:**+- Consumes: `SavedStateHandle["providerId"]`, `CategoryRepository`, temporary `PreferencesRepository`, core search/PIN/shell components.+- Produces: feature-owned parental state/ViewModel/screen with unchanged category keys, pending changes, hide/show behavior, messages, focus, and callbacks.++- [ ] **Step 1: Write focused ViewModel policy tests before the move**++Cover adult categories remaining protected, non-adult pending toggles, reset, search, hidden counts, save failure message, and provider ID preservation. The adult test must assert real state:++```kotlin+@Test+fun adultCategoryCannotBeUnprotected() = runTest {+ val adult = category(id = 9L, isAdult = true, isUserProtected = false)+ repository.categories.value = listOf(adult)+ viewModel.toggleCategoryProtection(adult)+ assertThat(viewModel.uiState.first { !it.isLoading }.categories.single().isProtected).isTrue()+}+```++- [ ] **Step 2: Run the feature test to verify red**++```powershell+.\gradlew.bat :feature:settings:testDebugUnitTest --tests "com.streamvault.feature.settings.parental.ParentalControlGroupViewModelTest" --console=plain+```++Expected: compilation fails because the parental classes remain in app.++- [ ] **Step 3: Move the two files mechanically**++Use core components and feature resources. Do not change string text, content descriptions, lazy-list keys, focus requesters, current mode/type state, or Hilt/SavedState behavior.++- [ ] **Step 4: Verify green**++```powershell+.\gradlew.bat :feature:settings:testDebugUnitTest --tests "com.streamvault.feature.settings.parental.ParentalControlGroupViewModelTest" :feature:settings:compileDebugKotlin --console=plain --warning-mode=none+```++- [ ] **Step 5: Commit parental ownership**++```powershell+git add app/src/main/java/com/streamvault/app/ui/screens/settings/parental feature/settings/src/main/java/com/streamvault/feature/settings/parental feature/settings/src/test/java/com/streamvault/feature/settings/parental+git commit -m "refactor: move parental controls to settings feature"+```++### Task 6: Move settings state, policies, actions, observers, and unit tests++**Files:**+- Move: all non-composable action/model/observer/formatter files listed in `validation/phase5_settings/source-inventory.txt`, including `SettingsUiStateModel.kt`, `SettingsOperationalModels.kt`, `SettingsPreferenceModels.kt`, `SettingsPreferenceSnapshotMapper.kt`, `RemoteShortcutSettingsModels.kt`, `RemoteShortcutSettingsSupport.kt`, `SettingsBackupActions.kt`, `SettingsDriveBackupActions.kt`, `SettingsProviderActions.kt`, `SettingsRecordingActions.kt`, `SettingsSyncActions.kt`, `SettingsEpgActions.kt`, `SettingsObserverRegistrations.kt`, `SettingsDerivedStateObservers.kt`, `SettingsGuideDefaultCategoryBindings.kt`, `SettingsStateBindings.kt`, `SettingsAppUpdateActions.kt`, `SettingsAppUpdateModels.kt`, `SettingsAppUpdateFormatting.kt`, `SettingsFormatting.kt`, and `InternetSpeedTestRunner.kt` into `feature/settings/src/main/java/com/streamvault/feature/settings/presentation/`.+- Move: all 12 paths in `validation/phase5_settings/test-inventory.txt` into `feature/settings/src/test/java/com/streamvault/feature/settings/presentation/`.+- Modify: moved sources to consume Task 2 contracts and Task 3 ports.++**Interfaces:**+- Consumes: unchanged domain repositories/managers/use cases, ledgered `:data` types, settings ports, shared domain display enums.+- Produces: independently testable settings state/action/observer layer with the existing method and state-field surface.++- [ ] **Step 1: Move one unit-test cluster first and verify red**++Start with `SettingsBackupActionsTest.kt`, `SettingsDriveBackupActionsTest.kt`, and `SettingsAppUpdateActionsTest.kt`. Change packages/imports only, then run:++```powershell+.\gradlew.bat :feature:settings:testDebugUnitTest --tests "com.streamvault.feature.settings.presentation.SettingsBackupActionsTest" --tests "com.streamvault.feature.settings.presentation.SettingsDriveBackupActionsTest" --tests "com.streamvault.feature.settings.presentation.SettingsAppUpdateActionsTest" --console=plain+```++Expected: compilation fails because production actions are still app-owned.++- [ ] **Step 2: Move the matching production cluster and verify green**++Use `git mv`; replace app update classes with `SettingsAppUpdatePort` value types and replace TV managers with `SettingsSurfaceRefreshPort`. Preserve state updates, coroutine launch order, partial-import checkpoint behavior, and messages.++Run the same focused command. Expected: all focused tests pass.++- [ ] **Step 3: Repeat test-first for remaining inventory tests**++Move the remaining nine test files, run `:feature:settings:testDebugUnitTest` to observe missing production symbols, then move the corresponding production helpers. Do not weaken assertions or replace real state assertions with mock-interaction-only assertions.++- [ ] **Step 4: Run the complete moved unit suite and app compile**++```powershell+.\gradlew.bat :feature:settings:testDebugUnitTest :app:compileDebugUnitTestKotlin :feature:settings:verifyFeatureSettingsBoundary --console=plain --warning-mode=none+```++Expected: all 12 moved test classes pass from the feature; boundary scan reports only ledger-approved module dependencies and zero forbidden source imports.++- [ ] **Step 5: Commit state/action ownership**++```powershell+git add app/src/main/java/com/streamvault/app/ui/screens/settings app/src/test/java/com/streamvault/app/ui/screens/settings feature/settings+git commit -m "refactor: move settings state and actions to feature"+```++### Task 7: Move `SettingsViewModel` and connect operational adapters++**Files:**+- Move: `app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsViewModel.kt` -> `feature/settings/src/main/java/com/streamvault/feature/settings/presentation/SettingsViewModel.kt`+- Modify: `app/src/main/java/com/streamvault/app/settings/AppSettingsBindings.kt`+- Test: `feature/settings/src/test/java/com/streamvault/feature/settings/presentation/SettingsViewModelBoundaryTest.kt`++**Interfaces:**+- Consumes: Task 3 ports, Task 6 state/actions, existing Hilt bindings for domain/data/player dependencies.+- Produces: feature-owned Hilt ViewModel with the same public actions and `StateFlow<SettingsUiState>`.++- [ ] **Step 1: Write the constructor-boundary source test**++```kotlin+@Test+fun viewModelUsesPortsInsteadOfAppImplementations() {+ val source = File("src/main/java/com/streamvault/feature/settings/presentation/SettingsViewModel.kt")+ assertThat(source.isFile).isTrue()+ val text = source.readText()+ assertThat(text).contains("SettingsSurfaceRefreshPort")+ assertThat(text).contains("SettingsDiagnosticsPort")+ assertThat(text).contains("SettingsAppUpdatePort")+ assertThat(text).doesNotContain("com.streamvault.app")+}+```++- [ ] **Step 2: Run to verify red**++```powershell+.\gradlew.bat :feature:settings:testDebugUnitTest --tests "com.streamvault.feature.settings.presentation.SettingsViewModelBoundaryTest" --console=plain+```++Expected: failure because the feature ViewModel file does not exist.++- [ ] **Step 3: Move the ViewModel mechanically**++Preserve all methods, observer registration order, StateFlow sharing policies, initial values, coroutine scopes, and injected domain/data/player dependencies. Replace only app implementations with Task 3 ports and feature R/build-info values.++- [ ] **Step 4: Verify Hilt and unit compilation**++```powershell+.\gradlew.bat :feature:settings:kspDebugKotlin :feature:settings:testDebugUnitTest :app:compileDebugKotlin --console=plain --warning-mode=none+```++Expected: Hilt resolves app adapter bindings at app assembly and the feature ViewModel compiles independently against interfaces.++- [ ] **Step 5: Commit ViewModel ownership**++```powershell+git add app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsViewModel.kt app/src/main/java/com/streamvault/app/settings feature/settings+git commit -m "refactor: move settings view model to feature"+```++### Task 8: Move remaining Settings UI and locale resources++**Files:**+- Move: every remaining production path under `app/src/main/java/com/streamvault/app/ui/screens/settings/` listed in `validation/phase5_settings/source-inventory.txt` into `feature/settings/src/main/java/com/streamvault/feature/settings/presentation/`, preserving the `parental/` destination already moved.+- Create/Modify: `feature/settings/src/main/res/values/strings.xml`+- Create/Modify: `feature/settings/src/main/res/values-ar/strings.xml`, `values-cs/strings.xml`, `values-da/strings.xml`, `values-de/strings.xml`, `values-el/strings.xml`, `values-es/strings.xml`, `values-fi/strings.xml`, `values-fr/strings.xml`, `values-hu/strings.xml`, `values-in/strings.xml`, `values-it/strings.xml`, `values-iw/strings.xml`, `values-ja/strings.xml`, `values-ko/strings.xml`, `values-nb/strings.xml`, `values-nl/strings.xml`, `values-pl/strings.xml`, `values-pt/strings.xml`, `values-ro/strings.xml`, `values-ru/strings.xml`, `values-sv/strings.xml`, `values-tr/strings.xml`, `values-uk/strings.xml`, `values-vi/strings.xml`, `values-zh/strings.xml`+- Modify: corresponding app locale files only after reference scans prove each moved key is feature-exclusive.+- Create: `feature/settings/src/androidTest/java/com/streamvault/feature/settings/presentation/SettingsNavigationAndDialogTest.kt`+- Modify/Split: `app/src/androidTest/java/com/streamvault/app/ui/PremiumRouteGoldenTest.kt`++**Interfaces:**+- Consumes: feature ViewModel/state/actions, core shell/UI primitives, platform host, app-supplied `List<UiDestination>` and route callback.+- Produces: complete feature-owned Settings UI with unchanged focus, semantics, rows, dialogs, launchers, and visual resources.++- [ ] **Step 1: Add a focused connected test before moving the root screen**++Cover the Settings destination semantic, selected section focus, navigation between at least two sections, opening/dismissing one value dialog, and Back restoration. Run compile first:++```powershell+.\gradlew.bat :feature:settings:compileDebugAndroidTestKotlin --console=plain+```++Expected: compilation fails because `SettingsScreen` is not in the feature.++- [ ] **Step 2: Move UI files mechanically**++Use `git mv`. Replace app shell with `CoreAppScreenScaffold`, passed `UiDestination` values, and `onTopLevelRouteRequested`. Replace app Search/PIN/empty/time/device imports with Task 2/core equivalents. Pass `SettingsPlatformHost` for recording playback, backup files/share, crash sharing, removable storage, build info, and official-build status. Preserve every Activity Result contract and callback order.++- [ ] **Step 3: Move resources locale by locale**++Use `validation/phase5_settings/resource-inventory.txt` as the candidate set. For each key, scan all non-settings source/tests/resources before removing it from app:++```powershell+rg -n "R\.(string|plurals)\.<key>|name=\"<key>\"" app feature core benchmark -g '*.kt' -g '*.xml'+```++Copy the exact default and translated values. Keep shared keys in app or duplicate them when another owner remains. Do not rename keys or rewrite translations.++- [ ] **Step 4: Move/split connected golden ownership**++Move the Settings route portion of `saved_guide_and_settings_routes_matchGolden` into the feature connected test while leaving Guide coverage in app. Reuse the checked-in Settings baseline rather than recording a new self-baseline. Keep the recording-disabled missing-golden guard.++- [ ] **Step 5: Compile and test the full UI**++```powershell+.\gradlew.bat :feature:settings:compileDebugKotlin :feature:settings:compileDebugAndroidTestKotlin :feature:settings:testDebugUnitTest :app:compileDebugKotlin --console=plain --warning-mode=none+```++Expected: all moved sources/resources compile and no `com.streamvault.app` import appears under feature main.++- [ ] **Step 6: Commit UI/resources separately**++```powershell+git add app/src/main app/src/androidTest feature/settings/src/main feature/settings/src/androidTest+git commit -m "refactor: move settings presentation to feature"+```++### Task 9: Move Settings graph registration and preserve route compatibility++**Files:**+- Create: `feature/settings/src/main/java/com/streamvault/feature/settings/navigation/SettingsRoutePatterns.kt`+- Create: `feature/settings/src/main/java/com/streamvault/feature/settings/navigation/SettingsGraph.kt`+- Create: `feature/settings/src/test/java/com/streamvault/feature/settings/navigation/SettingsRoutePatternsTest.kt`+- Modify: `app/src/main/java/com/streamvault/app/navigation/AppNavHost.kt`+- Modify: `app/src/main/java/com/streamvault/app/navigation/graph/SystemGraph.kt`+- Modify: `app/src/test/java/com/streamvault/app/navigation/FeatureGraphBoundaryTest.kt`+- Test: existing `AppRouteCodecTest.kt` and `ExternalDestinationTest.kt`++**Interfaces:**+- Consumes: Task 3 platform host, Task 8 screens, `NavigationActions`, `AppDestination`, `UiDestination` list, app top-level route callback.+- Produces: `SettingsRoutePatterns` and `registerSettingsGraph(actions, platformHost, navigationDestinations, onTopLevelRouteRequested, onTopLevelDestinationRequested)`.++- [ ] **Step 1: Write route-pattern tests first**++```kotlin+@Test+fun routePatternsRemainCompatible() {+ assertThat(SettingsRoutePatterns.SETTINGS).isEqualTo("settings")+ assertThat(SettingsRoutePatterns.SETTINGS_DESTINATION)+ .isEqualTo("settings?backupUri={backupUri}")+ assertThat(SettingsRoutePatterns.PARENTAL_CONTROL_GROUPS)+ .isEqualTo("parental_control_groups/{providerId}")+}+```++- [ ] **Step 2: Run to verify red**++```powershell+.\gradlew.bat :feature:settings:testDebugUnitTest --tests "com.streamvault.feature.settings.navigation.SettingsRoutePatternsTest" --console=plain+```++Expected: unresolved `SettingsRoutePatterns`.++- [ ] **Step 3: Implement route constants and controller-free graph**++Copy the existing `SystemGraph` Settings and parental composable blocks. Preserve `backupUri` blank filtering, provider ID type, `dropUnlessResumed`, `launchSingleTop`, current route, add/edit callbacks, parental callbacks, and Back. Do not copy Downloads or Plugins.++- [ ] **Step 4: Register the feature from `AppNavHost`**++Build/pass current shell `UiDestination` values in app, supply `AppSettingsPlatformHost`, and call `registerSettingsGraph`. Keep the provider preview adapter pointing to the settings dialog. Remove only Settings and parental blocks/imports from `SystemGraph` after app compilation succeeds.++- [ ] **Step 5: Extend graph-boundary coverage and verify**++Add the settings navigation directory to `FeatureGraphBoundaryTest` and require `SettingsGraph.kt`. Run:++```powershell+.\gradlew.bat :feature:settings:testDebugUnitTest :app:testDebugUnitTest --tests "com.streamvault.app.navigation.AppRouteCodecTest" --tests "com.streamvault.app.navigation.ExternalDestinationTest" --tests "com.streamvault.app.navigation.FeatureGraphBoundaryTest" :app:assembleDebug --console=plain --warning-mode=none+```++Expected: route compatibility and feature graph tests pass; the app assembles with one Settings route owner.++- [ ] **Step 6: Commit graph ownership**++```powershell+git add feature/settings/src/main/java/com/streamvault/feature/settings/navigation feature/settings/src/test/java/com/streamvault/feature/settings/navigation app/src/main/java/com/streamvault/app/navigation app/src/test/java/com/streamvault/app/navigation+git commit -m "refactor: register settings graph from feature"+```++### Task 10: Remove legacy ownership and run automated structural gates++**Files:**+- Modify: `docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md`+- Create: `validation/phase5_settings/task10-automated-validation.md`+- Modify: `app/build.gradle.kts` only for confirmed-obsolete dependencies/tasks.+- Modify: `feature/settings/build.gradle.kts` for final exact dependency/runtime report wiring.++**Interfaces:**+- Consumes: completed feature ownership and inventory.+- Produces: one production owner, exact transitional dependency evidence, source-count evidence, independent checks, app integration checks, and refreshed Graphify output.++- [ ] **Step 1: Fail on legacy or forbidden ownership**++Run:++```powershell+rg -n "com\.streamvault\.app\.ui\.screens\.settings" app feature core domain -g '*.kt' -g '*.java'+rg -n "com\.streamvault\.app|NavHostController|NavController|MainActivity|com\.streamvault\.feature\.(provider|playback)" feature/settings/src/main -g '*.kt' -g '*.java'+rg -n '^import com\.streamvault\.data\.' feature/settings/src/main -g '*.kt' | Sort-Object+```++Expected: first two scans return no results; every third-scan type matches the settings ledger exactly.++- [ ] **Step 2: Remove only confirmed-obsolete app resources/dependencies**++Check every candidate with `rg` and Gradle dependency reports. Do not remove `:data`, `:player`, provider, playback, Room, OkHttp, WorkManager, or other app dependencies while any app consumer remains.++- [ ] **Step 3: Run feature checks**++```powershell+.\gradlew.bat :feature:settings:verifyFeatureSettingsBoundary :feature:settings:testDebugUnitTest :feature:settings:lintDebug :feature:settings:check :feature:settings:assembleDebug --console=plain --warning-mode=none+```++Expected: every command exits 0. Record test counts, lint warnings, boundary report, dependency list, and durations.++- [ ] **Step 4: Run app and neighboring-feature integration checks**++```powershell+.\gradlew.bat :core:navigation:check :core:ui:check :domain:test :feature:playback:check :feature:provider:check :app:testDebugUnitTest :app:assembleDebug --console=plain --warning-mode=none+```++Expected: commands exit 0 or exact pre-existing failures are recorded with evidence and the gate remains open. Do not attribute an existing failure to extraction without a baseline comparison.++- [ ] **Step 5: Prove compile isolation**++Apply and revert a comment-only edit in a settings production file, run `:feature:settings:compileDebugKotlin :app:compileDebugKotlin --dry-run` and a real profiled build, and record executed Kotlin/KSP tasks. Confirm no `:feature:playback:compile*` or `:feature:provider:compile*` task executes because of the edit.++- [ ] **Step 6: Refresh Graphify**++```powershell+graphify update .+```++Expected: graph rebuild succeeds and settings implementation nodes point to `feature/settings`, not the old app package. Record node/edge/community counts.++- [ ] **Step 7: Commit cleanup/evidence**++```powershell+git add app feature/settings docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md validation/phase5_settings graphify-out+git commit -m "chore: verify settings feature ownership"+```++### Task 11: Connected acceptance, measurements, profiles, and final report++**Files:**+- Create: `validation/phase5_settings/task11-runtime-validation.md`+- Create: `validation/phase5_settings/build-after/README.md`+- Create: `validation/phase5_settings/profile-validation.md`+- Create: `docs/COMPOSE_REDUCTION_PHASE5_SETTINGS_REPORT.md`+- Modify: `docs/COMPOSE_REDUCTION_PHASE5_ROADMAP.md`+- Modify: `docs/COMPOSE_REDUCTION_AND_UI_ARCHITECTURE_PLAN.md`++**Interfaces:**+- Consumes: installed debug app, feature/app connected suites, pre/post refs, baseline-profile producer, all prior evidence.+- Produces: honest Settings extraction status, rollback SHA/commits, automated/runtime/performance/profile evidence, and explicit open gates.++- [ ] **Step 1: Run focused connected suites on the TV emulator**++```powershell+.\gradlew.bat :feature:settings:connectedDebugAndroidTest :feature:provider:connectedDebugAndroidTest :app:connectedDebugAndroidTest --console=plain --warning-mode=none+```++Record device/AVD/API, per-class counts, XML result paths, screenshots, and every failure. Isolate reruns when a mixed suite times out; do not erase the mixed-run result.++- [ ] **Step 2: Exercise Settings navigation/focus/dialog behavior**++On a fresh debug APK, record Settings entry, section navigation, selected-section focus, dialog open/dismiss, Back restoration, add/edit provider handoff, parental route/return, touch/mouse where available, RTL, reduced motion, and accessibility semantics. Sanitize logs and screenshots.++- [ ] **Step 3: Exercise backup/restore and provider preview compatibility**++Cover picker launch, managed local backup, folder flow, share, preview selection, conflict strategy, dismiss/confirm, partial-import checkpoint, restore synchronization chooser, and provider setup preview rendering. Cover USB/Drive/account/provider-completion only when hardware/accounts/test data are available; otherwise list each as open.++- [ ] **Step 4: Exercise parental, recording, EPG, provider, and update paths**++Record parental search/protection/hide/PIN/save/reset, recording folder/browser/playback callback, EPG source/assignment dialogs, provider management/sync dialogs, and update check/download/install states that are safe and available. Never perform credentialed or destructive external operations without the existing test fixture/explicit authority.++- [ ] **Step 5: Capture five paired build samples**++Follow `performance-protocol.md` on clean committed pre/post refs with identical commands and host state. Report all samples, median, p95, task sets, daemon/cache state, and whether the 25% source-edit / 20% test-compile targets were demonstrated. If a comparable pre-ref cannot be constructed, keep the performance gate open.++- [ ] **Step 6: Run profile regeneration and stale-descriptor checks**++```powershell+.\gradlew.bat :app:generateBaselineProfile verifyBaselineProfileSources :app:assembleBeta :app:assembleRelease --console=plain --warning-mode=none+rg -n 'com/streamvault/app/ui/screens/settings|com\.streamvault\.app\.ui\.screens\.settings' app/src/main/generated/baselineProfiles app/build -g '*.txt' -g '*.prof' -g '*.map'+```++Expected: profile tasks pass and stale app-settings descriptors are absent. Preserve the existing physical-device/release-approval caveats.++- [ ] **Step 7: Write the settings report**++`COMPOSE_REDUCTION_PHASE5_SETTINGS_REPORT.md` must include ownership, public boundary, source/resource/test counts, exact ledger entries, automated commands/results, connected/manual results, provider preview compatibility, performance samples, profile status, rollback instructions, Graphify counts, known existing failures, and every open gate. State structural completion separately from runtime/performance acceptance.++- [ ] **Step 8: Update roadmap/grand-plan status without closing unrelated gates**++Link the settings plan/report. Preserve the playback and provider open-gate text. Do not mark Phase 5 complete because settings structure passes.++- [ ] **Step 9: Run final verification before any completion claim**++```powershell+git diff --check+.\gradlew.bat :feature:settings:check :feature:provider:check :feature:playback:check :app:testDebugUnitTest :app:assembleDebug --console=plain --warning-mode=none+graphify update .+git status --short+```++Read the full output and report the actual result. Do not claim a pass for any command not run fresh.++- [ ] **Step 10: Commit report and final evidence**++```powershell+git add docs/COMPOSE_REDUCTION_PHASE5_SETTINGS_REPORT.md docs/COMPOSE_REDUCTION_PHASE5_ROADMAP.md docs/COMPOSE_REDUCTION_AND_UI_ARCHITECTURE_PLAN.md validation/phase5_settings graphify-out+git commit -m "docs: report settings feature extraction"+```++## Exit criteria++- `:feature:settings` owns all 71 inventoried production paths, 12 inventoried unit-test paths, parental controls, backup preview, resources, connected tests, and Settings graph registration, subject to documented shared-resource exceptions.+- `:app` owns only Settings platform adapters, route compatibility/external intents, root graph registration, and provider-to-settings preview adaptation.+- Settings and parental route strings/arguments are unchanged.+- Provider backup-preview request type and callback mapping are unchanged.+- Feature boundary, independent tests, lint/check/assemble, app navigation tests, app unit tests, and app assembly have fresh evidence.+- No feature main source imports app, root controllers, `MainActivity`, provider implementation, or playback implementation.+- All temporary data types and the concrete player audit candidate are documented.+- Connected/manual/performance/profile outcomes and unavailable gates are recorded without converting open gates into passes.+- Graphify reflects feature ownership.diff --git a/docs/superpowers/specs/2026-08-27-phase-5-settings-feature-extraction-design.md b/docs/superpowers/specs/2026-08-27-phase-5-settings-feature-extraction-design.mdnew file mode 100644index 00000000..04f5ecb1--- /dev/null+++ b/docs/superpowers/specs/2026-08-27-phase-5-settings-feature-extraction-design.md@@ -0,0 +1,409 @@+# Phase 5 Settings Feature Module Extraction Design++Date: 2026-08-27+Status: Approved for implementation planning++## Context++Phase 5 moves presentation out of `:app` into independently compiled feature+modules without changing behavior. Playback now lives in `:feature:playback`+and provider setup lives in `:feature:provider`. Their reports retain open+runtime, manual, and performance gates; this settings extraction does not close+or reinterpret those gates.++Settings is the next roadmap slice. Its current package contains 71 production+Kotlin files and 19,483 lines, plus 12 unit-test files and 1,031 test lines.+Graphify identifies `SettingsViewModel` as a god node with 112 connections.+The ViewModel has 27 constructor dependencies and coordinates preferences,+providers, EPG, recordings, parental controls, backup/restore, Drive backup,+application updates, diagnostics, TV surfaces, and direct DAO state.++The extraction is therefore a contract-first, staged ownership transfer. It+is not a one-shot package rename and not an opportunity to redesign Settings.++## Goal++Create `:feature:settings` as the sole owner of Settings presentation,+parental-control presentation, backup/restore presentation, settings state and+dialogs, feature resources, tests, and graph registration while keeping+`:app` as the platform and navigation composition root.++The extracted feature must compile and test independently. A settings-only+source edit must not compile playback or provider feature source. Routes,+arguments, focus, semantics, callbacks, persistence, file-launcher behavior,+and visual output remain equivalent.++## Non-goals++- Do not convert Settings or backup flows to classic Views in Phase 5.+- Do not redesign the settings navigation rail, rows, dialogs, or section+ organization.+- Do not split `SettingsViewModel` behavior or replace its state model during+ the mechanical ownership move.+- Do not change backup formats, conflict resolution, Drive behavior, provider+ synchronization, recording policy, parental-control policy, or app-update+ policy.+- Do not extract Downloads, Plugins, Live, EPG, catalog, or system presentation.+- Do not add a feature-to-feature implementation dependency.+- Do not claim Phase 5 completion while playback/provider/settings acceptance+ or performance gates remain open.++## Current ownership and coupling++### Settings package++The move unit is:++```text+app/src/main/java/com/streamvault/app/ui/screens/settings/+app/src/test/java/com/streamvault/app/ui/screens/settings/+```++It includes the root screen, sections, dialogs, action coordinators, derived+observers, formatting/model helpers, `SettingsViewModel`, the parental-control+group route/ViewModel, backup preview, Drive backup, provider management,+recording browsing, EPG configuration, app-update presentation, and speed test.++### Navigation++`app/navigation/graph/SystemGraph.kt` currently registers Downloads, Settings,+Plugins, and parental-control groups. `AppRouteCodec` owns compatibility+encoding/decoding for the Settings backup URI and parental provider ID.++Settings extraction moves only Settings and parental-control graph+registration. Downloads and Plugins remain app-owned. Compatibility encoding+and external-intent parsing remain app-owned.++### Existing provider backup-preview seam++`:feature:provider` exposes `ProviderBackupPreviewContent` and+`ProviderBackupPreviewRequest`. `AppNavHost` currently satisfies that contract+with the app-owned `BackupImportPreviewDialog` from Settings.++Settings takes ownership of `BackupImportPreviewDialog` without changing the+provider API. `AppNavHost`, as composition root, continues to translate the+provider request field-for-field into the settings composable. Neither feature+imports the other.++### Direct implementation dependencies++The current settings package directly imports these `:data` types:++| Implementation type | Current responsibility | Phase 7 removal direction |+|---|---|---|+| `ProgramDao` | provider program-count diagnostics | domain diagnostics query |+| `XtreamIndexJobDao` | Xtream index status observation | domain sync-status query |+| `XtreamLiveOnboardingDao` | live onboarding progress | domain onboarding-status query |+| `XtreamIndexJobEntity` | index status mapping | domain sync-status model |+| `XtreamLiveOnboardingStateEntity` | onboarding status mapping | domain onboarding-status model |+| `DatabaseMaintenanceSnapshot` | database maintenance UI mapping | domain maintenance snapshot |+| `PreferencesRepository` | settings persistence and observation | domain application-settings contract |+| `ProviderSyncCommands` | repair/cancel commands | domain provider-sync commands |+| `SyncRepairSection` | repair section selection | domain provider-sync section |++The feature also uses concrete `AudioCompatibilityMemoryStore` from `:player`.+That dependency is allowed by the Phase 5 technical-module rules but is+recorded as a Phase 7 contract-cleanup candidate.++### App implementation dependencies++The package currently imports app resources, shell components, shared display+models, backup files, diagnostics, update services, TV-surface managers,+TV-input work, `MainActivity`, route codecs, locale helpers, and build+verification. These imports cannot cross the feature boundary. They are+resolved through the ownership rules and ports below.++## Target dependency direction++```text+:app+ -> :feature:settings+ -> :feature:provider+ -> :feature:playback+ -> :core:navigation / :core:ui / :domain / :data / :player++:feature:settings+ -> :core:navigation+ -> :core:ui+ -> :domain+ -> :data # temporary, every imported type ledgered+ -> :player # AudioCompatibilityMemoryStore audit candidate+```++`:feature:settings` must not depend on `:app`, `:feature:provider`, or+`:feature:playback`. Feature-to-feature navigation is expressed with core+destinations and app callbacks.++## Target ownership++### `:feature:settings` owns++- Settings and parental-control route patterns and graph registration.+- `SettingsScreen`, `SettingsViewModel`, `SettingsUiState`, action helpers,+ observers, sections, rows, dialogs, formatters, and operational UI models.+- `ParentalControlGroupScreen`, its ViewModel, state, and components.+- Backup/restore and Drive-backup presentation, including+ `BackupImportPreviewDialog`.+- Settings-owned backup file selection/management UI behavior behind the+ platform file port.+- Settings-owned resources, locale translations, unit tests, connected tests,+ Compose diagnostics, and module-boundary verification.+- Pure app-update presentation models and selection/formatting policy. The+ update transport/installer implementation remains app-owned.+- The dashboard-shelf customization dialog, because it is invoked only from+ Settings and edits a persisted settings preference.++### `:app` retains++- `MainActivity`, root `NavHostController`, `AppNavHost`, external intents,+ `AppRouteCodec`, and navigation payload storage.+- Downloads and Plugins registration in the app system graph.+- `BackupFileBridge` implementation used by external-intent parsing.+- `CrashReportStore` installation and storage implementation.+- app-update download/network/install implementations and worker entry points.+- Watch Next, launcher recommendations, TV-input manager/worker, build identity,+ package verification, and other platform implementations.+- Hilt adapters from app implementations to settings feature ports.+- Mapping `ProviderBackupPreviewRequest` to the settings-owned preview dialog.++### Neutral shared ownership++- Generic shell visuals, TV empty/search controls, PIN entry, time formatting,+ and device classification use or move to `:core:ui` only when their APIs are+ app-agnostic.+- Persisted display preference enums used by Settings plus Live or Catalog move+ to `:domain`; storage values and parsing remain unchanged.+- Typed settings and parental destinations remain in `:core:navigation`.++## Public feature boundary++### Routes and graph registration++The feature owns stable patterns matching the existing strings:++```kotlin+object SettingsRoutePatterns {+ const val SETTINGS = "settings"+ const val SETTINGS_DESTINATION = "settings?backupUri={backupUri}"+ const val PARENTAL_CONTROL_GROUPS = "parental_control_groups/{providerId}"+}++fun NavGraphBuilder.registerSettingsGraph(+ actions: NavigationActions,+ platformHost: SettingsPlatformHost,+ navigationDestinations: List<UiDestination>,+ onTopLevelRouteRequested: (String) -> Unit,+ onTopLevelDestinationRequested: (AppDestination) -> Unit,+)+```++The graph reads the existing `backupUri` and `providerId` arguments, uses+`dropUnlessResumed` for provider create/edit and parental navigation, and+passes controller-free callbacks to the screens. It never imports+`AppRouteCodec`, a root controller, `MainActivity`, or app payload storage.++`AppRouteCodec` keeps constructing and decoding the same routes. The app system+graph stops registering Settings only after `AppNavHost` registers the feature+graph.++### Platform host++Route-owned Android actions use one narrow host supplied by `:app`:++```kotlin+interface SettingsPlatformHost {+ val buildInfo: SettingsBuildInfo+ val backupFiles: SettingsBackupFileHost+ fun officialBuildStatus(): SettingsOfficialBuildStatus+ fun playRecording(request: SettingsRecordingPlaybackRequest)+ fun shareBackup(uri: Uri): Result<Unit>+ fun shareCrashReport(): Result<Unit>+ fun removableBackupDirectory(): File?+}+```++`SettingsBuildInfo`, `SettingsOfficialBuildStatus`, and+`SettingsRecordingPlaybackRequest` are feature-owned immutable value types.+The host adds no policy; app adapters delegate to current implementations.+The feature retains Activity Result launchers and their callback order.++`SettingsBackupFileHost` exposes the current managed-backup, picker-free,+folder, removable-storage, URI, delete, and publish operations using+`SettingsBackupFileCandidate` values. It delegates to app-owned+`BackupFileBridge`; no storage policy or filename behavior is reimplemented in+the feature.++### Injected operational ports++App-owned services used by the feature ViewModel are exposed through focused+interfaces:++```kotlin+interface SettingsSurfaceRefreshPort {+ suspend fun refreshWatchNext()+ suspend fun refreshRecommendations()+ suspend fun refreshTvInputCatalog()+ fun enqueueTvInputCatalogRefresh()+}++interface SettingsDiagnosticsPort {+ fun latestReport(): SettingsCrashReport?+ fun deleteLatestReport(): Boolean+}++interface SettingsAppUpdatePort {+ val downloadState: StateFlow<SettingsUpdateDownloadState>+ fun isRemoteVersionNewer(+ remoteVersionCode: Int?,+ remoteVersionName: String,+ remotePublishedAt: String?,+ ): Boolean+ suspend fun fetchLatestRelease(): Result<SettingsReleaseInfo>+ suspend fun refreshDownloadState(): SettingsUpdateDownloadState+ suspend fun startDownload(release: SettingsReleaseInfo): Result<Unit>+ suspend fun installDownloadedUpdate(expectedSha256: String?): Result<Unit>+}+```++The feature value types preserve every field consumed by current settings+presentation. App adapters map current update/diagnostics objects without+changing error strings, timestamps, HTTPS validation, download state, or+installer behavior. The feature owns the pure auto-check interval and+download/install action-selection policy; the app port retains the+BuildConfig/channel-aware version comparison.++## Screen and state boundary++Phase 5 keeps the current `SettingsUiState`, action coordinators, observer+topology, and ViewModel call order. The extraction may split route-owned+platform launchers from `SettingsScreen`, but must not split the ViewModel by+responsibility in the same change. That decomposition belongs to a later+behavior-focused phase with dedicated tests.++The target composition is:++```text+SettingsGraph+ SettingsRoute+ Activity Result launchers and SettingsPlatformHost+ SettingsScreen+ Settings navigation rail/content pane+ sections and rows+ SettingsScreenOverlays+ backup/restore dialogs++ ParentalControlGroupRoute+ ParentalControlGroupScreen+```++`SettingsScreen` remains renderable with an explicitly supplied ViewModel/state+and callbacks. Existing test tags, content descriptions, focus request order,+dialog ordering, lazy-item ordering, and Back behavior remain unchanged.++## Resources++The settings package references 665 unique resources: 660 strings and five+plurals. Feature-owned settings and parental keys move locale by locale into+`:feature:settings`. A resource is removed from `:app` only when no app source,+test, manifest, benchmark, or other feature references it. Shared keys may be+duplicated temporarily when ownership is not yet safe to transfer; duplication+is recorded in the report.++The module namespace is `com.streamvault.feature.settings`, and moved source+uses `com.streamvault.feature.settings.*` packages and+`com.streamvault.feature.settings.R`.++## Migration sequence++1. Record inventory, rollback SHA, baseline commands, dependencies, routes,+ resources, tests, and open acceptance gates.+2. Add the module, coverage wiring, and fail-closed boundary task with Kotlin+ and Java violation fixtures.+3. Establish neutral shared UI/model contracts and app-supplied platform ports.+4. Move the backup-preview implementation first and keep the provider contract+ compatible through app composition.+5. Move parental-control presentation and verify its provider-ID route.+6. Move settings models/actions/observers and their tests mechanically.+7. Move `SettingsViewModel` and add app adapters/Hilt bindings for operational+ ports.+8. Move remaining Settings UI and resources without changing behavior.+9. Register the settings graph from `AppNavHost`, then remove Settings routes+ from the app system graph.+10. Remove legacy ownership, audit dependencies, update the ledger, run all+ structural/runtime gates, regenerate profiles, refresh Graphify, and write+ the feature report.++## Error handling and rollback++- Invalid or missing settings backup URI retains the existing empty/default+ behavior.+- Missing recording playback or platform capability remains a no-op with the+ current user-message behavior.+- File permission, unavailable picker, share, removable-storage, update,+ diagnostics, backup, Drive, sync, and provider errors keep their current+ messages and callback ordering.+- Backup partial-import checkpoint and retry state is preserved.+- The app-owned Settings route remains wired until the feature graph compiles,+ unit tests pass, and an installed app reaches both Settings destinations.+- Commits separate contracts, mechanical moves, graph wiring, and cleanup so+ each slice is independently revertible.++## Verification++### Automated structural gates++- `:feature:settings:verifyFeatureSettingsBoundary`+- `:feature:settings:testDebugUnitTest`+- `:feature:settings:lintDebug`+- `:feature:settings:check`+- `:feature:settings:assembleDebug`+- app navigation compatibility tests and feature-graph boundary tests+- `:app:testDebugUnitTest`+- `:app:assembleDebug`+- source scans for app/root-controller/feature-implementation imports+- runtime dependency report and transitional ledger comparison+- `graphify update .` after code changes++### Connected and manual behavior gates++- Settings route with and without `backupUri`.+- Settings navigation rail, D-pad focus restoration, Back behavior, touch,+ mouse, RTL, reduced motion, and accessibility semantics.+- All selection/value/PIN/provider/EPG/recording/update/backup dialogs.+- Parental category protection/hiding, search, PIN, save/reset, and route return.+- Backup create/share/local/folder/USB flows where supported; preview choices,+ conflict strategies, partial import, restore synchronization, and Drive+ sign-in/push/pull/manage/delete.+- Provider create/edit callbacks from Settings and provider backup-preview+ rendering through the unchanged provider request contract.+- Recording folder launcher and recording playback handoff.++Unavailable hardware, credentials, accounts, files, or provider data are+reported as open gates, not passes.++### Build and profile evidence++- Five before/after settings-only incremental source-edit runs.+- Five before/after settings-test compile runs.+- Clean debug and warm no-change guardrails.+- Executed task-set proof that a settings edit does not compile playback or+ provider feature source.+- Profile regeneration and stale app-settings descriptor scan after package+ moves.+- Controlled runtime benchmark evidence for settings scrolling and dialog+ opening when the environment supports it.++## Exit criteria++- Settings, parental controls, backup/restore presentation, state, dialogs,+ resources, tests, and graph registration are owned by `:feature:settings`.+- `:app` registers the settings graph and supplies platform adapters only.+- Provider backup preview still renders through `ProviderBackupPreviewContent`+ with field-for-field callback compatibility.+- No settings feature source imports `com.streamvault.app`, a root navigation+ controller, provider/playback feature implementations, or `MainActivity`.+- All temporary `:data` imports are complete in the transitional ledger.+- Feature tests run independently and a feature-only edit is isolated from+ unrelated feature compilation.+- Verification and open runtime/performance gates are recorded honestly in+ `docs/COMPOSE_REDUCTION_PHASE5_SETTINGS_REPORT.md`.diff --git a/validation/phase5_settings/task6-state-actions-report.md b/validation/phase5_settings/task6-state-actions-report.mdnew file mode 100644index 00000000..61fb4298--- /dev/null+++ b/validation/phase5_settings/task6-state-actions-report.md@@ -0,0 +1,41 @@+# Settings extraction — Task 6 evidence++Date: 2026-08-27++## Scope++Task 6 moved the pure settings presentation state/action/model layer and its+focused unit tests into `:feature:settings`. App-owned platform adapters and+the remaining Settings UI/ViewModel files intentionally remain in `:app` for+the next tasks.++## Verification++Commands were run from the repository root with the existing Gradle daemon and+cache:++```text+gradlew.bat :feature:settings:check --console=plain --warning-mode=none+EXIT=0+BUILD SUCCESSFUL in 31s++gradlew.bat :feature:settings:verifyFeatureSettingsBoundary \+ :feature:settings:testDebugUnitTest \+ :app:compileDebugKotlin \+ :app:compileDebugUnitTestKotlin \+ --console=plain --warning-mode=none+EXIT=0+BUILD SUCCESSFUL in 5s+```++The full feature check includes debug/release unit tests, lint, Kover, and the+boundary task. The focused command verifies feature boundary fixtures and app+source/test compilation against the transitional contracts.++## Evidence interpretation++These are structural/compile/unit-test gates only. Runtime playback/provider+acceptance, settings connected tests, physical-TV focus journeys, account and+document chooser flows, and paired incremental-performance measurements remain+open and are not represented as passing here.+