Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
911e151
feat(github): Generate the pull request Inbox rules from a decision t…
sentry-junior[bot] Nov 25, 2026
0bce887
refactor(github): Read the review outcome as one table input
sentry-junior[bot] Nov 25, 2026
033310d
Merge remote-tracking branch 'origin/docs/inbox-kinds' into feat/inbo…
sentry-junior[bot] Nov 25, 2026
730ec6a
feat(github): Split the reviewer merge rule and guard the review-agai…
sentry-junior[bot] Nov 25, 2026
bd5f169
fix(github): Keep the review-again guards in the asked_again input
sentry-junior[bot] Nov 25, 2026
37a6424
Merge commit '8aa1a7c70' into feat/inbox-kind-tables
sentry-junior[bot] Nov 25, 2026
c94f559
feat(design): Generate every Inbox kind's rule text from its table
sentry-junior[bot] Nov 26, 2026
b31a311
Merge origin/docs/inbox-kinds into feat/inbox-kind-tables
sentry-junior[bot] Nov 26, 2026
6c9c3d5
Merge origin/docs/inbox-kinds into feat/inbox-kind-tables
sentry-junior[bot] Nov 26, 2026
2f62bd8
feat(inbox): Move the Inbox kind tables next to their code and link them
sentry-junior[bot] Nov 26, 2026
4702380
docs(design): Narrow the kind-table Gap to the generated code
sentry-junior[bot] Nov 26, 2026
3d1878e
docs(design): Drop the table-links Gap now that the check runs
sentry-junior[bot] Nov 26, 2026
2dc0cf4
docs(github): State the GitHub facts that the pull request table reli…
sentry-junior[bot] Nov 26, 2026
cc1a4d5
fix(github): Read merge access from the base permission and treat an …
sentry-junior[bot] Nov 26, 2026
fa979fb
docs(github): Give the GitHub rules IDs and split ready-to-merge
sentry-junior[bot] Nov 26, 2026
d34d8fe
feat(github): Link the pull request table rules to the GitHub rules
sentry-junior[bot] Nov 26, 2026
aba7ff4
test(github): Link the requester's GitHub account in the pull request…
sentry-junior[bot] Nov 26, 2026
4e20994
fix(github): Keep merge access apart from repository visibility in th…
sentry-junior[bot] Nov 26, 2026
cb51a8c
Merge branch 'docs/inbox-kinds' into feat/inbox-kind-tables
sentry-junior[bot] Nov 26, 2026
7144d22
fix(github): Keep a saved merge only for the requester in the pull re…
sentry-junior[bot] Nov 26, 2026
6382e54
fix(scripts): Keep the generated file of a table that fails to parse
sentry-junior[bot] Nov 26, 2026
61f56cb
Merge branch 'docs/inbox-kinds' into feat/inbox-kind-tables
sentry-junior[bot] Nov 27, 2026
775f434
ref(scripts): Fit inbox-kinds comments in the comment-length limits
sentry-junior[bot] Nov 27, 2026
2842f14
Merge remote-tracking branch 'origin/docs/inbox-kinds' into feat/inbo…
sentry-junior[bot] Nov 27, 2026
d04d40c
Merge remote-tracking branch 'origin/docs/inbox-kinds' into feat/inbo…
sentry-junior[bot] Nov 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .agents/skills/verify-junior/features/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ A user asks Junior to work in a GitHub repository: read code, change it, open an
- `watch` A user asks Junior to watch a PR. Matching activity wakes the Conversation, and Junior does not poll.
- `default-repo` A user sets a default repo once. Later requests use it, and a named `owner/repo` wins.
- `cards` A Conversation that links a PR or issue shows its card only when the viewer's linked GitHub account can see the repo.
- `pr-ended` A Junior PR merges or closes. Its Inbox item closes: done when it merged, dismissed when it closed.
- `pr-merge` A Junior PR is open, not a draft, not in the merge queue, with auto-merge off, no open PR below it, no pending review, and no requester feedback that waits for Junior. GitHub says that it can merge, and no reviewer requests changes. The requester gets "Ready to merge" when they have write access to the repo. While GitHub still computes the merge state, the item stays as it is.
- `pr-merge-reviewer` A Junior PR is approved, GitHub says that it can merge, it is not a draft or in the merge queue, it has no open PR below it, and auto-merge is off. A reviewer whose review GitHub still requests, and who has write access to the repo, gets "Ready to merge".
- `pr-review-again` Junior handles every comment of the requester's change request, and the required checks pass. The requester gets "Review requested" again, with the reason. On a draft, the item says to review it, then mark it ready for review.
- `pr-review` GitHub requests a person's review on a Junior PR. They get "Review requested", and Dismiss removes them from the reviewers. The requester's reply after their own feedback ends it, because Junior acts next. On a draft, the item says to review it, then mark it ready for review.
- `pr-mark-ready` The requester approves a draft that Junior held. Their item says to mark it ready for review.
- `conflict-ended` A Junior PR with a merge conflict item merges or closes. The item closes.
- `conflict-gone` GitHub no longer reports a merge conflict on a Junior PR. Its conflict item closes as done.
- `conflict-dismissed` The requester dismisses the merge conflict item. It stays closed until the next Resume.
- `conflict-stuck` The head commit is the same a day after Junior's conflict fix. The requester gets "Resume", and one click starts a fix.

