Skip to content

feat(tools): gh read ops — issue_view, issue_list, pr_view - #39

Merged
ajianaz merged 1 commit into
developfrom
feat/gh-read-ops
Aug 27, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/gh-read-ops

Conversation

@ajianaz

@ajianaz ajianaz commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What

Adds three whitelisted read operations to the gh tool: issue_view (fetch one issue as JSON), issue_list (list issues, optional state filter + limit), and pr_view (fetch one PR incl. mergeable + statusCheckRollup). All free-form inputs are validated before spawn — number digits-only, state whitelist (open|closed|all), limit digits 1..=200 — same argument-injection discipline as the write ops. --repo stays fixed at registration.

JSON field sets are deliberately minimal (no author emails, bounded payloads).

Why

E8 MVP gate retro, backlog item #1 (highest impact): the agent had no way to read issues/PRs, so every mission prompt had to embed the issue body manually. With read ops the agent can pull its own work items — mission prompts shrink to a pointer (fix issue #33), and self-verification (CI status via pr_view.statusCheckRollup) becomes possible.

Testing

  • 2 new unit tests: exact argv construction for all three ops (incl. --json field quoting), and injection rejection (number=--repo, state=--limit, state=OPEN, limit=999, missing number).
  • 114/114 tests pass, clippy clean.
  • Live validation: agent session s-1a041d61c85-1418d4 ran issue_view on the real issue docs: README status line stale — says Phase 0 while Phase 2 is nearly complete #33 via the tool and answered its title and content correctly — the exact workflow this PR enables.

The agent can now read GitHub state itself; mission prompts no longer
need to embed issue bodies. Whitelisted read ops, same argv validation
discipline as the write ops:

- issue_view NUMBER: --json number,title,body,state,url,labels,
  createdAt,closedAt
- issue_list: --json number,title,state,url,updatedAt, optional
  state=open|closed|all (whitelisted) and limit (digits, 1..=200)
- pr_view NUMBER: --json number,title,body,state,url,baseRefName,
  headRefName,mergeable,statusCheckRollup

All free-form inputs (number/state/limit) validated before spawn;
repo stays fixed at registration. Tool remains Risk::Write as a whole
(per-op risk would need a trait change — noted for later); the
approval prompt shows the exact read command anyway.

Live validation: agent session read real issue #33 via issue_view and
answered title + content correctly. 114/114 tests, clippy clean.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 6254151 into develop Aug 27, 2026
11 checks passed
@ajianaz
ajianaz deleted the feat/gh-read-ops branch August 27, 2026 06:14
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