Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ Set `bot.trigger: "@CBReview"` to use the example above. The legacy default `@co

## Status

**Release acceptance in progress.** The existing production review pipeline is operational. The browser onboarding and management flow is implemented and tested locally against real workerd/D1 with synthetic GitHub/OpenAI providers. It remains disabled until the operator provisions the actual approved website OAuth client, callbacks, inference scopes and workspace claim, then completes staged acceptance. No production deployment follows from a PR or local test.
**CLI release acceptance in progress.** Real complete COMMENT and inline advisory reviews, native APPROVE, high-confidence REQUEST_CHANGES, token rotation and an exact-head autonomous App merge without human approval have been verified. Final unattended-contributor and Human-in-the-Loop live acceptance is still pending; no public release is claimed yet.

See [web onboarding, credentials and activation](docs/web-onboarding.md) for the explicit hosted credential trust boundary and remaining live gates. AI reviews can miss defects; keep required CI and choose human oversight according to repository policy. Automatic merging remains disabled.
Browser ChatGPT onboarding is intentionally deferred and is **not a release blocker**. Keep `WEB_ENABLED=false` and `OPENAI_HOSTED_INFERENCE_AUTHORIZED=false`. Installation redirects lead to the CLI instructions; no website OAuth client is needed for the approved existing CLI connection. Reviews and merges then run without an ongoing CLI process. See [configuration](docs/configuration.md) for explicit repository-owner credential assignment and the two merge modes.

AI reviews can miss defects. GitHub protections, required CI, separate merge authorization and repository opt-in always apply. The global merge gate stays closed during final acceptance; live merge tests are restricted to the exact disposable repository and installation.

## What is implemented

Expand Down Expand Up @@ -54,10 +56,10 @@ npm run check

```sh
npm run cli -- setup --repository OWNER/REPO --backend https://codexbot.appsolves.workers.dev \
--source AppSolves/codexbot --ref 4ed668864cac0682e09ec49a2515a6e1893a2780
--source AppSolves/codexbot --ref FULL_TRUSTED_WORKFLOW_SHA
```

The source must match the Worker's trusted reusable workflow. If you prefer a temporary personal setup token to granting the App Workflows write, add `--setup-as-user`; the user credential needs Contents/Pull requests/Workflows write. No files are overwritten. See [manual setup](docs/installation.md).
Use the full 40-character revision from the operator’s deployed `TRUSTED_WORKFLOW` (the published deployment configuration records it). The source must match the Worker's trusted reusable workflow. If you prefer a temporary personal setup token to granting the App Workflows write, add `--setup-as-user`; the user credential needs Contents/Pull requests/Workflows write. No files are overwritten. See [manual setup](docs/installation.md).

4. Choose authentication:

Expand Down Expand Up @@ -103,4 +105,4 @@ AI review can miss defects and is vulnerable to semantic prompt manipulation. Is

See [the per-finding matrix](docs/remediation.md), [changelog](CHANGELOG.md), [migration/recovery runbook](docs/operations.md) and [live acceptance](docs/acceptance.md). Durable outbox/publication recovery, installation-bound session encryption, required-first context and deterministic output quarantine are implemented and locally tested. Existing OAuth sessions require reconnect after migration 0002.

Both hosted ChatGPT eligibility and actual provider/GitHub acceptance remain external gates. MERGE_DEPLOYMENT_AUTHORIZED defaults false independently of repository policy. Initial smoke is advisory/no-merge. Private GitHub Free repositories lack the supported credential Environment path; merge queues are manual-only. No deployment or paid inference is performed by local checks.
The approved CLI ChatGPT deployment is supported independently of the deferred website registration. New self-hosted operators must establish their own applicable authorization and acceptance. The merge deployment gate is independent of repository policy; verify the exact deployed settings and start new installations with advisory/no-merge acceptance. Private GitHub Free repositories lack the supported credential Environment path; merge queues are manual-only. No deployment or paid inference is performed by local checks.
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Repository installation and CLI provisioning

This release uses the CLI once for credential provisioning. Install/select the GitHub App, protect the default branch, create and merge the workflow/configuration setup PR, then connect ChatGPT using the commands below. Ongoing automatic reviews and merges run on GitHub Actions without a running CLI or personal machine. Browser OAuth is deferred; WEB_ENABLED and OPENAI_HOSTED_INFERENCE_AUTHORIZED remain false until the separate website client is provisioned.
This release uses the CLI once for credential provisioning. Install/select the GitHub App, protect the default branch, create and merge the workflow/configuration setup PR, then connect ChatGPT using the commands below. Ongoing automatic reviews and merges run on GitHub Actions without a running CLI or personal machine. With browser onboarding disabled, the GitHub App installation callback at `/dashboard` redirects to the canonical public CLI setup landing page; callback query values never authorize configuration. Browser OAuth is deferred; WEB_ENABLED and OPENAI_HOSTED_INFERENCE_AUTHORIZED remain false until the separate website client is provisioned.

The hosted backend and CLI default is `https://codexbot.appsolves.workers.dev`. Self-hosted operators supply their own `--backend` and source pin. Existing ChatGPT connections must follow the [origin cutover and reconnect procedure](origin-migration.md) before using this new origin; they are not transferable ciphertext.

