Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
df7bb76
feat(flow): read-only local-state effect checker for files and OS set…
abrichr Nov 21, 2026
3717799
feat(flow): local-state examples, lab harness and docs
abrichr Nov 21, 2026
0c6df69
test(lab): focus setup click before record and replay
abrichr Nov 21, 2026
9ad79ba
style: ruff format and import order
abrichr Nov 21, 2026
f56df09
docs: local-state lab results in CAPABILITIES, doc and harness
abrichr Nov 21, 2026
3935cd4
fix(flow): a missing registry key or empty preferences domain is unre…
abrichr Nov 21, 2026
5e516a7
Merge remote-tracking branch 'origin/main' into claude/local-state-check
abrichr Nov 21, 2026
65cfe96
Merge remote-tracking branch 'origin/main' into HEAD
abrichr Nov 22, 2026
f4db48f
fix(local-state): refuse non-regular files; keep the import layers an…
abrichr Nov 22, 2026
5862640
Merge remote-tracking branch 'origin/main' into HEAD
abrichr Nov 22, 2026
f5f4b42
fix(local-state): preserve legacy verifier identity hashes and update…
abrichr Nov 22, 2026
146438a
Merge remote-tracking branch 'origin/main' into HEAD
abrichr Nov 22, 2026
ae1a16e
Merge remote-tracking branch 'origin/main' into claude/local-state-check
abrichr Nov 23, 2026
443cbbc
feat(flow,quickstart): add read-only Night Shift/Light and Calendar p…
abrichr Nov 23, 2026
3b4c46c
fix(flow,quickstart): EventKit OS probe (no app name), local-tz conve…
abrichr Nov 23, 2026
83aae18
Merge origin/main and fix P1-A/P2: withhold unprobed calendar revert,…
abrichr Nov 23, 2026
bdbf657
fix(quickstart): guard optional local_state import against released o…
abrichr Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| Generate read-only OS `local-state` verification contracts for built-in everyday tasks (`macos_night_shift` via private `CoreBrightness`, `windows_night_light` via `HKCU` CloudStore `Data` byte 18 heuristic, and `macos_calendar_event` via EventKit `EKEventStore` matching exact title, local-timezone start/end, recurrence, and optional `event_uid`), wired into `openadapt quickstart --task night-shift` and `--task calendar-block` (with opt-in `--probe-baseline` and withheld revert contract when baseline is unreadable); unreadable or unsupported hosts fail closed as `INDETERMINATE` | Experimental | Unit-tested across all 3 probes (enabled/disabled, malformed bytes, missing/ambiguous calendars, unauthorized EventKit, aware timezone conversion, wrong OS -> fail-closed `INDETERMINATE`) and contract generation; live Windows and end-to-end macOS toggle runs not yet recorded | `openadapt quickstart --task`, [LOCAL_STATE_CHECKS.md](packages/flow/docs/LOCAL_STATE_CHECKS.md), `openadapt/quickstart/everyday.py`, `runtime/effects/local_state.py` |
132 changes: 132 additions & 0 deletions openadapt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,73 @@ def ask(prompt: str) -> str:
default=None,
help="With --own: your web app's address. Recording opens a browser window.",
)
@click.option(
"--task",
type=click.Choice(["night-shift", "calendar-block"]),
default=None,
help=(
"Built-in OS everyday task (no sample app, no login): "
"night-shift (macOS Night Shift / Windows Night Light) or "
"calendar-block (parameterized recurring Calendar block)."
),
)
@click.option(
"--title",
default=None,
help="With --task calendar-block: Calendar event title.",
)
@click.option(
"--calendar",
"calendar_name",
default=None,
help="With --task calendar-block: macOS Calendar name (default: Calendar).",
)
@click.option(
"--start",
"start_iso",
default=None,
help="With --task calendar-block: ISO-8601 start timestamp.",
)
@click.option(
"--duration",
"duration_minutes",
type=int,
default=None,
help="With --task calendar-block: duration in minutes (default: 30).",
)
@click.option(
"--recurrence",
type=click.Choice(["none", "daily", "weekly", "weekdays"]),
default=None,
help="With --task calendar-block: recurrence cadence (default: weekly).",
)
@click.option(
"--event-uid",
default=None,
help=(
"With --task calendar-block: optional EventKit eventIdentifier to bind "
"forward and revert checks to one specific event (without --event-uid, "
"the check matches any event with the same calendar, title, time, and recurrence)."
),
)
@click.option(
"--revert/--no-revert",
default=True,
show_default=True,
help=(
"With --task: write a revert_verify.yaml check file to run after undoing "
"the change (withheld when baseline is not confirmed or Night Shift baseline is unreadable)."
),
)
@click.option(
"--probe-baseline",
is_flag=True,
default=False,
help=(
"With --task calendar-block: run an opt-in read-only macOS EventKit "
"baseline check (requires Calendars privacy permission)."
),
)
@click.option("--headed", is_flag=True, hidden=True)
@click.option("--headless", is_flag=True, hidden=True)
@click.option("--break-it", "break_it", is_flag=True, hidden=True)
Expand All @@ -895,6 +962,15 @@ def quickstart(
more: bool,
own: bool,
url: Optional[str],
task: Optional[str],
title: Optional[str],
calendar_name: Optional[str],
start_iso: Optional[str],
duration_minutes: Optional[int],
recurrence: Optional[str],
event_uid: Optional[str],
revert: bool,
probe_baseline: bool,
headed: bool,
headless: bool,
break_it: bool,
Expand Down Expand Up @@ -923,6 +999,62 @@ def quickstart(
_require_supported_python()
if url is not None and not own:
raise click.UsageError("--url works with --own.")
calendar_opts_used = any(
opt is not None
for opt in (
title,
calendar_name,
start_iso,
duration_minutes,
recurrence,
event_uid,
)
)
if (calendar_opts_used or probe_baseline) and task != "calendar-block":
raise click.UsageError(
"--title, --calendar, --start, --duration, --recurrence, --event-uid, "
"and --probe-baseline require --task calendar-block."
)
if task is not None:
if own:
raise click.UsageError("--task cannot be combined with --own.")
from openadapt.quickstart.everyday import (
DEFAULT_CALENDAR_NAME,
DEFAULT_CALENDAR_TITLE,
DEFAULT_DURATION_MINUTES,
DEFAULT_RECURRENCE,
EverydayTaskError,
run_everyday_task,
)

root = _quickstart_root(out)
try:
run_everyday_task(
task,
root,
title=title if title is not None else DEFAULT_CALENDAR_TITLE,
calendar_name=(
calendar_name
if calendar_name is not None
else DEFAULT_CALENDAR_NAME
),
start_iso=start_iso,
duration_minutes=(
duration_minutes
if duration_minutes is not None
else DEFAULT_DURATION_MINUTES
),
recurrence=(
recurrence if recurrence is not None else DEFAULT_RECURRENCE
),
event_uid=event_uid,
revert=revert,
probe_baseline=probe_baseline,
say=click.echo,
)
except EverydayTaskError as error:
raise click.ClickException(str(error)) from error
return
if own:
_quickstart_own(_quickstart_root(out), url, watch or headed)
return
Expand Down
Loading
Loading