InstallCài đặt
Installing is one command — no follow-up scripts to chain over several turns. It verifies the bundle, extracts it, checks dependencies, installs into your repo, verifies the wiring, and runs the test suite — in that order, fail-fast at the first problem. Requirements: Linux, Python ≥ 3.9, git, and Claude Code.Cài đặt là một lệnh — không phải chạy script nối tiếp qua nhiều lượt. Nó kiểm bundle, giải nén, kiểm phụ thuộc, cài vào repo, xác nhận wiring, rồi chạy bộ test — theo đúng thứ tự đó, dừng ngay ở lỗi đầu tiên. Yêu cầu: Linux, Python ≥ 3.9, git, và Claude Code.
pyyaml, pytest, defusedxml. The one-command install.sh below checks them and prints the exact fix (step ③), so on that path you do nothing up front. But if you run the installer directly (python3 harness/install/install.py, below), there is no deps check — install them yourself first, or the hooks fail later at runtime:python3 -m pip install pyyaml pytest defusedxmlTrước khi bắt đầu. Máy đích cần Python ≥ 3.9 và ba gói pip — pyyaml, pytest, defusedxml. Lệnh-một-phát install.sh bên dưới tự kiểm và in đúng lệnh sửa (bước ③), nên đi đường này bạn không phải làm gì trước. Nhưng nếu chạy trình cài trực tiếp (python3 harness/install/install.py, ở dưới) thì không có bước kiểm deps — phải tự cài trước, không thì hook sẽ chết lúc chạy:python3 -m pip install pyyaml pytest defusedxmlInstall in one commandCài trong một lệnh
Point the installer at a release bundle and the target repo. It runs five steps for you: ① verify the sha256 sidecar → ② extract → ③ check deps (and print the exact pip command if any are missing) → ④ install + verify (--strict fails on any drift) → ⑤ run the test suite against the freshly installed copy. The integrity check in step ④ already proves the install; step ⑤ is the extra "does it run green in my environment" pass, and you can skip it with --skip-tests.Trỏ trình cài vào một bản release và repo đích. Nó chạy năm bước hộ bạn: ① kiểm sha256 → ② giải nén → ③ kiểm deps (và in đúng lệnh pip nếu thiếu) → ④ cài + verify (--strict lỗi khi có lệch) → ⑤ chạy bộ test trên bản vừa cài. Bước ④ đã chứng minh cài đúng; bước ⑤ là lượt kiểm thêm "chạy có xanh trong môi trường của tôi không", và bạn bỏ qua được bằng --skip-tests.
The release ships two files: the bundle harness-<version>.tar.gz (with its .sha256) and a standalone install.sh. Download them into the same folder, then run:Bản release kèm hai file: bundle harness-<version>.tar.gz (cùng .sha256) và một install.sh độc lập. Tải cả hai vào cùng một thư mục, rồi chạy:
sh install.sh harness-<version>.tar.gz ../my-repoStep ③ — check dependencies. Deps are checked before anything is installed, so a missing one stops the run early with the command to fix it. real outputBước ③ — kiểm phụ thuộc. Deps được kiểm trước khi cài, nên thiếu cái gì là dừng sớm kèm lệnh sửa. đầu ra thật
preflight OK: pytest, pyyaml
Step ④ — install + verify. The installer copies harness/, merges hooks into .claude/settings.json additively (your own hooks survive), installs the pre-push gate, adds a .gitignore block for runtime state, injects a self-loading harness onboarding block into CLAUDE.md (replace-between-markers, your prose preserved), then runs verify_install as the closing gate. Pass --no-track to run the harness without committing harness/ into your product git. real outputBước ④ — cài + verify. Trình cài copy harness/, gộp hook vào .claude/settings.json theo kiểu cộng thêm (hook của bạn vẫn còn), cài pre-push gate, thêm khối .gitignore cho trạng thái runtime, chèn khối onboarding harness tự-nạp vào CLAUDE.md (thay-giữa-mốc, giữ nguyên prose của bạn), rồi chạy verify_install làm gate chốt. Dùng --no-track để chạy harness mà không commit harness/ vào git sản phẩm. đầu ra thật
verify_install OK: manifest + hook registration consistent
Step ⑤ — run the suite (default; --skip-tests to skip). The harness ships its own tests and runs them against the installed copy, so you see them green in your environment before you trust the gate. real outputBước ⑤ — chạy bộ test (mặc định; --skip-tests để bỏ). Harness kèm theo bộ test của chính nó và chạy trên bản vừa cài, để bạn thấy chúng xanh trong môi trường của mình trước khi tin vào gate. đầu ra thật
........................................................................ [ 8%] ........................................................................ [ 17%] ........................................................................ [ 26%] ........................................................................ [ 35%] ........................................................................ [ 44%] ........................................................................ [ 52%] ........................................................................ [ 61%] ........................................................................ [ 70%] ........................................................................ [ 79%] ........................................................................ [ 88%] ........................................................................ [ 97%] ........................ [100%] 816 passed in 17.28s
python3 script on each tool call, so the machine that runs the harness needs Python ≥ 3.9. The installer fails clearly up front if it is missing. No Python? Install it first (apt install python3 · brew install python · python.org), then re-run. We deliberately do not bundle a venv: a venv references a base interpreter (it does not contain Python) and is not portable across machines — it would not help the no-Python case and would break on a different OS. The whole dependency surface is three pip packages (PyYAML + pytest + defusedxml), which the deps check installs for you.Máy đích bắt buộc có Python — không chỉ để cài. Mỗi hook chạy như script python3 ở từng lần gọi tool, nên máy chạy harness cần Python ≥ 3.9. Trình cài báo rõ ngay từ đầu nếu thiếu. Chưa có Python? Cài trước (apt install python3 · brew install python · python.org) rồi chạy lại. Chúng tôi cố ý không đóng gói venv: venv tham chiếu tới một interpreter gốc (nó không chứa Python) và không di động giữa các máy — gói venv không cứu được trường hợp thiếu Python mà còn vỡ trên OS khác. Toàn bộ phụ thuộc chỉ là ba gói pip (PyYAML + pytest + defusedxml), và bước kiểm deps lo việc cài.Prefer explicit commands? Install step by stepThích lệnh tường minh? Cài từng bước
The one-shot above wraps these. If you would rather see each command, unpack the bundle and run the installer directly — same writes, same final verify. Three lines: install deps, extract, install.Lệnh-một-phát ở trên gói lại đúng các bước này. Nếu muốn thấy từng lệnh, giải nén bundle và chạy thẳng trình cài — cùng cách ghi, cùng verify cuối. Ba dòng: cài deps, giải nén, cài.
① Install deps (the direct path skips the auto-check):① Cài deps (đường trực tiếp bỏ qua bước tự kiểm):
python3 -m pip install pyyaml pytest defusedxml② Extract the bundle into a folder beside your repo — not inside it (see the note below):② Giải nén bundle ra một thư mục cạnh repo — đừng để trong repo (xem lưu ý dưới):
tar -xzf harness-<version>.tar.gz -C ../harness-src③ Install, pointing --target at your repo:③ Cài, trỏ --target vào repo của bạn:
cd ../harness-src && python3 harness/install/install.py --target ../my-repoinstall.py --target ., the installer sees source == target and skips the file copy as a no-op (it assumes the harness is already in place — the in-repo dev case), so you get "0 tracked files" and nothing installs. Unpack it as a sibling folder instead (the layout above: harness-src/ next to my-repo/) and point --target at the repo so source and target differ. The one-command install.sh avoids this for you — it always extracts to a temp dir first.Để thư mục harness vừa giải nén ở NGOÀI repo định cài. Nếu giải nén bundle bên trong repo rồi chạy install.py --target ., trình cài thấy source trùng target nên bỏ qua bước copy (coi như harness đã sẵn — trường hợp dev ngay trong repo), kết quả là "0 tracked files", không cài được gì. Hãy giải nén ra thư mục cạnh bên (như sơ đồ trên: harness-src/ cạnh my-repo/) rồi trỏ --target vào repo để source khác target. Lệnh-một-phát install.sh tránh hộ bạn lỗi này — nó luôn giải nén ra thư mục tạm trước.OptionsTùy chọn
| OptionTùy chọn | EffectTác dụng |
|---|---|
--skip-tests | Skip step ⑤ (the suite takes ~30s). The install is still verified by --strict.Bỏ bước ⑤ (bộ test ~30s). Bản cài vẫn được --strict verify. |
--non-interactive / --yes | (direct installer) Never prompt, even on a TTY — the CI / automation path.(trình cài trực tiếp) Không bao giờ hỏi, kể cả trên TTY — đường CI / tự động. |
--dry-run | (direct installer) Plan every write, change nothing.(trình cài trực tiếp) Lập kế hoạch mọi lần ghi, không đổi gì. |
--uninstall | (direct installer) Reverse the settings + pre-push edits (harness/ is left in place).(trình cài trực tiếp) Đảo ngược chỉnh settings + pre-push (harness/ vẫn để nguyên). |
block everywhere. Real enforcement happens on the remote CI (via `.github/workflows/receipts-gate.yml`) where plan receipts are checked before PR merge and push-to-main. Nothing gets past the remote gate without the plan artifacts and code review.Personal-first local, ép remote. Gate local là advisory để bạn lặp thoải mái; nhốt RBAC agent và safety floor vẫn block ở mọi chỗ. Ép thật xảy ở CI remote (qua `.github/workflows/receipts-gate.yml`) kiểm plan receipt trước merge PR và push-main. Không gì vượt qua gate remote nếu thiếu plan artifact và code review.From a clone (advanced)Từ một clone (nâng cao)
If you already have the harness checked out, skip the bundle and run the installer directly. Same writes, same final verify; this is the path the one-shot wraps. Every mutation is idempotent and previewable.Nếu đã có harness sẵn, bỏ qua bundle và chạy thẳng trình cài. Cùng cách ghi, cùng verify cuối; đây là đường mà lệnh-một-phát bọc lại. Mọi thay đổi đều idempotent và xem-trước được.
python3 harness/install/install.py --target ../my-repoharness/standards/ is missing or thin. Run scaffold_standards.py --type system-architecture|code-standards for a TBD skeleton to fill. Once installed, tune behavior on the Configure page; every knob (file, default, how to change it, env override) is mapped in harness/rules/config-reference.md.Trình cài không bao giờ bịa standards của bạn — nó cảnh báo khi harness/standards/ trống hoặc sơ sài. Chạy scaffold_standards.py --type system-architecture|code-standards để có khung TBD mà điền. Cài xong, chỉnh hành vi ở trang Cấu hình; mọi núm (file, mặc định, đổi cách nào, env override) liệt kê trong harness/rules/config-reference.md./reload-plugins in Claude Code (or restart it), then run your first loop in the Quick start. Re-verify any time with python3 harness/scripts/verify_install.py --strict.Sau khi cài: bật plugin bằng /reload-plugins trong Claude Code (hoặc khởi động lại), rồi chạy vòng đầu tiên trong Bắt đầu. Verify lại bất cứ lúc nào với python3 harness/scripts/verify_install.py --strict.FAQHỏi đáp
What if the target machine has no Python?Nếu máy đích không có Python thì sao?
python3 script, so Python ≥ 3.9 is a runtime requirement, not just an install-time one. The installer detects this and stops with the install command for your OS. Install Python first, then re-run.Thì harness không chạy được — mọi hook là script python3, nên Python ≥ 3.9 là yêu cầu lúc chạy, không chỉ lúc cài. Trình cài phát hiện và dừng kèm lệnh cài cho OS của bạn. Cài Python trước, rồi chạy lại.Why not bundle Python or a venv so I don't need either?Sao không gói sẵn Python hay venv để khỏi cần?
Will installing touch files I didn't expect?Cài đặt có đụng file tôi không ngờ không?
--dry-run first — it plans every write and changes nothing. The real run is idempotent, merges .claude hooks additively (your own survive), and --uninstall reverses the settings + pre-push edits (it leaves harness/ in place; delete that folder to remove it fully).Chạy trình cài trực tiếp với --dry-run trước — nó lập kế hoạch mọi lần ghi và không đổi gì. Lần chạy thật là idempotent, gộp hook .claude theo kiểu cộng thêm (hook của bạn vẫn còn), và --uninstall đảo ngược chỉnh settings + pre-push (để harness/ nguyên; xóa thư mục đó để gỡ hẳn).