github-issue

The github-issue system is the issues of a repository at GitHub. Each verb is a call that the runner makes to GitHub with its credential for the repository.

What a charter sees

iod github writes each issue into the store as the data at github.<org>.<name>.issue.<n>: its title, its state, its labels (a list of names, absent when there are none), its body and its comments. A rule reacts to an issue as it reacts to any data, here to an open issue nobody has labelled yet:

tony
condition:
  subject:
    path: "github.acme.app.issue.*"
    value: !and [{state: open}, !not {labels: null}]

iod github has the flags and the whole payload.

What a charter writes

Comments, a new issue, a closed issue. With -out, the iod carries a rule’s writes back to GitHub. A rule writes an input under github.<org>.<name>.out with to: issue.<n>, and the iod does what it says (the out half of github). So a rule can comment when it labels an issue, or close an issue once its pull request merged, with no task.

What a task can do

A task gets the forge’s issues with a github-issue block for a repository its git block checks out, where the runner’s forge is GitHub.

tony
spawn:
  agent: {name: viff}
  prompt: "File an issue for each TODO in the README, and close each open TODO issue whose TODO is gone."
  environment:
    systems:
      network: {mode: open}
      git: [{repo: acme/app, fetch: {}}]
      github-issue: [{repo: acme/app, create: {}, close: {}}]
  autonomy:
  - {match: {system: github-issue, verb: close}, then: ask}
  - {then: allow}
Tool What it does Step
github-issue-create opens an issue at the repository, with a title and body; the task reads back its number and url github-issue.create, with repo
github-issue-update changes an issue there, by its number: its title, its body, or both. What it does not name stays as it is, and an update that names neither is refused. github-issue.update, with repo, issue
github-issue-list reads the open issues, most recently changed first: each one’s number, title, author, labels, assignees, how many comments it has, and when it last changed. Pull requests are not among them. It reads the first 500 open issues and pull requests together, and says so. github-issue.list, with repo
github-issue-read reads one issue by its number: its state, author, labels, assignees and milestone, its description, and its comments, oldest first, each with its id. It reads the first 500 comments and says so. github-issue.read, with repo, issue
github-issue-comment comments on an issue there, by its number github-issue.comment, with repo, issue
github-issue-close closes an issue there, by its number github-issue.close, with repo, issue

GitHub keeps a pull request’s conversation as an issue’s, so its issue routes take a pull request’s number too. The runner reads the number before each verb that names one, and refuses one that is a pull request, naming the github system’s verb that does it there: update-pr, read-pr, comment-pr or close-pr. A number that is nothing is refused as no issue, and so is the number of an issue transferred to another repository, which GitHub would answer for with the issue where it went: the refusal says where that is. A repository that was renamed is still this repository, and its issues are acted on. So a doer given github-issue and no github block cannot read, change, comment on or close a pull request.

The reads are steps too, as a Slack read is: what the tracker holds is not the task’s until it is read, and a row can keep a task from it. A title, a description and a comment are other people’s words, and they come into the task’s context as written, indented and held to a size as a pull request’s are (github). A task that only reads names the reads: github-issue: [{repo: acme/app, list: {}, read: {}}], or read: {issue: 12} for one issue.

The store holds the issues too, where iod github reflects the repository (what a charter sees). A read here needs no iod, and is the forge’s answer at the moment of the call. GitHub’s list of issues runs a few seconds behind its writes: a list made straight after a create or a close may not show it yet, where a read of the issue by its number does.

Every verb is a step, because each one uses the runner’s credential. So an environment can leave any of them out (above, comment), and an autonomy can refuse or ask about any it gives. In a row or a shape, repo is the repository as host/owner/name, and issue is the number. A script calls the same tools with viff-call-tool, and the same environment and rows decide them.

Where the credential lives

The iod needs a token or a GitHub App with write access on issues for its out half.

The task holds no credential. The runner files, changes, reads, comments and closes with its token for the forge, GITHUB_TOKEN. It calls the API of github.com, or the one that repos.api names.

The operator sets a limit on what any task may do with a repository’s issues, in the runner’s configuration, under each doer whose tasks may use it:

tony
agents:
  claude:
    systems:
      github-issue:
        ceiling: {repo: !regexp "^github\\.com/acme/", create: {}, update: {}, list: {}, read: {}, comment: {}, close: {}}

A ceiling that lists its verbs has only those it lists: one written before update, list and read were verbs lacks them until the operator adds them. A ceiling block that names no verb (github-issue: {ceiling: {}}) allows every verb of the system, these three among them.

Edit on GitHub · viff is a shared runtime for a team's software delivery work.