Skip to content

Code Review

Stratum’s merge gate decides whether a change may land. Code review is how people say whether it should. The two are independent: a change can be green on every evaluator and still sit unapproved, and no amount of approval lets a change past a failing required evaluator.

Everything here works on a change, from the change page in the web UI or through the API.

The change page is built to answer two questions before you give a verdict: what is this change, and what did the gates look at.

  • The heading is the change’s title, and its description follows. Whoever opened the change sets them, and anyone who can write to the project can edit them afterwards. A change that has no title at the moment is headed by the subject of its first commit instead. The change id, who opened it and the agent that wrote it are on the line beneath.
  • Files changed gives the totals, lists the commits the workspace adds, and shows the diff. The diff is what the workspace changed since it forked from the project. If the project has moved on since, the page says how many commits the workspace is behind and which commit the diff starts from; those newer commits are not part of the change.
  • Evaluator evidence shows the latest evaluation: when it ran, which revision it judged, and each evaluator’s verdict and findings. Earlier evaluations of the same change are folded away beneath it, since a newer one replaces them. The exception is an evaluator the latest evaluation did not run: merging is decided on each evaluator’s newest result, so that earlier result still counts, and it stays in view under “Still counted from an earlier evaluation”.
  • Checks, where the project declares any, are the results its runner reported for that same revision.

Once a change has been promoted to a GitHub pull request the page says so and links to it: review and merging then happen on GitHub (see Reviewing in GitHub instead). The diff stays visible here so the page still says what the change is.

Promotion opens the pull request as a draft. While it is one, the page’s button is Mark ready for review, which takes it out of draft on GitHub without leaving Stratum. Once the pull request is ready, whichever side that happened on, the button becomes Open GitHub PR. The text above it links to the pull request in both states.

Marking ready is a person’s step, done here signed in or on GitHub: an agent, a scoped API token or an OAuth connection (an MCP client, the CLI) can only open a draft and cannot mark one ready. When one of them promotes a change again after a review asked for changes, its pull request goes back to draft before the new commits are pushed, and a person marks it ready again. On a repository whose workflows deploy or test pull requests with secrets, that step is what decides when the new code runs with them.

A comment is either floating — attached to the change as a whole — or anchored to a line of the diff.

Terminal window
# A floating comment on the change
curl -X POST https://app.usestratum.dev/api/changes/chg_123/comments \
-H "Authorization: Bearer stratum_user_xxxxx" \
-H "Content-Type: application/json" \
-d '{"body": "Worth a follow-up issue, not a blocker."}'

To anchor a comment to a line, pass file and line together. line is 1-based. side (old or new) picks which half of the diff the line belongs to, and commitSha records the commit the anchor was taken against — both are accepted only alongside a file+line anchor.

Terminal window
curl -X POST https://app.usestratum.dev/api/changes/chg_123/comments \
-H "Authorization: Bearer stratum_user_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"body": "This retries on a 4xx — the circuit breaker will trip on client errors.",
"file": "src/github/client.ts",
"line": 214,
"side": "new",
"commitSha": "a1b2c3d4..."
}'

Anyone who can read the project may comment — including agents. Comments are capped at 20,000 characters.

Passing parentCommentId posts a reply into an existing thread:

  • The parent must belong to the same change.
  • Replies inherit the thread’s anchor, so the anchor fields must be omitted.
  • Replies to replies are flattened onto the thread root — threads are one level deep, not a tree.
Terminal window
curl -X POST https://app.usestratum.dev/api/changes/chg_123/comments \
-H "Authorization: Bearer stratum_user_xxxxx" \
-H "Content-Type: application/json" \
-d '{"body": "Good catch — fixed in the next commit.", "parentCommentId": "cmt_456"}'
Terminal window
curl -X POST https://app.usestratum.dev/api/changes/chg_123/comments/cmt_456/resolve \
-H "Authorization: Bearer stratum_user_xxxxx"

POST .../unresolve reopens it. Two rules are worth knowing:

  • Only project writers or the comment’s author may resolve a thread, so a reader cannot quietly close feedback they received.
  • Only a thread root can be resolved. Resolving a reply is refused — resolution is a property of the conversation, not of an individual message.

Resolving is bookkeeping, not a gate: an unresolved thread does not block a merge. Use request_changes for that.

A review is a verdict on the whole change:

