← TAS Portal · Documents · Engineering FAQ
Snoraire · Engineering review · 2 November 2026 · v1
Recording, analysis and results saving
Status and scope
This handoff covers one consumer recording session and the proposed structured-results save flow. It expands the product overview into engineering interactions. The diagrams describe intended behaviour; they do not establish implementation or release acceptance.
- Existing source pattern: recording controller owns capture outside screen lifecycles; the durable pipeline owns analysis finalisation.
- Current product direction: 2–8 recorded hours inclusive, stop at eight hours, and separate audio-quality checks. Recorded duration is not measured sleep.
- Proposed: verified accounts, owner-protected structured results saving and safe retries. Payload fields, score parameters, quality, retention and deletion policies still need agreement.
- Consumer boundary: raw audio, playback clips and raw waveform stay on the phone in staging/production. Research collection has a separate build and contract.
1. Capture and local analysis
Participants run left to right; numbered messages run downward. Analysis readiness, score eligibility and server-save status are separate states.
2. Structured results saving — proposed
Target review contract, not a verified route inventory. Reuse equivalent existing endpoints where they satisfy the contract.
Responsibilities and existing tracking
| Area | Engineering boundary | Existing tracking |
|---|---|---|
| Capture / recovery | Reuse the shared controller and ledger. Preserve rollback, saved-duration reporting and recovery from capture facts. Agree short-session retention and recovery actions. | EAS-26 / EAS-27 device gates; EAS-88 screen states |
| Analysis / report | Preserve the sole analysis.finalize writer. Screens read/request analysis. Distinguish ready, analyzing and unavailable from score eligibility. Do not adopt provisional score parameters as approved. | Current PRD duration/score sections; parameter and quality approval open |
| Account/results saving | Server derives owner from verified session, validates payload/schema/units and enforces immutable analysis revisions, operation-key reuse and revision conflicts. No new auth provider or generic sync framework. | EAS-98; data/API draft |
| Deletion / account changes | Never move unsynced data between logins. Deletion defeats stale writes. Automatic audio pruning differs from manual Delete all recordings; exact scope and provider exceptions need approval. | EAS-54 / EAS-126 |
| Optional care | Outside these diagrams. Authenticated consented SG/MY CRM submission, destination receipt and human response remain distinct. No booking/payment or silent country rerouting. | EAS-87 / EAS-125; full app journey |
Source check and implementation gaps
Inspected local Reverie commit: 653cf4707af83edf039a10c5e7150b3d9771618e. This is a pinned local review, not a claim about latest upstream or deployed code. Paths below are relative to that repository.
| Inspected source | What it establishes |
|---|---|
apps/airese-mobile/lib/recording/session-controller.ts | Shared capture/stop controller, auto-stop path and research collection seam. |
apps/airese-mobile/lib/analysis/request-night-analysis.ts | Reads existing analysis or requests a pipeline pass; returns ready, analyzing or unavailable. |
apps/airese-mobile/docs/decisions/AMOB-0031-one-writer-of-the-night-analysis.md | Single production writer and dependency handling. Its historical device evidence was not rerun. |
apps/airese-mobile/lib/research-collection.ts | Product pipeline is local and adds no research upload stages. Research upload code is not consumer account/results saving. |
Gap: the inspected source does not establish the proposed consumer save queue/API. Review exact auth/routes and map the agreed contract to implementation before enabling it. Research code comments describe retired account-level grants; the build split alone does not prove consent compliance.
Open decisions before implementation
- Agree score definition/version, quality/coverage rules and unavailable-result wording. This diagram approves no clinical cutoff.
- Freeze profile/result/notes fields, validation bounds, API responses, conflict resolution and owner-bound queue policy.
- Agree short/interrupted-session handling, automatic pruning, explicit deletion, retention and provider exceptions.
- Identify exact app/API candidate, environments and implementers. No new named owner or deadline is assigned here.
Existing acceptance gates to demonstrate
- Capture: start failure/rollback, lock screen, interruption/relaunch and manual/automatic stop. Check 2h minus one second, exactly 2h, exactly 8h and attempted 8h plus one second. Capture must stop at the maximum.
- Analysis: pending inputs, exhaustion, retry/recompute, no duplicate final writer, accurate unavailable reasons and absent-media playback. Approved identical inputs produce repeatable outputs.
- Saving: offline local report; pending/failed/saved states; lost-response retry; same-key/different-payload conflict; stale revision; revoked session and cross-user rejection.
- Data safety: account changes do not reassign queued data; deleted data cannot be recreated by stale retries; remote pending/failure stays visible. Capture network/storage evidence that prohibited consumer media is absent.
- Devices: retain EAS-26/27: three consecutive eight-hour release-build nights per supported class; at least 98% coverage; no gap over 75s; Android flat memory and zero silent loss; iOS results within five minutes after reopening. Record build, phone, OS and failures as well as passes.
These restate the referenced gates. No acceptance pass is claimed.
Canonical references and editable sources
- Current PRD reconciliation — read 28 October updates before historical sections.
- Account/results API draft — proposed data model, endpoint shapes, ownership, retry and erasure.
- Full product requirements and evidence limits — onboarding, history and optional care.
- Capture/analysis Mermaid · Proposed saving Mermaid
The diagrams are embedded: share this HTML without companion images. Editable sources are available from the links above; canonical references open in this portal. No canonical requirement, ticket acceptance criterion or generated dashboard snapshot was changed.