# Astra-reviewed implementation plan

The authorized scope is achievable as a static HTML/CSS/JavaScript demo with JSON fixtures, a deterministic conversation state machine, browser-local drafts and an iframe embed. The proposed entities are sufficient after the additions below, but no actual fixtures or executable tests were supplied. This review establishes implementation requirements; it does not verify deployed behavior or cited websites.

## Required implementation details

- Record the public synthetic demo and sarafanov.online deployment as authorized. Correct the design's six support choices to seven, including general triage.
- Implement branch-specific collection: hardware problem and impact; technical question and application/software subtype; planned-service subtype, requested date and site; case/order reference lookup; contract coverage and quote/renewal choice; general issue without mandatory serial.
- Define explicit states for identifier entry, model/site confirmation, linked-data display, request review, route selection and completion. Never display case, order or coverage details before the user confirms the linked site and, where applicable, product. Confirmation is a demo consistency check, not authentication.
- Use a small, documented keyword matcher for free text. Ask the user to choose when multiple intents match; show the menu when none match. After one invalid-input retry, offer general triage. Support guided completion without free text.
- Label every terminal outcome as simulated: handoff preview, saved callback draft, saved service request draft or official-contact referral. No booking, submission, agent connection, SLA or callback promise. Requested dates are preferences only.
- Ship English copy. Unsupported language choices offer English or an official contact referral; unsupported countries can still complete general triage. Treat a selected-country/site-country mismatch as a correction step before routing.
- Make routing deterministic with ordered rules and a general fallback. Evaluate hours in the destination region's timezone with opening inclusive, closing exclusive and holidays overriding weekday intervals. Use an injected clock for tests.
- Back must invalidate dependent answers, lookup results and route decisions. Restart clears the current conversation; explicitly saved drafts have a separate clear action. Explain browser-local storage, warn against entering personal data and recover gracefully when storage is unavailable.
- Separate source links from evidence: the supplied URLs have no accompanying excerpts, so they do not substantiate particular operating rules. Menus, routing, calendars, availability, priority handling and fixtures are original demo configuration. Verify official contact destinations before release; never invent regional numbers.
- Deliver runnable static assets, versioned fixture JSON and schemas, scenario JSON, Markdown documentation and JSON/text transcript downloads. Use an iframe for the smallest isolated embed; verify HTTPS, the chosen domain path and embedding headers on the actual host.

## Dependency order

1. Finalize the authorized scope, seven-intent acceptance matrix, simulation wording and source-versus-design annotations.
2. Define schemas, branch fields, state transitions, routing precedence and calendar semantics.
3. Create the linked baseline fixtures and scenario overrides; pass schema and referential-integrity validation.
4. Implement pure lookup, confirmation, intent matching, coverage, calendar and routing functions with an injected clock; test boundary behavior.
5. Implement the conversation state machine, review step, back/restart invalidation, draft persistence and exports; run all branch scenarios.
6. Build the accessible responsive widget, demo page and iframe/launcher example; complete keyboard and mobile checks.
7. Package static assets, Markdown documentation, schemas and downloadable JSON artifacts; validate a production build and verify official contact destinations.
8. Deploy to the authorized sarafanov.online location; verify HTTPS, embed behavior and representative end-to-end scenarios, then record the verified URL.

## Minimum data

