diff --git a/.copilotignore b/.copilotignore index 51bf53c3..b8c26092 100644 --- a/.copilotignore +++ b/.copilotignore @@ -104,7 +104,7 @@ __pycache__/ python_pkg/cinema_planner/pasted_content.txt # Large data files (exceed indexing limits) -linux_configuration/scripts/digital_wellbeing/pacman/words.txt +linux_configuration/digital_wellbeing/pacman/words.txt # C build artifacts **/*.out diff --git a/.github/skills/efficient-polling-scripts/SKILL.md b/.github/skills/efficient-polling-scripts/SKILL.md index 1ceb4b95..c8026d35 100644 --- a/.github/skills/efficient-polling-scripts/SKILL.md +++ b/.github/skills/efficient-polling-scripts/SKILL.md @@ -211,6 +211,6 @@ cached snapshot tools, some builds don't refresh them between calls. - `linux_configuration/i3-configuration/i3blocks/battery_status.sh` — zero-fork via `/sys/class/power_supply`. - `linux_configuration/i3-configuration/i3blocks/cpu_monitor.sh` — zero-fork via `/proc/loadavg` + `/sys/class/hwmon`. - `linux_configuration/i3-configuration/i3blocks/motherboard_temp.sh` — zero-fork via `/sys/class/hwmon`. -- `linux_configuration/scripts/system-maintenance/systemd/monitors.slice` — resource-cap slice. +- `linux_configuration/system-maintenance/systemd/monitors.slice` — resource-cap slice. - `phone_focus_mode/dns_enforcer.sh::chain_intact()`/`expected_rule_count()` — R9's hash/count-gate pattern, fixed 2026-07-03 after it was found pegging Android's `netd` at ~50% CPU. - `phone_focus_mode/hosts_enforcer.sh::sync_magisk_module` — the original hash-before-write pattern R9 mirrors. diff --git a/.github/skills/self-hosted-service-exposure/SKILL.md b/.github/skills/self-hosted-service-exposure/SKILL.md index da349a91..d574a6c1 100644 --- a/.github/skills/self-hosted-service-exposure/SKILL.md +++ b/.github/skills/self-hosted-service-exposure/SKILL.md @@ -13,7 +13,7 @@ description: Use BEFORE deploying any Docker-based self-hosted service on this m `setup_wireguard_ssh.sh`'s own `setup_duckdns()` also has a `duckdns_already_updated()` guard for this reason. **Do not add a second one.** - **The firewall is owned entirely by** - `linux_configuration/scripts/single_use/features/setup_wireguard_ssh.sh`. It + `linux_configuration/features/setup_wireguard_ssh.sh`. It regenerates `/etc/nftables.conf` from scratch on every `setup` run (`flush ruleset` + fixed heredoc). **Never hand-edit `/etc/nftables.conf` directly or from a second script** — the next `setup` re-run (e.g. adding a WireGuard peer) @@ -139,7 +139,7 @@ own startup, independent of `docker compose` ever being re-invoked. ## Reference implementation -`linux_configuration/scripts/single_use/features/setup_gitea.sh` and +`linux_configuration/features/setup_gitea.sh` and `migrate_github_to_gitea.sh` are working, idempotent examples of this whole pattern end to end (firewall, Caddy, headless bootstrap, host networking workaround, least-privilege external credential). Copy the shape, not diff --git a/.gitignore b/.gitignore index 62f4893d..9b4fbb00 100644 --- a/.gitignore +++ b/.gitignore @@ -373,15 +373,15 @@ out.txt # Locally built Arch packages. The PKGBUILD and installer script are the source # and stay tracked; the built artifact is a ~600 MB binary that must never be # committed (see memories/binary-files.md). -linux_configuration/scripts/single_use/*/*.pkg.tar.zst -linux_configuration/scripts/single_use/*/*.pkg.tar.xz +linux_configuration/*/*.pkg.tar.zst +linux_configuration/*/*.pkg.tar.xz # Wine/Bottles prefixes — local runtime state, not source. bottles/ # archwiki_rag local vector index: regenerated by `reindex`, machine-specific, # and full of binary sqlite/parquet blobs. -linux_configuration/scripts/periodic_background/digital_wellbeing/data/ +linux_configuration/periodic_background/digital_wellbeing/data/ # =========================================================================== # billsplit (Flutter) — launcher icons & platform assets MUST live in-repo diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f2963a81..b6d9ab05 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,9 +37,9 @@ repos: # chattr +i (self-commitment lock on the shutdown-enforcement # script) makes this file unwritable on purpose; the fixer hooks # can't open it for writing even as the owning user. - exclude: ^linux_configuration/scripts/periodic_background/digital_wellbeing/setup_midnight_shutdown\.sh$ + exclude: ^linux_configuration/periodic_background/digital_wellbeing/setup_midnight_shutdown\.sh$ - id: end-of-file-fixer - exclude: ^linux_configuration/scripts/periodic_background/digital_wellbeing/setup_midnight_shutdown\.sh$ + exclude: ^linux_configuration/periodic_background/digital_wellbeing/setup_midnight_shutdown\.sh$ - id: check-yaml args: [--unsafe] - id: check-json @@ -218,7 +218,7 @@ repos: (?x)^( Bash/.*| \.venv/.*| - linux_configuration/scripts/single_use/misc/testsAndMisc-bash/tools/.* + linux_configuration/misc/testsAndMisc-bash/tools/.* )$ additional_dependencies: - types-requests diff --git a/AGENTS.md b/AGENTS.md index 1dc396d5..b1fbfd01 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,7 +9,6 @@ Mixed-language monorepo: Python packages, Bash automation, and several apps. | `python_pkg/` | Python packages — every `.py` in the repo belongs here or in an allowlisted dir | | `meta/` | Repo-wide tooling: `pyproject.toml`, `requirements.txt`, `run.sh`, `lint_python.sh`, `.fvmrc`, `scripts/` | | `linux_configuration/` | Arch setup, i3 config, system maintenance, and the tracked git hooks | -| `billsplit/` | Receipt bill-splitting Flutter app (Dart) | | `bottles/` | Small standalone project | | `docs/` | Reference docs; `docs/superpowers/` holds AI workflow artifacts | | `third_party/` | Vendored upstream skills/agents | @@ -18,6 +17,14 @@ Root `pyproject.toml`, `requirements.txt`, `run.sh`, `lint_python.sh` and `.fvmrc` are **symlinks into `meta/`** — edit the files in `meta/`, not the symlinks. +`linux_configuration/` has no `scripts/` or `single_use/` level: those two were +pure taxonomy carrying no information, and the directory-depth cap does not +leave room for them. Categories sit directly under it — `features/`, `fixes/`, +`utils/`, `misc/`, `fresh-install/`, `installers/`, `diagnostics/`, `gaming/`, +`boot_recovery/`, `periodic_background/`, `lib/`, `meta/`, `tests/`. A script's +own `lib/` and `tests/` subdirectories are exempt from the cap, so those stay +where they are. + Extracted to their own repos: [`steam-backlog-enforcer`](https://github.com/kuhyx/steam-backlog-enforcer), [`screen-locker`](https://github.com/kuhyx/screen-locker), [`diet-guard`](https://github.com/kuhyx/diet-guard), @@ -38,18 +45,19 @@ Archived work: [`testsAndMisc-archive`](https://github.com/kuhyx/testsAndMisc-ar ## Adding a Flutter app -`billsplit/` is currently the only one, and the only place binaries are -committed. To add another, repeat **both** halves or the icons fail silently: +There is currently no Flutter app here — `billsplit/` was archived, and with it +the only committed binaries. Adding one means repeating **both** halves or the +icons fail silently: 1. Add the icon globs to `.binary-allowlist`. 2. Add matching `!` overrides at the end of `.gitignore` — an ignored file fails silently on `git add` rather than erroring. -Icons come from the shared generator in `python_pkg/app_icons/`. Dart style is -gated by CI only (`.github/workflows/billsplit-ci.yml`), not by a local hook. -Keep app dirs free of Python: the `check-python-location` hook requires every -`.py` to sit under `python_pkg/` (or `linux_configuration/`, `meta/scripts/`). `billsplit/`'s coverage gate therefore lives at -`python_pkg/billsplit_coverage/`. +Icons come from the shared generator in `python_pkg/app_icons/`. Dart style +needs its own CI workflow; there is no local hook for it. Keep app dirs free of +Python: the `check-python-location` hook requires every `.py` to sit under +`python_pkg/` (or `linux_configuration/`, `meta/scripts/`), so an app's coverage +gate lives in `python_pkg/`. ## Git Workflow diff --git a/NEXT_SESSION_PROMPT.md b/NEXT_SESSION_PROMPT.md index 468f90cf..b6bdfc65 100644 --- a/NEXT_SESSION_PROMPT.md +++ b/NEXT_SESSION_PROMPT.md @@ -32,7 +32,7 @@ branches, measured in a clean worktree. **File-length cap needs nothing:** 0 violations, hook-enforced. **What is left, if anyone wants it:** 8 directories still have no suite at all -(`.githooks/lib`, `scripts/meta/lib`, `mtk_root/lib`, `digital_wellbeing/{pacman, +(`.githooks/lib`, `meta/lib`, `mtk_root/lib`, `digital_wellbeing/{pacman, virtualbox}/lib`, `system-maintenance/bin/lib`, `single_use/{fresh-install,}/lib`) — 20 libs, ~1,980 lines. All are allowlisted, so nothing is blocked. This is optional work now, not a campaign. @@ -100,7 +100,7 @@ SP=$(mktemp -d); git worktree add --detach --quiet "$SP/co" HEAD time (cd "$SP/co" && SKIP=pytest-coverage pre-commit run --all-files) time (cd "$SP/co" && python meta/scripts/pytest_changed_packages.py) -time bash linux_configuration/scripts/single_use/fixes/lib/tests/run_all.sh +time bash linux_configuration/fixes/lib/tests/run_all.sh git worktree remove --force "$SP/co" ``` @@ -242,7 +242,7 @@ the shape before you spend it. ## The suite and its harnesses -`linux_configuration/scripts/single_use/fixes/lib/tests/` is the reference +`linux_configuration/fixes/lib/tests/` is the reference suite: **30 test files, 645 assertions, all green, zero suppressions, 37s.** Copy its shape. Layers: diff --git a/NEXT_SESSION_RESTRUCTURE.md b/NEXT_SESSION_RESTRUCTURE.md index 3779380d..aa068f85 100644 --- a/NEXT_SESSION_RESTRUCTURE.md +++ b/NEXT_SESSION_RESTRUCTURE.md @@ -15,7 +15,7 @@ patterns at all). **Extracted** to public repos, full history, each with CI it did not have here: `reverse-survivors`, `kcd2-dice-solver` (cloned to `~/kcd2-dice-solver`), `focus-owner`, `mtk-root` (took the four `mtk_*` libs and three suites that -lived in `scripts/lib/`). +lived in `lib/`). **Gates written, deliberately NOT wired**: `meta/scripts/check_directory_depth.sh` (cap 2; exempts `third_party/`, `docs/superpowers/`, `.github/skills/` by prefix @@ -29,7 +29,7 @@ Depth, tests and pre-commit verified green at every commit; nothing used - **Depth cap is 2**, with `lib/` and `tests/` exempt — so the ~118 single_use lib files stay put and step D only flattens entry scripts. - **`meta/` is in scope** for the cap. -- **`scripts/lib/common.sh` STAYS.** Measured: 55 consumers, 51 of which remain +- **`lib/common.sh` STAYS.** Measured: 55 consumers, 51 of which remain here. The `.githooks` use a _separate_ `common.sh`, so the ">2 units" rule selects nothing worth moving. Deviation from the original instruction, agreed after measurement. diff --git a/docs/explanations/2026-07-13-explanation-setup-syncyomi.html b/docs/explanations/2026-07-13-explanation-setup-syncyomi.html index 8bd95cec..5c895ea0 100644 --- a/docs/explanations/2026-07-13-explanation-setup-syncyomi.html +++ b/docs/explanations/2026-07-13-explanation-setup-syncyomi.html @@ -263,7 +263,7 @@ docker exec "${CADDY_CONTAINER}" caddy reload --config "${CADDYFILE_IN_CONTAINER
Generated by /explain-diff for commit 59430f9 · - linux_configuration/scripts/single_use/features/setup_syncyomi.sh + linux_configuration/features/setup_syncyomi.sh
diff --git a/docs/explanations/2026-07-17-explanation-night-lockdown.html b/docs/explanations/2026-07-17-explanation-night-lockdown.html index 25b17ac4..9c809467 100644 --- a/docs/explanations/2026-07-17-explanation-night-lockdown.html +++ b/docs/explanations/2026-07-17-explanation-night-lockdown.html @@ -116,7 +116,7 @@

Night lockdown: keeping the servers up through the curfew

-

How a self-discipline shutdown stopped killing seven services every night — and the four bugs that surfaced on the way there.
3ebb56c · 2026-07-17 · linux_configuration/scripts/periodic_background/digital_wellbeing/

+

How a self-discipline shutdown stopped killing seven services every night — and the four bugs that surfaced on the way there.
3ebb56c · 2026-07-17 · linux_configuration/periodic_background/digital_wellbeing/