Review nudges: say which upcoming nights need approval, before they go dark #149
Labels
No labels
area/ai
area/backend
area/frontend
area/infra
area/scheduler
area/wled
good-first-issue
priority/high
priority/low
priority/medium
security
type/bug
type/chore
type/ci-cd
type/docs
type/feature
type/qa
v1.0.0
v1.1.0
v1.2.0
v2.0.0
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/Iris-WLED#149
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Iris's model is that nothing reaches the house without a human approving it, and that is right. But the review queue only works if someone remembers to open it, and the cost of forgetting is currently silent.
Verified against
main(services/schedule_service.py_push_today_scheme):lights_off_state()and logs{"pushed": "off", "reason": "no_approved_scheme"}.default_scheme, and no specific webhook fires.push_failedonly fires if the off push itself fails.The only existing nudge is the
review_queue_readywebhook (schemas/webhooks.py), which the weekly and yearly jobs fire with{job, years}. It carries no counts, no dates, and no sense of urgency.Design
1. A review summary the rest can share
GET /api/v1/schemes/review-summary?days=Nreturns upcoming days in the next N whose resolved scheme is unapproved, rejected or stale. Each entry has the date, the event, the scheme id, the reason and the days remaining.get_events_for_dateandresolve_scheme_for_date, the same path the scheduler uses.2. Webhook events
review_reminder: a weekly digest, default Monday 09:00, configurable. It sends{upcoming_unapproved: [...], count, horizon_days}, and only when the count is > 0. A nudge that fires with nothing to say trains people to ignore it.unapproved_tonight: fired in the morning (default 09:00) on any day whose on job will push "off" for want of an approval. It gives a day's warning while there's still time to approve, and names the scheme and a deep link to it.review_reminderandunapproved_tonighttoDEFAULT_WEBHOOK_EVENTSalongsidepush_failed.3. In the app
Toolbar.tsxalready has theunapprovedfilter) narrowed to that window.4. Reconsider the dark fallback (decision needed)
Going dark is the conservative choice, and "nothing unapproved reaches the house" is a principle worth keeping. But the configured
default_schemewas approved by the user as a general fallback. An option to use it on unapproved nights would be reasonable:unapproved_policy: "off" | "default_scheme"off, which preserves the current behaviour.Settings
All runtime-settable:
REVIEW_HORIZON_DAYS=14REVIEW_REMINDER_WEEKDAY=monREVIEW_REMINDER_TIME=09:00UNAPPROVED_TONIGHT_TIME=09:00Pairs with
Acceptance
unapproved_tonightfires on the morning of a day that would go dark, and not on a day that won't.Picking this up first in the v1.2.0 run.
The decision in §4: implement
unapproved_policywith the defaultoff, so current behaviour is unchanged and the option is there for anyone who wantsdefault_schemeinstead.Foundation work in this issue: one shared
plan_for_date()helper answers "what will the scheduler push on day X, and why". The scheduler's own on-push, the review summary here, and later the season preview (#151) and watchdog (#148) all use it, so that the answer is computed in one place. The scheduler moves onto it with no behaviour change, and a parity test proves that.Done in #162 (squash-merged, CI green).
Delivered:
services/day_plan.py:plan_for_date/plan_for_range, which the on job now carries out. Zero behaviour change, proven by the parity test run against the oldschedule_service.py.GET /schemes/review-summary.review_reminder(weekly, silent when nothing needs review) andunapproved_tonight(on the day and 3 days before), both on by default.unapproved_policy(defaultoff).Decisions made along the way:
will_go_darkfollows what will actually be pushed.missing.Follow-ups, filed:
/?….Not verified: the ntfy templating examples in
docs/setup.md§4 were not tested against a real ntfy server.