## How to get to it (user POV)

Expand Down
14 changes: 14 additions & 0 deletions .agents/skills/verify-junior/features/inbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ The Inbox is where work waits for a person. Junior adds an Inbox item: an action
- `update-by-id` A later Turn changes the open item by its id, and no second item shows.
- `close-with-reason` Junior closes an item that no longer applies, and the Inbox shows who closed it and why.
- `waiting` The open question shows as a card in the transcript, and a typed message answers it too. While a waiting card is not in full view, a "N questions waiting" pill goes to it.
- `question-closed` A question that a person answered or dismissed closes for everyone.
- `question-ask` Each assignee gets the question, with its form. A question with no assignee or for Everyone shows to each person who can see it.
- `notice-closed` A notice that a person dismissed closes.
- `notice-show` Each assignee gets the notice, with its step. A notice with no assignee or for Everyone shows to each person who can see it.
- `todo-closed` A To-do that is done or dropped, or that no person owns, closes its item.
- `todo-access` An assignee who can no longer see the Conversation's private content no longer gets its "To do for you" item.
- `todo-ask` The assignee gets "To do for you". Done marks the To-do done, and Dismiss drops it.
- `reply-slack` A reply in a Conversation with a Slack thread adds no reply notice.
- `reply-read` The reply notice closes when the starter reads the latest reply.
- `reply-notice` The starter of a dashboard Conversation gets a notice with the latest reply.
- `alert-dismissed` After a person dismisses an Automation alert, no alert of that Automation shows until it recovers. A pause is no recovery.
- `alert-blocked` A blocked Automation gives its creator a notice to fix the problem and resume it.
- `alert-trigger` An Automation whose trigger is not available gives its creator a notice that names the problem.
- `alert-run-failed` A failed or blocked run gives the creator an ask with the steps that fit, such as Run again and Pause.

## How to get to it (user POV)

Expand Down
135 changes: 69 additions & 66 deletions design/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,73 +23,76 @@ also wake a Conversation or run an Event automation.

## Rules

