Files
solution-erp/docs/changelog/sessions/2026-07-12-S112-supplier-import-pe-signoff.md

38 lines
4.3 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.

# S112 — 2 feature SHIP prod: Supplier Excel-import + PE sign-off change (2026-07-12)
> **em-main-led · lead=Opus 4.8 owner-choice (`/model`) · HMW-ON · 3 fable-clone ensemble Opus MAX + 8 spawn · 4 commit (2 prod + closeout) · Deploy Run #496 PASS.**
## Kết quả
- **2 feature LIVE prod** (Gitea Run #496, 5m25s, 458 test PASS):
- **Supplier Excel-import Phase B** (`e100ef0` — Mig 63): nút "Import Excel NCC" → upload → preview (New/Update/Skip/Error) → confirm all-or-nothing.
- **PE sign-off change** (`a829d0d` — code-only): A1 người-tạo tự ký ô cấp mình + EDGE-5 khóa terminal + opinion-history.
- **bundle** admin `BVyH-FY7``Cixlt_MA` / user `EDsZebvn``BhBOG1dn` · Mig 63 prod 2/2-col · smoke all-200 + import-route live.
## Owner-directed (số = quyền anh)
- `harness_floor.rounded_up_tokens` **30K→100K** + `measured_token_estimate` re-measure **21K→55K**. 21K cũ = UNDER-COUNT: S81 đoán tool-schema+framing ~7K, thực ~30-50K; disk-inject đo-thật 57.6KB (~14-19K tok) MỘT MÌNH đã ≈ 21K cũ. Sister-parity ~60-71K. Derived-flush engine §G.1.
## Supplier import — pipeline
invest `wf_e2f23a84` (30-col messy header row-4, #REF!, 4 NCC) → anh chốt **5 decision** (Code=col4 · +2 field Mig63 · A-scoped-layout · fill-nulls-SAFE · Type-lạ→NhaCungCap) → BE (dedup **OrdinalIgnoreCase** preview+confirm chống unique-violation CI-collation · all-or-nothing · parser header-fingerprint absolute-cell-index #REF!-null NAS-backslash-raw) + FE 2-app byte-identical + 10 test có-RĂNG (SQLite BINARY → dedup ở SERVICE) → close-review `wf_75d6149b` GO-WITH-ADJ → **adjust**: bake 30 real-token `RealFileHeaderTokens` (byte-verify em-main) + `.Normalize(FormC)` de-risk NFD.
## PE sign-off — pipeline
invest `wf_fd8f2bfe`**root = `ApplyDrafterBypassOnSubmitAsync` (S60-feature)** tự-ký-hộ ô creator bằng comment-canned + advance-qua → creator mất ô comment thật → anh Kiệt **6 decision**: A1 (bypass CHỈ NV cấp dưới, creator ký tay, giữ skip-NV S60) · no-finalize-guard (theo quyền `AllowApproverFinalize`) · EDGE-5 hard-lock · 1-nút · opinion-history · phiếu-mới-only → close-review `wf_7df56b89` GO-WITH-ADJ (🔴 **L2-catch**: EDGE-5-guard phải ĐỈNH-METHOD `TransitionAsync` mới chặn admin-override `:290` [spec bỏ sót] · A1 **MỞ CEO-skip MỚI** qua finalize-flag) → **oQ reconcile**: finalize-theo-quyền accept + EDGE-5 `!isAdmin && !isSystem` **admin-exempt** ("Admin đầy-đủ-nhất") → BE (A1 `minOwn`+pointer-stop · EDGE-5 guard-top · history log-cũ→`PurchaseEvaluationChangelog` trước overwrite) + test 4-update→A1 + 8-new → reviewer GO 0-must-fix.
## Lessons
- **#53-garble ×3** (invest + reviewer + cicd — chủ yếu Opus reasoning-lane) → recover: SendMessage-resume (2/2 clean lần 2) + **em-main byte-verify** (token-diff prod-curl) — KHÔNG tin verdict garble, tự verify ground-truth.
- **A1 "bám đúng quy trình" = thay-đổi tối-thiểu** (chỉ gate bypass, 0 refactor engine) = an-toàn deploy prod live.
- **close-review > investigation**: L2 bắt EDGE-5-guard-placement + A1-CEO-skip mà investigation nói "đã tồn tại" (imprecise).
- **NFC/NFD**: header-fingerprint file Excel thật có thể NFD → `.Normalize(FormC)` cả 2 phía.
- **fill-nulls-safe**: re-import KHÔNG sửa field đã-có (anh chốt "an toàn").
## UAT heads-up anh Kiệt
- **A1 bỏ auto-terminal-on-submit**: phiếu 1-bước creator-là-cấp-cuối nay cần bấm Duyệt (đúng ý, KHÔNG lỗi).
- **Upload file "Database NCC" THẬT** trên DEV/prod xác nhận LayoutValid=true trước dùng (structure scout khớp + NFC handled, file-thật end-to-end chưa test; báo "Sai layout" → hộp đỏ FE có "Header nhận được" copy sửa 1 vòng, KHÔNG hỏng data).
## Defer (non-blocking follow-up)
- FE-Import-guard `Suppliers/Create``Admin,CatalogManager` role-gate (user-thường thấy nút→403, BE-safe) 2-app.
- 2 stale-comment (best-guess→baked) + test `NormalizeJoin` +`.Normalize(FormC)`.
- harvest run-trace 3 ensemble @full session-end (agents self-updated diary; em-main stamp `[engine: fable-clone-ensemble · Opus-S112]`).
## State
**Mig 63 · 89 bảng · 458 test (45D+413I) · gotcha 79 · menu 54 · bundle admin `Cixlt_MA`/user `BhBOG1dn` (Run #496) · prod 21 NCC/17 user.**