mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 16:14:12 +01:00
Held until last on purpose: all five enforcer splits this session grew
deploy.sh's two hardcoded file lists, so cutting it earlier would have left
every "add to BOTH lists" step pointing at a stale location. Those lists are
final as of the focus_ctl commit, so this is now safe.
do_deploy was 421 lines -- over the cap on its own, so moving it whole would
have achieved nothing. It is cut at the phase boundaries it already prints
("[4/7] Uploading scripts...", "[5/7] Setting permissions...") plus two more
inside the push phase, giving seven named functions instead of one wall.
The two hardcoded lists now live in SEPARATE files, which is the real risk
this commit introduces. deploy_phases.sh holds the push list and
deploy_install.sh the cp list; each header names the other and says what
happens when they drift -- the file is staged, never lands, and whatever
sources it fails to start with no obvious cause. Checked in both directions
after the move: the only asymmetry is config_secrets.sh, which a conditional
block handles so the phone's real coordinates survive a deploy. That was
asymmetric at HEAD too.
check_coords now RETURNS whether the coordinates are placeholders instead of
assigning $NEEDS_GPS_FETCH. The flag is written in deploy.sh and read in
deploy_phases.sh, so assigning it from deploy_gps.sh as well left that file
writing a global it never reads. Behaviour proven identical to HEAD: real
coords -> 0, placeholders -> 1.
NO TESTS, and that is a deliberate limit rather than an omission. Every
phase here is a sequence of adb calls against a real device; a stub layer
deep enough to mean anything would be modelling the phone, not testing the
script. Verification is that deploy.sh parses, sources all six libraries and
reaches its usage message -- which catches a broken split, not a wrong one.
515 assertions across ten phone suites still pass; run_phone.sh --help
exits 0.
Over-cap 16 -> 15, and NO phone_focus_mode file is over the cap any more.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
68 lines
6.1 KiB
JSON
68 lines
6.1 KiB
JSON
{
|
|
"intent": "Bring deploy.sh under the 250-line cap, finishing phone_focus_mode. It was held until last because every enforcer split this session added entries to its two hardcoded file lists.",
|
|
"scope": [
|
|
"phone_focus_mode/deploy.sh - 875 lines down to 241",
|
|
"phone_focus_mode/deploy_phases.sh - new: the push phase and the generated assets, holding the FIRST hardcoded list",
|
|
"phone_focus_mode/deploy_install.sh - new: the install-into-REMOTE_DIR phase and permissions, holding the SECOND list",
|
|
"phone_focus_mode/deploy_daemons.sh - new: restarting the enforcers, the companion app, the closing report",
|
|
"phone_focus_mode/deploy_magisk.sh - new: the systemless-hosts module, Aurora Store, the hash helper",
|
|
"phone_focus_mode/deploy_gps.sh - new: home-coordinate capture",
|
|
"phone_focus_mode/deploy_actions.sh - new: usage and the non-deploy actions",
|
|
"Non-goal: any device deploy, or any change to what gets deployed."
|
|
],
|
|
"changes": [
|
|
"Ran the pre-extraction audits. deploy.sh has NO while-read loops, so the stdin-drain hazard that constrained focus_daemon.sh does not apply. Four globals are written inside functions (ADB_TARGET, ACTION, PHONE_IP, NEEDS_GPS_FETCH); the first three are written and read only in the entry script and stayed there.",
|
|
"do_deploy was 421 lines -- over the cap by itself -- so it could not simply be moved. It was cut at the phase boundaries it already prints ([4/7] Uploading, [5/7] Permissions, [6/7] Starting daemons, the companion app, the closing report), plus two more inside the push phase, giving seven named functions instead of one wall.",
|
|
"The two hardcoded file lists now live in different files. Each carries a comment naming where its counterpart is and what happens if they drift: a file in one and not the other is staged and never lands, and the script that sources it then fails to start with no obvious cause.",
|
|
"check_coords now RETURNS whether the coordinates are placeholders instead of assigning $NEEDS_GPS_FETCH. The flag is written in deploy.sh and read in deploy_phases.sh; assigning it from deploy_gps.sh as well left that file writing a global it never reads (SC2034), and the repo forbids disables.",
|
|
"The six source lines resolve the library directory once into _DEPLOY_LIB_DIR rather than re-running the same command substitution per line, and sit above DEPLOY_DIR -- safe because the libraries only define functions."
|
|
],
|
|
"verification": [
|
|
{
|
|
"command": "timeout 30 bash phone_focus_mode/deploy.sh",
|
|
"result": "pass",
|
|
"evidence": "Reaches 'ERROR: Phone IP not provided.' and its usage text, which requires all six libraries and config.sh to have sourced cleanly."
|
|
},
|
|
{
|
|
"command": "bash meta/scripts/verify_shell_split.sh 3ddc13f phone_focus_mode/deploy.sh phone_focus_mode/deploy.sh phone_focus_mode/deploy_*.sh",
|
|
"result": "pass",
|
|
"evidence": "Reports do_deploy as differing, plus the seven new phase functions as added. That is exactly the intended change: do_deploy was too large to move whole and was cut into the phases it already announced. Every other function hashes identical."
|
|
},
|
|
{
|
|
"command": "behavioural comparison of check_coords against the pre-split version",
|
|
"result": "pass",
|
|
"evidence": "Real coordinates (52.228948, 20.951184) -> NEEDS_GPS_FETCH=0 in both; placeholders -> 1 in both. The return-status refactor preserves the flag exactly."
|
|
},
|
|
{
|
|
"command": "two-list parity check between deploy_phases.sh and deploy_install.sh",
|
|
"result": "pass",
|
|
"evidence": "comm reports one difference, config_secrets.sh, which is handled by a conditional block that preserves the phone's existing copy rather than by the standard push/cp pair. Confirmed asymmetric at HEAD too (2 occurrences there), so it is pre-existing and deliberate, not introduced here."
|
|
},
|
|
{
|
|
"command": "shellcheck on each of the seven files individually (no -x)",
|
|
"result": "pass",
|
|
"evidence": "All clean standalone. The one SC2034 was NEEDS_GPS_FETCH, fixed by the return-status refactor above rather than by a disable."
|
|
},
|
|
{
|
|
"command": "every phone-side shell suite",
|
|
"result": "pass",
|
|
"evidence": "dns_iptables 24, monitor 82, tether_enforcer 17, curfew_net 41, hosts_libs 69, daemon_libs 108, backup_capture 22, ctl_libs 136, adb_common 10, adb_trusted 6 -- 515 assertions, 0 failures. run_phone.sh --help exits 0."
|
|
},
|
|
{
|
|
"command": "bash meta/scripts/check_file_length.sh --all",
|
|
"result": "pass",
|
|
"evidence": "15 over-cap files, down from 16, and NO phone_focus_mode file remains over the cap. deploy.sh is 241 and the six siblings are 83-168."
|
|
}
|
|
],
|
|
"risks": [
|
|
"NO TESTS. Unlike every other split this session, nothing here is covered: each deploy phase is a sequence of adb calls against a real device, and a stub layer deep enough to be meaningful would be modelling the phone rather than testing the script. The verification is that deploy.sh still parses, sources and runs to its usage message -- which catches a broken split but not a wrong one.",
|
|
"THE TWO LISTS ARE NOW IN DIFFERENT FILES. They were adjacent before; a future sibling has to be added to deploy_phases.sh AND deploy_install.sh. Each file says so in its header, but nothing enforces it, and the failure is silent: the file is staged and never installed.",
|
|
"UNVERIFIED ON DEVICE, and this is the script that performs the deploy itself. If it is broken, the recovery path is a manual adb push of the whole directory. It is also the highest-value target for a next-session on-device check, since a single real deploy would validate this and the five enforcer splits behind it at once."
|
|
],
|
|
"rollback": [
|
|
"git revert the commit. deploy.sh returns to a single 875-line file, over the cap, with both lists adjacent again.",
|
|
"After rollback, run timeout 30 bash phone_focus_mode/deploy.sh and confirm it prints the usage message, then bash -n phone_focus_mode/deploy.sh.",
|
|
"Nothing else sources the six siblings, so the revert is self-contained; delete any stale copies if one has already reached a device."
|
|
]
|
|
}
|