# DISPATCH: Explorer M3 3 (Server Collision Integration & Unit Test Suite Spec)

## Assigned Agent
- Name: `explorer_m3_3`
- Type: `teamwork_preview_explorer`
- Working Directory: `c:\Projects\FreeExile\.agents\teamwork\explorer_m3_3`

## Mandatory Reference Documents
1. `c:\Projects\FreeExile\.agents\teamwork\ORIGINAL_REQUEST.md` (specifically section `## 2026-10-01T19:19:13Z` - R3 & R5)
2. `c:\Projects\FreeExile\GEMINI.md`
3. `c:\Projects\FreeExile\AGENTS.md`
4. `c:\Projects\FreeExile\.agents\teamwork\orchestrator_11\PROJECT.md`
5. `server/world/zone_engine.py`

## Exploration Scope & Instructions
Investigate server-side spawn collision validation and design the unit test suite for M3:
1. Examine `server/world/zone_engine.py`:
   - Inspect `validate_monster_spawn(zone_id, tx, ty)` and `can_spawn_hostile_monsters`.
   - Ensure monster spawn points are checked against tile passability (`ProceduralMapEngine.get_tile_type(zone_id, tx, ty)`): monsters cannot spawn on `WALL`, `CHASM`, `WATER`, or `BOSS_GATE`.
   - Ensure Safe Haven zones (`zone_player_hideout`, `zone_boundless_sanctuary`) strictly reject hostile spawns.
   - Line limit: `server/world/zone_engine.py` must stay $\le 490$ lines (Soft cap 350, Hard cap 500 lines).
2. Design comprehensive unit test suite `tests/unit/test_tile_collision.py`:
   - $\ge 10$ unit tests covering:
     1. Direct tile blocking: `WALL`, `CHASM`, `WATER`, `BOSS_GATE` block player.
     2. Passable tiles: `FLOOR`, `DIRT_PATH`, `SAND`, etc. do not block.
     3. 2-Axis sliding physics: Diagonal blocked into wall slides along orthogonal axis.
     4. Corner sliding: Sliding along corner tiles without penetration.
     5. Player collision radius: Edge penetration prevention at $r = 0.35$.
     6. Out-of-bounds containment: Coordinates $< 0$ or $\ge W, H$ are blocked.
     7. Boss Gate locked state blocks movement.
     8. Boss Gate unlocking mutates tile to passable and clears collision.
     9. Server `validate_monster_spawn` rejects impassable tiles.
     10. Dodge/blink behavior on chasms.
   - Line limit: `test_tile_collision.py` must be $\le 300$ lines.
3. Design Node.js client-side collision harness if helpful.
4. Deliver a detailed technical report in `report.md` and self-contained `handoff.md`.
Notify parent when complete.

## 2026-10-01T20:54:28Z
Sender: 1cc48fc5-ce57-4f48-8964-24cab4bfcacc
You are Explorer M3 3 (explorer_m3_3).
Your working directory is: c:\Projects\FreeExile\.agents\teamwork\explorer_m3_3
Your dispatch assignment is: c:\Projects\FreeExile\.agents\teamwork\explorer_m3_3\DISPATCH.md
MANDATORY: Read the authoritative user request at:
c:\Projects\FreeExile\.agents\teamwork\ORIGINAL_REQUEST.md (specifically section ## 2026-10-01T19:19:13Z - R3 & R5).
Also consult c:\Projects\FreeExile\GEMINI.md, c:\Projects\FreeExile\AGENTS.md, and c:\Projects\FreeExile\.agents\teamwork\orchestrator_11\PROJECT.md.

Investigate server-side spawn collision validation and design M3 unit test suite:
1. Examine server/world/zone_engine.py:
   - Ensure validate_monster_spawn checks tile passability via ProceduralMapEngine.get_tile_type.
   - Ensure Safe Haven purity (zone_player_hideout, zone_boundless_sanctuary) strictly rejects hostile spawns.
   - Keep zone_engine.py <= 490 lines (Soft cap 350, Hard cap 500 lines).
2. Design comprehensive unit test suite tests/unit/test_tile_collision.py (>= 10 unit tests, <= 300 lines).

Write report.md and handoff.md in your working directory and notify parent when complete.
