HomeTrang chủ › hs:shiphs:ship
The highest-risk skill — so every gate is realSkill rủi ro cao nhất — nên mọi gate đều thật

hs:ship

workflow

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
officialTarget main / master — the full pipeline.Đích main / master — pipeline đầy đủ.
betaTarget 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-testsSkip the test step (only if you ran tests separately).Bỏ bước test (chỉ khi bạn đã chạy test riêng).
--dry-runShow 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.

merge targetmerge đích
fetch + mergefetch + merge
→
testtest
verification.json
→
reviewreview
review-decision.json
→
approvalduyệt
plan-approval.yaml
→
push / PRpush / PR
gate has final saygate quyết cuối

The 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.

ArtifactArtifactGate requiresGate yêu cầu
verification.jsonno FAILed checkkhông có check FAIL
review-decision.jsonverdict exactly PASS — PASS_WITH_RISK does not qualifyverdict đúng PASS — PASS_WITH_RISK không đủ
plan-approval.yamlplan 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ó
⚖️ A note on the source, read honestlyMột lưu ý về nguồn, đọc trung thực
  • The hs:ship pipeline spells out steps for verification, review, and plan-approval. The policy lives in stage-policy.yaml, and the local hook reads it but only advises (exit 0) — it never blocks you. Its shipped default names exactly those three at pr / merge / ship / deploy. critique-consensus.json is opt-in: a stage checks it only if you add it to that stage's requires:. Want the same policy hard-enforced remotely too? Wire the optional receipts-gate CI workflow into your own repo.Pipeline hs:ship ghi rõ bước cho verification, review, và plan-approval. Policy nằm trong stage-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.json là tùy chọn: một stage chỉ kiểm nó nếu bạn thêm vào requires: của stage đó. Muốn ép cứng cùng policy đó từ xa nữa? Gắn workflow CI receipts-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.yaml says, not what a skill's description says.Khi prose và policy bất đồng, policy thắng: hook tại máy đọc đúng theo stage-policy.yaml, không theo mô tả của một skill.
The gate, realGate, thật

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

echo '{"tool_input":{"command":"git push"}}' | python3 harness/hooks/gate_stage.py
[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-decision verdict ≠ PASS → stop, ask (fix now / accept risk / cancel).verdict review-decision ≠ PASS → dừng, hỏi (sửa ngay / nhận rủi ro / hủy).
  • Artifact missing → hs:ship aborts on its own policy (it won't push without the receipts); the local gate itself would only advise.Thiếu artifact → hs:ship tự 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:ship aborts; re-approval is needed.Artifact lệch (plan sửa sau khi duyệt) → hs:ship hủy; cần duyệt lại.
HARD-GATE — two advisories locally; the real hard blocks don't need CI.hai advisory tại máy; các block cứng thật không cần CI. 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?
Not through the workflow. It orchestrates the prerequisites, but the policy lives in a hook, not the skill. A missing or failing artifact makes 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?
It's a conscious soft-accept — "this has a known risk we're choosing to carry". Ship demands an unqualified 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?
Yes — --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ì.