Each package subprocess now writes to its own tmpfile via COVERAGE_FILE env.
This prevents sequential subprocess runs from stomping on the .coverage SQLite
DB that the prior run left behind, which caused INTERNALERROR when pytest-cov
tried to combine() parallel data files with incompatible schemas.
Parallel cgroup subprocesses racing on the same .coverage SQLite DB caused
INTERNALERROR (no such table: meta/arc) when combining coverage data files.
Delete all .coverage* files before each package run to prevent corruption.
Each pytest package runs in its own systemd-run scope with:
- MemoryMax=2G per package (nested inside the 4GB parent cgroup)
- MemorySwapMax=0 to prevent zram thrashing (the real cause of freezes)
- gc.collect() between packages to free Python heap
- Set oom_score_adj=1000 in git hooks so OOM killer targets
pre-commit first, never crashing the PC
- Cap Node.js heap to 512MB for eslint/prettier/vitest
- Remove broken systemd-run cgroup wrapper (didn't work)
- cppcheck: process files one-at-a-time, --check-level=normal
- pytest: run packages sequentially in separate subprocesses
- Remove --force from cppcheck (exponential memory on #ifdef combos)
systemd-run --scope -p MemoryMax=3G per pytest subprocess so each
package gets its own memory cap, freed completely before the next.
Also use shutil.which + pathlib per ruff rules.
Each python_pkg subpackage now runs in its own pytest subprocess so
memory is freed between packages. Prevents 4GB+ accumulation when
matplotlib, geopandas, pygame, etc. all load in a single process.
- scripts/optimize_vscode.py: auto-detect hardware (CPU, RAM, GPU, disk)
and apply optimal VS Code settings and Electron GPU flags
- scripts/pytest_changed_packages.py: pre-commit hook that runs pytest
only for python_pkg subpackages with changed files
- .pre-commit-config.yaml: use new selective pytest hook
- scripts/check_python_location.sh: allow scripts/ directory
Layer 1: Pre-commit hook (scripts/check_no_binaries.sh) blocks 60+
binary/image extensions with .binary-allowlist for build-essential exceptions.
Layer 2: Comprehensive .gitignore binary patterns with ! overrides
for allowlisted files (app icons).
Layer 3: Agent exclusions - .copilotignore, files.exclude, and
search.exclude all mirror the same patterns to prevent Copilot
from hitting the 20-image URL limit.
- Move puzzle_solver/, poker_modifier_app/, articles/, tests/ into python_pkg/
- Move moviepy_showcase.py and _moviepy_*.py into python_pkg/moviepy_showcase/
- Update all imports to use python_pkg. prefix
- Update pyproject.toml per-file-ignores and pytest testpaths
- Add pre-commit hook to enforce Python files under python_pkg/