From d55177dce535b84e49984aa21b328973060ab983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A0=AA=E5=BC=8F=E4=BC=9A=E7=A4=BEIT=E3=83=92=E3=83=BC?= =?UTF-8?q?=E3=83=AD=E3=83=BC?= <130669990+it-her0@users.noreply.github.com> Date: Thu, 5 Nov 2026 03:21:09 +0900 Subject: [PATCH 1/9] docs(plugin): clarify how saved review tasks are closed (#1497) fix(artifacts): keep retained deferred coverage partial Co-authored-by: Michael D'Angelo Co-authored-by: mldangelo-oai <269034524+mldangelo-oai@users.noreply.github.com> --- plugins/codex-security/references/final-report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/codex-security/references/final-report.md b/plugins/codex-security/references/final-report.md index 887ac1362..17147fdf1 100644 --- a/plugins/codex-security/references/final-report.md +++ b/plugins/codex-security/references/final-report.md @@ -33,7 +33,7 @@ Keep unfinished requested work and essential in-scope proof gaps in `reviewState Standard and diff drafts use `{ surfaces, explicitExclusions, deferred }`. Give surfaces meaningful labels and schema-defined dispositions, preserving saved surface IDs in updates. Retain reasons and evidence for rejected, not-applicable, and follow-up work. Open questions may be strings or `{ question, followUpPrompt? }` objects. An open question does not prevent the configured review from finishing. -Preserve each saved deferred `id` or `candidateId`, use each deferred ID only once, and copy IDs assigned by the draft response into later updates. Close a generic saved task in the final Standard or diff draft with `reviewState.resolvedDeferred: [{ id, reason }]`; keep unfinished tasks deferred and update linked surfaces by ID. Candidate-linked tasks close through findings or terminal dispositions. Deep parents cannot close worker tasks; original checkpoints remain unchanged. +Preserve each saved deferred `id` or `candidateId`, use each deferred ID only once, and copy IDs assigned by the draft response into later updates. Omitting a saved task from the final draft does not by itself close it. Close a generic saved task in the final Standard or diff draft with `reviewState.resolvedDeferred: [{ id, reason }]`; keep unfinished tasks deferred and update linked surfaces by ID. Candidate-linked tasks close through findings or terminal dispositions. Deep parents cannot close worker tasks; original checkpoints remain unchanged. The workbench assigns IDs to new surfaces and derives a finding's `identity` when omitted. Review notes do not measure file coverage; do not add reviewed-surface tables or file-coverage claims to the report. Omit host-owned target/scope metadata, `reviewState.inventoryStrategy`, `reviewState.receiptRefs`, and each active finding's `findingId`, `occurrenceId` and `fingerprints` from semantic drafts. SDK-authored canonical files follow `scan-contract.md` and the SDK's supplied metadata. From a51602904c2b61e4ef28e8130793145791e153d1 Mon Sep 17 00:00:00 2001 From: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com> Date: Wed, 4 Nov 2026 18:21:44 +0000 Subject: [PATCH 2/9] fix(deep-scan): stop workers when the plan does not include Codex (#1843) Co-authored-by: Codex Co-authored-by: Michael D'Angelo Co-authored-by: mldangelo-oai <269034524+mldangelo-oai@users.noreply.github.com> --- plugins/codex-security/mcp-app/src/deep-scan/errors.ts | 1 + plugins/codex-security/mcp-app/tests/test_deep_scan_errors.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/codex-security/mcp-app/src/deep-scan/errors.ts b/plugins/codex-security/mcp-app/src/deep-scan/errors.ts index 57317357f..98127bf34 100644 --- a/plugins/codex-security/mcp-app/src/deep-scan/errors.ts +++ b/plugins/codex-security/mcp-app/src/deep-scan/errors.ts @@ -25,6 +25,7 @@ export class DeepScanNonRetryableError extends Error { const USAGE_LIMIT_MESSAGES = new Set([ "Quota exceeded. Check your plan and billing details.", + "To use Codex with your ChatGPT plan, upgrade to Plus: https://chatgpt.com/explore/plus.", "Your workspace is out of credits. Add credits to continue.", "Your workspace is out of credits. Ask your workspace owner to refill in order to continue.", "You hit your spend cap set in your workspace. Increase your spend cap to continue.", diff --git a/plugins/codex-security/mcp-app/tests/test_deep_scan_errors.ts b/plugins/codex-security/mcp-app/tests/test_deep_scan_errors.ts index 6737c2216..4e81cf42f 100644 --- a/plugins/codex-security/mcp-app/tests/test_deep_scan_errors.ts +++ b/plugins/codex-security/mcp-app/tests/test_deep_scan_errors.ts @@ -107,6 +107,7 @@ function testWorkerErrorClassificationPreservesExplicitFailures() { function testUsageLimitClassification() { for (const message of [ "Quota exceeded. Check your plan and billing details.", + "To use Codex with your ChatGPT plan, upgrade to Plus: https://chatgpt.com/explore/plus.", "Your workspace is out of credits. Add credits to continue.", "Your workspace is out of credits. Ask your workspace owner to refill in order to continue.", "You hit your spend cap set in your workspace. Increase your spend cap to continue.", From 086028e780019e60fd89377d0ae1e9cb64fd8462 Mon Sep 17 00:00:00 2001 From: yaqoob1152-ai Date: Wed, 4 Nov 2026 23:22:14 +0500 Subject: [PATCH 3/9] chore: track the lockfile generated by root pnpm installs (#1758) * added the pnpm modules * chore: restore devcontainer lockfile newline --------- Co-authored-by: Michael D'Angelo Co-authored-by: mldangelo-oai <269034524+mldangelo-oai@users.noreply.github.com> --- pnpm-lock.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 pnpm-lock.yaml diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 000000000..9b60ae178 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,9 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: {} From ebac5c04c6f5be3f6f0e97d7d59b567f7f7bac26 Mon Sep 17 00:00:00 2001 From: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com> Date: Wed, 4 Nov 2026 18:22:37 +0000 Subject: [PATCH 4/9] fix(knowledge-base): skip LibreOffice lock files in knowledge-base folders (#2291) Co-authored-by: mldangelo-oai <269034524+mldangelo-oai@users.noreply.github.com> --- sdk/typescript/src/knowledge-base.ts | 2 ++ sdk/typescript/tests-ts/knowledge-base.test.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sdk/typescript/src/knowledge-base.ts b/sdk/typescript/src/knowledge-base.ts index bbbb04745..b2a27df89 100644 --- a/sdk/typescript/src/knowledge-base.ts +++ b/sdk/typescript/src/knowledge-base.ts @@ -230,6 +230,8 @@ async function discover( if (entry.name.startsWith("~$")) continue; // macOS writes "._" metadata files when copying to other filesystems. if (entry.name.startsWith("._")) continue; + // LibreOffice keeps a ".~lock.#" file next to each open document. + if (/^\.~lock\..+#$/s.test(entry.name)) continue; if (!DOCUMENT_EXTENSIONS.has(extname(path).toLowerCase())) { const bytes = await readFile(path, { flag: constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0), diff --git a/sdk/typescript/tests-ts/knowledge-base.test.ts b/sdk/typescript/tests-ts/knowledge-base.test.ts index 03611b724..9dd571abf 100644 --- a/sdk/typescript/tests-ts/knowledge-base.test.ts +++ b/sdk/typescript/tests-ts/knowledge-base.test.ts @@ -847,16 +847,22 @@ describe("scan knowledge bases", () => { expect(documents).toContain("Boundary � case.\n"); }); - test("skips Office owner files while a document is open", async () => { + test("skips Office owner files and LibreOffice lock files during discovery", async () => { const root = await temporaryDirectory(); await writeFile(join(root, "policy.docx"), docx("Access policy.")); await writeFile(join(root, "~$policy.docx"), new Uint8Array(162).fill(1)); + await writeFile( + join(root, ".~lock.policy.docx#"), + ",Example User,example-host,01.01.2026 09:00,file:///home/example/.config/libreoffice/4;", + ); + await writeFile(join(root, ".~lock.#"), "Named document"); const knowledgeBase = await prepareKnowledgeBase([root]); temporaryDirectories.track(knowledgeBase.path); - expect(await extractedDocuments(knowledgeBase.path)).toEqual([ + expect((await extractedDocuments(knowledgeBase.path)).sort()).toEqual([ "Access policy.\n", + "Named document", ]); }); From 801a36de697ff78746e00a420550f61b39fee447 Mon Sep 17 00:00:00 2001 From: cjc0013 Date: Wed, 4 Nov 2026 13:23:27 -0500 Subject: [PATCH 5/9] test(deep-scan): cover severity preservation for duplicate findings (#737) * fix: keep severity calibration consistent across scan modes * test(severity): cover aggregate recalibration and retry persistence --------- Co-authored-by: cjc0013 Co-authored-by: Michael D'Angelo Co-authored-by: root Co-authored-by: mldangelo-oai <269034524+mldangelo-oai@users.noreply.github.com> --- .../mcp-app/tests/test_deep_scan_iterations.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/codex-security/mcp-app/tests/test_deep_scan_iterations.ts b/plugins/codex-security/mcp-app/tests/test_deep_scan_iterations.ts index adb0e7e8b..281d8c992 100644 --- a/plugins/codex-security/mcp-app/tests/test_deep_scan_iterations.ts +++ b/plugins/codex-security/mcp-app/tests/test_deep_scan_iterations.ts @@ -154,6 +154,7 @@ test("a duplicate stops the loop and every observation survives", async () => { const alias = { ...base, title: "A different description", + severity: { level: "critical" as const }, provenance: { source: "local_plugin" }, }; const { terminal, draft, started } = await scanLoop([[base], [alias]], { @@ -164,16 +165,22 @@ test("a duplicate stops the loop and every observation survives", async () => { assert.deepEqual(started, [0, 1]); assert.equal(terminal.terminalReason, "saturated"); assert.equal(draft.findings.length, 1); + assert.deepEqual(draft.findings[0].severity, base.severity); assert.deepEqual( draft.findings[0].provenance.sourceFindings?.map((x) => x.finding.title), [base.title, alias.title], ); + assert.deepEqual( + draft.findings[0].provenance.sourceFindings?.map((x) => x.finding.severity), + [base.severity, alias.severity], + ); }); test("an exact repeat of a merged source saturates without another comparison", async () => { const alias = { ...base, title: "Another description of the same sink", + severity: { level: "medium" as const }, locations: [...base.locations, { path: "caller.py", startLine: 12 }], }; const { terminal, draft } = await scanLoop([[base, alias], [alias]], { @@ -182,9 +189,11 @@ test("an exact repeat of a merged source saturates without another comparison", comparisons: [[[0, 1]]], }); assert.equal(terminal.terminalReason, "saturated"); + assert.equal(draft.findings.length, 1); + assert.deepEqual(draft.findings[0].severity, base.severity); assert.deepEqual( - draft.findings.map((f) => f.provenance.sourceFindings?.length), - [3], + draft.findings[0].provenance.sourceFindings?.map((x) => x.finding.severity), + [base.severity, alias.severity, alias.severity], ); }); From ae278f1cb073bd2dcc4490eba026c03adf1da2f0 Mon Sep 17 00:00:00 2001 From: Michael D'Angelo Date: Wed, 4 Nov 2026 10:25:18 -0800 Subject: [PATCH 6/9] docs(release): call out changes to scan instructions (#2287) --- RELEASING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELEASING.md b/RELEASING.md index 3476f3fd3..5a8db1188 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -174,6 +174,10 @@ Keep the published notes easy to scan: - Start with a short overview and the main user-facing highlights. Use bold topic labels to make the bullets easy to skim. Put secondary improvements in a `
` block when they would crowd out upgrade guidance. +- When bundled instructions change how scans discover or validate findings + or assign severity, describe the change in the highlights or upgrade notes. + Name the affected scan modes and behaviors or finding categories. If a + benchmark measured the effect, report the result and its scope. - Keep breaking changes and required upgrade actions visible. Long migration procedures can go in a clearly named `
` block under the relevant upgrade note. Keep code fences, tables, and lists intact. From 6f22c2b2d72e3b17a970e1efdc510f678de37b7e Mon Sep 17 00:00:00 2001 From: ilaigold <117302862+ilaigold@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:27:42 +0200 Subject: [PATCH 7/9] docs(cli): clarify pre-commit hook scope and upgrades (#1536) fix(cli): unset Git hook variables in the generated pre-commit hook Git exports GIT_INDEX_FILE to pre-commit hooks. When .git is a file (linked worktrees, submodules, --separate-git-dir checkouts) it also exports GIT_DIR. The scan rejects both before it starts, so the hook written by install-hook failed every commit with: GIT_INDEX_FILE is not supported for Codex Security scans. or, in those checkouts: GIT_DIR is not supported for Codex Security scans. This happened with or without credentials and with or without findings. The existing hook test only checked for a non-zero exit, so it passed on this error. The generated hook now unsets GIT_DIR and GIT_INDEX_FILE before running the scan. Git starts the hook at the worktree root, so `scan .` still finds the same repository. Hooks written by the previous version are recognized and rewritten in place, like the older npx hooks. Co-authored-by: Claude Opus 5.5 Co-authored-by: Michael D'Angelo Co-authored-by: mldangelo-oai <269034524+mldangelo-oai@users.noreply.github.com> --- sdk/typescript/docs/cli.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sdk/typescript/docs/cli.md b/sdk/typescript/docs/cli.md index 87ef304ba..0bab8bd77 100644 --- a/sdk/typescript/docs/cli.md +++ b/sdk/typescript/docs/cli.md @@ -2325,9 +2325,11 @@ or the [Bedrock workflow](https://github.com/openai/codex-security/blob/main/exa ### Local pre-commit checks -`install-hook` checks staged and unstaged changes, blocking the commit on scan -failure or findings at/above its threshold (`high` by default). Use required CI -for enforcement; local hooks are optional. +The generated hook runs a `--working-tree` scan and blocks the commit on scan +failure or findings at or above its threshold (`high` by default). It uses the +checkout's normal index for staged and unstaged changes, so it can include changes +outside a partial commit and miss content staged only in a separate index. +Use required CI for enforcement because local hooks are optional. Install the CLI outside the target repository and run that copy directly. `npx` can select a repository-local package. Before installation, inspect: @@ -2345,11 +2347,12 @@ codex-security install-hook /path/to/repository ``` To migrate an existing generated hook, verify it is a regular file used only by -this repository and contains only the generated command. Preserve its severity. -The installer can update older `npx` hooks when the severity matches. New hooks -record absolute Node/CLI paths. If those change, back up and remove the verified -generated hook, then reinstall with the same threshold. Restore the backup if -installation fails. The installer respects `core.hooksPath`. +this repository and contains only the generated commands. Rerun `install-hook` +with `--fail-on-severity` set to its original threshold. It recognizes the legacy +`npx` hook and supported earlier templates with matching absolute Node and CLI +paths. If it refuses to overwrite the verified hook, back it up, remove it and +reinstall with the same threshold. Restore the backup if installation fails. The installer +respects `core.hooksPath`. ## Import SonarQube Cloud issues From 8faac059c6038517013c32c1a591a89432725ce1 Mon Sep 17 00:00:00 2001 From: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com> Date: Wed, 4 Nov 2026 18:28:05 +0000 Subject: [PATCH 8/9] test(progress): cover live dispatch after a fenced example (#526) * fix(progress): ignore fenced status markers * test(progress): cover nested code fences * test(progress): cover live dispatch after a fenced example * test(progress): keep the fixture dispatch phase literal --------- Co-authored-by: Michael D'Angelo Co-authored-by: mldangelo-oai <269034524+mldangelo-oai@users.noreply.github.com> --- .../tests-ts/worker-progress.test.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sdk/typescript/tests-ts/worker-progress.test.ts b/sdk/typescript/tests-ts/worker-progress.test.ts index bdbe334ee..2fc9604c3 100644 --- a/sdk/typescript/tests-ts/worker-progress.test.ts +++ b/sdk/typescript/tests-ts/worker-progress.test.ts @@ -250,6 +250,27 @@ describe("worker progress events", () => { messageEvent(["Example:", "```text", dispatchMarker, "```"].join("\n")), ), ).toBeNull(); + + const liveDispatch = { + phase: "validation", + planned: 2, + started: 2, + } as const; + const message = messageEvent( + [ + "~~~text", + progressMarker, + dispatchMarker, + "~~~", + liveMarker, + `CODEX_SECURITY_WORKER_STATUS ${JSON.stringify(liveDispatch)}`, + ].join("\n"), + ); + expect(scanProgressUpdatesFromEvent(message)).toEqual([liveProgress]); + expect(workerStatusFromEvent(message)).toEqual({ + kind: "dispatch", + ...liveDispatch, + }); }); test("rejects malformed or overstated file progress", () => { From 021f6a68ab1f893556c2d3b8085489bcadf5b3d0 Mon Sep 17 00:00:00 2001 From: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com> Date: Wed, 4 Nov 2026 18:28:42 +0000 Subject: [PATCH 9/9] fix(sdk): pass severity record efforts through to the host (#1842) * fix(sdk): pass severity record efforts through to the host * test(sdk): cover host efforts in the records workflows * test(sdk): exercise unchanged reasoning effort at the host * fix(sdk): forward every string effort in severity record reviews --------- Co-authored-by: Codex Co-authored-by: Michael D'Angelo Co-authored-by: mldangelo-oai <269034524+mldangelo-oai@users.noreply.github.com> --- .../docs/classify-severity-records.md | 3 ++- sdk/typescript/src/classify-severity-records.ts | 10 +--------- .../tests-ts/classify-severity-records.test.ts | 17 +++++++++++------ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/sdk/typescript/docs/classify-severity-records.md b/sdk/typescript/docs/classify-severity-records.md index 01426b2bf..c3257bf85 100644 --- a/sdk/typescript/docs/classify-severity-records.md +++ b/sdk/typescript/docs/classify-severity-records.md @@ -58,7 +58,8 @@ an integer from 1 through 10 (default: 3), validated before any host work. For each record the CLI emits that many sequential `method: "review.run"` requests, each with a unique request ID and params containing `requestId`, `stage: "severity-classification"`, explicit `model` and `effort`, `trustedInstructions`, untrusted report/rubric `prompt`, and -an output JSON `schema`. The host must authorize the requested model and effort, +an output JSON `schema`. The SDK and CLI forward the `effort` string unchanged. +The host must authorize the requested model and effort, create a fresh independent review context, preserve the instruction/data boundary, and disable tools, repository access, browsing, and source inspection. A managed-agent host can execute this request directly in its existing session diff --git a/sdk/typescript/src/classify-severity-records.ts b/sdk/typescript/src/classify-severity-records.ts index f881a01ff..609f0c3c7 100644 --- a/sdk/typescript/src/classify-severity-records.ts +++ b/sdk/typescript/src/classify-severity-records.ts @@ -46,15 +46,7 @@ export const classifySeverityRecordsInputSchema = z version: z.literal(1), rubric: severityRubricSnapshotSchema.optional(), model: text, - effort: z.enum([ - "minimal", - "low", - "medium", - "high", - "xhigh", - "max", - "ultra", - ]), + effort: z.string(), records: z.array( z .object({ diff --git a/sdk/typescript/tests-ts/classify-severity-records.test.ts b/sdk/typescript/tests-ts/classify-severity-records.test.ts index dc157b5ee..e63d7981a 100644 --- a/sdk/typescript/tests-ts/classify-severity-records.test.ts +++ b/sdk/typescript/tests-ts/classify-severity-records.test.ts @@ -12,7 +12,7 @@ import { capture, dependencies } from "./cli-fixtures.js"; const hash = (value: string) => createHash("sha256").update(value, "utf8").digest("hex"); -function input(): ClassifySeverityRecordsInput & { +function input(effort = "high"): ClassifySeverityRecordsInput & { rubric: NonNullable; } { const markdown = @@ -23,7 +23,7 @@ function input(): ClassifySeverityRecordsInput & { version: 1, rubric: { revision: 4, markdown, sha256: hash(markdown) }, model: "synthetic-model", - effort: "high", + effort, records: [ { id: "canonical-one", @@ -46,8 +46,9 @@ function answer(request: SeverityClassificationReviewRequest) { }; } -test("binds assessments to exact UTF-8 snapshots without rewriting the original report", async () => { - const original = input(); +const efforts = ["", "\t", " synthetic-effort "]; +test.each(efforts)("preserves UTF-8 records and effort %p", async (effort) => { + const original = input(effort); const before = structuredClone(original); const requests: SeverityClassificationReviewRequest[] = []; const result = await classifySeverityRecords(original, { @@ -55,7 +56,7 @@ test("binds assessments to exact UTF-8 snapshots without rewriting the original async run(request) { requests.push(request); expect(request.model).toBe(original.model); - expect(request.effort).toBe("high"); + expect(request.effort).toBe(original.effort); expect(JSON.parse(request.prompt).rubric).toEqual([ original.rubric.markdown, ]); @@ -89,6 +90,8 @@ test("binds assessments to exact UTF-8 snapshots without rewriting the original }); test.each([ + "missing-effort", + "numeric-effort", "rubric-hash", "finding-hash", "duplicate", @@ -99,6 +102,8 @@ test.each([ "unsafe-revision", ])("rejects %s before any host work", async (scenario) => { const data = input(); + if (scenario === "missing-effort") Reflect.deleteProperty(data, "effort"); + if (scenario === "numeric-effort") Reflect.set(data, "effort", 1); if (scenario === "rubric-hash") data.rubric.markdown += " "; if (scenario === "finding-hash") data.records[0]!.findingJson += " "; if (scenario === "duplicate") data.records.push(data.records[0]!); @@ -296,7 +301,7 @@ test.each([ capture().stream, deps, ); - const params: ClassifySeverityRecordsInput = input(); + const params: ClassifySeverityRecordsInput = input("none"); if (scenario === "default-rubric") delete params.rubric; const completed = [ "completed",