mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-17 21:45:08 +01:00
|
Some checks are pending
crdt_sync_flutter tests / test (push) Waiting to run
dependency freshness / dependencies on newest stable (push) Waiting to run
file length / file-length (push) Waiting to run
focus-project pre-commit / pre-commit (push) Waiting to run
focus-project tests / test (push) Waiting to run
freedays pre-commit / pre-commit (push) Waiting to run
freedays tests / test (push) Waiting to run
holds pre-commit / pre-commit (push) Waiting to run
holds tests / test (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
palette drift / palette (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
shared gate tests / gate unit tests (push) Waiting to run
sickdays pre-commit / pre-commit (push) Waiting to run
sickdays tests / test (push) Waiting to run
sickdays 0.5.3 and freedays 0.4.2 pinned crdt-sync 0.11.0 exactly, so a consumer on 0.11.1 could not resolve. freedays 0.4.3 and sickdays 0.5.4 move to 0.11.1 (additive: verified plaintext cleanup). freedays 125 pass, sickdays 155 pass (1 Tk test needs a display). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| holds | ||
| .pre-commit-config.yaml | ||
| install.sh | ||
| pyproject.toml | ||
| README.md | ||
| requirements.txt | ||
holds
Declared time-boxed holds (contract v1): while a hold is active every gate (focus-guard, diet-guard, screen-locker prompts) stands down so the PC stays usable, e.g. for a proctored test. Stdlib only; gates import it from the system python.
import holds
holds.active(now=None) # Hold | None (corrupt file -> None, logged: fail closed)
holds.covers("diet-guard") # bool; v1: every gate
holds.next_change(now=None) # datetime | None: active hold's end, else next start
holds.add(start, end, "reason of 10+ chars") # raises HoldsError on a ratchet breach
holds.remove(hold_id) # only before it starts
Ratchet (R11): each hold <= 15 h, <= 3 per ISO week (by start), start >= now + 30 min,
reason >= 10 chars, no overlaps, whole-minute times, existing holds are never edited.
Data: $HOLDS_DATA or ~/.local/share/holds/holds.json, local naive times.
Install: ./install.sh (editable, /usr/bin/python3). Tests: python3 -m pytest.