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 dev / beta — skips the docs-update step.Đích dev / beta — bỏ bước cập-nhật-docs. |
| (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
Ten 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 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.jsonThe real gateGate thật
Stage ship in stage-policy.yaml hard-blocks unless four artifacts are present and pass their verdict policy. The pre-push hook adds a second block at the transport layer — even a manual push hits it.Stage ship trong stage-policy.yaml chặn cứng trừ khi bốn artifact hiện diện và qua chính sách verdict. Pre-push hook thêm một block thứ hai ở tầng vận chuyển — kể cả push tay cũng đụng.
| 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.json | plan hash hasn't drifted (checked on remote CI)hash plan chưa lệch (kiểm ở CI remote) |
critique-consensus.json | consensus verdict presentcó verdict đồng thuận |
- The
hs:shippipeline spells out steps for verification, review, and plan-approval. The enforced gate —stage-policy.yaml, the file the hook actually reads — additionally requirescritique-consensus.json, the same aspr/merge/deploy.Pipelinehs:shipghi rõ bước cho verification, review, và plan-approval. Gate được ép —stage-policy.yaml, file mà hook thực sự đọc — còn yêu cầu thêmcritique-consensus.json, giốngpr/merge/deploy. - When prose and policy disagree, the policy wins: the gate blocks on what
stage-policy.yamlsays, not on what a skill's description says.Khi prose và policy bất đồng, policy thắng: gate chặn theostage-policy.yaml, không theo mô tả của một skill.
A git push with the artifacts missing. The compliance hook fails closed with exit 2 and names the exits — never a dead end. hs:ship hits this same wall. real output
Một git push khi thiếu artifact. Hook compliance fail-closed exit 2 và nêu các lối ra — không bao giờ ngõ cụt. hs:ship đụng đúng bức tường này. đầu ra thật
[gate_stage] BLOCKED: 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) [exit 2 — compliance hook fail-closed]
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 → the gate blocks; ship does not continue.Thiếu artifact → gate chặn; ship không tiếp tục.
- Artifact drift (plan modified after approval) → the gate blocks.Artifact lệch (plan sửa sau khi duyệt) → gate chặn.
harness/hooks/gate_stage.py (PreToolUse·Bash, fail-closed) blocks the ship stage at the tool layer; harness/install/git-pre-push-hook.sh blocks again at the transport layer. Skipping the skill doesn't skip the gate — a raw push meets the same refusal.
harness/hooks/gate_stage.py (PreToolUse·Bash, fail-closed) chặn stage ship ở tầng tool; harness/install/git-pre-push-hook.sh chặn lần nữa ở tầng vận chuyển. Bỏ skill không bỏ được gate — một push thô gặp đúng sự từ chối.
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?
git push.Không. Nó điều phối các điều-kiện-tiên-quyết nhưng gate được ép trong hook, không trong skill. Một artifact thiếu hoặc rớt sẽ dừng cả skill lẫn git push tay.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ì.