Expand Down
1 change: 1 addition & 0 deletions src/worker/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export async function webRoute(request: Request, env: WebConfig): Promise<Respon
if (request.method === 'GET' && path === '/assets/app.css') return new Response(APP_CSS, { headers: { 'Content-Type': 'text/css; charset=utf-8' } });
if (request.method === 'GET' && path === '/assets/app.js') return new Response(APP_JS, { headers: { 'Content-Type': 'application/javascript; charset=utf-8' } });
if (!path.startsWith('/auth/') && !path.startsWith('/dashboard')) return null;
if (env.WEB_ENABLED!=='true' && request.method==='GET' && path==='/dashboard') return redirect('/');
try {
webKey(env);
if (request.method === 'GET' && path === '/auth/error') return page('Connection needs attention', '<section class="page-title"><h1>Connection needs attention.</h1><p role="alert">Sign-in or credential provisioning could not finish. No approval or inference was authorized. Return to the repository to resume pending provisioning, or start sign-in again.</p><a class="button primary" href="/dashboard">Return to dashboard</a></section>');
Expand Down
2 changes: 2 additions & 0 deletions tests/web-auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ await test('identity-only website OAuth cannot activate inference and web remain
assert.throws(() => websiteOAuth({ ...f.env, OPENAI_HOSTED_INFERENCE_AUTHORIZED: 'true', OPENAI_WEB_CLIENT_ID:'oaiapp_test', OPENAI_WEB_AUTH_METHOD:'none', OPENAI_WEB_SCOPES:'openid email profile' }), /inference_scopes/);
const disabled = await worker.fetch(new Request('https://web.invalid/auth/github'), { ...f.env, WEB_ENABLED:'false' } as Env);
assert.equal(disabled.status, 503); assert.ok(!(await disabled.text()).includes(f.env.GITHUB_CLIENT_SECRET!));
const cliLanding=await worker.fetch(new Request('https://web.invalid/dashboard?installation_id=untrusted&next=https://evil.invalid'),{...f.env,WEB_ENABLED:'false'} as Env);assert.equal(cliLanding.status,303);assert.equal(cliLanding.headers.get('location'),'/');
assert.equal((await worker.fetch(new Request('https://web.invalid/dashboard',{method:'POST'}),{...f.env,WEB_ENABLED:'false'} as Env)).status,503);
const missing = await worker.fetch(new Request('https://web.invalid/dashboard'), f.env as Env); assert.equal(missing.status, 401);
} finally { f.close(); }
});
Expand Down