# Dispatch for worker_chat_m3_1

You are worker_chat_m3_1.
Your working directory is: c:\Projects\FreeExile\.agents\teamwork\worker_chat_m3_1

## Mandatory Inputs to Read First
1. `c:\Projects\FreeExile\.agents\teamwork\ORIGINAL_REQUEST.md` (specifically section `## 2026-10-01T00:42:05Z`)
2. `c:\Projects\FreeExile\.agents\teamwork\orchestrator_5\plan.md`
3. `c:\Projects\FreeExile\.agents\teamwork\explorer_chat_client_bench_1\handoff.md`
4. `TEST_READY.md` at project root

## MANDATORY INTEGRITY WARNING
DO NOT CHEAT. All implementations must be genuine. DO NOT hardcode test results, create dummy/facade implementations, or circumvent the intended task. A teamwork_preview_auditor will independently verify your work. Integrity violations WILL be detected and your work WILL be rejected.

## File Ownership
You own EXCLUSIVELY:
- `tools/stress/chat_load_benchmark.py`
- `tests/unit/test_chat_load_benchmark.py`

Do NOT touch any files in `server/chat/` or `client/`.

## Mission: Milestone M3 — 1,000,000 CCU Stress Benchmark & Performance Hardening
Upgrade `tools/stress/chat_load_benchmark.py` to deliver an enterprise-grade 1M CCU stress and performance verification suite:
1. **Concurrent Publisher Workers**:
   - Implement concurrent producer tasks via `asyncio.gather(*[publisher_worker(...) for _ in range(concurrency)])`.
   - Distribute messages across all 8 channels (World, Zone, Guild, Party, Whisper, System, Recruit, Feedback).
2. **Cryptographic HMAC Item Query Load**:
   - Ingest item snapshots and run high-concurrency item snapshot queries to verify that HMAC verification and cache lookup achieve average latency < 2.0ms.
3. **Multi-Round Memory Leak Regression**:
   - Run 3-5 rounds of burst broadcasts with `tracemalloc`.
   - Track memory growth across rounds. Assert residual slope `residual_growth <= 0.05MB` across subsequent rounds to prove zero memory leak.
4. **Latency SLAs**:
   - Measure and report p50, p95, and p99 fan-out latency.
   - Assert `p99 < 15.0ms` (Zero-Latency SLA).
   - Assert zero packet loss (delivered_count == expected_deliveries).
5. **CLI & Unit Testing**:
   - Support CLI arguments: `--simulated-ccu`, `--active-sample-subscribers`, `--message-count`, `--concurrency`, `--shards`, `--rounds`.
   - Create unit tests in `tests/unit/test_chat_load_benchmark.py` to verify benchmark arguments, metrics collection, and exit codes.
   - Run `python tools/stress/chat_load_benchmark.py --active-sample-subscribers 1000 --message-count 200 --concurrency 10`.
   - Ensure `python tools/lint/check_code_and_doc_hygiene.py --strict` passes with 0 errors.

Deliver your report in `c:\Projects\FreeExile\.agents\teamwork\worker_chat_m3_1\handoff.md`.

## 2026-10-01T01:04:18Z
[Message] timestamp=2026-10-01T01:04:18Z sender=7020ed22-d577-4b8a-8fb7-a0bd4b2658d7 priority=MESSAGE_PRIORITY_HIGH content=You are worker_chat_m3_1.
Your working directory is: c:\Projects\FreeExile\.agents\teamwork\worker_chat_m3_1

Read c:\Projects\FreeExile\.agents\teamwork\ORIGINAL_REQUEST.md (specifically section ## 2026-10-01T00:42:05Z).
Read c:\Projects\FreeExile\.agents\teamwork\worker_chat_m3_1\DISPATCH.md.

MANDATORY INTEGRITY WARNING:
DO NOT CHEAT. All implementations must be genuine. DO NOT hardcode test results, create dummy/facade implementations, or circumvent the intended task. A teamwork_preview_auditor will independently verify your work. Integrity violations WILL be detected and your work WILL be rejected.

File ownership:
You own exclusively:
- tools/stress/chat_load_benchmark.py
- tests/unit/test_chat_load_benchmark.py

Task: Milestone M3 — 1,000,000 CCU Stress Benchmark & Performance Hardening
1. Upgrade tools/stress/chat_load_benchmark.py with concurrent publisher workers (asyncio.gather), all 8 channels distribution, HMAC snapshot query stress (< 2ms SLA), and multi-round memory leak regression testing (residual growth <= 0.05MB).
2. Verify fan-out latency p99 < 15.0ms SLA under 1M CCU simulation.
3. Create unit tests in tests/unit/test_chat_load_benchmark.py and verify execution.
4. Run python tools/stress/chat_load_benchmark.py --active-sample-subscribers 1000 --message-count 200 --concurrency 10.
5. Check hygiene: python tools/lint/check_code_and_doc_hygiene.py --strict.

Deliver your handoff report to:
c:\Projects\FreeExile\.agents\teamwork\worker_chat_m3_1\handoff.md
When finished, notify the orchestrator via send_message.

