TFD Tools and Service Relationships

External tools are mediated by backend-owned adapters, durable inboxes, snapshots, and worker processes

TFD Tools and Service Relationships External tools are mediated by backend-owned adapters, durable inboxes, snapshots, and worker processes AWS Cognito · Hosted UI · JWT · staff provisioning · Architecture component AWS Cognito Hosted UI · JWT · staff provisioning Stripe + NMI · snapshots · direct subscription creation · Architecture component Stripe + NMI snapshots · direct subscription creation ActiveCampaign · contact snapshots · live tag catalog · Architecture component ActiveCampaign contact snapshots · live tag catalog Google Sheets + Practice Better · onboarding · acquisition · client records · Architecture component Google Sheets + Practice Better onboarding · acquisition · client records Backoffice API + Cron Workers · provider adapters · inboxes · snapshots · public APIs · Architecture component · Integration boundary Backoffice API + Cron Workers provider adapters · inboxes · snapshots · public APIs Integration boundary YouTube + Outline · resource lookup · video import · Architecture component YouTube + Outline resource lookup · video import Slack + AWS SES/SNS · outbound · signed email feedback · Architecture component Slack + AWS SES/SNS outbound · signed email feedback Zoom · webhooks · OAuth · Meeting SDK · Architecture component Zoom webhooks · OAuth · Meeting SDK AddPipe + Trainerize · signed video webhook · staged import · Architecture component AddPipe + Trainerize signed video webhook · staged import Recorder + Finalizer · C++ capture · Node remux/normalize · Architecture component · No media through API Recorder + Finalizer C++ capture · Node remux/normalize No media through API Meeting Streamer · Isolated join/leave · Architecture component · Not a recorder Meeting Streamer Isolated join/leave Not a recorder Private AWS Storage · S3 normalized/final MP4 · presigned playback · Architecture component Private AWS Storage S3 normalized/final MP4 · presigned playback Redis + PostgreSQL · Durable state + isolated flag cache · Architecture component Redis + PostgreSQL Durable state + isolated flag cache LaunchDarkly · Boolean flags · private Admin targeting · Architecture component LaunchDarkly Boolean flags · private Admin targeting webhooks + metadata Streams v1 · requests/results tfd:streamer commands allowlisted HTTPS source Legend Security External Backend Cloud Database

Secure communications

  • • Communications uses Cognito for staff/portal authentication, KMS for wrapped conversation keys, Redis for bounded shared limits and metadata fan-out, PostgreSQL for durable conversations, and a separate versioned private S3 attachment bucket with GuardDuty malware scanning. The explicit CHAT_ATTACHMENT_SCAN_MODE=disabled exception is accepted only for Railway staging. Validated uploads retain ready_unscanned evidence and are publishable/downloadable only while that exception is active; other environments require clean scans and reject disabled configuration. Membership, checksum, format, size and immutable version controls remain enforced. Reconfirmation validates the original frozen version; withdrawing the exception blocks new links while previously signed downloads retain their two-minute expiry.
  • • Chat source URLs and credentials are never caller-controlled. Direct signed uploads are restricted to generated quarantine keys, checksum, exact length/type and conditional creation; downloads authorize current membership and pin a verified object version.

