Skip to main content
Core10–16 hours

Production AI Assistant Interface

Build a production AI assistant frontend with streaming, citations, approvals, cancellation, error states, and accessibility.

streaming UIstate managementapprovalsaccessibilitysafe rendering

Scenario

Task

A user works with an AI assistant that streams its response, shows sources, and may propose a risky action. The interface must explain the current state, support cancellation, and require explicit confirmation.

Step-by-step execution

1. Design the state model

Outcome: The UI has explicit idle, loading, streaming, error, and approval states.

Tasks

  • Define the state machine
  • Add cancellation
  • Separate content from commands

Checks

  • No hidden transitional states remain
  • Repeated submission does not duplicate the request

2. Implement streaming and citations

Outcome: Responses update reliably and expose their evidence.

Tasks

  • Process chunks
  • Add source cards
  • Add an abstention state

Checks

  • Out-of-order chunks do not break the UI
  • An unknown citation is not rendered as valid

3. Add approval UX

Outcome: Risky actions cannot execute without consent.

Tasks

  • Show consequences
  • Add confirm and deny actions
  • Add an audit summary

Checks

  • There is no auto-confirm path
  • The user sees the exact action before execution

4. Verify accessibility and failures

Outcome: The interface is accessible and can recover from failures.

Tasks

  • Run a keyboard test
  • Verify screen-reader status announcements
  • Simulate network failure

Checks

  • Focus is not lost
  • Every error has retry or a safe exit

Acceptance criteria

  • Streaming can be cancelled
  • Citations are validated
  • Risky actions require approval
  • The UI passes the keyboard flow
  • Failure-state evidence exists

Assessment rubric

How the result is assessed

Passing score: 72/100 · Distinction: 90/100

UI state model

Streaming, error, cancellation, and approval states are explicit.

25 points

Insufficient

States are mixed together or race conditions remain.

Competent

Core states are explicit and tested.

Strong

Deterministic replay, concurrency tests, and recovery paths are implemented.

Evidence required

  • ✓ Link to an artifact or code
  • ✓ README with decisions and trade-offs
  • ✓ Evidence of completed checks
  • ✓ State diagram or transition table

Citations and safe rendering

Sources are validated and untrusted content cannot become a command.

25 points

Insufficient

An unknown source is displayed as valid.

Competent

Citations are validated and have a fallback.

Strong

Provenance, schema validation, and security tests are implemented.

Evidence required

  • ✓ Link to an artifact or code
  • ✓ README with decisions and trade-offs
  • ✓ Evidence of completed checks
  • ✓ Example of a valid and invalid citation

Approval UX

Risky actions expose context, confirm or deny controls, and an audit trail.

25 points

Insufficient

An action can execute without explicit consent.

Competent

Approval blocks execution and shows the consequences.

Strong

Undo, delegated approval, and a durable audit trail are implemented.

Evidence required

  • ✓ Link to an artifact or code
  • ✓ README with decisions and trade-offs
  • ✓ Evidence of completed checks
  • ✓ Approval flow recording

Accessibility and failure recovery

Keyboard access, focus, announcements, and retry behavior work reliably.

25 points

Insufficient

Focus is lost or streaming updates are not announced.

Competent

The core flow is accessible and recoverable.

Strong

Automated accessibility tests and progressive disclosure are implemented.

Evidence required

  • ✓ Link to an artifact or code
  • ✓ README with decisions and trade-offs
  • ✓ Evidence of completed checks
  • ✓ Keyboard and screen-reader checklist