Current entity families and the Delivery, Engagement, and Clinical flows represented by the product-development mind map
Guided views
Explore this system
Step through curated paths without changing the source diagram.
Beat
Next
ReadyChapter 01 / 01
Guided chapter
Diagram guideExplore this system
Inspecting compiled semantics
E ExportT ThemeS Style0 Reset+ Zoom in- Zoom outEsc Close
Find a node
⌕/
No matching nodes
Semantic passport
Verified source
Authored reach
Route probeChoose a start node
Pick two semantic nodes on the diagram
Choose the source, then the destination. Direction matters.
Semantic lensCompare system roles
Choose up to two semantic kinds. One reveals its real traffic; two compare only direct authored relationships.
Choose a kind to inspect its nodes and touching relationships.
Semantic radar
Building overview
Click nodeDrag to pan
Secure communications
• Communications references StaffUser or UserProfile through typed conversation membership. CLIENT_DIRECT requires an active portal identity; GROUP is staff-only. Owner-controlled membership changes share the aggregate lock with message sending.
• Conversation orders Messages by a unique (conversationId, sequence); the unique (conversationId, senderId, clientMessageId) deduplicates retries. Attachments are scoped to the same conversation and verified sender-owned uploads.
• Delivery's SessionAnalysis request read projection exposes has_draft_clips using one parameterized batch over active draft live_recording projects and confirmed same-project/same-organization studio_clip assets referenced by composition.settings.liveClips. Empty drafts, original source videos and composition blocks alone do not remove a request from the analysis queue. Queue and Studio next navigation skip ongoing requests with saved clips; View all open retains them. Archiving a draft releases its occupancy, while other active draft clips and completed/cancelled request history remain authoritative. No lifecycle reset or new completion event is introduced.
• Explicit DELETE delete_clips=true is restricted to unfinished drafts without active render work or protected final/delivery evidence. Delivery atomically archives the project, clears saved clip references, appends draft_clips_deleted version/actor evidence and tombstones only project-owned studio_clip/presenter_video/voiceover media as deletion_pending. Source recordings, shared library assets and completed exports are preserved. Upload/confirm and render creation serialize on project/request/source state so late operations cannot resurrect deleted work.
• SessionAnalysisDraftClipCleanupService runs within the existing Backoffice Delivery process, with bounded batches of 25 per minute and a 16-minute grace period exceeding signed upload lifetime. Durable media tombstones survive restart; failed private S3 deletion remains pending. Runtime identity needs scoped s3:DeleteObject; exact project/asset capture namespaces are validated, no whole prefix is deleted, and no private storage key enters logs or audit. Browser cleanup removes only the deleting staff member's recovery clips and capture checkpoints for that project. Successful deleted tombstones remain eligible for bounded re-deletion after one hour; reserved scan capacity also serves pending work. This removes signed PUTs that began before expiry and finish after the first deletion, without discarding durable deletion intent.
• Current MVP completion policy: the first successful final render automatically completes the linked open SessionAnalysis Request after confirming same-project/same-organization private final media. Manual start, submitted feedback and VIP delivery are not prerequisites for this automatic path. Waiting live and on-demand requests retain verified source/VIP identity and active assigned/global staff authorization. The existing idempotent transition preserves the first completedAt and never reopens cancelled work; queued/processing/failed/cancelled renders do not qualify.
• Immutable completed render jobs retain confirmed final-video evidence independently of the current project export pointer. Autosaving a newer revision while rendering cannot strand its request open or attach an old export to the newer revision. Delivery accepts a current confirmed final or resolves the earliest confirmed completed-job final, verifies same-project/organization ownership, and completes the owning request without mutating the newer revision's final pointer.
How to read this map
• Solid paths are current durable relationships or approved processing paths
• VIP experience ownership is read and changed only through the active Assignment; workload and package totals join those assignments to active VipProfiles
• Dashed paths are projections, future identity, or conceptual boundaries
• The original sample JSON was replaced by current schema-backed entity summaries
• SalesMembershipCapture has many SalesMembershipSilver rows and one SalesMembershipGold row. The unique day/revision selects an auditable observation; capture/VIP is unique. Silver technical VIP and subscription references are evidence, not cross-context database relations; source fields arrive through Identity and Engagement public contracts.
• Assets library shares private media across Program Assets and Studio; routines and VIT/VIP documents stay on ProgramAsset
• A stable technical source video may be referenced by multiple SessionAttendanceVideo and SessionAnalysisSourceVideo owner pairs for shared-device participation. Each VIP retains an independent SessionAnalysis/project. External_completion projects can have nullable sourceVideoId and empty sourceVideoIds; final_video confirmation, project attachment and request completion are atomic. Explicit video unavailability instead retains completed_without_video and completes the request without a final asset. Both remain separate from SessionAnalysisDelivery.
• VipProfile relates to its VIP/CRM-owned VipQuitterParticipationMonitor through the exact operational cus_ id. One durable episode references confirmed Delivery evidence by id/source/time/occurrence without copying attendance ownership. lastResolvedEpisodeId retains the latest completed episode; updatedAt rejects older scans, while current-episode lookup and prefix cleanup recover all superseded inbox items even after multiple resolutions.
• SalesRenewalCapture owns immutable selected-queue Bronze and dated-customer Silver rows, each unique by capture/customer, plus daily expected-count Gold unique by capture/dueDay. Day/revision selects the latest forecast; all layers commit atomically. Identity supplies sanitized public queue evidence, with no cross-context foreign key. Effective dates are forecast buckets, not renewal-cycle identities or proof of completion; realized/rate and historical completed quarters remain unavailable. PR2 stages 1–10 now implement the local operational cohort pipeline: Identity exports allowlisted plan/status/date/correction evidence for all stored contracts, including predecessors. Sales preserves original Expected due quarters, compares fresh observations for unique effective successors, technical plan changes and full operational-term rollover, and excludes installments, pauses, date corrections, future schedules and ambiguous/missing evidence. A one-per-cycle outcome plus journal handles effective successor cancellation, support replacement and subsequent term admission without duplicate realization. Cancellations of completed historical terms or unrelated predecessors do not erase a valid successor. Local snapshots, cycle/outcome updates, events, daily Expected/Realized/unknown Gold and publication metadata commit atomically under the existing advisory lock; stale, older, page-limited or shrinking sources cannot supersede published Gold. Legacy queue replay retains provenance/candidates without inventing missing old plan references or erasing rich evidence. Public-factory CLIs and the existing complete-import capture path read local data only, with no new timer/provider call. Authorized overview reads indexed published cohort Gold and computes conversion from summed counts in the same due-date range. Before cohort publication it retains the separate PR1 forecast scope. Conversion uses confirmed Realized divided by available Expected in the selected due-date range, including partial historical cohorts and positive confirmed subtotals with unresolved outcomes. Missing Realized or zero Expected remains unavailable; known zero remains distinct. Plain count labels and quality warnings explain the available-cycle scope. The existing Figma card shows operational cycle units, history/quality notes and stale/retry states. History is partial and full-refund detection requires unavailable local refund evidence; no payment confirmation is asserted. Renewal accuracy v2 persists mapped plan terms and schedule references while retaining staff overrides and incomplete-phase provenance. Identity owns StripeSubscriptionImportCompletion, written only after a successful unlimited source import; its public renewalCycleEvidence supplies bounded completion metadata to Sales. Fresh matching completion permits legitimate source-count reductions, while missing contracts remain unknown rather than canceled. Stable future schedules are assessed pending, exact-customer schedule activation is linked by schedule id, and activation alone does not realize a cycle. The local bounded sales-renewals:reconstruct CLI defaults to read-only preview; explicit apply atomically preserves observations, admits or matches immutable Expected cycles, confirms validated historical full-term/successor outcomes with provenance and original due attribution, appends journal evidence and publishes Gold. Existing cycles and realized/reversed outcomes are deduplicated; historical candidates are not automatically promoted. Reconstructed historical cohorts retain incomplete-denominator metadata and original evidence. Conversion describes only confirmed Realized relative to available Expected; it does not assert complete historical coverage. Explicitly named one-month plans require a complete one-installment calendar term; annual monthly installments retain annual semantics. Calendar anchors preserve month-end and leap-day boundaries. Reconstruction also prepares the next Expected term for each current effective contract. Scheduled successors require an exact customer/schedule link and a unique previous contract; retained rich observations and legacy Expected Bronze remain separate evidence sources so incomplete recent observations cannot hide preserved ownership. No new provider calls, worker, payment claim or automatic refund detection is introduced. Historical rule v2 reads bounded Sales forecast Bronze as of the observation cutoff and restores omitted past Expected cycles with their original due and observation dates. Exact schedule/customer links require a complete effective operational term and prior commercial membership or replacement-plan evidence; first sales, financing phases and ambiguous cases stay unresolved. Preview and locked apply use the same archive rules. A realized-term attribution key prevents one successor from fulfilling multiple reconstructed cycles, and existing realized/reversed outcomes stay protected. Earlier VIP participation dates are not contract corrections; explicit canceledAt supports effective predecessor evidence and late-import cancellation reversal. No schema migration or provider call is added.
• Anatomy image/GIF records consolidate into SessionAnalysisLibraryAsset with original ids, private object keys, description/region/view metadata and all pending/archive states retained. Legacy anatomy HTTP routes are guarded image-only views over the same canonical catalog; the original anatomy table is a sealed backup with no runtime access. Existing Studio anatomyAssetId and referenceMaterialId values and historical composition snapshots are unchanged; shared archive checks protect those references.
• Authorized external completion may explicitly record video_unavailable=true. Delivery atomically completes the request and retains completed_without_video project state and immutable actor/version evidence, without fabricating a final_video, render timestamp or delivery. The upload path still requires a confirmed private final asset; failed uploads keep requests open. The old local-review toggle is replaced by the explicit no-video choice.
Delivery flow
• ProgramAsset references shared media by tfd-media:library:id; saved programs retain their own versioned definitions
• A run generates SessionOccurrences and owns VIP, time-slot-specific Session Analysis VIT rosters, and an AddPipe level-code whitelist
• Only stored AddPipe videos whose normalized session code is whitelisted by the run enter its first future occurrence. Resumed runs accept uploads from the calendar day before sessionGenerationStartDate in the run timezone; explicit relocations override this window. Older recordings remain in the catalog.
• Every Program Run VIP is eligible before live attendance finalizes; evidence records on-demand-only, missed-live, or run-assignment reasons
• Automatic and occurrence-scoped manual links persist OnDemandAttendance atomically; grouped invalid uploads leave the pending queue together
• Before analysis exists, live attendance may move or be invalidated with durable staff evidence
• Staff explicitly create Session Analysis from saved attendance; automatic distribution uses only active VITs configured for the occurrence start time
• ConfirmedVipParticipationService dates positive live presence by occurrence scheduledAt and confirmed on-demand presence by original availableAt, including confirmed uploads linked to future occurrences. It excludes pending, invalidated, absent, cancelled and future live records. Identity reconcileWithParticipation invokes this public read under the same per-VIP transaction lock as current status validation and persistence; no historic Quitter status is inferred.
• identity.vip_quitter.participation_detected creates one configurable, default-enabled inbox item per active administrator and monitoring episode. Notifications serializes cleanup and fan-out under withSourceProjectionLock, rechecks Identity getCurrentEpisodeId and expires all superseded source episodes without resetting read state. A later actionable condition uses a new episode. Both lock callbacks must finish bounded local database work within 15 seconds; no payment or billing state is created.
Engagement and Clinical
• Engagement derives session-granular report facts after Delivery persists attendance
• The Engagement projection preserves occurrence, local day, phase/cycle, status, participation mode, and assigned VIT dimensions for report drill-downs. Existing period-fact and engagement-snapshot detail JSON adds optional nullable reportingPhaseKey. One shared normalizer requires an original nonblank phase id plus a complete normalized Phase1/Phase2 name to map phase_1/phase_2 while retaining original raw phase ids/names, cycles, source keys and occurrence ids. Generation/imports persist the metadata; legacy reads and native On-demand normalize compatibly. Canonical phase grouping keeps custom source phases and source cycles separate and monthly metrics unchanged. Original-phase cycle partitions prevent id collisions; unique existing month-view links remain stable and only ambiguous derived keys are qualified. A preview-default bounded CLI can annotate historical derived JSON with explicit compare-and-set apply; Delivery source/manual attendance and templates remain untouched, with no schema migration, new event or runtime. AttendanceReportRunsQuery adds a bounded public read of current confirmed, non-reopened OnDemandAttendance with non-deleted linked occurrences; later session/run cancellation preserves confirmed history. The public facade combines listReportOnDemandFacts with compact runTimezones metadata for source-referenced historical, cancelled or archived Program Runs absent from the active catalog. Referenced sessions resolve missing phase/cycle metadata; current membership never invents a historical phase. Report requests combine native evidence with materialized history in memory, use the canonical run timezone and optional session localDate, exclude unrelated phase/month facts, and count Live plus On-demand once per VIP/occurrence without changing durable facts or media ownership.
• Notifications keeps per-staff inbox, event preferences, and outbound delivery separate
• Clinical remains a planned isolated context and does not own general VIP operations
• Identity VIPProfile.privateSessionsOnly defaults false and describes operational group-session eligibility; it is independent of Clinical records, Program Run membership and Not Acc. Integrations preserves reviewed current-tab Touchpoint evidence for the explicit PS Only H3 Boolean and updates the Identity-owned profile through the public Identity import contract after an authorized imports.manage preview with stale-preview compare-and-set and safe completed-action audit. Engagement projects current eligibility onto source-linked period facts only at report read time. Month/week/day/session and VIT summaries retain PS Only visibility and separate counts, excluding these VIPs from expected group totals and low/no-attendance indicators. Underlying attendance status, source evidence and confirmed participation remain unchanged; roster-backed detail rows can show PS Only without fabricating a missed attendance fact.
Audit P0 and P1 coverage
• Identity, Clinical, Sales, Delivery and Integrations retain their state; Audit receives bounded facts through the synchronous public contract
• Staff/RBAC, Clinical and attendance/evidence changes commit with Audit. Private media and sensitive VIP concessions await durable evidence before disclosure
• Integrations owns MediaDeletionJob: committed intent blocks playback, leased bounded retries remove private objects, completion and Audit commit together; terminal failure has an authorized repair path
• Audit HTTP queries use explicit independent read, restricted-metadata and export grants, server organization scope and validated unsigned pagination; every page reapplies authorization and query limits. No Audit secret is required. Retention is held without automatic purge or receipt expiry
• P1 adds manual VIP changes, VIT assignment decisions, Program Run creation, manual attendance and named soft archives; existing video decisions retain one P0 fact and owner histories remain independent
Message template catalog
• Notifications owns MessageTemplate catalog records for email, SMS and WhatsApp, with string channel identifiers and a validated capability registry.
• Settings exposes Message Templates beside Notification Settings. Active StaffUser access and independent message_templates:read/manage grants authorize every route.
• Templates use draft, active and archived states, revision-checked updates, declared variables, visual email authoring and sanitized sample previews. Completed-action audit contains safe metadata only; the catalog does not enqueue outbound messages.
• Notifications also owns revisioned EmailSignature profiles. A template may select one active profile or none; each profile supplies its own optional header and footer. A bounded declarative schema permits approved logos, plain text and HTTPS links.
• One composer builds template/VIP previews and HTML/text delivery. Reviewed signature id/name/revision and composed content freeze in EmailDelivery; enqueue locks and rechecks the active signature. Only the configured public asset origin may load images in the sandboxed preview.
Track authoring — ADR 0083
• Delivery owns TrackDefinition drafts and append-only TrackVersion publications. Nested stages, decisions, routes and training profiles share one typed definition between Structure and Flow.
• Clinical owns immutable TrackQuestionnaireVersion health questions/rules. Identity adapters require explicit Clinical grants; Delivery resolves only approved identity/outcome codes through the synchronous Clinical public facade.
• Publication freezes safe video and exact whole-class Program version references. Catalog/media archival is guarded under dependency locks. Program Runs, existing on-demand attendance and recording processes retain their ownership.
• Delivery now owns TrackParticipation pinned to a published TrackVersion and append-only VipDirectionAction evidence. The direction queue composes existing ProgramRunVip links with a narrow Identity public projection of active VIPs, breaks and experience assignments. VIP execution and camera capture are implemented by ADR 0086. ADR 0085 adds Delivery-owned immutable progression policy versions, participation-scoped reviews, PT votes and append-only actions. Identity exposes scoped Platinum/Diamond Director and active linked VIT eligibility through ProgressionIdentityService. Review windows use persisted timestamps and server-clock checks; no scheduler is needed. Director confirmation preserves a destination; ADR 0086 schedules and applies the effective participation transfer. ADR 0086 adds Delivery-owned ProgressionTransition, TrackProgress, TrackExecutionAction and TrackRecording. A bounded poll in the existing monolith applies due Director-authorized transfers under roster locks and publishes existing participation facts after commit. Active UserProfile ownership gates progressive portal activities and private media. Clinical portalForm/portalSave own TrackQuestionnaireResponse and immutable submitted clinical answers, returning route outcomes only. Browser media uploads directly to private S3 and is frozen through an ETag-conditional internal copy; no API media bytes or new runtime service.
• ADR 0091 reserves VIP Journey for the composed lifecycle of TrackParticipation and ProgramRunVip, without a duplicate ledger. Track entities map to existing Journey tables and columns; immutable snapshots, legacy progression discriminators and LaunchDarkly keys remain stable. Programs remain reusable and independent of Tracks.
• Service Funnel question contracts add checkbox selections and ordered rankings (bounded string arrays), rating/opinion scales (bounded integers), and long text with optional prompt descriptions. Delivery validates current-activity answers and published option membership; routing uses explicit contains/first_equals predicates and rejects overlapping automatic outcomes. Existing snapshots and identity/prerequisite checks remain unchanged. Backoffice direct video upload reuses the private Assets library upload/confirm contract and resolves a stable ProgramAsset before applying the step; no signed URL is stored in the workflow and no new runtime service is introduced.
• ADR 0083 connected-workflow amendment: schema 4 TrackVersion freezes an entry stage and per-output destination references. Quiz/Form finite-answer ports or existing checkpoint outcomes connect to stage ids or explicit Finish; Lessons keep one continuation. Delivery validates acyclicity, reachability, answer availability and complete connections, then preview and owned progressive execution traverse the same pinned graph after activity/recording/review gates. Existing route activities and Clinical outcomes retain their contracts; schemas 1–3 remain ordered. No second progress ledger, new runtime, event or context boundary is introduced.
• Schema 4 optionally stores bounded per-node canvas coordinates in workflow.positions. Revision-checked draft saves and immutable publications preserve this editorial layout; execution and authorization ignore coordinates. Missing positions use automatic layout and deleted blocks lose their saved coordinates.
• ADR 0107 adds explicit scoped staff restart/version-replacement commands. Delivery supersedes the prior TrackParticipation, preserving its pinned snapshot, answers, media and Clinical references, and creates a new owner-scoped cycle. Reset starts empty; published-version replacement preserves compatible answers, completions and recording provenance within one TrackDefinition; revision/request fences reject stale commands and duplicate resets. Delivery-owned TrackExecutionEvent records distinguish bounded advisory portal observations from confirmed execution actions; neither telemetry nor playback progress proves completion. Staff operational response/history reads preserve Clinical isolation. The user-approved November 10 amendment to ADR 0102 grants active administrator/global StaffUsers all resolved Service Funnel executions through Identity canManageAllTracks, including unlinked clients and unassigned participations; non-global reviewer assignment and Director membership scope remain required. No new runtime, provider or cross-context event is added.
• Identity's completed-action audit sanitizer accepts the current track resource label alongside historical journey records; sanitized reset/version-change staff facts remain recorded without response bodies.
• Service Funnel Forms and Video Quizzes may freeze optionPoints aligned with choice/checkbox answer labels: each is a nonnegative integer up to 1000000. Connected priority Decision score conditions explicitly select scored questionIds from common steps encountered on every path, compare their sum with equals/gte/lte and retain first-match/default behavior. Delivery derives the sum from valid answers in completed, encountered activities; skipped answers contribute zero and checkbox selections contribute each selected option once. Staff fictional testing and owner-authorized execution share this evaluator. No independently incremented total, Clinical rule change, migration or publication rewrite is introduced.
Manual VIP email — ADR 0088
• Notifications owns EmailDelivery with the frozen active MessageTemplate revision, rendered content and reviewed sender/recipient. NotificationEvent carries emailDeliveryId only; EmailDeliveryFeedback and EmailSuppression retain normalized results and permanent-bounce/complaint blocks.
• Saved VIP email HTTP requires active StaffUser, vip_management.view and independent vip_email:send/read. Identity VipEmailRecipientsService resolves the exact internal profile and operational VIP id through its public facade; the worker rechecks deletion and unchanged recipient without importing Identity tables.
• The generic Notifications worker remains a channel-isolated durable fallback for Slack and leased/fenced email work. Amazon SESv2 sends one recipient with maxAttempts 1 and tfd_email_delivery_id correlation. An unresolved started send becomes uncertain rather than automatically resending; only definitive throttling uses bounded retries.
• After durable enqueue commits, an individual reviewed VIP email immediately attempts only its own delivery through the existing fenced EmailDispatcherService and returns the stored status. An identical request keeps the same delivery and cannot bypass scheduled retry time, duplicate a provider attempt, or drain unrelated mail.
• The existing Backoffice API owns an email-only composition-root pass in email-delivery-runtime.service.ts, registered only in AppModule. With EMAIL_DELIVERY_ENABLED=true it starts at bootstrap and checks every five seconds, without overlapping local passes, for approved due cycle schedules and queued email dispatch. Campaigns become visible only after their transaction commits; future due times, 60/120-second retry waits, expired-claim recovery and uncertain-send protections remain authoritative. The pass uses existing Notifications public services, stops with the API, and logs only sanitized failure codes. Slack, digests and the generic worker schedule are unchanged; no separate process, context, broker or email cron is created.
• Amazon SNS feedback must match the configured topic and verified signature using bounded allowlisted HTTPS certificates without redirects. Durable normalized feedback is correlated to provider message plus delivery id; permanent bounce/complaint suppresses current and future queued sends. Server delivery is not inbox/read proof. No CommunicationLog, Engagement fact or new runtime is created; real sender/DNS/AWS setup and deployment remain prerequisites.
• Notifications also owns revisioned EmailSignature profiles. A template may select one active profile or none; each profile supplies its own optional header and footer. A bounded declarative schema permits approved logos, plain text and HTTPS links.
• One composer builds template/VIP previews and HTML/text delivery. Reviewed signature id/name/revision and composed content freeze in EmailDelivery; enqueue locks and rechecks the active signature. Only the configured public asset origin may load images in the sandboxed preview.
• Signature authoring also exposes POST /email-signatures/:id/send-test, requiring an active administrator (StaffUser.userType=admin). A confirmation names the current StaffUser email; the server alone selects that recipient and checks the confirmed address and saved non-archived signature revision. A staff-scoped idempotency key and serialized one-minute limit atomically create EmailDelivery and a minimal email.signature_test.requested outbox fact. Test deliveries have recipientStaffUserId equal to the requesting actor, null vipProfileId/templateId, frozen sample content and signature, and no campaign. The existing fenced dispatcher immediately claims only that delivery, revalidates the active administrator address through Identity public contracts, and preserves SES/SNS feedback, suppression and uncertain-send protections. The API email-only pass and generic worker recover remaining queued work; no VIP record or separately deployed runtime is created. Administrator self-tests bypass the exact-recipient list through their separately authorized policy. The endpoint and dispatcher recheck administrator status; the global enabled flag, sender/SES/SNS configuration, recipient validity and suppression remain required. Other delivery uses its configured recipient policy, including the development-only current registered-VIP option.
Phase team communications — ADR 0090
• Identity publicly supplies bounded stable-VIP contact, status, membership, active-break and normalized shared-mailbox facts. Delivery publicly supplies current run/session audiences, cycle timelines and reviewed group/completion evidence; placement age is never completion.
• Delivery owns CommunicationRosterReview, PhaseTeachingPlanItem and PhaseResourceHandoff. Classification corrections preserve reason, actor/time, revision and append-only history. Teaching plans reuse ProgramAsset VIP document links; VIT guidance and temporary access URLs are not email resources.
• Notifications owns EmailCampaign, CycleEmailSchedule and StaffCommunicationTask. A reviewed campaign revalidates bounded bulk owner projections and atomically freezes private per-VIP EmailDelivery plus minimal NotificationEvent work under stable idempotency and template/signature locks. Cancellation affects queued work only.
• The existing notification worker activates no drafts automatically. Explicitly approved future cycle schedules use run timezone/calendar offsets, reevaluate due recipients and move changed or overdue intent to needs_review. Late joiners are considered at due time; historical catch-up requires a manual review.
• Calendar reads authorized staff tasks; due inbox notifications deduplicate by task/revision and never imply completion. Accepted frozen resource email reconciles idempotent Delivery handoff evidence. No new runtime, media path, VIP portal contract or graduation authority is introduced; existing Director progression governance remains authoritative.
• The false-default phase-team-communications flag gates staff navigation, Calendar reminders and all campaign/team HTTP routes without granting RBAC. Notifications rechecks each stored authorizing actor before due work; disabled schedules/reminders retain intent and revisions. Already queued email dispatch and accepted handoff reconciliation continue.
• Staff navigation exposes separate Communications, Session groups, Teaching plans and Team tasks modules. The session_leader role grants only dashboard.view plus dedicated phase_communications/phase_roster/phase_teaching/phase_tasks read-write capabilities. Each adapter and scheduled command enforces its own capability; the same feature flag gates all four. No dashboard shortcuts or indicators are added.
Personalized video prescriptions
• Delivery owns PrescriptionExercise, VideoPrescription and immutable PrescriptionRenderJob snapshots. Demonstrations reference the existing private SessionAnalysisLibraryAsset; approval freezes no VIP clinical content and changing an exercise requires reapproval. Historical export snapshots pin the source range, cue and dose. Shared library archive blocks all exercise and render dependencies.
• The false-default video-prescriptions LaunchDarkly key gates staff menus and every prescription/catalog/private media HTTP endpoint. video_prescriptions.view is independent from edit_own/manage; author ownership or a separate manager grant protects all prescription access. program_setup.manage protects catalog maintenance and loop approval. Cognito and active StaffUser remain required.
• The existing tfd-session-analysis-renderer also consumes dedicated tfd:prescriptions:render-commands and produces render-results using separate consumer groups and prescription.render message types. It normalizes approved private source intervals, repeats at original speed for the exact timed dose, adds silent audio, countdown/preparation/rest scenes, and writes validated private H.264/AAC 720p MP4. No SessionAnalysis request/project, attendance, portal or recorder state is created.
• PostgreSQL owns draft revision, immutable render snapshot, retry/progress/cancellation and final review. Core reconciliation recovers unpublished and abandoned jobs; attempt ids fence stale results and private output paths. Worker TTL leases renew during rendering and stop work when ownership cannot be proven. Only the monolith mutates database state; neither Redis nor the API carries media bytes.
• Staff explicitly review the exact final MP4 before authenticated short-lived download. A downloaded prescription never proves VIP delivery or completion. Existing reviewed earlier versions remain accessible after a later draft changes. Enabling the flag requires a validated deployment of the renderer contract and configured private storage; no provider flag or deployment is changed by repository implementation.
Standalone portal accounts
• Identity allows privileged staff to create UserProfile with a null VIP link, a required name and a unique sign-in email. The exact Cognito subject is provisioned by the backend with mail suppressed, never supplied by the browser. Existing invitation links, verified activation and password reset remain. ADR 0096 allows limited sessions for inactive/disabled application profiles while business resources remain restricted. Optional vip_id is explicit in staff and /portal/me response contracts. Non-null VIP links retain uniqueness; multiple standalone identities do not conflict on NULL. No VIPProfile, enrollment, clinical access or program ownership is fabricated. Delivery portal routes independently require a linked VIP and existing ownership/prerequisite rules.
• Privileged staff can later attach a non-archived VIP to the existing unlinked account through PATCH /vip-access/:id/vip. A transaction conditionally changes only a null vipId; same-target retries are idempotent and the partial unique index prevents duplicate VIP claims. Different existing or concurrent links are never reassigned. Cognito subject, email, status, password, invitation and sessions remain unchanged; no provider call, new identity, email or enrollment is created. Completed links append sanitized identity.vip_access.vip_linked evidence containing only the account and technical VIP identifiers. Subsequent authorized identity reads use the stored link under normal program ownership rules.
• An explicit VIP correction endpoint requires the expected current VIP and account update timestamp plus the target VIP. Its compare-and-set transaction changes only vipId; the existing partial unique index prevents claiming another account’s VIP. Concurrent stale corrections fail closed and same-target retries do not emit another correction audit fact. Privileged staff review old/new VIP names before confirming. Cognito identity, sign-in email, profile fields, status, password, sessions and invitations remain unchanged, with no provider call, email or new account. Technical fromVipId/vipId audit evidence preserves the correction. VIP program, enrollment and clinical records are not moved; subsequent authorization follows the corrected identity link under existing ownership rules.
• Identity.UserProfile now has an internal portalAuthorizationRevision. A PostgreSQL BEFORE UPDATE trigger advances it on effective vipId, cognitoSub or deletedAt changes. Ordinary profile/status edits preserve it, explicit identity-wide revocation can advance it, and same-target writes do not revoke again. Transaction rollback also rolls back the revision; A-to-B-to-A cannot revive an old session.
• Dedicated fixed-expiry Redis records hold server-only provider tokens plus the pinned profile/subject/VIP/revision. No tokens are added to PostgreSQL, and no cross-context session ledger is introduced. API instances recheck the durable revision and expose a bounded Identity public actor and safe /portal/me expiry/access metadata. Business controllers and limited-session admission are migrated in steps 3–4; steps 5–6 implement automatic browser expiry/recovery.
• See docs/architecture/vip-portal-protected-surface.md and docs/operations/vip-portal-session-storage.md for the route inventory, migration order, leased/CAS refresh, shared one-time auth transactions, atomic logout and disposable real PostgreSQL/Redis verification.
• Verified existing inactive/disabled UserProfiles may establish BFF sessions and read /portal/me without a denied-login attempt or status activation. Active unlinked accounts remain limited. Invited activation and provider verification stay pinned; missing/deleted/conflicting identities fail closed. /portal/me always returns the immutable BFF deadline with private/no-store metadata; Bearer-only portal access is removed, including legacy Backoffice portal consumers.
• Identity exports a bounded PortalResourceActor or an explicitly selected client-resource PortalReadActor after current status, current optional VIP binding and durable authorization revision checks. A Nest adapter keeps token-custody services private while imported guards resolve correctly in consuming modules. Delivery retains participation/route/prerequisite/clinical checkpoint and nested recording authorization; Chat admits active UserProfiles without requiring VIP and retains typed UserProfile conversation/attachment membership, exact portal realtime rooms, and the independent chat feature flag. Staff RBAC and Cognito groups never authorize a portal resource.
• Delivery separately evaluates the stable journeys provider flag for the trusted VIP UserProfile UUID; Chat retains its independent chat flag. Unsafe portal HTTP methods require the exact PORTAL_FRONTEND_URL Origin, including auth setup and logout. Origin checks are independent of CORS. Owner Forbidden/NotFound denials share a structured Resource unavailable response; limited-account and flag denials retain non-enumerating codes. Logs contain bounded reasons and trusted identity references only, never request bodies, PHI, tokens, private keys or signed URLs; no failed staff audit rows are created.
• The dedicated VIP frontend blocks its existing static/demo screens for newly resolved limited accounts and shows one explanation/sign-out action. Steps 5–6 implement automatic absolute browser expiry, response recovery, cross-tab state and work/cache preservation. VIP realtime and inactivity controls stay excluded. Real PostgreSQL/Redis HTTP tests cover every business route/alias, restricted identities, cross-VIP parent and nested-media substitution, CSRF and flag independence. See docs/architecture/vip-portal-protected-surface.md and docs/operations/vip-portal-session-storage.md.
• Identity exposes withResourceTransaction: shared UserProfile row locking and current revision/binding/status validation precede unsafe portal owner work. Effective binding/status changes serialize with the owning application transaction; stale writers fail before side effects. Same-target retries and transaction rollback preserve the durable revision policy.
• Delivery, Clinical and Chat use the existing application transaction client. Contexts keep ownership queries and aggregate concurrency decisions; Chat publishes message facts only after the outer commit. Existing transaction timeout is 15 seconds. No new context, service or VIP realtime transport is introduced.
• The dedicated VIP frontend separates authenticated limited, expired, recoverable-error and logout-pending states. The immutable server deadline drives timers and focus/resume checks, with conservative server Date clock correction. Offline recovery never extends the deadline. Profile restriction rechecks /portal/me; resource/flag denial does not end the session.
• Account generations cancel pending requests and reject late response bodies; logout clears media, memory drafts and registered account caches. Goal/assessment drafts survive temporary recovery only within one identity/binding/session. Cross-tab messages carry secret-free logout/change metadata; failed server logout blocks sign-in and retries on focus, reconnect or explicit action. No inactivity timeout or warning is added.
Bounded portal media and validated denial/logoff matrix — ADR 0096 steps 7–8
• Every business handler, including GET media, now uses the existing Identity resource transaction with current status/binding/revision checks and a shared UserProfile row lock. Before result delivery and database commit, a private adapter rechecks the authoritative Redis session without another Cognito refresh. Expiry/logout/revocation discards results and rolls back database work; an external copy or previously issued URL cannot be retroactively withdrawn.
• Delivery private lesson playback uses a dedicated 300-second portal signer; staff editor playback retains 900 seconds. Practice playback remains 300 seconds; Chat downloads remain 120 seconds. Practice upload grants last 600 seconds and Chat uploads 300 seconds; confirmation requires a new protected owner check. Published YouTube/direct HTTPS references are existing public catalog sources, not private per-VIP or expiring portal grants. Source validation excludes credentials/signed query data.
• Real PostgreSQL/Redis HTTP tests cover positive two-VIP reads/writes/media, all aliases, nested substitutions, limited/invited/missing/deleted identities, provider outage, revocation/expiry, archived private assets, independent flags/prerequisites, playback-result discard and confirmation rollback. Real SDK presigning with ephemeral synthetic credentials verifies bounded URL metadata without live AWS calls.
• Real Chromium drives the dedicated VIP frontend using a controlled HttpOnly-cookie BFF boundary under TEST_ENV=dev and allowed hosts. Tests cover direct limited routes, 12-hour expiry after activity/reload, sleep/resume, two tabs, account B draft isolation, delayed account A responses, offline recovery, failed logout across reload and media source cleanup. No staff tokens, real providers, persisted auth state, screenshots, traces, video or fixed sleeps. No new runtime, ingress, inactivity controls or VIP realtime.
Repository release readiness — ADR 0096 step 9
• Steps 1–9 are implemented and locally validated in the repository. ADR status, protected-route and denial contracts, private/public media bounds, recovery notes, validation evidence and staff system updates are current. The release handoff records migration order, expected re-login, existing-address cohort rollout, provider smoke requirements and forward recovery; it does not authorize deployment.
• Application Validation preserves exact candidate checkout, existing required-check names, daily/manual/production full validation and non-cancellation. VIP Platform adds development type/lint/environment checks and full-run build/unit/controlled Chromium validation. Portal Authorization adds full-run disposable loopback PostgreSQL/Redis integration with one Prisma generation and no production secrets or application migrations. Workflow YAML/actionlint and CI policy tests pass locally; no remote candidate CI execution is asserted.
• External deployment readiness remains conditional: GitHub rules could not be inspected because gh is unauthenticated; Railway Wait for CI, Cloudflare deployment ordering, live Cognito/cookie/Redis/media settings, cohort targeting and application migration are unverified. Repository workflow definitions are not evidence of those external gates. Production continues through the existing release/prod to main draft PR and main-to-develop sync policy.
• No new ingress, parallel application lane, runtime service, VIP realtime or inactivity timeout is introduced. See docs/operations/vip-portal-release-readiness.md and docs/operations/vip-portal-authorization-validation.md for evidence, pending deployment prerequisites and the exact local-versus-live validation limits.
Explicit VIP session continuation — ADR 0097
• ADR 0097 amends the original-login immutable deadline from ADR 0096 for selected portal-session-renewal cohorts, off/default false. A server warning defaults to 30 minutes before period expiry (PORTAL_SESSION_EXPIRY_WARNING_MINUTES, integer 1–719). Only an explicit Stay signed in command can start another 12-hour period; activity, page reload, polling and automatic Cognito refresh cannot. No inactivity timer or VIP realtime is introduced.
• Identity owns POST /portal/auth/session/renew: exact Origin, current HttpOnly credential, expected generation, warning-window eligibility, server-only trusted UserProfile cohort and provider/profile/subject/VIP/revision revalidation. Valid limited/unlinked sessions may continue without gaining business access. JSON exposes safe scope/generation/server-time/warning metadata only; rotated credentials remain Set-Cookie and tokens stay server-side.
• New v2 credentials separate the family selector from an independently random rotating secret. One authoritative v2 Redis family record, its provider-refresh lease and five-second attempt throttle share a Cluster hash slot. Owned-lease/version/credential CAS rotates one period atomically and cannot recreate logout/expired/revoked state. Retired proofs permit logout only for 30 seconds, never reads or renewal; stale guards never clear a newer cookie. V1 records keep fixed expiry until next login, with no new database migration.
• The existing portal-themed Radix/shadcn dialog offers Sign out now and Stay signed in, with keyboard focus, mobile button targets, pending and inline retry states. Same-family renewal preserves the page, media and memory-only answers by stable scope; request-generation fencing rejects stale results independently of account cleanup. Secret-free cross-tab events trigger authorized metadata rechecks; concurrent confirmations converge to one period and logout wins.
• Real PostgreSQL/Redis tests, controlled-clock components and real Chromium cover config/window/cohort rules, restricted identities, repeated and competing rotations, provider/lease/expiry/binding/logout races, form preservation and multiple tabs. Synthetic desktop/mobile crops verify the existing UI language. Existing CI jobs execute the extended matrices with bounded Node heaps. No live provider flag/configuration or deployment was changed. No token storage in browsers, new ingress or runtime service was added.
• A renewable family whose local deadline appears expired closes content and rechecks the current shared cookie before destructive logout. Suspended tabs may miss renewal messages; authoritative newer generations recover the same work instead of ending a renewed period. Unavailable verification keeps content closed with retry, while confirmed invalidation hints peers to revalidate. The recheck never grants another period.
Renewal evidence and current annual cycles
• Identity preserves recurring unit amount, normalized currency and price status for future schedule snapshots using the existing subscription normalization. Known zero remains zero; unknown amount remains unavailable; non-USD prices retain their currency without a USD amount. The recurring amount is separate from the total of the payment plan.
• The shared renewal projection uses basis current_cycle only for an actual, non-schedule active/trialing/past_due contract with a known positive recurring price, a known annual 12-month package and yearly billing cadence. The original subscription start must be known, and the imported current-period start must be at least its first anniversary and no later than the explicit evaluation instant.
• The imported period must prove a complete 12-month cycle after removing the recorded break offset from its end: either a directly clamped annual interval or an interval aligned to the original contract anniversaries. This is evidence of the imported current cycle, never a clock-based roll-forward. Recorded break days affect the projected renewal once.
• A service-delay anchor applies only when the effective participation civil day is later than the VIP's original startDate civil day and the effective timestamp is later than the commercial contract start. Equal original/effective profile days are a baseline, so the commercial contract supplies the renewal basis and its Phoenix day without changing saved profile dates. Missing original-profile start evidence retains the previous fallback. This shared guard also applies to complete annual installment terms and verified explicit one-month terms. A qualifying delayed participation anchor advances only when the otherwise qualifying annual provider period aligns exactly to original subscription anniversaries. Apply its whole annual-cycle count from the original service date with leap-day clamping, capped by both the observed provider cycle and the latest break-adjusted service anniversary actually started at explicit asOf. Keep basis effective_start and literal saved-day authority. Non-aligned or invalid cycle evidence retains the existing service-start baseline; stale evidence cannot advance beyond its observed cycle and the clock alone never adds cycles. A selected paid-row manual override remains exact and recorded break days apply once. Invalid, short, monthly-installment, future, missing, inactive, unknown-price and zero-price evidence cannot establish current_cycle. A separately verified pending annual schedule may use its own scheduled start. Provider, contract and participation dates remain unchanged.
• Sales consumes the corrected due date and basis through the existing public evidence facade. Existing Expected baselines and original due attribution remain immutable; a date correction requires the existing amendment path and does not prove a Realized renewal or payment. No database schema, boundary, event or runtime is added.
• Automatic renewal eligibility excludes a known-zero recurring row when it has no positive complete plan, even if that row has a manual override. Unknown price is not zero. An introductory zero-priced phase backed by a positive complete plan remains eligible. Excluded rows remain in contract history and renewalCycleEvidence; exclusion neither deactivates a VIP nor changes provider state. For a new VIP profile, import selection prefers a commercial contract over a known-zero placeholder only within the same coverage class. Known-zero-only and unknown-price sources retain their existing import behavior, and already saved participation dates remain untouched. This general source-selection rule uses exact provider-customer ownership, never a case-specific correction or an inferred payment or participation-date origin.
• Monthly multi-payment annual-membership financing is excluded from automatic selection only when an explicit future yearly successor with a known positive unit amount or verified positive complete plan starts on or after the finite financing-plan end and no later than the later of the projected membership end or one calendar month after the financing-plan end. The earliest eligible future candidate must itself satisfy the positive yearly successor and start-window guards, independently of source order. A later qualifying contract cannot promote an earlier unsupported candidate or suppress active financing. A manual override or positive local break adjustment preserves that row. A future financed membership is also preserved when a recognized prior commercial membership started by evaluation and its calculated term ends no later than the financed start; active financing can still yield to its annual successor. Without a qualifying successor the annual-membership projection remains; an installment start alone does not prove renewal. Unknown-price standalone rows remain eligible, but cannot displace financing without that positive successor evidence.
• A complete 12-month plan aligned to the original contract anchor supports annual membership duration independently of quarterly cadence, preserving the quarterly classification kind. Without complete term evidence, quarterly membership duration remains a Product decision; the existing three-month runtime projection stays unchanged. Existing monthly-named annual memberships, including Few Months names, remain recognized; explicit one-month, quarterly and semi-annual names require their own term evidence. Outside the verified pending-annual path, ordinary non-financing future transitions require earlier business-eligible history that has started by evaluation; canceled or paused history can qualify without proof of payment or a completed membership term. A future financed membership instead requires a recognized prior membership with a known positive unit amount or verified positive complete plan whose calculated term ends no later than the financed start. A started zero placeholder supports its separate replacement transition but never proves a paid or completed membership.
• Returning from a started zero placeholder uses the next non-financing commercial start and that row's break offset once. The same pure projector supplies API selection, VIP summary/commercial date, reminders, forecast and Sales evidence. Paid-row manual overrides remain exact; zero-row overrides cannot restore automatic eligibility. Every contract observation remains available to cycle evidence and original Expected cohorts retain their attribution; selecting a new date proves neither payment nor Realized renewal.
• A verified pending annual provider schedule uses basis future_contract, labeled Scheduled membership start: provider-schedule provenance, not_started, scheduled or future_confirmed status, operationally inactive, no canceledAt, yearly cadence and annual classification excluding quarterly and semi-annual classifications, plus a verified positive complete phase plan of exactly 12 calendar months anchored to its own subscription/current-period start and one installment; an approximate installment count is allowed. Its own start plus its own break offset once supplies the date, with the selected-row manual override exact and no started-history requirement. An eligible active contract still wins; otherwise the earliest eligible pending annual start retains chronological priority over later futures, including same-day or overdue pending starts. Pending provider status preserves this scheduled date until activation or cancellation is imported; the clock alone never adds 12 months. VIP participation start remains separate and unchanged; an effective-start conflict does not establish whether that profile value was manual or imported. This schedule evidence proves neither payment nor Sales Realized, and original Expected cohorts remain immutable.
• Identity defines RENEWAL_CALENDAR_TIME_ZONE as America/Phoenix, the confirmed Arizona renewal calendar, without rewriting original instants. Public row day fields and calendar metadata distinguish provider-derived bases, which use Phoenix days, from manual_override and effective_start, which preserve the literal UTC day of staff civil-date intent. A participation day later than the original VIP start day retains effective_start authority and its saved literal day; an equal-day profile baseline uses the commercial contract and provider-derived Phoenix calendar instead. This distinction preserves saved profile values, exact overrides and granted break days, without inferring historical date provenance or repairing profiles. API/UI rows and VIP upcoming days consume these day fields. Date-only filters, statuses, counters, overdue decisions, day windows and reminders use the same calendar policy; legacy explicit-instant filters keep their existing contract. Sales receives dueDay and calendar metadata for future admissions while original Expected cohorts and due attribution remain immutable. The calendar correction proves neither payment nor Realized renewal; no browser or host timezone supplies the business day.
• Identity owns nullable VipProfile.operationalStatusOverride (active/inactive). Its dedicated audited staff command requires vip_management.manage and updates operational status without changing Stripe snapshots or renewal rules. Subscription upserts lock the exact customer profile before reading the override; both import deactivation paths atomically skip retained statuses and return only changed rows for existing activity facts. Null releases status to the next import. The override establishes neither credit balance/expiry, commercial coverage, payment nor portal access. Canceled contracts remain excluded even when the profile is retained Active.
Facebook email confirmation — ADR 0098
• Identity owns PortalEmailChallenge and PortalEmailConfirmation, bound to the dedicated VIP pool and exact Cognito subject. A separate 15-minute HttpOnly pending cookie references a TTL-bound transaction in the existing Redis authentication store; it grants no portal business access. Eight-digit codes expire in ten minutes, with bounded attempts, resend cooldown and hourly destination/identity limits before atomic single-use proof persistence.
• Identity synchronously calls the Notifications auth-public.ts leaf contract to deliver one explicitly requested code. Notifications owns SES transport and existing sender, environment, recipient and suppression controls, independently of IdentityModule and manual VIP campaigns. Codes, credentials and raw provider errors are never logged; PostgreSQL stores only code HMAC and browser-secret digest evidence.
• Confirmed contact email is application evidence, not Facebook email_verified. Confirmation never creates or activates UserProfile, binds accounts by email or links VIPProfile. Exact existing active subjects may sign in; inactive/disabled subjects retain only the limited BFF authentication allowed by ADR 0096, with resource access denied independently. Missing/invited identities await explicit staff review and a live enabled Facebook identity check. Redis outages fail closed without process-local fallback; temporary provider outages preserve pending work until its TTL.
User-owned Track execution and compatible owner storage — ADR 0102
• Delivery Achievement owns ordered AchievementBadge children with library image references and inclusive age bounds, including one unconditional fallback. AchievementAward freezes badge identity and copy with source participation and award time. The userProfileId plus achievementId key prevents duplicate grants. TrackVersion pins catalog revisions and every variant image.
• Compatible owner storage preserves older unresolved userProfileId rows in physical Delivery JourneyParticipation and Clinical JourneyQuestionnaireResponse. NOT VALID required-owner CHECKs enforce all new/updated writes. The rejected finalization is corrected to a no-op; versioned migration 20261029160000_preserve_older_track_owners aligns both failed-finalization and previously successful databases without owner inference or data deletion. Assigned owner and every original VIP context remain immutable.
• Delivery exposes granular-permission client assignment/closure under existing program_setup.manage and Tracks rollout controls; the Backoffice user directory selects an existing account, published TrackVersion, training profile and reason without provisioning or activation. VIP direction and scheduled Track destinations resolve the unique user before creation/source closure/roster mutation. ProgramRunVip and live/operational on-demand stay VIP-based. November 16 assignment amendment: reviewer allocation is optional for every manual client assignment, including professional-review funnels; non-global review still requires the assigned authorized reviewer and checkpoints never auto-complete. VIP Users supports explicit selection of up to 100 accounts across pages and choosing one published version. The browser sends the existing independently authorized, fenced and idempotent per-user assignment commands sequentially, retains each request key on retry, reports partial results and retries only failed accounts. Existing open cycles are rejected rather than closed, reset or version-replaced implicitly; account lifecycle and ownership remain unchanged.
• Explicit client-owned Track methods derive a trusted active UserProfile from the cookie session, retain Identity row/revision/binding and final Redis-session fences, and validate immutable participation ownership before progress, Clinical, upload or playback access. General Tracks never query VIP attendance/upcoming projections. Clinical retains subject-bound immutable submitted answers; actual recording uploader and media TTLs remain unchanged. Sessions and VIP Journey keep strict VIP guards. Under the November 10 ADR 0060 amendment, portal Chat instead admits active UserProfiles with optional VIP binding through the client-resource actor, including realtime admission and periodic reauthorization; the independent chat flag and exact typed conversation/attachment membership remain required. The Responsible VIT shortcut is empty without a linked VIP, while authorized staff-created client conversations remain available.
• Delivery PortalTrackEntry pins an explicitly configured published assessment version with optimistic revision and the existing physical configuration key. Assessment entry is the UI, implementation and HTTP client terminology, and only assessment-entry HTTP routes are exposed. Published welcome snapshot values remain readable without rewriting immutable versions. Entering Assessment resolves owned work or automatically issues the idempotent assessment-entry/start POST for active authenticated clients, including clients without VIP. GET/login remain read-only. The resulting normal Track participation uses the same pinned video, chapter questions, answers and completion engine as manual assignment. There is no independent preview player or extra Start button; Play is explicit and replies resume playback. Optional checkpoint images use a separate authenticated images GET independent of the legacy fixed video. Roster locks, durable keys and saved work remain authoritative after entry is disabled. Version, progress, original context and ownerless older records are preserved.
• Default reviewer assignment is optional at assessment start; a revoked default grant leaves new participation unassigned. Under the user-approved November 10 amendment to ADR 0102, Identity projects active administrator/global StaffUser authority through canManageAllTracks. Administrators inherit tracks.client.review and can list, review, play execution recordings and control all resolved Service Funnel executions, including general unlinked clients and unassigned participations. Non-global reviewers still require an explicit grant and current assignment; non-global VIP Directors retain membership scope. Portal UserProfile ownership, original-context quarantine, completion prerequisites and independent Clinical permissions remain unchanged. No commercial entitlement engine, new runtime service or extra progress ledger. Required new-write checks and nullable older-owner storage are validated in disposable tests; application environment recovery/configuration remains pending.
• Step 9 regression corrects staff capability eligibility: explicit tracks.client.review and Track management permissions participate in the existing journeys rollout; journey-reviews remains a derived capability, not a new provider key. Active program_setup.manage governs Delivery client assignment/configuration without hardcoded role restrictions; Identity account provisioning/directory policies remain independent. Browser, real PostgreSQL/Redis HTTP and broad domain regression validate new client flows and unchanged VIP live/on-demand operations using synthetic fixtures. No real-data mapping or deployment is performed.
• All 212 migrations install on a clean disposable PostgreSQL 17/pgvector database. Real Prisma CLI recovery/repeat tests preserve older participation, questionnaire answers and progress while rejecting new ownerless writes. Application execution, media, review queues and staff closure exclude or reject unresolved owners. API startup still requires one controlled resolve --rolled-back for an existing P3009 using the corrected release; no automatic migration-history clearing hook or application environment mutation is introduced. Other Clinical/VIP live/on-demand ownership remains unchanged.
Manual historical GA4 reporting import
• Integrations owns read-only Google Analytics Admin/Data access and five PostgreSQL models: GoogleAnalyticsSource, GoogleAnalyticsReportDefinition, GoogleAnalyticsImportRun, GoogleAnalyticsImportPartition and GoogleAnalyticsReportRow. Foreign keys connect source/definition/run to daily partitions and observations. These are private aggregate provider facts, separate from raw events, VIP identity, Clinical, attendance, Sales and Engagement.
• A dedicated manual CLI accepts private configuration files or GA_IMPORT_CONFIG_JSON, and read-only Google credential files or named environment secrets. Credentials never enter plans or logs. Undated development configuration defaults to the previous complete property-local month; validated explicit start/end date arguments support later ranges. Production requires an explicit window. Destination host/port/database and target guards remain required; database run/partition history preserves coverage and failure evidence without receipt files. Preflight and cleanup do not load Google credentials. No application workers, automatic migrations, tracking changes, HTTP routes, schedules, realtime or business events are introduced.
• Property/spec/local-date uniqueness and database-clock leases fence staging and atomic generation activation. Exact original metric strings/types are preserved. Named dimension, metric and metric-type JSON objects replace positional arrays; immutable definitions explain each report grain. Restrict-delete provenance relations, query indexes and private migration backup preserve evidence.
• The retained baseline v1 uses exact allowlists. Explicit marketing v2 preserves original selected reporting values for later cleaning, without rejecting unfamiliar business labels. Thirteen separate grains cover overview, acquisition, content, events, technology, landing pages/campaigns, campaign actions, geography/language, custom event details, video, ecommerce overview and items. Unsupported reports and source restrictions remain explicit; no identity, clinical or full-query URL fields are selected.
• Active rows retain committed spec history. Current rows choose the highest committed report version and latest commit per property/report/day; failed replacements preserve prior snapshots and successful empty snapshots suppress older rows. Flat SQL family views expose named numeric columns without business classification, cross-property deduplication or inferred bookings/payments. Five-request batches, one-use bounded caches, grouped running checkpoints and bounded cleanup retain independent report pagination/fences. See docs/operations/google-analytics-structured-import.md.
• API-only ActiveCampaign tag dates: Integrations owns ActiveCampaignTagFact, ActiveCampaignTagImportRun and ActiveCampaignTagObservation. Isolated manual CLI persists paginated current-association cdate evidence, checkpoints and fenced account leases; no schedules, provider writes, HTTP route or historical removal inference.
• ActiveCampaignTagDatesService resolves exact provider contact IDs through import-owned ActiveCampaignSnapshotLookup and current Identity ActiveCampaignProfileReferenceService. Account attestation is mandatory for matching; legacy matchedBy email remains existing_import_reference. Duplicate/shared/deleted references stay unresolved; no profile foreign key freezes ownership into source facts.
Portal user invitations — ADR 0103
• Identity owns PortalInvitation and append-only PortalInvitationEvent, with per-email/actor transaction locks, request idempotency, immutable recipient and a hashed 256-bit bearer token. Staff use /settings/portal-invitations with portal_invitations:manage. Existing local/provider accounts block sends. Default validity is seven days (168 hours), configurable via PORTAL_INVITATION_TTL_HOURS; expiration is authoritative without a cron and reissue supersedes the old token. No VIP or enrollment is inferred.
• Public POST /portal/auth/user-invitation/inspect, /verification and /accept require exact portal Origin plus shared Redis traffic limits. A fixed-email OTP, hashed HttpOnly browser proof, bounded lifetime/resends/guesses and an atomic provisioning claim precede Cognito creation. Native verified subject/email must match before UserProfile invited-to-active and invitation consumption commit. Lost commit results are reconciled before compensating only a proven newly created unbound subject; uncertain creation/cleanup stays needs_review. The portal strips URL fragments and never persists secrets in browser storage.
• Notifications exposes a leaf auth-public invitation mail facade: a manually selected active MessageTemplate revision and optional signature render transient secret-bearing SES messages, without a regular EmailDelivery snapshot/outbox or a new runtime. VIP Users Email configuration binds Portal account invitation separately from legacy Cognito auth settings. Staff-issued invitations and their fixed-recipient proof codes bypass recipient allowlists, retaining enabled sending, valid sender/tracking configuration, address validation and suppression checks. Other email recipient policies remain unchanged. SES acceptance, failure and uncertainty are durable operational facts; no inbox receipt is inferred. StaffAuditLog adds an explicitly validated recipient email snapshot, fixed reason and correlation for completed sends only. Secrets and bodies never enter logs, audit or history. See docs/operations/portal-user-invitations.md.
• The November 4 amendment adds POST /portal/auth/user-invitation/confirm under the existing Origin and shared traffic guards. Identity validates the token, code and HttpOnly cookie under the invitation lock and shared expiry/attempt budget before VIP Platform reveals name/password fields. Confirmation never provisions, consumes or extends proof, creates a session or issues another credential. Final acceptance revalidates and atomically claims the same proof. The November 5 visual correction reuses the VIP Portal split photo/purple glass layout, white fields, shared visibility checkbox and dark actions; responsive invitation forms scroll without shrinking text; password policy remains twelve characters with uppercase, lowercase, number and symbol. No migration, environment variable or Notifications transport change is introduced.
• The verification-code email has a separate revisioned template binding in the existing Notifications PortalInvitationEmailSettings row portal-user-invitation-verification. Identity exposes GET/PATCH /portal-invitations/verification-template under message_templates:manage, recording existing sanitized configuration audit with resource verification-template and version only. Notifications requires visible verification_code, optional verification_validity_minutes, current template/signature revisions and no enabled buttons or markers. Identity passes the newly persisted proof deadline; rounded-up display minutes never extend expiry. Only an absent binding uses the original built-in copy. Rendered code/body remain transient; the fixed recipient, proof, resend, suppression and activation policies are unchanged. No migration, new runtime or env is introduced; publish API before Backoffice frontend.
• ADR 0105 adds native portal password recovery using the existing Cognito one-hour reset link and Password reset template binding, optional auth_validity_minutes=60, shared Redis IP/account limits and exact verified subject/email checks. A per-profile reset fence plus durable UserProfile authorization revision closes old BFF sessions; verified native password login heals uncertain provider outcomes. Reset never provisions, activates or signs in. Notifications uses its existing auth-public facade and settings table for a separate static portal-password-changed template. Dispatch and notice are best-effort without a new worker/outbox. VIP Portal strips fragments, respects Retry-After and offers normal sign-in. No new migration or env; live provider/inbox/CDN checks remain separate. See docs/operations/portal-password-recovery.md.
• ADR 0108 supersedes mandatory OTP with server-owned link-only policy; dormant verification endpoints reject requests while disabled. Identity records invitation_link_verified and retains fixed recipient, expiry, claim, conflict and compensation controls. Activation uses an application transaction with a Notifications auth-public enqueue callback; Notifications owns the unique PortalWelcomeDelivery intent, recipient/name and delivery leases. Existing API/worker processes poll it; aborted preparation retries, unknown sends remain uncertain, definitive rejection retries are bounded. The manual portal-welcome template requires a normal portal_url button, never a credential. Backoffice shows Account access and Password recovery, hides dormant code/provider-purpose controls and preserves legacy first access collapsed. A dedicated permission-protected retry for failed delivery records secret-free completed audit. Migration 20261109120000 precedes coordinated API/worker/frontend release. See docs/operations/portal-invitation-welcome.md.
Optional email action buttons — ADR 0104
• Notifications reserves button_enabled, button_label and button_url for email-only action controls. Variable definitions may persist default_value only for these controls; fictional examples never become live defaults. The existing template DTO/JSON and revisioned editor expose these saved values without a migration or new runtime. Explicit generic send values can override declared controls.
• Absent/false buttons return the existing body unchanged, preserving exact no-button HTML, signature layout and spacing. Enabled buttons require bounded plain text and a literal HTTPS URL or one declared non-button destination variable. The shared renderer appends trusted purple (#7D06D0) anchor/table markup after sanitized content, before optional signature composition, without allowing arbitrary body CSS. Preview, text fallback and delivery use the same result; reviewed delivery snapshots remain immutable.
• Portal invitations require button_url to reference the server-owned invitation_url; existing first-access/password-reset email binds to auth_url and preserves Cognito placeholders. No personal URL is persisted in a signature/default and no token enters audit. Default-off compatibility, unsafe destinations, variable aliases, provider placeholders and editor persistence are tested; real email-client appearance remains an operational verification. See docs/operations/email-action-buttons.md.
• The November 4 amendment adds up to five content.action_buttons entries (id, enabled, label, url), each positioned by exactly one standalone {{action_button:<id>}} paragraph. The generic {{action_button}} positions the legacy action; absent markers preserve its append behavior. Disabled paragraphs disappear. DTO/editor validation rejects duplicate, unknown, inline and subject markers. A per-render sentinel protects configured placement from variable-value injection before trusted HTML rendering. Invitation/auth require the expected personal link and allow supplemental named HTTPS actions. No new table, runtime or event is introduced; deploy API/worker before frontend and rebind revised templates.
• Delivery video activities may optionally freeze presentation.videoWidth (narrow or wide). Video Quizzes alone may freeze consultationInvitation with integer startMs/endMs inside a hosted video clip. Editor, fictional preview and owned portal execution show the invitation within that interval without pausing playback or requiring an answer; Lessons and Forms cannot own this timed item. Existing explicit presentation.consultationEnabled Quiz flags retain their legacy interval when no timed item exists, without rewriting pinned publications. One width section replaces duplicated authoring controls. Ownership, decisions, completion requirements and media authorization remain unchanged.
ActiveCampaign contact coverage and recovery
• Identity storage retains import-owned ActiveCampaignContactSnapshot and the account-scoped ActiveCampaignContactImportState checkpoint. Historical scans resume by ordered provider IDs; incremental scans freeze lower/upper time boundaries. A leased owner commits snapshot data and checkpoint advancement in one PostgreSQL transaction, and only a completed scan advances the watermark. Targeted imports never move that checkpoint. Incomplete provider reads fail without replacing stored fields.
• Before VIP projection import, a targeted coverage repair resolves the existing Stripe customer and source subscription to an exact provider email lookup. It imports complete labeled contact snapshots and compare-and-set patches only contact notes; no VIP rows, top-level identity, subscriptions, Clinical answers or portal access are created or replaced. Missing sources, multiple provider contacts, invalid identifiers and concurrent changes retain review evidence visible through the existing authorized expanded-list projection.
• The approved duplicate-contact-data policy copies one provider contact into distinct VIP profiles sharing an email with explicit shared-email evidence. It never merges identities or attributes email-only onboarding/Clinical answers to an individual. Existing contact references are retained; conflicting replacement proposals stay in review. The isolated maintenance bootstrap starts no business consumers.
VIP playback requirements, review metrics and favorite achievements
• Delivery freezes optional per-video videoCompletion requirements in TrackVersion. Omission preserves manual completion; minimum_watch requires an integer 1–100 percent and monitored internal media. TrackVideoWatch stores merged distinct playback intervals per participation/activity with a fenced browser session, monotonic sequence and server-clock-bounded observations. Seeking, disconnected time and replays never add duplicate credit. Completion independently enforces the pinned minimum in the owning backend. Client playback evidence does not prove attention, practice submission, review or live attendance.
• Owner-authorized POST /portal/tracks/:id/lessons/:activityId/watch accepts only the current eligible video and returns saved watch percentage without incrementing execution revision. Delivery staff GET /delivery/track-execution/:id/summary rechecks each included cycle against existing review authority, aggregates up to 500 recent same-owner/Track/original-VIP cycles, and leaves unmeasured viewing and unavailable consultation scheduling unknown. No provider payload, media bytes or cross-context database access is introduced.
• Delivery ProfileBadgeSelection stores up to three explicit profile selections per UserProfile, keyed by earned awardId or an owned completed legacy badge id and ordered by selectedAt then badgeId. POST /portal/tracks/badges/profile validates the owned earned collection and serializes add/remove/count checks with an owner-scoped transaction advisory lock; retries are idempotent and a fourth selection is rejected without replacement. Earned collection and conclusion projections include isProfileBadge and profileBadgePosition. Migration preserves the prior explicit favorite; the legacy favorite route retains single-selection replacement semantics under the same lock. The header overlaps selected badges beside the avatar, with independent subtle float/glow and a browser-only 30-second front-to-back queue animation; reduced motion disables float and rotation, and hover/focus pauses cycling. Profile actions are available wherever earned badges appear. No award, progress, media grant or Identity authorization changes. Completed-step links remain read-only and pass through the existing owned-history APIs during onboarding. Confirmed Quiz answers exit before playback resumes. Consultation celebration is prepared but dormant until a scheduling integration supplies an authenticated persisted confirmation.
Architecture diagram • Built with Archify • Create yours ↗ • Hover to trace • R route • Click to focus • +/− zoom • M radar • [/] views • P play story • T theme • E export