Files
solution-erp/.claude/commands/fable-clone.md
pqhuy1987 e9124fc6de
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m30s
[CLAUDE] Docs: S125-S126 closeout GOP — H23-precedence DO (spawn-param THANG hard-pin, /fable-real SONG) + sweep all-inherit va 15+3+5 + gotcha #83 + hub-mail h23-result
- NHOM A restart-verify: A1 tier:'fable' tren reviewer pin-opus -> resolved claude-fable-5 (spawn-param THANG); A2 no-tier -> claude-opus-4-8 DU lead=Fable (pin an runtime); A3 autoMemory WRITE-path OK (project_h23_spawn_precedence.md moi).
- B1 sweep all-inherit floor-song: 15 dong/5 file + 3 cung-lop lot-pattern + 5 dong H23-stale o 3 command-file (H1 bat) -> VA HET; spawn-model-audit Section-D flush H8->S124 + effort-check (fault-inject 2-chieu PASS, 14 duong-gia -> 0); governance-detectors C3 seed +worker-tier-pin; re-grep 0 floor-song; suite 45 = baseline 0-new.
- vocab-alias-map §3 canonical flip -> worker-tier-pin (all-inherit/two-tier = 2 alias cu); STATUS:6 FROZEN-diary label (het H24-3 lag); STATUS:25 + agents/README:5 sync.
- Email hub h23-precedence-test-result stamp 945cf3ad (reviewer-gate FAIL bat 3 loi truoc stamp -> gotcha #83 aggregate-cumulative) + _index cung luot.
- B3/B4 owner-gated: soan b3-b4-owner-gated-proposals.md CHO ANH (mega-line retier + budget:74 wording) — 0 apply.
- Closeout: harvest 4 lane + 2 monitor (H2 GATE PASS 5/5, 0/29 orphan; H1 3/4 clean + 5-spot fix) + curate moved-not-cut reviewer/inv-cb + carry disposition (DONG 2: restart-s124, h23-fable-test-postrestart; MO re-stamp 9) + H24 counter=5 + pilot H22 D5 (pause-roundtrip + hook-fire re-verified; cross-model PENDING).
- Governance/tooling-only: 0 prod-code, 0 mig, test 509 GIU, bundle FROZEN.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 15:19:08 +07:00

8.9 KiB
Raw Blame History

description: /fable-clone <đề-bài> — ENGINE-ĐẮT LỆNH-B per-invocation (H21): vai anh GÁN chạy ENSEMBLE tier-2-mạnh-nhất (N lane đa-lăng-kính CÙNG 1 VAI qua hmw.js parallel + em-main refute+synthesize) cho đề-bài đó — KHÔNG marker, KHÔNG mode persist. Thiếu/sai vai → em main hỏi lại anh 1 dòng, KHÔNG tự chọn. Cặp /fable-real. argument-hint: <vai ∈ roster 14> <đề-bài phán-quyết> — vd "reviewer rà commit X" · "investigator-codebase truy bug Y"

/fable-clone — ENGINE-ĐẮT LỆNH-B: 1 vai × ENSEMBLE tier-2 (per-invocation, H21)

Cặp /fable-real (lệnh-A single top-model). 🔴 restart Claude Code sau khi tạo/sửa (no hot-reload). Adopt H21 S110 (2026-07-11) — supersede semantics toggle-marker H19 (S101). KHÔNG còn mode-ảo mặc-định để "về", KHÔNG còn marker: cả 2 lệnh giờ = engine-đắt per-invocation, chỉ SỐNG trong lượt anh gõ. 📘 Runbook: docs/governance/fable-real-runbook.md · 🔧 Guard §K: docs/governance/harness-11-engine.md §K (engine).

Vai + đề-bài lượt này: $ARGUMENTS

🔴 Semantics per-invocation (H21 ①/②)

  • /fable-clone <vai> <đề-bài> = vai anh gán chạy ENSEMBLE tier-2-mạnh-nhất = N lane đa-lăng-kính CÙNG 1 VAI (qua HMW parallel) + em-main refute + synthesize (P3/P4) = "bản sao Fable". Rẻ quota top-model, giữ tầng phản-biện chống-đồng-thuận-sai.
  • Hiệu-lực CHỈ lượt đóKHÔNG còn "về mặc-định", KHÔNG marker, KHÔNG persist (H19 mode thật/ảo đã retired H21). Lượt sau muốn ensemble = gõ lại lệnh.

🔴 Vai BẮT BUỘC ∈ roster 14 (H21 ②)

investigator-codebase · investigator-api · implementer-backend · implementer-frontend · frontend-designer · database-agent · office-document · test-specialist · reviewer · cicd-monitor · tooling-auditor · harvest-curator · lead-view-auditor · lead-omission-auditor.

  • Thiếu <vai> HOẶC vai ngoài roster → em main hỏi lại anh 1 dòng, KHÔNG tự chọn vai.
  • VALID_ROLES đủ roster 14 — canonical đếm ở docs/STATUS.md §Sub-agents (B1 derived-trỏ-canonical; KHÔNG chép số ở đây khi roster đổi — đó chính là class view-stale-role-desclead-view-auditor soi). Lịch-sử: 10→12 (S110, +2 monitor tooling-auditor/harvest-curator) → 12→14 (S121 W2, +2 monitor H24 lead-view-auditor/lead-omission-auditor). (🧊 limitation cũ 10-vai + H6-design "monitor ngoài workflow" superseded; monitor vẫn INFORM-only, lane RETURN-only.)
  • 🔒 Honest-note (a/b): bảo-đảm = owner-gated tầng lệnh + kỷ-luật lead, KHÔNG code-enforced; lệnh/alias = cách anh gán vai nhanh, hệ KHÔNG tự chọn vai.

🔴 Spec-file 3-mục BẮT BUỘC mỗi run (H21 ①)

Mỗi lần chạy engine-đắt PHẢI kết-tinh 1 spec theo pipeline propose → verify → ghi → thực-thi:

  1. Engine propose-only — vai chạy ensemble đề-xuất [đề-bài · cách làm · checklist]. Engine KHÔNG tự ghi.
  2. Lead verify — lead soi + chỉnh (P3/P4 refute + synthesize N lane).
  3. Lead ghi file .claude/workflows/runs/<run-id>/spec-<tên-tính-năng>-<dd-mm-yyyy>.md3 heading cố-định: ① Tính-năng/đề-bài · ② Cách implement · ③ Checklist (vai + deliverable + acceptance ĐO ĐƯỢC).
  4. Worker thực-thi THEO spec — spec bơm QUA ARGS/prompt (worker KHÔNG tự Read file).
  • 🔒 Honest-note (c): file spec do LEAD ghi SAU khi verify — engine KHÔNG tự ghi.
  • 🔒 Honest-note (d): run chấm/verify CŨNG sinh spec-file (kế-hoạch xử issue = "cách làm" cần kết-tinh).

🔴 Cờ args.run — RUN-TRACE BẮT BUỘC khi ≥3 lane (Sàn-1 H22, cơ-khí-hoá S121 W2)

🔴 /fable-clone ensemble hầu như LUÔN ≥3 lane (run S119 = 5 lane) ⇒ cờ này gần như LUÔN bắt buộc. Trước khi gọi Workflow hmw, lead PHẢI @P1:

  1. Scaffold .claude/workflows/runs/<run-id>/ (TRACKED) + run.md kèm ## taskList snapshot.
  2. Truyền args.run = { name:'<run-id>', dir:'.claude/workflows/runs/<run-id>' }.

Thiếu cờ + ≥3 task ⇒ hmw.js THROW (STOP-HARD), KHÔNG fail-soft. Vì sao gate: script chạy JS-sandbox KHÔNG filesystem ⇒ tự nó không tạo được folder ⇒ trước S121 sàn này chỉ là kỷ-luật người (đo thật @S119: git grep args.run .claude/commands/ = 0 hit ⇒ 4/4 wrapper KHÔNG cờ ⇒ sàn danh-nghĩa). Hậu-quả thật khi thiếu: chết giữa run ⇒ per-turn returns mất theo phiên, chỉ file trên đĩa sống sót/tiep §4 không có vật-liệu cắt-gọt ⇒ chạy lại TỪ ĐẦU (S118 raw-Agent 7-spawn ⇒ 0 run-folder). 🔸 Khai thật: gate chỉ phủ đường hmw.js. Ngưỡng "hoặc ước >5 phút" KHÔNG cơ-khí-hoá được (script không đo trước thời-lượng) ⇒ phần đó vẫn là kỷ-luật lead. raw Workflow/Agent tool = kẽ CÒN-LẠI, đi thẳng không qua file này ⇒ mất writeGuard + run-trace.

🔴 Guard ensemble (§K engine — 3 floor-fidelity)

  • ảo-ensemble = N lane CÙNG 1 vai phán-quyết (multi-lens trên 1 vai), KHÔNG mixed-roster fan-out (hmw.js VALID_ROLES = roster đầy-đủ, canonical → docs/STATUS.md §Sub-agents; KHÔNG gate vai — worker-tier-pin S124 che leak qua frontmatter opus (xem :57), hết thời all-inherit ăn-theo-lead).
  • N lane RETURN-only; em-main single-writer (B3) ghi 1 MEMORY entry đúng vai đó + gắn nhãn engine đã dùng (hmw SCHEMA memoryDelta KHÔNG field engine → em-main stamp @P3 harvest).
  • Một vai = một trí-nhớ dù N lane (chống AS-10 fragment N-lane).

🔴 GAP#6 — lane ensemble PHẢI mang tier:'opus' (KHÔNG để inherit)

🔴 Lệnh này tự định-nghĩa mình là "ENSEMBLE tier-2" ⇒ lane BUỘC phải chạy tier-2, KHÔNG phải tier của lead.

taskList: [ { role:'<vai anh gán>', tier:'opus', label:'lens-1', prompt:'…' },
            { role:'<vai anh gán>', tier:'opus', label:'lens-2', prompt:'…' },  ]

Vì sao GIỮ (đổi nấc S124) (hmw.js resolveModel(): if (tier==='fable'||tier==='opus') return tier):

  • 🔴 N×Fable-risk NAY được PIN che: frontmatter đổi inheritopus (worker-tier-pin S124) ⇒ thiếu tier → role-có-frontmatter → model: opus → lane = opus (tier-2), KHÔNG còn ăn lead. Vậy dù lead=Fable, lane vẫn opus (KHÔNG còn N×Fable). ⇒ tier:'opus' nay = belt-and-suspenders (explicit-is-better), KHÔNG còn là chốt-chặn DUY-NHẤT như thời all-inherit.
  • ⇒ Lỗi cũ 🟥 reviewer @S108 (lead=Fable → ensemble N×Fable) = đã vá bằng pin, giữ mô-tả làm lịch-sử.
  • 🔴 Lỗ THẬT còn lại = tier:'fable' của /fable-real (KHÁC frontmatter opus) → H23-precedence (xem dưới): nếu frontmatter thắng, /fable-real KHÔNG lên Fable được.

ĐÃ VERIFY S126 (2026-07-16) — precedence spawn-param ⟂ frontmatter (H23 §2(2); flip từ "CHƯA VERIFY")

Đo thật (run wf_f960dae2-fa0, phiên đầu sau restart kích-hoạt frontmatter S124): lane reviewer (frontmatter opus) + tier:'fable' → resolved claude-fable-5SPAWN-PARAM THẮNG hard-pintier:'fable' của /fable-real KHÔNG NO-OP — escalate Fable ĐƯỢC (hmw.js:44-51 mang kết-quả + caveat cùng nội-dung). (tier:'opus' trùng frontmatter, vô-hại như cũ.) Control: lane no-tier → claude-opus-4-8 DÙ lead=Fable ⇒ pin ăn runtime (loại inherit-lead). Caveat GIỮ: retrospective (không hứa spawn tương-lai — PA-2b) · ALIAS-pin only (hub full-id KHÔNG covered) · fix#8a vẫn mở (param từ-chối full-id? chưa thử). Evidence: runs/2026-07-16-S126-adap-spec-execute/runtime-verify-synthesis.md. PA-2 (anh chốt O1) = 2 lớp GIÁN-TIẾP bổ-trợ: PA-2a hằng-số TIER2_EXPECTED_FULL_ID = 'claude-opus-4-8' (hmw.js:53) + PA-2b scripts/spawn-model-audit.ps1 so resolved-vs-expected.

⚠️ Grep tier:'opus' ≥1 hit = ĐIỀU-KIỆN CẦN, KHÔNG ĐỦ — nó chỉ đo CHỮ trong file, không đo runtime ⇒ Goodhart-able 100%.

🔴 Floor model-tier v3 + lead-discipline

  • Lead = frontier-class do ANH chọn per-session {Fable 5 | Opus 4.8 — 1M MAX}; CẤM Sonnet/Haiku-class ghế lead. Engine-đắt per-invocation = đường DUY NHẤT nâng 1 vai lên hạng-nhất.
  • ⚠️ Lead KHÔNG tự ý gọi engine-đắtkể cả khi HMW-mode ON; chỉ chạy khi anh gõ lệnh.