Commit Graph

633 Commits

Author SHA1 Message Date
3e2c18b637 [CLAUDE] Docs: S101 session-end closeout — §L auto-maintain (AS-10 recurrence + 2 monitor CHOT + model-note uniform)
- error-ledger E-006: AS-10 recurrence S101 (fire 5-6 from workflow-lanes; harvest-curator Fidelity-gate PASS -> KEEP per keep-if-correct, differs from S95-revert because S101-writes clean; GAP-3 dogfood-validate convention-not-mechanism; guard git-diff HELD 6/6 0-escape)
- session-start BUOC 0.6: +S101-Opus caveat (F-H19b, uniform with STATUS:24 + agents/README:3)
- harvest-curator diary: S101 @closeout GATE PASS 5/5 truc + AS-10 legit-keep Fidelity-call (on-behalf B3)
- tooling-auditor diary: S101 @closeout CHOT 4-mat + command 14->16 (COMMAND not skill) + model-drift #5 + F-H19a-defer (on-behalf B3)
- monitors verdict: harvest-curator GATE PASS (0 orphan, 0-byte 0/11, U+FFFD 0/11, containment OK) + tooling-auditor CHOT (11=11=11, 18/15/3, H19 docs full path:line-verified)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 18:32:11 +07:00
e35066016f [CLAUDE] Docs: S101 check-email AI_INFRA + H19 fable-clone formal adopt + model-tier 12/12
- check-email batch13 ack (SE caught-up H-17, Fable-restore H-8 recognized) + re-stamp H10 body-hash 5f511fe5->5f8b8504 (no-strip->canonical) + frontier flag#2 RESOLVED (AI_INFRA re-stamped 8b6a8354=SE-computed)
- model-tier bundle 07-03: 12/12 (all-inherit form-valid; v2-pin-simple not-adopted) + Q1/Q2 documented + selftest-stamp -> send-email 6c
- H19 fable-clone FORMAL ADOPT + RC-stamp RC-pqhuy1987-03-07-2026-17-46-35: 2 command fable-real/fable-clone (that/ao toggle, semantic-inverse) + marker gitignored + engine SS-K (K.A-K.D + 3 floor-fidelity gap) + session-start BUOC 0.5b reader (WF2-Lane-A fix marker-write-only) + 4 adap-report
- 2-workflow Harness-9: WF1 wf_5f308fd8-744 SOUND_WITH_CONCERNS (lost-to-interruption->resume-cached) + WF2 wf_ed5b972f-a4d PASS_WITH_CONCERNS 0-BLOCKING
- mapping reviewer + investigator-codebase; VACUOUSLY-MET-honest (all-inherit->0 runtime-delta; value=future-proof-floor + anti-consensus-catch NOT cost; nac designed+will-dogfood)
- GAP-3 AS-10 fired LIVE (WF1+WF2 lanes auto-harvested agent-memory -> dogfood-validate convention-not-mechanism; harness-sanctioned, verified, KEPT)
- email AI_INFRA harness-19-adopt-plus-model-tier (selftest-stamp 6c PASS)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 18:22:28 +07:00
f229b07f39 [CLAUDE] Docs: S101 H18 WF2 review closeout — re-run wf_955643c3-f7d PASS_WITH_CONCERNS + stamp + model-note Opus-S101
- WF2 gốc wf_31ea3985-92c mất theo CLI-restart → re-run fresh 3-lane adversarial
- Lane-A detector-teeth PASS (fault-inject 4/4 tái-dựng độc-lập -RepoRoot, MED derived-stale 11→0)
- Lane-B ledger-retire PASS_WITH_CONCERNS: 1 CONCERN workflows/README:51 nhãn-cũ "ledger orphan-scan" sweep-S100-sót → FIXED
- Lane-C PARTIAL: codify+n-a-H8+containment first-hand; frontier-hash+reviewer_gate dựa record-S100 (broadcast inbound vắng repo)
- Lane-C #53 return-garble → recover first-hand; AS-10 residual sub-write reverted (git-diff backstop)
- Stamp run-id+verdict → adap-report:5 + engine §J:283; STATUS/HANDOFF flip + session-log
- Model-note reconcile: runtime=Opus S101 (Fable unavailable, settings pin fable → H5-fallback revert-free) — STATUS:24 + agents/README:3
- Harvest reviewer + tooling-auditor memory (B3)
- Email AI_INFRA wf2-verdict + 3 flag (reviewer_gate-missing · frontier-hash-mismatch · process-gap broadcast-not-committed)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 17:14:14 +07:00
5ee32c0c0b [CLAUDE] Docs: S100 Harness-18 adopt — detector v2 ratio-band+glob (fault-inject 4/4, MED 11→0) + retire runs/_ledger 🧊 (0/15 lifetime, sweep 15 điểm/8 file, orphan=folder-scan) + engine §J + cron ghost-wire honest-retire (CronList=0, 5 file) + F2 SendMessage re-verified + 3 adap-report (frontier HELD hash-MISMATCH, flag reviewer_gate-missing) — WF1 wf_50a817ce-a69 · WF2 wf_31ea3985-92c in-flight
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m17s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 15:32:04 +07:00
513aa09b2e [CLAUDE] Memory: S100 bootstrap — 2 monitor RE-REPORT clean (H1 ALL-4 PASS · H2 4-trục CLEAN) + tooling-auditor S100 live-delta + harvest-curator on-behalf append
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 14:43:18 +07:00
525a01ad41 [CLAUDE] Docs: S99 flip S98 closeout hồi-tố (H1 F1) + cert 09-16 verified + session-start.md count→B1 pointer (H1 F3)
- STATUS/HANDOFF: header +blurb S98 (batch đóng 2 commit CI-skip) + gỡ row In Progress S98 (đã đóng) + note mega-line 4 blurb (re-tier S95 defer monthly 08-01).
- STATUS blockers: cert api.solutions.com.vn ĐÃ auto-renew (TLS verified NotAfter 2026-09-16) — hết blocker giả.
- session-start.md:44 gotcha hard-count "(68)" stale (thật 79) → B1 pointer về docs/STATUS.md.
- Defer @session-end: F2 SendMessage-note (:8/:62) + P4 monthly count-grep mở rộng commands/*.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 12:02:52 +07:00
c112be9884 [CLAUDE] Memory: S99 bootstrap — cicd #485 orphan-append (H2 fidelity PASS) + 2 monitor L1→L2 self-curate hook + restore verbatim entry S98 tooling-auditor
- cicd-monitor +1 entry run #485 (verify CI trên chính commit cuối S98 8a249c5, ghi sau commit → orphan-by-construction; H2 arithmetic-check 23 file khớp).
- harvest-curator self-curate L1 19.9→7.2KB, 14 entry S50-S66 → archive/2026-06.md — em main verify moved-not-cut: 0 dated-entry mất.
- tooling-auditor self-curate L1 19.6→8.0KB, 12 entry → archive/2026-06.md — verify phát hiện entry S98 bị RÚT GỌN trong L1 (mất method- drift-born-sau-monthly + note bundle-mismatch CeTA7Z82) → restore VERBATIM từ HEAD blob vào archive/2026-07.md (bug-class #74 paraphrase-drift, biến thể self-curate).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 12:02:52 +07:00
8a249c512d [CLAUDE] Memory: sleep-compress L2 implementer-frontend — 2026-H1.gist.md additive
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m17s
HC propose (50/50 pointer count==1) + reviewer Fidelity-gate PASS-với-sửa (1 fix R4 áp + 2 optional áp; 0 bịa, 3 diễn giải ground-truth code). Coverage-diff gate 31/31 token (gotcha#/SHA/surprise/guard/root-cause). G-009 post-scan sạch. Verbatim 2026-H1.md FROZEN không đổi. memory-budget.json: last_sleep_at=2026-07-02 + measured S98 refresh (script output, không hand-edit).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 10:57:45 +07:00
4263d63e74 [CLAUDE] Docs: S98 harness backlog — Fable-restore gỡ caveat H5.6 (runtime-verified spawn-test ×2) + monthly→2026-08-01 + skill Mig 60/61 + re-tier mega-line S93/S94→archive-S98 + cicd L1 curate + 3 orphan-append H2 + ledger mode-A note + email AI_INFRA
Verify: V1 conservation PASS (arithmetic full-accounting 0-byte-unaccounted) · V2 cross-doc PASS (detector 28→25, còn lại false-positive class) · V3 moved-not-cut PASS (sha-match + byte-arithmetic đóng vòng).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 10:57:33 +07:00
310b9fce68 [CLAUDE] Docs: S97 deep review-before-session-end (4-lane workflow) — PROD verified SAFE, closeout
- Review workflow wf_4951c347 4-lane (anh yêu cầu, LIVE PROD rigor): prod-data-integrity CLEAN + prod-deploy CLEAN + code-review PASS + feedback captured
- prod-data (database-agent): flag-vs-marker 3 phiếu chuẩn 0-miss/0-over-reach, Mig 60/61 backfill complete, #78/#79 fix ăn prod, no anomaly, DB11 consistent
- prod-deploy (cicd): 11 commit #478-484 deploy OK, Mig 61 applied, health 200×4; bundle live mEGqlNWc/Dnrp4PU1 (#69-rebuild #484)
- code-review + feedback lanes fail-return-schema → recover diary + em-main (0 wrong-table pattern khác; gotchas #77-79 captured)
- session-log Part 5 + §L bug-production RCA (Mig 60 wrong-table 2-fixed: Mig 61 + gotcha #79) + STATUS bundle/state
- Memory harvest: cicd-monitor + investigator-codebase (return-fail recovered)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 21:57:48 +07:00
5c914e4d8c [CLAUDE] Docs: S97 Mig 61 backfill-wrong-table fix + gotcha #79 closeout (STATUS/HANDOFF/log + memory)
- fix-5: check A/005 "CEO duyệt chưa" → A/005/A/008 finalize-CCM (KHÔNG qua CEO), badge sai do Mig 60 backfill wrong-table; Mig 61 query đúng Changelogs; cicd #484 verified A/005/A/008 flag 0→1 + endsBeforeCeo-True, A/010 control
- gotcha #79: transition-marker ở Changelogs KHÔNG phải Approvals (PE 2 bảng lịch-sử tách vai)
- STATUS/HANDOFF Mig 60→61, gotcha 78→79, State Run #484; session-log Part 4
- Memory harvest: cicd-monitor (#484 verdict recover từ diary — #53 lần-6) + database-agent (điều tra prod A/005)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 21:43:57 +07:00
fb2dfa9f7a [CLAUDE] PurchaseEvaluation: Mig 61 backfill EndedByLevelFinalize từ Changelogs (fix Mig 60 wrong-table) — phiếu finalize-CCM hết hiện sai "Đã được CEO duyệt" (anh Kiệt FDC UAT)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m12s
- Root-cause: Mig 60 backfill query PurchaseEvaluationApprovals cho marker "[Duyệt KẾT THÚC tại]", nhưng marker do LogTransitionAsync ghi vào PurchaseEvaluationChangelogs (approval-history là record riêng dòng :745) → match 0 dòng
- Phiếu finalize-sớm pre-Mig60 (PE/2026/A/005, A/008 — CCM Cấp 2 Phan Văn Chương duyệt-thay-CEO, KHÔNG qua CEO) giữ EndedByLevelFinalize=0 → endsBeforeCeo=False → badge SAI "Đã được CEO duyệt"
- Mig 61: backfill ĐÚNG bảng Changelogs (ContextNote LIKE N'%Duyệt KẾT THÚC tại%' + PhaseAtChange=7), idempotent, SQL-Server-only (tests SQLite no-replay)
- Verified prod: A/005/A/008 fin_marker=1 (finalize CCM) vs A/010 fin_marker=0 (CEO thật). gotcha #79

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 21:30:30 +07:00
21be786c9e [CLAUDE] Docs: S97 badge "Đã được CEO duyệt" (#483) closeout — STATUS/HANDOFF/log + memory harvest
- fix-4 badge (đối xứng fix-3 endsBeforeCeo): PeFinalizeChip DaDuyet+!endsBeforeCeo → " Đã được CEO duyệt"
- STATUS/HANDOFF: bundle CeTA7Z82+CGaAyXen (Run #483), 3-fix→4-fix, session-log Part 3
- Memory harvest: implementer-frontend + cicd-monitor (#483 verdict clean-return, no #53 garble lần này)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 21:01:55 +07:00
9e12e80b48 [CLAUDE] FE-Admin·FE-User: badge " Đã được CEO duyệt" cho phiếu đi hết lên CEO (anh Kiệt FDC UAT)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m13s
- PeFinalizeChip (single-source-of-truth pill): +nhánh phase===DaDuyet && !endsBeforeCeo → " Đã được CEO duyệt" (đối xứng chip "⚑ Kết thúc · X" cho endsBeforeCeo=true)
- Wire phase ở 6 call-site (PeListPanel + PurchaseEvaluationsListPage ×2 app + Inbox + Dashboard user)
- FE-only, tận dụng endsBeforeCeo runtime (Mig 60 fix-3), no BE/mig; mirror 2-app SHA da9c3ed9, build ×2 PASS 0-TS-err

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 20:52:17 +07:00
07c89058d7 [CLAUDE] Docs: S97 part-2 closeout — endsBeforeCeo config→RUNTIME (Mig 60) + gotcha #78 + memory harvest
- STATUS/HANDOFF S97 mega-line: +fix-3 endsBeforeCeo; State → Mig 60 / 89 tables / gotcha 78 / bundle DR9q2VUy+Bgz8u4E5 (Run #482)
- gotcha #78: display-flag CONFIG-vs-RUNTIME (nói dối khi instance lệch config; nặng sau opt-in flip)
- session-log Part 2: endsBeforeCeo root-cause + fix + verify (test 440 + reviewer PASS 0-issue + cicd #482 bug-fixed-LIVE)
- Memory harvest: test-specialist + reviewer + cicd-monitor (#482 verdict recover từ diary — #53 return-garble lần-5, root-cause structural noted)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 20:16:43 +07:00
8037fa01d1 [CLAUDE] PurchaseEvaluation: endsBeforeCeo theo RUNTIME (Mig 60 EndedByLevelFinalize) — phiếu lên CEO hết báo sai "không qua CEO" (anh Kiệt FDC UAT)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m21s
- Bug: phiếu có cấp AllowApproverFinalize nhưng approver opt-out → lên CEO thật + CEO duyệt, nhưng sơ đồ báo sai "kết thúc tại CCM, không qua CEO" + làm mờ Bước CEO (endsBeforeCeo tính theo CONFIG workflow)
- Fix: +field runtime EndedByLevelFinalize (set true CHỈ ở nhánh level-finalize service) → EndsBeforeCeo cho phiếu DaDuyet đọc runtime thay config; ChoDuyet giữ heads-up config
- BE: entity + EF config + service + 4 projection (detail/List/Inbox/ListApproved) runtime-aware
- Mig 60 AddPeEndedByLevelFinalize + backfill (dò marker "Duyệt KẾT THÚC tại" set phiếu finalize-sớm cũ; ccm-delegation không match → giữ false)
- FE: gate làm-mờ finalizeFlowStep theo endsBeforeCeo (2 app SHA-mirror b7abbc2f)
- Test 440 PASS (repro peFinButWentCeo: config-finalize + EndedByLevelFinalize=false → false) + reviewer PASS 0-issue

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 19:23:03 +07:00
051d0493ae [CLAUDE] Docs: S97 closeout — PE finalize wording + default-flip (STATUS/HANDOFF/log + memory harvest)
- Session log 2026-07-01-S97-pe-finalize-wording-default-flip.md
- STATUS mega-line S97 blurb + bundle admin Cf0o8dx8/user x8rppRAK (Run #481) + In Progress
- HANDOFF S97 brief
- Memory harvest: implementer-frontend (+archive/2026-H1.md compaction) + reviewer + cicd-monitor (Run #481 verdict recovered from diary — #53 return-garble lần-4)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 18:19:18 +07:00
1c8fb6ab94 [CLAUDE] PurchaseEvaluation: badge "không trình tới"→"Kết thúc tại {cấp}" + đảo default ô-tick finalize sang opt-in (anh Kiệt FDC UAT)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m10s
- Fix 1: badge cấp-sau-finalize "không trình tới" → "Kết thúc tại {finalizeLevelName}" (động, hiện "Kết thúc tại CCM") + tooltip template-literal
- Fix 2: đảo default checkbox "Cấp này KẾT THÚC quy trình" opt-out→opt-in (useState true→false + reset onSuccess) — mặc định TRÌNH TIẾP CEO, tick mới KẾT THÚC; helper text reword
- FE-only, mirror 2 app SHA-identical, no BE/mig/test; workflow implement+review PASS 0 issue

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 18:05:49 +07:00
791ec5544d [CLAUDE] Docs: S96 session-end closeout — UAT PE fixes + monthly audit + memory flush
- STATUS/HANDOFF: prepend S96 mega-line (5 commit: monthly-audit 881783c + NCC ba4b8e0 + 3 PE fix e657faa/36cbf8b/0c2f9f6) · Tests 434->440 · gotcha 76->77 · bundle COYAX-yQ/0MU-kb4N · prod 21 NCC · In-Progress S95->S96
- gotchas: +#77 SPA deploy bundle cache-lag (verify byte-level cache!=deploy; incognito golden)
- session log 2026-07-01-S96-uat-pe-fixes-monthly-audit.md
- user-memory (ngoài repo): +2 feedback (verify-deployed-artifact-byte-level · agent-return-garble-recover)
- agent-memory: cicd-monitor S-tag drift S97/S98->S96 reconcile (11x; facts correct) · investigator-codebase Supplier-audit diary

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 16:49:16 +07:00
0c2f9f630f [CLAUDE] PurchaseEvaluation: khóa sửa giá đề xuất PRO/CCM sau khi phiếu đã gửi duyệt (anh Kiệt FDC "duyệt là fix")
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m25s
Bug (anh Kiệt/team, screenshot): drafter=PRO vẫn điền được giá đề xuất Min/Max SAU khi cấp trên (chị Trà) đã duyệt — "duyệt là fix".

Root cause: UpdatePeSuggestedPricePro/CcmCommandHandler cố ý KHÔNG ràng Phase (Mig 54 "chỉnh như tài liệu sống") → sửa được mọi phase kể cả DaDuyet.

Fix:
- BE: +phase-guard — non-admin chỉ sửa giá đề xuất PRO/CCM khi phiếu ở Nháp (DangSoanThao) / Trả lại (TraLai); đã gửi duyệt (ChoDuyet) / đã duyệt (DaDuyet) / từ chối → ConflictException. Admin override (sửa-sai). Role-gate vẫn chạy trước.
- FE (2 app): SuggestedPriceRows gate canEditPro/Ccm thêm && isEditablePhase(ev.phase) → ẩn ô sửa (read-only) khi phiếu đã gửi duyệt. Đồng bộ BE.
- Test: +4 (PRO ChoDuyet->Conflict no-mutate, PRO DaDuyet->Conflict, Admin DaDuyet->override-set, CCM DaDuyet->Conflict); sửa SeedPeAsync default->DangSoanThao (spec change). 436->440 PASS.

Delete phiếu sau duyệt: ĐÃ chặn sẵn (FE nút Xóa chỉ hiện DangSoanThao + BE delete-guard block non-draft) — không cần sửa.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 16:07:25 +07:00
36cbf8b1cc [CLAUDE] PurchaseEvaluation: mark-read noti "cần duyệt" cũ khi phiếu rời cấp (fix chuông stale — anh Kiệt FDC)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m3s
anh Kiệt "chuông không bỏ ra được" — noti "Phiếu cần bạn duyệt" của approver (kể cả CEO) KHÔNG tự xóa khi phiếu đã xong/chuyển bởi người khác (duyệt-thay tại Cấp CEO, co-approver OR-of-N, finalize) → chuông đầy phiếu thừa.

Fix: trong LogTransitionAsync (chạy MỌI transition), TRƯỚC block notify cấp mới → mark-read (ReadAt) tất cả noti Generic + RefId=phiếu còn unread. Phiếu rời cấp (finalize/advance/return/reject) → noti cũ tự sạch; approver cấp MỚI nhận noti fresh (tạo sau mark-read). Best-effort try/catch, V2-only, ExecuteUpdateAsync. KHÔNG đổi target (noti vẫn báo đúng lúc), chỉ thu-hồi khi stale.

Test: +test #7 (finalize → noti CEO cũ mark-read). 435→436 PASS. BE-only, no migration.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 15:47:08 +07:00
e657faa74a [CLAUDE] PurchaseEvaluation: ô "Cấp này KẾT THÚC quy trình" → opt-out bỏ-tick-được (anh Kiệt FDC)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m12s
anh Kiệt UAT "cái này option thôi chứ e" — cấp cấu hình AllowApproverFinalize (Mig 58, S89 auto-finalize im lặng) NAY là ô-tích BỎ được:
- Default checked = giữ hành vi cũ (duyệt xong KẾT THÚC, không lên CEO) — backward-compat.
- BỎ tick (applyLevelFinalize=false) → KHÔNG finalize, trình tiếp CEO/cấp sau; giá chốt ẩn (CEO chọn sau).

BE: +param applyLevelFinalize (default true) xuyên interface → service (finalize guard `&& applyLevelFinalize`) → command → handler → controller body. FE: ô xanh static → checkbox 2 app (fe-admin+fe-user SHA-mirror) + hint động + sendPrice/shouldPickPrice gate theo cờ. Test: +test #6 opt-out→advance-to-CEO (spec change; #1-5 backward-compat giữ). Build slnx + 2 FE PASS 0-err; test 434→435.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 15:39:24 +07:00
ba4b8e0339 [CLAUDE] Infra: import NCC DONGDUONG (Excel anh Kiệt) + Supplier-field backlog
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m6s
- SeedRealMasterDataAsync +DONGDUONG (CP DV Công nghệ Đông Dương, NTP, gói Thang máy) = NCC thứ 4 từ Excel "Database NCC" anh Kiệt FDC 1/7; 3 NCC còn lại (TRUONGGIANG/TANPHU/TGN) đã seed sẵn S55/S59 → idempotent skip
- Scope option-3 (anh chốt): 9 field entity + gói extras (Loại/NĐD/TK/GUQ/Trạng thái) vào Note; KHÔNG migration (data-only ungated idempotent seed → prod)
- docs/STATUS: backlog "15-18 field note lại từ từ tính" (Supplier schema mở rộng khi anh chốt)
- Build slnx PASS 0 warn/err. Seed thẳng deploy (anh chốt).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 14:49:37 +07:00
881783c335 [CLAUDE] Docs: S96 monthly drift audit + FD memory distill + mega-line re-tier
Monthly drift audit (2026-07-01, cron ngày 1) — workflow-prepared (wf_2d687d27-175, 4 clusters draft→adversarial-verify), em-main single-writer applied:
- ef-core-migration/SKILL.md: latest-mig 56→59 + append table rows 57/58/59 + Mig 14 + Phase-7 Budget annotate DROPPED Mig 50 (S61)
- skills/README.md: ef-core row Mig 55→59/S87 + gotcha cite #69→#76 (5 latest, authoritative gotchas.md headings)
- docs/CLAUDE.md: Budget module marked REMOVED Mig 50 — §1 item 6 + roadmap Phase 7/8 rows (strike-through, non-destructive)
- docs/governance/vocab-alias-map.md (NEW): 3 vocab-forks documented (run-trace / Ngân sách PRO / all-inherit canonical) + governance-detectors.ps1 $ExcludeExact entry (anti self-match)
- re-tier STATUS/HANDOFF mega-line 5→3 blurbs (S92/S91 → archive verbatim, conservation delta=0, BOM preserved) + hoist 3 UAT-carry items to blockers

FD memory distill (H17 loop strike-1 → CLEARED, GAPS: none):
- frontend-designer L1 26129B→21492B: 5 old Activity war-stories → archive/2026-06.md + _INDEX + gist; Lessons value-protect distilled to L1
- budget.json measured.frontend-designer refreshed

Detector 27→25 (2 real drift cleared; remaining = documented false-positives module-local/never-built-defer). AS-10 residual reviewer sub-write reverted (git-diff backstop, E-006 recurrence — guard HELD).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 13:04:15 +07:00
353f81a318 [CLAUDE] Docs: S95 session-end closeout — Harness-17 adopt + STATUS/HANDOFF/ledger + session log
- STATUS mega-line prepend S95 (H17 adopt 3-workflow + 10/10 floor + 2 commit + cicd #476) + In-Progress→S95 + bundle-hash live 0T6vVJST/BGXEVZO6 (cicd re-snapshot, was stale S85)
- HANDOFF S95 brief + NEXT (frontend-designer distill = H17 loop finding · monthly re-tier)
- error-ledger: AS-10 recurrence S95 (E-006, WF1+WF3 self-write reverted 4th fire; instruction-fix NOT 100% — WF3 explicit-return-only STILL self-wrote → git-diff = net) + Active-Guard git-diff-containment 4/4 held
- session log 2026-07-01-S95-harness17-adopt.md
- user-memory: +feedback_faultinjection_proves_teeth (reusable verify pattern)
- 0 production code; 434 test unchanged; docs-only CI-skip

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 10:48:39 +07:00
65b434a370 [CLAUDE] Docs: Harness-17 deep-reverify (WF3) — fault-injection teeth-proof + cross-doc + AI_INFRA update
- WF3 wf_6f44eddf-680 (anh-directed 3rd pass): Lane A fault-injection PASS (13 inject prove teeth: A1/A2/C-spectrum/B1/B2/A3 all catch faults, no-false-flag, off-by-one correct, 8/8 md5 match restore) + Lane C integration PASS (0 application-defect, anti-Goodhart flip proofs, numbering intact, mfe-eval A2 not broken)
- Lane B empty-return (#53) → em-main self-gate recover (N=3/HCV/run-id/hash consistent, detector 27)
- engine §I banner: inline WF2 wf_8e73c1d6-ee6 + WF3 wf_6f44eddf-680 (was WF2-pointer-only)
- adap-report: +Deep-reverify(WF3) section + 2 brittleness honest-noted (fail-safe over-flag, not fixed per Lane A) + dogfood-C3-round2
- email AI_INFRA update (hash 8c94fa348514): deep-reverify notify
- dogfood: WF3 reviewer self-write reverted (D9/AS-10 round-2); cicd-monitor verdict kept (legit normal-spawn) — Run #476 success, prod 200x3, Mig 59
- 0 .ps1 changed → CI-skip (docs-only); 0 production code

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 09:31:55 +07:00
18a17f5498 [CLAUDE] Docs: adopt Harness-17 memory self-improvement loop (Đo→Tinh-chỉnh→Kiểm) — 2-workflow, 0 prod code
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m8s
- engine §I codify 10 red-floor: A1 HCV/A2 load-fid/B1 signal→action/B2 CG-1 termination/B3 build-gap-vs-floor-rot/C1 spec-audit/C2 spot-check/C3 single-writer/C4 provenance/CG-2 age-exempt
- REUSE-cite (no rebuild): A2=§H MFE · C3=D9 · CG-2=§G.2b value_protect · archive=§A
- new mechanized: scripts/memory-selfimprove-audit.ps1 (C1 spec-audit NO-API exit-0, runtime-verified — bắt frontend-designer over-cap GAP thật)
- new: .claude/governance/reinject-ledger.md (B2 CG-1 git-tracked append-only N=3, tách khỏi budget.json)
- wire session-start §2.1.7 (loop-DÒ) + session-end §L.b(c) (loop-REFINE)
- vocab: HCV alias no-seed (coverage 3-way) + governance-detectors C3-comment; cap-fix 220K→380K-pointer
- 2-workflow (Harness-9): WF1 wf_f085d7c4-d78 (ground-truth) + WF2 wf_8e73c1d6-ee6 (3-lane PASS 0-blocking)
- adap-report + checklist-pointer + email AI_INFRA (hash 54789e19, hash-verified self-consistent)
- dogfood: WF1 agent self-write MEMORY.md reverted (D9/AS-10 containment; archive missing → saved 8.5KB)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 09:11:46 +07:00
707b632a64 [CLAUDE] Docs: S94 session-end closeout — prepend S94 blurb + session log
- STATUS/HANDOFF: prepend S94 blurb (cap 220K→380K anh-directed + re-tier mega-line) → mega-line giữ current+3 (S94/S93/S92/S91). In Progress S94 → done.
- Session log 2026-06-29-S94-cap-380k-retier-megaline.md.
- §L closeout: 0 RCA · archive-gate FD WATCH strike-1 / test-specialist RESOLVED 7.8KB / A7 217/217 · 0 sub spawn (harvest n-a) · 4 mark Active-High (H-15 v4-delta stamped).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 00:10:28 +07:00
5f61b038e4 [CLAUDE] Docs: S94 nâng cap lead 220K→380K (anh-directed) + re-tier STATUS/HANDOFF mega-line
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m24s
- Cap lead_tokens 220K→380K (memory-budget.json canonical; SE-override, lead KHÔNG còn AI_INFRA-parity, subs giữ 60K/50K). Mark H-15 v4-delta RC-pqhuy1987-29-06-2026-23-25-50. Flush 3 derived echo (ACTIVE-MARKS · session-start §2.1.6 · engine §G adopt-delta).
- Re-tier mega-line (fix Read-25K/call OOM + token-cost): STATUS 389→89 dòng (mega-line 59.6K→7.1K char) · HANDOFF 732→12 dòng. Live 332KB→34KB (−90%). Session ≤S90 → docs/_archive/STATUS-HANDOFF-tier-S94 (0 byte-loss: new+archive = orig + 995B pointer).
- Verify: detector 27=baseline (0 broken-pointer mới) · canonical mig59/test434/gotcha76/table88 intact · MFE live-read 380K · conservation spot-check PASS.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 23:46:04 +07:00
ea075bac00 [CLAUDE] Docs: S93 closeout — PE project-code (Run #473) + Harness-16 MFE adopt + harvest
Closeout 2 task: (1) PE tree node Du an hien MA du an (8ee8f3e Run #473
prod-verified) (2) adopt Harness-16 MFE memory-fidelity-EVAL (9580098, 2-workflow PASS).

- STATUS + HANDOFF: prepend S93 (mega-line via PowerShell, S92->Prev).
- session log 2026-06-29-S93-pe-projectcode-harness16-mfe.md.
- error-ledger E-006: AS-10 2nd-fire recurrence (WF1 3-agent residual caught+reverted;
  WF2 explicit-return-only -> 0 residual) + containment guard verified S93.
- harvest (B3 single-writer APPEND): investigator-codebase (MFE ground-truth extraction-spec)
  + reviewer (MFE adoption review WF2 PASS) diaries.
- user-MEMORY index compacted 23.7->7.8KB (hook), all 38 entries kept, vocab-collision
  lesson folded into 2-workflow entry.

State unchanged (Mig 59 · 88 tables · 434 test · gotcha 76 · bundle CDn40vpV/CoPmPBg7).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 19:01:19 +07:00
958009858e [CLAUDE] Docs: adopt Harness-16 MFE (memory-fidelity-EVAL) — 2-workflow + email AI_INFRA
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m2s
Adopt AI_INFRA Harness-16 (3 broadcast 2026-06-29) qua 2-workflow mandate:
WF1 implement wf_4c63e1bd-99e + WF2 review wf_13e3d35a-023 (PASS 0-blocking).

MFE = coverage/retention eval (do nap-vs-nho-vs-dung bang SO DO). DISTINCT
voi H6.7 memoryDelta-routing-fidelity (vocab-fork WF1 reviewer bat duoc).

Built (em-main single-writer, 0 production code):
- scripts/mfe-eval.ps1 deterministic NO-API (ASCII #30, exit 0): LEAD coverage-FIT
  (token-RANGE, cap live-read) + age-band flag-not-cut + Goodhart-anchor strikes/RCA;
  SUB per-role coverage do-that (prose->N/A khong 0%); sub-workflow N/A. Smoke 3-tier PASS.
- memory-budget.json :mfe config + eval/mfe/ (seed sample-questions stable-id + README)
  + engine §H + artifact-row + C3-comment + wire session-start §2.1.6 / session-end §L.b(c)
  opt-in + agents/README S93. Judge layer = SCAFFOLD-only (honest nac).

adap-report harness-16-mfe + harness-15-v3 (covered/folded) + email outbox/ai_infra.
AS-10 dogfood: WF1 residual-write caught+reverted. State GIU NGUYEN (Mig 59 · 88 · 434 · gotcha 76).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 18:35:14 +07:00
8ee8f3e248 [CLAUDE] PurchaseEvaluation: cây Duyệt NCC node Dự án hiện mã dự án thay tên dài (anh Kiệt FDC)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m23s
Anh Kiệt FDC (Zalo + screenshot): node 📁 Dự án trong cây "Năm > Dự án >
Hạng mục > Phiếu" hiện TÊN dài ("Phân xưởng homecare 75 tấn/ngày và các
hạng mục") → user thấy vướng → "bắt mã dự án nhé".

BE: thread ProjectCode vào PurchaseEvaluationListItemDto + 3 projection
(list + inbox + approved-from-evaluation) + search khớp thêm mã dự án.
FE 2 app (SHA-mirror): PeListItem +projectCode; tree node 📁 render Code
(fallback Name nếu rỗng) + tooltip=tên đầy đủ + sort theo mã.

Verify: dotnet build 0/0 - npm build x2 PASS - test 434 (45D+389I).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 16:00:03 +07:00
c22b06e14a [CLAUDE] Docs: S92 session-end — flush STATUS canonical counts (test 402→434, gotcha 73→76)
§L session-end closeout. Canonical count table (machine-readable, B1 source-of-truth)
đã stale từ S87-era trong khi narrative bump qua S88-S92:
- Tests 402→**434** (45 Domain + 389 Infra) — +S88 +17 / S89 +3 / S91 +9 / S92 +3.
- Gotchas 73→**76** — +#74 (S90 Chrome-MCP SPA document_idle) +#75 (S91 seed-resurrect ungated)
  +#76 (S91 deploy config từ .example). Detector "canonical-itself-stale" + tooling-auditor xác nhận.
- Mig 59 / tables 88 / menu 54 đã đúng — KHÔNG đụng.

Tiering (KHÔNG cắt): prepend increments, giữ narrative S87-cũ.
Carry monthly 2026-07-01 (PULL FORWARD — tooling-blocker): STATUS line-6 = 61,285-char single
line UN-Read/UN-Edit (PowerShell workaround) → re-tier relocate narrative ra session logs; +
ef-core SKILL Mig 56→59 + docs/CLAUDE Budget-removed + 3 vocab-fork + detector anchor-on-table-row.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 15:24:22 +07:00
396266e5fd [CLAUDE] Docs: S92 closeout — ẩn 5 nhóm menu chỉ Admin (Run #358 PASS prod-verified) + harvest
- Session log 2026-06-29-S92-admin-only-modules.md + STATUS/HANDOFF prepend S92 (demote S91→Prev).
- cicd Run #358 PASS: deploy shipped (dll-mtime in-window 08:00–08:01Z + w3wp recycle 08:04Z),
  smoke 4×200, prod sqlcmd verify (non-Admin CanRead 0 trên 5 nhóm ẩn / 0 leak Contracts·Master·Catalogs
  / Admin giữ 5 key / Pe_* non-Admin 120 untouched). Permission change LIVE.
- Bundle JS rotate admin xz8FdmLN / user CA8Rla2w (CSS frozen) — sửa nhận-định #69-REFINE
  (deploy.yml rebuild FE vô-điều-kiện + rolldown chunk-id non-deterministic → bundle-hash KHÔNG
  đáng-tin làm ship-signal cho BE-only; tín-hiệu thật = dll-mtime + w3wp-recycle).
- Harvest agent-memory: test-specialist (434) + reviewer (S92 topic file + L1 curate 12.9KB) +
  cicd-monitor (Run #358 + prod schema note: bảng Roles/UserRoles KHÔNG prefix AspNetRoles).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 15:10:43 +07:00
1408d4eb03 [CLAUDE] Infra: ẩn 5 nhóm menu (Hợp đồng + Danh mục + HRM/Office/Cá nhân) chỉ Admin thấy trên eoffice (S92)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m24s
- RevokeTemporarilyHiddenModulesAsync mở rộng predicate: +Contracts/Ct_*
  +Master/Suppliers/Projects/Departments/Catalog* (cộng dồn S58 Hrm*/Off*/Personal).
- Tắt 2 re-grant public cũ: SeedAllRolesHrmProfileReadPermissions (S65) +
  SeedAllRolesOfficeModulePermissions (S69). Revoke là bước permission CUỐI trong
  SeedAdminPermissionsAsync (ungated) → durable, re-ẩn mỗi restart prod (gotcha #75).
- Thu hẹp InReviewScope → chỉ Pe_* (Duyệt NCC giữ nguyên cho user thường;
  master-data GET = any-auth nên form PE vẫn chọn được Dự án/NCC/Hạng mục dù menu ẩn).
- 2 method grant giữ private static (reversibility) → 2 seed test cũ vẫn invoke cô-lập, pass.
- +AdminOnlyModulesRevokeTests (3 test-before-merge, security): non-Admin revoked 4 cờ /
  Admin untouched / PE preserved. Test 431→434 PASS (45 Domain + 389 Infra).
- Reviewer PASS (5 attack vector: seed-order/under-revoke/over-revoke/test-genuine/prod-impact).
  FYI: role CatalogManager (0 user hiện tại) cũng bị thu Danh mục — intended-by-spec.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 14:58:59 +07:00
f98a743074 [CLAUDE] Docs: S91 closeout — go-live wipe + seed-gate + user-change-password + backup (gotcha #75/#76)
Closeout phiên go-live 26/06 (4 commit prod-verified đã push: guide-fix 159b69d · wipe ba42c59
· seed-gate 55494ad · user-change-password e81e87f + backup local).
- STATUS/HANDOFF +S91 entry, state re-ground: Mig 59 · 88 bang · 431 test (45D+386I) · gotcha 76
  · menu 54 · bundle admin DgQyuG7f/user BmbQon23 · prod 17 user/7 NCC/0 PE-HD
- gotchas #75 (SeedDemoMasterData ungated per-code -> resurrect NCC demo moi restart)
  + #76 (deploy render appsettings.Production.json tu .example, KHONG file gitignored)
- session log 2026-06-26-S91 + feedback_wipe_durability_check_reseed (user memory)
- harvest cicd-monitor + test-specialist diary (self-written, verified)
- .gitignore +backups/ +*.bak

Docs/memory-only -> CI skip (paths-ignore docs/** + **/*.md + .gitignore).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 13:07:01 +07:00
e81e87ff9f [CLAUDE] Auth: user tự đổi mật khẩu (self-service change-password) — BE + 2 FE + test
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m10s
Go-live request anh Kiệt FDC (Zalo "user chưa tự đổi pass được hả em"): trước đây chỉ admin
Reset hộ (POST users/{id}/reset-password), user KHÔNG tự đổi được. Thêm self-service:

- BE: ChangePasswordCommand + POST /api/auth/change-password ([Authorize]). Lấy user qua
  ICurrentUser.UserId; UserManager.ChangePasswordAsync verify mật khẩu HIỆN TẠI; sai →
  ValidationException field CurrentPassword "Mật khẩu hiện tại không đúng."; rule mật khẩu mới
  ≥ 12 + khác mật khẩu cũ (validator); sau đổi vô hiệu refresh token (mirror ResetPassword).
  Qualify SolutionErp...ValidationException (tránh CS0104 clash với FluentValidation).
- FE 2 app (SHA-mirror): ChangePasswordDialog (3 ô current/new/confirm + validate client:
  ≥12, khớp, khác cũ) wire vào menu tài khoản TopBar — "Đổi mật khẩu" trên "Đăng xuất".
- Test: +ChangePasswordCommandTests (đúng/sai pass cũ keyed-field + msg, <12 boundary, ==cũ,
  chưa-auth/UserId-null/user-not-found, RefreshToken cleared). Full suite 431 PASS (45D + 386I).

Build: BE 0 warn/0 err · fe-user + fe-admin build OK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 12:27:52 +07:00
55494ad477 [CLAUDE] Infra: gate SeedDemoMasterData sau DemoSeed:Disabled (chống resurrect NCC demo go-live)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m10s
Sau wipe 18 NCC demo (scripts/s91-wipe-golive.sql, go-live anh Kiệt FDC 26/06), phát hiện
SeedDemoMasterDataAsync chạy UNGATED + per-code idempotent (skip-if-code-exists else Add) ->
mỗi restart / IIS recycle TỰ ADD lại 18 NCC demo (NCC-VLXD / CDT-VIN / Sun Group ...) ->
undo danh sách NCC sạch anh Kiệt vừa chốt.

Fix: gate SeedDemoMasterDataAsync (Supplier + Project DEMO) sau cờ DemoSeed:Disabled, mirror
cách Contracts/PE/Workflow demo đã gated. Prod hiệu lực Disabled=true (appsettings.json deployed;
appsettings.Production.json render từ .example KHÔNG có DemoSeed -> fallback appsettings.json=true,
đúng fallback đã giữ contracts/PE gated nhiều tháng). -> SKIP -> wipe BỀN qua restart. Dev
Disabled=false -> vẫn seed demo local. Master data THẬT (SeedRealMasterDataAsync: 62 dự án + 71
hạng mục + 3 NCC) ungated -> KHÔNG ảnh hưởng.

User test (38) đã an toàn từ S89 (gỡ khỏi mảng SeedDemoUsers). Build slnx OK 0 warn / 0 err.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 10:53:25 +07:00
ba42c59430 [CLAUDE] Scripts: S91 go-live wipe data UAT (prod-executed 26/06)
anh Kiệt FDC chỉ đạo "xóa data cũ" trước go-live Phase-01 (PRO+CCM) hôm nay 26/06.
Quy trình destructive-prod chuẩn S85/S89: recon -> AskUserQuestion chốt scope ->
backup -> wipe atomic (XACT_ABORT + 2 guard) -> verify exact.

Đã chạy prod (.\SQLEXPRESS / SolutionErp); backup SolutionErp_S91_pregolivewipe.bak (2705 pages):
- Xóa: 16 PE (+cascade child Suppliers/Quotes/Attachments/Changelogs -> 0) · 16 PeWorkItemBudgets
       · 94 Notifications · 19 NCC demo (CreatedAt < 2026-06-01)
- Giữ: 7 NCC thật (06-09 x3 + 06-23 x4) · 70 Projects · 71 WorkItems · 17 Users · 8 Workflows
- Reset PeSeq -> phiếu thật đầu tiên = PE/2026/A/001
- Guard A: PE > 16 -> ABORT (chống xóa phiếu thật mới tạo sau recon, go-live day)
- Guard B: NCC demo deleted <> 19 -> ROLLBACK toàn bộ

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 10:21:12 +07:00
159b69da90 [CLAUDE] Docs: guide Duyệt NCC bỏ "Từ chối" + fix 12 caption "Hinh"→"Hình" (go-live 26/06)
App gỡ nút "Từ chối" từ S60 (Khu vực Quyết định chỉ còn Duyệt/Trả lại) nhưng guide
phát toàn công ty (đính kèm email go-live anh Kiệt 26/06) vẫn ghi "Từ chối" 2 chỗ:
- Bước 4 (thân bài): bỏ ' / "Từ chối"'
- Caption Hình 9: "Duyệt / Trả lại / Từ chối" -> "Duyệt / Trả lại" (caption mâu thuẫn với ảnh)
+ Sửa 12 caption "Hinh N." -> "Hình N." (thiếu dấu từ S90 ASCII-gen, gotcha #30/#61 họ hàng).

Sửa qua unpack -> edit XML -> repack (giữ nguyên 13 ảnh: 1 logo + 12 màn).
Pack --validate false (validator dính bug cp1252 đọc UTF-8 VN, kể cả numbering.xml không sửa).
Verify độc-lập python-docx: 'Từ chối'=0, caption=12, media=13, open-strict OK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 09:49:57 +07:00
6a2435f027 [CLAUDE] Docs: chèn 12 ảnh khoanh-đỏ vào guide Word Duyệt NCC (em chụp prod) + gotcha #74 + closeout S90
- 12 ảnh prod khoanh-đỏ 1→2→3 vào docs/Huong-dan-Duyet-NCC.docx
  pipeline tự-chế: PowerShell CopyFromScreen + Win32 lọc-process-chrome.exe
  + DOM overlay element-based + python-docx (MCP save_to_disk KHÔNG ra file env này)
- gotcha #74 (chụp-prod-vào-docx) + STATUS/HANDOFF S90 + session log
- 0 production code, 0 prod mutation (xem-only), em-main solo

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 19:09:28 +07:00
946c5b21ae [CLAUDE] Docs: S89 closeout — PE visibility/finalize + user-cleanup + Word guide
- STATUS/HANDOFF: prepend S89 (demote S88); state Mig 59 · 422 test · prod 17 user
- session log 2026-06-25-S89 (D1 draft-privacy IDOR · D2 CCM suggested-price !readOnly · D3 finalize-note 3-surface + flow badge + matrix flag · prod user-delete · Word guide)
- docs/Huong-dan-Duyet-NCC.docx (skill docx — logo Solution, 8 sections, khoanh-do 1->2->3; real screenshots pending anh)
- harvest residual workflow-sub agent-memory (cicd / investigator-codebase / reviewer + 2 plan-reviews)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 17:05:49 +07:00
681b1edc7e [CLAUDE] Infra · Scripts: xóa hết User test khỏi prod (38) + gỡ seed — chỉ giữ 17 User Solutions thật
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m51s
anh Kiệt FDC: "Xóa hết các User test ko liên quan, lấy User Solution thật vào".
Recon prod: 55 user → GIỮ 17 (admin + 16 real) → XÓA 38 (37 test rõ + 1 typo
chuong.phan@solution.com.vn — anh chốt xóa, anh Chương dùng bản @solutions).
An toàn FK: KHÔNG user test nào là ApproverUserId (NO_ACTION không bị chặn — recon verified);
5 bảng con CASCADE (EmployeeProfiles/UserRoles/Claims/Logins/Tokens); nv.test 1 PE loose-Guid xóa kèm.

- DbInitializer: gỡ 16 user mẫu khỏi SeedDemoUsersAsync + gỡ LockDemoSampleUsersAsync (call+method).
  Seed giờ chỉ tạo/reconcile 17 user thật. SeedItDepartmentStaff + sample-workflow seeds null-guard
  (skip user đã xóa) → deploy KHÔNG resurrect/crash. ⚠ PHẢI deploy để binary mới không tái tạo test.
- scripts/s89-delete-test-users.sql: whitelist-keep 17 + BACKUP + XACT_ABORT + count-guard[30,45].
  ĐÃ CHẠY prod (backup SolutionErp_S89_preuserdelete.bak): count=38, PE=1, còn đúng 17 user. Build slnx xanh.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 16:25:00 +07:00
fef4c33527 [CLAUDE] FE-User: workflow-matrix view — thêm flag thứ 8 "Duyệt là KẾT THÚC quy trình" (thiếu từ Mig 58)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m1s
WorkflowMatrixViewPage (màn "Luồng duyệt" read-only của user, build S24 với 7 flag) thiếu flag
thứ 8 allowApproverFinalize ("Duyệt là KẾT THÚC quy trình, không trình tiếp CEO") thêm ở Mig 58
(S87) → matrix "chưa hiển thị chính xác" QT-DN-V2-001 (anh Kiệt FDC). BE overview DTO đã gửi sẵn
field này (ApprovalWorkflowV2AdminFeatures.cs:41/188), chỉ FE matrix + AwLevelDto type thiếu.

Thêm allowApproverFinalize vào AwLevelDto + FlagRow thứ 8 (colSpan2, mirror admin Designer).
FE-user only (matrix là view user-app, không có bản fe-admin). Build xanh.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 15:45:28 +07:00
9c920ad4c3 [CLAUDE] FE-User · FE-Admin: PE flow sơ-đồ — badge "Duyệt thay CEO" trên cấp finalize + làm mờ Bước CEO "không trình tới"
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m2s
Trong khối "Quy trình duyệt" của phiếu (PeWorkflowPanel, sơ đồ Bước→Cấp→NV), cấp được cấu hình
AllowApproverFinalize (Mig 58) giờ hiện badge tím "⚑ Duyệt thay CEO" + tooltip; các Bước/Cấp SAU
cấp finalize (vd Ban Giám đốc / CEO) làm mờ + nhãn "không trình tới" → người xem phiếu biết NGAY
trong sơ đồ rằng quy trình DỪNG ở cấp này (duyệt thay CEO), không lên CEO (anh Kiệt FDC).

Dùng field allowApproverFinalize đã expose ở flow-level (S89 #3). first-reachable theo Step.Order→
Level.Order (khớp BE finalize). Bổ sung cho callout note (#3) = chỉ-dẫn trong chính sơ đồ flow.
FE-only, 2 app SHA-mirror, build xanh.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 15:32:34 +07:00
f0bca7737c [CLAUDE] PurchaseEvaluation · FE-User · FE-Admin · Tests: PE note "Duyệt là KẾT THÚC quy trình (không trình CEO)" — 3 surface
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m58s
Phiếu mà quy trình duyệt có cấp bật AllowApproverFinalize (Mig 58) sẽ kết thúc tại cấp đó,
KHÔNG trình CEO. Hiển thị note cho MỌI NGƯỜI NẮM ở 3 surface (anh Kiệt FDC). KHÔNG migration
(cột AllowApproverFinalize đã có Mig 58, prod ở Mig 59).

BE (3 file, computed DTO):
- PurchaseEvaluationDtos.cs: +bool EndsBeforeCeo +string? FinalizeStepName +string? FinalizeLevelName
  trên DetailBundle + ListItem; flow-level +bool AllowApproverFinalize.
- PurchaseEvaluationFeatures.cs: detail compute first-reachable (Step.Order↑→Level.Order↑, dept-name
  in-memory); list + inbox projection qua 3 subquery EF-safe (lv.Step!.Name). V1 (workflowId==null) → false.
- CreateContractFromEvaluationFeatures.cs: ListApproved projection cùng DTO → +3 subquery y hệt.

FE 2-app (fe-user + fe-admin SHA-mirror component):
- PeFinalizeChip.tsx (MỚI, chip tím) ở 3 danh sách: PeListPanel + PurchaseEvaluationsListPage (cây) + InboxPage.
- PeWorkflowPanel.tsx: note callout trong phiếu, branch DaDuyet (past-tense) / đang-chạy; copy boundary-aware
  "...là KẾT THÚC, không trình CEO. Các cấp trước vẫn duyệt như thường." (tránh cấp giữa hiểu nhầm).
- UserDashboardPage.tsx (chỉ fe-user): dải "Phiếu Duyệt NCC gần đây" + chip (admin dashboard để nguyên).
- types: PeListItem/PeDetailBundle/PeApprovalFlowLevel +field.

Tests: +PeFinalizeProjectionTests (EF-translate smoke 3 subquery + first-reachable + V1-false). Full suite 421→422.
em-main self-gate sau workflow (impl-frontend return rỗng #53 → mirror fe-admin + verify 5 site recover-disk).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 14:58:54 +07:00
a71753bde8 [CLAUDE] PurchaseEvaluation · Tests: phiếu nháp riêng tư người tạo (chặn leak role + V2-approver)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m56s
Màn hình CEO ở "chỗ thao tác" hiện bản nháp / phiếu chưa xong của NGƯỜI KHÁC (anh Kiệt
FDC). Phiếu nháp (DangSoanThao) lộ qua 2 đường: cond #2 role-eligible (Drafter/DeptManager
→ DangSoanThao, mọi Drafter thấy nháp nhau) + cond #3 V2-approver (workflow pin lúc TẠO
phiếu nên approver như CEO thấy mọi nháp trước khi gửi duyệt = leak chính).

Luật mới: nháp = RIÊNG TƯ người tạo (DrafterUserId) + Admin thấy hết. 4 chỗ:
- GetEligiblePhases: bỏ DangSoanThao khỏi role-eligible (cond #2).
- Inbox (mảng admin): bỏ DangSoanThao — nháp khỏi Inbox hẳn kể cả admin (anh Kiệt chốt).
- List query cond #3: guard != DangSoanThao (approver không thấy nháp).
- Detail authz: guard != DangSoanThao cho V2-approver (không mở nháp người khác bằng link).
Phiếu ĐÃ gửi duyệt giữ nguyên (approver vẫn thấy). Phần admin-screen tinh chỉnh sâu để sau.

+PeDraftVisibilityTests (2 test, test-before security): owner thấy nháp mình · drafter khác
không · CEO/V2-approver không · admin thấy hết · phiếu đã gửi vẫn hiện (no regression).
Full suite 419→421 PASS.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 14:39:26 +07:00
f7bd97a83d [CLAUDE] FE-User · FE-Admin: PE giá đề xuất PRO/CCM editable theo role (gỡ !readOnly over-gate)
Ô "Giá đề xuất (PRO/CCM)" trong SuggestedPriceRows bị khoá thừa tầng !readOnly mà ô
ngân sách song song (editable={bs.canEditCcm}) không có. Hệ quả: CCM (role CostControl)
không nhập được giá đề xuất khi xem phiếu ở view readOnly=true (preview danh sách, hoặc
màn Duyệt chưa tới lượt mình) — đúng báo cáo anh Kiệt FDC "PRO oki nhưng CCM không nhập".

Gỡ !readOnly, gate thuần theo role-capability (ev.canEdit{Pro,Ccm}SuggestedPrice do BE
tính). BE setter vẫn fail-closed theo role (ForbiddenException) nên gỡ gate FE = an toàn,
khớp hành vi ô ngân sách + intent handler "KHÔNG ràng Phase, chỉnh như tài liệu sống".
Bỏ luôn prop readOnly không dùng khỏi signature + call-site. 2 app SHA-mirror, build xanh.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 14:39:08 +07:00
d085436e49 [CLAUDE] Skill · Docs: fix iis-deploy-runbook stale paths + S88 web.config closeout
iis-deploy-runbook SKILL corrected (discovered during the index.html-hardening task):
- physical paths apps\SolutionErp\{Api,Admin,User} were STALE (empty dir) -> real
  solution-erp\{api,fe-admin,fe-user} (verified via appcmd list site).
- web.config rule list fixed to the ACTUAL live config (HTTP->HTTPS + SPA-Routes excl
  /api + .webmanifest + 3 security headers; NO /api|/hubs ARR proxy -- FE calls api via CORS)
  + documented the S88 cache hardening (index.html no-cache, assets immutable).
- log/appsettings/scp/backup paths swept to the real base.
Session log: index.html no-cache hardening DONE (ca136d8) + lesson reference.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 11:42:23 +07:00
ca136d8e2e [CLAUDE] FE-User · FE-Admin: web.config — index.html no-cache + assets immutable
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m54s
S88 white-screen-incident hardening. An open tab could serve a stale index.html across
a deploy (IIS served index.html cacheable: only ETag/Last-Modified, no Cache-Control).
Add version-controlled web.config to fe-*/public (Vite -> dist -> deploy Copy-Item
overwrites the previously manually-managed server file):
- root staticContent clientCache=DisableCache -> Cache-Control: no-cache for the SPA
  shell (index.html served at / and via SPA-rewrite for /dashboard etc.) = always revalidate.
- <location path="assets"> UseMaxAge 365d + custom immutable -> hashed assets cached 1y.
Replicates the EXACT live rules (HTTP->HTTPS, SPA-Routes rewrite excl /api, .webmanifest
mime, 3 security headers) so routing is preserved. Applied + verified on live before commit
(index.html no-cache; asset immutable,max-age; / /dashboard /login 200; http->https 301).
api = .NET API (no SPA index.html) -> N/A.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 11:33:57 +07:00