Skip to content

chore(hook): retire enforce_gh_review_approval (autonomous issue/PR policy) - #403

Merged
ycpss91255 merged 2 commits into
mainfrom
chore/retire-review-approval-hook
Sep 19, 2026
Merged

ycpss91255 merged 2 commits into
mainfrom
chore/retire-review-approval-hook

Conversation

@ycpss91255

Copy link
Copy Markdown
Owner

Summary

Retire the enforce_gh_review_approval.sh PreToolUse hook (issue #34's transcript-approval gate for gh issue|pr create|edit).

  • Removed .agents/hook/enforce_gh_review_approval.sh (the .claude/hook/ path is a directory symlink into .agents/hook/, so nothing else to unlink) and its .claude/settings.json PreToolUse Bash registration.
  • Removed test/unit/hook/enforce_gh_review_approval_spec.bats.
  • test/unit/tool_hook_conformance_spec.bats gains a RETIRED_HOOKS ledger with two meta-tests asserting a retired hook is neither on disk under .agents/hook/ nor registered in .claude/settings.json, so it cannot creep back through a merge or a reflexive restore.
  • .agents/rules/{common,zh}/development-workflow.md: the "GitHub Issue / PR Review Approval (mandatory before gh ... create)" section is replaced by a short "Autonomous issue / PR policy" section (zh file kept in Chinese).
  • CHANGELOG entry under [Unreleased] / ### Removed.

No ADR documents this hook (doc/adr/ has no reference to it or to #34), so there is nothing to mark superseded; the retirement is recorded in the CHANGELOG and the rules docs.

Why

Maintainer policy (2026-09-16/19): issues and PRs no longer wait for a per-item human draft approval. Agents create and merge them autonomously once TDD + CI (ci-passed) are green; only a release tag still needs the maintainer's explicit consent. The transcript-approval gate (approve issue / approve pr / skip review phrases, ECC_ALLOW_GH_REVIEW=1 bypass) therefore no longer applies and only blocks the autonomous flow.

The English-only hook (enforce_gh_english.sh), --body-file discipline, and the issue-template hook are unchanged and still apply. Scoping the English-only hook to this repository is a separate PR.

Test plan

TDD: the two RETIRED_HOOKS meta-tests were added first and run in Docker against the untouched tree (RED), then the hook, its registration, and its spec were removed (GREEN).

RED (before removal):

not ok 9 every retired hook is absent from .agents/hook/
#   enforce_gh_review_approval.sh: still exists under .agents/hook/ — it was retired, delete it
not ok 10 every retired hook is not registered in .claude/settings.json
#   enforce_gh_review_approval.sh: still registered in .claude/settings.json — it was retired, drop the entry

GREEN (after removal):

ok 9 every retired hook is absent from .agents/hook/
ok 10 every retired hook is not registered in .claude/settings.json

Gates (Docker):

  • just -f justfile.ci lint
  • just -f justfile.ci test-unit

just -f justfile.ci lint tail:

[ci] Running ShellCheck
[ci]   found 355 shell script(s)
[ci] ShellCheck OK
[ci] Running fish -n syntax check
[ci]   checked 24 fish script(s); 0 failed
[ci] fish syntax OK
[ci] Running Hadolint on dockerfile/Dockerfile.test-tools
[ci] Running Hadolint on dockerfile/Dockerfile.kcov-tools
[ci] Hadolint OK
exit=0

just -f justfile.ci test-unit tail (full unit tree, 1..7465, no not ok):

ok 7199 executing tui_backend.sh directly warns that it is a library (source guard)
ok 7200 _tui_category_entry emits nothing for an unknown category (defensive default)
...
exit=0

Verified grep -rn enforce_gh_review_approval --exclude-dir=.git . finds no remaining reference outside the CHANGELOG history and the new retired-hooks ledger.

…olicy)

Issues and PRs are now created and merged by agents once TDD + CI
(ci-passed) are green; only a release tag still needs the maintainer's
explicit consent. The transcript-approval gate from issue #34 therefore
no longer applies.

- Remove .agents/hook/enforce_gh_review_approval.sh and its PreToolUse
  Bash registration in .claude/settings.json.
- Remove test/unit/hook/enforce_gh_review_approval_spec.bats.
- test/unit/tool_hook_conformance_spec.bats: add a RETIRED_HOOKS ledger
  with two meta-tests asserting a retired hook is neither on disk nor
  registered in settings.json (RED before removal, GREEN after).
- .agents/rules/{common,zh}/development-workflow.md: replace the review-
  approval section with a short "Autonomous issue / PR policy" section.
- CHANGELOG: entry under [Unreleased] / Removed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NX5H2vuMTv4mBmjpPYoS3s
@ycpss91255
ycpss91255 enabled auto-merge (squash) September 19, 2026 09:44
@ycpss91255
ycpss91255 merged commit e1a6b47 into main Sep 19, 2026
19 checks passed
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.

1 participant