Files
solution-erp/docs/changelog/sessions/2026-06-18-S71-harness-10-run-trace.md
pqhuy1987 8c47bd0f0c
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m36s
[CLAUDE] Docs: adopt Harness-10 — tracked run-trace folder convention + checklist 9-10 (3-workflow invest/imple/review)
Migrate .claude/workflows/wave-*/ (gitignored) -> runs/<run-id>/ git-TRACKED (run.md+sub-md/+harvest/) + _ledger.md 2-beat + 3-layer anti-miss + containment model shift (B6 'any tracked-change=violation' -> 'tracked-change outside run-folder+code-disjoint=violation'). hmw.js wave->run-trace (accept args.run + alias). Review (R2+R3) caught C5 L1 over-claim -> fixed (em-main convention, engine no-fs). 3 run-id: wf_9c2cd2cd-2e7 / wf_e4e46725-231 / wf_636bc95b-939. 0 production code, state unchanged (Mig 53/88 tables/306 test/68 gotcha).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 09:15:51 +07:00

5.2 KiB
Raw Blame History

S71 (2026-06-18) — Harness-10 adopt: tracked run-trace folder convention + checklist 9-10 self-verify

Trigger: anh --resume/check-email AI_INFRA và /adap-apply harness-10 và check list 9-10 → chốt (AskUserQuestion) "full-adap + dogfood ngay qua HMW đủ các bước invest/imple/review đầy đủ, tránh sai sót".

Loại: governance/workflow-infra · 0 production code · em-main + 3 Workflow (mandate Harness-9 PART 2).


Bối cảnh

  • /check-email AI_INFRA: 0 thư mới se-directed. Broadcast mới outbox/all/2026-06-18-Governance-checklist-harness-9-10.md (content_sha256 ec32951a MATCH, đọc UTF-8 tường minh #61).
  • KHÔNG có base broadcast Harness-10 file riêng (grep toàn broadcasts/ chỉ match checklist) → spec Harness-10 = Part C (C1-C8) + CAVEAT của checklist.
  • Checklist 3 phần: A (Harness-9 memory, proposal — đã adopt S70) · B (adap 2-workflow, mandatory — codify S70) · C (Harness-10 run-trace, mandatory — MỚI).
  • Điểm-quyết-định (AskUserQuestion): Harness-10 C3 đảo ngược Harness-2 B6 gitignore (.claude/workflows/wave-*/ transient-ignored → runs/<run-id>/ tracked) → anh chốt full-adopt qua HMW.

3-stage Workflow (run-id = bằng chứng mandate B3)

Stage run-id verdict
INVEST wf_9c2cd2cd-2e7 (4× investigator-codebase) PASS — B+C+D strong; A trả stub structured-output nhưng ghi diary thật trên đĩa → self-gate bù
IMPLEMENT wf_e4e46725-231 (3× general-purpose file-disjoint + em-main cluster) PASS — 3/3, containment CLEAN, wording đồng-bộ 4 file
REVIEW wf_636bc95b-939 (3× reviewer adversarial 3-lens) PASS sau-fix — bắt C5 L1 over-claim

Dogfood: 3 run-trace folder TRACKED đầu tiên (.claude/workflows/runs/2026-06-18-h10-{invest,implement,review}/) + 3 entry _ledger.md 2-nhịp.

Thay đổi (migrate wave→run-trace)

  • .gitignore — runs/ tracked qua negation !.claude/**:83 (KHÔNG thêm dòng); wave-*/ giữ legacy-ignored + comment superseded; exit-code-trap note (check-ignore exit 0 cho CẢ negation lẫn ignore → && IGNORED || NOT).
  • hmw.js (em-main, live engine minimal-risk) — accept args.run primary + args.wave alias back-compat; path sub-md/<role>-<i>.md; wording containment model mới; 9 ref wave→RUN-TRACE. node --check PARSE-OK (R1 verify).
  • workflows/README.md full-rewrite + NEW runs/README.md (C1-C7 + caveat trung-thực + verify-pattern).
  • session-start.md:71 L2 orphan-scan · session-end.md:51 L3 close-gate idempotent-VERIFY-not-re-APPEND · agents/README.md/harvest-curator.md/tooling-auditor.md repoint.

Review caught — C5 L1 over-claim (R2 + R3 độc-lập = high-confidence)

runs/README.md ban đầu (Agent 3) ghi L1 in-run reminder fire trong "hmw.js prompt-builder" với text cụ thể → grep hmw.js = 0. Engine no-fs KHÔNG đọc được ledger → L1 "check prior-run-harvested" KHÔNG THỂ là engine-prompt. Fixed path-a (em-main): L1 = em-main @P1 ledger-check convention (đọc _ledger, run trước closed=⏳ → harvest+CLOSE trước) + C7 timing đồng-bộ. Verify: hmw.js L1-text=0 / C4-text=1 → doc khớp engine. → Đây là giá trị cốt lõi của mandate B2 (review-workflow RIÊNG): 1-workflow-vừa-làm-vừa-tự-chấm đã bỏ sót (IMPLEMENT synthesis không nhắc L1); review độc-lập bắt TRƯỚC commit.

Floor C1-C8 (nấc THẬT, honest)

C1 run-folder 3-phần ✓ · C2 scaffold-đầu-run (em-main @P1, engine no-fs) ✓ · C3 tracked-eligible → COMMITTED (sau commit; review bắt git ls-files rỗng = 2-level) · C4 per-turn harvest ✓ · C5 L2/L3 wired + L1 honest-doc ✓ · C6 ledger 2-nhịp ✓ · C7 caveat (reviewer khen "điểm sáng nhất") ✓ · C8 migration clean (0 wave-*/ remain) ✓.

Residual / lessons

  • Race INVEST: 4 same-role investigator tự-ghi chung investigator-codebase/MEMORY.md ("file modified since read") → +6 lines/29.8KB. Content hợp-lệ (R1/R2 verify, purely additive). Fixed cấu-trúc: hmw.js RUN-TRACE writeGuard cấm sub tự-ghi MEMORY (return-delta-only); custom workflow (như INVEST này) thiếu guard → lesson: custom Workflow script phải copy delta-guard. curate-debt: consolidate 3→1 + L1→L2 next.
  • 4 reverse-findings → AI_INFRA (B2.5): (1) C5-L1 không thể là engine-prompt (engine no-fs → lead-side) · (2) custom-workflow thiếu return-delta-guard gây same-role race · (3) check-ignore exit-code trap nên vào C3 self-verify · (4) C3 2-level (eligible vs committed) là bẫy thật, floor tách đúng.

State (GIỮ NGUYÊN — adap không đụng production)

Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle admin BgNCjwsG/user CBvh0vtf. + CLAUDE.md test-flush 263→306 (pre-existing uncommitted, resolve H1 stale-flag).

NEXT

  • ⚠️ Restart CLI: hmw.js RUN-TRACE runtime + carry §2.1.2/reviewer-Cat-6/H8-inherit.
  • curate-debt reviewer 33.8KB (over-soft) + inv-codebase 29.8KB (S71 same-role races; cicd/impl-be OK post-S70) · monthly audit 07-01.
  • Pending product/ops carry S69 (ngưỡng CEO · cờ gấp PE · tzutil · real-staff pw).