# Execution Plan — Orchestrator 13: Full i18n & Chat UI Architecture Overhaul

## Objective
Fulfill all requirements under ## 2026-10-02T01:42:06Z of `ORIGINAL_REQUEST.md`:
1. R1: Comprehensive audit and resolution of language issues in Chat UI and related modules (immediate reactive update on language switch, zero hardcoded Vietnamese/English strings).
2. R2: Unified i18n architecture and event bus for cross-platform reactive language propagation across Web PWA, iOS Metal/Mobile, and Desktop.
3. R3: Multi-tiered anti-regression test suite and hygiene linter (Python/JS linter detecting hardcoded Vietnamese strings, unit tests for i18n event propagation, E2E validation script).
4. R4: Documentation of engineering standards and developer checklists in AGENTS.md, GEMINI.md, and docs/standards/ENGINEERING_STANDARDS_2026.md.

## Phases

### Phase 0: Survey & Codebase Exploration (Current)
- Dispatch 3 parallel Explorers:
  - `explorer_survey_chat_1`: Audit `client/webapp/js/ui/chat_ui.js` and all related chat UI components, finding all hardcoded strings, state bindings, event listeners, and reactive gaps.
  - `explorer_survey_i18n_1`: Investigate current i18n architecture, locale dictionaries, settings modal language switching, storage, event bus mechanisms, and cross-platform hooks.
  - `explorer_survey_tests_1`: Map existing test suites, linters (`tools/lint/`), hygiene checks, and design the anti-regression verification strategy.
- Synthesize findings into `PROJECT.md` with full Feature Inventory.

### Phase 1: Milestone 1 — Reactive i18n Event Bus & Chat UI Full Localization
- Dispatch Worker:
  - Implement unified language change event bus / observer pattern in client i18n system.
  - Update `chat_ui.js` and related components to listen to language changes and re-render/update all DOM elements dynamically (tabs, placeholders, cooldowns, system notices, tooltips, buttons).
  - Extract all hardcoded strings into dictionary/locale entries (both Vietnamese and English, plus fallback keys).
  - Ensure zero page reload required.
- Dispatch 2 Reviewers, 2 Challengers, 1 Auditor.
- Pass Gate.

### Phase 2: Milestone 2 — Multi-Tiered Anti-Regression & Hygiene Linter Suite
- Dispatch Worker:
  - Create static linter tool in `tools/lint/` (e.g., `check_ui_i18n_hygiene.py` or similar) to detect hardcoded Vietnamese text/strings in UI source files.
  - Create unit tests (Python / JS) verifying i18n event bus registration, event firing, locale dictionary key parity, and subscriber notification.
  - Create E2E / integration test verifying real UI language switching without page reload.
  - Wire into existing test runners / hygiene runners.
- Dispatch 2 Reviewers, 2 Challengers, 1 Auditor.
- Pass Gate.

### Phase 3: Milestone 3 — Documentation & Engineering Standards Integration
- Dispatch Worker:
  - Update `AGENTS.md`, `GEMINI.md`, and `docs/standards/ENGINEERING_STANDARDS_2026.md`.
  - Document mandatory i18n rules, event-driven reactive UI patterns, anti-hardcoding directives, and CI linting gates.
  - Verify file line caps (soft cap <= 400 docs / 350 code, hard cap <= 600 docs / 500 code).
- Dispatch 2 Reviewers, 2 Challengers, 1 Auditor.
- Pass Gate.

### Phase 4: Final Verification, Adversarial Hardening & Forensic Audit
- Full regression run of all tests.
- Comprehensive forensic audit for zero hardcoded strings and genuine implementation.
- Gate check & Handoff to parent.
