Go to file
Krzysztof kuhy Rudnicki cc804dd311 Run enforcement from exact alarms, and re-arm it before first unlock
The decision layer needed a runtime. A polling loop was the obvious design and
the wrong one: Doze can skip a poll indefinitely, and skipping the 05:00
boundary leaves the curfew allowlist applied into the morning -- the user finds
their banking app missing with no obvious cause. The transitions are known
ahead of time, so they get exact alarms. The service wakes, applies, schedules
the next run and stops rather than sitting resident.

BootReceiver takes LOCKED_BOOT_COMPLETED as well as BOOT_COMPLETED, because the
latter does not arrive until first unlock. That is not theoretical: this phone
sat at RUNNING_LOCKED for minutes after an earlier reboot in this session, with
no network and no app able to start. Relying on BOOT_COMPLETED alone freezes
enforcement state across a reboot -- safe for hiding, not for unhiding, which is
the direction that strands you without a dialer. The schedule is re-armed
before unlock; the pass itself waits until storage is readable.

The first on-device run logged "exact alarms not permitted", and dumpsys showed
what that costs: window=+11m14s, maxWhenElapsed=+25m51s, so a 15-minute
fallback could slip to 26 minutes. SCHEDULE_EXACT_ALARM is user-revocable and
denied by default on Android 16; USE_EXACT_ALARM is the permission for apps
whose function is acting at specific times, and is granted at install. After
the change: window=0, exactAllowReason=policy_permission, whenElapsed equal to
maxWhenElapsed.

The service reports "not DO/PO - no enforcement applied" and does nothing when
unprovisioned, rather than failing quietly, and a failure inside a pass cannot
stop the next run being scheduled -- an enforcement bug should degrade one tick,
not end the chain.

Not yet wired: the service logs a tick rather than calling setApplicationHidden
with the decision. Both halves are tested; joining them is next.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AwepyL5Lxs5QKbKkMpxxxL
2026-08-09 21:50:58 +02:00
.github Pin prettier, shfmt and zsh too, not just shellcheck 2026-08-04 21:07:49 +02:00
.hippo style: prettier format .hippo memory files 2026-05-28 07:05:24 +02:00
.vscode chore: archive 41 unmaintained directories to testsAndMisc-archive 2026-05-14 20:21:05 +02:00
billsplit billsplit: build a real APK by dropping file_picker for file_selector 2026-08-03 14:15:40 +02:00
bucket_catch bucket_catch: introduce a real design-token system, fix reversed gradients 2026-07-22 19:18:12 +02:00
docs Run enforcement from exact alarms, and re-arm it before first unlock 2026-08-09 21:50:58 +02:00
focus_owner Run enforcement from exact alarms, and re-arm it before first unlock 2026-08-09 21:50:58 +02:00
kcd2_dice_solver kcd2 dice solver: lock deploy_build.sh so two runs cannot publish half a bundle 2026-07-26 20:33:38 +02:00
linux_configuration Fix engine pruning: disabled -> inactive (they were still running) 2026-08-09 17:56:59 +02:00
meta Fail the build on any shellcheck finding; fix the 222 the old gate hid 2026-08-03 19:49:11 +02:00
phone_focus_mode app_icons: add a decision-tree glyph and register untools 2026-08-09 17:23:35 +02:00
python_pkg app_icons: add a decision-tree glyph and register untools 2026-08-09 17:23:35 +02:00
reverse_survivors feat(reverse_survivors): migrate Reverse Survivors game into the monorepo 2026-08-03 10:45:12 +02:00
third_party/agent-skills style(prettier): apply markdown/json formatting updates 2026-05-07 22:08:00 +02:00
.binary-allowlist Move billsplit Flutter app into the monorepo 2026-08-03 12:22:22 +02:00
.copilotignore chore: archive 41 unmaintained directories to testsAndMisc-archive 2026-05-14 20:21:05 +02:00
.fvmrc chore: consolidate root configs into meta/, drop unused C dir + split/pdfCentered/geo_data 2026-05-14 20:40:12 +02:00
.gitignore Move billsplit Flutter app into the monorepo 2026-08-03 12:22:22 +02:00
.pre-commit-config.yaml Prune 84 SearXNG engines; images category now sub-1s 2026-08-09 17:42:56 +02:00
.prettierignore Exempt the generated policy asset from prettier 2026-08-05 09:40:44 +02:00
.shellcheckrc Fail the build on any shellcheck finding; fix the 222 the old gate hid 2026-08-03 19:49:11 +02:00
CLAUDE.md Move billsplit Flutter app into the monorepo 2026-08-03 12:22:22 +02:00
DESIGN_AUDIT_TODO.md Format last three markdown files; cap billsplit's Android build memory 2026-08-03 13:25:48 +02:00
lint_python.sh chore: consolidate root configs into meta/, drop unused C dir + split/pdfCentered/geo_data 2026-05-14 20:40:12 +02:00
pyproject.toml chore: consolidate root configs into meta/, drop unused C dir + split/pdfCentered/geo_data 2026-05-14 20:40:12 +02:00
README.md Move billsplit Flutter app into the monorepo 2026-08-03 12:22:22 +02:00
requirements.txt chore: consolidate root configs into meta/, drop unused C dir + split/pdfCentered/geo_data 2026-05-14 20:40:12 +02:00
run.sh chore: consolidate root configs into meta/, drop unused C dir + split/pdfCentered/geo_data 2026-05-14 20:40:12 +02:00

testsAndMisc

A collection of personal projects, scripts, and experiments — from a GPS-based phone focus tool to Linux/Arch automation, with CI, linting, and pre-commit hooks across the board.

Highlights

Phone Focus Mode

Location-based app restriction for rooted Android. Automatically disables non-whitelisted apps within 500 m of home using ADB + Magisk. Features Haversine distance calculation, hysteresis to prevent toggling, fail-safe unlock, and state persistence. Bash, Android ADB.

Linux Configuration

Automated Arch Linux setup: fresh-install scripts, i3 window manager config, LaTeX environment, and system tests. Includes documentation and test result logging.

Scripts

Utility scripts for development workflows — build file validation, secret detection, and custom makepkg helpers.

Repository Layout

Path Description
python_pkg/ Python packages (each maintained subpackage lives here)
billsplit/ Receipt bill-splitting Flutter app — people, groups, per-item assignment, e-paragon import and xlsx export (Dart, 100 % line coverage gate)
linux_configuration/ Arch Linux setup, i3 config, system maintenance scripts
phone_focus_mode/ GPS-based Android focus enforcer
reverse_survivors/ Reverse Survivors — React/Vite game where you play the horde against an AI survivor (TypeScript, 100 % coverage gate)
scripts/ Workspace-level helper scripts and pre-commit hooks
docs/ Reference docs and historical reports
third_party/ Vendored upstream skills/agents
meta/ Repo-wide tooling: pyproject.toml, requirements.txt, .pre-commit-config.yaml, run.sh, lint_python.sh, .fvmrc. Symlinked into the repo root so tools that auto-discover from root keep working.

Archived / unmaintained projects live in the sibling repository testsAndMisc-archive.

Tooling

  • Python linting: Ruff with all rules enabled (see meta/pyproject.toml)
  • Dependencies: pip install -r meta/requirements.txt (combined runtime + dev)
  • CI: GitHub Actions — lint, build, and test on push
  • Testing: pytest (Python), custom shell-based test harness for scripts