> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stoutdata.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Factory

> Production and QA hardware test suites with structured pass/fail steps and optional camera capture.

A **factory suite** is a reusable collection of hardware tests designed for production or QA use: boards on a jig, an operator procedure, clear pass/fail verdicts, and a written record of each run.

Where [Workbench](/source/workbench/overview) is for interactive, hands-on control of a single instrument, a factory suite is a **scripted, repeatable sequence** with structured pass/fail steps — built for operators ("plug in the board, click Run, see pass/fail") rather than for a bench engineer poking at one net.

## Anatomy of a suite

Every suite has:

* An **entry point** (usually `main.py`) that declares the ordered sequence of steps.
* **Suite files** — Python modules, YAML step metadata, JSON fixtures, firmware binaries, reference images — uploaded into Stout's object storage.
* **Parsed steps** — derived from the entry point at import time, each step carrying a name, a description, and optional visual metadata (icon, color, expected image).

## Importing a suite

From **Factory → Import Suite**:

1. Upload a zip of your suite directory, or point at a GitHub repo.
2. Stout parses `main.py` to extract the step list and validates each step.
3. The suite is saved with a version. Re-importing creates a new version so you can roll back if a suite regresses.

## Running a suite

From **Factory → \[suite] → Run**:

1. Pick a target box. Stout checks that the box has all the nets the suite requires.
2. Click **Start**. The suite boots in a dedicated container on the box.
3. The run detail page opens a WebSocket to the box and streams every step event in real time.

Events you'll see:

* `step_started` / `step_completed` with pass/fail and duration.
* `image_captured` / `video_captured` if your step takes a camera capture.
* `log_line` for free-form output.
* `suite_finished` with aggregate `successCount` / `failureCount`.

## Run states

| State         | Meaning                                               |
| ------------- | ----------------------------------------------------- |
| **pending**   | Accepted, waiting for the box.                        |
| **uploading** | Suite files being pushed to the box.                  |
| **running**   | Steps executing.                                      |
| **passed**    | Every step completed successfully.                    |
| **failed**    | At least one step failed.                             |
| **cancelled** | An operator clicked Cancel.                           |
| **error**     | Infrastructure failure (box lost, suite parse error). |

## Reports

Every run produces a report with per-step results, any captured images or videos, and a structured event log. Reports can be downloaded as JSON for integration with your MES or QA tracker.

<Note>
  The authoring guide for factory suites (writing steps, defining pass/fail
  criteria, camera capture, structured metadata) is coming soon. In the meantime,
  look at an existing suite's `main.py` for the conventions.
</Note>