Adapter rule

  • • All About You confirmed-pair conversion is computed in the Sales overview read, using existing Gold. Mixed-quality ranges exclude both numerator and denominator for unconfirmed groups and keep source precedence and date filtering. The rate is the ratio of sums, never a mean of provider or monthly percentages; no provider calls or new import are required.
  • • Consultations uses the existing read-only Google Sheets client with yearly A:H allowlists. Only dated primary counters contribute; weekly totals corroborate missing zeros and cumulative totals are excluded. Sales owns dataset-isolated review/publication, unified provider-keyed Gold, scheduled-denominator conversion and monthly spreadsheet precedence over Airtable Gold appointments. Notes and person-level fields are not imported. The separate Airtable Overview pipeline replays saved Bronze locally once per version and then synchronizes changed records through the same mapper; API and cron startup share a durable completion checkpoint without provider access.
  • • Frontend code never exposes provider credentials
  • • All About You reuses the same read-only Google Sheets client, bounded to yearly A:I metric ranges with unformatted serial dates/counts. The tab year corrects session dates. Sales retains separate aggregate and individual Airtable Silver and one canonical All About You Gold read contract, prioritizing spreadsheet monthly coverage and never summing overlapping providers. Provider secrets and private lineage stay server-side.
  • • Raw provider payloads stay inside integration inboxes
  • • Domain modules receive normalized internal contracts
  • • Acquisition imports discover annual tabs and read only bounded metric ranges, exposing aggregate reconciliation rather than raw workbook cells
  • • AddPipe provider URLs remain intake evidence; analysis resolves only the stable private video id
  • • Practice Better raw data is staged first; authorized staff explicitly copy notes and tags to existing VIP clinical records through a synchronous public contract
  • • Clinical exposes a VIP care workspace with front/back body observations, revision history, copied source records and authorized existing video playback; all remain in the modular monolith
  • • Clinical exposes an explicitly authorized, VIP-scoped YouTube catalog from current copied note revisions. The frontend opens an official privacy-enhanced YouTube iframe only on staff selection; only a validated video id and origin referrer cross to YouTube, never VIP identifiers or note content. Existing recording permissions remain separate

Import rule

  • • Stripe and ActiveCampaign contacts first become reviewable snapshots
  • • NMI custom subscription creation uses a tokenized payment method and does not import provider records
  • • ActiveCampaign tag browsing and reviewed contact reassignment are normalized Marketing operations
  • • Google Sheets access is read-only
  • • The Registration workbook remains external bronze; Sales owns versioned Silver facts and atomic FBF registration Gold. Annual recovery and authorized dashboard reads use stored data only. FBF freshness and failures remain independent of sales history; missing data never becomes mock counts
  • • Trainerize snapshots and bounded calendar reads map through Delivery ImportProgramDraftService: exercise assets, YouTube links and level-local days. Versioned ImportedProgramDraft receipts upgrade legacy drafts by appending a version; previous versions and runs remain unchanged
  • • Practice Better client imports persist profiles, tags and full session notes in Integrations staging through a dedicated five-minute scheduled process

Media rule

  • • Zoom participant capture runs only in the recorder; movement lab tab capture runs locally in the staff browser
  • • The finalizer also downloads bounded allowlisted AddPipe sources and creates H.264 320x180/15 fps, yuv420p + AAC 128 kbit/s faststart MP4
  • • Finalizer uploads directly to private S3 and returns stored/failed metadata through its dedicated stream
  • • Redis and the API carry control data and metadata only; Delivery availability waits for confirmed storage
  • • The movement lab opens YouTube in a separate tab and records staff-approved tab playback locally in real time through getDisplayMedia and MediaRecorder. The existing yt-dlp/bgutil finalizer import remains a legacy backend capability, outside the active lab UI flow.
  • • Session streaming uses tfd:streamer keys only and never shares recorder streams, recording S3, or the finalizer

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.

