Files
solution-erp/.claude/WAL.md
pqhuy1987 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

23 lines
3.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# WAL — auto-generated, không sửa tay
updated: 2026-07-15T11:32 | session: S120 | branch: main
goal: Adap 6 broadcast AI_INFRA (H23 · H24 · H22-wal-defect 5-sàn · H22-push-guard · EOL/CRLF · owner-sign). Spec v3 CHỐT (GO-WITH-FIXES · fix#8 anh ký · gate-blocker=0). Phiên này = CHẠY WAVE W0→W6. Đọc v2 làm thân + v3-PATCH thay-thế; v1 CẤM CHẠY.
chain:
[x] S119 điều-tra: check-email → invest 5-lane → spec v1 → review 4-lane → fable-real gate → v3-PATCH → anh ký fix#8 → commit-chốt 4727d16 ĐÃ PUSH (7 broadcast + 14 file run-folder now TRACKED)
[x] S120 /tiep reconcile: ground-truth thắng WAL 3 chỗ (xem GT bên dưới) + vá v3-GAP → FIX #3-bis ghi vào v3-PATCH (4 ca, test ĐÁY range)
[!] W0 SOLO — W0.0 re-measure [đo 11:30: K=0 NONWAL=0 porcelain=0] → W0.1 gitattributes → W0.2 scoped-only → W0.3 [4-ca] reset--soft + hook-interlock + commit-chốt CÙNG 1 TURN → W0.4 README:52 → W0.5 git-log-%cI → W0.6 spawn-probe CRLF + RESTART
[ ] W1 (3 lane) + W1b spawn-model-audit.ps1 → W2 GỘP-1-COMMIT (hmw.js 5 hạng-mục + 4 cờ wrapper + 2 agent MỚI + h24_cadence + .session-counter + STATUS Sub-agents 12→14 + row Policies) + RESTART
[ ] W3 SERIAL 5 file (tiep §0 → session-start → session-end → fable-clone → agents/README) → W4 detector-fire (PHẢI in permission-matrix/SKILL.md TRƯỚC vá) → W5 harness-11-engine
[ ] W6 push (🔴 squash→count→push CHAINED 1 LƯỢT; K tính runtime, CẤM hardcode) → adap-report ×4 + adap-request R1-R4 + send-email AI_INFRA + stamp-mark
🔴 GT (ground-truth S120 @/tiep — 3 chỗ WAL S119 đã STALE, ĐÃ reconcile):
(1) "7 broadcast UNTRACKED cố ý → GỘP vào commit-chốt W0.3" = XONG RỒI ở 4727d16 (commit+push). W0.3 KHÔNG còn việc gộp.
(2) "K trôi 10→11" = squash+push đã chạy 11:20:29 → K=0, range RỖNG, git status sạch tuyệt-đối.
(3) fix#8 tick mâu-thuẫn (dòng 13 `[ ]` vs 17 `[x]`) → owner-decisions §ACK xác nhận ĐÃ KÝ → gate-blocker=0.
🔴 v3-GAP ĐÃ VÁ (FIX #3-bis trong v3-PATCH): v2:92 rẽ nhánh bằng `NONWAL==0` = SAI THỨ; đúng = test ĐÁY range. 4 ca: (0) K=0 RỖNG → NO-OP commit thẳng [ca MỚI, v3 không liệt] · (1) đáy=wal: & NONWAL=0 · (2) đáy=wal: & NONWAL>0 → (1)+(2) CÙNG xử-lý reset--soft origin/main, CẤM rebase · (3) đáy=commit-thường → rebase+fixup OK.
🔴 Hook wal-flush.ps1:7 phủ ĐÚNG 3 path (.claude/WAL.md · agent-memory/ · workflows/runs/) — KHÔNG phủ broadcasts/ · KHÔNG phủ .gitattributes/scripts/docs. ⇒ MỖI lần ghi WAL = +1 `wal:` ở ĐÁY range ⇒ W0.3 PHẢI re-đo NGAY trước reset (K=0 lúc 11:30 là ảnh-chụp, KHÔNG phải hằng-số).
🔴 RESTART ×2 (W0.6 + post-W2) ⇒ wave trải ≥3 phiên CLI ⇒ nối bằng /tiep (fix #9j).
next: W0.1 `.gitattributes` (+`* text=auto eol=lf` + khai binary THẬT, GIỮ 2 rule cũ broadcasts/**+*.sh; CẤM vá theo đuôi-file-vừa-cắn) → W0.2 scoped-only (CẤM mass rm+checkout 188) → W0.3 [4-ca + interlock + commit-chốt CÙNG TURN] → W0.4 → W0.5 → W0.6 RESTART
verify: K=$(git rev-list --count origin/main..HEAD) ; NONWAL=$(git log --format='%s' origin/main..HEAD | grep -vc '^wal:') ; git log --format='%s' origin/main..HEAD | tail -1 [đáy range → quyết ca 0/1/2/3] ; git check-attr text eol -- .claude/agents/reviewer.md [W0.1 → text:auto eol:lf] ; ls .git/rebase-merge [PHẢI absent]