From b50b146dad24cb42aa1ff45dc4bd83fd027bbc62 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sun, 23 Aug 2026 17:44:10 +0200 Subject: [PATCH] report_live_state: also scan installed scripts under /usr/local Found while surveying system-maintenance: /usr/local/bin holds copies that hardcode repo paths, and no section of the inventory looked there. The installed copy is what actually runs, so grepping the repo for its own paths never finds them. Three were invisible until now: periodic-system-maintenance.sh 3 paths into digital_wellbeing + hosts hosts-file-monitor.sh 1 path into hosts wsg-grabber PYTHONPATH into the repo root The first runs hourly, which means the two subsystem extractions coming next have to reinstall it -- editing the repo copy alone would leave the live one pointing at a directory that no longer exists. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01PJrqKERAo5QUeEHWS5Asgp --- docs/restructure-live-state.md | 74 ++++++------------- ...ve-state-installed-scripts-2026-08-23.json | 37 ++++++++++ meta/scripts/report_live_state.sh | 19 +++++ 3 files changed, 80 insertions(+), 50 deletions(-) create mode 100644 docs/superpowers/evidence/live-state-installed-scripts-2026-08-23.json diff --git a/docs/restructure-live-state.md b/docs/restructure-live-state.md index b3bafc48..92eebd8a 100644 --- a/docs/restructure-live-state.md +++ b/docs/restructure-live-state.md @@ -1,13 +1,19 @@ # Live state pointing into testsAndMisc -Generated by `meta/scripts/report_live_state.sh` at 2026-08-23T16:56:34+02:00. -Baseline commit: f4535b6b +Generated by `meta/scripts/report_live_state.sh` at 2026-08-23T17:43:44+02:00. +Commit: 6b5fe8e7 This is the checklist for the repo restructure. Every entry below names an absolute path inside this repo; when that path moves, the referring file must be repointed in the same step. Re-run the script with `--check` after each move to prove nothing was left behind. +The "installed scripts" section was added after `/usr/local/bin/` +copies were found naming repo paths. Those are the easiest references to +miss: the installed copy is what actually runs, so grepping the repo for +its own paths never finds them, and a stale one fails at whatever hour +its timer next fires. + ``` ## systemd units /etc/systemd/system/dns-blocklist-refresh.service @@ -18,9 +24,6 @@ file must be repointed in the same step. Re-run the script with 3:Documentation=file:///home/kuhy/testsAndMisc/endurain/README.md 11:WorkingDirectory=/home/kuhy/testsAndMisc 21:ExecStart=/usr/bin/bash -c 'ENDURAIN_API_KEY="$(cat /home/kuhy/testsAndMisc/endurain/.api_key)" /home/kuhy/testsAndMisc/.venv/bin/python -m python_pkg.endurain_import' - /home/kuhy/.config/systemd/user/kcd2-dice-build.service - 7:WorkingDirectory=/home/kuhy/testsAndMisc/kcd2_dice_solver - 8:ExecStart=/home/kuhy/testsAndMisc/kcd2_dice_solver/deploy_build.sh /home/kuhy/.config/systemd/user/morning-routine.service 13:Environment=PYTHONPATH=%h/testsAndMisc 16:WorkingDirectory=%h/testsAndMisc @@ -34,6 +37,16 @@ file must be repointed in the same step. Re-run the script with /etc/guard-lib/targets/resolved.conf 4:PLUGIN="/home/kuhy/testsAndMisc/linux_configuration/scripts/periodic_background/hosts/guard/plugins/resolved-plugin.sh" +## installed scripts referencing the repo + /usr/local/bin/hosts-file-monitor.sh + 10:HOSTS_INSTALL_SCRIPT="/home/kuhy/testsAndMisc/linux_configuration/scripts/periodic_background/hosts/install.sh" + /usr/local/bin/periodic-system-maintenance.sh + 26:PACMAN_WRAPPER_INSTALL="/home/kuhy/testsAndMisc/linux_configuration/scripts/periodic_background/digital_wellbeing/pacman/install_pacman_wrapper.sh" + 27:MAKEPKG_WRAPPER_INSTALL="/home/kuhy/testsAndMisc/linux_configuration/scripts/periodic_background/digital_wellbeing/pacman/install_makepkg_wrapper.sh" + 28:HOSTS_INSTALL_SCRIPT="/home/kuhy/testsAndMisc/linux_configuration/scripts/periodic_background/hosts/install.sh" + /usr/local/bin/wsg-grabber + 4:export PYTHONPATH="/home/kuhy/testsAndMisc${PYTHONPATH:+:$PYTHONPATH}" + ## symlinks into the repo /home/kuhy/.config/i3blocks/claude_usage.sh -> /home/kuhy/testsAndMisc/linux_configuration/scripts/periodic_background/i3-configuration/i3blocks/claude_usage.sh /home/kuhy/.config/i3blocks/config -> /home/kuhy/testsAndMisc/linux_configuration/scripts/periodic_background/i3-configuration/i3blocks/config @@ -56,49 +69,10 @@ file must be repointed in the same step. Re-run the script with /home/kuhy/.oh-my-zsh/custom/token-savers.zsh -> /home/kuhy/testsAndMisc/linux_configuration/zsh/token-savers.zsh ``` -## Depth-cap dry run (step 0) +## Depth-cap progress -`meta/scripts/check_directory_depth.sh --all` at baseline: - -| Bucket | Files | -| --------------------------------------- | ------- | -| Total violations | 556 | -| Disappear with the archives/extractions | 349 | -| **Remain — the step D worklist** | **207** | - -Step D worklist by directory: - -``` - 36 linux_configuration/scripts/single_use/utils - 24 linux_configuration/scripts/single_use/features - 18 linux_configuration/scripts/single_use/misc/testsAndMisc-bash - 17 linux_configuration/scripts/single_use/fixes - 14 linux_configuration/scripts/single_use/fresh-install - 13 linux_configuration/scripts/periodic_background/i3-configuration/i3blocks - 10 linux_configuration/scripts/single_use/misc/testsAndMisc-bash/tools - 9 linux_configuration/C/atop_agg - 7 python_pkg/artgate/routes - 6 meta/scripts/fixtures/mutations - 6 meta/scripts/fixtures - 6 linux_configuration/scripts/single_use - 6 linux_configuration/docs/security-hardening - 5 linux_configuration/dwm/bin - 3 python_pkg/artgate/styles - 3 linux_configuration/scripts/diagnostics - 3 linux_configuration/scripts/boot_recovery - 2 linux_configuration/scripts/single_use/features/systemd - 2 linux_configuration/scripts/periodic_background/i3-configuration - 2 linux_configuration/scripts/periodic_background - 2 linux_configuration/scripts/gaming - 2 linux_configuration/scripts/boot_recovery/hooks - 2 linux_configuration/dwm/patches - 1 meta/scripts/run_all - 1 linux_configuration/zsh/scratchpad - 1 linux_configuration/scripts/single_use/utils/data - 1 linux_configuration/scripts/single_use/misc/testsAndMisc-bash/.vscode - 1 linux_configuration/scripts/single_use/feedback-appimage - 1 linux_configuration/scripts/periodic_background/i3-configuration/i3 - 1 linux_configuration/scripts/meta - 1 linux_configuration/.github/workflows - 1 linux_configuration/docs/pacman-wrapper -``` +| Bucket | Files | +| ---------------------------------------- | ------- | +| Violations now | 294 | +| Disappear with the remaining extractions | 87 | +| **Remain — the step D worklist** | **207** | diff --git a/docs/superpowers/evidence/live-state-installed-scripts-2026-08-23.json b/docs/superpowers/evidence/live-state-installed-scripts-2026-08-23.json new file mode 100644 index 00000000..24023009 --- /dev/null +++ b/docs/superpowers/evidence/live-state-installed-scripts-2026-08-23.json @@ -0,0 +1,37 @@ +{ + "intent": "Close a gap in the live-state inventory: scripts installed under /usr/local that hardcode repo paths were invisible to the checklist the restructure relies on.", + "scope": [ + "meta/scripts/report_live_state.sh - new report_installed section scanning /usr/local/bin and /usr/local/lib", + "docs/restructure-live-state.md - regenerated", + "Non-goal: repointing the references it found; each travels with its own subsystem extraction" + ], + "changes": [ + "Added report_installed(), which greps /usr/local/bin and /usr/local/lib for the repo path and prints each hit with line numbers, matching the existing sections' shape and feeding the same --check exit code.", + "Regenerated the inventory doc and folded in current depth-cap progress." + ], + "verification": [ + { + "command": "./meta/scripts/report_live_state.sh", + "result": "pass", + "evidence": "Found 3 installed scripts naming repo paths that no prior section reported: /usr/local/bin/periodic-system-maintenance.sh (3 paths into digital_wellbeing and hosts), /usr/local/bin/hosts-file-monitor.sh (1 into hosts), /usr/local/bin/wsg-grabber (PYTHONPATH into the repo root)." + }, + { + "command": "./meta/scripts/report_live_state.sh --check; echo $?", + "result": "pass", + "evidence": "Exit 1, correct while references remain; the new section participates in the same aggregate." + }, + { + "command": "shellcheck meta/scripts/report_live_state.sh", + "result": "pass", + "evidence": "Clean, no findings at any severity." + } + ], + "risks": [ + "The scan covers /usr/local/bin and /usr/local/lib. A reference installed elsewhere on PATH would still be missed; those two are where this machine's installers write.", + "periodic-system-maintenance.sh runs hourly and names install scripts in two subsystems that are about to move, so those extractions must reinstall it rather than only editing the repo copy." + ], + "rollback": [ + "git revert; the section is additive and nothing depends on its output yet.", + "Re-run report_live_state.sh to confirm the remaining sections still report." + ] +} diff --git a/meta/scripts/report_live_state.sh b/meta/scripts/report_live_state.sh index 5b6ab93b..b3483e9e 100755 --- a/meta/scripts/report_live_state.sh +++ b/meta/scripts/report_live_state.sh @@ -63,6 +63,23 @@ report_etc() { return "$found" } +# Scripts INSTALLED outside the repo that name a path inside it. These are the +# easiest references to miss: the copy under /usr/local/bin is what actually +# runs, so grepping the repo for its own paths never finds them, and a stale +# one fails at whatever hour its timer next fires. +report_installed() { + echo "## installed scripts referencing the repo" + local found=0 path + while IFS= read -r path; do + [[ -n "$path" ]] || continue + found=1 + printf ' %s\n' "$path" + grep -n "$REPO" "$path" 2>/dev/null | sed 's/^/ /' + done < <(grep -rl "$REPO" /usr/local/bin /usr/local/lib 2>/dev/null | sort) + ((found)) || echo " (none)" + return "$found" +} + # Symlinks anywhere in $HOME resolving into the repo: i3blocks, ~/.local/bin, # oh-my-zsh custom. Depth 4 covers every known location without walking the # whole home directory. @@ -86,6 +103,8 @@ main() { echo report_etc || any=1 echo + report_installed || any=1 + echo report_symlinks || any=1 if ((CHECK_ONLY)); then