# Phase 9 — Two-form integration specification (historical title) ## Current referral decision — 2026-11-01 (supersedes Form C planning) The owner directs `/referrals` to retain the current public-site workflow: one button-styled **Refer a Client** link to [the existing hosted Jotform](https://form.jotform.com/231638510219149). There is **no separate Form C** to create, embed, configure or launch. The former Form C / proposed two-form architecture is historical only. `/referrals` renders no local form or Form A iframe; the original 16 approved Form A placements remain unchanged. This is authorization to restore the existing destination in Astro, **not** verification of that separate legacy Jotform's HIPAA configuration, notification recipients, patient-data handling, accessibility or continued operational suitability. Review the actual hosted form and its clinical/privacy claims before production cutover. No account modification or submission occurred in this PR. ## Current decision — 2026-10-30: default-live Form A The owner intentionally supersedes the earlier isolated-test and seven-route production-gate architecture. `npm run dev` and `npm run build` now enable Form A on exactly **16 approved placements**, including the publicly reachable `aia.web3app.dev` environment. No additional approval flags or access restriction are required. `PUBLIC_AIA_FORMS_MODE` is optional: absent/empty means `live`; explicit `off` and `mock` remain available. Invalid/obsolete `isolated-test` settings produce an actionable configuration error. The former approval flags and form environment role are retired, not renamed. Indexing and forms are independent. Both publication modes emit ten immediate frames (two contact, five landing, three consultation) and six deferred bilingual service-drawer frames. The bounded registry fixes ID `262946078314059`, HTTPS origin, context and language. Physical Form B is retired; the Form C proposal was canceled on 2026-11-01. Live drawers retain four-second/50%-scroll opening, shared 30-day suppression, manual CTA override, deferred loading, verified completion acknowledgment for five seconds, animated dismissal and fresh-form reopening. Off mode does not automatically show inactive drawers. All iframe security/fallback behavior is preserved. Employee-portal preview remains independently gated by explicit local approval, valid private ciphertext input and non-indexing output; Form A cannot authorize private content. No portal private resources enter normal artifacts. This owner authorization does not modify Jotform, authorize site cutover or complete pending consultation-language, provider-event, accessibility, runtime telemetry/privacy, recipient-routing or hosting acceptance. See the [current operating guide](../integrations/jotform/README.md) and [implementation and validation report](phase-9-form-a-default-live-2026-10-30.md). Earlier dated decisions and test results below are historical evidence, not current environment setup instructions. **Recorded:** 2026-10-28 UTC; revised 2026-10-30 UTC **Scope:** Default-live Form A integration; former Form C plan superseded by existing hosted referral link **Status:** 16 default-live placements owner-authorized; Jotform language/runtime acceptance and site cutover remain separate ## Decision revision (historical, superseded for Form C) The owner has replaced the former three-physical-form plan with two physical Jotform forms: - **Form A — General Enquiries, landing enquiries and family service consultations.** The existing Form A ID remains `262946078314059`; its approved `contact`, `landing` and `consultation` contexts cover 16 current Astro placements. - **Form C — Professional Referral Initiation.** It remains a separate future blank form with no assigned Jotform ID. **Form B is retired as a physical form.** Historical Form B decisions remain in the versioned contract and plan. The repository may keep `service` as a logical visitor-intent classification, but it maps to Form A's `consultation` context; remaining Builder/runtime acceptance does not constitute a new code gate. The October 30 decision enables all 16 existing placements by default without creating routes, modifying Jotform, creating Form C, changing query parameters or canonicals, or promising appointments. ## Form A contexts and planned consultation contract | Context | Status | Intended audience | Required route state | |---|---|---|---| | `contact` | Existing, owner-tested | General contact enquiries | Two approved live placements | | `landing` | Existing, owner-tested | Five named campaign landing journeys | Five approved live placements | | `consultation` | Configured in Jotform; nine live Astro placements | Family service consultations | Owner runtime acceptance remains separate | The context value is presentation-only. It is not an authorization, attribution, security, analytics or visitor-controlled value. `formContext` remains the known case-sensitive hidden-field Unique Name; no other Jotform field ID or condition name is inferred here. ### Planned consultation fields The consultation context reuses the current Form A adult contact and preferred contact-method behavior, including its existing conditional email/phone validation. It adds one required controlled question: > **Which service would you like to discuss?** | Approved display option | Logical intent only | |---|---| | ABA Therapy | `aba_therapy` | | AIA Preparatory Academy | `aia_preparatory_academy` | | Learner Social Club | `learner_social_club` | | Autism Diagnostic Evaluation | `autism_diagnostic_evaluation` | | I'm Not Sure Yet | `not_sure_yet` | The values in the right column are planning labels, not Jotform option values or IDs. Operations and the Jotform owner must approve the exact Builder labels, translations, requiredness and conditions. Do not add a conditional explanatory note when **Autism Diagnostic Evaluation** is selected. An AIA client advocate will explain available options and coordination with qualified diagnostic providers during the subsequent conversation. The consultation form must not imply that AIA currently provides an in-clinic diagnostic evaluation, offers a diagnosis, or has completed a diagnostic-professional hire. Do not add child name, date of birth, age, diagnosis, medical history, records, insurance member ID, payment, location or booking questions to the initial consultation context. Do not make any additional consultation field required without a separately documented operations, clinical and privacy decision. Whether an existing optional free-text message remains visible requires the existing Form A privacy treatment; it is not an additional required consultation field under this specification. ## Historical Form C proposal (canceled 2026-11-01) The following field plan is retained only as historical evidence. It is not a task, cutover dependency, or direction to create another Jotform. Form C remains a separate future physical Jotform created from a blank form. Its initial, minimum-necessary specification is: | Semantic field | Requirement | |---|---| | Professional name | Required | | Organization | Required | | Work email | Required | | Work phone | Optional, pending operations confirmation | | Service of interest | Required controlled selection | The visible form must instruct referrers not to submit patient names, dates of birth, diagnosis narratives, medical records or other patient-identifying information. Detailed referrals remain in the separately approved protected workflow. No Form C ID, hosted URL, iframe, language route or conditional logic is assigned by this document. ## Current consultation route and component matrix The following nine placements join the original seven in one live registry. Both indexing and non-indexing builds enable them by default. Explicit off/mock builds contain no real Form A frames. | Route or entry point | Locale | Current component / behavior | Future physical form and context | Dependencies | |---|---|---|---|---| | `/client-consultation` | EN | `FormShell.astro` through `PageLayout.astro`; immediate live iframe | Form A / `consultation` | Owner Jotform visibility/requiredness/confirmation acceptance | | `/es/client-consultation` | ES | Same component; immediate live iframe | Form A / `consultation` | Spanish Jotform labels, errors and locale acceptance | | `/schedule-consultation` | EN | `FormShell.astro` through `PageLayout.astro`; immediate live iframe | Form A / `consultation` | No-booking copy and owner acceptance | | `/aba-therapy` drawer | EN | `ServiceInquiryDrawer.astro`; live automatic/manual drawer | Form A / `consultation` | Owner acceptance and dialog accessibility review | | `/autism-evaluations` drawer | EN | Same component; live automatic/manual drawer | Form A / `consultation` | Clinical/operations copy and owner acceptance | | `/learner-social-club` drawer | EN | Same component; live automatic/manual drawer | Form A / `consultation` | Program copy and owner acceptance | | `/es/aba-therapy` drawer | ES | Same shared drawer; live automatic/manual drawer | Form A / `consultation` | Spanish Jotform and fluent-language acceptance | | `/es/autism-evaluations` drawer | ES | Same shared drawer; live automatic/manual drawer | Form A / `consultation` | Spanish Jotform and fluent-language acceptance | | `/es/learner-social-club` drawer | ES | Same shared drawer; live automatic/manual drawer | Form A / `consultation` | Spanish Jotform and fluent-language acceptance | | `/referrals` | EN | One `Refer a Client` external button; no local form | Existing hosted Jotform https://form.jotform.com/231638510219149, distinct from Form A | Confirm existing form's recipient/privacy/accessibility controls; no Form C | English and Spanish service-page CTAs open their authorized live drawer with JavaScript, retaining their consultation-page navigation destination otherwise. They are not additional iframe placements. The same is true of homepage, services, FAQ and library consultation CTAs that resolve to those pages. The current Tour CTA in `src/content/pages/en/tour.mdx` points to `/client-consultation`. The planned consultation service list contains no tour choice. Intake/operations must decide whether Tour keeps that destination, moves to the existing general-contact/tour journey, or receives a separately approved context before any code or CTA change. This specification makes no Tour-route change. ## Remaining owner and Jotform acceptance actions 1. Confirm that the configured Form A `consultation` context has not changed the approved `contact` or `landing` journeys; record the rollback method for the Builder configuration. 2. Verify the exact hidden context value, service question, five display options, requiredness, EN/ES translations, validation messages and confirmation language in Jotform. Do not invent fields or accept query-controlled context values. 3. Confirm that no child/clinical/payment/location/booking fields, webhooks, integrations, answer-bearing notifications, PDF attachments, analytics or forwarding are introduced for the consultation context. 4. Obtain intake/operations, clinical and privacy approval for the field set and approved service options. Obtain fluent English/Spanish review for all added presentation and error text. 5. Run separately authorized synthetic Jotform and Astro-iframe acceptance tests with no real patient data. Cover both locales, all service choices, validation/error states, no-JavaScript and keyboard behavior, confirmation, notifications, responsive sizes and direct hosted fallback. 6. Record acceptance separately from the owner-authorized default-live 16-route registry. Site deployment/cutover still requires release authorization; no further Form A build flags are required. 7. For `/referrals`, confirm the existing hosted Jotform destination, permissions, response handling, patient-data privacy, staff recipients and operational suitability. Do not create Form C. ## Retained gates This decision does not close P9-01, P9-03, P9-05, P9-06, P9-07, P9-09 or P9-10. Form A's existing owner-reported direct and sampled embedded acceptance does not prove the new consultation context. Final real screen-reader, all-route responsive, runtime telemetry/privacy, hosting, notification-recipient and release-owner acceptance remain open. ## Historical 2026-10-29 supersession and implementation addendum (gate superseded above) The owner reports that the Form A `consultation` context and its conditional rules have been configured through the connected Jotform app. The repository now permits the nine matrix placements only when every isolated-test gate is present, including `PUBLIC_AIA_FORMS_CONSULTATION_TEST_APPROVED=true`. Three standalone pages load the fixed consultation URL immediately; six English/Spanish service drawers retain no iframe `src` until the visitor explicitly opens them. This does not change the frozen seven-route production allowlist. The earlier version of this specification required a conditional Autism Diagnostic Evaluation explanation. That requirement is superseded: no conditional explanatory note is required in Form A or Astro. The historical decision is preserved by this dated addendum; the current contract is the client-advocate conversation described above. ## Historical 2026-10-30 consolidated drawer behavior revision (mode superseded above) The later owner prompt supersedes explicit-only opening for the six EN/ES service drawers. Authorized consultation-test drawers now open after four seconds or 50% of positive available page-scroll distance, whichever occurs first. Opening consumes both automatic triggers. A different open modal or actively edited field cancels that automatic opportunity without polling. Deferred Jotform loading begins only when the drawer actually opens. Dismissal stores only `aia:service-inquiry:auto-suppressed-until`, a first-party expiry timestamp for 30 days shared across services and locales. Existing consultation anchors are explicitly marked as drawer triggers; they bypass suppression manually and retain their consultation-page href without JavaScript or an authorized drawer. Closing renews the preference. It is not an audience, tracking identifier, service-selection record or form-response store. Centralized bilingual headings/introductions use provisional owner-supplied service copy. The Academy service key has EN/ES copy for ages 2–6 but no route, navigation change, new iframe allowance or publication entry. All original seven production and nine isolated consultation placements remain unchanged. No diagnostic conditional note or service preselection is introduced. The clinical and fluent-language review gates remain open. ### 2026-10-30 completion and language correction addendum On a strictly validated Form A `submission-completed` message, an open activated consultation drawer records the same shared suppression expiry immediately, shows localized acknowledgment for five seconds, then uses the existing slide-out/close/focus-restoration flow. The 500ms slide-out follows the full five-second acknowledgment; reduced motion closes immediately after that delay. Manual close/navigation cancels timers. A duplicate message is inert. A later manual CTA starts a fresh iframe after completion; an unfinished iframe is retained. This is not analytics, conversion measurement or answer inspection. The exact source window and exact origin from the gated URL must match. No new production route is approved. Provider behavior still requires owner acceptance. The owner-reported Spanish seven-option dropdown conflicts with the intended five choices. Astro emits one fixed consultation iframe per surface; EN/ES differ only in language. No option identifiers, duplicate intent field or service preselection are emitted by Astro. Owner must compare the hosted Spanish form, then review multilingual option translations and Update Options conditions. Do not remove options through cross-origin scripts or add another physical form.