Commit Graph

749 Commits

Author SHA1 Message Date
38bbcad416 wal: flush 20260715T1245 2026-07-15 12:45:00 +07:00
826510ba28 wal: flush 20260715T1215 2026-07-15 12:15:56 +07:00
c5c68de3bb [CLAUDE] Docs: W0.6 setup - them probe LF lam NHOM CHUNG (lech spec co chu-dich) + WAL cho restart
W0.6 = bao-dam falsifiable DUY NHAT cua ca wave (broadcast 4(d): "moi kiem static-text deu
KHONG falsifiable; chi spawn-probe / assert-registry moi that-su chung-minh").

LECH SPEC CO CHU-DICH - spec v2 W0.6 chi dung 1 probe (CRLF) -> RESTART -> spawn. LO: neu spawn
FAIL, quan-sat do KHONG phan-biet duoc 2 gia-thuyet: "reader LF-only nen chet" vs "registry chua
nap file moi". Mot quan-sat, hai gia-thuyet => vo-nghia.
VA: dung them _lf-probe.md GIONG HET, khac DUNG 1 BIEN = line-ending.
  CRLF ok + LF ok  -> CRLF-tolerant (khoi restart)
  CRLF x  + LF ok  -> CRLF-fatal CHAC-CHAN (LF chung-minh hot-reload CO chay)
  CRLF x  + LF x   -> hot-reload KHONG chay -> chi nhanh nay moi can RESTART

Kiem bien don (soi byte, khong tin sed): _crlf-probe CR=276 LF=276 ; _lf-probe CR=0 LF=276 ;
od -c xac nhan "-  -  -  \r  \n  n  a  m  e  :  _  c  r  l  f  -  p  r  o  b  e  \r  \n" ;
diff <(bo CR, bo dong name:) 2 file -> GIONG HET => bien duy-nhat = line-ending.

LUOT-1 (TRUOC restart) = nhanh 3: CA 2 probe not-found. Available list = 19 sub + plugin co
tu dau phien, khong co probe nao.
>>> NHOM CHUNG CUU 1 KET-LUAN SAI: _lf-probe THUAN LF (0 byte CR) cung chet y het => nguyen-nhan
KHONG PHAI CRLF. Neu lam dung spec (1 probe), lead se thay _crlf-probe chet va rat de ket-luan
"CRLF-fatal" - SAI, va sai THEO HUONG CO LOI cho cau chuyen (xac nhan L3 + giu R4 nac manh).

DO DUOC (moi, S120): registry agent = ANH-CHUP luc khoi phien; KHONG hot-reload agent file MOI.
Doi-chieu memory project_harness4_two_tier_model: ghi "agent file MOI = hot-reload OK" (verified
S107) KEM canh-bao ENV-DEPENDENT (hub ra ket-qua NGUOC S110). S120 do KHONG hot-reload => canh-bao
ENV-DEP xac-nhan lan nua, lan nay ngay trong repo SE. Cau "nghi ngo -> restart" cua memory = DUNG.
=> de-nghi thu hep memory o session-end: "hot-reload agent-file-moi = ENV-DEP, SE do KHONG an @S120".

2 probe = UNTRACKED CO Y. CAM `git add` - `.gitattributes` `* text=auto eol=lf` se NORMALIZE
mat CR = giet thi-nghiem. Hook khong phu .claude/agents/ nen khong tu commit.

WAL: ghim 3 buoc sau restart (LF TRUOC -> CRLF sau -> xoa 2 probe), + verify lenh kiem 276 CR
con nguyen. Day range hien = commit thuong 92de58f => moi wal: sinh sau roi ca(3) an-toan @W6.

0 prod-code, 0 migration, 0 FE, 0 test-change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 11:52:01 +07:00
48e0d26ee9 [CLAUDE] Docs: W0.4 go claim STALE bypass-surface + W0.5 baseline orphan (git %cI, KHONG mtime)
W0.4 workflows/README.md - go claim STALE dang CHE San-1:
- Ban cu tuyen SE "tailored-out" khoi lop anti-bypass detector + coi mat-lach gan-nhu-khong-co.
  BI BAC x3 BANG SU-KIEN (khong phai ly-le):
  (i)  S72 RECURRED: chay REVIEW qua raw Workflow tool -> khong inject writeGuard -> reviewer
       tu ghi MEMORY +2850B over-cap -> git-status bat @session-end + revert. Nguyen-van
       feedback_harness10_run_trace.md:20 "dung RAW Workflow tool = MAT governance project-wrapper".
  (ii) S118 raw-Agent 7-spawn -> 0 run-folder (viec rot khoi so).
  (iii) CHINH run S119 di raw Workflow tool.
- Ban moi khai 3 DUONG phong, chi 1 gate duoc: /ultra-on->hmw.js (gate) | raw Workflow (KHONG)
  | raw Agent (KHONG). + khai KE CON-LAI: lach o SE KHONG can CLI-launcher, goi thang tool
  harness la xong => 3 nguyen-tac detector (whitelist launcher / path-variant / anchor launch-key)
  N/A VI KHONG CO LAUNCHER DE WHITELIST, khong phai vi "khong co ke". Containment THAT =
  em-main single-writer + git-diff + chunk-count = PHAT-HIEN-SAU, KHONG NGAN-CHAN-TRUOC (G-015).
- Neu de nguyen claim cu: co "tailored-out" se (sai) bien-minh cho viec skip luon San-1 (F2 v1).

W0.5 baseline orphan - FIX #4 (bo mtime, dung git log %cI):
- Moc closeout cuoi = 3fde8af @ 2026-07-14T16:29:55+07.
- 3 phep do doi chung: naive(chi flat)=13 | dual-accept(+harvest/)=8 | dual+scoped(%cI>moc)=1={S119}.
- Khop CHINH XAC du-bao FIX #4 (13 / 8 / {S119}). Chenh 13-8 = 5 folder S71 h10/h910 dung
  harvest/<stage>-synthesis.md -> KHONG duoc flag (C8 README:19). Chenh 8-1 = 7 ton-dong cu
  -> loai bang SCOPE, KHONG tao *-synthesis.md gia (Goodhart, R3 flag).
- {S119} bi flag la DUNG: run chua dong, se dong o W6 khi co synthesis that.
- REGRESSED da va: v2 chot scope theo mtime; Dropbox resync GHI DE mtime => khong ben (R3-m5).

W0-evidence-15-07-2026.md - capture stdout THAT vao run-folder (fix #9c: bang-chung
time-anchored thay "reviewer chung-kien" lam neo duy-nhat). Gom: ground-truth /tiep 3 cho stale
+ W0.0-W0.5 so do + 2 fault-inject + nac trung-thuc.

2 LOI LEAD TU MAC o W0.4 (ghi vao evidence, di nguyen vao adap-report, KHONG im):
1. Gate tu-tham-chieu: lead trich NGUYEN-VAN claim cu lam bang-chung -> grep bat trung chinh
   cau trich -> FAIL tren ban sua DUNG. Roi lead viet LITERAL mau regex cua gate vao ghi-chu
   -> mau tu khop chinh no -> FAIL lan 2. => gate grep-chuoi chay tren chinh file no kiem =
   TU-THAM-CHIEU, can neo bang dau-hieu khac. Cung ho R2-C1.
2. Meta-count tai-pham: bang tong-ket cua lead IN SAN chu "PASS" trong khi phep do ngay canh
   tra "1 hit" = FAIL. Dung lop v3 §Nac-trung-thuc "lead DO tot; lead DEM VE CHINH MINH thi sai".
   => pass/fail phai TINH tu so do, cam in nhan cung. Da ap dung o lan do lai.

0 prod-code, 0 migration, 0 FE, 0 test-change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 11:48:24 +07:00
92de58f329 [CLAUDE] Infra: W0 pre-flight - gitattributes EOL san-chung + hook rebase-interlock + FIX #3-bis 4-ca
W0.1 .gitattributes theo CLASS (khong va theo duoi-file-vua-can):
- `* text=auto eol=lf` = san chung. core.autocrlf=true @system lat LF->CRLF luc checkout;
  attr nay ep blob LF + worktree LF, DOC-LAP autocrlf.
- Khai binary TUONG-MINH 13 duoi (zip/exe/dll/docx/xlsx/pptx/pdf/png/jpg/jpeg/ico/woff/woff2)
  thay vi pho-thac heuristic NUL-byte-8000-dau: .docx "gay" co the lot thanh text -> mangle
  OOXML -> hong file KHONG cuu duoc. Do that: repo co 19 binary (12 docx + 6 png + 1 xlsx).
- .svg = XML -> CO Y giu text. Giu 2 rule cu (broadcasts/** + *.sh) tuong-minh.
- Fault-inject chung rule CO RANG: go `*.docx binary` -> git coi .docx la `text: auto` (nguy
  hiem that); khoi phuc -> `text: unset`. 19/19 binary co attr/-text.
- Acceptance PASS: agents/reviewer.md unspecified -> text:auto eol:lf.

W0.2 scoped-only (vacuous, KHAI THAT):
- scope-gate (agents+commands+skills) = 0 DA XANH SAN truoc khi lam gi -> KHONG tinh la thanh-tuu.
- repo-wide 188 (131 Migrations + 57 con lai) = INFORM-only. CAM mass rm+checkout phien nay.
- `git add --renormalize --dry-run .` = 0 file dirty; `git diff --cached --stat` = rong.

W0.3 hook rebase-interlock (anh ky S119 fix#8b = TRONG KHUNG, khong can adap-request):
- wal-flush.ps1: `if (Test-Path .git/rebase-merge -or .git/rebase-apply) { exit 0 }`.
- Dat SAU Set-Location $root, KHONG phai dau file: dat truoc thi Test-Path soi nham CWD.
- Chung RANG 2 CHIEU tren cay tam: (a) khong rebase-state -> hook VAN commit (guard khong
  over-fire, WAL persist con song); (b) co rebase-state -> 0 commit, exit 0, worktree GIU dirty.
- Pure-ASCII giu nguyen (gotcha #30). Do lai bang tr sau khi phat hien `grep -P` false-pass
  (loi locale -> output rong -> wc -l dem 0 = grep CHET, khong phai sach).

FIX #3-bis (MOI, ghi vao v3-PATCH) - dieu-kien re nhanh W0.3 test SAI THU:
- v2:92 re nhanh bang `NONWAL==0`; luat fix#3(c) noi phai test "wal: o DAY range". Hai thu khac nhau.
- Fault-inject 4 cay tam chung diem re o ca2 (shape base|wal:|[CLAUDE], NONWAL=1, day=wal:):
  v2 -> nhanh-B REBASE; v3bis -> reset--soft. Chay that nhanh-B tren ca2: REBASE-EXIT=0 KHONG
  crash, nhung commit gop THUA KE message "wal: flush 1" -> push-guard n=1 -> chan push ->
  re-squash cung logic -> van "wal:" -> STOP VINH VIEN. Deadlock XAC NHAN bang thuc nghiem.
- +ca(0) MOI v2/v3 khong liet: K=0 range RONG (S119 da push 4727d16) -> NO-OP commit thang.
- 4 ca: (0) K=0 NO-OP · (1) day=wal: NONWAL=0 · (2) day=wal: NONWAL>0 -> (1)+(2) CUNG xu-ly
  reset--soft origin/main CAM rebase · (3) day=commit-thuong -> rebase+fixup OK.
- Ca fire hom nay = ca(0). Commit-chot nay dat day range = commit thuong -> moi wal: sinh sau
  deu roi vao ca(3) an-toan. Dung y do fix#3(a).

WAL reconcile (/tiep S120): ground-truth thang WAL 3 cho - (1) 7 broadcast "UNTRACKED co y"
da tracked+pushed trong 4727d16, W0.3 khong con viec gop; (2) "K troi 10->11" -> thuc te K=0
range RONG; (3) fix#8 tick mau-thuan -> owner-decisions xac nhan DA KY, gate-blocker=0.

0 prod-code, 0 migration, 0 FE, 0 test-change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 11:41:33 +07:00
4727d16178 [CLAUDE] Docs: S119 adap 6 broadcast AI_INFRA - dieu tra chieu rong + spec v3 (dung truoc wave)
check-email 6 broadcast moi (H23 model-at-spawn / H24 lead-self-audit / H22 wal-defect-fix
5-san / H22 push-guard / EOL-CRLF agent-registry / owner-sign) - hash 7/7 + tamper 4/4 MATCH.

Pipeline H21: fable-clone invest 5-lane (wf_1f6bd5e2-478, 5/5 clean) -> spec v1 ->
fable-clone reviewer 4-lane (wf_78a84f9b-03e: R2 FAIL 4C+8M, R3 FAIL 5C+6M, R1/R4 chet #53)
-> v2 -> fable-real reviewer cong-cuoi (wf_cb964f83-331: GO-WITH-FIXES + 8 fix + 2 honesty-C)
-> v3 (STILL-BROKEN = 0). Anh chot B: dung tai spec, wave chay phien sau qua /tiep.

Do that: 57 wal: da lot origin/main (hub do duoc 1 -> SE = 57x); nguyen nhan KHONG phai
turn-seam ma la session-end.md:113 SE tu viet "kep sau -> GIU NGUYEN". K troi 3->10/buoi.
v1 SE GAY MAT VIEC (R3 fault-inject: NONWAL=0 -> 0 commit de fixup -> detached HEAD ->
hook fail-open -> abort -> mat worktree = E-029 bang cua sau).

Owner 6 chot: nguyen-tac moi (vuot-khung = request anh + AI_INFRA) / PA-2 = PA-2a hang-so +
PA-2b audit / 6-15-3 / [carry:slug] / KHONG don 57 / fix#8 (a)(b).

0 prod-code, 0 migration, 0 FE. Test 509 giu nguyen (45D + 464I).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 11:20:29 +07:00
3fde8afb93 [CLAUDE] Docs: S118 closeout - STATUS/HANDOFF/session-log + memory reconcile (509 test / gotcha 82)
Session S118: phan quyen PRO tra.bui (Procurement exception to S92 revoke) + va lo hong
ReportsController authz. 2 prod deploy #388/#389 verified; 3 code/docs commit da push
(e88e75d docs-reconcile + c2135ba PRO-perm-seeder + c808b9a Reports-authz).

Closeout (docs/memory-only -> CI-skip per paths-ignore):
- STATUS: S118 mega-line blurb + canonical rows Tests 501->509 + Gotchas 81->82
  (governance-detector [OK] canonical matches disk 509/82).
- HANDOFF: S118 brief + NEXT anh (tra.bui re-login · binh.le decision · account-trung Le-Thanh-Binh)
  + lessons (wipe-durability / menu-flag!=API / verify-lane-garble-recover / Serilog-durability-proof).
- Session log 2026-07-14-S118-perm-pro-tra-bui-reports-authz.md.
- User memory: +feedback_permission_grant_two_layers (menu-flag grant != API-power, 2-layer verify);
  garble-recover x18->x20 (cicd VERIFY-lane x2 -> em-main-solo curl+sqlcmd).
- Agent-memory: cicd fidelity-fix (harvest-curator F1: false "CLEAN-return" label -> garble+recover,
  substance disk-verified TRUE) + tooling-auditor/harvest-curator @end diaries (H1/H2 gate PASS 5-truc).
- H22 §5.0: fold 2 trailing wal: flush commits (670c888 + e5f655f) into this closeout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 16:29:55 +07:00
c808b9ad81 [CLAUDE] Auth: gate ReportsController tai-chinh HD behind Reports.Read policy (reviewer S118)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m34s
Lo hong (reviewer S118 phat hien khi phan quyen PRO tra.bui): ReportsController chi co
[Authorize] tran (khong policy) -> MOI user dang nhap goi duoc GET /reports/dashboard (tong gia
tri HD dang chay, top NCC/du an theo gia tri, xu huong 12 thang) + GET /reports/contracts/export
(xuat toan bo HD ra Excel). Nguoc quyet dinh S92 "HD chi Admin thay" (menu an nhung API van mo,
go URL/API truc tiep lay duoc).

Fix (owner chot: chi Admin qua Reports.Read policy -- linh hoat mo role khac qua ma tran sau):
- Dashboard() + ExportContracts() -> them [Authorize(Policy = "Reports.Read")] per-method. Hien
  chi Admin co Reports.Read -> non-admin 403. Admin bypass moi policy nhu cu.
- MyDashboard() GIU MO (chi [Authorize] class-level) -- scope theo currentUser, moi user chi thay
  so cua CHINH MINH (draft/pending/SLA/gia tri draft cua minh), khong lo toan cong ty.

Test: +4 reflection authz regression (AuthorizePolicyRegressionTests, mirror gotcha #44 S45):
dashboard/export co Reports.Read; my-dashboard KHONG co action-policy (guard chong ai khoa nham
dashboard ca nhan). 505 -> 509. Gotcha #82 (menu-flag grant != quyen API that).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 15:55:18 +07:00
1491d29b10 wal: flush 20260714T1549 2026-07-14 15:49:59 +07:00
b7f7b56860 wal: flush 20260714T1531 2026-07-14 15:31:47 +07:00
c2135bae2b [CLAUDE] Auth: PRO role giu quyen Master/NCC qua deploy (seeder chay-sau-revoke) + scope-isolation test
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m33s
Van de (UAT anh Kiet FDC, S118): user tra.bui (Bui Le Thuy Tra, Procurement TP) dang nhap khong
thay menu quan ly NCC/Suppliers. Nguyen nhan: seeder S92 RevokeTemporarilyHiddenModulesAsync (chay
moi startup) set CanRead=false cho Master/Suppliers/Projects/Departments/Catalog* voi moi role
non-Admin ("chi Admin thay").

Fix (owner chot mo ngoai-le CHI role Procurement, ben qua deploy):
- Them SeedProcurementMasterAccessAsync chay NGAY SAU revoke de THANG (mirror pattern Hrm S65 /
  Office S69). Chi dung role Procurement -- S92 "chi Admin thay" GIU NGUYEN cho moi role khac.
- Grant 9 key: Suppliers (R+C+U -- quan ly + cong bo NCC, S113 publish can Suppliers.Update);
  Master/Projects/Departments/Catalogs + 4 Catalog leaf (Read-only). KHONG Delete.
- Dashboard/Reports CO Y KHONG cap (reviewer bat: Reports lo tong gia tri HD + top NCC/du an theo
  gia tri, nguoc S92; owner chot bo).
- Upgrade-only idempotent: nang co desired len true, khong ha co, khong dung role khac.

Test: +4 regression scope-isolation (ProcurementMasterAccessSeedTests) -- Procurement duoc nang
dung ma tran, role khac (DeptManager rieng) VAN bi revoke. 501 -> 505.

Reviewer PASS (scope cach-ly sach, no over-grant). Grant tam da ap prod (tra.bui verified 20 menu);
deploy nay = ban ben. Follow-up: gate ReportsController thieu policy (task rieng).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 15:29:44 +07:00
b56659b6b7 wal: flush 20260714T1519 2026-07-14 15:19:32 +07:00
e88e75d8f8 [CLAUDE] Docs: S118 bootstrap monitor-gate reconcile - CLAUDE.md mig-col + skills/README ef-core S117
H1 tooling-auditor @session-start flagged 2 LOW derived-doc staleness (ton-dong S113-S117, khong phai drift S117-moi):
- CLAUDE.md module-table Migration column: PE row +65,66 (multi-NCC per-hang-muc Mig 65 S114 gotcha #81 + duyet-khoang Min-Max Mig 66 S117); Master row +48,51,62-64 (Project fields Mig 48 / Department.ParentId Mig 51 / Supplier expand-import-publish Mig 62-64)
- .claude/skills/README.md ef-core-migration status-cell: Updated S113 -> S117 (Mig 66 AddPeApprovedPriceRange row)

Derived-flush (B1 pointer discipline) - canonical so van o docs/STATUS.md, day chi la enumeration lag o doc dan-xuat. Mig-column = ung vien B1-hoa cho monthly re-tier.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 13:57:16 +07:00
b6b7c03cba wal: flush 20260714T1351 2026-07-14 13:51:36 +07:00
5c7569ed7f wal: flush 20260714T1156 2026-07-14 11:56:15 +07:00
1b8b065cab [CLAUDE] Docs: S117 monitor-gate reconcile (H1 ef-core range + H2 diary nits)
H1 tooling-auditor: ef-core SKILL §16+ pending-range 27-64/27-61 → 27-66 (internal
consistency; 2 STALE-rows Tests/bundle đã fix ở d08f2a3).
H2 harvest-curator PASS 5/5: 3 benign diary-reconcile (0 data-loss) —
inv-cb S118→S117 (mis-tag header+tag, task-2 của S117) · test-spec baseline
500→501 (+1 em-main-solo luyke fix nó không đếm) · cicd S117 garble→resume
self-record (was under-reported "×3 clean").

Docs/.claude-only → CI-skip.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 11:55:28 +07:00
d08f2a3697 [CLAUDE] Docs: S117 STATUS canonical-row reconcile (Mig 66 · 501 test · bundle)
Detector bắt HIGH: mega-line đã có S117 nhưng canonical state-table rows chưa.
Fix: Migrations 65→66 (+Mig 66 AddPeApprovedPriceRange entry) · Tests 495→501
(+S117 +6 detail) · Bundle live admin cFI7ih4a/user MxgooVZw (demote S116) ·
+In Progress (S117) section. Detector re-run: 0 HIGH, canonical==disk MATCH.

Docs-only → CI-skip.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 11:47:50 +07:00
fc1b8d9642 [CLAUDE] Docs: S117 closeout — PE lũy-kế display-fix + duyệt theo khoảng Min–Max
STATUS + HANDOFF mega-line: prepend S117 (Mig 66 · 89 bảng · 501 test · bundle
cFI7ih4a/MxgooVZw · prod 37 NCC/17 user), demote S116 → Prev. ef-core-migration
SKILL +row Mig 66 AddPeApprovedPriceRange + range 51-66. Session log
2026-07-14-S117-pe-luyke-display-minmax-range.md (2 feature + /fable-real process
+ #53-garble ×2 recover + lessons).

Docs-only → CI-skip (path-filter #41). Feature code đã ship `316a82f` Run #387.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 11:39:08 +07:00
b128f30a35 wal: flush 20260714T1129 2026-07-14 11:29:32 +07:00
a19d6eab37 wal: flush 20260714T1115 2026-07-14 11:15:31 +07:00
316a82f96d [CLAUDE] PurchaseEvaluation: endsBeforeCeo pointer-aware + duyệt theo khoảng Min–Max (Mig 66)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m26s
Hai chỉnh từ buổi UAT anh Kiệt FDC (S117):

1) Fix hiển thị lũy kế "duyệt rồi không bắt" — root cause là DISPLAY-LIE, không phải
   lũy kế bug. endsBeforeCeo cho phiếu CHƯA DaDuyet nay POINTER-AWARE: chỉ báo "kết
   thúc trước CEO" khi con-trỏ còn ở/trước cấp finalize. Phiếu đã đi QUA cấp finalize
   (approver bỏ tick "Cấp này KẾT THÚC" → trình tiếp CEO) → false: sơ đồ hết làm mờ
   Bước CEO + hết nói dối "Kết thúc tại Cấp X" khi phiếu đang chờ CEO. 3 site (detail
   in-memory + list/inbox EF-subquery). Filter lũy kế GIỮ nguyên (đúng nguyên tắc
   "duyệt rồi mới bắc"). BE-only — FE là consumer thuần nên tự render đúng.

2) Feature "duyệt theo KHOẢNG Min–Max": khi PRO có cả Min & Max, người duyệt cấp cuối
   chọn CẢ HAI (radio "PRO — cả Min và Max", source=ProMinMax) → Min ở ApprovedPriceAmount
   + Max ở ApprovedPriceMaxAmount (Mig 66 AddColumn nullable, no backfill, phiếu cũ
   nguyên vẹn). Bất-biến Max⟺ProMinMax, Min≤Max (guard ở service + validator). HĐ.GiaTri
   KHÔNG đọc giá chốt (= SUM báo giá NCC được chọn) → range thuần record-of-decision
   hiển thị, 0 tác động HĐ. FE 2-app SHA-mirror (Panel + DetailTabs).

Test 495 → 501 (+1 pointer-aware repro, +5 ProMinMax). Cả 2 điều tra qua /fable-real
engine-đắt (investigator-codebase deep-pass) theo yêu cầu anh Kiệt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 11:14:09 +07:00
6f1f8aa898 wal: flush 20260714T1105 2026-07-14 11:05:09 +07:00
625169dce8 wal: flush 20260714T1100 2026-07-14 11:00:09 +07:00
940db93309 wal: flush 20260714T1033 2026-07-14 10:33:18 +07:00
5f046eafb3 wal: flush 20260713T1741 2026-07-13 17:41:28 +07:00
73f2939d8b [CLAUDE] Docs: S116 closeout — PE negative-quote (STATUS/HANDOFF/session-log + harvest)
- STATUS/HANDOFF prepend S116 (test 486->495 · bundle Dd55jBpj/DVDr1UQ4) + fix
  D1 Tests-row (486->495, 441->450 Infra) + D2 bundle-live-pointer (tooling-auditor
  caught 2 derived-summary lags below the mega-line).
- Session log 2026-07-13-S116-pe-negative-quote.md.
- Harvest: investigator-codebase on-behalf S116 (invest lanes RETURN-only) +
  reviewer/impl-fe/impl-be/test/cicd self-written · monitor diaries (harvest-curator
  self-compact moved-not-cut + tooling-auditor archive-move).
- §5.0 squash 2 wal-trailing (dfa1c8c/0edbc58, post-feature Stop-hook flush) folded here.
- Feature already shipped 88368fd (Run 386 PASS 5m28s); this commit = docs/memory/run-trace
  only -> CI skip (paths-ignore #41).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 17:40:27 +07:00
88368fd87e [CLAUDE] PurchaseEvaluation: cho nhập giá ÂM ô báo giá hạng mục + submit-guard all-zero (S116)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m28s
Feature (anh Kiệt FDC ⇄ Duy Nguyen 2026-07-13): cho nhập SỐ ÂM ô "Số tiền báo giá
cho hạng mục" (Quote.ThanhTien) — âm = phát-sinh-giảm / hoàn-tiền của NCC = giá THẬT.
Nguyên-tắc "có giá là được": ≥1 giá thật (âm/dương) → gửi được; chỉ chưa-nhập-gì mới chặn.

FE (2 app byte-identical PeDetailTabs.tsx):
- Nút ± toggle 2 input quote (AddSupplierDialog + QuoteDialog), ghi giá-CÓ-DẤU thẳng vào
  form.thanhTien (2 dialog POST commit trực tiếp, không nút Lưu riêng → tránh mất-dấu thầm lặng).
- Submit gate + toast >0 → !==0. Ô ngân sách giữ ≥0 (không toggle).
- 2 FE submit-mirror (:201 missingForApproval + :235 submitChecklist) đổi từ SUM
  computeGiaChaoThau → helper hasRealSelectedQuote (iterate details[].quotes IsSelected≠0;
  SUM không phân-biệt all-zero vs net-zero).

BE (1 điều-kiện): PurchaseEvaluationWorkflowService.cs:206 selectedThanhTien.Sum()<=0
  → All(x=>x==0) — chặn chỉ khi TẤT CẢ selected=0. BE+DB nhận âm sẵn (0 validator,
  decimal(18,2), no CHECK, KHÔNG migration).

Owner-decisions: R1 cho Contract.GiaTri âm (no clamp) · R2 nới submit-guard · R-CEO
  giữ NET threshold (dòng âm có thể kéo dưới ngưỡng → CCM finalize, owner chấp nhận).

Tests +9 (486→495): ngân-sách-bất-biến · winnerQuoteTotal signed-sum · submit-guard
  all-zero/negative/net-zero · CCM-threshold net.

Pipeline S116: /fable-clone invest (4-lane) → owner-gate → /fable-clone review (3-lane)
  → /fable-real (Fable, #53 garble → em-main-solo gate GO-WITH-FIXES) → hmw implement (Opus MAX).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 17:08:34 +07:00
2ef3f445bf wal: flush 20260713T1702 2026-07-13 17:02:40 +07:00
d3fa073c0c wal: flush 20260713T1637 2026-07-13 16:37:04 +07:00
e5f3c5d70a wal: flush 20260713T1622 2026-07-13 16:22:29 +07:00
3abc8a0950 wal: flush 20260713T1612 2026-07-13 16:12:58 +07:00
7676718cbe wal: flush 20260713T1611 2026-07-13 16:11:50 +07:00
6356def8c0 wal: flush 20260713T1605 2026-07-13 16:05:44 +07:00
5dc29cd23f wal: flush 20260713T1546 2026-07-13 15:46:31 +07:00
c66dab7ee3 [CLAUDE] Docs: broadcast SE->AI_INFRA H-22 WAL restart runtime-verify report
Runtime-verify H-22 WAL session-continuity qua restart may that (S116):
/tiep no-op-detect + /session-end no-op-closeout PASS. Reviewer-gated
(return-garble #53 recovered via SendMessage-resume). Honest caveat:
WAL rong -> chi verify persist-file + no-op + idempotent, CHUA content-recovery.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 14:04:37 +07:00
078396d3a0 wal: flush 20260713T1401 2026-07-13 14:01:30 +07:00
88bd8e666d [CLAUDE] Docs: S115 presence-not-age adopt closeout (STATUS/HANDOFF/session-log/synthesis/WAL)
Session-end closeout for S115 (AI_INFRA presence-not-age selector guardrail +
rec-3 hmw.js STOP-HARD, shipped 81b59f0, CI #385 PASS). STATUS + HANDOFF
mega-line blurb, session-log, ensemble-synthesis (closes H10/HCV gate), WAL
reset to clean template. No canonical-count change (Mig 65 / 89 tables / 486
tests / gotcha 81). Owner backfill target 210K + reviewer/cicd harvest already
in 81b59f0. §5.0 squashed the trailing wal: flush.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 13:01:14 +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
de3536d47e wal: flush 20260713T0950 2026-07-13 09:50:21 +07:00
66bd127cd3 wal: flush 20260712T2347 2026-07-12 23:47:05 +07:00
16a199f031 [CLAUDE] Docs: S114 PE multi-NCC per hạng mục closeout (STATUS/HANDOFF/gotcha #81/Mig 65/session-log)
Closeout feature multi-NCC per hạng mục (ship d436af2):
- STATUS/HANDOFF: S114 blurb + CURRENT STATE canonical Mig 64→65 · test 477→486 · gotcha 80→81 · bundle D51OYyGV/BVdssm5S.
- gotcha #81: derived-invariant re-derive sót DELETE writer (DeleteQuote/DeleteDetail) → IsWinner kẹt stale → HĐ giaTri=0 phantom (Bước 4 fable-clone verify bắt; fix helper PeWinnerInvariant test-before).
- ef-core skill: +Mig 65 BackfillPeQuoteIsSelectedAndWinnerInvariant row.
- session log 2026-07-12-S114 + 2 reviewer diary harvest (verify run) + run-trace fold.
- cicd on-behalf record (garble #53 ×5 → em-main-solo deploy verify).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 23:45:08 +07:00
d436af2971 [CLAUDE] PurchaseEvaluation: multi-NCC per hạng mục — chọn ≥2 NCC-TP trúng thầu/1 hạng mục (mỗi nhà 1 giá riêng)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m17s
Đổi winner-truth từ whole-supplier Supplier.IsWinner (Mig 58 liên-danh) sang per-hạng-mục
Quote.IsSelected (Mig 12 dormant hook → nay nguồn-sự-thật); Supplier.IsWinner = DERIVED (== Any IsSelected).
Anh Kiệt LOCKED D1=SUM(IsSelected) · D2=THAY-THẾ · D3=giá-chào-gốc · D4=1HĐ/NCC. 0 bảng/cột mới.

BE:
- SelectWinnerCommand + POST /select-winner: body {supplierIds} → {detailId, supplierIds} (per hạng mục).
- Re-key 5 financial-SUM → WHERE IsSelected: winnerQuoteTotal, submit-guard, CCM-threshold, giaTri, budget-B.
- giaTri bỏ shortcut isSingle→detailsSum (single đổi budget→bid theo D4).
- Derive IsWinner invariant ở MỌI writer: SelectWinner + UpsertQuote + seed + DeleteQuote/DeleteDetail (helper PeWinnerInvariant, fix Bước 4).
- GIỮ IsWinner-derived cho winner-names/existence + CreateContract winners-list.
- Migration BackfillPeQuoteIsSelectedAndWinnerInvariant (data-only 2-chiều IsWinner↔IsSelected, Down no-op).

FE 2-app (PeDetailTabs SHA-identical): HangMucCard per-cell winner grid Detail×NCC + toggle per-detail; NccSelectorRow hạ-cấp read-only summary; giữ derived display.

Test: 7 file update + 8 test mới (per-hạng-mục total, giaTri single-partial, threshold-crossing, derive-invariant, delete-path). 486 PASS.

Flow: fable-clone invest ensemble → anh Kiệt 4-decision → fable-clone review ensemble (6 adjustment) → hmw implement (disk-recover #53) → fable-clone verify (bắt MUST bug delete-path → fix test-before).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 22:22:09 +07:00
8a1b0d4901 wal: flush 20260712T2156 2026-07-12 21:56:29 +07:00
44ba05e5cf wal: flush 20260712T2132 2026-07-12 21:32:24 +07:00
53e8d1689d wal: flush 20260712T2114 2026-07-12 21:14:52 +07:00
e05763f46c wal: flush 20260712T2045 2026-07-12 20:45:57 +07:00
c20fa5f3a0 wal: flush 20260712T2026 2026-07-12 20:26:38 +07:00
aa655cb412 wal: flush 20260712T2009 2026-07-12 20:09:13 +07:00
a3e9e14219 wal: flush 20260712T1939 2026-07-12 19:39:33 +07:00
8304d081f3 wal: flush 20260712T1926 2026-07-12 19:26:19 +07:00