--- name: h22-wal-session-continuity description: H22 WAL adopted S111 — sổ mạch-việc + Stop-hook persist VERIFIED-RUNTIME (hot-reload env-dependent) + /pause·/tiep + squash wal:; pilot kill-test/đổi-acc pending metadata: node_type: memory type: project originSessionId: 5337f05f-50e4-42e8-bf54-2f9bfa9a32da modified: 2026-07-22T15:43:25.999Z --- **H22 WAL session-continuity — ADOPTED S111 (2026-07-12), mark `RC-pqhuy1987-12-07-2026-11-43-45` (AH thứ 6).** Sổ `.claude/WAL.md` ≤40 dòng ghi-đè (chain-bằng-chứng + next + verify, ground-truth thắng; detector C5 bắt >40) · Stop-hook `.claude/hooks/wal-flush.ps1` persist-only (per-path+CAND+exit-0; **4 path** kể từ S146: WAL/agent-memory/runs/**sessions** — path thứ-4 `.claude/sessions/` = thư-mục phiên-LOGIC, đẻ CÙNG tín-hiệu MẠNH ⑤ + ORPHAN-L ở `tiep.md §0`) qua `.claude/settings.json` (file ĐẦU TIÊN của repo) · `/pause`·`/tiep` MỘT đường recovery · session-start BƯỚC 0.7 (ngoại-lệ CHỜ duy-nhất) + session-end §5.0 squash `wal:`-trailing-chưa-push + §6.4 reset · **FLIP-policy: run ≥3 task HOẶC >5' = BẮT BUỘC RUN-TRACE** (hmw.js :9/:19 + workflows/README) + run.md `## taskList snapshot` + dòng `wf:` 5-trường. **Why:** phiên chết giữa mạch = mất trí-nhớ chưa-ghi + đốt-lại token (sự-cố thật: WF2 S101 mất theo CLI-restart; diary transcript-lost ×2 S110; W3 return-truncate ngay run adopt — per-agent-file cứu). **How to apply:** - **Hook = VERIFIED-RUNTIME** (`12071c5`+`67be443` fire thật S111, fault-inject 2-ca PASS) — NHƯNG **hot-reload = ENV-DEPENDENT** (data-point #2/#3 lớp registry-hot-reload; hub từng NGƯỢC): hook/command mới nghi ngờ → phiên mới re-check `git log --grep="^wal:"`; không fire → thử schema hooks phẳng. - **Hook PS1 KHÔNG bash:** PATH 3-context Windows ngược nhau (PS-primary → WSL-hỏng system32 · cmd → Git-Bash · PS-from-bash → usr/bin) — exec-env bất-định, `powershell.exe` system32 resolve mọi context. Bash-hook rơi WSL-hỏng = chết mọi lượt + fail-open CHE (ghost-wire class). - **Commit `wal:` = ngoại-lệ duy-nhất** format `[CLAUDE]` (rules §5.2) — máy sinh, squash về commit-chốt trước push (`origin/main..HEAD` — không bao giờ rewrite đã-push). Squash xong = điểm review-diff wal-paths (AS-10 backstop dời, không mất). - **D10 S111: deploy.yml paths-ignore +agent-memory/** +runs/**** → budget.json/runs đổi HẾT trigger CI — **AS-6 taxonomy đổi từ S111** (phân loại CI-trigger phiên sau nhớ điều này). - **Nhánh-im-lặng fail-open phải chứng bằng fault-inject**, không bằng quan-sát-vắng-mặt (reviewer bịt lỗ ca 0-delta). - **Pilot — ĐÃ CHẠY THẬT 1 leg (S125→S126, 2026-07-16):** pause-roundtrip ✅ — `/pause` (S125) → restart → `/tiep` (S126): sàn-3 §0 cả 3 tín-hiệu MẠNH đều CÓ và đều KHỚP chain (orphan-folder = spec-holder đúng dòng `[!]`), ground-truth verify 4/4, mạch nối 0 hỏi-lại, NHÓM A thực-thi thẳng từ spec. **Còn PENDING:** kill-giữa-chain (unplanned) · đổi-tài-khoản · **đổi-MODEL leg** (WAL dự-kiến Opus 4.8 MAX, owner mở phiên Fable ⇒ thực-tế same-model — KHÔNG claim cross-model đã test). Hook-fire per-turn ✅ **RE-VERIFIED S126**: boundary duy-nhất 14:24 → `f9fa77d wal: flush 20260716T1424` tự-động (1 boundary = 1 commit, đúng thiết-kế; S125 1-turn-dài 0 boundary nên 0 fire = ĐÚNG, không phải hỏng — đừng đọc "không fire ở phiên 1-turn" thành broken). Cơ chế đầy đủ → engine PHẦN N + [[h18-ghostwire-stamp-integrity]] (STAGED-until-verified nguyên tắc) + [[workflow-fanout-reliability]] (run-trace mandate mới).