Skip to content

feat: family opt-in to plan alerts (alert_subscribers) — PR 1/2#10

Merged
illinigirl merged 1 commit into
mainfrom
feat/plan-alert-subscribers
Jul 3, 2026
Merged

feat: family opt-in to plan alerts (alert_subscribers) — PR 1/2#10
illinigirl merged 1 commit into
mainfrom
feat/plan-alert-subscribers

Conversation

@illinigirl

Copy link
Copy Markdown
Owner

Adds alert_subscribers (atomic String Set) on plan rows, per-recipient poller fanout on all plan-alert surfaces, the set_plan_alert_subscription MCP tool (both transports), creator auto-seed on HTTP, and the upsert carry-forward. Owner stays implicit — absent attribute is exactly the old behavior. Web self-serve toggle is PR 2.

🤖 Generated with Claude Code

Plan alerts (DOWN/BACK UP, storm, low-wait) had exactly one hard-wired
recipient — the shared-partition owner. Adds per-plan opt-in:

- `alert_subscribers`: DDB String Set of ADDITIONAL recipient ids on each
  PLAN# row. Owner stays implicit and always alerted; absent attribute =
  owner-only (pre-feature behavior, zero migration). Mutated ONLY via
  atomic ADD/DELETE so web/MCP edits can't race (and they never touch the
  attributes the plan-edit tools rewrite).
- Poller: build_active_plan_ride_index emits per-recipient entries on both
  fanout surfaces (per-ride index for DOWN/UP/low-wait; active_plans for
  weather). Existing resolver/cooldown/window gates unchanged.
- New MCP tool set_plan_alert_subscription(member, subscribed, trip_id/
  date), both transports: resolves member → the USER#<id>/PROFILE the
  poller alerts on (friendly-name→sub map on HTTP), trip-wide or per-day,
  errors with instructions when the member has no /me profile, warns when
  the profile lacks a Pushover key.
- HTTP record_plan/create_trip seed the creator's sub (owner excepted) —
  a family member's own plans alert them by default.
- record_plan's upsert merge carries alert_subscribers forward (the same
  wipe hazard that once ate completed_rides).
- _convert_decimals converts sets → sorted lists (SS isn't JSON-
  serializable; raw rows appear in tool returns).

Tests: 15 new (tool add/remove/errors/warning, upsert carry + seed-merge,
poller fanout expansion incl. owner-dedup, http creator seed).

Web self-serve toggle on /trips is PR 2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@illinigirl illinigirl merged commit ea056b8 into main Jul 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant