Commit Graph

54 Commits

Author SHA1 Message Date
c2d01f0dce [CLAUDE] Docs: S152 closeout — bookend hình B trọn 2 đầu + owner (30)(31)(32) + queue memory-ops TRỌN (squash 20 wal:)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m30s
- Owner 3-quyết: (30) JUMP để-nguyên-theo-nhịp · (31) 4 persona +NEVER-block (restart ĐÃ THOẢ) · (32) vòng 1→5 AUTO — lô consent gỡ 9 site (5 H1 + ring1-tự-bắt + 3 trio; E-013 EXT)
- Memory-ops TRỌN: A1-A4/D1/D2/R1/B-series — A7 392/392 · mfe 20/20-100% lần đầu · lead-gap drain 24.728→16.485B · strike-ledger + WARN-latch (-Ack = owner-action)
- V4 sleep AUTO đầu: 1 shard thật/16 KÊU · ring4 đầu-đời TRƯỢT-4/5 → 4 fix gist (scribe sub-ring4-close vì return-only)
- Thư model re-stamp: 59ce1d0f → 9c909007 published (G-024a) — adap-report Đính-chính @S152 + sweep 13 bề-mặt LIVE
- Bookend @close: stale 6 FLAG + gap 2 FLAG → vá 8/8; ring2 8/8 ĐẠT (4-A pin-bản-cắt → slot 33) · ring1 48Đ/5T/59-claim
- M9 13 đơn-vị diary (3 S151-deep hồi-tố) · #53 ×10-chắc → tally 60-cận-dưới + errata subject-1b85713
- Session-log 2 run= + completeness-gate 5-vòng ĐẠT · HANDOFF segment S152 (carry 3-đóng/3-mới/23-giữ; slot 33/34)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 01:58:30 +07:00
1b85713bb6 [CLAUDE] Docs: S151 closeout — bootstrap + trio-AUTO đầu tiên + gói 3-máy vá sống + bookend DEEP trả nợ JUMP (tally #53=53, AS-17 promote)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m38s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 20:13:25 +07:00
398d343403 [CLAUDE] Docs: S149-S150 closeout — bookend lượt đầu end-to-end (hình B) + 2 arc đóng + tally #53 chốt 45
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m48s
- Arc-1 hội-tụ-bookend (rename 5 vai + 4 máy PS1 + C9-C12) + arc-2 adap-backlog 23/23 + probe Opus-5 khép (S149)
- Bookend @close S150: wave 6 vai (4 đo + 2 KIỂM) → 20 FLAG disposition từng-dòng; ring1 31/34-ĐẠT, ring2 10/10 + M-1 view-stale-role-desc
- Khoá _frozen_until_owner CẮM trước h24-signal-write (frozen-held in thật); 9 class FIRE; JUMP dải {5,4,4,3}+asym{1,4} chờ anh #21
- STATUS bump CURRENT S149-S150 + 2 khối Recently Done; HANDOFF segment mới + re-stamp đủ-slug + (17)(18)(19) lật + (14) viết lại + 6 slot #21-#26
- K2 posture-A @engine PHẦN K + K5 luật TÁCH vòng-đo-mới @session-end (O-2/O-3 OWNER-DELEGATED execute)
- sleep-doc derive-monitor-set (bỏ hardcode 4-tên); spawn-model-audit desc/comment fix; h24-signal-write param-default fix (first-live bug)
- M9 on-behalf ×3 (tooling + inv-cb F3 + reviewer F4); ring1/ring4 nhà seed; ring2 3 cite-dead vá
- Sổ garble #53 derive-from-body chốt 45 + sub-class ngược-#53/skeleton-ruột-rỗng (ghi-đĩa CẦN-KHÔNG-ĐỦ)
- Session-log S149-S150 (Sàn-5 đăng-ký 6 run=) + closeout-synthesis dạng-1

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 12:17:05 +07:00
24483935cb [CLAUDE] Docs: S148 — session-model port form hub + /check-email 4 cửa + Sàn-3 dual-accept
Session-model (owner chốt "đối ứng đúng chính xác như hub"):
- Form hub: _context-s-<N>.md (STOCK-map + FLOW append-only + STOCK-touched)
  + _pause-<i>/_tiep-<i> marker 5-trường + _snapshot-<i> + _end (thay closed.md)
- Port /snapshot + scripts/session_scaffold.py (near-verbatim)
  + scripts/session_ctx.py TRIMMED CÓ KHAI (chỉ machine-block + secrets-sweep;
    KHÔNG port jsonl/overhead/cap-getter vì chưa có caller = ghost-wire)
- session-2 migrate sang form hub; session-1 giữ legacy (FROZEN)

Sàn-3 ORPHAN-L:
- DUAL-ACCEPT hub + legacy; glob pause-* KHÔNG khớp _pause-1.md nên không đếm đôi
- VÁ bug có sẵn từ S146: chốt-kết ĐÓNG TRỌN thư-mục (bản cũ c=1 chỉ tha 1 pause,
  lệch chính câu session-end §6.3-bis vẫn nói "mọi pause")
- Fault-inject 10/10 hai chiều + anti-Goodhart

/check-email:
- Wire 4 CỬA phiên (session-start/tiep/session-end/pause), 2 CHẾ-ĐỘ:
  DÒ ~5ms ở cửa dừng-nối (ràng buộc BINDING hub goi-chot §3) ⟂ KÉO ở bookend
- DÒ quét 2 kênh + định tuyến: outbox/se -> /check-email · outbox/all -> /adap-apply
- STAGE-2: 10 thư fan-out verify 2 tuyến 10/10 -> inbox/ai_infra/; backlog root = 0

HANDOFF re-stamp: #1 ĐÓNG (trio đã chạy S144) · #2 đổi trục · #3 anh chốt (a)
+ 4 mục mới (13)-(16); carry #15/#17 đóng, #16 đóng nửa (khai rõ vế còn hở)

H24 tick S147->S148: counter 21->22 CLEAN

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 18:03:41 +07:00
8b6df0a396 [CLAUDE] Docs: S146 closeout — session-model 3 owner-decision + hook 4-path + H24 auto
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m25s
Ap spec-apply-hub-s145-v2 (5 axis, governance-only: 0 prod-code, 0 migration).
Workflow S145 chet giua chung -> /tiep §4 relaunch-cat-gon wf_3d803740-41d 3/3 DONE.

Owner-decision @S146:
- session_ctx_kb = 64 TUONG-MINH (giu nguyen caveat ghost-wire: 0 reader)
- session-model: scaffold IDEMPOTENT (tach cap-SO vs tao-THU-MUC) · closed.md WIRE
  (session-end §6.3-bis) · V2 AUTO (go cong NGUOI, GIU cong NHIP 6/15/3)

Landed: C7 §N.8 predicate 4-ve · hook wal-flush.ps1 4 path (+.claude/sessions/)
· San-3 tin-hieu ⑤ + ORPHAN-L · D2 KIEM end-only · §L.c completeness-gate co RANG.
LIVE-VERIFY hook 4-path PASS repo THAT (da7ee8a). Session-model chay TRON VONG dau
tien: pause-S146 -> resume-S146 -> ORPHAN-L can so.

H24 force-fire (P=8 pause >= 1, luat auto moi): 2 vai + h24-audit -> 7 FLAG, va het:
- sweep-consent sot 6 site (h24-audit.md:4 = frontmatter description)
- closed.md wired-but-declared-unwired (ghost-wire CHIEU NGUOC)
- owner-decision [7] BI GHI DE do tai-dung slot-index -> mat uy-quyen push
3/3 vai lane-H24 garble #53: ghi-dia-SOM cuu tron, ghi-MUON mat trang.

So: orphan run-folder 3->0 · carry 14->20 (co tag [carry:*]) · +E-013 +E-014
error-ledger · +memory feedback_absence_looks_like_clean · .gitignore +lock file.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 00:16:37 +07:00
36cefcca62 [CLAUDE] Docs: vá 9 finding audit S143 + mở enum gap-incident-unrecorded
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m26s
Audit 3 lane (reviewer FAIL 1C/4M/4m/1nit + 2 vai H24 = 6 FLAG), lead tự
re-đo từng finding trước khi vá.

CRITICAL/MAJOR:
- Re-anchor 5 adap-report: sha wal: tiền-closeout (1a0fa59/a458102/96ab2679)
  dangling sau squash -> hub clone không resolve nổi. Đổi sang 2757e41.
  LUẬT: cite outward = commit SẼ SỐNG sau squash, không bao giờ wal:.
- Đính chính claim OK-reachable: phép đo tự huỷ trong cùng phiên (squash lật
  sang squash-benign). Sự thật mạnh hơn: cả 2 nhánh lành đã chạy runtime.
- TRIPLE 17/17/17 chọn enum dễ: README:225 (tự xưng "ĐỦ roster") còn 14 +
  "4 monitor"; README:27 ("Roster THẬT") còn 14. Cả 2 vá -> 17/7.
- TOTAL 46 "== baseline" sai: baseline ghi trong repo là 45. Tách claim-DELTA
  (bền) khỏi claim-TUYỆT-ĐỐI (phải neo commit+thời-điểm).

FLAG view-residual-asym: STATUS:450 + README:190 còn khai "NO Write/Edit" như
cơ-chế chặn -> sửa thành tuyên-bố ý-định (runtime vẫn cấp, 9/9 vai; nhân-chứng
reviewer đã Write+Edit thật).

FLAG gap-carry-dropped: HANDOFF carry 13 -> 14, trả [carry:session-model-adopt].
FLAG gap-decision-sunk: 3 mục "Chờ-anh" chìm 2 nhãn phiên -> lên NEXT anh (10)(11)(12).

Enum flag_classes 10 -> 11: +gap-incident-unrecorded (anh duyệt). Vai
lead-omission từ chối tự chế class và escalate đúng luật CLOSED-enum.

Bài học acceptance: AC4 grep theo SỐ nên 2 site liệt-kê-TÊN lọt lưới.
Lần sau đếm PHẦN TỬ rồi so canonical, đừng so hình-dạng chuỗi.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 13:40:49 +07:00
2757e418a1 [CLAUDE] Docs: closeout OUTWARD wave adap đợt-9/10 + vá drift skill-matrix H24
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m43s
Closeout 4 mục OUTWARD của wave S141-S142 (anh gật @S143):
- adap-report 7/7 thư, đủ 5 trường REPORT-FORMAT LOCK, evidence đo thật
- email hub báo-nấc (sha 6c94873f72e0, selftest_verify exit 0, log _index cùng lượt)
- STAGE-2: 7 thư -> inbox/ai_infra/, _index 0 pending, cross-check 7/7
- squash K=8 wal: -> commit chốt

Ngoài wave: agents/README skill-matrix thiếu 2 row H24 (drift S121) -> 15/17 thành 17/17.

Nấc cao nhất khai được = executed-file/verified-pending-restart (trio CHƯA spawn).
2 phát hiện khai thẳng theo G-015 (chi tiết trong report + email):
- whitelist `tools:` KHÔNG chặn ghi ở runtime: 6 vai read-only bị append Write+Edit
- pull-lag do "watch broadcasts/inbox" canh nhầm chỗ

TICK H24: counter 16->17 (S143), 3-điều-kiện OK-reachable, không fail-loud.
Detector TOTAL 46 == baseline 46, 0 flag mới.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 12:32:27 +07:00
3a394b02cc wal: pause 2026-07-18 01:00:30 +07:00
7760cdfec0 [CLAUDE] Scripts: H25-closeout-ritual fold-per-label + batch>=3 INFORM guard (owner S137) — FP W3 tail-adjacency retired; fault-inject 12/12 PASS (9 regression + 3 fold-case); repo TOTAL 46->45, diff = dung 1 FP classified, W1/W2 window giu nguyen
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 20:34:28 +07:00
da349fc2c9 [CLAUDE] Docs: S135-S136 adap khung-nhip-nam-vong 7-item — tick da-diem-vao OR-guard+label-pin + force-fire consent + nhip-no-probe 3-ve + 2 detector H25 (fault-inject 9/9, FP W3 tail-adjacency classified) + residual do-token e0bb5bbf + luat non-JSON-args + sleep-khuon; AC A10/10 B6/6 C8/8; reviewer GO 0C/0M/2n
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 19:12:41 +07:00
295c70c904 [CLAUDE] Scripts: S129 adap 2 errata EOL 16-07 — pre-satisfy fix①②③ + vá point-of-generation mfe-eval 2-phía (BOM/LF) + AXIS-limit header + compendium 4-gated/3-discipline + 2 adap-report + email hub 10ca96c9 (H9 2-workflow wf_3fccd7d1 + wf_8a0249f6)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m30s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 23:16:50 +07:00
289ba96cb0 [CLAUDE] Docs: S128 adap đợt broadcast 16-07 — 6 bản nấc-hoá (fable A/B/C gate + HMW D 3-wave 11/11 + review 2-lane GO-COMMIT)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m33s
- rag.json contextual_retrieval=false (owner-final f5ce2778; lineage git-chính-xác 05-22 bf93abd)
- crystallized-backfill.ps1 hạ-nhãn calibrated→heuristic (C1 190c11ba; code /4.0 /3.0 nguyên byte)
- reviewer.md +Measured-label gate (verified-pending restart) + session-start.md:206 re-tune chu-kỳ-2 CỦA SE
- 4 adap-reports NEW + bookend UPDATE đính-chính dòng 8 + mục Re-verify (khuôn LOCK 5-trường, 0 self-verified)
- email hub gộp 6c-PASS c0ac7486447e + STAGE-2 move 6 file hash-preserve 6/6 + _index chốt
- owner-gated 4 mục CHỜ ANH: runs/2026-07-16-S127-adap-dot-16-07/owner-gated-proposals-dot-16-07.md
- run-trace đủ: 11 sub-md 3-wave + 2 review-lane + 2 synthesis + curate reviewer L1 20.3→16.8KB seal-verified

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 20:57:02 +07:00
e9124fc6de [CLAUDE] Docs: S125-S126 closeout GOP — H23-precedence DO (spawn-param THANG hard-pin, /fable-real SONG) + sweep all-inherit va 15+3+5 + gotcha #83 + hub-mail h23-result
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m30s
- NHOM A restart-verify: A1 tier:'fable' tren reviewer pin-opus -> resolved claude-fable-5 (spawn-param THANG); A2 no-tier -> claude-opus-4-8 DU lead=Fable (pin an runtime); A3 autoMemory WRITE-path OK (project_h23_spawn_precedence.md moi).
- B1 sweep all-inherit floor-song: 15 dong/5 file + 3 cung-lop lot-pattern + 5 dong H23-stale o 3 command-file (H1 bat) -> VA HET; spawn-model-audit Section-D flush H8->S124 + effort-check (fault-inject 2-chieu PASS, 14 duong-gia -> 0); governance-detectors C3 seed +worker-tier-pin; re-grep 0 floor-song; suite 45 = baseline 0-new.
- vocab-alias-map §3 canonical flip -> worker-tier-pin (all-inherit/two-tier = 2 alias cu); STATUS:6 FROZEN-diary label (het H24-3 lag); STATUS:25 + agents/README:5 sync.
- Email hub h23-precedence-test-result stamp 945cf3ad (reviewer-gate FAIL bat 3 loi truoc stamp -> gotcha #83 aggregate-cumulative) + _index cung luot.
- B3/B4 owner-gated: soan b3-b4-owner-gated-proposals.md CHO ANH (mega-line retier + budget:74 wording) — 0 apply.
- Closeout: harvest 4 lane + 2 monitor (H2 GATE PASS 5/5, 0/29 orphan; H1 3/4 clean + 5-spot fix) + curate moved-not-cut reviewer/inv-cb + carry disposition (DONG 2: restart-s124, h23-fable-test-postrestart; MO re-stamp 9) + H24 counter=5 + pilot H22 D5 (pause-roundtrip + hook-fire re-verified; cross-model PENDING).
- Governance/tooling-only: 0 prod-code, 0 mig, test 509 GIU, bundle FROZEN.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 15:19:08 +07:00
b764ac791a [CLAUDE] Docs: S123 citation-trap guard + H24-3 + DUAL-ACCEPT + luat retire-legacy
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m22s
Anh chot 4 viec governance. Detector 46->45 = DOI THANH-PHAN (-2 duong-gia
+1 duong-THAT), khong phai "flag giam". Mark moi RC-pqhuy1987-15-07-2026-17-23-10.

- backtick-guard H24-1: discriminator = ENCLOSURE (use vs mention), KHONG port
  duoc charset-guard cua H24-2 vi vi-du byte-identical voi claim. Helper DUY-NHAT
  Test-Quoted. Fault-inject 5/5 (2 anti-Goodhart).
- H24-3 session-label lag (MED, moi): va am-gia CHUNG-MINH-DUOC cua H24-1
  (so NGAY ma ngay = moi nhat => 0 flag trong khi nhan lui 3 phien; tai-phat lan 4).
  Fault-inject 6/6 + 6/6 sau fix.
- DUAL-ACCEPT (dang-3 RETIRED) + LUAT RETIRE LEGACY: go nhanh legacy khi tap
  di-san RONG, giu khi CON nguoi thu-huong. Repo that 0 orphan/26. Fault-inject 7/7.
- tiep.md:66 stale-at-birth + sweep view-residual-asym 6/6 be-mat LUAT sach.

Reviewer PASS_WITH_FIXES bat 6 loi that, lead verify 4/4 doc-lap:
gen-2 citation-trap (lead viet 30 dong chung-minh dinh-luat roi de H24-3 KHONG
guard) - greedy .* lay CUOI khong phai MAX - ly-do retire ap cho dang-2 thi giet
C8 - "retire HOAN-THANH mark" = nguy-bien - "5/5" = 4/4.

Goodhart DO DUOC (ngoai diff): W4/S122 "va" permission-matrix:16 bang doi FORMAT
anchor => khop 0 pattern => H24-1 mat chinh positive-control no dung quanh;
flag-count GIAM nen trong nhu thanh-cong.

Outward: addendum R5 (DUNG adopt TRI-ACCEPT) + email hub ed3786a10f12
(selftest-stamp MATCH x2). _index reconcile: 2 email S122 gui ma chua log.

#53 garble x4/3 agent - harvest-curator ghi diary TRONG luc lam nen vot duoc tu
dia ngay; reviewer tu rut luat "ghi diary TRUOC return" tu garble-1 va nho dung
no ma garble-2 vot duoc. Prompt-dung KHONG chan duoc #53.

Lead sai 4 ca tron o truc dem-ve-minh: "25"!=26 - "5/5"!=4/4 - viet "7/7 PASS"
TRUOC khi chay - "0 proxy" sai.

State GIU NGUYEN: Mig 66 - 89 bang - 509 test - gotcha 82 - menu 54.
Con no: STATUS:6 CO Y chua bump (H24-3 dang FLAG, giu cho hien ra).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 17:36:39 +07:00
c39ba9d28e [CLAUDE] Infra: W5 - engine roster B1 + FIX bug $userMemDir hardcode (fault-inject nay CO LAP duoc)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m31s
W5a -- harness-11-engine.md: 4 hit roster -> 0 occurrence (do bang grep -o|wc -l, KHONG grep -c).
  :269 "12 sub tools:" -> "sub read-only tools:"
  :322 "MOI vai roster 12" -> "MOI vai trong roster hien-hanh" + tro canonical
  :332 GAP-1 "nhan ca 12 vai" -> "nhan TOAN roster" + lich-su 9->12->14 + tro canonical
  :345 x2 -- BAY MEGA-LINE: sua phan "(i) Vai owner-gan" roi VAN con "VALID_ROLES = 12"
       o doan SAU cua CHINH DONG DO. Sua 1 cho tuong xong = dung bay grep -c da ghi WAL 2 lan.
  + danh-sach vai khai ro la BAN SAO; nguon that = hmw.js VALID_ROLES :22-36; lech => tin hmw.js.

W5b -- scripts/governance-detectors.ps1:363 bug $userMemDir:
  TRUOC: $userMemDir = 'C:\Users\pqhuy\.claude\projects\D--Dropbox-...\memory'
  ...nam NGAY DUOI comment ghi "Derive from this machine's project slug".
  => Comment mo-ta Y DINH; code hardcode ca path tuyet-doi LAN username. Loi noi doi
     nam ngay canh dong no noi doi ve.

  2 HAI CU-THE (khong phai style):
  1) -RepoRoot <cay-tam> VAN doc user-memory THAT => fault-inject KHONG co lap duoc
     => teeth-test C1-wikilink bat-kha-thi => cong-cu dung de CHUNG-MINH-CO-RANG
        lai khong co rang cua chinh no.
  2) hardcode 'pqhuy' => may/acc khac se im lang roi xuong else-branch, va mot su
     degrade IM LANG doc y het "sach".

  SAU: $projectSlug = $RepoRoot -replace '[:\/_]', '-'
       $userMemDir  = Join-Path $env:USERPROFILE ".claude\projects\$projectSlug\memory"

  VERIFY 2 CHIEU (do that, khong suy):
  - slug derive tu RepoRoot that == literal hardcode cu, KHOP 100%; Test-Path = True
    => hanh-vi KHONG doi (TOTAL van 45, user-memory van duoc quet)
  - -RepoRoot cay-tam => slug khac => "[note] user-memory path not reachable (...fake-repo\memory)"
    => CO LAP; ro path THAT = 0 hit.

SWEEP CUOI toan repo: 8 hit / 6 file, 0 cai thuoc nhom "doc dan-xuat khai so roster SAI
nhu su-that hien-hanh" => acceptance MOI FIX#6 DAT; nhom "chua toi luot" nay RONG sau W5.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 15:12:14 +07:00
d07bbb98c5 [CLAUDE] Infra: W1 - 2 detector H24 + 3 script governance (eol-hygiene / wal-recovery 4-ca / spawn-model-audit)
Wave adap-6-broadcast W1 - 4 lane disjoint qua /hmw RUN-TRACE (wf_de36dea9-265, 4/4 lane 0-error).
Lead TU CHAY LAI ca 4 + tu fault-inject, KHONG tin return (gotcha #53 fire 2/2 @W0.6).

(1) governance-detectors.ps1 455->715
    - GAP-3 +2 token canonical: menu=54 (STATUS.md:19); policy = row CHUA co (W2 land)
      -> FAIL-LOUD + SKIP, khong im lang gia vo xanh.
    - Detector H24-1 title-freshness: anchor_patterns[] = MANG 2 dang (fix C2). Bat buoc co dang
      '**Status (post Session N <em-dash> YYYY-MM-DD):**' vi permission-matrix/SKILL.md
      (positive-control SONG) dung dang do va KHONG co 'Last updated'. Neu 1 regex => detector
      loai thang chinh positive-control cua no => W4 bat-kha-thi.
      NEO-PHAM-VI load-bearing: STATUS.md:6 chua 2026-08-01 / 1987-03-07 / 2026-20-42 (cat tu
      mark-id). Regex-ngay-bat-ky lay max => 2026-20-42 = ngay KHONG ton tai => moc-phai rac
      => trai<phai khong bao gio dung => 0 flag VINH VIEN ma van xanh.
    - Detector H24-2 carry-age INFORM-only: M doc tu agent-memory/memory-budget.json
      h24_cadence.light_every; thieu key => FAIL-LOUD, 0 so nhip hardcode.
    - Bug lane tu bat: PS ten bien CASE-INSENSITIVE => $M (cadence) == $m (loop match) => ghi de
      cadence => vo nhanh fail-loud. exit 0 CHE bug nay; chi stderr moi lo.
    - M3 scope giu: 4 hang so owner-da-ky KHONG dung (walLineCount 40 / ratio / maxGotcha / liveVariants).

(2) agent-frontmatter-eol-check.ps1 (NEW) - HYGIENE-only
    W0.6 spawn-probe @S121 do duoc CRLF-TOLERANT (agent CRLF 276 byte CR spawn an du 4 tang;
    token 45248 LF vs 45240 CRLF, lech 8 = chenh chu trong prompt) => gia thuyet 'CRLF giet
    registry' BI BAC => script ha cap xuong hygiene, khai that ca o header lan thong diep FLAG
    runtime. Scope-chat 37 file (agents/commands/skills), KHONG repo-wide (188 = duong-gia
    factory). Tu in GREEN-BUT-VACUOUS thay vi nhan cong.

(3) wal-recovery-test.ps1 (NEW) - 4/4 ca, 30 assert
    FIX #3-bis: bien re nhanh = DAY RANGE, KHONG phai NONWAL. Counterfactual chay luat cu =>
    tai hien DEADLOCK that voi rebase-exit=0 (hong ma bao thanh cong). Assert
    sut-has-no-NONWAL-param bang Get-Command reflection, KHONG grep => ne tu-tham-chieu (W0.4#1).

(4) spawn-model-audit.ps1 (NEW) - PA-2b
    FAIL-LOUD khi thieu TIER2_EXPECTED_FULL_ID (W2 chua land). Muc E liet 6 dieu no KHONG chung,
    gom precedence spawn-param vs frontmatter (CHUA TEST, defer phien lead=Fable) + fix#8a chua thu.

VERIFY LEAD TU DO (khong phai so sub khai):
  TOTAL FLAGS 42->49 (>=46) . permission-matrix/SKILL.md FIRE 3 dong (W4 kha thi; KHONG lane nao
  cham file do) . exit 0 + stderr 0 x4 . non-ASCII 0/4 . teeth 2/2: inject 276 CR -> FLAG, go -> 0;
  inject claude-opus-9-9 -> FLAG mismatch, sua -> het. Containment sach.

LOI LEAD @S121 (di vao adap-report, khong im):
  (a) San-1 lech: marker wf: dang ky SAU khi phong (luat = TRUOC).
  (b) Khang dinh fact-tren-dia ma KHONG do dia: lead phan 'backfill [carry:*] = orphan chua ai lam'
      -> SAI, da co 7 khoa tu 4727d16 (S119, da push). Co che: ra BANG WAVE thay khong ai duoc
      giao => suy ra chua lam. 'Khong wave nao so huu' != 'chua co tren dia'. Brief lead co 4 tien
      de sai (config path / acceptance ngay 07-14 vs that 07-15 / carry / do-dai); lane (1) do dia va va het.

GAP THAT thay claim sai (lane 1 tim, lead verify dia): carry-age vacuous vi CAU TRUC - 45
logic-segment nhung carry-lines=1 => streak==1 => 0 fire vinh vien ke ca sau W2. Lo = thieu nghi
thuc RE-STAMP moi phien => giao W3 session-end.md, KHONG phai W2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 12:47:55 +07:00
81b59f0389 [CLAUDE] Workflow: adopt presence-not-age selector guardrail + rec-3 hmw.js STOP-HARD (S115)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m23s
Adopt AI_INFRA 2026-07-13 broadcast ab6c387e (presence-not-age selector,
type=update) + directed 6c32df89 rec-3, via /fable-clone 5-lane reviewer
ensemble (wf_b621aac4-f0b) -> spec -> /fable-real deep-pass (PASS-WITH-FIXES,
M1+M2 applied) -> HMW execute (em-main solo; governance single-writer D9).

D2 (hmw.js): unknown-role fail-soft-WARN -> up-front STOP-HARD throw (before
  parallel; preserves null/'' role-less inherit-lead path). node --check + stub
  7/7. Doc-sync 5 live lines (ultra-on/README/harness-11-engine/runbook).
D3 (memory-archive-gate.ps1): value_protect advisory-flag -> pre-selection
  HARD-SKIP (value-primary; heading-only spans; non-contiguous byte accum) +
  value-floor WARN. Fault-inject ALL PASS + real regression A7 242/242. DRY-RUN.
D1 (reinject-ledger.md): presence re-verify stamp + 3 honest-notes + BUILD-GAP.

Re-verify: reinject (i) + MFE age-band (iii) already COMPLIANT; only the
archive-gate age-trace needed hardening. D3 = defense-in-depth codify, NOT
leak-closure (9-token grep unchanged; em-main value-scan stays the guarantee).

adap-report + email AI_INFRA (8b9dc5165d5a); inbox STAGE-2 processed. No new
User-Mark (codify-only). #53 garble x1 (lane-4) recovered from disk, 0 loss.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 12:25:24 +07:00
8aa3869637 [CLAUDE] Docs: S111 adopt H22 WAL session-continuity — sổ WAL ≤40 + Stop-hook wal-flush.ps1 persist-only VERIFIED-RUNTIME ×2 (12071c5/67be443 hot-reload ENV-DEPENDENT) + /pause·/tiep 1-đường + BƯỚC 0.7/§5.0/§6.4 + FLIP run-trace ≥3-task + engine PHẦN N + detector C5 + mark RC-…12-07-2026-11-43-45 + D10 paths-ignore anh-directed + email 9cdcda2f3c83 (invest/reviewer Fable per-invocation 0-garble · WF wf_5ba3daf6-fe0 3-Opus RUN-TRACE · reviewer PASS_WITH_FIXES 8/8-fix · squash §5.0 dogfood-THẬT K=2)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m11s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 11:45:14 +07:00
f0874dd2c9 [CLAUDE] Docs: S103 AI_INFRA 6-broadcast adap — crystallized-backfill (measure-then-fill) + Harness-20 fix-all-structure + memory-hygiene mapping
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m26s
Adap 6 broadcast (hash MATCH cả 6 indep-recompute) qua 2-workflow Harness-9:
- Harness-20 fix-all-structure -> engine §L + dogfood model-note 4-tầng-sweep (incl PERSONA) + 220K→380K neo-supersede + 2-đầu-catch (review bắt 2 DẪN-XUẤT stale-trailer sweep-sót → fixed)
- F4 crystallized-backfill = NEW scripts/crystallized-backfill.ps1 (measure-then-fill DRY NO-API; default target=0=OFF owner-authority; calibrated-range; precondition; file-floor=UPPER-BOUND honest) + budget.json config + budget-table wire
- F1/F3 already-met (0 hardcoded-violation persona-clean; BƯỚC 0.6 bắt S103=Opus real-metadata)
- session-cmd budget-table (Up1) + run-loop 2-tầng (Up2 largely-already-met §L.b(c))
- H16 no-key Applied% = NEW scripts/applied-eval-nokey.ps1 (adversarial-gate fail-closed 3-ca + fault-inject FLIP; mechanism-built numbers-DEFERRED)
- memory-hygiene A/B already-met (archive-gate DRY-RUN + governance-detectors 4-layer 1:1); C n/a JS-sandbox no-CLI-launcher
- consolidation reference-ack (crystallization≠backfill)

engine §L+§M · 6 adap-report + 1 adap-request (#53-garble reasoning-lane mitigation) · send-email fc1e22ac selftest-MATCH · check-email 3 pulled+verified+STAGE-2.

2-workflow: WF1 implement wf_55ef6778-a0d (3 lane schema-CLEAN, selftest exit-0 ×2 + fault-inject teeth) + WF2 review wf_3c5c37cb-aa2 fable-clone (Lane-C PASS returned + Lane-B recover-from-memory PASS; 0-BLOCKING 2-CONCERN-addressed). #53 garble ×3 → em-main recover; investigator AS-10 garble-curation REVERTED (git-backstop).

Runtime S103 = Opus (Fable outage lại, per-session flip; H5-fallback revert-free). State GIỮ NGUYÊN: Mig 61 · 89 bảng · 440 test · gotcha 79 · menu 54. 0 prod-code.

Co-Authored-By: Claude Opus 4.8 (1M) <noreply@anthropic.com>
2026-07-06 13:54:13 +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
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
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
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
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
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
d4f60212a5 [CLAUDE] Docs: S85 closeout — CV PRO batch + clear-data + 6 UAT round + 2 root-cause + 5 SQL-fix
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m51s
STATUS/HANDOFF prepend S85 (Mig 57 · 88 tables · 374 test · gotcha 73 · bundle admin aKuNip19/user BUsL0HeQ Run #341). gotchas +2: #72 DateTime serialize no-Z -> FE +7h (UtcDateTimeJsonConverter UTC-with-Z) · #73 UPDATE absolute-set clears field on FE-omit (bug-class S42, null-safe guard). + session log + scripts/s85-wipe-uat-data.sql (prod UAT wipe, backup-first, executed) + agent-memory residuals (inv-codebase PE-recon, test-specialist baseline 374).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 15:52:46 +07:00
0bc2112952 [CLAUDE] Docs: adopt Harness-15 memory-budget per-agent (token-governor + value-gate + work-state block, S81)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m0s
8/8 floor via engine section-G + budget.json (harness_floor/token_governor/value_protect) + session-start 2.1.5 + rules 6.6 + gate-script value-protect FLAG (runtime-fired test-specialist). Review wf_b7f3c8ac-b53 PASS/PASS/HONEST -> 2 CONCERN fixed (anchoring + tool-attribution) + refresh stale measured S71->S81. adap-report + email ai_infra body-hash bb8fb6e803ae. 0 production code, A7 217/217, detector 26-flag baseline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 22:46:17 +07:00
ae957c4e35 [CLAUDE] Docs: Harness-11 double-check ×2 + finalize report (anh giao)
Some checks failed
Deploy SOLUTION_ERP / build-deploy (push) Has been cancelled
- DOUBLE-CHECK wf_a0b68d2f-30e (3× reviewer): committed-state e70c046 PASS — B1 ×11 exact, root CLAUDE.md:53 tail byte-identical, broadcasts hash recompute khớp, single-writer clean. Over-suppression regression CLEAN: DA1 no-return → em-main self-gate fake-drift "99 migration" CAUGHT (runtime) + DA2/DA3 độc-lập confirm
- CHECKLIST-VERIFY wf_39cd4cbe-f07 (3× investigator-codebase): completeness-gate H11 FORMAL ĐẠT — B 4/4 + C 5/5 + D 11/11 đủ-trọn (function-floor MET), A 🟡 tailored; D5/D6/D7 explicit + D8 one-direction codify = YES
- detector refine: +C2 "test project" skip (27→26); tree-skip reverted (gotcha #30 box-glyph trap, kể cả qua Edit render-normalize); detector pure-ASCII verified
- agents/README "(pending)"→run-id; adap-report + outbox email +double-check section (hash 2316773229f2)
- 0 production code; state THẬT giữ nguyên (Mig 55 · 88 bảng · 339 test · gotcha 69 · bundle BYF5vIMJ/CB-tiRxd)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 23:01:10 +07:00
e70c0462d7 [CLAUDE] Docs: adopt Harness-11 engine tự-bảo-trì (3-workflow audit→implement→review)
- engine-doc canonical docs/governance/harness-11-engine.md (PHẦN A/B/C/D + 3-tier D5/D6/D7 + one-direction-lock D8 + CAVEAT honest)
- scripts/governance-detectors.ps1 (C1 broken-pointer + C2/B3 staleness + C3 vocab-fork + C4 self-exclusion + C5 resolve, NO-API DÒ+FLAG-only, runtime-proven, FP-refined 59→27)
- scripts/memory-archive-gate.ps1 (PHẦN A: hysteresis 0.85 + keep-floor 5 + 2-strike + A7 NO-API L1-eval) + budget.json archive_gate
- B1 ×11 count→canonical-pointer (root CLAUDE.md, ef-core/dep-audit SKILL, skills/README, docs/CLAUDE.md) — drift mig53→55/test306→339/gotcha68→69 RESOLVED + ef-core +Mig 54/55 rows
- cadence-wire D1 session-start §2.1.3 + D2 session-end §L.b(c) + agents/README Upgrade S75
- run-trace TRACKED: audit wf_7fdc3bd5-930 / implement wf_c5e5844e-7c1 / review wf_d7ca1ff8-942 (REVIEW PASS, completeness-gate ĐẠT)
- check-email AI_INFRA harness-11 (verify whole-file 318ff9f6 + body b2a2fc1c) + adap-report + outbox report (body 7fa1b53a)
- 0 production code; state THẬT giữ nguyên (Mig 55 · 88 bảng · 339 test · gotcha 69 · menu 54 · bundle BYF5vIMJ/CB-tiRxd)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 20:44:26 +07:00
f36aab8934 [CLAUDE] Docs: adopt Harness-9 — L2 archive dark-matter recovery (4 sub) + adap 2-workflow mandate (S70)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m52s
3-stage Workflow run-id evidence: investigate wf_be952f3c-97f / implement wf_a58e0d15-beb / audit wf_9520d8cd-4fe.

PART 1 (L2 recovery): 4 over-cap sub (cicd-monitor/investigator-codebase/reviewer/implementer-backend)
curated L1->L2 byte-exact + archive/_INDEX.md (substring sha-keyed pointers, no line-hints)
+ <period>.gist.md (4-field distill, distill-gen:1, verbatim frozen). All 4 MEMORY.md now < 25KB
auto-inject cap (closes P1 curate-debt). ~240KB archive no longer RAG-dark. 0-byte-loss git+sha
verified (Stage C audit + em-main self-gate on 2 reviewer StructuredOutput no-returns). Read-side
gap fixed (MEMORY.md L5 header -> _INDEX). + memory-budget.json (seed-by-measure) +
scripts/measure-agent-memory.ps1 + .ragignore guard.

PART 2/3 (process mandate): every adap = 2 separate workflows (implement + review) + report with
run-id; short-but-needs-confirm still requires review. Codified in .claude/commands/adap-apply.md
+ agents/README.md (Upgrade S70) + session-start.md (§2.1.2 budget-audit, pending-restart).

adap-report + email-back to AI_INFRA (body-hash 7c07b716e775).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 23:52:51 +07:00
c869d2617d [CLAUDE] PurchaseEvaluation: rename 71 WorkItems theo format PMH anh Kiet FDC chot (MAT-n/SUB-n/MEP-SUB-n/MEP-EQU-n + ten "STT nhom ten") + FE sort numeric
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m33s
- anh Kiet 16:59: "MA CV gom chu MEP-SUB-1 roi ten 1 MEP Sub MEP (Full) - dung kieu vay".
- DbInitializer seed tuples 71 ma moi (VT->MAT, TP->SUB, MEP-0n->MEP-SUB-n, TB->MEP-EQU-n).
- scripts/s59-rename-workitems-pmh.sql DA CHAY prod + LocalDB Dev TRUOC push (UPDATE giu Id,
  71/71, OLD-CODES=0, verify JSON qua API prod tieng Viet nguyen ven).
- FE x2 app (SHA256 mirror): PeWorkspaceCreateView + PeHeaderForm sort numeric-aware
  (ma khong pad -> string-sort loan "10"<"2") + tree Panel 1 workItemName numeric:true.
- scripts/master-import-data.generated.md sync 71 dong W| + note mapping.
2026-06-11 17:14:06 +07:00
bbd1554f74 [CLAUDE] Infra: WorkItems chi giu dung 71 ma PMH cong ty gui (chi Tra Sol chot) - go seed 15 demo + wipe prod 86->71
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m31s
- DbInitializer: XOA block seed 15 WorkItems demo (Phan tho/Hoan thien/Co dien/Khac
  - DAO-MONG, SON-NUOC, TRAT-TUONG... "ma anh tu de ra") -> nguon duy nhat =
  SeedRealMasterDataAsync 71 ma PMH (VT-01..16 + TP-01..30 + MEP-01..09 + TB-01..16).
- scripts/s59-wipe-demo-workitems.sql DA CHAY prod + LocalDB Dev: 86 -> 71,
  demo categories bien mat, doi chieu 71/71 khop bang PMH cong ty gui tung dong.
- An toan: PE=0 (Run #273 wipe) -> khong phieu nao tro WorkItemId demo.
2026-06-11 16:56:46 +07:00
56882acc4f [CLAUDE] PurchaseEvaluation: tree Panel 1 doi nhom theo anh Kiet FDC "Du an (Nam) > Hang muc cong viec > Phieu" (bo tang NCC, SHA256 mirror x2 app) + wipe testing data prod S59
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m27s
- Tree Panel 1: moi cap (Du an, Nam-tao-phieu) = 1 folder label "Ten du an (Nam)",
  level 2 = Hang muc cong viec (WorkItemId Mig 49, phieu cu null -> "(Chua gan hang muc)"),
  bo tang NCC khoi tree (van hien o card/detail). Expand-state localStorage key v2.
- scripts/s59-wipe-testing-data.sql DA CHAY prod (anh chot AskUserQuestion): xoa 10 PE
  + 7 HD [DEMO] + 64 notif + 1 workflow V2 cu inactive; reset PeSeq/CtSeq -> ma moi tu 001;
  GIU master 70/86/22 + users 55 + templates 9 + 7 workflow ghim. Uploads orphan da don.
2026-06-11 15:35:25 +07:00
69cb3937bb [CLAUDE] Master: nạp master data thật từ Excel (62 dự án + 71 hạng mục + 3 NCC) + Project +4 cột (Mig 48)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m33s
Nạp master data công ty từ file Excel 'HẠNG MỤC CÔNG VIỆC DỰ ÁN':
- 62 Projects (Mã + Năm; tên/CĐT/địa điểm/gói thầu cho ~6 dự án có chi tiết)
- 71 WorkItems: Vật tư 16 · Thầu phụ 30 · MEP 9 · Thiết bị 16
- 3 Suppliers (TRUONGGIANG/TANPHU/TGN)

Mig 48 AddProjectMasterFields: Project +4 cột nullable (Year/Investor/Location/Package) + ProjectFeatures DTO/Create/Update + ProjectsPage form ×2 app (SHA256 mirror).
SeedRealMasterDataAsync per-code idempotent, UNGATED → reaches prod (coexist demo). FLOCK01 collision → skip (demo wins).

Verify: build 0-err · test 216 PASS · runtime Dev proof (data landed, Investor col populates). Provenance: scripts/master-import-data.generated.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 09:27:04 +07:00
e199603420 [CLAUDE] Docs+Memory: Session 29 FINAL wrap — Plan CA + Plan B Contract V2 cumulative
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m31s
20 commits S29 push 4 CI Runs PASS (#229+#230 Plan CA, #231+#232 Plan B).
2 big plans END-TO-END deployed prod.

Changes (docs + memory + scripts — CI skip per paths-ignore):

docs/:
- STATUS.md: S29 FINAL wrap header với cumulative summary 20 commits +
  multi-agent ROI ~565K + 8 patterns NEW + state stats (33 mig, 60 tables,
  51 gotcha, 14 AppRoles, 34 active users, 4× bundle rotate)
- HANDOFF.md: S29 FINAL wrap header với end-to-end V2 capability + pending S30+
  follow-up (anh restart CLI MCP RAG hot-reload, UAT verify V2, test bundle
  Plan B, curate dedicated session)
- gotchas.md: +gotcha #51 INFRASTRUCTURE vs DEMO seed phân biệt (Plan B
  Hotfix CICD lesson) với decision tree + seed classification table
- changelog/sessions/2026-05-22-s29-plan-ca-plan-b-contract-v2-wire.md:
  Session log đầy đủ 20 commits + 4× Smart Friend pattern proven + 8
  patterns NEW + file-touched list + NEW capability end-to-end test plan

.claude/agent-memory/:
- 4 MEMORY.md flush S29 wrap entry FIFO each agent perspective:
  - Investigator (25.2 KB just over threshold) — Plan CA + Plan B pre-flight
    2 spawn + 3 patterns NEW (terrain map, V1+V2 coexist, reference templates)
  - Implementer (35.4 KB over hard threshold, defer curate S30) — 5 spawn
    cookie-cutter + E3 stopped + Pattern 12-bis NEW (cross-module entity mirror)
  - Reviewer (23.0 KB compacted) — 4 spawn 2 MAJOR catches + Cat 3 security
    cross-module validation foundation reinforced
  - CICD Monitor (24.9 KB) — 4 Runs verify + CRITICAL DemoSeed gate catch +
    Stage 4.6 sqlcmd seed verify foundation + Discovery #6 gotcha #51 cross-ref
- implementer/pattern_master_page_mirror.md (NEW Plan CA Chunk B Pattern 16-bis)

scripts/:
- plan-ca-{verify-menu,verify-perms,run-perms}.{sql,ps1} (5 verify scripts)
- plan-b-{verify-prod,run-verify}.{sql,ps1} (2 verify scripts)

Smart Friend pattern proven 4× cumulative S22 #44 + S25 #48 + S29 Reviewer
#ApplicableType + S29 CICD #DemoSeed.

Pending S30+:
- Anh restart CLI hot-reload MCP RAG cho 4 sub-agents (commit b51fc94)
- Anh UAT verify V2 contract end-to-end (Drafter → CCM approve → DaPhatHanh)
- Test bundle Plan B (regression ApproveV2Async + ApplicableType validation)
- Curate dedicated session 4 MEMORY (Implementer 35.4 KB priority)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 13:29:49 +07:00
7b7b28f2cd [CLAUDE] Scripts Docs: Chunk T5+T6 — Final DELETE + verify NO re-seed loop (Plan T proven active)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m15s
Post-Plan T deploy Run #207 sha=0b97840 PASS — DemoSeed:Disabled flag
applied prod via appsettings.json (commit qua git, override
appsettings.Production.json gitignored).

T5 — Final DELETE sau flag deploy:
- scripts/plan-t5-final-cleanup.sql upload qua scp + sqlcmd -i
- 3 TRANSACTION DELETE: 4 PE + 1 V2 + 2 V1 = 7 rows direct + cascade child
- Post-state: PE=0 + V2=0 + V1=0 + Steps cascade=0 + Levels cascade=0

T6 — Verify NO re-seed loop (FORCE IIS recycle test):
- Restart-WebAppPool SolutionErp-Api → app pool Started
- Wait BE healthy (curl auth login 200)
- sqlcmd verify post-recycle DB state:
  * PE=0  NO re-seed
  * V2 workflows=0  NO re-seed
  * V1 workflows=0  NO re-seed
  * Users=33  preserved (SeedDemoUsers KEEP)
  * Suppliers=19  preserved (SeedDemoMasterData KEEP)
  * Projects=9  preserved (SeedDemoMasterData KEEP)
  * Contracts=7  preserved (bro chưa request xóa)

→ DemoSeed:Disabled flag PROVEN active end-to-end. DbInitializer skip 5
method seed, KHÔNG còn re-seed contaminate sau mỗi deploy.

Cumulative Plan R + S + T cleanup:
- R: 35 PE + 17 V2 + 4 V1 + ~600 cascade (52 + 600 = 652 rows)
- S: 4 workflow + cascade (4 + ~20 = 24 rows)
- T5: 7 rows direct + cascade child (~7 + ~30 = 37 rows)
- T flag: DbInitializer permanent disable demo seed
- TOTAL: ~713 rows wiped + flag persist active

Stats final S23 t10:
- 31 mig · 59 tables · ~145 endpoints · 34 FE pages
- 111 test unchanged · 47 gotcha · 20 memory · 6 skills
- 4 sub-agents · backup rollback ready
- **0 PE + 0 workflow + flag disable seed** UAT permanent clean slate

Bro Designer setup workflow mới from scratch khi UAT continue — KHÔNG còn
auto re-seed contaminate. Plan B Contract V2 wire next HIGH priority.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 15:14:39 +07:00
c4d5704269 [CLAUDE] Scripts Docs: Chunk S — Wipe ALL workflows (UAT clean slate hoàn toàn)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m22s
Bro chốt sau Plan R: "các cái demo quy trình cũ -> xóa hết luôn đi nhé"

State post-Plan R: 4 workflows còn lại đều seed demo cumulative:
- V2 `QT-DN-PA-V2-001 v2` "Quy trình duyệt NCC và Giải pháp (mẫu UAT)"
- V2 `QT-DN-V2-001 v16` "QT Duyệt So Sánh Giá NCC-TP" (sample seed default)
- V1 `QT-DN-A v3` "Quy trình Duyệt NCC (v01) (clone)(clone)"
- V1 `QT-DN-B v1` "Quy trình Duyệt NCC và Giải pháp (v01)" (sample seed)

Bro AskUserQuestion chốt Option A (Recommended): wipe ALL 4 workflows
→ UAT clean slate hoàn toàn. Em main solo execute (Investigator audit Plan
R đã cover scope precedent + backup rollback Plan R còn dùng được).

Backup rollback ready: C:\Backup\SolutionErp_pre_cleanup_2026-05-15.bak
(Plan R, 18.5MB) — capture full state pre-cleanup, reuse cho Plan S rollback.

Execute via scp scripts/plan-s-wipe-all-workflows.sql + sqlcmd -i:
- DELETE ALL ApprovalWorkflows (2 rows cascade Steps+Levels)
- DELETE ALL PurchaseEvaluationWorkflowDefinitions (2 rows cascade
  Steps+Approvers)

Post-state cumulative Plan R + S:
- PE: 35 → 0
- V2 workflows: 17 → 2 → 0
- V1 workflows: 4 → 2 → 0
- Cascade Steps + Levels + Approvers: 0 (all entities wiped)

BE smoke verify 5/5 endpoints 200 post-cleanup:
- /api/auth/login → OK (admin token len 468)
- /api/purchase-evaluations → 200 (empty list)
- /api/approval-workflows-v2 → 200 (empty list)
- /api/pe-workflows → 200 (empty list)
- /api/users + /api/menus → 200

→ KHÔNG crash startup (Plan F precedent avoid: no Contract pin to V1, PE
đã wipe Plan R, nên drop workflow safe).

Hậu quả expected:
- User KHÔNG tạo được phiếu mới qua Workspace (Select workflow empty)
- Admin Designer phải seed workflow mới from scratch để UAT continue
- Total cleanup cumulative ~670 rows wiped (35 PE + 17 V2 + 4 V1 + ~600
  cascade child)

Stats final S23 t9:
- 31 mig · 59 tables · ~145 endpoints · 34 FE pages · 111 test unchanged
- 47 gotcha · 20 memory · 6 skills · 4 sub-agents
- **0 PE + 0 workflow** — database UAT clean slate hoàn toàn

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 14:52:55 +07:00
5cbf516a78 [CLAUDE] Scripts Docs: Chunk R — Cleanup destructive prod database (52 rows + ~600 cascade child)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m27s
Bro UAT confirm Plan P+Q wire OK + chỉ thị cleanup test data:
> "OK Tao thấy tạm ổn rồi đấy, mày xóa hết các phiếu test cũ đi nhé,
> các quy trình cũ ko ghim cũng xóa hết đi. Cho gọn đẹp."

Investigator pre-flight audit prod DB ~64K spawn confirm scope:
- 35 PE rows total (28 active + 7 soft-deleted)
- 17 ApprovalWorkflowsV2 (15 IsUserSelectable=false + 2 ghim+active)
- 4 PurchaseEvaluationWorkflowDefinitions V1 (2 IsActive=false + 2 active)

Critical gotchas:
1. PE.ApprovalWorkflowId FK Restrict → soft-delete KHÔNG release FK,
   hard-DELETE PE first
2. ApprovalWorkflow extend BaseEntity (NO soft-delete) → hard DELETE only
3. Filtered indexes Mig 29+ require SET QUOTED_IDENTIFIER ON
4. SQL Express constraints: NO BACKUP COMPRESSION + RESTORE VERIFYONLY
   require sysadmin (vrapp KHÔNG có)

Execute via scripts/plan-r-*.sql upload scp + sqlcmd -i workflow:

Step 1+2 — BACKUP DATABASE:
- C:\Backup\SolutionErp_pre_cleanup_2026-05-15.bak (18.5MB, 2249 pages)
- Verified via Get-Item file size

Step 3-5 — 3 separate transactions DELETE:
- 28 PE active + 7 soft-deleted → cascade 446 child rows
  (42 Details + 49 Suppliers + 64 Approvals + 238 Changelogs +
   10 Attachments + 43 LevelOpinions)
- 15 V2 workflows unghim → cascade ~140 Steps+Levels
- 2 V1 workflows inactive → cascade ~37 Steps+Approvers

Total: 52 rows direct + ~600 cascade child = ~650+ rows wiped.

Step 6 — Verify post-cleanup state:
- PE total: 35 → 0 ✓
- V2 workflows: 17 → 2 (QT-DN-V2-001 v16 + QT-DN-PA-V2-001 v2 ghim+active)
- V1 workflows: 4 → 2 (QT-DN-A v3 + QT-DN-B v1 active, PE pin protected)

Step 7 — BE smoke verify alive post-cleanup:
- /api/auth/login → 200
- /api/purchase-evaluations → 200
- /api/approval-workflows-v2 → 200
- /api/pe-workflows → 200
→ KHÔNG crash startup (Plan F precedent avoid được)

Multi-agent ROI: Investigator save em main hard-delete blind without
backup + catch SQL Express constraint + catch FK Restrict gotcha.

Pattern reinforced:
- Destructive operation prod BẮT BUỘC pre-flight audit + backup + verify
- scp + sqlcmd -i workflow cho complex SQL trên prod (avoid shell escape
  hell qua SSH PowerShell)
- Plan F precedent: KHÔNG drop active workflow (PE pin → BE crash)

Stats final S23 t8:
- 31 mig · 59 tables · ~145 endpoints · 34 FE pages · 111 test unchanged
- 47 gotcha · 20 memory · 6 skills · 4 sub-agents
- **0 PE phiếu test + 4 workflow ghim/active** — UAT clean slate
- Backup rollback ready: vietreport-vps:C:\Backup\SolutionErp_pre_cleanup_2026-05-15.bak

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 14:11:56 +07:00
0e707891ff [CLAUDE] Scripts: rename 20 test user sang role-based naming (S22+3)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m6s
Bro feedback: "đổi tên thành roles luôn đi cho dễ test, để user ít nhầm lẫn"

20 user S22+2 đã rename:

Email pattern: {dept}.{level}@solutions.com.vn
  - act.nv / act.pp / act.tp
  - bod.1 / bod.2 (no hierarchy)
  - equ.nv / equ.pp / equ.tp
  - fin.nv / fin.pp / fin.tp
  - hra.nv / hra.pp / hra.tp
  - pm.nv / pm.pp / pm.tp
  - qs.nv / qs.pp / qs.tp

FullName pattern: "{DEPT} {LEVEL} - {Roles} [Flags]"
  - [Bypass] = CanBypassReview=true (act.tp, hra.tp)
  - [SkipFinal] = AllowDrafterSkipToFinal=true (fin.pp, pm.nv)

Identity rename pattern per gotcha #38 — 4 fields atomic UPDATE:
  Email + NormalizedEmail + UserName + NormalizedUserName + FullName.

Implementation:
- Build single SQL transaction 20 UPDATE
- SET QUOTED_IDENTIFIER ON (required filtered indexes Users)
- SCP file → SSH sqlcmd execute (avoid shell quote escape hell)

Verify:
- 20 rows UPDATE affected (1 mỗi user)
- Login test act.nv / TestUser@2026 → ACT NV - Drafter+Accounting OK
- NormalizedEmail + NormalizedUserName uppercase match Identity convention

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 22:09:10 +07:00
8185070109 [CLAUDE] Scripts: seed 20 test user prod cho UAT (S22+2)
Some checks failed
Deploy SOLUTION_ERP / build-deploy (push) Has been cancelled
Bro request: tạo mỗi phòng 2-3 user + phân quyền để test scenarios.

Script `scripts/seed-test-users-prod.ps1` ASCII-only (gotcha #30 PS 5.1 diacritics)
gọi API admin token, idempotent (skip 409 conflict). Tạo 20 user mới:

| Phòng | Trước | Sau | Pattern |
|---|---:|---:|---|
| ACT | 0 | 3 | NV (Drafter+Accounting) / PP / TP (DeptManager, CanBypassReview=true) |
| BOD | 1 | 3 | +2 Director (no PositionLevel) |
| CCM | 7 | 7 | SKIP existing đủ |
| EQU | 0 | 3 | NV / PP / TP (DeptManager+Equipment) |
| FIN | 0 | 3 | NV / PP (AllowDrafterSkipToFinal=true) / TP |
| HRA | 0 | 3 | NV / PP / TP (CanBypassReview=true) |
| PM | 0 | 3 | NV (AllowDrafterSkipToFinal=true, ProjectManager) / PP / TP |
| PRO | 5 | 5 | SKIP existing đủ |
| QS | 0 | 3 | NV / PP / TP (Drafter-only, no role chuyên) |

Total active prod: 13 → 33 users.

UAT scenarios covered:
- N-stage workflow inner step (Mig 18): NV/PP/TP per phòng test sequential + bypass
- 2-stage dept approval (Mig 16): 2 user CanBypassReview=true (ACT.tp + HRA.tp)
- F2 per-Drafter skip (Mig 29): 2 user AllowDrafterSkipToFinal=true (FIN.pp + PM.nv)
- Plan E strict V2 scope: 33 user × 9 dept × various roles (test diverse approver match)

Password tất cả: TestUser@2026 (>=12 chars per Identity policy).

Discoveries:
- Identity password policy: >=12 chars (HANDOFF "User@123456" 11 chars FAIL 400)
- API auth response: field `accessToken` không phải `token`
- Rate limit awareness: Start-Sleep 500ms giữa requests

Verify: sqlcmd Prod 9 phòng × 2-7 user, 33 total active.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 22:05:46 +07:00
ac41d5e0d8 [CLAUDE] Scripts: SQL clean transactional UAT (Session 17 V2 testing)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m12s
User UAT V2 schema cần clean phiếu cũ trên prod để đỡ rối mắt + giữ
master data (Users / Suppliers / Projects / Departments / Workflows).

scripts/sql/clean-transactional-uat.sql:
- DELETE theo FK order (child → parent):
  1. PE child rows (DeptApprovals/Opinions/Attachments/Changelogs/
     Approvals/Quotes/Details/Suppliers)
  2. PE main (giải phóng FK PE.ContractId/BudgetId)
  3. Contract per-type Details (7 bảng) + Contract child rows
  4. Contract main
  5. Budget child rows + main
  6. CodeSequences (PE + Contract reset)
  7. Notifications (dangling refs sau khi xóa phiếu)
- Wrap BEGIN/COMMIT TRANSACTION
- Verify queries cuối in count master KEEP + transactional after-clean

KEEP master: Users, Roles, MenuItems, Permissions, Suppliers, Projects,
Departments, UnitsOfMeasure, MaterialItems, ServiceItems, WorkItems,
ContractTemplates, ContractClauses, WorkflowTypeAssignments,
WorkflowDefinitions (V1 legacy), PurchaseEvaluationWorkflowDefinitions,
ApprovalWorkflows + Steps + Levels (V2 Mig 22).

Required SET QUOTED_IDENTIFIER ON; ANSI_NULLS ON; cho filtered indexes
Mig 19/20 (sqlcmd default off → DELETE fail).

Verify local Dev: chạy OK, 1 Contract + 0 PE + 0 Budget cleaned, master
giữ (Users=2 admin seed, Suppliers=3, Projects=1, Departments=9, V1
WfDef=7).
2026-05-08 15:28:40 +07:00
b93dacff44 [CLAUDE] Scripts: fix migrate-domains.ps1 ASCII-only (gotcha #30 PS 5.1)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 2m46s
2026-04-24 09:55:57 +07:00
66c1a5c170 [CLAUDE] Rebrand: 3 domain huypham.vn → solutions.com.vn + migrate script
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 2m52s
User request: anh trỏ 3 subdomain mới về VPS IP 103.124.94.38:
  - api.huypham.vn        → api.solutions.com.vn
  - admin.huypham.vn      → admin.solutions.com.vn
  - user.huypham.vn       → eoffice.solutions.com.vn

Verified DNS: cả 3 resolve 103.124.94.38 ✓

Update 17 file repo:
FE (4): fe-admin/.env.production + fe-user/.env.production
        (VITE_API_BASE_URL → https://api.solutions.com.vn)
        fe-admin/src/lib/{api,realtime}.ts + fe-user equivalents (comment)
BE (1): appsettings.Production.json.example — CORS AllowedOrigins
CI/CD (1): .gitea/workflows/deploy.yml — smoke test URL
Scripts (3): setup-iis-sites (DomainApi/Admin/User), setup-ssl (3 host),
             deploy-all (verify curls)
Docs (5): STATUS, HANDOFF, PROJECT-MAP, vps-setup, gotchas
Skill (1): iis-deploy-runbook — 3 site table + description
Email admin@huypham.vn giữ nguyên (Let's Encrypt contact — không phải
domain serve).

Thêm scripts/migrate-domains.ps1 — 1-shot VPS migration:
  1. Pre-flight: resolve DNS 3 domain → verify IP VPS khớp
  2. Add HTTP binding mới cho 3 IIS site (giữ binding cũ làm fallback)
  3. Run win-acme xin 3 cert Let's Encrypt qua HTTP-01 challenge
     (auto add HTTPS binding + http→https redirect)
  4. Verify /health/live + /health/ready + 2 FE endpoint
  5. (Optional -RemoveOld) xóa binding huypham.vn sau verify OK
Rollback: nếu fail, binding cũ vẫn active → site serve qua huypham.vn.

Anh chạy trên VPS:
  cd C:\solution-erp\scripts  ;  .\migrate-domains.ps1
  # Sau 1-2 ngày verify stable:
  .\migrate-domains.ps1 -RemoveOld -SkipCert
2026-04-24 09:43:05 +07:00
e53cd3a3b2 [CLAUDE] App+Api+FE+Scripts: Edit detail row inline + deps audit helper
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 2m45s
## Edit detail row inline (BE)

7 typed UpdateXxxDetailCommand handler trong ContractDetailsFeatures.cs
— pattern lặp giống Add commands, EnsureContractType guard + log
ChangelogAction.Update với summary "Sửa <hạng mục/SP/CV/...>".

7 PUT endpoints trong ContractsController:
- PUT /contracts/{id}/details/{thau-phu|giao-khoan|nha-cung-cap|dich-vu|
  mua-ban|nguyen-tac-ncc|nguyen-tac-dv}/{detailId}

## Edit detail row inline (FE)

ContractDetailsTab.tsx refactor:
- DeleteBtn → ActionBtns (Pencil + Trash) với onEdit + onDelete callbacks
- 7 XxxTable signatures + onEdit prop + pass row data via callback
- New EditRowDialog component:
  * useEffect populate form từ row data khi target thay đổi
  * Reuse FIELDS_BY_TYPE config + buildPayload (compute thanhTien)
  * Date field convert ISO → yyyy-MM-dd cho input[type=date]
  * PUT /contracts/{id}/details/{slug}/{detailId}
- Parent state editTarget — open dialog, close khi save thành công

Mirror fe-admin (file copy).

## Deps audit helper script

scripts/deps-audit.ps1 — chạy thủ công hoặc CI integration:
- dotnet list package --vulnerable --include-transitive (BE)
- npm audit --audit-level=moderate (fe-admin + fe-user)
- Color-coded output (green/red), summary cuối
- -FailOnHigh switch để CI gate

Skill ref .claude/skills/dependency-audit-erp/SKILL.md (đã có) cho
pin constraints + workflow fix.

## Build

- BE: dotnet build pass (0 error)
- fe-user: tsc + vite pass (11.52s)
- fe-admin: tsc + vite pass (577ms)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 15:18:53 +07:00
6bbd894d96 [CLAUDE] App+Infra+Api+FE-Admin: PDF export (LibreOffice headless)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 2m33s
Pipeline: template.docx → FormRenderer fill placeholders → LibreOffice
soffice --headless --convert-to pdf → PDF byte[] → File() stream to
browser.

Clean-arch split:
- Application: IPdfConverter abstraction (swap to QuestPDF/Aspose later
  without touching caller).
- Infrastructure: LibreOfficePdfConverter — shells out to soffice.exe
  path from config (Pdf:SofficePath, default
  `C:\Program Files\LibreOffice\program\soffice.exe` on Windows).
  Per-request temp workDir để tránh filename collision + -env:
  UserInstallation isolate mỗi conversion (chống "soffice already
  running" khi concurrent). Timeout 60s (configurable). Best-effort
  cleanup. Kill entire process tree nếu timeout.
- Application: ExportTemplatePdfCommand — reuses existing FormRenderer
  + pipes bytes through IPdfConverter. Same data dict signature as
  Render để UI code share.
- Api: POST /api/forms/templates/{id}/export-pdf (same JSON body as
  /render, returns PDF stream).

FE:
- useExport hook chung cho 2 endpoints (DRY render + export-pdf mutations)
- Render dialog thêm nút "Tải PDF" (outline variant) cạnh "Tải file gốc".
  Disabled khi mutation khác đang chạy.
- Hướng dẫn dialog nâng cấp: "file gốc để edit Word/Excel, PDF để
  in/gửi không chỉnh sửa được".

Ops: scripts/install-libreoffice.ps1 — silent MSI install 25.8.6 cho
VPS (đã chạy trên prod).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 21:28:31 +07:00
397eb367e5 [CLAUDE] Scripts: SPA web.config thêm HTTP→HTTPS redirect (fix admin login Network Error)
Some checks failed
Deploy SOLUTION_ERP / build-deploy (push) Has been cancelled
2026-04-21 15:33:01 +07:00
45452765e3 [CLAUDE] Scripts: fix setup-ssl.ps1 --installationsiteid flag
Some checks failed
Deploy SOLUTION_ERP / build-backend (push) Failing after 8s
Deploy SOLUTION_ERP / build-fe-admin (push) Has been cancelled
Deploy SOLUTION_ERP / build-fe-user (push) Has been cancelled
Deploy SOLUTION_ERP / deploy-iis (push) Has been cancelled
win-acme 2.2.9 with --target manual + --installation iis requires
--installationsiteid (not --siteid). --siteid only applies to the
iis target plugin, not the iis installation plugin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 14:19:26 +07:00
169e268b28 [CLAUDE] Scripts: rewrite 4 deploy PS1 ASCII-only for PS 5.1 compat
Some checks failed
Deploy SOLUTION_ERP / build-backend (push) Failing after 9s
Deploy SOLUTION_ERP / build-fe-admin (push) Has been cancelled
Deploy SOLUTION_ERP / build-fe-user (push) Has been cancelled
Deploy SOLUTION_ERP / deploy-iis (push) Has been cancelled
PowerShell 5.1 reads .ps1 files as locale codepage (not UTF-8 no BOM),
which corrupts multi-byte Vietnamese chars and breaks parsing. Rewrote
setup-iis-sites.ps1, setup-ssl.ps1, setup-gitea-runner.ps1, deploy-all.ps1
as ASCII-only. Also renamed $Host param to $HostName in Ensure-Site to
avoid collision with PowerShell built-in $Host automatic variable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 14:17:36 +07:00
85acf750b3 [CLAUDE] Scripts: update cho SQLEXPRESS instance + Invoke-Sqlcmd (no sqlcmd.exe binary needed)
Some checks failed
Deploy SOLUTION_ERP / build-backend (push) Failing after 9s
Deploy SOLUTION_ERP / build-fe-admin (push) Has been cancelled
Deploy SOLUTION_ERP / build-fe-user (push) Has been cancelled
Deploy SOLUTION_ERP / deploy-iis (push) Has been cancelled
- setup-sql-db.ps1: Server=.\SQLEXPRESS default, dung Invoke-Sqlcmd (SqlServer PS module) voi credential + TrustServerCertificate
- appsettings.Production.json.example: Server=.\SQLEXPRESS (voi escaped backslash JSON)
- DB_CONNECTION Gitea secret da update (qua API)

VPS Windows Server 2022 minimal, co VIETREPORT da chay 4 site, SQL instance SQLEXPRESS.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 14:10:08 +07:00
1b7d8872ab [CLAUDE] Scripts: deploy-all.ps1 one-command gop 4 step
Some checks failed
Deploy SOLUTION_ERP / build-backend (push) Failing after 9s
Deploy SOLUTION_ERP / build-fe-admin (push) Has been cancelled
Deploy SOLUTION_ERP / build-fe-user (push) Has been cancelled
Deploy SOLUTION_ERP / deploy-iis (push) Has been cancelled
- Pre-check prerequisites (admin, sqlcmd, WebAdministration, .NET 10)
- Chay theo thu tu SQL → IIS → appsettings.Production.json (auto write tu template + ACL restrict) → SSL (voi confirm) → Runner
- Idempotent: chay lai khong pha
- -SkipSsl / -SkipRunner flag cho debug
- Summary voi next steps

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 13:49:55 +07:00