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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Security and behavior changes

## Unreleased — Codex 0.171.0 catalog synchronization

- Regenerate the committed catalog for the retained Codex 0.171.0 dependency: eleven entries, including GPT-6.2 Sol (new default) and Astra. Account entitlement is not inferred from catalog visibility.
- Compare the full native catalog and installed version during normal tests; cover GPT-6.2 model/effort selection in both credential modes, CLI parsing, browser configuration and native scripted Docker acceptance. Unknown models and unsupported efforts still fail closed.
- Document atomic dependency/catalog upgrades and a separate non-bypassable required-CI ruleset recommendation. No deployment, credential, authorization or caller-pin change.

## 0.1.3 — targeted continuation and configurable review timeout

- Default to 30 minutes of isolated execution; support trusted `review.timeout_minutes` and an authorized `--timeout` override. Bound execution by GitHub's six-hour job limit, retaining setup/refresh/cleanup reserves and the existing global inference-request cap.
Expand Down
2 changes: 1 addition & 1 deletion docs/adaptive-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Missing patches are never assumed binary merely from extensions. Supported PNGs

The publisher independently verifies PNG evidence within 32 additional Git calls. A complete text-and-image analysis uses the ordinary confidence/verdict policy; unavailable visual evidence remains incomplete and cannot approve or merge. Image findings use `line: null` and appear in the overall review, since GitHub cannot anchor inline comments to image pixels. Text findings still require actual changed lines.