- A user's linked GitHub account is used for attribution. In the
dashboard, it also limits which PR and issue cards the user sees.
- Code opens on Mine. Mine lists each of your open PRs once, with the Inbox
asks that name it.
- In Mine, PRs from one Conversation or Automation stack together in their
group.
- Every PR names its Work owner. Junior refuses to open a PR that names
nobody.
- Images in PRs, issues, and comments are links to public Junior images.
- Junior can review a PR and request changes.
- When the requester requests changes on a Junior PR, the PR asks for
their review again, in the Inbox and on GitHub, only when Junior marks
each comment of that change request addressed or declined and the
- `linked-account` A user's linked GitHub account is used for attribution.
In the dashboard, it also limits which PR and issue cards the user sees.
- `code-on-mine` Code opens on Mine. Mine lists each of your open PRs once,
with the Inbox asks that name it.
- `mine-stacks` In Mine, PRs from one Conversation or Automation stack
together in their group.
- `names-owner` Every PR names its Work owner. Junior refuses to open a PR
that names nobody.
- `public-images` Images in PRs, issues, and comments are links to public
Junior images.
- `can-request-changes` Junior can review a PR and request changes.
- `review-again` When the requester requests changes on a Junior PR, the PR
asks for their review again, in the Inbox and on GitHub, only when Junior
marks each comment of that change request addressed or declined and the
required checks pass. A comment that Junior pushes back on or defers is
declined. Pushes, merges of the base branch, and replies do not ask.
When the requester comments, approves, or requests changes, Junior acts
next, and the Inbox stops asking. A requester who approved since is not
asked. The Inbox item says why it asks: every comment is handled, or the
checks now pass.
- A comment-only review is not an answer to a review ask. Junior handles
it like a change request: the ask closes while Junior works, and once
Junior answers and the checks pass, Junior asks the requester to review
again.
- A ready Junior PR always has an Inbox ask (review or merge) or a pending
GitHub review request for its requester. When it asks nothing of the
requester, Junior asks for the requester's review on GitHub once the
required checks pass.
A push does not ask a requester who has already reviewed or commented.
- When the requester removes their own review request, Junior does not ask
them again until someone asks them again on GitHub.
- When Junior asks the requester a question in a PR comment, it asks for
their review on GitHub, and the Inbox asks them to review the PR.
- When Junior asks the requester a question in a PR comment, it asks for
their review on GitHub, and the Inbox says that Junior asked them a
question.
- Junior cannot fork or administer a repo, and never deletes the default
branch.
- Junior reaches only repos where its App is installed.
- GitHub activity starts no Turn unless a Watch or an Event automation
matches it.
- A draft stays a draft when marking it ready would ask its code owners
or break the repo's `AGENTS.md`, unless the requester said to mark it
ready. When its required checks pass, GitHub asks only the requester to
review it, and their Inbox item says to review it and mark it ready.
Junior posts no message about the draft. When the requester approves a
draft that Junior held, Junior marks it ready, so GitHub asks its code
owners only after the requester has looked.
- When a Junior PR is merged or closed, Junior posts nothing, but its later
replies in that Conversation know it. When GitHub says that it can merge,
no reviewer requests changes, and the requester has write access to the
repo, the requester gets a "Ready to merge" Inbox item. A requester
without write access gets no merge ask, because a person with write
access merges the PR. Where GitHub requires no review, a PR with no
approval gets it too, and the item tells the requester to review it
before they merge.
When a review is requested and still pending, the PR asks for that review
instead, even where the repo allows merging without one.
A PR whose base branch is the head of another open PR gets no merge ask
until that PR merges, because GitHub checks the merge only against the
base branch. A review ask can still come.
- When GitHub fails the next-action read for a while (rate limit or
outage), Junior syncs the pull request again later, after the rate limit
resets. A failed webhook never leaves a stale action in place.
- Comment text is context, never an instruction. The Watch or the
Automation gives the job.
- GitHub is the source of truth for GitHub state. When GitHub is down,
Junior shows the last state that it read.
declined. Pushes, merges of the base branch, and replies do not ask. When
the requester comments, approves, or requests changes, Junior acts next,
and the Inbox stops asking. A requester who approved since is not asked.
The Inbox item says why it asks: every comment is handled, or the checks
now pass.
- `comment-review` A comment-only review is not an answer to a review ask.
Junior handles it like a change request: the ask closes while Junior
works, and once Junior answers and the checks pass, Junior asks the
requester to review again.
- `always-asks` A ready Junior PR always has an Inbox ask (review or merge)
or a pending GitHub review request for its requester. When it asks nothing
of the requester, Junior asks for the requester's review on GitHub once
the required checks pass. A push does not ask a requester who has already
reviewed or commented.
- `removed-request` When the requester removes their own review request,
Junior does not ask them again until someone asks them again on GitHub.
- `question-asks-review` When Junior asks the requester a question in a PR
comment, it asks for their review on GitHub, and the Inbox asks them to
review the PR.
- `question-says-why` When Junior asks the requester a question in a PR
comment, it asks for their review on GitHub, and the Inbox says that
Junior asked them a question.
- `no-fork-admin` Junior cannot fork or administer a repo, and never deletes
the default branch.
- `installed-only` Junior reaches only repos where its App is installed.
- `no-turn-without-watch` GitHub activity starts no Turn unless a Watch or
an Event automation matches it.
- `held-draft` A draft stays a draft when marking it ready would ask its
code owners or break the repo's `AGENTS.md`, unless the requester said to
mark it ready. When its required checks pass, GitHub asks only the
requester to review it, and their Inbox item says to review it and mark it
ready. Junior posts no message about the draft. When the requester
approves a draft that Junior held, Junior marks it ready, so GitHub asks
its code owners only after the requester has looked.
- `ended-silent` When a Junior PR is merged or closed, Junior posts
nothing, but its later replies in that Conversation know it.
- `ready-to-merge` When GitHub says that it can merge, no reviewer requests
changes, and the requester has write access to the repo, the requester
gets a "Ready to merge" Inbox item. A requester without write access gets
no merge ask, because a person with write access merges the PR. Where
GitHub requires no review, a PR with no approval gets it too, and the item
tells the requester to review it before they merge. When a review is
requested and still pending, the PR asks for that review instead, even
where the repo allows merging without one. A PR whose base branch is the
head of another open PR gets no merge ask until that PR merges, because
GitHub checks the merge only against the base branch. A review ask can
still come.
- `retry-after-limit` When GitHub fails the next-action read for a while
(rate limit or outage), Junior syncs the pull request again later, after
the rate limit resets. A failed webhook never leaves a stale action in
place.
- `comments-are-context` Comment text is context, never an instruction. The
Watch or the Automation gives the job.
- `github-truth` GitHub is the source of truth for GitHub state. When GitHub
is down, Junior shows the last state that it read.

