Commit Graph

732 Commits

Author SHA1 Message Date
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
ccdcbe79f0 [CLAUDE] Docs: S113 closeout — Supplier import v2 SHIP prod (Run #497) + Mig 64/477 test/gotcha #80
- STATUS/HANDOFF: S113 mega-line + state (Mig 63->64, test 458->477, gotcha 79->80, prod 22->37 NCC, bundle acprMqfB/Ck3BTDdA Run #497)
- gotcha #80: ! null-forgiving tren external-parsed data -> NRE an (build 0/0 khong bat; chi test-before-critical bat)
- ef-core skill: Mig 64 row + pointer-flush (session-start H1 drift, kill recurring latest-Mig class)
- session log 2026-07-12-S113-supplier-import-v2.md

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 19:24:49 +07:00
0efc22364b wal: flush 20260712T1905 2026-07-12 19:05:05 +07:00
5fa11b588a [CLAUDE] Supplier: import v2 — Mig 64 publish/draft + dedup-MST + template + file mẫu
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m14s
- Mig 64 AddSupplierPublishState: +IsPublic (draft/public); backfill 22 prod->public; filtered-unique doi [Code]<>'' (cho phep nhieu nhap Code=''); no new table (89).
- Import v2: dedup MST-primary + Code-backstop (chong 500 unique-violation); re-bake 30 token header THAT byte-exact (LayoutValid khop file that); nhap Ma NCC per-row (=Code); thieu Ma NCC->nhap (IsPublic=false); MST thieu->canh bao mem (MstMissing).
- PublishSupplierCommand rieng (ne #73 clobber); GET /suppliers/import/template (BE-gen xlsx 30-col).
- FE 2-app SHA-mirror: badge Public/Nhap; nut Cong bo; filter; nut Tai file mau; cot Ma editable; canh bao MST. Picker PE + tao HD loc published=true (an nhap -> ma HD khong dinh Code rong). CreateSupplier set IsPublic=true.
- authz D3: import/preview/confirm/template/publish = Policy Suppliers.Update (khop FE PermissionGuard, het 403).
- Tests +19 (477 PASS): dedup T1-T7, publish-guard, list-filter, all-or-nothing, LayoutValid. Fix null-Code NRE (path R4 loi).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 19:03:37 +07:00
41f29acf68 wal: flush 20260712T1900 2026-07-12 19:00:31 +07:00
d53145cb27 wal: flush 20260712T1845 2026-07-12 18:45:36 +07:00
58f1c5fdbc wal: flush 20260712T1824 2026-07-12 18:24:13 +07:00
461be04bc4 wal: flush 20260712T1812 2026-07-12 18:12:03 +07:00
b5bc030e6b wal: flush 20260712T1757 2026-07-12 17:57:45 +07:00
b942e52226 wal: flush 20260712T1732 2026-07-12 17:32:50 +07:00
2b54293679 wal: flush 20260712T1711 2026-07-12 17:11:07 +07:00
8fa2fcccb2 [CLAUDE] Docs: S112 session-end — Tests canonical 440→458 + In-Progress S112 + bundle live-pointer hoist #496 (Cixlt_MA/BhBOG1dn) + measured 21K→55K reconcile [H1 flags] + investigator-codebase fable-clone harvest + close-review run.md synthesis [H2 gate]
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 16:51:21 +07:00
f8376cfcf4 wal: flush 20260712T1646 2026-07-12 16:46:06 +07:00
58b20ea441 wal: flush 20260712T1634 2026-07-12 16:34:04 +07:00
0d912ad184 [CLAUDE] Docs: S112 closeout — Supplier-import + PE-signoff SHIP prod (Run #496 PASS) + harness_floor 30K→100K/measured→55K + 3 fable-clone run-trace + 12-agent diary harvest + session log
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 16:32:37 +07:00
8cd2d82ded wal: flush 20260712T1626 2026-07-12 16:26:03 +07:00
be9476da6d wal: flush 20260712T1615 2026-07-12 16:15:44 +07:00
e100ef065b [CLAUDE] Supplier: Excel-import Phase B (upload NCC preview/confirm) + Mig 63
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m25s
Import Excel 'Database NCC': upload→preview classify (New/Update/Skip/Error)→confirm all-or-nothing upsert-by-Code (OrdinalIgnoreCase dedup, fill-nulls-safe). Mig 63 +SourceUpdatedAt/By (2 nullable). Parser layout-locked header-fingerprint NFC-normalized + absolute-cell-index + #REF!-null + NAS-backslash-raw. Type-lạ→NhaCungCap. FE dialog fe-admin+fe-user byte-identical. 10 test SupplierExcelImportServiceTests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 16:13:46 +07:00