## 2026-10-08T08:38:30Z
You are teamwork_preview_worker (Milestone 5 Implementation Worker - Hardening & Grand Master Assembly).
Your working directory is: c:\Projects\KieuStory\.agents\teamwork\worker_m5_1

You MUST read:
- c:\Projects\KieuStory\.agents\teamwork\ORIGINAL_REQUEST.md
- c:\Projects\KieuStory\PROJECT.md
- c:\Projects\KieuStory\.agents\teamwork\challenger_m5_1\handoff.md (and tests/tier5_creative_hardening_report.json)
- c:\Projects\KieuStory\.agents\teamwork\challenger_m5_2\handoff.md (and tests/adversarial_tier5_pipeline_hardening_results.json)
before starting work.

Files owned exclusively by you:
- c:\Projects\KieuStory\FilmMaker\TAP_01_XUAN_SAC_THE_NGUYEN_VA_GIONG_BAO_DOAN_TRUONG.md
- c:\Projects\KieuStory\FilmMaker\INDEX_VA_DANH_MUC_CANH_QUAY.md
- c:\Projects\KieuStory\02_AI_Prompts\muse_ai_video_prompts.json
- c:\Projects\KieuStory\05_Production_Pipeline\assemble_ep01_feature.py
- c:\Projects\KieuStory\05_Production_Pipeline\audio_continuity_engine.py
- c:\Projects\KieuStory\05_Production_Pipeline\production_orchestrator.py
- c:\Projects\KieuStory\PROJECT.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.

Your implementation tasks:
1. Fix GAP-CREATIVE-01 (Thúy Vân Age & Twin Status Reconciliation):
   - In `FilmMaker/TAP_01_XUAN_SAC_THE_NGUYEN_VA_GIONG_BAO_DOAN_TRUONG.md`: Reconcile Thúy Vân's age in character roster (lines 18-20) and action descriptions (around lines 389, 402, 664) from "15 tuổi"/"15t" to "16 tuổi (song sinh cùng Kiều)".
   - In `FilmMaker/INDEX_VA_DANH_MUC_CANH_QUAY.md`: Reconcile C03 summary from "15t" to "16t (song sinh)".
   - In `02_AI_Prompts/muse_ai_video_prompts.json`: In `ep01_scene03_shot02`, update description to reflect 16yo twin.
2. Fix GAP-CREATIVE-02 & GAP-CREATIVE-03 (Character Asset Refs & Normalization):
   - In `02_AI_Prompts/muse_ai_video_prompts.json`: Normalize the 27 verbose character asset references to existing canonical files in `04_Assets/characters/` (e.g., `vuong_ong_patriarch_55yo` -> `vuong_ong_55yo`, `vuong_ba_matriarch_50yo` -> `vuong_ba_50yo`, `vuong_quan_young_14yo` -> `vuong_quan_14yo`, `imperial_guards_brutal_officials` -> `sai_nha_feudal_guards`).
   - In `05_Production_Pipeline/production_orchestrator.py`: In `resolve_start_frame()`, add alias mapping dictionary so verbose keys map cleanly to canonical asset files if requested.
3. Fix Pipeline Gaps in `05_Production_Pipeline/assemble_ep01_feature.py`:
   - Include all 15 scenes (C01 through C15: `ep01_scene01` to `ep01_scene15`) in the parts list.
   - Enforce MP4 versioning for output: default to `ep01_grand_master_v1.mp4` / `thap_ngu_nien_ep01_grand_feature_master_v1.mp4`.
   - Resolve scene masters dynamically (preferring `06_Exports/<scene>_cinematic_master_v1.mp4`, `<scene>_cinematic_master.mp4`, or `04_Assets/videos/<scene>_master_v1.mp4`).
   - Wrap script execution in `if __name__ == "__main__":` and provide `assemble_grand_feature(ep="ep01", dry_run=False, check=False, output_path=None)` callable function.
   - Add CLI arguments: `--check`, `--dry-run`, `--output`, `--version`.
   - Update console output and docstrings from "7m30s / 10min" to "25-30 phút (Full Feature 188 Shots)".
4. Fix Audio Engine Silence Crash in `05_Production_Pipeline/audio_continuity_engine.py`:
   - In `normalize_loudness()`, if single-pass loudnorm encounters `-inf` or pure silence, clamp or provide safe parameters to prevent AAC encoder `nan` crashes.
5. Update `PROJECT.md`:
   - Line 50: Milestone 4 Status -> `DONE`
   - Line 51: Milestone 5 Status -> `IN_PROGRESS`
6. Run Verification:
   - Run `python tests/run_all_tests.py` and verify all 155 tests pass (100.0%).
   - Run `pytest tests/test_tier5_creative_hardening.py` and verify all 38 tests pass.
   - Run `pytest tests/test_tier5_pipeline_hardening.py` and verify all 20 tests pass.
   - Run `pytest tests/ -q` and verify all tests pass.
   - Run `python 05_Production_Pipeline/assemble_ep01_feature.py --check` and `--dry-run`.
7. Document all changes, test commands, and layout compliance in `handoff.md` following the 5-component protocol, and send a message back.
