Skip to content

feat(gate): explicit approve and a machine-readable decision - #122

Merged
backnotprop merged 1 commit into
mainfrom
feat/gate-mode
Oct 28, 2026
Merged

backnotprop merged 1 commit into
mainfrom
feat/gate-mode

Conversation

@backnotprop

Copy link
Copy Markdown
Contributor

Adds an opt-in gate mode, matching plannotator annotate --gate in the browser. Without --gate, nothing changes.

  • plannotator-tui <file|folder> --gate adds Approve (A, plus a header button). Approving with notes unsent is allowed. Send still means "annotated", and quitting means "dismissed".
  • --json prints {"decision":"approved|annotated|dismissed","feedback":"..."}, the same records as the browser.
  • --require-approval exits with 0 when approved, 1 when annotated or dismissed, and 2 when the gate itself fails.
  • --result-file <path> writes the decision atomically and never overwrites an existing file.
  • herdr open --gate [--deliver-to PANE] [--result-file PATH] sends the agent "The user approved.", the browser's approved-with-notes message, or the numbered feedback as today, and writes the result file.
  • Decisions go into the shared feedback archive the way the browser records them (approved, approved-with-notes, feedback, dismissed).

Limits:

  • The TUI draws on stdout, so a gated review needs a terminal there. Scripts read --result-file and can't capture stdout.
  • herdr open --gate returns as soon as the pane opens, so its exit code doesn't carry the decision.
  • The content digest (point 5) is not built.

Closes #121

- `plannotator-tui <file|folder> --gate` adds Approve (`A`, and an
  `Approve (A)` header button) beside Send and quit. The review ends with
  one decision: approved (unsent notes ride along as approval notes),
  annotated (a successful send) or dismissed (quit). Without `--gate`
  nothing changes.
- output matches `plannotator annotate --gate`: plaintext `The user
  approved.` or the approved-with-notes message; `--json` prints
  `{"decision","feedback"}` plus `annotationCount` and `target`;
  `--require-approval` exits 0 only on approval; `--result-file`
  publishes the strict record atomically and never overwrites. Strict
  flags need `--gate --json`, and the gate's own failures exit 2.
- `herdr open --gate [--result-file PATH]` delivers the approval message
  or the numbered feedback to the agent pane and publishes the result.
- the feedback archive records approved, approved-with-notes and
  dismissed in the browser's shape.

refs #121
@backnotprop
backnotprop added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 86bd358 Oct 28, 2026
3 checks passed
@backnotprop
backnotprop deleted the feat/gate-mode branch October 28, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gate mode: explicit Approve with a machine-readable decision (parity with plannotator annotate --gate)

1 participant