Files
solution-erp/.claude/workflows/runs/2026-07-16-S129-adap-errata-16-07/spec-adap-errata-16-07.md
2026-07-16 22:35:53 +07:00

6.4 KiB
Raw Blame History

spec — adap 2 errata 16-07 (IMPLEMENT 3-task · S129)

Bối cảnh chung (mọi task đọc trước)

  • 2 broadcast nguồn (ĐÃ verify hash, đọc trực-tiếp từ inbox):
    • broadcasts/inbox/2026-07-16-Governance-erratum-eol-metric-hai-chieu-va-bon-lo-moi.md — type update, supersedes-scope HẸP: chỉ 3 fix (① phép đếm attr-aware 2-chiều + w/mixed · ③ cổng push so SỐ không so exit-code, cấm A && B || C · TIPS) + 4 lỗ mới (#4 lone-CR i/-text · #5 fixture-tracked phải -text · #6 nguồn drift = công-cụ-sinh-file · #7 ma-trận 4-ô). Mandate re-verify: CHỈ delta — KHÔNG adopt lại bản 2026-07-15.
    • broadcasts/inbox/2026-07-16-Governance-tong-hop-loi-da-bat-va-sua-bay-lop-sau-phep-thu.md — type new: 7 lớp lỗi (mỗi lớp 1 phép-thử-nhanh) + 6 dấu-hiệu xuyên-dự-án. Adap = tự-soi SE.
  • Hiện-trạng SE (em-main đã recon — RE-VERIFY đừng tin suông): .gitattributes S120 tồn-tại (* text=auto eol=lf, binary tường-minh, đo lúc khai 19 i/-text = 12 docx + 6 png + 1 xlsx) · scripts/agent-frontmatter-eol-check.ps1 = BYTE-level CR-count scoped 3-dir + synthetic control ± + exit 0 luôn (INFORM) · 188 file i/lf w/crlf repo-wide = INFORM-only by-design (S119 spec v2 W0.2 cấm mass rm+checkout) · SE W0.6 S121 = spawn-probe CRLF-tolerant (agent full-CRLF spawn OK 4 stage, scope: agents/ + 1 win32 build).

Luật chung

  1. PROPOSE-only: KHÔNG Edit/Write file nào ngoài sub-<role>-<i>.md của CHÍNH MÌNH trong run-dir. Mọi diff = đề-xuất trong return + sub-file, em-main verify + apply.
  2. Mọi claim = evidence: file:line HOẶC lệnh + output dán thật. Số phải ĐO lúc chạy, không chép từ spec này (spec có thể stale — bài S121 resume-premise).
  3. Lịch-sử đóng-băng KHÔNG tính là consumer: .claude/workflows/runs/** (trừ run-dir này) · docs/changelog/sessions/** · broadcasts/outbox/** đã stamp · adap-reports cũ (đã có addendum-convention riêng).
  4. Ghi full-detail vào sub-investigator-codebase-<i>.md (i = index task) TRONG LÚC LÀM (ghi-đĩa-trong-lúc-làm — chống garble #53), return 4-field NHỎ.
  5. ASCII-safe khi đề-xuất diff cho .ps1 (gotcha #30); phân-biệt use⟂mention khi grep pattern bị-cấm (citation-trap — file NÓI VỀ pattern ≠ file DÙNG pattern).

T0 — erratum fix ①/②/③: sweep consumer đếm-EOL + cổng-push

  • Sweep TOÀN repo sống (glob *.ps1 *.md *.js *.yml — trừ mục Luật-3): site nào (a) đếm EOL-drift (ls-files --eol / i/lf / w/crlf / CR-count), (b) có git push đứng cùng khối với 1 phép kiểm, (c) dùng dạng A && B || C quanh push.
  • Từng site: verdict vs fix① (đếm 2-chiều? mù w/mixed? có trừ cố-ý eol=crlf + -text?) · fix② (đo SAU khi attr áp? — xác-nhận .gitattributes commit-date bằng git log --format='%h %cI' -- .gitattributes | tail -1) · fix③ (so SỐ hay so exit-code? có A && B || C?).
  • Site đã biết cần grade: scripts/agent-frontmatter-eol-check.ps1 (byte-level — grade vs fix①: CR-count có bắt w/mixed không? có false-positive trên file cố-ý-CRLF không — scoped set có file cố-ý nào?) · session-end.md khối push-guard (đọc TRỌN khối squash→count→push, xác-nhận CÓ/KHÔNG EOL-assert + wiring form) · hooks/wal-flush.ps1.
  • Acceptance: bảng site × 3-fix verdict + kết-luận "SE có site nào mang defect erratum không" + diff-proposal nếu có.

T1 — erratum lỗ #4-#7

  • #4: chạy git ls-files --eol | grep 'i/-text' → phân-loại từng file vs .gitattributes binary khai; suspects "lẽ-ra-text nhưng i/-text" = ? (ĐO — kỳ-vọng 0 nhưng phải đo). Lưu ý filter mẫu của erratum THIẾU docx/xlsx — tailor theo class SE khai.
  • #5: SE có fixture EOL byte-cố-ý nào TRACKED không? (eol-check dùng synthetic IN-MEMORY + -RepoRoot temp-tree). Grep fixture-dir + attr -text ngoài binary-class. Verdict: n-a-by-design hay cần attr-line.
  • #6: inventory generator write-site: hooks/*.ps1 + scripts/*.ps1 (Out-File / Set-Content / Add-Content / WriteAllText / WriteAllLines / > redirect) — từng site: file đích nào, encoding/EOL flag gì; rồi ĐO live EOL các file generated đang tracked (vd .claude/WAL.md, .claude/agent-memory/.mfe-state.json, .archive-strikes.json, broadcasts/_index.md): git ls-files --eol <file>. Verdict per-site + đề-xuất self-check-at-point-of-generation NẾU có site ghi CRLF ra file tracked-text (nấc: PROPOSE, tôn-trọng INFORM-stance hiện-hành).
  • #7: map ma-trận 4-ô hub vs SE W0.6: đọc runs/2026-07-15-S119-adap-6-broadcast/W0-evidence-15-07-2026.md (+ file probe nếu có) — probe file của SE thuộc ô nào (mô-tả có : chưa-quote hay đã-quote?), W0.6 có restart-rồi-verify không (erratum: probe TRƯỚC re-scan = không có giá-trị bác-bỏ). Kết-luận: SE data-point củng-cố / mâu-thuẫn / bổ-sung ô nào; header script eol-check có cần thêm 1 câu matrix-ref không (PROPOSE nếu đáng).
  • Acceptance: 4 verdict + số đo dán thật + diff-proposal (nếu có).

T2 — compendium: 7 lớp + 6 dấu-hiệu tự-soi SE

  • Bảng 7 lớp: mỗi lớp → trạng-thái SE {ADOPTED (guard/lesson/mark nào, file:line) · GAP (thiếu gì) · N-A (vì sao)} + phép-thử-nhanh của lớp đó: CHẠY THẬT nếu ≤2 phút, còn lại khai "map-only".
  • Quick-test BẮT BUỘC CHẠY (3 cái rẻ): (a) lớp-6 phao-đông-cứng: chạy scripts/memory-archive-gate.ps1 2 LẦN liên-tiếp → lần 2 phải cùng-verdict/không-đề-xuất-mới (DRY planner đọc gauge sống); dán output 2 lần. (b) lớp-3 công-cụ-kiểm: chạy scripts/agent-frontmatter-eol-check.ps1 1 lần → synthetic control ± phải PASS; dán khối control. (c) lớp-7 proxy-token: chỉ ra Test-Quoted trong scripts/governance-detectors.ps1 (file:line) + 1 ví-dụ enclosure use⟂mention đang sống.
  • Bảng 6 dấu-hiệu xuyên-dự-án: SE đã dính dấu-hiệu nào (evidence: gotcha#/mark/error-ledger) — đặc-biệt dấu-hiệu 4 "công-cụ-đo tự nói dối": SE có instance PS5.1 Get-Content -Raw hash-mojibake S125 (đã có guard trong send/check-email) — cite đúng chỗ.
  • Acceptance: 2 bảng + danh-sách GAP THẬT (nếu 0 GAP thì nói 0 kèm lý-do từng lớp đã phủ) + tests-đã-chạy vs map-only khai thẳng.