From 317152991ec22b96c6a59cda676a9cc4820eb45b Mon Sep 17 00:00:00 2001 From: AppSolves Date: Thu, 26 Nov 2026 14:01:08 +0100 Subject: [PATCH 1/2] fix: synchronize Codex 0.171.0 catalog and validate GPT-6.2 selection --- CHANGELOG.md | 6 ++++++ docs/adaptive-context.md | 2 +- docs/architecture.md | 2 +- docs/development.md | 8 ++++++++ src/core/model-catalog.json | 40 +++++++++++++++++++++++++++++-------- tests/engine.test.ts | 17 ++++++++++++++++ tests/inspection-check.mjs | 4 +++- tests/protocol.test.ts | 16 ++++++++++++--- tests/sandbox-check.mjs | 2 ++ tests/web-auth.test.ts | 2 +- tests/web-browser.mjs | 2 +- 11 files changed, 85 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b98a961..4f1c9f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/docs/adaptive-context.md b/docs/adaptive-context.md index 98d0bee..04c6497 100644 --- a/docs/adaptive-context.md +++ b/docs/adaptive-context.md @@ -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. diff --git a/docs/architecture.md b/docs/architecture.md index 772fd61..c5805df 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -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 diff --git a/docs/development.md b/docs/development.md index 575d589..b2db57a 100644 --- a/docs/development.md +++ b/docs/development.md @@ -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. diff --git a/src/core/model-catalog.json b/src/core/model-catalog.json index 861530a..707683e 100644 --- a/src/core/model-catalog.json +++ b/src/core/model-catalog.json @@ -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", @@ -14,7 +14,7 @@ ] }, { - "model": "gpt-6-astra", + "model": "gpt-6.2-astra", "isDefault": false, "efforts": [ "low", @@ -26,7 +26,7 @@ ] }, { - "model": "gpt-6-sol", + "model": "gpt-6.1-terra", "isDefault": false, "efforts": [ "low", @@ -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", @@ -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", diff --git a/tests/engine.test.ts b/tests/engine.test.ts index fa6283f..85a49c1 100644 --- a/tests/engine.test.ts +++ b/tests/engine.test.ts @@ -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}]}; diff --git a/tests/inspection-check.mjs b/tests/inspection-check.mjs index 266cb2f..be63829 100644 --- a/tests/inspection-check.mjs +++ b/tests/inspection-check.mjs @@ -1,3 +1,4 @@ +import catalog from '../src/core/model-catalog.json' with { type: 'json' }; import assert from 'node:assert/strict'; import process from 'node:process'; import {Buffer} from 'node:buffer'; @@ -92,7 +93,8 @@ for (const scenario of ['untrusted', 'findings', 'clean', 'incomplete','vision', if(url!=='https://api.openai.com/v1/responses'||init.headers.Authorization!=='Bearer fixture-only')throw new Error('Fixture boundary failed'); try{const format=JSON.parse(init.body).text?.format;if(format?.schema)assert.equal(format.strict,true);if(${JSON.stringify(scenario)}==='provider-schema-rejected')format.schema.properties.unfinished_reasons.uniqueItems=true;if(format?.schema)assertProviderSchema(format.schema);else assert.equal(${JSON.stringify(scenario)},'large-compaction');}catch{return Response.json({error:{code:'invalid_json_schema',param:'text.format.schema',message:'Synthetic schema contract rejection'}},{status:400});} if(${JSON.stringify(scenario)}==='synthesis-no-reread'&&JSON.parse(init.body).text.format.schema.properties.unit_id.enum[0]==='synthesis')return new Response(events([{id:'msg_synthesis',type:'message',role:'assistant',status:'completed',content:[{type:'output_text',text:JSON.stringify({unit_id:'synthesis',completed_paths:[],review:${encodedResult},unfinished_reasons:[]}),annotations:[]}]}]),{headers:{'content-type':'text/event-stream'}}); - const body=JSON.parse(init.body);const media=[];const texts=[];const visit=v=>{if(v&&typeof v==='object'){if(v.type==='input_image'&&typeof v.image_url==='string')media.push(createHash('sha256').update(v.image_url).digest('hex'));if(typeof v.text==='string'){try{const item=JSON.parse(v.text);if(item.head_sha&&typeof item.unit_id==='string')texts.push(item)}catch{}}for(const x of Object.values(v))visit(x)}};visit(body.input);const requiredImages=${manifest.binaryFiles?.length??0};if(requiredImages){const unique=[...new Set(media)];if(!firstImages){if(unique.length!==requiredImages)throw new Error('Initial distinct image count incorrect');firstImages=unique;}if(firstImages.some(image=>!unique.includes(image)))throw new Error('A distinct required image was lost across turns');}if(!body.text?.format?.schema){console.log('fixture_compaction_verified');return new Response(events([{id:'msg_compact',type:'message',role:'assistant',status:'completed',content:[{type:'output_text',text:'Synthetic compaction checkpoint. Continue the next host-assigned group using its verified evidence; preserve the validated finding.',annotations:[]}]}]),{headers:{'content-type':'text/event-stream'}});}const assigned=texts.at(-1);const unitId=assigned?.unit_id;if(unitId&&unitId!=='synthesis'){const payload=JSON.parse(assigned.evidence);const expected=${JSON.stringify(plan.units)}.find(u=>u.id===unitId);if(!expected||(payload.continuation?payload.evidence!==undefined||payload.evidence_receipt?.sha256!==expected.sha256||!Array.isArray(payload.pending_paths)||payload.pending_paths.some(p=>payload.completed_paths.includes(p)):createHash('sha256').update(payload.evidence).digest('hex')!==expected.sha256))throw new Error('Unit evidence or targeted continuation receipt missing');}if(unitId==='synthesis'&&${JSON.stringify(plan.units)}.some(u=>!unitCalls.has(u.id)))throw new Error('Synthesis skipped a required group');if(!unitId)throw new Error('No host assigned unit');const round=(unitCalls.get(unitId)??0)+1;unitCalls.set(unitId,round);calls++;if(${JSON.stringify(scenario.startsWith('vision'))}&&!JSON.stringify(body.input).includes('data:image/'))throw new Error('Native Codex did not supply image data');if(${JSON.stringify(scenario)}==='provided-group-evidence'&&unitId!=='group-00')return new Response(events([{id:'msg_reuse',type:'message',role:'assistant',status:'completed',content:[{type:'output_text',text:JSON.stringify({unit_id:unitId,completed_paths:unitId==='synthesis'?[]:${JSON.stringify(plan.units)}.find(u=>u.id===unitId).paths,review:${encodedResult},unfinished_reasons:[]}),annotations:[]}]}]),{headers:{'content-type':'text/event-stream'}});if(round%2===1){const tools=[...(body.tools??[]),...body.input.filter(item=>item.type==='additional_tools').flatMap(item=>item.tools??[])]; + if(JSON.parse(init.body).model!==${JSON.stringify(catalog.models.find(model=>model.isDefault).model)})throw new Error('Unexpected native default model'); + const body=JSON.parse(init.body);const media=[];const texts=[];const visit=v=>{if(v&&typeof v==='object'){if(v.type==='input_image'&&typeof v.image_url==='string')media.push(createHash('sha256').update(v.image_url).digest('hex'));if(typeof v.text==='string'){try{const item=JSON.parse(v.text);if(item.head_sha&&typeof item.unit_id==='string')texts.push(item)}catch{}}for(const x of Object.values(v))visit(x)}};visit(body.input);const requiredImages=${manifest.binaryFiles?.length??0};if(requiredImages){const unique=[...new Set(media)];if(!firstImages){if(unique.length!==requiredImages)throw new Error('Initial distinct image count incorrect');firstImages=unique;}if(firstImages.some(image=>!unique.includes(image)))throw new Error('A distinct required image was lost across turns');}if(!body.text?.format?.schema){console.log('fixture_compaction_verified');return new Response(events([{id:'msg_compact',type:'message',role:'assistant',status:'completed',content:[{type:'output_text',text:'Synthetic compaction checkpoint. Continue the next host-assigned group using its verified evidence; preserve the validated finding.',annotations:[]}]}]),{headers:{'content-type':'text/event-stream'}});}const assigned=texts.at(-1);const unitId=assigned?.unit_id;if(unitId&&unitId!=='synthesis'){const payload=JSON.parse(assigned.evidence);const expected=${JSON.stringify(plan.units)}.find(u=>u.id===unitId);if(!expected||(payload.continuation?payload.evidence!==undefined||payload.evidence_receipt?.sha256!==expected.sha256||!Array.isArray(payload.pending_paths)||payload.pending_paths.some(p=>payload.completed_paths.includes(p)):createHash('sha256').update(payload.evidence).digest('hex')!==expected.sha256))throw new Error('Unit evidence or targeted continuation receipt missing');}if(unitId==='synthesis'&&${JSON.stringify(plan.units)}.some(u=>!unitCalls.has(u.id)))throw new Error('Synthesis skipped a required group');if(!unitId)throw new Error('No host assigned unit');const round=(unitCalls.get(unitId)??0)+1;unitCalls.set(unitId,round);calls++;if(${JSON.stringify(scenario.startsWith('vision'))}&&!JSON.stringify(body.input).includes('data:image/'))throw new Error('Native Codex did not supply image data');if(${JSON.stringify(scenario)}==='provided-group-evidence'&&unitId!=='group-00')return new Response(events([{id:'msg_reuse',type:'message',role:'assistant',status:'completed',content:[{type:'output_text',text:JSON.stringify({unit_id:unitId,completed_paths:unitId==='synthesis'?[]:${JSON.stringify(plan.units)}.find(u=>u.id===unitId).paths,review:${encodedResult},unfinished_reasons:[]}),annotations:[]}]}]),{headers:{'content-type':'text/event-stream'}});if(round%2===1){const tools=[...(body.tools??[]),...body.input.filter(item=>item.type==='additional_tools').flatMap(item=>item.tools??[])]; if(!tools.find(t=>t.type==='namespace'&&t.name==='functions')?.tools.some(t=>t.type==='custom'&&t.name==='exec'))throw new Error('Pinned code-mode tool missing');console.log('fixture_tool_selected'); return new Response(events([{id:'fc_fixture_'+calls,call_id:'call_fixture_'+calls,namespace:'functions',name:'exec',type:'custom_tool_call',input:'const r=await tools.exec_command({cmd:"node /workspace/inspect.mjs",yield_time_ms:10000,max_output_tokens:2000});text(r);'}]),{headers:{'content-type':'text/event-stream'}})} const output=JSON.stringify(body.input.filter(item=>['function_call_output','custom_tool_call_output'].includes(item.type))); diff --git a/tests/protocol.test.ts b/tests/protocol.test.ts index 968d329..7c266df 100644 --- a/tests/protocol.test.ts +++ b/tests/protocol.test.ts @@ -1,19 +1,23 @@ import { test } from 'node:test'; import assert from 'node:assert/strict'; import { spawn } from 'node:child_process'; -import { mkdtemp, rm, mkdir } from 'node:fs/promises'; +import { mkdtemp, rm, readFile } from 'node:fs/promises'; import { join, resolve } from 'node:path'; +import { tmpdir } from 'node:os'; import { Rpc } from '../src/runner/rpc.js'; import { record } from '../src/core/errors.js'; await test('pinned official Codex app-server initializes and provides model effort catalog without credentials', { timeout: 30_000 }, async () => { - const root = resolve('.local'); await mkdir(root, { recursive: true }); + const root = tmpdir(); const directory = await mkdtemp(join(root, 'codexbot-protocol-')); const allowed = Object.assign(Object.create(null) as NodeJS.ProcessEnv, { PATH: process.env.PATH, HOME: directory, USERPROFILE: directory, CODEX_HOME: directory, SystemRoot: process.env.SystemRoot ?? '', TEMP: directory, TMP: directory }); const architecture = process.arch === 'arm64' ? 'aarch64' : 'x86_64'; const target = process.platform === 'win32' ? `${architecture}-pc-windows-msvc` : process.platform === 'darwin' ? `${architecture}-apple-darwin` : `${architecture}-unknown-linux-musl`; const executable = resolve(`node_modules/@openai/codex-${process.platform}-${process.arch}/vendor/${target}/bin/${process.platform === 'win32' ? 'codex.exe' : 'codex'}`); // Execute the official native binary directly: a Windows Node launcher cannot forward SIGKILL. - const child = spawn(executable, ['app-server', '--listen', 'stdio://'], { env: allowed, cwd: directory, stdio: 'pipe' }); + const child = spawn(executable, ['app-server', '--listen', 'stdio://', + '-c','model_provider="codexbot_catalog"','-c','model_providers.codexbot_catalog.name="Local catalog"', + '-c','model_providers.codexbot_catalog.base_url="http://127.0.0.1:1/v1"', + '-c','model_providers.codexbot_catalog.wire_api="responses"','-c','model_providers.codexbot_catalog.requires_openai_auth=false'], { env: allowed, cwd: directory, stdio: 'pipe' }); // Register before any RPC: the process may close before the finally block runs. const closed = new Promise(resolve => child.once('close', () => resolve())); const rpc = new Rpc(child), timer = setTimeout(() => { child.kill('SIGKILL'); child.stdin.destroy(); child.stdout.destroy(); child.stderr.destroy(); }, 20_000); @@ -23,6 +27,12 @@ await test('pinned official Codex app-server initializes and provides model effo const catalog = record(await rpc.request('model/list', { limit: 100, includeHidden: false })); assert.ok(Array.isArray(catalog.data) && catalog.data.length > 0); for (const item of catalog.data) assert.ok(Array.isArray(record(item).supportedReasoningEfforts)); + const committed=JSON.parse(await readFile('src/core/model-catalog.json','utf8')); + const installed=JSON.parse(await readFile('node_modules/@openai/codex/package.json','utf8')); + assert.equal(committed.codexVersion,installed.version,'Regenerate catalog together with a Codex upgrade'); + assert.equal(catalog.nextCursor,null); + assert.deepEqual(committed.models,catalog.data.map(item=>{const model=record(item);return{model:model.model,isDefault:model.isDefault,efforts:(model.supportedReasoningEfforts as {reasoningEffort:string}[]).map(e=>e.reasoningEffort)};})); + assert.equal(committed.models.filter((model:{isDefault:boolean})=>model.isDefault).length,1); } finally { // EOF lets Codex close its SQLite/runtime resources before removing its home. // The existing deadline still kills a process that refuses to shut down. diff --git a/tests/sandbox-check.mjs b/tests/sandbox-check.mjs index ac6f1a2..931561c 100644 --- a/tests/sandbox-check.mjs +++ b/tests/sandbox-check.mjs @@ -1,3 +1,4 @@ +import catalog from '../src/core/model-catalog.json' with { type: 'json' }; import process from 'node:process'; import { execFileSync, spawn } from 'node:child_process'; import { mkdir, writeFile, rm } from 'node:fs/promises'; @@ -41,6 +42,7 @@ import {executionEnvelope,proxyRequestEnvelope} from '/app/dist/src/core/executi const assertProviderSchema=${assertProviderSchema.toString()}; let calls=0; globalThis.fetch = async (url, init) => { + if(JSON.parse(init.body).model!==${JSON.stringify(catalog.models.find(model=>model.isDefault).model)})throw new Error('Unexpected native default model'); if(url !== 'https://api.openai.com/v1/responses' || init.headers.Authorization !== 'Bearer fixture-only') throw new Error('Invalid inference boundary'); const request=JSON.parse(init.body); assert.equal(request.text?.format?.strict,true);assertProviderSchema(request.text.format.schema); diff --git a/tests/web-auth.test.ts b/tests/web-auth.test.ts index 974d157..34adb3d 100644 --- a/tests/web-auth.test.ts +++ b/tests/web-auth.test.ts @@ -151,7 +151,7 @@ function configForm(): URLSearchParams { await test('web policy fields use canonical schema and pinned model catalog, with no silent model/effort substitution', () => { const form = configForm(); assert.deepEqual(configurationFromForm(form), DEFAULT_CONFIG); const unlimited=configForm();unlimited.set('quotas.user_per_day','unlimited');assert.equal(configurationFromForm(unlimited).quotas.user_per_day,'unlimited'); - form.set('review.model','gpt-6.1-sol'); form.set('review.effort','ultra'); assert.equal(configurationFromForm(form).review.effort, 'ultra'); + for(const model of ['gpt-6.2-sol','gpt-6.2-astra','gpt-6.1-sol']){form.set('review.model',model);form.set('review.effort','ultra');const selected=configurationFromForm(form);assert.equal(selected.review.model,model);assert.equal(selected.review.effort,'ultra');} assert.equal(parseCommand('@CBReview review --model=gpt-6.1-sol --effort ultra', '@CBReview')?.model, 'gpt-6.1-sol'); form.set('review.model','unknown-model'); assert.throws(() => configurationFromForm(form), /not_in_codex_catalog/); form.set('review.model','gpt-5.5'); assert.throws(() => configurationFromForm(form), /effort_not_supported/); diff --git a/tests/web-browser.mjs b/tests/web-browser.mjs index c91f1e1..8b0d8de 100644 --- a/tests/web-browser.mjs +++ b/tests/web-browser.mjs @@ -61,7 +61,7 @@ try { await page.getByRole('button',{name:'Propose configuration / workflow update'}).click(); await page.getByRole('alert').filter({hasText:'does not support the selected reasoning effort'}).waitFor(); assert.equal((await (await context.request.get(origin+'/__fixture/state')).json()).pulls,1); await page.goto(repository); await page.getByText('Review policy & configuration',{exact:true}).click(); - await page.locator('[name="review.model"]').selectOption('gpt-6.1-sol'); await page.locator('[name="review.effort"]').selectOption('high'); await page.locator('[name="review.auto_approve"]').uncheck(); + await page.locator('[name="review.model"]').selectOption('gpt-6.2-sol'); await page.locator('[name="review.effort"]').selectOption('high'); await page.locator('[name="review.auto_approve"]').uncheck(); await page.getByLabel('Merge mode',{exact:true}).selectOption('0'); await page.locator('[name="merge.auto_merge_on_approval"]').check(); await page.getByLabel('Merge mode',{exact:true}).selectOption('2'); await page.getByRole('button',{name:'Propose configuration / workflow update'}).click(); await page.getByRole('heading',{name:'Changes proposed.'}).waitFor(); From 42ab27d6984db2b357f2ac555950b1f19805fac5 Mon Sep 17 00:00:00 2001 From: AppSolves Date: Thu, 26 Nov 2026 14:03:22 +0100 Subject: [PATCH 2/2] docs: align current native acceptance version with Codex 0.171.0 --- docs/validation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/validation.md b/docs/validation.md index 52726cb..650e1ba 100644 --- a/docs/validation.md +++ b/docs/validation.md @@ -42,7 +42,7 @@ 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 @@ -50,7 +50,7 @@ Verified root cause of the green workflow: `reviewJob` caught inference failure, 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.