- Product: id, displayName, family, supportedIntents. Minimum: DEMO-PRODUCT-1, 'Demo PCR instrument', amplification; DEMO-PRODUCT-2, 'Demo imaging instrument', imaging. Use synthetic names, not claims about an actual product portfolio.
- Site: id, organization, name, countryCode, timezone. Minimum: DEMO-SITE-1 in US/America/New_York and DEMO-SITE-2 in GB/Europe/London, each with an explicitly fictional organization.
- Instrument: serial, productId, siteId, contractId|null. Exactly three baseline records: DEMO-SERIAL-1 links product 1/site 1/active contract; DEMO-SERIAL-2 links product 2/site 2/expired contract; DEMO-SERIAL-3 links product 1/site 1/no contract. DEMO prefixes are test conventions, not manufacturer serial standards.
- Contract: id, tierLabel, startDate, endDate. DEMO-CONTRACT-1 runs 2026-01-01 through 2026-12-31; DEMO-CONTRACT-2 runs 2025-01-01 through 2025-12-31. Determine coverage using the confirmed site's local date, inclusive of both endpoints. Derive covered instruments from Instrument.contractId to avoid duplicate relationship storage. Tiers imply no SLA.
- Case: reference, instrumentSerial|null, productId, siteId, intent, status, ownerQueueId, updatedAt, nextAction. DEMO-CASE-1 is open and linked to serial 1; DEMO-CASE-2 is resolved, product-only, linked to product 2/site 2. Use explicit synthetic next-action text and timestamps preceding the baseline test time.
- Order: reference, siteId, lineItems[{productId,quantity}], shipmentStatus, invoiceStatus, updatedAt, nextAction. DEMO-ORDER-1 belongs to site 1 with delivered shipment/outstanding invoice; DEMO-ORDER-2 belongs to site 2 with pending shipment/invoice not issued. Exclude payment collection and financial details.
- Region: id, countryCode, supportedLanguages, timezone, weekdayIntervals, holidayDates, officialContactUrl, syntheticCalendar. DEMO-REGION-US and DEMO-REGION-GB both support English and synthetic Monday–Friday 09:00–17:00 hours. Mark 2026-10-13 as a synthetic US closure and label it visibly. Use verified official contact links before deployment.
- Queue and routing rules: queue id, regionId, availability enum available|busy, callbackEnabled; rule id, precedence, intent, optional family, regionId, language, queueId, routeLabel. Two regional queues suffice for the minimum demo, with intent-specific destination labels and wildcard/general fallback rules. Set US available/callback enabled and GB busy/callback enabled; scenarios override availability and callback flags explicitly.
- Conversation and draft: schemaVersion, DEMO-prefixed reference, intent, subtype, selectedCountry, language, productId|null, instrumentSerial|null, siteId|null, enteredUnknownIdentifier|null, confirmed lookup flags, issue/question, impact|null, requestedDate|null, callbackDestination|null, route, createdAt, simulatedStatus. Store only fields needed for the selected branch; callbacks use a fixed simulated destination or example.com identity.
- Scenario: DEMO-prefixed id, fixture references, initial state, injectedNow, configuration overrides, ordered user actions and expected state/route/outcome/export assertions. Baseline clock: 2026-10-12T14:00:00Z. Keep malformed fixtures and nonexistent lookup inputs separate from the valid baseline dataset.
- Validation: check schema versions, unique DEMO entity identifiers, enums, valid ISO dates/timestamps and IANA zones, positive order quantities, all foreign keys, case/instrument/product/site agreement, contract date ordering, nonoverlapping opening intervals, complete routing fallbacks and allowed official-link destinations. Reject or clearly report invalid configuration.

## Acceptance scenarios

- Complete each of seven intents from both the menu and an unambiguous free-text example. Assert review-before-completion, expected route, DEMO draft reference where applicable and a visible simulated outcome.
- Exercise application and software separately; installation, maintenance, qualification and training separately; quote and renewal separately. Reject malformed or past requested dates using the confirmed site's local date.
- Look up each of the three serials, confirm product/site, then show active, expired or absent coverage. Declining confirmation returns to correction without exposing linked details.
- Resolve DEMO-CASE-1 and DEMO-CASE-2, including the case without an instrument. Resolve both orders and display their distinct shipment/invoice states only after site confirmation.
- Use nonexistent DEMO-SERIAL-UNKNOWN, DEMO-CASE-UNKNOWN and DEMO-ORDER-UNKNOWN; test malformed and blank input. Unknown serials and cases allow triage; unknown orders retain a commercial referral path. General triage completes without an identifier.
- At baseline time, US routing produces an available-agent simulation and GB routing offers a callback draft. Override availability to busy, then disable callbacks; verify the official-contact alternative. Declining a callback also permits referral.
- Check opening, one instant before opening, closing, weekend and synthetic holiday. Test both regions and daylight-saving offsets: 2026-03-16T13:00:00Z is US opening; 2026-03-16T09:00:00Z is GB opening. Closed routes display synthetic hours and never promise agent availability.
- Test contract start date, end date and the following local day. Priority messaging neither invents a number nor changes eligibility into an SLA promise.
- Choose an unsupported country, unsupported language and a country conflicting with the confirmed site. Verify usable fallback or correction without a dead end.
- Enter ambiguous and unmatched intent text, then repeated invalid input. Verify clarification, menu access and general fallback. Back/edit/restart must remove stale linked data and routing decisions.
- Save and reload a draft, clear it, simulate blocked storage and export JSON/text. Exports contain correct confirmed fields and simulation labels. Render HTML-like user input as text; submission never sends entered content to a backend.
- Check desktop and narrow mobile layouts, keyboard-only completion, visible focus, input labels, announced bot messages, readable contrast and reduced motion. For the floating panel, verify Escape closes it and restores launcher focus without trapping users.
- Load the HTTPS sarafanov.online deployment directly and inside an iframe on a second origin. Verify asset paths, launcher behavior, scrolling, downloads, official links, framing policy and absence of console errors or unintended network submissions.