Terminal window
curl -X POST https://app.usestratum.dev/api/changes/chg_123/reviews \
-H "Authorization: Bearer stratum_user_xxxxx" \
-H "Content-Type: application/json" \
-d '{"verdict": "approve", "comment": "Reads well, tests cover the retry path."}'
VerdictEffect on the change
approveMoves the change to approved; counts toward requiredApprovals.
request_changesMoves the change to needs_changes; blocks the merge.
commentRecords the text in the discussion. Status untouched.

Submitting a verdict requires write access to the project — commenting only needs read access, but a verdict moves the change’s state. Only open, needs_changes, accepted, or approved changes can be reviewed.

{"verdict": "comment"} is for saying something substantive without taking a position. It requires a comment (an empty one is a 400), and it is deliberately inert:

  • It never counts toward required approvals and never blocks a merge.
  • It never replaces an existing verdict by the same reviewer. If you have already approved or requested changes, a later comment-only review leaves that verdict standing — a verdict row is only recorded when you have none yet.

The body lands in the change’s append-only discussion rather than in the verdict row, which is why it survives alongside a verdict you gave earlier. It emits change.commented, so activity feeds and webhook subscribers see it like any other comment.

POST /api/changes/{id}/reviews rejects agent tokens on every surface. An agent can read a diff, comment on it, and anchor those comments to lines — but it cannot approve, and it cannot clear requiredApprovals. This is the human-approval invariant described in Getting Started, and it is enforced in the route, not in the UI.

Approvals are made by a signed-in human. The same goes for credentials that act for a human: an approve verdict sent with a scoped API token or an OAuth grant (an MCP client, stratum login in the CLI) is refused with 403 SESSION_REQUIRED, because those are exactly the credentials an agent ends up holding. Approve on the change page in the browser. Those credentials can still request changes and comment, which can only block a merge.

Separately, the change author’s own approval never counts toward requiredApprovals — otherwise a lone writer could open a change, approve it, and self-merge. For a change an agent created, the excluded author is the agent’s owning user, so an operator cannot approve their own agent’s work either. (Changes created before authorship was recorded have no author to exclude, so on those every approval counts — including what may in fact be a self-approval. The strict fail-closed rule applies on the manual conflict-resolution path when the originating change is unknown.)

In layer mode, promoting a change to a GitHub PR moves the conversation to GitHub, and your team reviews there as usual. Stratum posts the evaluation verdict to the PR as a comment (edited in place on re-evaluation) and as a stratum/evaluation commit status: the verdict that let the change be promoted when the PR is opened, and each later one after that. That makes stratum/evaluation usable as a required check in GitHub’s branch protection. Each of the change’s checks is posted beside it as stratum/check/<name>, since checks finish after the verdict. Posting it is best-effort and is not retried: if GitHub refused it when the PR was opened, the PR has no status until the change is evaluated again, and a required check would hold the merge. Promote the change again to re-post it. See Getting Started.

GitHub records whoever’s credential created a pull request as its author. By default that is the instance’s own credential, normally the Stratum GitHub App, so a promoted pull request is authored by a bot. Tools that look at the author treat it accordingly: a review tool may skip it or ask for a seat for the bot, and the person whose agent wrote the code can approve it themselves.

To have your promotions opened as you, connect your GitHub account under Settings → GitHub. After that:

  • a pull request you promote is opened as you, unless one of the exceptions listed below applies at that moment;
  • so is a pull request an agent you own promotes, with the same exceptions, since you are the person answerable for that agent;
  • nobody else’s promotion is ever opened as you. When a teammate promotes a change you opened, the pull request is theirs, or the instance’s if they have not connected.

GitHub then applies its own rules to you as the author. In particular you cannot approve your own pull request, including one your agent promoted.

Connecting stores an authorization for your GitHub account, encrypted. Stratum uses it for one thing, opening the pull request at promotion, and through it can act as you only where the Stratum app is installed and you already have access. The branch is still pushed by the app. Disconnect at any time from the same settings card, or by revoking the app in your GitHub settings; pull requests already opened as you stay yours.

Stratum creates the pull request with the instance’s own GitHub credential instead, exactly as it would have if you had never connected, when:

  • you are not connected;
  • your authorization has lapsed or been revoked (connect again);
  • another promotion of yours is renewing your authorization at that same moment, which lasts a few seconds;
  • your stored authorization cannot be read or renewed just then;
  • GitHub will not let you open a pull request on that repository.

The promote response says which happened: see Promote to a GitHub PR.

The account you authorize must be the GitHub account you sign in to Stratum with. An account that has only ever signed in by email has none yet: sign in with GitHub once, using a GitHub account whose verified email is your Stratum account’s, and the two are linked. The card is absent when the instance’s operator has not turned the feature on.