# BRIEFING — 2026-10-01T01:05:00Z

## Mission
Milestone M2 — Client Chat Engine & WebApp UI Integration (ChatManager.ts, chat_ui.js, index.html, main.js, unit tests).

## 🔒 My Identity
- Archetype: implementer
- Roles: implementer, qa
- Working directory: c:\Projects\FreeExile\.agents\teamwork\worker_chat_m2_1
- Original parent: 7020ed22-d577-4b8a-8fb7-a0bd4b2658d7
- Milestone: Milestone M2 — Client Chat Engine & WebApp UI Integration

## 🔒 Key Constraints
- File ownership: exclusively client/src/chat/ChatManager.ts, client/webapp/js/ui/chat_ui.js, client/webapp/index.html, client/webapp/js/main.js, tests/unit/test_webapp_chat_ui.py.
- Do NOT touch server/chat/ or tools/stress/.
- Soft caps: JS logic <= 350 lines, HTML <= 150-200 lines (hard cap 400 lines), tests <= 350-500 lines.
- Clean TypeScript compile: cd client; npm run build must exit 0.
- Clean hygiene: python tools/lint/check_code_and_doc_hygiene.py --strict must pass with 0 errors.
- Genuine implementation: real ring buffer, auto-scroll lock, anti-spam countdown, item link tooltip modal with HMAC badge.

## Current Parent
- Conversation ID: 7020ed22-d577-4b8a-8fb7-a0bd4b2658d7
- Updated: 2026-10-01T01:04:18Z

## Task Summary
- **What to build**: Extend ClientItemSnapshot in ChatManager.ts; create client/webapp/js/ui/chat_ui.js; update client/webapp/index.html and main.js for chat dock, tooltip modal, and keyboard shortcuts; create tests/unit/test_webapp_chat_ui.py.
- **Success criteria**: TypeScript build passes, Python unit tests pass, hygiene check passes, 8 channels, 100-msg ring buffer, auto-scroll, cooldown countdown, rich item tags, 2.5D Cổ Võ tooltip with HMAC badge.
- **Interface contracts**: proto/chat.proto, server/chat/chat_types.py
- **Code layout**: Tam Phân Lập Native ES Modules in client/webapp

## Key Decisions Made
- Channel mapping: 8 channels matching proto/chat.proto (World=1, Zone=2, Guild=3, Party=4, Whisper=5, System=6, Recruit=7, Feedback=8).
- UI dock: Collapsible/expandable dock in bottom-left above mobile safe area, avoiding collision with existing HUD / skill bar.
- Item tags format: `[item:{uuid}:{sig}:{name}:{rarity}]` parsed to clickable spans opening `#modal-item-link-tooltip`.

## Artifact Index
- client/src/chat/ChatManager.ts
- client/webapp/js/ui/chat_ui.js
- client/webapp/index.html
- client/webapp/js/main.js
- tests/unit/test_webapp_chat_ui.py
- .agents/teamwork/worker_chat_m2_1/handoff.md

## Change Tracker
- **Files modified**: None yet
- **Build status**: Pending
- **Pending issues**: None

## Quality Status
- **Build/test result**: Pending
- **Lint status**: Pending
- **Tests added/modified**: tests/unit/test_webapp_chat_ui.py (planned)
