Reopening a gate with rulings
Every way a person rules on a play after it starts. Approve with rulings, reject and approve the replan in one step, accept a Verify or Audit finding, and void a gate that already passed.
Verification: verified on the twin, except gw accept (details at the bottom).
Gates are where your judgment enters the play, and the engine keeps that judgment on the record. Every approval is a signed file holding a hash of the artifacts you reviewed. If those artifacts change afterwards, the approval no longer counts. Your rulings are written to the play’s feedback/ folder in your own words, and later stages must follow them where they differ from the plan.
This page covers the five moves, from the lightest to the heaviest.
| Situation | Command | Where the play goes |
|---|---|---|
| Gate A, the planner asked you something | gw approve <play> --gate A --comment "<rulings>" |
Build, with your rulings as feedback |
| Gate A, the plan is wrong in a way you can state | gw reject <play> --gate A --comment "<what to change>" --approve |
Plan, then straight on to Build unless the replan raises something new |
| Gate B, the draft needs a fix | gw reject <play> --gate B --comment "<what to fix>" |
Build |
| Verify or Audit stopped on something only you can decide | gw accept <play> --comment "<what you accept and why>" |
On, with your acceptance shown at Gate B |
| A passed gate turned out wrong | gw reopen <play> --gate A|B --comment "<rulings>" [--approve] |
Plan (A) or Build (B) |
1. Rulings at Gate A
When the planner hits a decision that’s yours, it writes needs-ruling.md instead of guessing. Requirements Research couldn’t resolve show as blocked in gw show. Either way, the gate tells you:
$ gw show acme/rule-01
the planner needs your ruling (needs-ruling.md):
# Needs your ruling
1. The seed AE or the candidate territory owner approves? Recommended: seed AE.
next: Rule on …/needs-ruling.md (or the blocked requirements), then: gw approve acme/rule-01 --gate A --comment "<your rulings>"
· or replan: gw reject acme/rule-01 --gate A --comment "<rulings>" --approve
A plain approval is refused, because approving past an open question would drop it:
$ gw approve acme/rule-01 --gate A
gw: Gate A has decisions only you can make: the planner's questions in needs-ruling.md.
Approve with --comment "<your rulings>" (for example "1-4 as recommended"), or reject with --comment to replan.
Two ways forward:
# The plan is right once your rulings are applied: approve with them. Build follows the rulings where they differ from plan.md.
gw approve acme/rule-01 --gate A --comment "1: seed AE approves, as recommended"
# The rulings change the plan: replan, and let your ruling approve the new plan.
gw reject acme/rule-01 --gate A --comment "Seed AE approves; fit threshold 65" --approve
With --approve, the replan is approved in your name, citing your ruling, unless the planner writes a new needs-ruling.md. Then it stops at Gate A again. On the twin, the approval file reads:
{ "gate": "A", "decision": "approved", "by": "<you>",
"comment": "Approved by ruling (--approve, 2026-11-28T22:30:10.442Z): Seed AE approves; fit threshold 65",
"artifactHash": "766c6eeb…", "mac": "1fce9036…" }
Good rulings are short, numbered to match the questions, and testable: “1: seed AE. 2: threshold 65. 3: no competitor variant.”
2. Fixes at Gate B
Gate B approves publishing one exact snapshot. If the draft needs a change, reject with the fix and the play goes back to Build. Verify and Audit run again on the new snapshot:
gw reject acme/rule-03 --gate B --comment "Rep task due next business day, not same day"
--approve never applies at Gate B. Publishing always needs your explicit approval:
$ gw reopen acme/rule-02 --gate B --comment "…" --approve
gw: --approve applies to Gate A only; Gate B (publishing) always needs your explicit approval
3. Accepting a finding
Verify fails an assertion it can’t fix itself, or Audit raises a needs_human finding: the play stops (manual, “Needs a human: …”). If you accept the finding, say what and why:
gw accept acme/champions-01 --comment "A7 can't be tested before the first production batch; we run it supervised with the switch OFF"
Your acceptance is recorded in your name and shown at Gate B. Accepting covers only what needs a human. Defects the stage could fix itself still go back to Build, with your ruling beside them. Accepting never waves them through.
4. Reopening a gate that already passed
Sometimes the problem shows up late. Verify finds the approved contract was wrong, or the budget runs out. gw reopen voids the passed gate with a signed rejected record that gives your reason, writes your rulings as feedback, and sends the play back to Plan (Gate A) or Build (Gate B).
On the twin, with maxCreditsPerPlay: 10, a second Verify pass ran out of budget:
acme/rule-03 Verify · blocked · Verify: … {"error":{"code":"budget_exhausted","message":"play acme/rule-03 has spent 15 of its 10 credit budget; ask a human to raise maxCreditsPerPlay"}}
Reopen Gate A with your ruling, and approve the replan in the same step:
gw reopen acme/rule-03 --gate A --comment "Fit threshold 65; keep the cap" --approve
The play replans, the ruling approves the new plan, and Build and Verify run again. Here Verify blocked again, because spend is still over the cap. Raising maxCreditsPerPlay in factory.yaml is the human fix for that, and gw retry resumes:
gw retry acme/rule-03
# acme/rule-03 Gate B · gate · Gate B: approve publishing wf_twin110 at snapshot snap_twin126 · 1 assertion unverified
The cap is checked before each spend-class Clay call, so one call can take a play past it. The next one is refused.
When reopen refuses
| Message | Why | Instead |
|---|---|---|
… is waiting at Gate A, so there is nothing to reopen |
The play is at the gate | gw approve … --comment or gw reject … there |
… is stopped; reopen a gate only on a blocked or manual play |
You took it off the board with gw stop |
gw retry <play> puts it back where it was, then reopen |
… is gate / … is ready |
Reopen works only on a play that stopped for a human (blocked or manual) after the gate | Wait for it to stop, or rule at the next gate |
… hasn't passed Gate A |
Nothing to void | Answer the questions, or gw retry |
Reopening a gate needs a comment |
Rulings are the point | --comment "<rulings>" |
5. Stopping and resuming
gw stop <play> --comment "why" takes a play off the active board. Nothing advances it until gw retry, which puts it back exactly where it was: waiting on questions, at a gate, or blocked. Stopping also withdraws a standing --approve, so a later retry never approves a plan you haven’t seen.
gw stop acme/lal-cap --comment "AE team on offsite until Monday"
gw retry acme/lal-cap
Where rulings live
| File | What |
|---|---|
plays/<client>/<play>/approvals/ |
Signed approval and void records, with the artifact hash |
plays/<client>/<play>/feedback/ |
Your rulings, rejections, reopen reasons and acceptances, in your words |
plays/<client>/<play>/events.jsonl |
gate.decided, gate.reopened and the rest, in order |
clients/<client>/decisions.md |
Decisions that should hold for every future play: record them with gw client decide |
If a ruling is really a client-wide rule (“never auto-enroll”, “Slack alerts go to #ae-desk”), record it as a decision as well, so the next play doesn’t ask:
gw client decide acme outreach.handoff "AE rep task with draft attached; never auto-enroll" --note "ruled on champions-01, Gate A"
Verification
Verified on the twin (isolated factory). With a needs-ruling.md placed in the play folder by hand, gw show printed it, gw approve --gate A without --comment was refused with the message above, and gw reject --gate A --comment … --approve replanned and approved in one step (the signed approval’s comment is quoted above). With maxCreditsPerPlay: 10: gw approve --gate A, then gw reject --gate B --comment …, then Verify blocked on budget_exhausted; gw reopen --gate A --comment … --approve replanned, approved and blocked again on the cap; after raising the cap, gw retry reached Gate B. Also checked: gw reopen --gate B --approve refused, gw reopen on a stopped play refused, and gw stop then gw retry resumed.
Not run: gw accept. The twin’s scripted Verify and Audit never stop for a human, so its text comes from src/core/engine.ts (acceptFindings). A real planner writing needs-ruling.md itself was also not run.