testsAndMisc/docs/superpowers/contracts/focus-owner-device-policy-bridge-split-2026-08-18.json
Krzysztof kuhy Rudnicki 6efb4baf04
Some checks failed
Pre-commit checks / pre-commit (push) Has been cancelled
Shell tests / shell-tests (push) Has been cancelled
Shell tests / arch-tests (push) Has been cancelled
focus_owner: split DevicePolicyBridge.kt under the 250-line cap
Kotlin has no part-of like Dart, so this extracts three cohesive
method groups into standalone internal helper classes held as
private delegates: DevicePolicyVpnDns (VPN/Private DNS pinning),
DevicePolicyLocation (location permissions), DevicePolicyUninstallGuard
(uninstall blocking). DevicePolicyBridge's public API is unchanged --
every method MainActivity.kt/EnforcementService.kt call directly
still exists as a one-line delegating wrapper.

Verified with gradlew compileDebugKotlin + test --rerun-tasks
(BUILD SUCCESSFUL, 40 tests / 0 failures).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-18 23:56:21 +02:00

18 lines
1.9 KiB
JSON

{
"title": "Split DevicePolicyBridge.kt under the 250-line cap",
"objective": "Bring focus_owner/android/.../DevicePolicyBridge.kt (415 lines) under the repo-wide 250-line cap by extracting cohesive method groups into standalone helper classes, without changing DevicePolicyBridge's public API.",
"acceptance_criteria": [
"bash meta/scripts/check_file_length.sh --all no longer lists DevicePolicyBridge.kt.",
"Every public method DevicePolicyBridge exposed before the split (isDeviceOwner, isProfileOwner, setApplicationHidden, grantLocationPermissions, enableLocation, isApplicationHidden, isAdminActive, hasAccounts, setSelfUninstallBlocked, isSelfUninstallBlocked, setPackageUninstallBlocked, setAlwaysOnVpn, setPrivateDns, privateDnsHost, setPrivateDnsConfigBlocked, alwaysOnVpnPackage, setVpnConfigBlocked, status, releaseDeviceOwner) still exists on DevicePolicyBridge with the same signature, since MainActivity.kt and EnforcementService.kt call these directly.",
"gradlew compileDebugKotlin --rerun-tasks succeeds with no compile errors.",
"gradlew test --rerun-tasks succeeds with the same test count and zero failures as before the split.",
"No method body logic changed -- only extraction into new files plus delegate wiring."
],
"out_of_scope": [
"Adding new unit tests for DevicePolicyBridge itself (it wraps the Android DevicePolicyManager system service; no prior test existed and none is required for a pure extraction).",
"Touching MainActivity.kt or EnforcementService.kt, whose call sites were verified but not modified.",
"Splitting EnforcementRunner.kt, the other over-cap focus_owner Kotlin file -- separate file, separate task."
],
"verifier": "JAVA_HOME=/usr/lib/jvm/java-21-openjdk ./gradlew compileDebugKotlin test --rerun-tasks (from focus_owner/android), plus bash meta/scripts/check_file_length.sh --all showing DevicePolicyBridge.kt no longer over cap."
}