mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-10 19:07:17 +01:00
Project.kind (focus default; old rows load unchanged) plus interview fields test_at, invite_url, trips, weekend_answers. Interview budget 30 min weekdays / 120 Sat-Sun, exempt from daily_floor, unlock clamped after the 0.7.0 history ratchet. Milestones are generated (rules, trip_ask, phone, mock, slot), never stored. Append-only evidence store behind the _paths seam. Calendar dropped: slot = slot entry + slot_confirm. Failure paths: - unanswered trip question: fail closed (reads as a trip, phone due) - late no-trip answer cannot erase an overdue phone milestone: closed - phone source missing/stale/crashed: unknown, locks: fail closed - trip_ask answer: evidence row first, then registry; a crash between leaves the question open: fail closed - add_trip/answer_weekend loosening: ValueError, nothing written - owed_lock with unreadable registry or evidence: fail open, logged (focus-guard's unreadable-registry rule); test day never locks - status() milestones with unreadable evidence: empty list, logged - torn or non-utf8 evidence lines: skipped and logged Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzxdWZUTC9Zzdzsx7VW7dm
24 lines
678 B
Python
24 lines
678 B
Python
# Copyright (c) 2026 Krzysztof Rudnicki
|
|
"""Project kinds and the interview budget (the one place the numbers live)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
if TYPE_CHECKING:
|
|
from datetime import date
|
|
|
|
FOCUS = "focus"
|
|
INTERVIEW = "interview"
|
|
KINDS = frozenset({FOCUS, INTERVIEW})
|
|
|
|
# kuhy, 2026-11-10: near-zero weekday energy, weekends are for learning.
|
|
WEEKDAY_MINUTES = 30
|
|
WEEKEND_MINUTES = 120
|
|
_FIRST_WEEKEND_DAY = 5 # Saturday
|
|
|
|
|
|
def interview_minutes(day: date) -> int:
|
|
"""The daily target of an interview project on ``day`` (Sat/Sun = 120)."""
|
|
return WEEKEND_MINUTES if day.weekday() >= _FIRST_WEEKEND_DAY else WEEKDAY_MINUTES
|