Questify

3.17.0

Released

Features

  • The route handlers the mobile app needs accept Authorization: Bearer <supabase access token> beside the web session cookie, starting with the Quest Chronicle story (POST /api/quests/:id/narrative), its narration (GET /api/quests/:id/narration) and the Year Theme quest slate (POST /api/year-themes/slate). One request client, createRequestClient() in lib/supabase/request.ts, decides the caller and acts as them under RLS, so credits, plan tiers and the free tier's daily caps apply to a Bearer caller exactly as to the web. Their response shapes are Zod schemas in @questify/core/api/*, and every refusal is one { error, code } body whose code fixes the status (#1008).

  • Those three handlers now answer a switched-off feature with 404 (the narrative was 403), a quest that is not finished with 409 (was 422) and an account with no available model with 503 (was 422). The web app reads only ok and error, so nothing it shows changes (#1008).

  • The AI Quest Coach (POST /api/coach/interview) and task investigations (POST /api/tasks/:id/investigations) accept the mobile app's Bearer token too. Their requests are parsed with schemas in @questify/core/api/coach and @questify/core/api/investigations, which keep the coach's leniency: a malformed message is dropped, and a persona key or interview id of the wrong shape is ignored. The coach's draft, message and seed types moved there from lib/ai/coaching.ts, which re-exports them (#1008).

  • Both handlers now answer with the shared { error, code } body: validation failures are 422 (were 400), the coach switched off is 404 (was 403), and naming a model the plan does not cover is 403 (was 402); running out of credits stays 402. "Draft it for me" decides whether to offer the interview instead from the error code (#1008).

  • Four route handlers the mobile app needs, each running the same function as the web's Server Action: POST /api/account/delete (deleteOwnAccount()), POST /api/similar-quests (findSimilarQuests()), POST /api/quests/:id/party/invitations (issuePartyInvitation()) and POST /api/guilds/:id/invitations (issueGuildInvitation()). They accept the session cookie or a Bearer token, answer the @questify/core/api/* contracts, and refuse with the shared { error, code } body. The invitation RPCs' refusals map to forbidden, invalid_request, conflict, rate_limited and not_found. With these, every handler docs/mobile/architecture.md lists for the app is in place, apart from the shared Chronicle and billing ones it leaves to #1025 and #1023 (#1008).

  • Party Quest invitations by email are always on: the invite form takes an email address and the invitation waits for that address to accept. The add that seated any account found by email or display name, used while NEXT_PUBLIC_FEATURE_PARTY_INVITES was off, is retired (#1009).

  • Party, guild and task assignment emails are retried: a send that fails is tried again with backoff for up to 23 hours instead of being lost, an email whose recipient has since opted out is skipped, and a retry goes to the address its first attempt used or, if the account's email has changed since, is skipped (#1009).

  • The mobile app signs people in with email and password: sign in, sign up, check your inbox with resend, forgot and reset password, with the web forms' rules and wording. Confirmation and reset emails asked for in the app open the app, an expired link shows the same states as on the web, the session is kept in the phone's secure storage across restarts and refreshed while the app is open, a reset link opened before a restart still ends on the new-password form, and signing out of the phone leaves web sessions alone. (#1010)

  • The mobile app can offer Continue with Apple, Google and Facebook, and the web adds Continue with Apple, each behind its own flag and off until its provider is set up (#410, #411, #1056). On iOS the app signs in with Apple's own sheet and shows Google and Facebook only alongside Apple, as the App Store requires; Apple is listed first on every sign-in screen, and the name Apple shares on the first sign-in becomes the profile's name unless the person already chose one. (#1010)

  • The mobile app shares the web's look: the same colours, brand palette and corner radii in light and dark, a dark mode that follows the theme chosen on the web (re-read whenever the app comes back to the foreground, and the phone's setting while signed out), and buttons, fields, cards, badges, alerts, dialogs, bottom sheets, toasts, empty states and list rows with the web's variants, 44-point targets, screen-reader labels and announcements, and no animation when the phone asks for reduced motion. The sign-in screens are rebuilt on them (#1011).

  • The mobile app has its navigation: Today, Quests, Tasks, Inbox and You tabs with the web nav's icons, each with its own stack, and New quest and Edit quest sheets over them, at the web's paths (/dashboard, /quests/[id], /quests/new, /tasks, /notifications, /settings) so a link can open the matching screen, with the tabs beneath a sheet opened from a link. Signing in lands on Today, every screen behind sign-in is gated (a deep link included), sign-out moved to the You tab, a password reset confirms with a toast, and the tab bar, headers, status bar and Android navigation bar follow the theme. The tabs hold placeholders until their feature issues fill them (#1011).

  • A new account that signs in on the phone goes through the same onboarding as the web: profile name and theme, a starting Quest Pack, the first quest (with the pack's tasks) and a Year Theme, each skippable, with Back, "Finish setup later" and sign-out in the header, then lands on Today. The step is the one the account is on, so onboarding started on the web continues on the phone and the reverse, and every step is recorded exactly as the web records it (#1011).

  • The mobile app's Today tab is the web dashboard on the phone: the greeting, today's recurring cycles with their streaks and tasks you can tick in place, your statistics, the next scheduled quest, what is due this week grouped by day, and your recently updated quests. A tick shows at once, goes back if it could not be saved, and taps a haptic when it is; the tab re-reads when you open it, return to the app, pull to refresh or pass midnight, and days follow the phone's timezone (#1012).

  • The Today tab now updates live: a task ticked on the web or by another party member, or a stall nudge the worker writes, shows up without a pull while the tab is open. It also shows "Needs a nudge" with each stalled quest's Check in, Snooze and Dismiss and the check-in reply's proposal, as on the web, plus the Year Theme banner (or the prompt to set one) and, for Pro accounts, the weekly review (#1012).

  • The mobile app's Quests tab lists your quests as the web's Quests page does: search, status and Owned / Party / Public chips with counts, four sorts, one card per recurring Quest with all of its cycles a tap away, and more cards as you scroll. Each card shows its status, schedule, progress, next deadline, Year Theme, party and a "No activity" marker for a stalled quest (#1013).

Fixes

  • The cycle streak on the dashboard's Today header and Cycle streaks rail, and in the mobile app, no longer drops to 0 when today's window closes. A daily Quest finished yesterday reads 1 day for the whole of today while today's cycle is still open, rises to 2 when today is finished, and resets to 0 only once today's cycle is missed at the end of the day (#1059).

  • A party member who ticked the last task of someone else's quest no longer takes the quest's completion achievements in place of its owner: PATCH /api/tasks/:id evaluated them for the caller, against a quest lookup filtered to the caller's own quests, so the owner earned nothing. The owner now earns them whoever finishes the quest, and the member keeps the Clean Sweep they earned (#1009).

  • Confirming attendance last on a recurring Party Quest no longer reads the owner's quest history with the service role to award the owner's achievements; the completion trigger does it (#1009).

  • A refused task list, pack or jam entry no longer leaves an empty quest or recurring Quest behind: the hand-written deletes that tried to undo them from a second request are gone (#1009).

  • POST /api/quests no longer sends coach_tasks as a quest column or reads back a column the caller cannot see; it starts from a pack or drafted tasks in one call and returns the created quest (#1009).

  • The onboarding first quest is counted in analytics only once its pack's tasks exist, and Quest Jam and quest creation errors no longer show raw database text (#1009).

  • A draft quest can no longer be marked completed without being started, through complete_quest() or the edit form, and a stale onboarding tab no longer rewrites a finished onboarding or reopens it. (#1009)

  • PATCH /api/quests/:id returns the quest by an explicit column list instead of every column, and answers a refused change with a 422 and a database error with a generic message instead of the raw error text. (#1009)

  • A feedback status email that fails to send is retried for up to 23 hours instead of being lost until the report's status changes again. (#1009)

Security

  • A Bearer token is verified with Supabase Auth (auth.getUser(token)) on every request, never decoded locally, so a revoked or expired token is refused before any query runs. A request that names a token is judged by it alone: one that does not verify is a 401 even when a session cookie came along, and the public narration endpoint refuses it rather than serving the caller as anonymous (#1008).

  • POST /api/account/delete accepts only Content-Type: application/json, so a page on another site cannot post to it with a visitor's cookie without a CORS preflight, which the route never answers. The invitation handlers return the invitation link, which carries its one-time token, only when the email could not be sent, exactly as the web form shows it (#1008).

  • A client can no longer insert or update a Party Quest seat, only leave or remove one, and can no longer write quest_party_invitations. A quest manager could previously make another seat a co-owner, or seat any account on their quest without its consent, straight through PostgREST. resolve_party_invitee(), which also told a manager whether an account with a given display name existed, is dropped (#1009).

  • claim_guild_join_notification() and claim_party_join_notification() are no longer callable by clients. A client could skip them and send nothing, or call them and spend the owner's one email; the accepts now decide it themselves (#1009).

  • A feedback report's screenshot path must sit in the reporter's own folder, and account deletion removes only screenshots in the account's own folder. Before, a user could store a path to someone else's screenshot and have it removed by deleting their own account. (#1009)

  • A profile avatar must be an image in the owner's own avatar folder, rather than any URL shown to signed-out visitors on public quest cards, and signup no longer copies an avatar or an over-long name from the metadata a client sends. Image URLs on a quest must be http(s). (#1009)

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

Database

  • 20261226120000_cycle_streak_settles_at_lapse.sql adds recurrence_cycle_is_settled() (internal, no client grant) and makes get_quest_cycle_streaks() settle a cycle at its lapse point from recurrence_cycle_lapses_at() instead of at the end of its window: a started cycle counts once it is completed, failed or archived, or once its local day (or a window that runs past midnight) is over, whether or not the #1039 sweep has closed it yet. Columns and grants are unchanged, and get_my_today_cycles() picks the rule up through its join. A cycle finished before its scheduled start still waits for the start. Covered by supabase/tests/cycle_streak_lapse.sql (#1059).

  • Achievements are awarded by the database instead of the web app, so a write made through PostgREST — the mobile app's, or a quest completed by its last task — earns the same badges as one made on the web. A quest becoming completed awards its owner the quest milestones, streaks, Pack Finisher, Public Hero, Challenge Runner and, with every task done, Clean Sweep; the task that finishes a quest's list awards Clean Sweep to whoever ticked it; and a new investigation awards AI Scout to its initiator. One owner's completions are awarded one transaction at a time, so two quests completed at once cannot both miss a milestone or a streak day. Each trigger catches its own failure, so an award never fails the write. Rows are stamped from a new service-only achievement_definitions catalog, and the award functions are revoked from clients (#1009).

  • Party Closer, defined but never awarded until now, goes to every account seated on a Party Quest (a quest with more than one seat), the owner included, when it is completed. Quest Jam Winner stays unawarded (#1009).

  • The party_member_added in-app notice is written by the database, in the same transaction as the seat, so a client calling the seat RPCs directly (the mobile app) leaves the same notice the web does. add_guild_to_quest_party_seats() tells each account it seated, naming the caller; link_guild_member_account(), behind claim links and guild invitations, tells the account about each quest it handed over, naming the owner. A cycle mint still notifies nobody. The rows no longer depend on NEXT_PUBLIC_FEATURE_IN_APP_NOTIFICATIONS, which only gates the bell (#1009).

  • The emails a write earns — a guild add or a claim/invitation link seating someone on a Party Quest, an accepted party invitation, a new guild member and a task assignment — are queued by the database in the same transaction as the write, in a new service-only email_outbox table, and sent by the worker. A client making the write through PostgREST (the mobile app) now earns the same email the web app does. The accepts stamp owner_notified_at themselves, a guild_members trigger covers every way of joining a guild, and a tasks trigger covers every task assigned to someone else's seat (#1009).

  • Creating a quest with its pack or AI Coach tasks, a recurring Quest with its tasks, the onboarding first quest, and a Quest Jam entry are each one database call — create_quest(), create_quest_recurrence_template(), onboarding_create_first_quest() and join_quest_jam() — running as the caller, so a refusal part-way leaves nothing behind for the mobile app or the web. create_quest() refuses a Quest Pack the catalogue no longer offers. Saving a recurring Quest's settings, resuming it and rescheduling a cycle mint the cycles they removed in the same call, and report a mint that failed without undoing the save; one owner's minting saves take an advisory lock first, so two of them cannot deadlock (#1009).

  • The database enforces the rules only the web forms checked, so the mobile app and any other PostgREST client meet the same limits: a quest's status moves only along its lifecycle (draft → active → completed or failed, back to active, and to or from archived), and a new quest starts as a draft or active; quest goal, context, constraints and image limits and the recurring Quest goal limit are CHECK constraints; a Year Theme is written only for the current year; and onboarding steps change only through new advance_onboarding(), onboarding_go_back() and dismiss_onboarding() functions. Recurring Quests are created only through create_quest_recurrence_template(). This replaces the free-form status edit from #462: the Edit Quest form offers only the moves the quest allows. (#1009)

  • The "resolved / won't fix" email to someone who sent feedback is queued by the database when the report's status changes, and the worker sends it from the email outbox, so a status change made anywhere sends it. It still goes once per report, and the feedback.notification_claimed_at column the web app used to claim the send is dropped. (#1009)

  • 20261225120000_realtime_today.sql adds tasks and quest_stall_notifications to the supabase_realtime publication, which held no tables until now, so the mobile Today tab hears a tick or a stall nudge without a refresh. Realtime filters every event through the subscriber's RLS and drops each column their role cannot select, so a task's withheld due_at, template_task_id and updated_by_* never travel in an event. No grant, policy or replica-identity change. Covered by supabase/tests/realtime_publication.sql, which also pins those column grants and the exact list of published tables (#1012).

Tooling & Configuration

  • The web app's service-role award code (unlockAchievements() and the quest and task evaluators in lib/achievements/server.ts) is gone. The six handlers and actions that called it take a snapshot of the caller's achievement keys before a write that can earn some and report the rows that are new afterwards, so the unlock toasts are unchanged (#1009).

  • account/validators and similarity/validators moved from apps/web/src/lib to @questify/core, and the party and guild invitation forms share invitationEmailSchema from @questify/core/api/invitations instead of two copies of the address rule (#1008).

  • NEXT_PUBLIC_FEATURE_PARTY_INVITES is retired from the code, .env.example, the Docker and Compose build args, turbo.json and the Playwright web server; a value left in Vercel is ignored. The web app no longer writes in-app notifications with the service role: recordPartyMemberAddedNotifications() is gone, and the party notifiers send email only (#1009).

  • The worker sends the outbox emails (apps/worker/src/email-outbox/), claiming only the templates whose flags it has on: NEXT_PUBLIC_FEATURE_PARTY_EMAILS, NEXT_PUBLIC_FEATURE_GUILDS with NEXT_PUBLIC_FEATURE_GUILD_INVITES, and NEXT_PUBLIC_FEATURE_TASK_ASSIGNMENT_EMAILS, which it now reads, plus EMAIL_OUTBOX_POLL_INTERVAL_MS. The five templates moved from the web app to the worker; the web app's inline senders for them, and its sendNotifications() batch helper, are gone, so it sends only the feedback and invitation emails itself (#1009).

  • createQuestAction, POST /api/quests, the onboarding first-quest step, createQuestRecurrenceAction and joinQuestJamAction each make one RPC, and the three recurrence settings actions and updateQuestAction no longer call ensure_quest_recurrence_cycles() afterwards. cloneQuestPackTasksIntoQuest() and cloneOnboardingPackTasksIntoQuest() are gone (#1009).

  • The advisor allowlist accepts create_quest_recurrence_template() as a definer the app calls, now that it is the only way to create a recurring Quest, and drops the three entries #1009 already cleared (claim_guild_join_notification(), claim_party_join_notification(), resolve_party_invitee()). (#1009)

  • The web app's sendNotification() and its email template registry are removed, now that the feedback status email was the last email they sent; the worker's outbox claims feedback_status whatever the feature flags say, as it never had a flag, and a worker with no email settings and no email flag on reports outbox emails off rather than misconfigured. (#1009)

  • questify://auth/callback and questify://auth/callback?next=reset-password are on the local Supabase redirect allowlist (supabase/config.toml), and the hosted project needs both under Authentication → URL Configuration; the app adds expo-secure-store. The auth error copy, the auth callback's error codes and the reset/resend confirmations moved from apps/web to @questify/core/auth/* for both clients. (#1010)

  • NEXT_PUBLIC_FEATURE_APPLE_LOGIN is new, registered in .env.example, the web env schema, the web Dockerfile, docker-compose.yml, turbo.json and the Playwright web server; the app honours EXPO_PUBLIC_FEATURE_GOOGLE_LOGIN, EXPO_PUBLIC_FEATURE_FACEBOOK_LOGIN and EXPO_PUBLIC_FEATURE_APPLE_LOGIN; supabase/config.toml has a disabled [auth.external.apple] block fed by APPLE_CLIENT_ID and APPLE_SECRET; the app adds expo-web-browser, expo-apple-authentication and expo-crypto and declares the Sign in with Apple entitlement. (#1010)

  • A new @questify/design-tokens package holds the semantic colours, brand palette and radius, spacing and duration scales; the web's Tailwind preset builds its colours and radii from it with no change to the compiled CSS, and the mobile app styles with NativeWind v4 from the same tokens (tailwind.config.ts, global.css, Babel and Metro), compiling one rem to 16 points as a browser does so Tailwind's spacing and type sizes match the web (nativewind.config.js). The app adds Reanimated and react-native-worklets, which NativeWind needs, class-variance-authority, clsx and tailwind-merge, and runs component tests under jest-expo with React Native Testing Library beside its Vitest suites (pnpm --filter mobile test runs both). Part 1's plain src/ui/form.tsx is removed (#1011).

  • The mobile app adds lucide-react-native with react-native-svg for icons, imported one file per icon because Metro does not tree-shake (the package entry would add about 2.5 MB; the shared React Native lint config refuses it), and expo-navigation-bar. src/navigation/routes.ts is the app's route map, and the theme's concrete colours for React Navigation come from the tokens (src/theme/colors.ts) (#1011).

  • The onboarding step order and copy (onboarding/steps), the step form schemas (onboarding/validators) and the avatar form fields (profile/avatar-change) moved from apps/web to @questify/core, with their tests; the web imports them from there with no change in behaviour, and the step failure and retired-pack messages are shared constants (#1011).

  • The dashboard greeting (dashboard/greeting), streak wording (quest-recurrences/streaks), the scheduled-window line (quests/schedule-display), task counting and recurring-cycle folding (quests/task-counts), the display-name rules (profile/display) and the paged PostgREST reads that get past its 1000-row cap (postgrest/pages) moved from apps/web to @questify/core with their tests, and the web imports them from there with no change in behaviour. The mobile app adds expo-haptics, mirrors NEXT_PUBLIC_FEATURE_QUEST_RECURRENCE as EXPO_PUBLIC_FEATURE_QUEST_RECURRENCE, and shares useTaskStatus and TaskStatusButton for status changes (#1012).

  • The stall banner's rules and copy (quests/stalls, plus formatStallIdle() in quests/stall-idle), Year Theme progress (year-themes/progress) and the weekly review's columns and shape (weekly-review/latest) moved from apps/web to @questify/core with their tests; the web imports them with no change in behaviour. The mobile app mirrors NEXT_PUBLIC_FEATURE_STALL_DETECTION, NEXT_PUBLIC_FEATURE_STALL_AI and NEXT_PUBLIC_FEATURE_WEEKLY_AI_REVIEW as their EXPO_PUBLIC_FEATURE_* twins, and subscribes to Realtime only through useRealtimeHint (#1012).

  • The Quests index's filtering, chip counts, recurring collapse, sorts and cycle line moved from listQuestIndex() in apps/web to @questify/core/quests/quest-index, and intervalToMinutes() / intervalToDays() to @questify/core/quest-recurrences/interval, with their tests; the web calls them with no change in behaviour (#1013).

CI/CD

  • The Release workflow copies NEXT_PUBLIC_FEATURE_PARTY_EMAILS, NEXT_PUBLIC_FEATURE_GUILDS, NEXT_PUBLIC_FEATURE_GUILD_INVITES and NEXT_PUBLIC_FEATURE_TASK_ASSIGNMENT_EMAILS from Vercel to the Fly worker with its other flags, refuses a Fly secret that would shadow them, and warns when one is off; scripts/worker-deploy.test.mjs pins each (#1009).

Tests

  • supabase/tests/cycle_streak_lapse.sql pins when a cycle counts towards its streak: not after its window closes while its local day is open, at local midnight on Toronto's 25-hour fall-back day, at the end of a window that crosses midnight, not before its start even if finished early, and the same number from get_quest_cycle_streaks() and get_my_today_cycles() before and after the lapse sweep; supabase/tests/rls.sql pins that no client can call the new settle helper and that the streak stays signed-in only (#1059).

  • lib/supabase/request.test.ts covers a valid token, an expired or empty one, Supabase Auth being unreachable, the cookie fallback and a caller with neither. Each moved handler's route test runs the Bearer path for success (checked against its @questify/core schema, with the cap and the charge made through the token's client), 401, the handler's refusals and a malformed id (#1008).

  • The coach and investigation route tests run the Bearer path for success (checked against the @questify/core response schemas, with the cap and the charge made through the token's client), an expired token, a plan refusal, a validation failure and, for investigations, a task the caller cannot reach and an exhausted balance. Core tests pin the coach request's leniency and the seed's error sentences (#1008).

  • Route tests for the four new handlers cover the Bearer path (checked against the @questify/core schemas, with the work done through the token's client), the cookie path, 401, the flags, validation, account deletion's content-type check and each refusal's status. invitationErrorCode() has its own table test. The existing account, similarity, party and guild action suites pass unchanged against the extracted functions (#1008).

  • task-evidence.test.tsx's caption-polling test no longer flakes on a loaded runner. It advanced the clock once the "Describing" text appeared, but the poll is an interval a passive effect registers, which can come later. It now waits for the component's own interval first (#1008).

  • supabase/tests/achievement_awards.sql covers the awards through a plain signed-in client: clients cannot run the award functions or read the catalog, a first quest, milestones, a streak back-dated across three days, a pack, public and challenge quest, a Party Quest finished by a member (Party Closer to both accounts, nothing for the accountless seat, the owner's milestones to the owner only), AI Scout for the initiator rather than the owner, and no duplicate on re-completion. achievement_awards_concurrency.sql races two completions for the same owner past the fifth quest, and rls.sql covers the service-only catalog, the award functions being out of client hands and a client's own completion earning a row it can read. definitions.test.ts fails if the catalog migration and definitions.ts disagree (#1009).

  • supabase/tests/party_seat_parity.sql covers the guild add's notices (account seats only, not the caller, nothing on a repeat or from the seating function a mint uses), the self-action skip, and the refused seat and invitation writes. in_app_notifications.sql checks that a claim and a guild invitation write exactly the notices for the quests they report, and rls.sql covers the new write rules. Suites that seated people through the client role now do it as postgres (#1009).

  • supabase/tests/email_outbox.sql covers every enqueue point (recipients, payloads, the self-action and system-write skips, the timezone of a due date, nothing from the seating function a mint uses), the worker's claim (template filter, category, skip reasons, reclaim, five-attempt failure, expiry), completion and retry backoff, and that clients reach none of it. The party and guild owner-email suites assert the queued row in place of the client claim, and worker Vitest covers delivery, the loop's flags and setup, and the moved templates (#1009).

  • supabase/tests/atomic_writes.sql covers the four create RPCs (pack and drafted tasks in order, the caller as owner whatever _quest says, refusals that leave nothing behind, onboarding re-entry and a deleted first quest, a retired pick still cloned, a second jam join) and the mint inside the recurrence saves, including a failed mint that does not undo the save. quest_recurrence_save_concurrency.sql shows two saves of one owner's recurring Quests running one at a time rather than deadlocking in the mint, and rls.sql asserts the new RPCs' grants. quest_recurrence_edit_pause.sql and the web action and route tests assert the one-call shapes (#1009).

  • supabase/tests/app_rule_enforcement.sql covers every lifecycle move a client can and cannot make, the exempt system writers, each new CHECK at its boundary, the template INSERT revocation, signup sanitising, Year Theme writes and the onboarding functions and guard; the existing suites now create recurring Quests and change onboarding through the functions. Web tests cover the status refusals, the onboarding actions' RPC calls and the screenshot path filter. (#1009)

  • supabase/tests/feedback_status_outbox.sql covers the feedback status email through an admin's own PostgREST update: one row per report, nothing for a re-save, a non-final status or a report already emailed, a new row after an expired one, any writer, and the reporter's opt-out at claim time. Worker tests cover the moved template, and the admin route test asserts the route sends nothing itself. (#1009)

  • Mobile Vitest suites cover the SecureStore session adapter (pinned key names, a session past the 2048-byte limit, interrupted writes), foreground-only token refresh, the auth routing rule, the stored pending-reset state, every auth form against a fake client, and the email-link callback's codes, refusals and reset states. (#1010)

  • Mobile suites cover which sign-in buttons show for every flag combination on each platform, the OAuth round trip, cancels, provider refusals and a code delivered twice, the Apple nonce and ID-token sign-in, and when Apple's name is saved; web tests cover the Apple button and the Apple branch of the OAuth action with its flag off and on. (#1010)

  • packages/design-tokens/src/parity.test.ts fails when the web's globals.css or the app's global.css differs from the tokens in either theme, declares a colour the tokens lack or lacks one they have, or when the web preset's colours drift. Mobile component tests cover every primitive by role, label and state (button variants, loading and disabled; field labels and announced errors; dialog and sheet dismissal from the backdrop and Android back, and reduced motion; toast announcement, timeout and tap dismissal; card, badge, alert, empty state and list row), and the theme provider applying each profile preference and the system fallback. components/ui/sizes.test.ts compiles every button size, the text field and the list row with the app's real NativeWind options and fails on a target under 44 points, hit slop included, and checks that the field's placeholder colour follows the theme (#1011).

  • src/navigation/navigation.test.tsx renders the real app/ directory with Expo Router's testing library: the entry for each auth state, the sign-in gate over a deep link and a reset session, all five tabs and back to Today from another tab, a deep-linked quest with the index beneath it, the create and edit sheets pushed from a tab and opened cold from a link, the capped tab label scaling and sign-out. routes.test.ts fails when a screen under app/, the route map, docs/mobile/routes.md or the web app's pages disagree, and colors.test.ts covers the token-to-hex conversion and the navigation theme (#1011).

  • Mobile suites cover the onboarding gate (an unfinished account sent to the wizard from the entry and from a deep link, a finished one sent on, a failed read failing open), every onboarding write against a recording client (the RPC arguments, the active-pack check, field errors with the web's copy, the generic message in place of a database error, a stale finished wizard), and the wizard screen: the step shown, Continue, skip, Back, a field error, finishing, Finish setup later, sign-out and the load retry (#1011).

  • Mobile suites cover the Today reads against a recording client (the cycle mint first, each RPC's arguments, every section's failure value, including Today after a failed cycle mint and Up next and the preview failing rather than reading owner-only when memberships can't be read, Up next's exclusions, the folded preview with task counts read past the 1000-row cap), the phone-timezone days (23:59 → 00:00, both US daylight-saving days, a half-hour zone), the optimistic status reducer and hook (shown at once, reverted on an error or a silent RLS refusal to the last saved status, one write at a time, haptic and re-read on success), each Today section's failed, empty and filled states, and the tab itself from the real app/ directory: its sections, pull-to-refresh, the foreground re-read and a tick (#1012).

  • Mobile suites cover the Realtime hint (INSERT and UPDATE bindings per table and never DELETE, tasks scoped by quest_id=in.(…) filters to the person's own and joined draft and active quests rather than every public quest's, one re-read per burst and at most 3 s after its first event, one after a reconnect, nothing while the tab is not listening), the stall reads (stall detection off, the generated copy dropped with stall AI off, a failed title read hiding the section) and writes (each RPC's arguments, the web's copy in place of a refusal), the Year Theme and weekly review reads, the stall banner's controls and check-in dialog, Needs a nudge, the Year Theme slot and the weekly review card, and the tab re-reading without the cycle mint on a Realtime hint (#1012).

  • Core suites cover the Quests index (the collapse under open and settled filters, each chip counted without its own filter, the Party rule, theme and template narrowing, each sort, the cycle line); mobile suites cover the tab's read (the mint first, a failed seat or quest read failing the whole list, the Party chip's and markers' reads failing soft), the per-card details, the in-memory view, each card line, the chips and toolbar, and the tab from the real app/ directory: local filtering without a re-read, the empty and failed states, a recurring Quest's cycles and Back, more cards on scroll, pull-to-refresh, a search box that follows a query cleared by Show all quests, and card details that still land after a refresh fails (#1013).

Documentation

  • docs/api-endpoints.md has a "Mobile app: Bearer handlers" section: how the caller is decided, the error body and its status codes, and each handler's Mobile status and contract, including the ones later slices of #1008 will add (#1008).

  • docs/api-endpoints.md marks the coach and investigations as Bearer handlers, documents the coach's two request kinds and the investigations' refusals, and packages/core/README.md lists the api/* contract modules (#1008).

  • docs/api-endpoints.md documents the four new handlers and marks them Bearer in its Mobile table, docs/mobile/architecture.md names their paths, and packages/core/README.md lists the moved validators and the new contracts (#1008).

  • docs/mobile/architecture.md records the Party Closer decision and marks the achievement rows of its inventory done, docs/quest-attendance.md describes the award by trigger, and docs/schema.md lists the migration (#1009).

  • docs/ops/feature-flags.md lists NEXT_PUBLIC_FEATURE_PARTY_INVITES as retired and says the database writes in-app rows whatever their flag says; docs/notifications.md, docs/api-endpoints.md, docs/schema.md, docs/ops/deployments.md and docs/mobile/architecture.md (items 2 and 6 done) follow (#1009).

  • docs/notifications.md has an "Email outbox" section and rewrites the party, guild and task assignment emails as worker emails; docs/ops/feature-flags.md marks the four flags as worker-read with their Fly checklists; docs/mobile/architecture.md marks its outbox item and inventory rows done; docs/schema.md documents email_outbox; .env.example says which flags the worker reads (#1009).

  • docs/mobile/architecture.md marks the atomic-write and mint inventory rows done and corrects its claim that no cron job mints recurring cycles; docs/schema.md lists the migration; docs/api-endpoints.md documents POST /api/quests's drafted tasks and response (#1009).

  • docs/mobile/architecture.md marks the app-only checks enforced, records the avatar host the database cannot check and the reversal of #462's free-form status edit; docs/schema.md and docs/api-endpoints.md describe the new migration and the quest create and update refusals. (#1009)

  • docs/mobile/architecture.md marks the last inventory rows done and records #1009 as complete, with pgTAP's plain signed-in callers as the parity proof; docs/notifications.md, docs/ops/deployments.md and docs/schema.md describe the feedback status email as an outbox email. (#1009)

  • docs/mobile/authentication.md describes the app's session storage, routing, screens, email-link contract and redirect allowlist; AGENTS.md and docs/ops/deployments.md point at it and name the hosted redirect URL step. (#1010)

  • docs/mobile/authentication.md describes third-party sign-in in the app (the iOS rule, both Apple paths, the nonce, the name, the double delivery and each provider's setup issue), and docs/ops/feature-flags.md has the Apple row and notes the app mirrors on the Google and Facebook rows. (#1010)

  • docs/mobile/architecture.md records Decision 8, styling with NativeWind v4 over shared design tokens, with what the spike measured (Hermes export on both platforms, about +1.2 MB of bundle, component tests under jest-expo) and what it leaves for the first device pass, and adds the shared-tokens rule. AGENTS.md describes packages/design-tokens and the app's styling, primitives and component test rules, and packages/design-tokens/README.md explains how to add a token (#1011).

  • docs/mobile/routes.md records the app's navigation: the tab, stack and sheet structure, the sign-in gate, every route with the web path it mirrors, its placement, owning issue and proposed Universal Link handling for #1025, the web pages the app leaves out, and how to add a screen. docs/mobile/authentication.md lands signed-in people on /dashboard, and AGENTS.md describes the navigation rules (#1011).

  • docs/mobile/authentication.md describes onboarding in the app: where an unfinished account is sent, how the state is read, what each step writes and what the app does not do yet. AGENTS.md and the route map point at it, and packages/core/README.md lists the moved modules (#1011).

  • docs/mobile/today.md describes the Today tab: what each section reads and shows when it fails, when the tab reads again, how days are decided and how a tick is written. AGENTS.md points at it and packages/core/README.md lists the moved modules (#1012).

  • docs/mobile/architecture.md Decision 5 now records tasks and quest_stall_notifications as published, the Realtime column filter read from production, the rule to subscribe to INSERT and UPDATE only, and why tasks is subscribed through quest filters rather than RLS alone (public quests' tasks are readable by everyone); docs/mobile/today.md covers the new sections, live updates and a stall's controls, AGENTS.md adds the Realtime rule, and docs/ops/feature-flags.md notes the three new mirrors (#1012).

  • docs/mobile/quests.md describes the Quests tab: its one read and what fails soft, the in-memory filtering shared with the web, the per-card details and links in; AGENTS.md and docs/mobile/routes.md point at it and packages/core/README.md lists the moved modules (#1013).