Server-side feature flags — ADR 0087

  • • FeatureFlagsModule is technical infrastructure in the monolith. One server-only LaunchDarkly Node SDK evaluates typed Booleans with 3 s startup and 750 ms decision limits; unavailable/error values return false. Optional isolated Redis persistence retains last-known rules across restarts; persisted rules have no freshness TTL.
  • • Canonical provider flags are chat, journeys, vip-progression, movement-lab, create-subscription and phase-team-communications, each with false default/off values. Billing groups renewal and creation screens without changing Identity/Integrations ownership. VIT type/roles are excluded at routes and API; create-subscription additionally gates creation with financials:manage. A no-store GET /me/features composes active StaffUser authorization with each flag. The expanded VIP table and shared-view GET/POST endpoints are generally available with vip_management.view; vip-expanded-table is a permission-derived response compatibility field, never provider-evaluated. journey-reviews is a derived compatibility response field: journeys plus explicit client-review eligibility or progression.read with Director authority; Delivery still enforces assigned participation or VIP membership scope. It is never a separate provider evaluation or legacy fallback.
  • • Tracks covers authoring, the staff Clinical questionnaire catalog, execution reviews and private playback, and Track-specific direction/progression surfaces. VIP progression covers policies, votes, reviews and transitions. Track-linked progression snapshots and commands require both flags. The direction queue still counts real participation coverage; Program Run and VIT operations remain available independently. Planned-transition and applied-progression history projections follow VIP progression; Track involvement requires both flags even for a Program destination. Filtering projections never changes real participation coverage.
  • • The initial staff pilot targets server-derived isAdmin=true: StaffUser admin type or admin/super_admin role. This private Boolean is the only added context attribute; browser input cannot set it. Admin targeting releases availability, never Director/PT authority, membership scope or a force-on bypass. Identity and Clinical use the public core evaluator without importing the staff adapter back into Identity.
  • • Scheduled progression transitions pause while the required authorizing-staff flags are false, retaining scheduled state and prior decisions. Resumption rechecks current Director authority, membership, source continuity and destination rules. Server-local emergency disabling overrides provider and cached true values; no work or completion evidence is fabricated.
  • • Contexts use trusted staff UUID/kind plus private isAdmin; future VIP evaluation uses active UserProfile UUID/kind. Email, names, clinical content and secrets are excluded. Evaluation count/latency labels contain no UUIDs and are not unique exposures or A/B samples. Existing Grafana/OpenTofu definitions require live export/query validation; future VIP experiments need actual served/rendered exposure and attributed outcomes.
  • • The server-evaluated chat flag defaults/off to false. Active staff and portal identities require independent trusted staff/vip cohort evaluation before chat HTTP, attachments or UI access. Staff sockets recheck availability every 10 seconds and before each recipient projection; message notification projections, inbox lists and unread counts exclude disabled recipients without deleting durable state. Identity exposes independent /portal/me for VIP Journey, separate from gated /portal/chat/me.
  • • Local-only exception: the explicit start:local launcher supplies TFD_LOCAL_DEVELOPMENT=true with NODE_ENV=development; deployment/CI markers reject this mode. The API binds to 127.0.0.1 and enables valid-context flags without LaunchDarkly. Emergency disable, authentication, RBAC and ownership still apply. Published runtimes retain provider evaluation and fail-closed defaults.

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.

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.

VIP access and authentication emails

  • • Identity provisions and pins VIP access in a separate Cognito pool with mail suppressed. An explicit invitation converts FORCE_CHANGE_PASSWORD using an unshared random permanent credential kept only in request memory, then AdminResetUserPassword sends a one-time password link. The CustomMessage_ForgotPassword Lambda uses non-sensitive purpose metadata and calls Notifications with purpose only. Notifications owns revision-pinned templates; invitations require auth_url without separate code or username fields. The adapter inserts the URI-encoded provider email locally; Cognito substitutes the recovery code and sends through SES. The custom VIP form removes the fragment on load and submits the chosen password through the BFF to ConfirmForgotPassword. Only successful verified authentication of the pinned subject conditionally activates invited UserProfile access; disabled access remains denied.

VIP development hosting and authentication boundary

  • • The independent VIP React/Vite app is hosted on the development-only Cloudflare Pages project tfd-vip-dev at https://dev.vip.tfdportal.com, built from develop. Its public assets contain only the HTTPS development API origin, never Cognito tokens, client secrets or service tokens.
  • • Browser requests go directly to https://dev.api.tfdportal.com/portal/* with credentials. Explicit CORS permits the VIP origin; both HTTPS origins share the tfdportal.com site. API-host-only HttpOnly, Secure, SameSite=Lax cookies identify server-held portal sessions. Active UserProfile authorization and rollout flags remain independent and mandatory.
  • • PORTAL_FRONTEND_URL is the canonical HTTPS origin for invitation activation and password-reset links and sensitive form-origin checks. The existing VIP client callback uses /auth/callback for legacy social BFF behavior; no VIP Hosted UI is added. Staff-host, staff Cognito pool and production deployment settings are unchanged.

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, account disable and password reset apply unchanged. 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.

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.