Commit Graph

8 Commits

Author SHA1 Message Date
0c1e395008 Split modules, fix tests, fix pre-commit batching
- steam_backlog_enforcer: extract _hltb_search.py and _scanning_confidence.py;
  split oversized test files into *_part2/3/4.py
- screen_locker: extract _early_bird.py and _window_setup.py from screen_lock.py;
  fix patch targets in tests (screen_lock.* -> _window_setup.*)
- wake_alarm: use shutil.which('xset') to avoid S607; add TestDisplayHelpers tests
- linux_configuration/usage_report: split into _parsing.py and _types.py;
  add bin/__init__.py (INP001); fix RUF002 (× -> x)
- pre-commit: add require_serial: true to pytest-coverage hook to prevent
  file batching across 24 CPU cores (was causing 12 parallel partial-coverage runs)
2026-05-22 22:48:28 +02:00
42a66a1419 refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/
- Move all linux_configuration scripts into two semantic categories:
  - single_use/: scripts run once manually (fresh install, fixes, setup)
  - periodic_background/: scripts run by systemd timers or daemons
- Preserve existing subdirectory structure within each category
- Fix lib/common.sh source paths for new directory depths
- Fix CONFIG_DIR depth in setup_periodic_system.sh and check_and_enable_services.sh
- Update all references in tests, fresh-install/main.sh, nix modules, and docs
- Fix check_polling_antipatterns.sh false positives (||, regex |, case patterns, jq strings)
- Fix pre-existing mypy exclusion path and type annotations for moved tools/ directory
- Rewrite check_polling_antipatterns.sh using awk (no bash regex loops); add require_serial: true
2026-05-15 00:32:35 +02:00
c23eb4d1a9 perf(pre-commit): batch+parallelize pytest on commit; kill 15s sleeps in steam_backlog_enforcer tests
- meta/.pre-commit-config.yaml: move pytest-coverage hook to pre-commit stage
- scripts/pytest_changed_packages.py: single batched pytest -n auto invocation
  with one --cov flag per affected python_pkg subpackage, wrapped in
  systemd-run --user --scope -p MemoryMax=4G -p MemorySwapMax=0 when available
- python_pkg/steam_backlog_enforcer/tests/conftest.py: new autouse
  _no_real_sleep fixture patches time.sleep across game_install /
  library_hider / steam_api / _enforce_loop. Removes 3x 15s real sleeps
  in TestFinalizeCompletion that fired through _ensure_steam_running

steam_backlog_enforcer test wall time: 33.97s -> 5.61s (xdist, no-cov)
5-package batched run: 732 tests in 1.37s @ 668% CPU
Coverage stays at 100% on all affected packages.

Evidence: docs/superpowers/evidence/pre-commit-pytest-batch-2026-05-14.json
2026-05-14 21:52:52 +02:00
d759313745 perf(pre-commit): default_stages=[pre-commit] so push only runs pytest+prettier
All hooks without an explicit stage are now commit-only. Pre-push
surface shrinks to pytest-coverage (scoped) and prettier (scoped+
isolated). Force-pushing already-audited history no longer re-scans the
divergent file diff with codespell/shellcheck/secrets/etc.
2026-05-14 21:21:40 +02:00
5f023afe96 perf(pre-commit): move mypy/pylint/bandit from pre-push to pre-commit
Heaviest hooks now run on tiny per-commit staged diffs instead of the
full force-push diff. After the recent filter-repo history rewrite,
origin/main shares no ancestor with local main, so pre-push was feeding
mypy/pylint/bandit ~every .py file in the repo, OOM-killing inside the
4 GiB cgroup. Per-commit cost: ~5-10 s on Python edits. Pre-push now
only runs pytest-coverage (scoped) and prettier (scoped+isolated).
2026-05-14 21:20:21 +02:00
dffbdac091 perf(pre-commit): run prettier in its own systemd-run scope
Wrap pre-push prettier --check in a 1 GiB systemd-run scope so its Node
heap is independent of the outer 4 GiB pre-push cgroup, which has
already accumulated page-cache footprint from pytest/mypy/pylint/bandit
by the time prettier runs. Falls back to direct invocation when
systemd-run is unavailable.
2026-05-14 21:12:32 +02:00
7ddab620bc perf(pre-commit): tighten prettier scope to fit in pre-push cgroup
Expand prettier exclude to skip vendored agent-skills mirrors,
big superpowers plan/spec docs, and the linux_configuration jscpd
report. Cuts the pre-push file count 143 -> 75, keeping Node heap
well under the 4 GB systemd-run MemoryMax that wraps pre-push.
2026-05-14 21:09:14 +02:00
89b4f59ce9 chore: consolidate root configs into meta/, drop unused C dir + split/pdfCentered/geo_data
- Move pyproject.toml, .pre-commit-config.yaml, requirements.txt, run.sh,
  lint_python.sh, .fvmrc into meta/ with root symlinks preserving tool
  auto-discovery.
- Combine requirements.txt + requirements-dev.txt into meta/requirements.txt
  (single sorted source of truth).
- Remove setup.sh, .binary-allowlist, C/ (no native code remains),
  python_pkg/{split,pdfCentered,geo_data}, scripts/check_c_cpp_build_files.sh.
- Drop clang-format/cppcheck/flawfinder/check-c-cpp-build-files hooks and
  archived path excludes from pre-commit config.
- Add .secret-patterns to .gitignore and untrack it (sensitive content;
  full history purge is a follow-up step).
2026-05-14 20:40:12 +02:00