# Plan: Multilingual Hello-World State Machine

## Context

The project is a fresh repository with no existing Python code. We need to create a simple state machine that cycles through English and Spanish greetings, along with pytest tests to verify behavior.

## Implementation

### 1. Create `project/state_machine.py`

Define a `StateMachine` class:

- **States**: `"english"` and `"spanish"` (stored as a list to define order)
- **Greetings map**: `{"english": "hello world", "spanish": "hola mundo"}`
- **`__init__`**: sets `current_index = 0`
- **`current_state`** property: returns the current language name
- **`run()`**: prints the greeting for the current state, then advances `current_index` (wrapping via modulo)
- Cycling order: english → spanish → english → ...

### 2. Create `project/test_state_machine.py`

Pytest tests using `capsys` to capture print output:

- **`test_english_output`**: fresh machine → `run()` → captured output is `"hello world\n"`
- **`test_spanish_output`**: fresh machine → `run()` (skip english) → `run()` → captured output contains `"hola mundo"`
- **`test_cycle_wraps`**: run through all states and verify it wraps back to english

## Files to Create

| File | Purpose |
|------|---------|
| `project/state_machine.py` | `StateMachine` class |
| `project/test_state_machine.py` | pytest unit tests |

## Verification

```bash
cd project && python -m pytest test_state_machine.py -v
```

All 3 tests should pass, confirming correct output for each language and proper cycling.
