Skip to content

feat(issues): write to GitHub issues, each write off until the owner turns it on - #59

Merged
leemour merged 4 commits into
mainfrom
feat/issue-writes
Dec 6, 2026
Merged

leemour merged 4 commits into
mainfrom
feat/issue-writes

Conversation

@leemour

@leemour leemour commented Dec 6, 2026 •

Copy link
Copy Markdown
Member

The owner's ruling NEED-3013: gthb writes to issues, off by default. Plan: cli-private plans/2026-12-01-github-cli/writes.md (cli-private #659). Slice 1 of 3; pull requests and Projects v2 are planned only.

What

  • cli-core's issues create, issues update (title, text, --status Closed / "Closed as not planned" / "Closed as duplicate" / Open, --label, --add-label, --remove-label, --assignee) and issues comments create now reach GitHub through src/github/writer.ts.
  • Off by default. issues.create, issues.update, issues.comments.create are deny (WRITE_DEFAULTS, src/config.ts); issues.assign-others keeps cli-core's deny. Only the exact key lifts it (issues: allow does not). ask asks at a terminal and needs --yes elsewhere; over MCP ask goes ahead (WC-MCP-7), documented in README and skill.
  • One door. Writes go through cli-core's serviceApiWriter over three allowlisted operations (WRITES, scripts/spec-model.ts); the api group keeps effects: ["read"] and offers no raw write. The command key is checked again on the send path; the owner is asked once.
  • No redirect for a write (fresh-agent security review, blocker fixed): a transferred issue's 301 is refused instead of re-sending the PATCH to another repository. Shared fix filed as cli-core#3798.
  • Labels and logins come from the copy; only the profile's chosen repositories are written; labels and assignees GitHub drops for a sign-in without push access are reported (sent: true); a read-only token's 403 says it needs Issues: Read and write. --priority, --project, --due, --parent, moving an issue and creating a closed one are refused before any call (cli-core gap G-W1).
  • No merge, no code write.
  • cli-testing 0.7.3 → 0.7.5: its deny contract accepts a key that is deny by default.

Testing

  • src/writes.test.ts (18 tests over the strict fake): refused at defaults (with --yes, --dry-run, GTHB_READ_ONLY, a broader issues: allow, ask without a terminal), one question with api: ask too, text sent as one JSON value, create/close/reopen/labels/assignee, fresh labels, silent drops, 403, 301 not followed (mutation-checked), no raw api issues create. src/mcp.test.ts: an agent's gthb_write is refused at defaults with no request.
  • Local: standards, deps, lint, typecheck, test:coverage (945 passed), lint:commands, audit, contracts (deny checks for the three writes pass), test-matrix, docs, generate, version, no-leak, package.
  • Live, profile leemour, leemour/brazecli#49: issues comments create … --yes, its --dry-run, and issues create … --yes all exit 5 permission_error (deny from the default), no request. The profile's token is read-only, so a real write is left to the owner.

🤖 Generated with Claude Code

Conformance

  • Live check: 0.2.3 7bd609844437dd11252442b6084020165ce14257 2026-12-06 scripts/live.sh v2:1cb00bcf495a813b51e8cb87ec0776625f16d02bf4b91ccc3d124ac2f1f8b090
  • Live check: 0.2.2 c0f48a14c1a4798cb21b21ead5165c38395dd046 2026-12-06 scripts/live.sh v2:ba81ab8056289e4f7ccf52fe4e91ac63e110043cf5b1bc5969575e95fdb96b67
  • Live check: 0.2.2 170697794abbdc671b14d27b8f6b623ace207e78 2026-12-06 scripts/live.sh v2:7316351187a70a3fbc25108962cee784a05cea0e125367a77f51682680fe33f1

@socket-security

socket-security Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​wirecat/​cli-testing@​0.7.3 ⏵ 0.7.590 -4100100 +195 +1100

View full report

leemour and others added 3 commits December 6, 2026 12:15
…turns it on

The owner's ruling NEED-3013. cli-core's `issues create`, `issues update`
and `issues comments create` now reach GitHub through a GitHub writer:
title, text, open or closed (completed, not planned, duplicate), labels and
the one assignee, and comments.

- Each key (issues.create, issues.update, issues.comments.create) is deny
  by default; issues.assign-others keeps cli-core's deny. Only the exact
  key lifts it. `ask` asks at a terminal, needs --yes elsewhere, and goes
  ahead over MCP (WC-MCP-7).
- Writes go through serviceApiWriter over three allowlisted operations
  kept by the spec model; the api group stays read-only. The command key is
  checked again on the send path, and the owner is asked once.
- A write follows no redirect: an issue transferred since the sync is
  refused, never changed in a repository the owner did not choose
  (security review; cli-core#3798 for the shared fix).
- Labels and logins come from the copy; only chosen repositories are
  written. Labels GitHub drops for a sign-in without push access are
  reported; a read-only token's 403 names Issues: Read and write.
- The strict fake takes the writes and refuses as GitHub does (403, 301,
  silent drops); the live check proves a write is refused by default.
- cli-testing 0.7.5: its deny contract accepts a key denied by default.

Plan: cli-private plans/2026-12-01-github-cli/writes.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… terminal

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour merged commit 4d7f2e3 into main Dec 6, 2026
17 of 18 checks passed
@leemour
leemour deleted the feat/issue-writes branch December 6, 2026 11:41
leemour added a commit that referenced this pull request Dec 6, 2026
0.2.4's registry publish failed with 422: the description had grown to 113 characters in #59.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leemour added a commit that referenced this pull request Dec 6, 2026
0.2.4's registry publish failed with 422: the description had grown to 113 characters in #59.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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