## 2026-10-04T03:58:38Z
You are teamwork_preview_worker for Milestone 2 (4D BIM Simulation & Interactive Site Diary Dock - Features F7 to F10).
Working directory: c:\Projects\DSCons\.agents\teamwork\teamwork_preview_worker_m2_1
Workspace root: c:\Projects\DSCons

MANDATORY INPUTS:
- Authoritative requirements: c:\Projects\DSCons\.agents\teamwork\ORIGINAL_REQUEST.md (YOU MUST READ THIS FILE FIRST).
- Project architecture & feature inventory: c:\Projects\DSCons\.agents\teamwork\teamwork_preview_orchestrator_1\PROJECT.md.
- Survey report & detailed architecture: c:\Projects\DSCons\.agents\teamwork\teamwork_preview_explorer_survey_2\handoff.md (Read the full 90-day grounded schedule array, 6-phase sequence, and 4-panel bottom dock layout).
- E2E Test script assertions: tools/verification/test_ong_den_4d_bim_and_video_export.py (Checks 5 and 6).
- Engineering directives: c:\Projects\DSCons\.agents\AGENTS.md and c:\Projects\DSCons\GEMINI.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.

EXCLUSIVE WRITE OWNERSHIP:
- c:\Projects\DSCons\app\static\bim\index.html
- You may NOT modify other source files concurrently.

YOUR TASK:
Implement Milestone 2 (Features F7, F8, F9, F10) in `app/static/bim/index.html`:
1. Mobile & Resize Safeguard (from Challenger 1 finding):
   - In container resize handler: ensure `camera.aspect = Math.max(container.clientWidth, 1) / Math.max(container.clientHeight, 1); camera.updateProjectionMatrix();` preventing division by zero.
2. 4D BIM Player Controls (Feature F7):
   - Add floating player bar `.player-4d-dock` with Dark Slate styling, positioned above the bottom dock.
   - Nút Play/Pause (`#btnPlayPause`).
   - Nút tốc độ (`#btnSpeed1x`, `#btnSpeed2x`, `#btnSpeed5x`).
   - Nút bước: `◀`, `▶`.
   - Nút nhảy pha nhanh: GĐ 1 (Ngày 1), GĐ 2 (Ngày 11), GĐ 3 (Ngày 26), GĐ 4 (Ngày 46), GĐ 5 (Ngày 71), GĐ 6 (Ngày 83).
   - Thanh trượt timeline: `<input type="range" id="timelineSlider" min="1" max="90" value="1" step="1">`.
   - Huy hiệu ngày `#lblTimelineDay` ("Ngày 1 / 90") và badge pha `#lblPhaseBadge`.
3. 6-Phase Phasing Simulation Engine (Feature F8):
   - Split culvert and top slab loft geometry creation into 3 segments: Seg 1 (0 -> 50.0m), Seg 2 (50.0 -> 101.46m), Seg 3 (101.46 -> 146.46m).
   - Implement `setTimelineDay(day)`:
     * Phase 1 (Days 1-10): Site prep & temporary ditch/dyke.
     * Phase 2 (Days 11-25): Larsen sheet piles slide down Y; waler I300 & struts appear.
     * Phase 3 (Days 26-45): Excavation down -2.2m; bamboo piles count (`bambooInstanced.count`) increments up to 13,042; lean concrete 3.4m appears.
     * Phase 4 (Days 46-70): Rebar & culvert bottom/walls poured sequentially across 3 segments; 2 V250 waterstops placed; top slabs remain hidden.
     * Phase 5 (Days 71-82): Top slabs poured across 3 segments; 5 manholes CT-01 and 5 inspection covers CT-02 appear; wing walls at outlet appear.
     * Phase 6 (Days 83-90): Remove struts; Larsen piles slide up Y (extracted with 60kW vibro hammer); backfill K95; restore roadway.
   - Maintain 60 FPS: 0 new geometry allocations inside render loop.
4. Interactive Site Diary Bottom Dock (Features F9 & F10):
   - Embed grounded 90-day dataset `SITE_DIARY_SCHEDULE_90_DAYS` from `handoff.md` (lines 167-290).
   - Collapsible dock `.site-diary-dock`: `position: absolute; left: 0; right: 390px; bottom: 0; z-index: 8;` (Strict Zero Occlusion with 390px sidebar!).
   - Collapse toggle button `#btnToggleDock` switching between expanded (195px) and collapsed (32px).
   - 4 Columns / Panels:
     1. Timeline & Meteorology: Date, weather icon, temp, CHT Nguyễn Văn Hoạt, TVGS Phạm Văn Dự.
     2. Workforce & Machinery: Trades headcount, active machines.
     3. 5D Cumulative Volumes: Earthwork m3, Larsen m, Bamboo piles, Concrete M250 m3, Rebar tons, progress bars.
     4. Safety & Monitoring: Bottleneck TC1-Cọc 4, Mr. Quyết house settlement M1-M3, crack monitoring, flood diversion.
   - Synchronous update: `renderSiteDiaryDock(day)` updates DOM elements in < 2ms on timeline change.
5. Testing & Verification:
   - Run `.venv\Scripts\python.exe -m pytest tools/verification/test_ong_den_4d_bim_and_video_export.py -v -k "test_check_5 or test_check_6"`.
   - Run `.venv\Scripts\python.exe -m pytest tests/test_architecture_boundary_enforcement.py -v`.
   - Verify 0 console errors on page load and during playback.
6. Write handoff report to: `c:\Projects\DSCons\.agents\teamwork\teamwork_preview_worker_m2_1\handoff.md`.
7. Send message to parent orchestrator when complete.
