diff --git a/engine/hooks/gh-write-verification/README.md b/engine/hooks/gh-write-verification/README.md new file mode 100644 index 0000000..e0d30e1 --- /dev/null +++ b/engine/hooks/gh-write-verification/README.md @@ -0,0 +1,136 @@ +# gh-write-verification + +One principle, three detectors: **a write's report is not the write's +effect.** A command that changes remote state has to leave behind evidence +the agent actually looked at, and that evidence has to be the effect itself +— not the tool's own claim about it. + +## 1. `gh pr edit` is refused on every flag (PreToolUse) + +`gh pr edit` eagerly queries `repository.pullRequest.projectCards`, a sunset +Projects-classic GraphQL field, and exits 1 before writing anything — +`--base`, `--add-label`, `--title`, `--body`, all of them. The equivalent +REST calls work. + +**Fires on:** any `gh pr edit ...` in a shell tool call. +**Stays silent on:** `gh pr view`, `gh api` reads, and the `gh api` writes it +redirects to. + +The block names the replacements: + +```sh +gh api -X PATCH repos///pulls/ -f base= +gh api -X POST repos///issues//labels -f 'labels[]=