# Flow benchmark fixture — Product Requirements (v1.0)

Flow benchmark is a one-page fixture: a heading, a status line and a single Name field with a Save button. Saving shows the saved name in the status line; a small API mirrors the page.

**Problem.** Testers and automation runners need a minimal, fully predictable page against which every message and rule can be checked exactly.

## Users
- **Tester** — Verify page text, validation and keyboard behaviour against exact wording.
- **Automation runner** — Read the page faithfully and report disagreement between an expectation and what is shown.

## Goals
- The page shows exactly the wording specified here.
- Validation rules are identical on the page and in the API.

## Page content (PAG)

Heading, status line and form shown on load.

- **FR-PAG-01** (Must) The page at /flow/ shows the heading "Flow benchmark", a status line reading "Ready" and a form with one text field labelled "Name" and a "Save" button.
  - The status line always starts as "Ready"; it never reads "Offline" or any other wording on load
  - The Name field is empty on load
- **FR-PAG-02** (Should) The status is not persisted: reloading the page resets it to "Ready" and empties the Name field.

## Save and validation (SAV)

Saving a name and rejecting empty input.

- **FR-SAV-01** (Must) Saving a name replaces the status with "Saved: <name>".
  - "Ada" shows "Saved: Ada"; the wording is "Saved", not "Stored"
- **FR-SAV-02** (Must) An empty name is rejected with "Name is required" in the status line, before any request is made.
- **FR-SAV-03** (Should) The name is trimmed before validation and saving.
  - Only spaces: "Name is required"
  - "  Grace  " is saved as "Saved: Grace"
- **FR-SAV-04** (Should) Each successful save replaces the previous one; only the latest name is shown.
  - Saving "Ada" then "Alan" shows "Saved: Alan"
- **FR-SAV-05** (Should) Pressing Enter in the Name field submits the form exactly like the Save button.

## Status and save API (API)

HTTP endpoints that mirror the page.

- **FR-API-01** (Should) POST /api/flow/save with a name returns 200 {"status":"Saved: <name>"}; GET /api/flow/status then returns status "Ready" and lastSaved set to the name.
- **FR-API-02** (Should) POST /api/flow/save with an empty or missing name returns 422 with errors.name "Name is required".

## Non-functional requirements

- **NFR-01** (Should) The status line is a polite live region (role "status", aria-live "polite") and the Name field is associated with its label.

## Out of scope

- Persistence across browsers
- Styling
