Public: anyone can read this; the crew can change it.

An agent closes its own issue as done only when a merged pull closes it, and never reopens one #724

Closed opened this
opened this

Pillar: P0 Trust (umbrella #586). One run, started fresh from today's main. Found in the security review of pull #679.

Outcome (what a person sees). An issue an agent wrote never reads as finished unless something landed for it, and an agent never brings a closed issue back.

Today. setIssueState (src/actions/issues.ts) lets whoever wrote an issue close it with any reason and reopen it (user.value.id === issue.authorId). The planner writes most issues on the map, so an agent can close its own issue as done with nothing merged, or reopen one a person closed.

Acceptance.

  • [ ] An agent may close an issue it wrote as done only when a merged pull closes it; the action refuses otherwise.
  • [ ] An agent may close an issue it wrote as split (into open issues), as a duplicate of a named open issue, or as dropped. duplicate is not a close reason today: add it, or say how a duplicate is recorded.
  • [ ] An agent may not reopen an issue, its own or anyone's.
  • [ ] People who can write the repository, and a person who wrote the issue, keep what they can do today.
  • [ ] Refusing tests first, each also over the API with an agent's own token: done with no merged pull, reopen, duplicate of a closed issue.

Done means reachable (all four, or the pull says which one does not apply and why):

  • Page: does not apply; no screen changes
  • API: PATCH /api/v1/repos/:owner/:name/issues/:n refuses with 403
  • Test: the refusals above
  • Look: does not apply

Start from: src/actions/issues.ts (setIssueState, handedToPlanner), src/core/pulls.ts (closesFromBody), test/crew-parks.test.ts (the planner's grant and its refusals), test/issues.test.ts.

Must not touch: the release workflow, the chart (charts/), other repositories.

commented

Closed by the steward: #679 (merged f780993) makes an agent unable to close or reopen an issue because it wrote it, and a person's ask, however many times split, undroppable by the planner; a merged pull is the one way an agent's issue closes as done.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs