feat: complete the write toolset (edit/merge/close/labels/assignees)#6
Merged
Conversation
Extends write_tools.py from 3 to 8 gated write tools so the plugin covers the
full GitHub write surface (still behind the per-agent github.write gate):
- github_edit_pr — gh pr edit (+ gh pr ready [--undo]) for title/body/draft
- github_merge_pr — gh pr merge; IRREVERSIBLE, so it refuses without
confirm=true and offers a dry_run preview (defence in
depth on top of the write gate)
- github_close — close/reopen an issue or PR (kind-aware subcommands)
- github_set_labels — gh {issue,pr} edit --add/--remove-label
- github_set_assignees— gh {issue,pr} edit --add/--remove-assignee
Each validates bad_repo(), builds explicit argv, runs via run_gh(), and degrades
to a readable Error string. test_register's WRITE_TOOLS set now covers all 8 (so
the gate test verifies they're all withheld read-only and present when write=true);
test_write_tools adds argv + guard coverage for each. PROTO.md + manifest updated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow. |
There was a problem hiding this comment.
QA Audit — PR #6 | feat: complete the write toolset (edit/merge/close/labels/assignees)
VERDICT: WARN (CI non-terminal — deferred)
CI Status
- test: queued ⏳
Diff Review
test_register.py:WRITE_TOOLSset correctly expanded from 3→8, matching the claimed tool list.test_write_tools.py: New tests cover argv construction, error short-circuits, merge confirm/dry-run guards, and kind-aware close — solid coverage.PROTO.md/protoagent.plugin.yaml: Docs and manifest updated consistently.
Observations
- GAP: CI (
test) is still queued — formal PASS/FAIL deferred to the CI-completion re-dispatch. - GAP:
write_tools.pyimplementation (~300 lines) truncated from diff — tests look correct but implementation unseen. - LOW: clawpatch structural review unavailable (repo not in project registry); proceeding on diff alone.
- No unresolved CodeRabbit threads. Tests appear well-structured with correct guard assertions.
— Quinn, QA Engineer
|
Submitted COMMENT review on #6. |
This was referenced Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends
write_tools.pyfrom 3 → 8 gated write tools, so the plugin covers the full GitHub write surface. All remain behind the per-agentgithub.writegate (a read-only agent never sees them).ghcallgithub_edit_prgh pr edit(+gh pr ready [--undo])github_merge_prgh pr merge --{squash,merge,rebase}confirm=true, offersdry_runpreview, optional--delete-branchgithub_closegh {issue,pr} close|reopenkind-aware; optional--commenton closegithub_set_labelsgh {issue,pr} edit --add/--remove-labelgithub_set_assigneesgh {issue,pr} edit --add/--remove-assigneeIssue-vs-PR ops take a
kind("issue" | "pr") since theghsubcommands differ. Each tool validatesbad_repo(), builds explicit argv, runs viarun_gh(), and degrades to a readableError: …string.Safety
github_merge_pris the one irreversible op — it's double-guarded: the per-agent write gate and aconfirm=truerequirement (with adry_runpreview), so it can't merge accidentally or autonomously even when write is enabled.Tests
test_register.WRITE_TOOLSnow lists all 8 — the gate test verifies every write tool is withheld for a read-only agent and present whengithub.write: true.test_write_toolsadds argv + guard coverage for each new tool (incl. merge's confirm/dry-run refusal and the bad-repo short-circuit).ruff check .,ruff format --check .,pytest -q→ 48 passed.🤖 Generated with Claude Code