Questify

3.14.0

Released

Features

  • Pro accounts now get a weekly AI review. On Sunday evening, local time, for anyone who did something that week, the worker writes a short review — a headline, what moved, what is aging, the one quest that most deserves attention next week and why, and a concrete first step on it — and it leads the dashboard's rail as "Your week" for the following week, with the focus quest linked. A bell notification ("Your weekly review is ready: …") links to it, and Settings > Notifications gains a "Weekly AI review" switch for Pro accounts that saves as soon as it changes, one save at a time; when no reminder or digest email is on, so the email form shows no timezone, the card carries its own timezone choice, since the review is written on Sunday evening in that zone (UTC until one is chosen). Free accounts keep the plain Sunday Report. Each review is one model call (Claude Haiku by default, WEEKLY_REVIEW_MODEL_TYPE), platform-funded from the weekly_digest system budget; once that budget's monthly ceiling is reached the worker writes reviews on the free OpenRouter router instead (WEEKLY_REVIEW_FALLBACK_MODEL_TYPE), so nobody eligible misses a week and spend stops at the ceiling. The model names its focus by a label that is mapped back to one of the person's own active quests, and an answer naming anything else is refused and retried. Behind NEXT_PUBLIC_FEATURE_WEEKLY_AI_REVIEW (.env.example, env.ts, Dockerfile, docker-compose.yml, turbo.json, playwright.config.ts, the worker's env schema and release.yml, docs/ops/feature-flags.md); off, no card or switch renders and the worker writes nothing (#546).

  • People now see in the app when someone puts them on a quest. A bell in the top bar shows how many notifications are unread; from tablet width up it opens a list of the newest — "Ada added you to Spring garden", when it happened, a link to the quest — and opening it marks them read. On a phone the bell goes to the new /notifications page, which lists them 50 at a time with Newer/Older links, marks each page's unread rows read so the badge drops as you read, and links to email preferences. The first notification is being seated on a Party Quest, by a direct add, a guild brought into the party, or a guild claim link or invitation that hands over a roster place's seats, and it arrives whatever the person's email settings — it is what someone who turned party email off still gets. Behind NEXT_PUBLIC_FEATURE_IN_APP_NOTIFICATIONS (.env.example, env.ts, Dockerfile, docker-compose.yml, turbo.json, playwright.config.ts, docs/ops/feature-flags.md); off, no bell renders and nothing is written (#991).

Fixes

  • Changing the time of a recurring Quest from one of its cycles now asks whether the change is for Only this cycle or This and all future cycles. Before, moving today's cycle from 9:00 PM to 7:00 AM in Edit Quest said "Saved" and moved that one cycle: tomorrow's, already created, and every later one stayed at 9:00 PM. The second choice now moves the later cycles too, except any someone has already worked on, which keep their time and are named in the confirmation. Changes that leave the schedule alone save without asking, and the Schedule section says which cycle of the recurring Quest it is. Clearing a cycle's schedule, which quietly dropped it from Today, is refused with a pointer to Pause. On the recurring settings page the start field is now Starts, with "Every cycle from the next one starts at this time", and a new time typed on the suggested date (or an earlier one) is taken as a time of day from the next free cycle instead of being refused with "Start the next cycle at or after …" (#999).

  • A recurring Quest the person is keeping no longer shows up under Needs a nudge as "No activity for 7+ days", naming a task they ticked that morning. The nudge came from a past day's cycle with a task left over, and dismissing it only made room for the next past day's. A recurring Quest now gets a nudge only when none of its cycles has been worked for the whole threshold — once, on today's cycle — and never while paused; ticking any day's task clears it. On the dashboard the row also says which cycle it is, as "Cycle 12 · Thu, 22 Oct" (#992).

  • Redeeming a guild claim link, or accepting a guild invitation aimed at a roster place, now tells the person which quests came with it. Taking over an accountless place hands over every quest seat it held, and until now the only email went to the guild owner — the member was silently put on those quests. One quest sends the usual "added you to" email; two or more send a single party_seats_linked email listing them all, under the same Party Quest email preference (#991).

Technical changes· 14 entries for database, tooling, CI, tests and docs

Database

  • 20261214120000_reschedule_recurrence_from_cycle.sql adds reschedule_quest_recurrence_from_cycle(_quest_id, _scheduled_start_at, _duration, _timezone), the owner-only RPC behind "This and all future cycles" on a recurring Quest's Edit Quest sheet. It moves the edited cycle, removes the later cycles that have not started and that nobody has worked on (the recurrence_cycle_is_untouched() rule a settings save already uses) for the mint to re-create, keeps worked-on later cycles at their old time and returns their starts as kept_starts, and re-anchors the template on the first free slot of the new grid — same local time and cadence, skipped weekdays still skipped — with the new duration and timezone, re-basing cycle_index_offset so numbering continues after the last cycle kept. An earlier cycle is never touched. It also adds quests_cycle_has_schedule, so a Quest with a recurrence_template_id can no longer have its scheduled_start_at cleared; production held no such row, so the constraint is validated. 20261215120000_reschedule_recurrence_atomic_save.sql adds save_quest_and_reschedule_from_cycle(), a SECURITY INVOKER wrapper the Edit Quest sheet calls instead: it runs the reschedule and writes the form's own quest fields (only the edit form's columns, only the keys sent, with the caller's privileges and triggers) in one transaction, so a refused deadline or status change moves nothing (#999).

  • 20261213120000_weekly_ai_review.sql adds weekly_reviews, the queue and the result of the weekly AI review: one row per Pro account per week (unique on user_id, week_start), queued by the new hourly pg_cron job enqueue-weekly-reviews (:27) on the Sunday Report's clock — a person is due while their local clock reads Sunday 17:00–18:59 — and for the Sunday Report's week, read from weekly_digest_content()'s own boundary by weekly_review_window(). Only an account that is Pro, opted in, acted that week (a task event of its own, a task finished on a quest it owns, or a quest created by hand; a scheduler-minted cycle does not count) and has an active quest is queued; weekly_review_input() freezes the Sunday Report's facts plus up to 15 active quests (a recurring quest once, as its newest cycle) with their next open tasks. The worker's claim_weekly_review(), charge_weekly_review(), reprice_weekly_review(), complete_weekly_review() and fail_weekly_review() run under a 5-minute lease in #548's shape: the claim skips an owner who has left Pro or opted out, charge_weekly_review() books the existing weekly_digest system budget against the person under its monthly ceiling and refuses a non-Pro owner with 42501, complete_weekly_review() accepts only a focus quest the model was shown and writes a weekly_review row to notifications (the kind check now allows it), and a failed attempt is refunded and retried 15 minutes then an hour later, three attempts in all. reap_weekly_reviews(), run by every claim and every enqueue, returns lapsed leases with their charge and expires reviews not written within 48 hours; the frozen input is emptied once a row is final, and a row deleted mid-lease returns its charge. The owner reads the review columns of their own rows only — never the input, the lease or the error text — and no client writes. notification_preferences.weekly_ai_review (default on) is the opt-out, accepted by update_my_notification_preferences(); export_my_data() exports it and the account's ready reviews. Every new function is service-role only. Covered by the new supabase/tests/weekly_ai_review.sql (60) and four rls.sql assertions (#546).

  • 20261212120000_recurring_cycle_stalls.sql makes stall detection treat a recurring Quest as one thing. check_stalled_quests() no longer judges a quest with a recurrence_template_id on its own; a new template pass raises at most one stall per active template, on its current cycle (the latest that has started, from the new recurrence_template_current_cycle()), when no cycle has had activity inside the threshold (recurrence_template_last_activity()). Minting is not activity: a cycle task counts only once changed (updated_at > created_at) or when added after its cycle was minted, an investigation on any cycle counts, and the template's updated_at is the floor. A paused template never stalls, and the new quest_recurrence_templates_resolve_stalls_on_pause trigger removes its stall at once. The #605 task and investigation triggers and stall_quest_has_recent_activity() now resolve a cycle's stall on activity on any cycle of the template. repoint_recurring_stall_notifications(), run first by the scan and every ten minutes by the new repoint-recurring-stalls pg_cron job, moves each template's stall onto its current cycle without touching stalled_since (so no second nudge is charged) and carries the nudge and suggestion task to the same task's copy by template_task_id. A row whose nudge or suggestion the worker is still generating is moved only once that claim settles, so the completion cannot write yesterday's task onto today's cycle. Every stall the old scan had raised on an individual cycle is removed with a resolved event, reason: recurring_cycle_untracked. The three new functions are service-role only. Covered by the new supabase/tests/stall_recurrence.sql, with rls.sql asserting the new functions' grants (#992).

  • 20261211120000_in_app_notifications.sql adds notifications, the in-app inbox: each user reads their own rows and may set read_at on them (a column grant, so any other column raises 42501), and no client may insert or delete one — the web app writes rows with the service role. kind starts with party_member_added; quest_id and actor_id are on delete set null and data keeps the quest title and actor name as they were, so a row still reads after a rename or a departure. link_guild_member_account() now returns the quests a linked account was newly put on, leaving out a seat merged into one the account already held, a deleted quest, and every cycle of a recurring series but its latest. The new redeem_guild_member_claim_seats() and accept_guild_invitation_seats() answer with those ids — empty for a place seated nowhere, a plain join and a pressed-again link — and redeem_guild_member_claim() / accept_guild_invitation() keep their results as thin wrappers, so a web build from before the migration keeps working. export_my_data() also exports the caller's notifications, without the actor's account id. Covered by supabase/tests/in_app_notifications.sql, with rls.sql, function_execute_grants.sql, account_deletion_cascade.sql and export_my_data.sql extended (#991).

CI/CD

  • The worker deploy in release.yml copies NEXT_PUBLIC_FEATURE_WEEKLY_AI_REVIEW from Vercel's production environment to the worker with the other worker-read flags, and fails the deploy if a Fly secret of that name would shadow it; scripts/worker-deploy.test.mjs pins it (#546).

Tests

  • supabase/tests/quest_recurrence_reschedule.sql covers rescheduling from a cycle: the template re-anchored on the new time with numbering continuing, untouched later cycles re-minted at the new time, a worked-on later cycle kept and reported, an earlier waiting cycle left alone, skipped weekdays kept, a refused deadline rolling the whole one-transaction save back while a good one writes the form's fields with the new time, the refusals (someone else's cycle, a non-cycle Quest, a cleared schedule, a cycle longer than the cadence, an unknown timezone, anon) and a plain "only this cycle" update leaving the template alone; rls.sql asserts the cleared-schedule guard and that another user cannot reschedule. Vitest pins the Edit Quest prompt (asked only for a changed schedule on a cycle, each choice submitted as schedule_scope, Cancel, never on a non-cycle Quest), updateQuestAction()'s two scopes and its refusals, the confirmation copy, and the settings page's time-of-day fallback; e2e/quest-recurrence-settings.spec.ts gains a live case that moves today's cycle with "This and all future cycles" and checks tomorrow's follows (#999).

  • Worker Vitest covers the weekly review prompt (quest labels, the fenced data block), the answer parser (focus mapping, bounds, links, empty aging), the generator (charge before the provider, the free fallback at the ceiling, a non-Pro owner, a lost lease, reprice, failed and superseded attempts) and the loop's setup and back-off; web Vitest covers the dashboard read, card and rail order, the bell's weekly_review row, the settings switch (serialised saves, rollback to the stored value, the timezone choice) and its action, and the Pro-only settings card. /settings/notifications is now split into loadNotificationSettingsPage(), NotificationSettingsView and a thin page, with the loader's decisions — sign-in, failed preferences, the review card for Pro only, and when it carries a timezone — tested directly (#546).

  • supabase/tests/stall_recurrence.sql covers a past cycle not stalling while today's is worked, one stall per untouched template on today's cycle, a cycle minted inside the threshold not counting as activity, a paused template, a dismissed template stall staying dismissed, resolution by ticking another cycle, the re-point sweep (move, duplicate removal, nudge task carried by lineage and not regenerated, a row mid-generation left until its claim completes), the pause trigger, grants and the schedule. listDashboardStalls(), StallBanner, NeedsANudge and QuestCard tests pin the cycle line on the dashboard and its absence where the card already names the cycle (#992).

  • supabase/tests/quest_recurrence.sql chose its DST-spanning weekly series by the date of the next fall clock change while anchoring it two days earlier, so from 19:00 Toronto two days before the change until that day it picked a boundary whose anchor had already passed, minted one cycle instead of two, and failed every PR's Supabase job. It now picks the next boundary whose anchor is still in the future (PR #996).

  • Pinned the in-app notification writer (flag off, the actor and duplicates dropped, every failure swallowed), the inbox reads and the open/mark-read actions, both trigger sites writing rows regardless of party email, the linked-seat notice (nothing for no quests, one email for one, a digest for several, untitled when the quests cannot be read), the party_seats_linked template, the guild actions handing the reported quests over, the bell (99+ badge, fresh load on open, count-down, retry, closing, a superseded response), the /notifications loader, view and page, the top bar with the flag on and off, and /notifications as a protected exact path that leaves /notifications/unsubscribe public; e2e/notifications.spec.ts checks both route boundaries signed out (#991).

Documentation

  • docs/schema.md documents 20261214120000_reschedule_recurrence_from_cycle.sql, its access rule and its pgTAP coverage (#999).

  • docs/schema.md documents weekly_reviews, the migration and its pgTAP coverage; docs/ops/scheduled-jobs.md adds enqueue-weekly-reviews; docs/ops/feature-flags.md adds the NEXT_PUBLIC_FEATURE_WEEKLY_AI_REVIEW row; docs/pricing.md notes the weekly review as the first caller of the weekly_digest budget (#546).

  • docs/ops/scheduled-jobs.md adds the repoint-recurring-stalls job and says how recurring Quests are treated by stall detection (#992).

  • docs/schema.md documents the notifications table, the migration and its pgTAP coverage, and the export key; docs/ops/feature-flags.md adds the NEXT_PUBLIC_FEATURE_IN_APP_NOTIFICATIONS row (#991).