Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

ci: reuse native proofs and focus SDK test-only checks (#1968)

Michael D'Angelo21c01de73db4
diff --git a/.github/scripts/check-ci-results.mjs b/.github/scripts/check-ci-results.mjs
index 922d19748..3538afc19 100644
--- a/.github/scripts/check-ci-results.mjs
+++ b/.github/scripts/check-ci-results.mjs
@@ -8,14 +8,8 @@ export function failedChecks(needs) {
const required = ["static-checks"];
const groups = {
"package-required": ["native", "package", "compatibility"],
- "source-required": [
- "test",
- "mcp",
- "plugin-host",
- "plugin-source",
- "windows-test",
- "windows-verify",
- ],
+ "source-required": ["test", "windows-test", "windows-verify"],
+ "plugin-tests-required": ["mcp", "plugin-host", "plugin-source"],
"workflow-quality": ["workflow-quality"],
"container-validate": ["container-validate"],
"action-ci": ["action-ci"],
diff --git a/.github/scripts/select-ci-checks.mjs b/.github/scripts/select-ci-checks.mjs
index 327d6aba8..863657b9b 100644
--- a/.github/scripts/select-ci-checks.mjs
+++ b/.github/scripts/select-ci-checks.mjs
@@ -6,6 +6,7 @@ const documentation =
/^(?:README\.md|CONTRIBUTING\.md|CODE_OF_CONDUCT\.md|docs\/.*\.md|github-action\/README\.md|docker\/README\.md)$/;
const ordinarySource =
/^(?:sdk\/typescript\/(?:src|tests-ts)|plugins\/codex-security\/mcp-app\/(?:src|tests))\/.*\.ts$/;
+const sdkTest = /^sdk\/typescript\/tests-ts\/[^/]+\.test\.ts$/;
const actionFiles =
/^(?:action\.yml|github-action\/(?:README\.md|(?:runtime\/)?package(?:-lock)?\.json|dist\/(?:index|post)\.cjs|(?:src|scripts|tests)\/[^/]+\.(?:mjs|ts)))$/;
const evalFiles =
@@ -60,6 +61,10 @@ export function selectChecks(paths, { event, baseChanged = false }) {
];
return {
"source-required": String(source),
+ "plugin-tests-required": String(
+ full ||
+ (scope === "source" && !paths.every((path) => sdkTest.test(path))),
+ ),
"package-required": String(source || scope === "action"),
"action-ci": String(action),
"eval-contracts": String(source || scope === "evals"),
diff --git a/.github/scripts/test-ci-selection.mjs b/.github/scripts/test-ci-selection.mjs
index b5e1dafe4..8db4006ff 100644
--- a/.github/scripts/test-ci-selection.mjs
+++ b/.github/scripts/test-ci-selection.mjs
@@ -10,6 +10,7 @@ const select = (paths, options = {}) =>
const regularSource = {
"source-required": "true",
+ "plugin-tests-required": "true",
"package-required": "true",
"action-ci": "false",
"eval-contracts": "true",
@@ -79,6 +80,7 @@ const fullQualification = {
const docs = {
...regularSource,
"source-required": "false",
+ "plugin-tests-required": "false",
"package-required": "false",
"eval-contracts": "false",
"container-validate": "false",
@@ -250,7 +252,6 @@ test("release helper changes select their release-progress regression checks", (
test("ordinary TypeScript source and tests retain the reduced version matrices", () => {
for (const path of [
"sdk/typescript/src/cost.ts",
- "sdk/typescript/tests-ts/skeleton.test.ts",
"sdk/typescript/tests-ts/support/test-subprocess.ts",
"plugins/codex-security/mcp-app/src/stdio-transport.ts",
"plugins/codex-security/mcp-app/tests/test_deep_scan_executor.ts",
@@ -261,6 +262,32 @@ test("ordinary TypeScript source and tests retain the reduced version matrices",
}
});
+test("SDK test-only PRs keep the SDK jobs and skip independent plugin suites", () => {
+ const paths = [
+ "sdk/typescript/tests-ts/skeleton.test.ts",
+ "sdk/typescript/tests-ts/windows-machine-policy.test.ts",
+ ];
+ assert.deepEqual(select(paths), {
+ ...regularSource,
+ "plugin-tests-required": "false",
+ });
+ for (const other of [
+ "README.md",
+ "sdk/typescript/tests-ts/support/test-subprocess.ts",
+ "sdk/typescript/src/api.ts",
+ ]) {
+ assert.deepEqual(select([...paths, other]), regularSource, other);
+ }
+ for (const options of [
+ { event: "push" },
+ { event: "schedule" },
+ { event: "workflow_dispatch" },
+ { baseChanged: true },
+ ]) {
+ assert.deepEqual(select(paths, options), fullQualification);
+ }
+});
+
test("unknown paths and dependency configuration receive full qualification", () => {
for (const paths of [
["new-runtime/file"],
@@ -406,6 +433,7 @@ test("documentation requires static checks and explicit selection, without skipp
);
for (const key of [
"source-required",
+ "plugin-tests-required",
"package-required",
"action-ci",
"eval-contracts",
diff --git a/.github/workflows/native-artifacts.yml b/.github/workflows/native-artifacts.yml
index f7d6cb5f9..e80d961d1 100644
--- a/.github/workflows/native-artifacts.yml
+++ b/.github/workflows/native-artifacts.yml
@@ -38,7 +38,7 @@ jobs:
empty_tree="$(git hash-object -t tree --stdin </dev/null)"
source_hash="$(git diff-tree -r -z --no-abbrev "$empty_tree" HEAD -- \
.gitattributes .cargo .npmrc .pnpmfile.cjs package.json pnpm-workspace.yaml \
- .github/actions/setup-tools .github/scripts ':(exclude).github/scripts/invoice-desk-*.mjs' \
+ .github/actions/setup-tools '.github/scripts/*.mts' \
.github/workflows/native-artifacts.yml \
.github/workflows/native-unix.yml \
.github/workflows/native-windows.yml \
diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml
index fac0b9f0f..add9e828b 100644
--- a/.github/workflows/node-ci.yml
+++ b/.github/workflows/node-ci.yml
@@ -32,6 +32,7 @@ jobs:
source-run: ${{ steps.proof.outputs.source-run }}
edit-attempt: ${{ steps.proof.outputs.edit-attempt }}
source-required: ${{ steps.scope.outputs.source-required }}
+ plugin-tests-required: ${{ steps.scope.outputs.plugin-tests-required }}
package-required: ${{ steps.scope.outputs.package-required }}
action-ci: ${{ steps.scope.outputs.action-ci }}
eval-contracts: ${{ steps.scope.outputs.eval-contracts }}
@@ -267,7 +268,7 @@ jobs:
uses: ./.github/actions/check-action-candidate
mcp:
- if: needs.classify-changes.outputs.source-required == 'true'
+ if: needs.classify-changes.outputs.plugin-tests-required == 'true'
name: MCP app tests (${{ matrix.shard }}/${{ strategy.job-total }})
needs: [classify-changes, package]
runs-on: ubuntu-latest
@@ -309,7 +310,7 @@ jobs:
retention-days: 14
plugin-host:
- if: needs.classify-changes.outputs.source-required == 'true'
+ if: needs.classify-changes.outputs.plugin-tests-required == 'true'
name: standalone plugin / ${{ matrix.os }}
needs: classify-changes
runs-on: ${{ matrix.os }}
@@ -333,7 +334,7 @@ jobs:
run: node --experimental-strip-types --test plugins/codex-security/mcp-app/scripts/test_host_build.mts
plugin-source:
- if: needs.classify-changes.outputs.source-required == 'true'
+ if: needs.classify-changes.outputs.plugin-tests-required == 'true'
name: plugin source contracts / ${{ matrix.os }} / python-${{ matrix.python }}
needs: classify-changes
runs-on: ${{ matrix.os }}
diff --git a/docs/ci.md b/docs/ci.md
index 27199d187..c65614b23 100644
--- a/docs/ci.md
+++ b/docs/ci.md
@@ -11,8 +11,8 @@ required package contents. Deleting or renaming them must pass archive checks.
`RELEASING.md` also receives full qualification because SDK tests validate its
canonical release recovery example.
-Source changes run the complete SDK suite on Linux, macOS, and Windows, plus
-MCP, standalone-plugin, native-runtime, and installed-package checks. Tests
+Product source changes run the complete SDK suite on Linux, macOS, and Windows,
+plus MCP, standalone-plugin, native-runtime, and installed-package checks. Tests
are discovered from the source tree, including new files without timing data.
Platform-specific filesystem, credential, process, cancellation, and resumed
worker cases remain enabled.
@@ -22,8 +22,16 @@ Pull requests limited to `.ts` files under `sdk/typescript/src/`,
`plugins/codex-security/mcp-app/tests/`, optionally mixed with ordinary docs,
use reduced version matrices. They test the minimum Node 22, 24, and 26 versions,
current Node 24 for the Action adapter, macOS installation, and Windows Node 22
-installation. Python runs the full suite on 3.12 and the native subsets on macOS
-and Windows. All source changes still select container validation.
+installation. When selected, Python runs the full suite on 3.12 and the native
+subsets on macOS and Windows. All source changes still select container
+validation.
+
+A PR that changes only top-level `sdk/typescript/tests-ts/*.test.ts` files runs
+the same SDK shards on all three platforms and the same static, native, package,
+container, and eval checks as an ordinary source PR. It skips the independent
+MCP, standalone-plugin, and Python suites. Changes to a test helper, nested
+fixture, or any other path alongside an SDK test use the usual source or full
+route.
PRs limited to Action metadata, wrapper implementation, tests, npm manifests,
locks, or checked-in bundles run Action CI. It verifies a clean rebuild, runs
@@ -115,6 +123,8 @@ a PR that leaves those inputs unchanged, look for the exact key in
matter which `main` run saved it. Different inputs can build in parallel.
The key uses the UTC week and the paths listed in **Identify native build and
-proof inputs**. Compare the next change against current `main`: its PR run may
-have tested an older base or skipped native preparation entirely. PR runs
-cannot populate this cache for `main`.
+proof inputs**. For repository CI scripts, the native jobs compile
+`.github/scripts/*.mts` through `build:ci`; changing unrelated workflow scripts
+does not require rebuilding native artifacts. Compare the next change against
+current `main`: its PR run may have tested an older base or skipped native
+preparation entirely. PR runs cannot populate this cache for `main`.
diff --git a/sdk/typescript/tests-ts/native-artifact-cache.test.ts b/sdk/typescript/tests-ts/native-artifact-cache.test.ts
index b1dd44b5c..f6efa5d5b 100644
--- a/sdk/typescript/tests-ts/native-artifact-cache.test.ts
+++ b/sdk/typescript/tests-ts/native-artifact-cache.test.ts
@@ -88,8 +88,8 @@ test("native reuse hashes committed inputs with Git alone across platforms", ()
writeSource(repository, "README.md", "updated documentation\n");
writeSource(
repository,
- ".github/scripts/invoice-desk-target.mjs",
- "invoice\n",
+ ".github/scripts/verify-pr-source.mjs",
+ "ci selection\n",
);
writeSource(
repository,