[CLAUDE] Docs: S130 session-end — Recently-Done S130 + HANDOFF segment mới (re-stamp 8 carry, ĐÓNG retier-megaline theo B3=#2 anh chốt) + error-ledger E-010/AS-14 encoding-mismeasure (Get-Content no-BOM ANSI ×2-3, tự-bắt + đính-chính) + guard ép-UTF8-tường-minh + session-log + memory append bẫy-đo-thứ-3

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-07-17 00:26:36 +07:00
parent cdb6279c25
commit 71757fc4f8
7 changed files with 87 additions and 17 deletions

View File

@ -33,7 +33,7 @@
- [Verify deployed artifact byte-level](feedback_verify_deployed_artifact_byte_level.md) — UAT "fix chưa ăn" sau deploy → curl-grep bundle prod byte-level (cache≠deploy); incognito=golden-test (S96, #77)
- [Agent return-garble recover](feedback_agent_return_garble_recover.md) — sub trả wrong-slice-of-transcript thay verdict (#53, **×20 qua S118**) → recover: **(0) WRITE-lane→disk-truth (git+build+test) · VERIFY-lane→em-main-re-curl+sqlcmd (2-nguồn-khớp)** → (1) diary → (2) SendMessage-resume in-session → (3) em-main solo; garble ∝ reasoning-lane; **WRITE-lane garble≠mất-code** (S114 ×5); cicd tái-phạm dai + tự-dán "CLEAN-return" sai (harvest-curator bắt S118)
- [H18 ghost-wire + stamp-integrity](feedback_h18_ghostwire_stamp_integrity.md) — hash-verify TRƯỚC khi áp broadcast (bắt stamp-then-edit THẬT → HELD + re-stamp); ghost-wire 2 class (cron-claim CronList=0 · config-key defined-but-unread); KHÔNG stamp run-id chưa chạy (S100)
- [Resume premise re-verify](feedback_resume_premise_reverify.md) — re-verify tiền-đề từ ĐĨA trước execute (header+git-date, match NỘI-DUNG KHÔNG tên-file 1:1); **S121: bảng-kế-hoạch ≠ đĩa — "không-ai-được-giao" ≠ "chưa-làm"; khẳng-định trạng-thái-đĩa = phải chạm đĩa 1 lệnh**; +bẫy `grep -c` (dòng) vs `-o|wc -l` (occurrence) trên mega-line; +acceptance literal tự-lão-hoá (S109/S121)
- [Resume premise re-verify](feedback_resume_premise_reverify.md) — re-verify tiền-đề từ ĐĨA trước execute (header+git-date, match NỘI-DUNG KHÔNG tên-file 1:1); **S121: bảng-kế-hoạch ≠ đĩa — "không-ai-được-giao" ≠ "chưa-làm"; khẳng-định trạng-thái-đĩa = phải chạm đĩa 1 lệnh**; +bẫy `grep -c` (dòng) vs `-o|wc -l` (occurrence) trên mega-line; +bẫy Get-Content-no-Encoding no-BOM = ANSI đếm ×2-3 → báo-số-sai-owner, đính-chính-ngay (S130 E-010/AS-14); +acceptance literal tự-lão-hoá (S109/S121)
- [Permission grant = 2 layers](feedback_permission_grant_two_layers.md) — cấp/verify quyền = display-layer (menu CanRead) ⟂ API-authz-layer (controller `[Authorize(Policy)]`) 2 tầng ĐỘC-LẬP; grep authz controller đích TRƯỚC khi tin grant (menu-ẩn ≠ API-đóng; `[Authorize]` trần = lỗ hổng); reviewer-adversarial bắt, em-main-solo sót (S118, #82)
- [Meta-count self-coverage blind-spot](feedback_meta_count_selfcoverage_blindspot.md) — lead ĐO tốt (~80% đúng) nhưng ĐẾM-VỀ-MÌNH sai (~13%, tập trung TRỌN ở meta-count/coverage); "vá 19 finding" khi thật 23 = con-số đóng vai đã-phủ-hết → bảng disposition TỪNG DÒNG thay số tổng; giữ kết-luận thì giữ cả caveat (S119)
- [Return terminates agent](feedback_return_terminates_agent.md) — CẤM lệnh "trả verdict TRƯỚC, làm việc SAU" = bất-khả-thi vật-lý; sub mô-tả ý-định rồi tắt → claim-sai mà lỗi ở LỆNH lead; thứ-tự đúng = làm→verify→return, hoặc lead ghi on-behalf sau VERIFY-đĩa (S119) · **+S123: prompt-đúng KHÔNG chặn được #53** (cấm bẫy từ prompt đầu cho cả 3 sub, cả 3 vẫn garble ×4) ⇒ chặn được = **ghi-đĩa-TRONG-lúc-làm** (harvest-curator vớt ngay từ đĩa; 2 vai kia phải resume) + resume-in-session; reviewer **tự rút luật "ghi diary TRƯỚC return"** từ garble-1 và nhờ đúng nó mà garble-2 vớt được

View File

@ -14,6 +14,7 @@ S109 (2026-07-10) resume sleep-recovery: scope 16-file/6-agent "đã chốt + gu
**S121 bổ-sung — biến-thể NGUY HIỂM HƠN: suy fact-đĩa từ BẢNG-KẾ-HOẠCH (lead tự mắc, /tiep W1).** Lead rà bảng 7-wave của spec, thấy **không wave nào được giao** việc backfill `[carry:*]` ⇒ kết-luận **"orphan, chưa ai làm"** ⇒ báo owner + ghi run.md + WAL + bơm vào brief fan-out 694k-token. **SAI:** disk có **7 khoá thật**, vào từ `4727d16` (closeout S119, đã push) — làm **NGOÀI** cấu-trúc wave. Sub (đo đĩa) bác lại lead. Brief lead còn **4/4 tiền-đề sai** cùng lượt: config path (`.claude/memory-budget.json` không tồn tại, thật = `.claude/agent-memory/memory-budget.json`) · acceptance literal ngày (`2026-07-14` đã tự lão-hoá thành `07-15` bởi commit **cùng ngày**) · carry · độ-dài (thật ra KHÔNG lệch: `wc -c` byte vs `len()` char, VN UTF-8 đa-byte — đừng tính oan cho sub).
**Phân-biệt 2 lỗi:** "đo nhầm" = có chạm đĩa nhưng lệch. Cái này **KHÔNG chạm đĩa lần nào** — suy từ artifact kế-hoạch rồi phát ngôn ở thể khẳng-định. **"Không ai được giao" ≠ "chưa có trên đĩa"**; bảng-wave mô-tả Ý-ĐỊNH, không mô-tả TRẠNG-THÁI.
🔸 **Bẫy đo kèm:** `grep -c '<pat>'` đếm **DÒNG khớp**, `grep -o '<pat>' | wc -l` đếm **occurrence**. Trên mega-line (`HANDOFF.md:5` = 50 665 byte / 45 đoạn logic) hai lệnh lệch **8×**`-c` cho `1` ⇒ kết-luận "chỉ 1 khoá" = sai. Mega-line ⇒ LUÔN `-o | wc -l`.
🔸 **Bẫy đo thứ-3 CÙNG HỌ (S130, E-010/AS-14):** `Get-Content`/console-pipe PS5.1 KHÔNG ép `-Encoding` trên file **no-BOM** = đọc ANSI ⇒ ký-tự Việt (2-3 byte UTF-8) đếm ×2-3 ⇒ lead báo anh "mega phình ~13K/ngày" trong khi số UTF-8 thật +2.6K (sai ~5×, lọt thẳng vào AskUserQuestion trình owner). Repo CỐ Ý để docs no-BOM ⇒ phép đo mặc-định LUÔN dính. Đo text ⇒ `[System.IO.File]::ReadAllText($p, [System.Text.UTF8Encoding]::new($false))`; cần ĐỌC tiếng Việt từ console ⇒ dump-ra-file rồi Read tool (console cũng mojibake). Số lỡ báo owner ⇒ đính-chính NGAY trong phiên, giữ kết-luận nếu còn đúng + khai độ-lớn sai.
🔸 **Acceptance literal = nợ tự-lão-hoá:** số/ngày tuyệt-đối trong acceptance có thể stale **trong cùng NGÀY** viết ra nó. Viết acceptance dạng **quan-hệ** ("in đúng ngày ở anchor STATUS.md:6"), cấm literal.
**How to apply:** (0) 🔴 **Trước khi phát ngôn thể KHẲNG-ĐỊNH về trạng-thái đĩa (tồn-tại/đã-làm/còn-thiếu/orphan): chạy ĐÚNG 1 lệnh chạm đĩa.** Rẻ hơn mọi thứ khác; lead S121 bỏ qua bước này và đầu-độc cả brief fan-out + run.md + WAL + báo-cáo owner. Suy-luận từ spec/bảng/kế-hoạch ⇒ chỉ được nói ở thể **nghi-vấn** ("chưa thấy wave nào được giao — để tôi đo đĩa"). (1) Mọi resume-from-pause: TRƯỚC execute, re-derive tiền-đề scope từ disk — đọc HEADER artifact đích (field source/coverage) + git-date so artifact vs nguồn; match theo NỘI-DUNG coverage, KHÔNG tên-file 1:1. (2) Lệch tiền-đề → thu-hẹp scope theo guard + báo user option ép-đè tường minh (đừng im lặng chạy scope cũ, cũng đừng im lặng bỏ). (3) Khi distill/nén (reviewer S109 meta-lesson): **3 bề-mặt lỗi NGOÀI body mà coverage-diff máy móc MÙ** = gist-metadata count (đếm từ disk, không copy brief) · số-TỰ-TÍNH (delta arithmetic không có token verbatim đối chiếu) · fact-claim trong N/A-note (resolved/pending phải verify tươi) — semantic reviewer soi riêng 3 lớp này. Liên quan [[agent-kill-recovery]] [[prod-config-inspect-before-change]] [[stale-diagnostic-background-agent]].