hs:ship
hs:ship takes a finished branch and turns it into a push or PR — but it does not bypass a single gate. It orchestrates the prerequisites (test → review → verify → human approval), then lets the transport layer's own gate have the final say. If an artifact is missing, ship stops at the same wall a raw git push would.hs:ship nhận một nhánh đã xong và biến nó thành push hoặc PR — nhưng không bỏ qua bất kỳ gate nào. Nó điều phối các điều-kiện-tiên-quyết (test → review → verify → người duyệt), rồi để chính gate ở tầng vận chuyển quyết định cuối cùng. Thiếu một artifact, ship dừng ngay tại bức tường mà một git push thô cũng dừng.
When to reach for itKhi nào dùng
✓ Reach for it when✓ Dùng khi
- a feature / fix branch is done and needs a PR to main or a targetmột nhánh feature / fix đã xong và cần PR lên main hoặc nhánh đích
- you want test → review → verify run in order, not by handbạn muốn test → review → verify chạy đúng thứ tự, không phải bằng tay
- you want one place that refuses to push if a gate isn't satisfiedbạn muốn một chỗ từ chối push nếu một gate chưa thỏa
✗ Not for✗ Không dùng để
- skipping gates — it can't, and won'tbỏ gate — nó không thể, và sẽ không
- a plain commit / push — that's
hs:gitcommit / push thường — đó làhs:git - pushing while you're on the target branch (it aborts)push khi bạn đang ở trên nhánh đích (nó hủy)
How to run itCách chạy
Invoke it on a finished branch. Mode is inferred from the branch name when you don't say; an ambiguous case asks. Two flags adjust the run.Gọi nó trên một nhánh đã xong. Mode được suy từ tên nhánh khi bạn không nói; trường hợp mơ hồ thì hỏi. Hai cờ điều chỉnh lần chạy.
/hs:ship official --dry-run| FlagCờ | EffectTác dụng |
|---|---|
official | Target main / master — the full pipeline.Đích main / master — pipeline đầy đủ. |
beta | Target the dev / beta branch instead of the release branch.Nhắm nhánh dev / beta thay cho nhánh release. |
| (empty)(trống) | Infer from the branch name; ambiguous → it asks.Suy từ tên nhánh; mơ hồ → nó hỏi. |
--skip-tests | Skip the test step (only if you ran tests separately).Bỏ bước test (chỉ khi bạn đã chạy test riêng). |
--dry-run | Show the plan, change nothing.Hiện kế hoạch, không đổi gì. |
The pipelinePipeline
Eleven steps, but the spine is: merge the target in, prove it works, get it reviewed, confirm the artifacts, then transport. Each prerequisite writes the artifact the final gate reads.Mười một bước, nhưng xương sống là: merge đích vào, chứng minh nó chạy, được review, xác nhận artifact, rồi vận chuyển. Mỗi điều-kiện-tiên-quyết ghi artifact mà gate cuối đọc.
verification.jsonreview-decision.jsonplan-approval.yamlThe real gateGate thật
This pipeline never issues a release verb, so it never reaches the ship stage. It crosses two gated points: step 10 git push is judged as the push stage, which requires only verification; step 11 gh pr create is judged as the pr stage, which requires all three artifacts below (a fourth, critique-consensus.json, is opt-in; coverage-grid is advised at both). Locally the stage hook and the git pre-push hook only advise (exit 0, naming the gap) — even a manual push gets the advisory, never a block. What hard-blocks locally with no CI required: the path-keyed write floors and the artifact-forgery check.Pipeline này không phát lệnh release nào, nên nó không bao giờ chạm stage ship. Nó đi qua hai điểm bị gate: bước 10 git push được xử theo stage push, chỉ đòi verification; bước 11 gh pr create được xử theo stage pr, đòi đủ ba artifact dưới đây (artifact thứ tư, critique-consensus.json, là tùy chọn; coverage-grid được khuyến nghị ở cả hai). Tại máy, hook stage và hook git pre-push chỉ advisory (exit 0, nêu chỗ thiếu) — kể cả push tay cũng chỉ nhận advisory, không bao giờ bị chặn. Cái chặn cứng tại máy mà không cần CI: các sàn ghi theo đường-dẫn và check chống-giả-mạo artifact.
| ArtifactArtifact | Gate requiresGate yêu cầu |
|---|---|
verification.json | no FAILed checkkhông có check FAIL |
review-decision.json | verdict exactly PASS — PASS_WITH_RISK does not qualifyverdict đúng PASS — PASS_WITH_RISK không đủ |
plan-approval.yaml | plan hash hasn't driftedhash plan chưa lệch |
critique-consensus.json (opt-in) | consensus verdict present — only enforced if a stage lists it in requires:; the shipped default does notcó verdict đồng thuận — chỉ bị ép nếu một stage liệt kê nó trong requires:; mặc định ship không có |
- The
hs:shippipeline spells out steps for verification, review, and plan-approval. The policy lives instage-policy.yaml, and the local hook reads it but only advises (exit 0) — it never blocks you. Its shipped default names exactly those three atpr/merge/ship/deploy.critique-consensus.jsonis opt-in: a stage checks it only if you add it to that stage'srequires:. Want the same policy hard-enforced remotely too? Wire the optionalreceipts-gateCI workflow into your own repo.Pipelinehs:shipghi rõ bước cho verification, review, và plan-approval. Policy nằm trongstage-policy.yaml, và hook tại máy đọc nó nhưng chỉ advisory (exit 0) — không bao giờ chặn bạn. Mặc định ship nêu tên đúng ba cái đó ởpr/merge/ship/deploy.critique-consensus.jsonlà tùy chọn: một stage chỉ kiểm nó nếu bạn thêm vàorequires:của stage đó. Muốn ép cứng cùng policy đó từ xa nữa? Gắn workflow CIreceipts-gate(tùy chọn) vào CI của repo bạn. - When prose and policy disagree, the policy wins: the local hook reads exactly what
stage-policy.yamlsays, not what a skill's description says.Khi prose và policy bất đồng, policy thắng: hook tại máy đọc đúng theostage-policy.yaml, không theo mô tả của một skill.
A git push with the artifacts missing. The local hook emits an advisory (exit 0) naming the gap + the exits — never a dead end; nothing local hard-blocks a missing presence artifact. real output
Một git push khi thiếu artifact. Hook tại máy phát advisory (exit 0) nêu chỗ thiếu + các lối ra — không bao giờ ngõ cụt; không gì tại máy chặn cứng một artifact presence còn thiếu. đầu ra thật
[advisory] gate_stage: hard stage 'push' needs an active plan but none resolved. Three exits: (1) create a plan under plans/ with `status: in_progress` frontmatter; (2) set HARNESS_ACTIVE_PLAN to the plan dir; (3) set `require_plan: false` for this stage in harness/data/stage-policy.yaml (tracked in git) — presence enforcement lives in remote CI (receipts-gate) [exit 0 — local gate is advisory; the remote CI receipts-gate is the hard block]
When it stopsKhi nó dừng
Ship is conservative by design — it aborts loudly rather than push something half-baked.Ship cố tình bảo thủ — nó dừng to tiếng thay vì push thứ chưa chín.
- You're currently on the target branch → abort.Bạn đang ở trên nhánh đích → hủy.
- A merge conflict that can't auto-resolve → stop, show the conflicts.Một xung đột merge không tự giải được → dừng, hiện xung đột.
- Tests fail → stop, show the failures.Test rớt → dừng, hiện lỗi.
review-decisionverdict ≠ PASS → stop, ask (fix now / accept risk / cancel).verdictreview-decision≠ PASS → dừng, hỏi (sửa ngay / nhận rủi ro / hủy).- Artifact missing →
hs:shipaborts on its own policy (it won't push without the receipts); the local gate itself would only advise.Thiếu artifact →hs:shiptự hủy theo policy riêng của nó (không push khi thiếu receipt); bản thân gate tại máy chỉ advisory. - Artifact drift (plan modified after approval) →
hs:shipaborts; re-approval is needed.Artifact lệch (plan sửa sau khi duyệt) →hs:shiphủy; cần duyệt lại.
harness/hooks/gate_stage.py (PreToolUse·Bash) advises (exit 0, naming the gap) at the tool layer; harness/install/git-pre-push-hook.sh warns (exit 0) at the transport layer. Neither ever blocks locally — the presence gate is advisory by design. Skipping the skill doesn't skip the advisory either — a raw push meets the same exit 0. What does hard-block, with no CI required: the path-keyed write floors and the artifact-forgery check — those stay local exit-2 no matter what. Want the presence gate hard-enforced remotely too? Wire the optional receipts-gate CI workflow into your own repo.
harness/hooks/gate_stage.py (PreToolUse·Bash) advisory (exit 0, nêu chỗ thiếu) ở tầng tool; harness/install/git-pre-push-hook.sh cảnh báo (exit 0) ở tầng vận chuyển. Cả hai không bao giờ chặn tại máy — presence gate là advisory theo thiết kế. Bỏ skill cũng không bỏ được advisory — một push thô gặp đúng exit 0. Cái chặn cứng, không cần CI: các sàn ghi theo đường-dẫn và check chống-giả-mạo artifact — những cái đó vẫn local exit-2 dù thế nào. Muốn ép cứng presence gate từ xa nữa? Gắn workflow CI receipts-gate (tùy chọn) vào CI của repo bạn.
FAQHỏi đáp
Does hs:ship let me skip a gate when I'm in a hurry?hs:ship có cho bỏ một gate khi gấp không?
hs:ship abort on its own; a manual git push gets the same local advisory (exit 0) — locally nothing hard-blocks the presence gate. What does hard-block regardless: the path-keyed write floors. Wire the optional receipts-gate CI workflow into your own repo if you want the presence gate hard-enforced too.Không qua workflow. Nó điều phối các điều-kiện-tiên-quyết, nhưng policy nằm trong hook, không trong skill. Một artifact thiếu hoặc rớt khiến hs:ship tự hủy; một git push tay vẫn nhận đúng advisory tại máy (exit 0) — tại máy không gì chặn cứng presence gate. Cái vẫn chặn cứng dù thế nào: các sàn ghi theo đường-dẫn. Gắn workflow CI receipts-gate (tùy chọn) vào CI của repo bạn nếu muốn ép cứng presence gate luôn.What's the difference between hs:ship and hs:git?Khác nhau giữa hs:ship và hs:git?
hs:git is plain commit / push / PR with conventional commits and a secret scan. hs:ship runs the full gated release pipeline — test, review, verify, approval — before it ever reaches transport.hs:git là commit / push / PR thường với conventional commit và quét secret. hs:ship chạy pipeline phát hành có gate đầy đủ — test, review, verify, duyệt — trước khi tới tầng vận chuyển.Why does PASS_WITH_RISK not qualify for ship?Vì sao PASS_WITH_RISK không đủ để ship?
PASS; carrying risk to production is a decision a human makes explicitly, not a verdict the gate waves through.Đó là chấp-nhận-mềm có ý thức — "cái này có rủi ro đã biết mà ta chọn gánh". Ship đòi PASS không điều kiện; mang rủi ro lên production là quyết định con người nêu rõ, không phải verdict gate cho qua.Can I preview what ship would do?Tôi xem trước ship sẽ làm gì được không?
--dry-run shows the full plan (target, mode, diff, steps) and changes nothing.Được — --dry-run hiện toàn bộ kế hoạch (đích, mode, diff, bước) và không đổi gì.