mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 21:14:01 +01:00
linux_configuration/periodic_background/hosts/ is now github.com/kuhyx/hosts-blocker, cloned at ~/hosts-blocker. Clears 5 of the 46 directory-depth violations; the remaining 41 are all digital_wellbeing, so --warn stays on the depth hook until that unit moves too. History was filtered across ALL FOUR paths the unit has lived at (hosts/, linux_configuration/hosts/, linux_configuration/scripts/periodic_background/ hosts/, and the current one). Filtering on the current path alone would have preserved 1 commit out of 51 -- the flatten moved it recently, so a naive single --path silently truncates the history to the flatten commit and still looks fine in `git log | head`. No source line changed: all 15 files are byte-identical to the copies removed here. install.sh already resolved its lib/ via BASH_SOURCE. The six callers now resolve the checkout through a new shared helper, linux_configuration/lib/extracted_repos.sh, which reads the invoking user's home from SUDO_USER's passwd entry rather than $HOME -- several of these scripts re-exec under sudo, where $HOME is /root. A missing checkout fails loudly with a clone instruction; it is never a silent skip, which is the failure mode that left screen-locker's self-repair dead for five months after the 2026-05-15 reorg. The live blocker is untouched: /etc/hosts keeps its chattr +i, and the guards load their plugins from /usr/local/share/guard-lib-plugins/ (byte-identical by md5), not from a repo path. Verified: 25 tests pass from ~/hosts-blocker; shellcheck clean on the helper and all six callers; sudo resolution prints /home/kuhy/hosts-blocker; test_setup_dns_blocker.sh passes; report_live_state.sh --check is byte-identical before and after, so no new stale references. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PJrqKERAo5QUeEHWS5Asgp
25 lines
2.6 KiB
JSON
25 lines
2.6 KiB
JSON
{
|
|
"title": "Extract the hosts blocker into its own repo and repoint its six monorepo callers",
|
|
"objective": "Move linux_configuration/periodic_background/hosts/ to github.com/kuhyx/hosts-blocker with full history, clearing 5 of 46 directory-depth violations, without changing a single source line or disturbing the live /etc/hosts guards.",
|
|
"acceptance_criteria": [
|
|
"The extracted repo's history spans all four paths the unit has lived at, not just the current one — 52 commits, reaching the original 'block websites uising etc hosts'.",
|
|
"Every extracted source file is byte-identical to its monorepo copy (diff -r reports no differences).",
|
|
"lib/tests/run_all.sh passes from ~/hosts-blocker, the real clone location, with 25 assertions.",
|
|
"All six monorepo callers resolve to /home/kuhy/hosts-blocker, including under sudo, where $HOME would be /root.",
|
|
"A missing checkout fails loudly with a clone instruction and a non-zero return — never a silent skip.",
|
|
"check_directory_depth.sh --all reports 41 violations, all of them digital_wellbeing.",
|
|
"report_live_state.sh --check output is byte-identical before and after: no new stale references.",
|
|
"The installed guard plugins under /usr/local/share/guard-lib-plugins/ remain byte-identical to the extracted copies.",
|
|
"No lint suppression (shellcheck disable, noqa, per-file ignore) is added anywhere."
|
|
],
|
|
"out_of_scope": [
|
|
"Extracting digital_wellbeing (41 violations) — the next, harder unit.",
|
|
"Removing --warn from the directory-depth-cap hook, which is only valid once BOTH units are out.",
|
|
"Reformatting guard/plugins/*.sh with shfmt; they are unformatted in the monorepo too and their installed copies must stay identical.",
|
|
"Re-running the hosts installer or otherwise touching the live /etc/hosts, its chattr flags, or the running guards.",
|
|
"Fixing the 8 pre-existing stale live-state references — a separate commit after both extractions.",
|
|
"Deleting .hippo/ or the untracked extraction residue — separate commits."
|
|
],
|
|
"verifier": "diff -r --exclude=.git between the monorepo unit and the extracted repo reports IDENTICAL; ~/hosts-blocker/lib/tests/run_all.sh exits 0 with 25 passed; pre-commit run --all-files --hook-stage pre-push in the extracted repo passes with no file modified; shellcheck is clean on the helper and all six callers; sudo -n resolution prints /home/kuhy/hosts-blocker; HOSTS_BLOCKER_DIR=/nonexistent require_extracted_repo returns 1 with a clone instruction; check_directory_depth.sh --all reports 41; diff of report_live_state.sh --check before/after is empty."
|
|
}
|