Files
solution-erp/.claude/agent-memory/office-document/MEMORY.md

19 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# office-document — MEMORY (L1 HOT)
> 📄 Office document WRITE specialist SOLUTION_ERP — 12th sub, S107 2026-07-10 anh giao trực tiếp ("Sub chính" mảng Office). Floor OD1OD10 → `.claude/agents/office-document.md`. Entry ≤1.5K chars, append BEFORE return. Tiered: L1 này ≤ ~25.6KB autoinject / archive L2 khi đầy.
## Role summary (baseline S107)
- Tạo/đọc/sửa/convert **docx · xlsx · pptx · pdf**. Skill-first (OD1): `docx`/`xlsx`/`pptx`/`pdf` standalone + `form-engine` project (template 8 form HĐ, placeholder `{{field}}`, PDF LibreOffice, mã RG-001).
- Use-case SE: extract spec TRUNG THỰC file anh gửi (Excel "Database NCC" → Supplier Phase B 🅿️ PARKED chờ anh nhắc · QUY_TRINH/FORM docx) · chuẩn hóa template form · báo cáo/document deliverable · screenshot→docx (#74) · verify render form-engine round-trip (OD5).
- **Boundary cứng (OD6):** KHÔNG đụng `src/` · `fe-*` · `tests/` — C# render-engine = implementer-backend. Pipeline: extract→spec-table→em-main chốt→implementer author (proven S55 Mig 48: 62 dự án + 71 hạng mục + 3 NCC từ Excel).
## Key patterns (seed — chưa có war-story riêng)
- **Excel import proven:** extract→spec→Dev-proof→cicd-check (`feedback_realdata_master_import` S55; S96 +DONGDUONG; S104 Mig 62 un-cram 30-field).
- **Screenshot→docx (#74, S90):** PowerShell `CopyFromScreen` + Win32 lọc process `chrome.exe` + DOM overlay khoanh-đỏ + python-docx chèn ảnh — Chrome-MCP screenshot kẹt SPA-SignalR `document_idle`.
- **PDF prod:** LibreOffice `soffice --headless` trên VPS (iis-deploy-runbook); local KHÔNG có LibreOffice → skill `pdf` hoặc đề xuất VPS-run.
- **PS5.1 encoding:** ghi file trung gian PHẢI `-Encoding utf8` (default UTF-16 BOM phá parser — gotcha #61-family); script .ps1 pure-ASCII (#30).
- **Guard #53:** return VERDICT + path output + số-đo (page/sheet/row) — KHÔNG dump nội dung dài / transcript-slice.
## Entries (append-only, newest last)
- **[S107 spawn-test]** Task: verified-runtime lần đầu — READ 2 template thật + WRITE round-trip. Verdict: **PASS** (OD1 skill docx+xlsx invoked · OD4 extract honest · OD5 round-trip 3/3 para + bảng 2×2 khớp nguyên văn, 37,043 bytes, VN có dấu + em-dash sống qua write→read). Learned: (a) pipeline local = python-docx/openpyxl + `PYTHONIOENCODING=utf-8` khi print VN ra console; (b) openpyxl `read_only=True` trả `EmptyCell` KHÔNG có `.coordinate` → tự build ref bằng `get_column_letter(max_c)+str(max_r)`; (c) scan placeholder docx = paragraph.text (đã merge run, bắt split-run) + raw-XML strip-tag toàn part (bắt textbox) — 2 lớp mới đủ. **SURPRISE:** cả 2 template `wwwroot/templates` (FO-002.05 Giao khoán docx 249 para/10 table · FO-002.07 Đơn đặt hàng xlsx 3 sheet `(F.01)_SS GIA`/`PO`/`Po01 NLT (sua)`) đều **0 placeholder `{{field}}`** (raw-XML 0 hit mọi syntax) — mẫu gốc dạng blank chấm-chấm "Số: …………..", CHƯA placeholder-hóa; đừng assume `{{}}` có sẵn trong file template — form-engine mapping nằm ngoài file hoặc là việc chưa làm → hỏi em main trước khi đụng. Registry hot-reload giữa phiên ĂN THẬT (không cần CLI-restart như dự kiến S107).