V1 accounts, recording data and protected APIs · draft
Fresh SG / MY schema evidence · 3 November 2026
Version: 2026-11-03-crm-schema-payload-v1. Read the schema comparison and payload proposal (internal working reference; not published). Both connections are verified sandboxes. SG Lead B2C and MY End User share core callback fields and Lead Source Airese; MY requires Mobile. These are candidate mappings, with no new scope approval or completed write/receipt test. The report preserves the full regional diff and pending payload, owner, consent and retry decisions.
Current owner confirmation — 2 November 2026
Version: 2026-11-02-owner-confirmation-v3. Read the current confirmed decisions (internal working reference; not published) first. Shane confirms password sign-in decided by Jonas and Shane (D-01), the current provisional formula approved last week in the Ervin meeting with ongoing Jonas testing/tuning (D-02), and Night Notes plus bedtime reminder approved for MVP last week (D-28/D-29). Exact historical dates were not supplied.
D-06/D-15/D-21/D-26/D-27/D-20 await today’s meeting confirmation. D-07 research is due Wednesday, 4 November. D-25 result hierarchy joins today’s approval priorities. Earlier conflicting approval-status and MVP-inclusion wording below is historical. Formula approval is separate from category bands, clinical/device validation and release acceptance. No ticket closes solely because these records change.
Latest decision reconciliation — 2 November 2026
Version: 2026-11-02-granola-refresh-v1. Current Excel decision log; source reconciliation and open decisions (internal working reference; not published). The workbook contains the current review log, all 19 concerns, prior decision history and source evidence. The 29 October account/password and audio-only deletion discussions conflict with earlier proposed contracts. SG Deals versus Leads and API versus form wording also need confirmation. These are recorded conflicts, not approved requirement changes. November remains an invited technical beta; January is the broader launch direction. Final approvals and acceptance evidence remain pending.
Earlier dated content in this document is historical where it conflicts with the refresh. Notion alignment is pending access; no release, implementation or clinical/legal acceptance is established here.
Management review update · 28 October 2026
Version: 2026-10-28-management-review-v1. Shennan approved these four documentation updates after reviewing the 23–28 October chat. Policy values and clinical thresholds remain open.
- Management view: lead with source UI, plain English and the 1.0/1.1/1.2 relative weights. Keep equations, simulator and API/environment diagrams available in expandable technical detail.
- Full profile: show the existing V1 Profile screen. Decide which fields are required, why each is needed and when to collect it. Prototype fields are not an approved collection list. Account signup and email verification remain the direction; SMS awaits Malaysia Twilio setup.
- January only: the proposed repeated-pattern rule is three qualifying nights in a rolling seven-day window. Define qualifying nights, missing-night handling and care wording before implementation. It is deferred to January, outside MVP scope, and is not an approved medical threshold. MVP care access is proposed after one usable night.
- Phone audio: choose automatic pruning window or low-space trigger, removal order, warning and retained report/notes fields. Protect active capture and processing, show unavailable playback accurately and prevent stale writes. Automatic pruning is distinct from manual Delete all recordings, which retains its proposed all-recordings/reports/related-night-data scope.
- Server retention: decide retention, user notification, erasure and provider exceptions for inactive accounts and sleep results, including users who uninstall. Uninstalling is not account deletion. Staging and production store no raw audio on the server; research upload retention is a separate consent/purpose decision. No retention duration or storage budget is approved here.
Earlier dated records remain historical where they conflict with this update. No implementation, device acceptance or release approval is added.
CRM handover diagram alignment · 2 November 2026
Version: 2026-11-02-crm-handover-v1. This aligns the portal handover diagram with the current API direction and owner confirmations (internal working reference; not published). It adds no scope approval or completed integration evidence.
- The user signs in with a password and chooses a callback, explicit country and contact details. Disclose the recipient and permitted fields; capture care consent separately from marketing and research.
- The authenticated Airese backend validates approved fields and consent, saves a durable request reference and uses an idempotency key for retries. CRM credentials stay on the server.
- Route Singapore requests to the SG Zoho API and Malaysia requests to the separate MY Zoho API. Exact modules, person/request mapping and regional owner remain open. Unsupported countries need an agreed alternative; do not silently reroute.
- Confirm destination receipt and show accurate delivered, pending or failed status. Match identity and prevent duplicate records on retry. Backend acceptance, CRM receipt and human response are distinct.
- The assigned regional care team picks up the request. CCC read access to both systems, staffing and response promise require confirmation. Booking and payment are separate.
Shane, Jonas and regional care/CRM owners need to confirm D-06, D-15, D-21, D-26, D-27 and D-20: modules/API contract, profile mapping, country/state/postcode routing, triggering-night/no-night payload, disclosure/receipt/retries and consent boundaries. Test SG and MY separately through CRM receipt and human pickup. No unapproved sleep-result fields are implied.
The September Zoho Form/accountless diagram is historical. Related ticket counterparts are EAS-87 and EAS-125; Notion alignment remains unverified because no connector is available in this session. This presentation update does not change their acceptance criteria or close either ticket.
Accounts, deletion, release data and CRM flow · 28 October 2026
Version: 2026-10-28-account-data-crm-v1. Source: Shennan’s current clarification and supplied deletion-flow context. Account signup with email verification is the current direction; accountless setup is superseded. SMS verification depends on Malaysia Twilio provisioning and verification, with no committed completion date. This replaces January as a fixed SMS assumption.
Deletion proposal for the account flow
The menu contains Delete all recordings, Delete account and Logout. Delete all recordings removes every recording, report and related night data in the declared local/server scope, while keeping the account. Delete account removes the identity and governed data and revokes sessions. Logout ends the session without deleting the account. The accountless alternative is historical, not a current option.
Use a full-height confirmation sheet: Delete all recordings? “All recordings, reports and related night data will be permanently deleted. This can’t be undone. Save any reports you want to share with a medical professional first.” Buttons: Keep recordings / Delete all recordings. After confirmed deletion, Reports shows No recordings yet and Record tonight. Preserve honest pending/failed remote status, block stale retries and define the separate research/CRM erasure process. Management still needs to approve the exact deletion scope and provider retention exceptions; this replaces the audio-only-retain-report proposal as the recommended menu.
Three release/data boundaries
- Staging: internal testing; no server storage of raw recordings, playback clips or raw waveform data. Test results and approved metadata only.
- Research preview: beta features and user-initiated sleep-result uploads. Define the payload, consent, retention, withdrawal and whether any raw data is included before enabling uploads; the current direction does not specify that raw-data scope.
- Production: main app; no server storage of raw recordings, playback clips or raw waveform data. Approved structured account/results data only.
Use separate endpoints, credentials and permissions. The diagrams describe intended boundaries, not evidence that the environments are deployed or that storage/payload controls pass.
Direct CRM handoff for Thursday 29 October
Submit callback requests plus agreed sleep-result context directly through CRM APIs, not webforms. SG and MY write to separate CRM databases within their respective Leads / Deals constructs. CCC is intended to have read access to both. Confirm country selection, permitted result fields and consent, the Lead-to-Deal mapping, receipt, access roles, response promise, duplicate prevention and fallback with CCC. Decide what happens for users outside SG/MY; do not silently reroute. Singapore payment/booking is removed from this handoff approval.
Distribution and pack layout
For iOS, share the TestFlight invitation link after the build is available for external testing; Apple’s external group and beta review requirements still apply. Android needs a separate route. Apple guidance. The standalone test-plan section is removed from the meeting pack only; existing device/security/privacy/operational acceptance gates remain in the linked test plan. Timeline title: Path to 11 Nov launch.
Version: 2026-10-26-draftpack-v1 · Prepared 26 October for Wednesday 28 October 2026. Working draft; recommendations below need approval. The recorded decision baseline remains 2026-10-26-signoff-v1.
Source: 26 October meeting record (internal working reference; not published).
This is an implementation contract to review, not a migration or claim that server sync works. Reuse the existing schema proposal (internal working reference; not published) and hosting specification (internal working reference; not published); the 26 October account decision supersedes their historical accountless product direction. No infrastructure redesign is needed for this draft.
Existing pieces and scope
Local source at 653cf4707af83edf039a10c5e7150b3d9771618e has Better Auth user/session/account/verification tables, an auth router mounted under /api/auth, and product routes under /api/v1. Session middleware includes requireAuth, requireAuthFromDatabase, optional auth and admin checks. This identifies reusable pieces; it is not a full route audit or proof every route is protected. Passwordless first-use/returning/deletion paths still require exact-candidate review.
V1 draft includes verified email identity, account-linked consent, user-owned recording metadata, versioned results and structured Night Notes, safe retries, authenticated callbacks and deletion. It excludes second-phone restore UI, raw consumer-audio upload, an admin health dashboard and a new auth provider. Research uploads retain their separate grant/token/consent contract.
Minimum data model
| Entity | Reuse / fields required by the draft | Invariants |
|---|---|---|
| Existing users / sessions / accounts / verifications | Existing identity and session expiry; minimum agreed profile | Do not duplicate auth tables; client input cannot set owner/admin/verified status |
| Existing consent events | User, document type/version, action, server receipt time, source | Reading a document is not acceptance; optional purposes remain separate |
| Proposed recording_sessions | Internal ID, public recording reference, user_id, client session ID, UTC start/end, timezone, captured media duration, capture status, approved context, revision, deleted_at | Unique user + client session; owner assigned from verified server session; capture duration is not sleep duration |
| Proposed recording_analyses | Recording FK, immutable analysis revision, schema/pipeline versions, input digest, generated/received times, eligibility/quality/coverage, approved result payload/projection | Summary and payload written consistently; unavailable differs from zero; validate size, units and finite values |
| Proposed score_definitions / recording_scores | Exact definition/parameters/quality contract, approval status, input snapshot, output, status/reason | No client-supplied “approved” flag; preserve original versus explicit recalculation; highlights not merged into snore score |
| Proposed recording_annotations | Recording FK, versioned selected factor/remedy IDs, nullable integer 1–5 subjective rating, revision/timestamps | Notes are independent of score/analysis success; no free text by assumption; copying cannot mutate the prior recording |
| Deletion status / intent | Existing erasure mechanism where possible; operation ID, owner, scope, requested/completed time, monotonic revision, pending stores | Reuse before introducing a new table; tombstone defeats stale retries; approve audit retention |
| Callback delivery record | Reuse existing request mechanism if present; opaque reference, owner, explicit country, approved fields, care-consent version/time, destination/status timestamps | Idempotent; country fixed for the submitted request; only the agreed consented sleep-result context; exact fields require CCC/privacy confirmation |
Use the five proposed recording tables rather than a generic sync framework. Final field types, FKs, indexes and migration order must follow the existing Drizzle/Postgres patterns after query needs and payload approval. This draft does not add a consumer-media table or store audio in JSON.
Proposed API contract
The paths below are proposed endpoint shapes, not an inventory of existing routes. Keep existing equivalent routes if they satisfy this contract; do not introduce duplicates just to match these names.
| Operation / proposed path | Authorization and validation | Observable result |
|---|---|---|
| Existing auth under /api/auth | Public only for deliberate OTP initiation/verification; rate limits, expiry/replay protection and allowed origins | Email OTP produces an authorized account/session; invalid/expired/replayed credentials fail safely |
| GET /api/v1/me | Valid session | Minimum approved own-profile response; no health fields by default |
| PUT /api/v1/recordings/:clientSessionId | Valid session; owner derived server-side; unique user/client session; allowed state transitions | Same retry returns same recording; conflicting revision/payload is rejected, not overwritten |
| POST /api/v1/recordings/:id/analyses | Recording ownership; allowed schema/version; finite values/units; size bound; approved metadata | One immutable revision per idempotency key; conflict returns a resolvable error |
| GET /api/v1/recordings/:id | Recording ownership; deletion state checked | Own approved result only; a guessed other-user ID discloses no record |
| PUT /api/v1/recordings/:id/annotations | Ownership, catalog ID/version, nullable integer rating bounds, expected revision | Atomic update; stale edits rejected and latest safe version returned as policy permits |
| DELETE /api/v1/recordings | Ownership; explicit all-recordings confirmation; idempotency key | Erase owned recordings, reports and related night data; account remains; truthful pending/failed status |
| DELETE /api/v1/recordings/:id | Ownership; approved full-record scope | Tombstone blocks old writes; status identifies pending/failed stores |
| GET /api/v1/erasures/:operationId | Erasure ownership; minimum audit fields | Accurate pending/complete/failed status; no other user’s record details |
| POST /api/v1/callback-requests | Session; explicit SG/MY; field allowlist; care consent; idempotency key | Durable request reference; accepted, destination receipt and human response stay distinct |
| Existing account deletion | Fresh authoritative session/confirmation per sensitivity; approved local/server/provider scope | Sessions revoked, governed data erased or truthfully pending, historical retry cannot recreate account data |
Health probes, document reads and auth-initiation are deliberate public exceptions with minimal responses. “Lock every route” means every route is explicitly classified and sensitive routes are protected, not that the user must authenticate before reading privacy terms. Internal jobs/admin/service routes use separate service authorization; research upload tokens must not confer consumer-history access.
Required server rules
- Validate identity server-side; ignore or reject body/query user_id as an authority. Scope every lookup and write to the authenticated owner, including list/export/delete/status routes.
- Verify session freshness/revocation for destructive/sensitive operations. Do not trust client-side gating or an installation/device ID as proof of user identity.
- Validate request schemas and lengths, finite numeric ranges, known catalog/method versions and state transitions. Reject unknown sensitive fields. Avoid raw request-body or result logging.
- Scope idempotency to owner + operation + key. Same key with a different payload conflicts; retrying a completed call cannot create another report or callback.
- Use expected revision or equivalent conflict detection. Deletion wins over stale updates. Tombstone retention must cover the maximum retry/backlog/backup restore window approved for V1.
- On sign-out/account change, quarantine or clear previous-user local caches/queues according to the approved policy. Never reassign unsynced data to whichever account signs in next. Claiming pre-account local sessions needs explicit user confirmation and an approved rule.
- Store secret CRM keys only in the appropriate server secret store, independently by environment/country. The app contains no MY/SG developer credentials. Do not send them in chat, Excel or the deck.
- Staging and production must not upload/store raw audio, playback clips or raw waveform data on the server. Delete all recordings also removes governed results and night data; no retained-report exception is assumed. Research upload content is separately specified and consented.
- Staging, production and research destinations/credentials remain isolated. QA tokens must be restricted to intended test environments; test that production rejects them.
Implementation sequence after approval
- Pin app/API commit, auth flows, exact route inventory and runtime environments. Mark every route public/session/service/admin/research and its data purpose. Preserve existing error handling and research separation.
- Freeze fields, ownership, consent and erasure/retention choices. Review the minimal five-table migration and compatibility with existing users/shared services; rehearse rollback/restore in disposable staging.
- Add server authorization/validation, then idempotent writes and deletion enforcement before enabling mobile queues. A userId column without enforced ownership is insufficient.
- Wire the mobile queue with explicit owner and progress states: local, pending, saved, failed, deletion pending. Show only verified saved states. Second-phone download/restore stays out of V1.
- Prove round-trip save/reload, offline/retry, cross-user rejection, revoked sessions, account changes, deletion races, provider receipt and no prohibited payloads on the signed candidate.
Acceptance evidence is pending. EAS-1 owns scope, EAS-54/126 consent/erasure, EAS-98 annotations/persistence, EAS-87/125 callback, EAS-4/35 permitted measurement and EAS-88 screen states. Use their existing gates; implementation must wait on unapproved fields/thresholds rather than fabricate them.