The pinned Codex 0.169.0 App Server supports `localImage`; its current adapter has no general local-file input. [Official SIWC limitations](https://developers.openai.com/siwc/token-sharing-open-source/preview-limitations) allow model-supported images/files on Responses, but exclude audio/video input, transcription and Files API uploads. This implementation supports verified PNG images, not every binary format. It does not execute, unpack, transcribe or silently skip EXE/archive/audio/PDF files. Those changes require a supported explicit inspection path before approval. No private ChatGPT endpoints or paid fallback are used.
The pinned Codex 0.171.0 App Server supports `localImage`; its current adapter has no general local-file input. [Official SIWC limitations](https://developers.openai.com/siwc/token-sharing-open-source/preview-limitations) allow model-supported images/files on Responses, but exclude audio/video input, transcription and Files API uploads. This implementation supports verified PNG images, not every binary format. It does not execute, unpack, transcribe or silently skip EXE/archive/audio/PDF files. Those changes require a supported explicit inspection path before approval. No private ChatGPT endpoints or paid fallback are used.

The Docker acceptance uses the actual pinned Codex binary to prove PNG conversion, transport, tool inspection and isolation against scripted Responses. It is not proof of real-model visual understanding; no new real-provider inference is part of this hotfix validation.

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The manifest distinguishes `diffComplete`, `requiredContextComplete` and supplem

Nonroot Docker containers use read-only root filesystems, resource caps, no capabilities, no-new-privileges and private temporary homes. The reviewer has network=none and only context/socket read-only mounts. It has no Docker socket, GitHub/OIDC token, API key, refresh token or vault key. A separate audited proxy owns the access credential, only permits stateless streaming Responses inference at one HTTPS route, rejects hosted network tools, pins model/effort/service-tier selection and replaces provider errors. Default inference limits are 100 provider requests and a configurable execution timeout (default 30 minutes, authorized `--timeout` override) for the entire isolated execution, shared by all groups, continuations and synthesis. The host owns CLI-session refresh and all context GitHub access. Approved hosted-session refresh stays on the Worker behind OIDC and leases.

Codex 0.169.0 uses `approvalPolicy: never` for unattended inspection. The thread's read-only default remains, and each review turn explicitly selects `externalSandbox` with restricted network, relying on the unchanged Docker boundary. `never` is not a client approval grant: all server-initiated approval/tool/permission requests still receive JSON-RPC -32601 and cause the analysis to fail. Native declined commands also fail. At least one completed command with exit 0 is necessary before a turn can produce a review; this is execution evidence, not proof of full semantic coverage. Both the isolated entrypoint and trusted host validate completeness, exact head and changed-line references. Incomplete/quarantined/truncated/inconclusive output fails the review job; the protected publisher can still publish a non-approving fallback.
Codex 0.171.0 uses `approvalPolicy: never` for unattended inspection. The thread's read-only default remains, and each review turn explicitly selects `externalSandbox` with restricted network, relying on the unchanged Docker boundary. `never` is not a client approval grant: all server-initiated approval/tool/permission requests still receive JSON-RPC -32601 and cause the analysis to fail. Native declined commands also fail. At least one completed command with exit 0 is necessary before a turn can produce a review; this is execution evidence, not proof of full semantic coverage. Both the isolated entrypoint and trusted host validate completeness, exact head and changed-line references. Incomplete/quarantined/truncated/inconclusive output fails the review job; the protected publisher can still publish a non-approving fallback.

## Durable identity and side effects

Expand Down
8 changes: 8 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ Keep changes focused and retain deterministic security checks. Review [architect
Install the pinned test browser with `node node_modules/playwright/cli.js install chromium` (`--with-deps` on CI/Linux), then run `npm run test:web`. This starts real disposable workerd/D1 with a test-only provider entrypoint. All external browser requests are blocked; GitHub/OpenAI metadata, JWT issuance and PR/secret API responses are deterministic. It checks actual forms/cookies, PKCE callbacks, setup idempotency, ambiguous Environment writes/resume, readiness/PR merge detection, policy validation and proposal, permission changes, CSRF, tenant denial, logout, keyboard access and desktop/mobile layouts. No real provider credentials or inference are used. Synthetic screenshots remain ignored under .local; no browser storage/session artifact is committed.

`npm run catalog:check` queries only model/list on the exact installed Codex binary with an empty temporary home and a disabled provider endpoint. It compares the committed generated catalog, including model-specific efforts. Regenerate intentionally with `node scripts/model-catalog.mjs` after reviewing a Codex upgrade. No account credential or inference is required. The shared synthetic inspection fixture now includes unchanged caller code and hostile repository text; Docker verifies actual byte access and isolation, not live AI quality. Compare old/revised prompt quality only in separately authorized real-provider acceptance using identical fixtures and recorded expected findings.

Codex upgrades must update `package.json`, the lockfile and `src/core/model-catalog.json` in the same PR. The native protocol regression also compares the complete installed catalog and version during `npm run check`; never regenerate silently in CI or relax the equality check. Codex 0.171.0 advertises eleven models, defaults to `gpt-6.2-sol`, and includes `gpt-6.2-astra`. Both GPT-6.2 variants support low, medium, high, xhigh, max and ultra reasoning; omitted effort still defers to Codex. Existing explicit model selections are retained, and account entitlement remains a separate provider check. Native scripted Docker tests assert the selected default model without contacting a real provider.

### Preventing merges before CI completes

Dependabot #64 was merged at 12:23:01 UTC while its CI checks were still running; they failed at 12:23:40 and 12:24:04 UTC. The merge actor was AppSolves and no submitted reviews are recorded. Inspection found an active Main ruleset requiring the GitHub Actions `check` result (App ID 15368), but allowing repository administrators (`RepositoryRole` 5) an `always` bypass. This is a bypass-capable configuration, not an absent catalog check. The REST timeline does not identify the exact UI/CLI bypass action or prove historical ruleset state.

Recommended operator change: place the required, up-to-date `check` status from GitHub Actions in a separate active Main ruleset with **no bypass actors**, so review exceptions cannot skip CI. Require normal protected merging for dependency updates. Keep Codex upgrades coupled to regenerated catalog review and full Docker/security acceptance. Do not add an auto-merge bot with admin bypass or treat the skipped optional cache benchmark as the required check. This fix does not modify repository protection settings.
4 changes: 2 additions & 2 deletions docs/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ The new response projection retains actual 200–599 HTTP status, a five-value M

Local verification passed: `npm run check` (143 tests, typecheck, lint, build), `npm run test:clean`, real workerd/D1, targeted execution/security regressions (21 tests), Actionlint, Docker build plus synthetic Codex integration, `npm audit --audit-level=moderate`, strict HIGH/CRITICAL image scan and Wrangler dry-run. No deployment, reconnect, paid inference or production review was performed.

`proxy.test.ts` covers successful SSE (including case/parameters), 2xx JSON success/error envelopes, 204/missing bodies, HTML, missing/misleading headers, oversized/malformed/unknown JSON and read/cancellation errors. `execution.test.ts` covers metadata validation, envelope/outer-log round trips and provenance. `test:sandbox` uses pinned Codex 0.169.0 and isolated Docker with synthetic successful SSE, HTTP 400 JSON and HTTP 200 JSON; both failure cases require exit 1 and absent review output, with safe proxy metadata. No real provider request is made. The pinned credential-free model-catalog test and official documentation show why bundled `model/list` is not account entitlement; the production account-specific catalog and completed inference remain unverified. See [the owner-only acceptance steps](acceptance.md#optional-real-openai-protocol-acceptance).
`proxy.test.ts` covers successful SSE (including case/parameters), 2xx JSON success/error envelopes, 204/missing bodies, HTML, missing/misleading headers, oversized/malformed/unknown JSON and read/cancellation errors. `execution.test.ts` covers metadata validation, envelope/outer-log round trips and provenance. `test:sandbox` uses pinned Codex 0.171.0 and isolated Docker with synthetic successful SSE, HTTP 400 JSON and HTTP 200 JSON; both failure cases require exit 1 and absent review output, with safe proxy metadata. No real provider request is made. The pinned credential-free model-catalog test and official documentation show why bundled `model/list` is not account entitlement; the production account-specific catalog and completed inference remain unverified. See [the owner-only acceptance steps](acceptance.md#optional-real-openai-protocol-acceptance).

## Isolated review failure and misleading success — 2026-11-14

Verified root cause of the green workflow: `reviewJob` caught inference failure, saved the incomplete fallback and returned successfully. It now always rethrows the primary failure, even when reporting fails; the existing separately protected publisher remains eligible and can only publish a non-approving report. Original container/Codex/provider diagnostics were discarded, so the production inference failure's specific cause remains unknown. Its old `400` was a local AppError default, not evidence of upstream HTTP 400.

Regression coverage in `execution.test.ts` exercises the actual review job through synthetic GitHub/OIDC/Docker boundaries, fallback persistence, primary-error preservation and session release. It also covers Docker exit classes/stderr drain, RPC rejection/process exit, model selection and failed/interrupted/malformed turns. Proxy/stream tests distinguish actual HTTP status and documented entitlement/scope/usage/model codes from validation/stream failures and discard malicious/unknown/oversized details. Progress tests distinguish failed analysis plus successful fallback publication from completed AI analysis, including historical green workflow status. Workflow tests enforce failed-job publication without `continue-on-error`; existing Worker/security tests enforce permanent non-approval after a failed job.

`test:sandbox` executes real Docker isolation and pinned Codex 0.169.0 with synthetic Responses, first successfully and then with a simulated unsupported-capability HTTP 400. It checks exit 1, absent review output, safe engine/proxy envelopes and absence of the private provider message. No stderr/provider-body dumps are used, including test failures. This is protocol/containment evidence, not a claim about any production account, model entitlement or non-API-billed inference. Current official [SIWC constraints](https://developers.openai.com/siwc/token-sharing-open-source/preview-limitations) are retained; no undocumented endpoint is used.
`test:sandbox` executes real Docker isolation and pinned Codex 0.171.0 with synthetic Responses, first successfully and then with a simulated unsupported-capability HTTP 400. It checks exit 1, absent review output, safe engine/proxy envelopes and absence of the private provider message. No stderr/provider-body dumps are used, including test failures. This is protocol/containment evidence, not a claim about any production account, model entitlement or non-API-billed inference. Current official [SIWC constraints](https://developers.openai.com/siwc/token-sharing-open-source/preview-limitations) are retained; no undocumented endpoint is used.

Local validation: `npm run check` (140 tests, typecheck, lint, build), `npm run test:clean`, `npm run test:workers`, actionlint, Docker image build, `npm run test:sandbox`, `npm audit --audit-level=moderate` and Wrangler dry-run passed. See the [coordinated rollout](review-rollout.md#isolated-failure-diagnostics-and-workflow-conclusions). Source, Worker trust and caller pins must move together after normal approval. Deployment and fresh credential-only/advisory provider acceptance remain external gates; no production request was triggered by these tests.

Expand Down
40 changes: 32 additions & 8 deletions src/core/model-catalog.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"codexVersion": "0.169.0",
"codexVersion": "0.171.0",
"models": [
{
"model": "gpt-6.1-sol",
"model": "gpt-6.2-sol",
"isDefault": true,
"efforts": [
"low",
Expand All @@ -14,7 +14,7 @@
]
},
{
"model": "gpt-6-astra",
"model": "gpt-6.2-astra",
"isDefault": false,
"efforts": [
"low",
Expand All @@ -26,7 +26,7 @@
]
},
{
"model": "gpt-6-sol",
"model": "gpt-6.1-terra",
"isDefault": false,
"efforts": [
"low",
Expand All @@ -38,18 +38,19 @@
]
},
{
"model": "gpt-6-luna",
"model": "gpt-6.1-sol",
"isDefault": false,
"efforts": [
"low",
"medium",
"high",
"xhigh",
"max"
"max",
"ultra"
]
},
{
"model": "gpt-5.6-sol",
"model": "gpt-6-astra",
"isDefault": false,
"efforts": [
"low",
Expand All @@ -61,7 +62,30 @@
]
},
{
"model": "gpt-6.1-terra",
"model": "gpt-6-sol",
"isDefault": false,
"efforts": [
"low",
"medium",
"high",
"xhigh",
"max",
"ultra"
]
},
{
"model": "gpt-6-luna",
"isDefault": false,
"efforts": [
"low",
"medium",
"high",
"xhigh",
"max"
]
},
{
"model": "gpt-5.6-sol",
"isDefault": false,
"efforts": [
"low",
Expand Down
17 changes: 17 additions & 0 deletions tests/engine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ import assert from 'node:assert/strict';
import { selectReviewModel,reviewImages } from '../src/runner/engine.js';
import {inspectMedia} from '../src/runner/proxy.js';
import { snapshot } from './fixtures.js';
import catalog from '../src/core/model-catalog.json' with {type:'json'};
import {parseCommand} from '../src/core/command.js';
await test('pinned GPT-6.2 catalog selects the new default and validates CLI overrides without fallback',()=>{
const native=catalog.models.map(model=>({...model,supportedReasoningEfforts:model.efforts.map(reasoningEffort=>({reasoningEffort}))}));
for(const mode of ['chatgpt','api-key'] as const){
const request=snapshot();request.config.credentials.mode=mode;
assert.deepEqual(selectReviewModel(native,request),{model:'gpt-6.2-sol',effort:null});
for(const model of ['gpt-6.2-sol','gpt-6.2-astra']){
request.command=parseCommand(`@CBReview review --model ${model} --effort ultra`,'@CBReview')!;
assert.deepEqual(selectReviewModel(native,request),{model,effort:'ultra'});
request.command.effort='none';assert.throws(()=>selectReviewModel(native,request),/effort_not_supported/);
}
request.command=parseCommand('@CBReview review --model gpt-6.1-sol','@CBReview')!;
assert.equal(selectReviewModel(native,request).model,'gpt-6.1-sol');
request.command.model='gpt-6.2-unknown';assert.throws(()=>selectReviewModel(native,request),/not_in_codex_catalog/);
}
});
const models = [{ model: 'codex-fixture', isDefault: true, supportedReasoningEfforts: [{ reasoningEffort: 'low' }, { reasoningEffort: 'high' }] }, { model: 'codex-deep', isDefault: false, supportedReasoningEfforts: [{ reasoningEffort: 'xhigh' }] }];
await test('vision attachments are bounded local immutable snapshots; remote media, audio and file uploads are denied',()=>{
const sha='a'.repeat(40),asset={filename:'image.png',format:'png',snapshots:[{side:'base',path:'old.png',sha},{side:'head',path:'image.png',sha}]};
Expand Down
Loading