You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,3 +44,54 @@ bun prisma migrate dev
44
44
```sh
45
45
bun run dev
46
46
```
47
+
48
+
## AI-assisted pull request reviews
49
+
50
+
The backend welcomes extension contributors and automatically runs a Codex review when a non-draft pull request is opened, marked ready, reopened, or updated. Blocking findings produce `REQUEST_CHANGES`; a clean review produces `APPROVE` and marks the PR `human-reviewable`. An organization member or repository collaborator can retry by mentioning the reviewer account with a comment containing only `@<reviewer> review`.
51
+
52
+
The intended repository rule requires two approvals: the reviewer's automated extension-policy approval and a final Code Owner approval from a Vicinae maintainer. Enable stale-approval dismissal so every new commit must pass both reviewers again.
53
+
54
+
### GitHub reviewer account
55
+
56
+
Create a fine-grained personal access token for the dedicated reviewer account, limited to `vicinaehq/extensions`, with:
57
+
58
+
- Contents: read
59
+
- Pull requests: read and write
60
+
- Issues: read and write
61
+
- Metadata: read (automatically granted)
62
+
63
+
Add a repository webhook for Pull request and Issue comment events pointing to `https://store.vicinae.dev/webhooks/github`. Configure the same secret as `GITHUB_WEBHOOK_SECRET`.
64
+
65
+
Set `GITHUB_PAT`, `GITHUB_WEBHOOK_SECRET`, `GITHUB_REVIEW_REPOSITORY`, and `GITHUB_REVIEW_MAINTAINER`. The backend discovers the reviewer login from the PAT, verifies every webhook delivery, and accepts the strict `@<reviewer> review` command only from an organization member or repository collaborator.
66
+
67
+
The reviewer maintains one welcome/status comment and the following labels:
68
+
69
+
-`ai-reviewing`
70
+
-`ai-changes-requested`
71
+
-`human-reviewable`
72
+
-`ai-review-failed`
73
+
74
+
It mentions `GITHUB_REVIEW_MAINTAINER` once per commit when the automated review transitions to approved.
75
+
76
+
### Codex subscription
77
+
78
+
Keep a dedicated, persistent Codex home and authenticate it with the Codex for OSS account:
79
+
80
+
```sh
81
+
CODEX_HOME=/app/data/codex bun node_modules/@openai/codex/bin/codex.js login --device-auth
82
+
```
83
+
84
+
In Docker, run that command inside the backend container and persist `/app/data`. Then deploy the database migration and enable the worker:
85
+
86
+
```sh
87
+
bun prisma migrate deploy
88
+
```
89
+
90
+
```env
91
+
CODEX_REVIEW_ENABLED=true
92
+
CODEX_REVIEW_HOME=/app/data/codex
93
+
CODEX_REVIEW_REASONING_EFFORT=high
94
+
CODEX_REVIEW_TIMEOUT_MS=900000
95
+
```
96
+
97
+
Each job uses an ephemeral directory containing only the trusted extension-reviewer skill, PR diff, changed extension files, and the pinned `@vicinae/api` TypeScript declarations. Package runtime code is not exposed or executed. The reviewer verifies API recommendations against those declarations, recommends compatible upgrades, and can attach one-click GitHub suggested changes for small exact replacements. The Codex SDK receives a sanitized environment and a least-privilege permission profile: model-generated commands can read only minimal runtime paths and the ephemeral review workspace, with no filesystem writes, approvals, command network access, or web search. The private Codex state directory remains outside that profile. The Docker image includes Bubblewrap for Linux enforcement.
0 commit comments