{ "intent": "Bring EnforcementLogTest.kt (251 lines) under the 250-line cap by splitting off the six EnforcementRunner.best fix-selection tests, which share no subject with the log tests.", "scope": [ "focus_owner/android/app/src/test/kotlin/com/kuhy/focus_owner/EnforcementLogTest.kt", "focus_owner/android/app/src/test/kotlin/com/kuhy/focus_owner/EnforcementRunnerBestTest.kt (new)", "focus_owner/android/app/src/test/kotlin/com/kuhy/focus_owner/EnforcementFixtures.kt", "Non-goal: no assertion changed, no test deleted, skipped or weakened; no production code touched" ], "changes": [ "Move the six `EnforcementRunner.best` tests into a new EnforcementRunnerBestTest class, verbatim including their explanatory comments.", "Hoist the shared `candidate()` fix builder into the existing internal EnforcementFixtures object rather than duplicating it, per docs/app-split-recipes.md's Kotlin rule.", "Point EnforcementLogTest's homeLat/homeLon at EnforcementFixtures so the home coordinates exist in exactly one file -- the file has a test asserting those coordinates never reach a log record." ], "verification": [ { "command": "JAVA_HOME=/usr/lib/jvm/java-21-openjdk ./gradlew :app:testDebugUnitTest --tests 'com.kuhy.focus_owner.EnforcementLogTest' (baseline, before the split)", "result": "pass", "evidence": "BUILD SUCCESSFUL; TEST-...EnforcementLogTest.xml reported tests=\"15\" failures=\"0\" errors=\"0\" skipped=\"0\"." }, { "command": "JAVA_HOME=/usr/lib/jvm/java-21-openjdk ./gradlew :app:testDebugUnitTest --tests 'com.kuhy.focus_owner.*' (after the split)", "result": "pass", "evidence": "BUILD SUCCESSFUL. Summed JUnit XML: tests=40 failures=0 errors=0 skipped=0, matching the documented 40-test focus_owner Kotlin baseline. Per class: EnforcementDecisionCurfewTest 13, EnforcementDecisionTest 12, EnforcementLogTest 9, EnforcementRunnerBestTest 6 -- the original 15 preserved as 9+6." }, { "command": "bash ~/utils/scripts/check_file_length.sh focus_owner/android/app/src/test/kotlin/com/kuhy/focus_owner/*.kt", "result": "pass", "evidence": "Exit 0. EnforcementLogTest 251 -> 169; EnforcementRunnerBestTest 90; EnforcementFixtures 77 -> 92. All five files under 250." }, { "command": "Intermediate failure, recorded deliberately: an initial attempt wrote a fresh EnforcementFixtures.kt over the existing one", "result": "fail, then fixed", "evidence": "compileDebugUnitTestKotlin FAILED with 14 'Unresolved reference' errors (homeLat, policy, installed, latOffset...) from EnforcementDecisionTest and EnforcementDecisionCurfewTest. Restored via `git checkout --` and re-applied as an extension of the existing object. This is the exact failure docs/app-split-recipes.md warns about -- list every private member before cutting." } ], "risks": [ "Low: test-only change. The gradle run is the full authority here and it matches the baseline exactly.", "EnforcementLogTest keeps its own fix() builder (outcome ACTIVE_OK) separate from the shared candidate() (CACHED_FRESH); merging them would change what the log tests exercise, so they stay distinct." ], "rollback": [ "git revert the commit; EnforcementRunnerBestTest.kt disappears and the six tests return to EnforcementLogTest.kt.", "Re-run the gradle command above and confirm tests=40 failures=0." ] }