utils/holds
Krzysztof kuhy Rudnicki de9d41d6f0 Bump deps; pnpm 12.21.0; sickdays 0.5.5
Every pin dep_freshness reported behind moves to newest stable:
pnpm 12.21.0 (packageManager, with hash), typescript-eslint 8.72.2,
@eslint-react 5.30.2 (5.30.3 is inside the 24 h quarantine), eslint
10.15.0, astro 7.4.12, pylint 4.1.4, ruff 0.17.5, mypy 2.4.1, pytest
9.2.0, numpy 2.5.5, CI node 26.13.1 and the rest.

astro 7.4.12 brings rolldown, whose wasm binding pulls @emnapi 2.0
beta; pnpm then fed that beta to astro2tsx's peer and astro check
died. web_ui pins @emnapi/runtime 1.11.3 so the peer stays on stable.

sickdays 0.5.5 releases its requirements bump so deploy's tag check
holds. The corepack call that broke the gate lived in claude-config
(finish_gate.sh) and is fixed there.

Todo: fda71ed1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 08:58:01 +01:00
..
holds holds 0.1.0: declared time-boxed holds 2026-11-03 20:25:10 +01:00
.pre-commit-config.yaml Python libs on crdt-sync 0.11.1 2026-11-16 08:07:53 +01:00
install.sh holds 0.1.0: declared time-boxed holds 2026-11-03 20:25:10 +01:00
pyproject.toml holds 0.1.0: declared time-boxed holds 2026-11-03 20:25:10 +01:00
README.md holds 0.1.0: declared time-boxed holds 2026-11-03 20:25:10 +01:00
requirements.txt Bump deps; pnpm 12.21.0; sickdays 0.5.5 2026-11-16 08:58:01 +01:00

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.