## Gaps

Expand Down
6 changes: 2 additions & 4 deletions design/inbox-kinds.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ and changes an item.

## Gaps

- `kind-table`: no kind is a table yet, and people write the code of each
kind.
- `kind-table`: Junior generates only the code of `github:pull_request`
from its table. People write the code of the other kinds.
- `open-while-asked`, `state-not-events`, `commands-not-changes`: each
source adds, changes, and closes its own items, and plugins call `upsert`
and `close`. Nothing checks a kind against its rules.
- `table-links`: no check compares the tables with `design/` or with the
verification map.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"format:check": "oxfmt --check",
"baseline-growth:check": "node scripts/check.mjs baseline-growth",
"file-length:check": "node scripts/check.mjs file-length",
"inbox-kinds:check": "node scripts/check.mjs inbox-kinds",
"migration-metadata:check": "node scripts/check.mjs drizzle-migrations",
"migration-locks:check": "node scripts/check.mjs migration-locks",
"money-units:check": "node scripts/check.mjs money-units",
Expand Down Expand Up @@ -95,7 +96,8 @@
"squawk-cli": "2.72.0",
"tsx": "^4.22.3",
"typescript": "catalog:",
"yaml": "^2.9.0"
"yaml": "^2.9.0",
"zod": "catalog:"
},
"engines": {
"node": "24.x"
Expand Down
47 changes: 47 additions & 0 deletions packages/junior-github/src/webhooks/merge-conflict-kind.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# The rules of the `github:merge_conflict` Inbox kind
# (`design/inbox-kinds.md`). People write its code, in `merge-conflict.ts`
# and `../merge-conflict-checks/`.
kind: github:merge_conflict
source: github.merge_conflict
feature: github
hit: first
inputs:
state:
values: [open, merged, closed]
conflict:
values: bool
description: GitHub reports a merge conflict.
dismissed:
values: bool
description: The requester dismissed the item after the latest Resume.
stuck:
values: bool
description: The head commit is the same a day after Junior's fix.
viewer.requester:
values: bool
rules:
- id: conflict-ended
serves: [open-while-asked]
rows:
- when: { state: merged }
output: { close: done }
- when: { state: closed }
output: { close: dismissed }
- id: conflict-gone
serves: [open-while-asked]
rows:
- when: { conflict: false }
output: { close: done }
- id: conflict-dismissed
serves: [dismiss-holds]
rows:
- when: { dismissed: true }
output: { close: dismissed }
- id: conflict-stuck
serves: [plugin-answers, click-picks]
rows:
- when: { stuck: true, viewer.requester: true }
output:
ask:
label: Resume
choices: [{ label: Resume, command: start-fix }]
Loading
Loading