# mail-engine-mime-content — Codex (3 surfaces, 5 behaviours, 2 contracts)

**Module:** `mail-engine-mime-content`
**Namespace:** `FreshCloud\Mail\MimeContent\`

---

## 3 Surfaces (public PHP classes/interfaces)

1. **`<PrimaryInterface>`** — the main public interface. Every other class in this module depends on it.
2. **`<ConcreteImpl>`** — the production implementation. Wires to PB / file system / network as needed.
3. **`<Exceptions>`** — module-specific exceptions (extends base or net-exceptions where applicable).

## 5 Behaviours (public methods/functions)

1. `init(...)` — bootstrap. Reads config, validates env, returns a ready instance.
2. `perform(...)` — the main verb. Does the work the module exists to do.
3. `validate(...)` — input/output validation. Throws on invalid.
4. `dispose()` — cleanup. Releases resources, flushes buffers, closes connections.
5. `health()` — returns status object for the bridge's `/health` endpoint.

## 2 Contracts (invariants)

1. **Pure construction**: every class is fully initialized via constructor. No half-built state. No setters that mutate after construction.
2. **No module cross-talk**: this module does not directly call other mail modules' internals. Only through their public interfaces. Cross-module calls go through the Composer.

---

## See also

- `recipe.md` — formation-recipe (full intent)
- `rules.md` — the 9 things per FVW §11.9
- `../module.json` — identity
- `../module-meta.json` — metadata
- `../composer.json` — autoload
