Commit Graph

588 Commits

Author SHA1 Message Date
09d8088865 feat(horatio): add step caching to run.sh with -f force flag
Each pipeline step computes a sha256 over its relevant source files and
skips re-execution when the hash matches the cached value. A .cache/
directory under horatio/ stores the per-step hashes.

Cache boundaries:
- *_get: pubspec.yaml
- core_format/analyze/test: all *.dart in horatio_core/
- app_analyze: all *.dart + analysis_options.yaml in horatio_app/
- app_test/dead_code: all *.dart in both packages

Use -f or --force to bypass the cache and re-run everything.

Also fixes:
- shellcheck SC2155 in run.sh and dead_code.sh
- codespell typo (thats -> that's) in planner_test.dart
2026-03-29 14:49:48 +02:00
da9727a21d feat(horatio): add Horatio actor script memorization app
Two-package monorepo:
- horatio_core: pure Dart package (parser, SRS, planner)
- horatio_app: Flutter UI (Bloc/Cubit, GoRouter, TTS)

Features:
- Script import (txt, docx, pdf) with drag-and-drop
- Four script format parsers (colon, bracketed, parenthetical, screenplay)
- SM-2 spaced repetition for line memorization
- Rehearsal mode with TTS and line comparison
- 5 bundled public domain scripts

Quality:
- 83 core tests + 160 app tests, both 100% branch coverage
- Strict analysis (130+ lint rules, fatal-infos)
- Dead code detection script (dead_code.sh)
- run.sh pipeline: analyze, test, dead-code, run, web
- Pre-commit hook for horatio test coverage
2026-03-29 14:44:57 +02:00
66949a25d3 feat: periodic system installation 2026-03-28 14:38:32 +01:00
ea829c596e fix: reduce phone penalty to 100s, fix shutdown guard race condition
- PHONE_PENALTY_DELAY_PRODUCTION: 600 → 100 seconds
- adjust_shutdown_schedule.sh: write canonical copy before watched config
  to prevent shutdown-schedule-guard.path from restoring stale values
2026-03-27 16:13:58 +01:00
ccb40ae635 fix: phone focus mode daemon survival across reboots
- Fix PID reuse bug: validate /proc/cmdline before assuming daemon is running
- Add log rotation using existing LOG_MAX_LINES config (was 7MB/70K lines)
- chmod 666 state files on init and deploy to prevent permission drift
2026-03-27 16:04:50 +01:00
ead6072eee refactor: remove manual workout forms, ADB-only verification + sick mode
- Remove _workout_forms.py and all manual running/strength workout forms
- Verification is now ADB-only: phone check → verified (unlock) | failed (retry + sick mode)
- Add systemd timer (workout-locker.timer) for periodic 15min checks
- Fix service unit: add PYTHONPATH, WorkingDirectory, use -m invocation
- Update install/remove scripts for timer support
- Remove form-related constants, tests, and conftest helpers
- 127 tests, 100% branch coverage maintained
2026-03-27 15:54:01 +01:00
0462565d99 Add VS Code auto-optimizer and selective pytest pre-commit hook
- 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
2026-03-25 21:56:37 +01:00
833c5755e8 fix: prevent tests from touching real Steam files
Tests for pick_next_game were calling uninstall_other_games and
state.save against real filesystem paths, deleting installed games
and overwriting the user's state.json whenever tests or pre-commit
ran.

- Add conftest.py safety net that redirects STEAMAPPS_PATH,
  CONFIG_DIR, STATE_FILE, SNAPSHOT_FILE, CONFIG_FILE, and
  HOSTS_FILE to tmp_path in all steam_backlog_enforcer tests
- Add missing uninstall_other_games mock to 4 tests in
  test_scanning.py (test_picks_shortest, test_skips_finished,
  test_unknown_hours, test_picks_game_no_hours)
2026-03-25 21:15:40 +01:00
16c6b207e6 Add defense-in-depth binary file protection system
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.
2026-03-25 21:09:03 +01:00
c444f0451a Remove tracked binary files and add aggressive Copilot exclusions
- git rm 146 tracked PNG images from praca_magisterska_video/images/
- git rm 1 tracked .apkg from anki_decks/warsaw_districts/
- Add *.apkg and praca_magisterska_video/images/ to .gitignore
- Update .copilotignore with ** recursive patterns for all binary types
- Add files.exclude and search.exclude in .vscode/settings.json
- All binary files preserved in ../testsAndMisc_binaries/
2026-03-25 20:59:47 +01:00
2b07333b60 fix(steam_backlog_enforcer): prevent enforce daemon from deleting assigned game
- Guard enforce_allowed_game() and _guard_installed_games() against
  current_app_id=None so they never treat all games as unauthorized
- Add early return in _enforce_loop_iteration when no game is assigned
- Wrap State.load() in enforce loop with error handling for corrupt files
- Switch all config/cache file writes to atomic (tmpfile + rename)
- Add robust error handling to State.load() for corrupt JSON
- Update tests for new behavior and add coverage for atomic writes
2026-03-25 19:19:52 +01:00
c71591ebc4 chore: more comprehensive copilot ignore 2026-03-25 19:18:58 +01:00
c8e2edd533 feat: copilot ignore apkg files 2026-03-25 19:17:32 +01:00
ee27d10fef Reduce per-file-ignores by fixing lint violations across codebase
Fix ruff violations in ~15 source files and ~60+ test files to minimize
per-file-ignores in pyproject.toml. Remaining ignores are justified with
comments explaining why each suppression is necessary.

Source fixes: FBT003 (keyword args), S310 (URL validation), SLF001
(private access), T201 (print→logging), C901 (complexity), E501 (line
length), E402 (import order).

Test fixes: SIM117 (combined with), FBT (boolean args), PERF203 (try in
loop), S310/S607 (URLs/executables), E402/E501 (imports/lines), S108
(tmp paths), PLR0913 (too many args), ARG (unused args), ANN (type
annotations), RUF059 (unused unpacked vars), PT019 (fixture naming).

Remaining per-file-ignores (with justifications):
- Tests: ARG, D, PLC0415, PLR2004, S101, SLF001
- music_gen sources: PLC0415 (heavy ML lazy imports)
- moviepy_showcase: PLC0415 (circular dependency)
- generate_images: PLR0913 (matplotlib helpers need many params)
- praca_magisterska_video: E501, E402 (long paths, mpl.use)
2026-03-25 18:58:05 +01:00
2545d72710 test: achieve 100% branch coverage across all python_pkg packages
- Add comprehensive tests for all packages (3572 tests, 100% branch coverage)
- Split oversized test files to stay under 500-line limit
- Add per-file ruff ignores for test-appropriate suppressions
- Fix _cache_decks.py to properly convert JSON lists to tuples
- Add session-scoped conftest fixture for logging handler cleanup (Python 3.14)
- Update ruff pre-commit hook to v0.15.2
- Add codespell ignore words for test data
- Add generated output files to .gitignore
2026-03-21 17:51:36 +01:00
72c6c3788c refactor: move Python packages under python_pkg/
- 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/
2026-03-18 22:54:45 +01:00
21b7b8107b fix: resolve all pre-commit hook failures after file splits
- Remove all # type: ignore and # noqa comments (banned by no-noqa hook)
- Add mypy --disable-error-code flags to pre-commit config for error
  codes previously suppressed by inline comments
- Fix broken imports after ruff auto-removed re-exports:
  steam_backlog_enforcer, stockfish_analysis, word_frequency, lichess_bot
- Re-add re-exports with __all__ in translator.py, screen_lock.py
- Split _process_epc_fc.py (524 lines) into _process_epc_fc.py + _process_fc.py
- Fix test failures: keyboard_coop, stockfish_analysis, tag_divider
- Add per-file-ignores for PLC0415 (deferred imports) in 7 files
- Mark shebang scripts as executable
- Add __init__.py for generate_images and repo_explorer packages
- Fix codespell, eslint, ruff-format, prettier issues
- Update copilot-instructions.md with --no-verify ban
2026-03-18 22:20:05 +01:00
50fd6812d7 refactor: enforce 500-line limit on all Python source files
Split 18+ Python files that exceeded 500 lines into smaller modules
with helper files (prefixed with _). All functions are re-exported
from the original modules to maintain backward compatibility with
test patches and external imports.

Files split:
- moviepy_showcase.py (1212 -> 302 + 3 helpers)
- anki_generator.py (1174 -> 473 + 4 helpers)
- test_analyze_chess_game.py (1152 -> 361 + 2 parts)
- poker_modifier_app.py (1024 -> 263 + 2 helpers)
- transcribe_fw.py (1007 -> 342 + 3 helpers)
- music_generator.py (1002 -> 319 + 2 helpers)
- translator.py (951 -> 442 + 2 helpers)
- cinema_planner.py (893 -> 369 + 2 helpers)
- lichess_bot/main.py (757 -> 495 + _game_logic.py)
- test_translator.py (725 -> 289 + part2 + conftest)
- test_lichess_api.py (680 -> 475 + part2)
- learning_pipe.py (668 -> 375 + 2 helpers)
- cache.py (655 -> 360 + _cache_decks.py)
- analyze_chess_game.py (632 -> 463 + _move_analysis.py)
- visualize_q02.py (609 -> 371 + helper)
- repo_explorer.py (602 -> 347 + 2 helpers)
- keyboard_coop/main.py (515 -> 416 + _dictionary.py)
- scanning.py (501 -> 314 + _enforce_loop.py)

All tests pass: 144 lichess_bot (100% branch coverage), 243 others.
No new lint errors introduced.
2026-03-17 22:47:42 +01:00
c4225496d3 fix(steam_backlog_enforcer): reload state in enforce loop, use steam:// protocol for installs
The enforce daemon loaded state once at startup and never reloaded it.
When the CLI reassigned a game (e.g. via 'done'), the daemon kept
enforcing the old assignment and deleted the newly assigned game every
3 seconds as 'unauthorized'.

Fix: reload state from disk at the top of each enforce loop iteration
so CLI changes take effect within one cycle.

Also add steam://install protocol handler for interactive installs
(via xdg-open) so Steam determines the correct installdir from its
own metadata, avoiding 'Missing game executable' errors from guessed
directory names in fabricated appmanifests.
2026-03-17 21:48:33 +01:00
c985160d17 WIP: Enforce 500-line limit - split batch 1
Split 16+ files. 27 files still need splitting. See session notes.
2026-03-16 22:46:48 +01:00
e51c12dd8e feat: puzzle solver algorithm 2026-03-16 19:49:52 +01:00
8998883a6c feat: add auto-close suspension for digital wellbeing
Add is_autoclose_suspended() function that checks for a per-app
suspend file dated today. When suspended, launches the app directly
without the auto-close timer via exec.
2026-03-15 19:15:38 +01:00
11a5574011 feat: add per-app timeout overrides for digital wellbeing
Allow specific apps (beeper, signal-desktop) to have longer
auto-close timeouts (20min) than the default (10min).
2026-03-14 17:52:38 +01:00
a82dfaa79f chore: update pyproject.toml per-file-ignores
- Remove per-file-ignores for cinema_planner, word_frequency, linux_configuration
- Add PT019 to test file ignores
- Add S310 for geo_data.py and library_hider.py (urlopen with validated schemes)
- Add PLC0415 for brother_printer (optional pyusb imports)
- Remove BLE001 ignores (all blind exceptions now fixed)
2026-03-14 17:52:20 +01:00
e7d2ecabb1 fix: resolve remaining ruff violations (FURB110, PLC0207)
- generate_blunder_tests.py: use 'or' instead of ternary (FURB110)
- music_generator.py: use 'or' instead of ternary (FURB110), fix type: ignore
- random_digits.py: use rsplit with maxsplit instead of split (PLC0207)
2026-03-14 17:51:55 +01:00
a77fd7f0fd refactor(praca/generate_images): fix ruff violations in generate_q23_diagrams.py 2026-03-14 17:47:32 +01:00
fe3cba03cd refactor(praca/generate_images): fix ruff violations in generate_process_diagrams.py 2026-03-14 17:28:21 +01:00
21d501bed4 refactor(praca/generate_images): fix ruff violations in generate_q24_diagrams.py 2026-03-14 17:15:35 +01:00
183f9bbc19 refactor(praca/generate_images): fix ruff violations in generate_arch_diagrams.py 2026-03-14 17:07:01 +01:00
21781d547e refactor(praca/generate_images): fix ruff violations in generate_q9_q12_diagrams.py 2026-03-14 16:38:10 +01:00
33f5c957df refactor(praca/generate_images): fix ruff violations in generate_q9_all_diagrams.py 2026-03-14 16:28:34 +01:00
9b4e9722f0 refactor(praca/generate_images): fix ruff violations in generate_study_diagrams.py 2026-03-14 16:19:59 +01:00
1721275423 refactor(praca/generate_images): fix ruff violations in generate_q20_diagrams.py 2026-03-14 16:04:14 +01:00
9041e87d32 refactor(praca/generate_images): fix ruff violations in generate_scheduling_diagrams.py 2026-03-14 15:51:02 +01:00
7c47befe04 refactor(praca/generate_images): fix ruff violations in diagram generators batch 1 2026-03-14 14:29:54 +01:00
03409b6839 refactor(praca): fix ruff violations in visualize scripts 2026-03-14 14:29:18 +01:00
d488c87203 refactor(praca_magisterska_video): fix ruff violations and remove noqa from diagram generators
- Add type annotations, docstrings, and constants
- Remove commented-out code and print statements
- Fix all lint issues in 11 generate_images files
2026-03-13 20:52:27 +01:00
1e108d1e3f refactor(tests): remove noqa comments from test files
- Fix lint issues in keyboard_coop, lichess_bot, and tag_divider tests
- Prefix unused parameters with underscore instead of noqa: ARG002
2026-03-13 20:49:25 +01:00
0d47f77ee5 refactor: remove noqa comments from miscellaneous scripts
- Fix underlying lint issues instead of suppressing with noqa
- Files: moviepy_showcase, pomodoro-wake-daemon, brother_printer,
  http_status_anki, geo_data, repo_explorer, steam_backlog_enforcer,
  music_generator
2026-03-13 20:48:40 +01:00
078a4c0071 refactor(anki_decks): remove all noqa comments and fix underlying issues
- Replace module-level globals with _mp_state dict (PLW0603)
- Use hashlib.sha256 instead of md5 (S324)
- Use secrets.randbelow instead of random.randrange (S311)
- Use tempfile.gettempdir() instead of hardcoded /tmp (S108)
- Replace assert statements with RuntimeError (S101)
2026-03-13 20:47:52 +01:00
8623276339 refactor(screen_locker): remove all noqa comments from tests
- Prefix unused mock parameters with underscore instead of noqa: ARG002
- Remove 102 noqa suppression comments
2026-03-13 20:46:45 +01:00
4d3da460fc refactor(linux_configuration): fix ruff violations in digital wellbeing and transcription scripts
- Add type annotations and docstrings to focus_mode_daemon.py, transcribe_fw.py, transcribe_helpers.py
- Use logging module instead of print
- Fix bare except clauses with specific exception types
2026-03-13 20:42:39 +01:00
0460f3fac6 refactor(word_frequency): fix all ruff violations and remove noqa comments
- Replace print() with logging module throughout
- Add type annotations and Google docstrings to all functions
- Introduce DeckInput and LessonConfig dataclasses to reduce function parameters
- Use specific exception types instead of bare except (BLE001)
- Remove all noqa suppression comments
- Fix test fixtures: remove unused _capsys/_tmp_path parameters
2026-03-13 20:41:31 +01:00
5cd30db5a2 refactor(cinema_planner): fix all ruff violations, add type hints, docstrings, logging
- Replace print() with logging module
- Add type annotations to all functions
- Add Google-style docstrings to all public functions/classes
- Extract magic numbers into named constants
- Break complex functions into smaller helpers
- Use Path.open() instead of open()
- Use contextlib.suppress where appropriate
2026-03-13 20:35:21 +01:00
cffd445b0b docs: add repository README 2026-03-13 19:47:11 +01:00
KRZYSZTOF RUDNICKI
89a8d57971 Merge branch 'main' of https://github.com/kuhyx/testsAndMisc 2026-03-12 08:50:22 +01:00
ee68d47a4c feat: improvements in hosts bluetooth focus mode and backglog scripts 2026-03-11 20:47:03 +01:00
KRZYSZTOF RUDNICKI
1a32d8dc51 Merge branch 'main' of https://github.com/kuhyx/testsAndMisc 2026-03-11 08:51:39 +01:00
KRZYSZTOF RUDNICKI
24be13a17a feat: install code insiders fix ubuntu performance gif to square and upgrae ubuntu script 2026-03-11 08:51:32 +01:00
497dcfd8b3 feat: screen replay feature 2026-03-09 18:52:48 +01:00