# Plan: Multilingual Hello-World State Machine

## Context
The project is a blank slate (no existing Python code). We need to build a `StateMachine` class that cycles through English and Spanish greetings, plus pytest unit tests to verify each language's output.

---

## Files to Create

### 1. `hello_machine.py`
Core state machine implementation.

```
project/hello_machine.py
```

**Design:**
- `STATES` list — ordered sequence of `(language_name, greeting)` tuples:
  ```python
  STATES = [
      ("english", "Hello, World!"),
      ("spanish", "¡Hola, Mundo!"),
  ]
  ```
- `StateMachine` class:
  - `__init__`: sets `self._index = 0`
  - `current_language` property → returns language name of current state
  - `greet()` → prints the greeting for the current state, then advances index (cycling via `% len(STATES)`)
  - No external dependencies — stdlib only

### 2. `test_hello_machine.py`
Pytest unit tests.

```
project/test_hello_machine.py
```

**Test cases:**
- `test_english_output` — create machine, call `greet()`, assert stdout == `"Hello, World!\n"` (using `capsys`)
- `test_spanish_output` — create machine, call `greet()` twice, assert second stdout == `"¡Hola, Mundo!\n"`
- `test_cycles_back_to_english` — call `greet()` 3 times, assert third output == `"Hello, World!\n"` (wraps around)
- `test_initial_language` — assert `machine.current_language == "english"` before any `greet()` call
- `test_language_advances_after_greet` — assert language changes to `"spanish"` after one `greet()` call

---

## Self-Reporting Requirement

Per `CLAUDE.md`, log a `plan_stated` event **before** starting implementation:
```bash
bash audit/agent-report.sh "SESSION_ID" "plan_stated" "building multilingual hello-world state machine with English and Spanish states and pytest tests"
```

---

## Verification

```bash
cd project
python -m pytest test_hello_machine.py -v
```

Expected: 5 tests pass, covering English output, Spanish output, cycle wrap-around, initial state, and state advancement.
