Skip to content

feat: complete the write toolset (edit/merge/close/labels/assignees)#6

Merged
mabry1985 merged 1 commit into
mainfrom
feat/write-ops-complete
Jun 24, 2026
Merged

feat: complete the write toolset (edit/merge/close/labels/assignees)#6
mabry1985 merged 1 commit into
mainfrom
feat/write-ops-complete

Conversation

@mabry1985

Copy link
Copy Markdown
Contributor

What

Extends write_tools.py from 3 → 8 gated write tools, so the plugin covers the full GitHub write surface. All remain behind the per-agent github.write gate (a read-only agent never sees them).

Tool gh call Notes
github_edit_pr gh pr edit (+ gh pr ready [--undo]) change title/body and/or draft↔ready
github_merge_pr gh pr merge --{squash,merge,rebase} IRREVERSIBLE — refuses without confirm=true, offers dry_run preview, optional --delete-branch
github_close gh {issue,pr} close|reopen kind-aware; optional --comment on close
github_set_labels gh {issue,pr} edit --add/--remove-label comma-separated add/remove
github_set_assignees gh {issue,pr} edit --add/--remove-assignee comma-separated add/remove

Issue-vs-PR ops take a kind ("issue" | "pr") since the gh subcommands differ. Each tool validates bad_repo(), builds explicit argv, runs via run_gh(), and degrades to a readable Error: … string.

Safety

github_merge_pr is the one irreversible op — it's double-guarded: the per-agent write gate and a confirm=true requirement (with a dry_run preview), so it can't merge accidentally or autonomously even when write is enabled.

Tests

  • test_register.WRITE_TOOLS now lists all 8 — the gate test verifies every write tool is withheld for a read-only agent and present when github.write: true.
  • test_write_tools adds argv + guard coverage for each new tool (incl. merge's confirm/dry-run refusal and the bad-repo short-circuit).
  • Gate green: ruff check ., ruff format --check ., pytest -q48 passed.

🤖 Generated with Claude Code

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>
@protoquinn

protoquinn Bot commented Jun 24, 2026

Copy link
Copy Markdown

👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow.

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_TOOLS set 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.py implementation (~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

@protoquinn

protoquinn Bot commented Jun 24, 2026

Copy link
Copy Markdown

Submitted COMMENT review on #6.

@mabry1985 mabry1985 merged commit 0850ff8 into main Jun 24, 2026
1 check passed
@mabry1985 mabry1985 deleted the feat/write-ops-complete branch June 24, 2026 05:13
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