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

chore: remove stale comments and redundant test indirection (#402)

mldangelo-oaie3dac7cf179c
diff --git a/sdk/typescript/src/api.ts b/sdk/typescript/src/api.ts
index 0f19f691a..5c4d7606b 100644
--- a/sdk/typescript/src/api.ts
+++ b/sdk/typescript/src/api.ts
@@ -2693,12 +2693,6 @@ function reconnectDetails(message: string): ScanReconnectDetails | undefined {
}
// A failed turn must fail the scan whatever its error payload looks like.
-//
-// Only `error.message` is reused, because that is the single shape the previous
-// code already surfaced. No other shape is forwarded or stringified: this message
-// reaches `fail-scan --message` and is stored unchanged in `scans.failure_message`,
-// so widening what is copied out of the payload would add a new
-// credential-disclosure path to persistent scan history.
function turnFailureMessage(error: unknown): string {
if (isRecord(error) && typeof error["message"] === "string") {
const message = error["message"].trim();
diff --git a/sdk/typescript/src/version.ts b/sdk/typescript/src/version.ts
index 65f403962..ef777c7d4 100644
--- a/sdk/typescript/src/version.ts
+++ b/sdk/typescript/src/version.ts
@@ -5,7 +5,6 @@ const PACKAGE_VERSIONS = packageVersions(
new URL("../package.json", import.meta.url),
);
-/** npm-compatible successor to the Python package version 0.1.0b3. */
export const VERSION = PACKAGE_VERSIONS.package;
export const CODEX_SDK_VERSION = PACKAGE_VERSIONS.sdk;
export const CODEX_EXECUTABLE_VERSION = PACKAGE_VERSIONS.executable;
diff --git a/sdk/typescript/tests-ts/api-events.test.ts b/sdk/typescript/tests-ts/api-events.test.ts
index 9c7b32c49..96842f38b 100644
--- a/sdk/typescript/tests-ts/api-events.test.ts
+++ b/sdk/typescript/tests-ts/api-events.test.ts
@@ -796,8 +796,6 @@ describe("one-shot scan events", () => {
message: "retry budget exhausted",
});
- // A bare string is deliberately NOT reused: it was never surfaced before, and
- // this message is stored by fail-scan without redaction.
await expect(
runEvents(
await copyCompletedScan(await temporaryDirectory()),
diff --git a/sdk/typescript/tests-ts/cli-authentication.test.ts b/sdk/typescript/tests-ts/cli-authentication.test.ts
index 0523f589d..032bd1ca8 100644
--- a/sdk/typescript/tests-ts/cli-authentication.test.ts
+++ b/sdk/typescript/tests-ts/cli-authentication.test.ts
@@ -22,7 +22,7 @@ import {
dependencies as cliDependencies,
fakePreflight,
fakeResult,
-} from "./support/cli.js";
+} from "./cli-fixtures.js";
let stateDirectory: string;
diff --git a/sdk/typescript/tests-ts/cli-launcher.test.ts b/sdk/typescript/tests-ts/cli-launcher.test.ts
index 2f1bde3ee..d427bb05b 100644
--- a/sdk/typescript/tests-ts/cli-launcher.test.ts
+++ b/sdk/typescript/tests-ts/cli-launcher.test.ts
@@ -13,7 +13,7 @@ import { join } from "node:path";
import { pathToFileURL } from "node:url";
import { describe, expect, test } from "bun:test";
import { VERSION } from "../src/index.js";
-import { SYNTHETIC_CREDENTIALS } from "./support/cli.js";
+import { SYNTHETIC_CREDENTIALS } from "./cli-fixtures.js";
const packageRoot = join(import.meta.dir, "..");
diff --git a/sdk/typescript/tests-ts/cli-signals.test.ts b/sdk/typescript/tests-ts/cli-signals.test.ts
index 8d57e89e1..0bc0e054f 100644
--- a/sdk/typescript/tests-ts/cli-signals.test.ts
+++ b/sdk/typescript/tests-ts/cli-signals.test.ts
@@ -6,7 +6,7 @@ import {
dependencies,
fakePreflight,
fakeResult,
-} from "./support/cli.js";
+} from "./cli-fixtures.js";
describe("CLI signals", () => {
test("maps Ctrl-C and SIGTERM to conventional exits and preserves partial output", async () => {
diff --git a/sdk/typescript/tests-ts/cli-skills.test.ts b/sdk/typescript/tests-ts/cli-skills.test.ts
index 822750c80..3ef574add 100644
--- a/sdk/typescript/tests-ts/cli-skills.test.ts
+++ b/sdk/typescript/tests-ts/cli-skills.test.ts
@@ -10,7 +10,7 @@ import {
runCodexSkillCommand,
skillCommandFailure,
} from "../src/cli.js";
-import { capture, dependencies } from "./support/cli.js";
+import { capture, dependencies } from "./cli-fixtures.js";
describe("CLI skill commands", () => {
test("runs validation and patch skills with file and literal inputs", async () => {
diff --git a/sdk/typescript/tests-ts/cli-workbench.test.ts b/sdk/typescript/tests-ts/cli-workbench.test.ts
index 775bf7de9..cbcc0e891 100644
--- a/sdk/typescript/tests-ts/cli-workbench.test.ts
+++ b/sdk/typescript/tests-ts/cli-workbench.test.ts
@@ -10,7 +10,7 @@ import {
dependencies,
fakeResult,
SYNTHETIC_CREDENTIALS,
-} from "./support/cli.js";
+} from "./cli-fixtures.js";
describe("CLI workbench", () => {
test("lists and summarizes open findings for the current repository", async () => {
diff --git a/sdk/typescript/tests-ts/release-automation.test.ts b/sdk/typescript/tests-ts/release-automation.test.ts
index a1ec56211..b2bfc1f19 100644
--- a/sdk/typescript/tests-ts/release-automation.test.ts
+++ b/sdk/typescript/tests-ts/release-automation.test.ts
@@ -1412,6 +1412,13 @@ describe("idempotent GitHub release verification", () => {
});
describe("GitHub release workflow safeguards", () => {
+ const checkedOutVersion = releaseVersion(
+ JSON.parse(
+ readFileSync(new URL("../package.json", import.meta.url), "utf8"),
+ ) as ReleaseMetadata,
+ );
+ const checkedOutTag = `npm-v${checkedOutVersion}`;
+
test("requires a real tag for protected npm publication", () => {
expect(protectedReleaseWorkflow).toContain("release-tag");
expect(protectedReleaseWorkflow).toContain('"$GITHUB_REF_TYPE"');
@@ -1907,12 +1914,6 @@ describe("GitHub release workflow safeguards", () => {
protectedReleaseWorkflow,
"Revalidate protected release tag",
);
- const checkedOutVersion = releaseVersion(
- JSON.parse(
- readFileSync(new URL("../package.json", import.meta.url), "utf8"),
- ) as ReleaseMetadata,
- );
- const checkedOutTag = `npm-v${checkedOutVersion}`;
const mock = [
"gh() {",
' if [[ "$1" != "api" ]]; then return 64; fi',
@@ -1963,12 +1964,6 @@ describe("GitHub release workflow safeguards", () => {
protectedReleaseWorkflow,
"Validate release tag",
);
- const checkedOutVersion = releaseVersion(
- JSON.parse(
- readFileSync(new URL("../package.json", import.meta.url), "utf8"),
- ) as ReleaseMetadata,
- );
- const checkedOutTag = `npm-v${checkedOutVersion}`;
const mocks = [
"git() { return 0; }",
"sfw() { printf '%s\\n' '[\"0.1.1\",\"999999999999999999999999.0.0\"]'; }",
@@ -1998,12 +1993,6 @@ describe("GitHub release workflow safeguards", () => {
protectedReleaseWorkflow,
"Validate release tag",
);
- const checkedOutVersion = releaseVersion(
- JSON.parse(
- readFileSync(new URL("../package.json", import.meta.url), "utf8"),
- ) as ReleaseMetadata,
- );
- const checkedOutTag = `npm-v${checkedOutVersion}`;
const mocks = [
"git() { return 0; }",
`sfw() { printf '%s\\n' '["0.1.0","${checkedOutVersion}"]'; }`,
diff --git a/sdk/typescript/tests-ts/support/cli.ts b/sdk/typescript/tests-ts/support/cli.ts
deleted file mode 100644
index e56555d2f..000000000
--- a/sdk/typescript/tests-ts/support/cli.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "../cli-fixtures.js";