OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security
TypeScript ai-securityapplication-securityclicode-scanningcodexcodex-securitycybersecuritydevsecopsnodejsnpmopenaisdksecuritytypescriptvulnerability-scanning
test: rebalance Windows CI shards without dropping coverage (#1332)
mldangelo-oaic6421c1791ae
diff --git a/sdk/typescript/scripts/ci-test-durations.json b/sdk/typescript/scripts/ci-test-durations.jsonindex a1437d24a..e41fd1871 100644--- a/sdk/typescript/scripts/ci-test-durations.json+++ b/sdk/typescript/scripts/ci-test-durations.json@@ -2,226 +2,350 @@"sources": ["https://github.com/openai/codex-security/actions/runs/33215429477","https://github.com/openai/codex-security/actions/runs/33227512538",- "https://github.com/openai/codex-security/actions/runs/33233690024"+ "https://github.com/openai/codex-security/actions/runs/33233690024",+ "https://github.com/openai/codex-security/actions/runs/37420072376",+ "https://github.com/openai/codex-security/actions/runs/37472306800"],"unix": {- "api-attribution-concurrency.test.ts": 0.372,- "api-credentials.test.ts": 0.892,+ "api-attribution-concurrency.test.ts": 1.552,+ "api-credentials.test.ts": 3.703,+ "api-cyber-access.test.ts": 0.12,"api-environment.test.ts": 0.0,- "api-events.test.ts": 2.277,+ "api-events.test.ts": 9.883,"api-integration.test.ts": 0.0,- "api-post-scan.test.ts": 7.161,- "api-preflight-config.test.ts": 1.053,- "api.test.ts": 16.055,- "attack-path-tool-name.test.ts": 0.237,- "auth.test.ts": 1.425,- "build-plugin.test.ts": 3.973,- "bulk-scan-discovery.test.ts": 0.021,- "cli-authentication.test.ts": 5.757,- "cli-cloud-publish.test.ts": 0.354,- "cli-dedupe.test.ts": 0.061,- "cli-deep-scan-summary.test.ts": 0.06,- "cli-export.test.ts": 2.058,+ "api-policy.test.ts": 40.924,+ "api-post-scan.test.ts": 22.923,+ "api-preflight-config.test.ts": 2.059,+ "api.test.ts": 50.539,+ "artifact-export.test.ts": 2.289,+ "attack-path-tool-name.test.ts": 0.305,+ "auth.test.ts": 2.604,+ "azure-pipelines-example.test.ts": 0.137,+ "bind-repo-scopes.test.ts": 4.878,+ "build-plugin.test.ts": 6.903,+ "bulk-scan-discovery.test.ts": 0.034,+ "candidate-normalizer.test.ts": 15.489,+ "check-markdown.test.ts": 2.334,+ "classify-scan-severity.test.ts": 25.587,+ "classify-severity.test.ts": 0.055,+ "cli-authentication.test.ts": 12.265,+ "cli-classify-severity.test.ts": 0.036,+ "cli-cloud-publish.test.ts": 0.261,+ "cli-dedupe.test.ts": 0.125,+ "cli-deep-scan-summary.test.ts": 0.055,+ "cli-diagnostics.test.ts": 0.153,+ "cli-export.test.ts": 9.881,+ "cli-feedback.test.ts": 3.787,+ "cli-help.test.ts": 0.192,"cli-history-paths.test.ts": 0.0,- "cli-launcher.test.ts": 8.154,- "cli-patch-trust.test.ts": 0.74,- "cli-patch.test.ts": 0.953,- "cli-publish.test.ts": 0.494,- "cli-scan-prompts.test.ts": 0.255,- "cli-serve.test.ts": 5.033,- "cli-signals.test.ts": 0.05,- "cli-skills.test.ts": 2.954,- "cli-verify-fix.test.ts": 0.158,- "cli-workbench.test.ts": 0.208,- "cli.test.ts": 3.071,- "cloud-publish.test.ts": 2.111,- "codex-review.test.ts": 0.246,- "compact-diff-scan.test.ts": 12.898,- "completed-scan-handoff.test.ts": 0.004,- "component-scan.test.ts": 0.396,- "config.test.ts": 0.403,- "container-entrypoint.test.ts": 0.051,- "contract.test.ts": 7.989,- "cost-model.property.test.ts": 0.01,- "cost.test.ts": 1.0,- "custom-publish.test.ts": 0.463,- "custom-validation.test.ts": 8.264,- "deep-progress.test.ts": 0.001,- "deep-scan-parent-denials.test.ts": 0.013,- "deep-scan-reducer-recovery.test.ts": 0.504,- "deep-scan-timestamp-compat.test.ts": 1.176,- "deep-scan-windows-executable.test.ts": 0.008,- "deep-scan-workbench.test.ts": 15.302,- "deep-scan-worker-shutdown.test.ts": 0.009,- "diff-rank-input.test.ts": 0.413,- "errors.property.test.ts": 0.033,- "errors.test.ts": 0.004,- "finding-deduplication.test.ts": 0.389,- "finding-embeddings.test.ts": 1.297,- "finding-preview.test.ts": 0.234,- "finding-workflow-integration.test.ts": 51.852,- "finding-workflow-publication.test.ts": 1.44,- "finding-workflow.test.ts": 0.455,+ "cli-launcher.test.ts": 1.887,+ "cli-patch-results.test.ts": 2.697,+ "cli-patch-trust.test.ts": 2.484,+ "cli-patch.test.ts": 5.118,+ "cli-policy.test.ts": 10.654,+ "cli-project-config.test.ts": 0.766,+ "cli-publish.test.ts": 0.427,+ "cli-scan-import.test.ts": 0.096,+ "cli-scan-logs.test.ts": 10.883,+ "cli-scan-patch-settings.test.ts": 0.32,+ "cli-scan-prompts.test.ts": 0.503,+ "cli-serve.test.ts": 11.424,+ "cli-show-cost.test.ts": 0.12,+ "cli-signals.test.ts": 0.075,+ "cli-skill-chatgpt-provider-auth.test.ts": 2.381,+ "cli-skill-native-config.test.ts": 7.617,+ "cli-skills.test.ts": 4.946,+ "cli-suggest-owners.test.ts": 0.338,+ "cli-verify-fix.test.ts": 0.109,+ "cli-workbench.test.ts": 0.276,+ "cli.test.ts": 3.987,+ "cloud-publish.test.ts": 2.566,+ "codex-review.test.ts": 4.444,+ "compact-diff-scan.test.ts": 26.361,+ "completed-scan-handoff.test.ts": 0.011,+ "component-scan.test.ts": 16.369,+ "config.test.ts": 3.029,+ "container-ci-workflow.test.ts": 0.3,+ "container-entrypoint.test.ts": 0.256,+ "contract.test.ts": 12.909,+ "cost-context.test.ts": 0.011,+ "cost-model.property.test.ts": 0.02,+ "cost.test.ts": 1.231,+ "custom-publish.test.ts": 0.594,+ "custom-validation-example.test.ts": 0.835,+ "custom-validation.test.ts": 14.506,+ "dedupe-records.test.ts": 1.457,+ "deep-config.test.ts": 0.04,+ "deep-progress.test.ts": 0.002,+ "deep-review-input.test.ts": 15.767,+ "deep-scan-parent-denials.test.ts": 0.048,+ "deep-scan-reducer-recovery.test.ts": 0.407,+ "deep-scan-timestamp-compat.test.ts": 1.27,+ "deep-scan-windows-executable.test.ts": 0.033,+ "deep-scan-workbench.test.ts": 27.622,+ "deep-scan-worker-shutdown.test.ts": 0.019,+ "diff-rank-input.test.ts": 1.378,+ "effort-forwarding.test.ts": 0.342,+ "errors.property.test.ts": 0.004,+ "errors.test.ts": 0.002,+ "feedback.test.ts": 0.461,+ "finding-catalogue.test.ts": 21.247,+ "finding-deduplication.test.ts": 6.609,+ "finding-embeddings.test.ts": 3.056,+ "finding-preview.test.ts": 0.399,+ "finding-workflow-integration.test.ts": 131.052,+ "finding-workflow-publication.test.ts": 10.601,+ "finding-workflow.test.ts": 1.61,+ "findings-client-retry.test.ts": 0.004,"findings-dashboard.test.ts": 0.001,- "findings-server.test.ts": 20.208,- "github.test.ts": 0.064,- "knowledge-base.test.ts": 1.665,+ "findings-import.test.ts": 1.76,+ "findings-server.test.ts": 47.498,+ "github-actions-example.test.ts": 0.08,+ "github.test.ts": 0.082,+ "import-scan.test.ts": 11.019,+ "invoice-desk-workflow.test.ts": 0.811,+ "knowledge-base.test.ts": 1.885,+ "linear-comment-pagination.test.ts": 0.002,+ "linear-pagination.test.ts": 0.004,"linear.test.ts": 0.002,- "mcp-launcher.test.ts": 0.222,- "multiscan.test.ts": 2.819,+ "mcp-launcher.test.ts": 1.17,+ "mock-scan.test.ts": 18.596,+ "multiscan.test.ts": 29.727,"package-provenance.test.ts": 0.001,+ "package-public-content.test.ts": 0.009,"package-smoke-timeouts.test.ts": 0.0,"package-tar-listing.test.ts": 0.0,- "patch-risk-contract.test.ts": 2.318,- "patch-tui.test.ts": 4.739,- "plugin-apps.test.ts": 0.0,- "plugin-finding-detail-contract.test.ts": 2.077,- "plugin-report-limits.test.ts": 0.709,- "prompt-only-start-timeout.test.ts": 0.002,- "publication-check.test.ts": 0.004,- "publication-events.test.ts": 0.002,- "publication-integration.test.ts": 9.618,- "publication-store.test.ts": 17.125,- "publication.test.ts": 1.359,- "publish.test.ts": 1.395,- "release-automation.test.ts": 6.993,+ "patch-risk-contract.test.ts": 19.551,+ "patch-tui.test.ts": 2.839,+ "plugin-apps.test.ts": 0.006,+ "plugin-finding-detail-contract.test.ts": 3.533,+ "plugin-report-limits.test.ts": 0.756,+ "project-config.test.ts": 6.125,+ "prompt-only-start-timeout.test.ts": 0.019,+ "publication-check.test.ts": 0.005,+ "publication-events.test.ts": 0.003,+ "publication-integration.test.ts": 26.289,+ "publication-store.test.ts": 27.125,+ "publication.test.ts": 1.542,+ "publish.test.ts": 1.957,+ "published-install-smoke.test.ts": 0.019,+ "rank-pool.test.ts": 35.165,+ "rank-shards.test.ts": 24.268,+ "release-automation.test.ts": 18.603,"release-cut-workflow.test.ts": 0.0,- "repository-findings.test.ts": 0.107,- "result.test.ts": 0.002,- "runtime.test.ts": 27.803,- "sarif.test.ts": 0.79,- "scan-activity.test.ts": 0.006,- "scan-comparison.property.test.ts": 0.127,- "scan-comparison.test.ts": 0.14,- "scan-dashboard.test.ts": 0.058,- "scan-history-renderer.test.ts": 0.004,- "scan-logs.test.ts": 0.039,- "scan-recovery.test.ts": 25.336,- "skeleton.test.ts": 0.024,- "stopped-scan-results.test.ts": 7.685,- "targets-large-output.test.ts": 0.486,- "targets.test.ts": 0.855,- "test-reports.test.ts": 0.439,- "trusted-executable.test.ts": 0.266,- "update-notice.test.ts": 0.037,- "workbench-canonical-paths.test.ts": 0.692,- "workbench-nested-git-utf8.test.ts": 0.063,- "workbench-patch.test.ts": 0.198,- "workbench-progress.test.ts": 0.493,- "workbench-remediation-timestamp.test.ts": 0.364,- "workbench-scan-history.test.ts": 0.199,+ "release-pr.test.ts": 36.676,+ "repository-findings.test.ts": 0.245,+ "result.test.ts": 0.008,+ "runtime-plugin-reuse.test.ts": 0.764,+ "runtime.test.ts": 45.386,+ "sandbox-probe.test.ts": 0.066,+ "sarif.test.ts": 0.89,+ "scan-activity.test.ts": 0.005,+ "scan-comparison.property.test.ts": 0.562,+ "scan-comparison.test.ts": 2.817,+ "scan-dashboard.test.ts": 0.103,+ "scan-history-renderer.test.ts": 0.011,+ "scan-logs.test.ts": 0.173,+ "scan-matching-e2e.test.ts": 8.781,+ "scan-recipe.test.ts": 2.5,+ "scan-recovery.test.ts": 36.092,+ "scan-resume.test.ts": 102.599,+ "script-entrypoints.test.ts": 3.564,+ "sdk-project-config.test.ts": 0.5,+ "sdk-scan-prompts.test.ts": 0.738,+ "security-policy-helper.test.ts": 6.905,+ "security-policy.test.ts": 23.727,+ "shell.test.ts": 0.082,+ "skeleton.test.ts": 0.08,+ "stopped-scan-results.test.ts": 15.197,+ "suggest-owners.test.ts": 3.669,+ "targets-large-output.test.ts": 1.285,+ "targets.test.ts": 3.605,+ "test-reports.test.ts": 4.004,+ "test-shards.test.ts": 2.342,+ "trusted-executable.test.ts": 0.356,+ "update-notice.test.ts": 0.125,+ "workbench-canonical-paths.test.ts": 0.873,+ "workbench-nested-git-utf8.test.ts": 0.154,+ "workbench-patch.test.ts": 0.822,+ "workbench-progress.test.ts": 1.183,+ "workbench-remediation-timestamp.test.ts": 1.512,+ "workbench-scan-history.test.ts": 3.351,"workbench-scan-root-alias.test.ts": 0.0,- "workbench-windows-compatibility.test.ts": 0.417,- "worker-progress.property.test.ts": 0.009,- "worker-progress.test.ts": 0.003+ "workbench-windows-compatibility.test.ts": 0.939,+ "worker-progress.property.test.ts": 0.018,+ "worker-progress.test.ts": 0.005,+ "workflow-quality.test.ts": 0.197},"windows": {- "api-attribution-concurrency.test.ts": 18.599,- "api-credentials.test.ts": 56.214,+ "api-attribution-concurrency.test.ts": 27.364,+ "api-credentials.test.ts": 76.223,+ "api-cyber-access.test.ts": 0.442,"api-environment.test.ts": 0.0,- "api-events.test.ts": 2.999,- "api-post-scan.test.ts": 11.43,- "api-preflight-config.test.ts": 1.84,- "api.test.ts": 100.166,- "attack-path-tool-name.test.ts": 0.326,- "auth.test.ts": 2.932,- "build-plugin.test.ts": 4.531,- "bulk-scan-discovery.test.ts": 0.054,- "cli-authentication.test.ts": 45.757,- "cli-cloud-publish.test.ts": 0.494,- "cli-dedupe.test.ts": 0.059,- "cli-deep-scan-summary.test.ts": 0.072,- "cli-export.test.ts": 6.323,+ "api-events.test.ts": 17.652,+ "api-integration.test.ts": 0.0,+ "api-policy.test.ts": 101.385,+ "api-post-scan.test.ts": 22.571,+ "api-preflight-config.test.ts": 1.602,+ "api.test.ts": 137.276,+ "artifact-export.test.ts": 2.514,+ "attack-path-tool-name.test.ts": 0.283,+ "auth.test.ts": 3.266,+ "azure-pipelines-example.test.ts": 0.721,+ "bind-repo-scopes.test.ts": 13.787,+ "build-plugin.test.ts": 7.354,+ "bulk-scan-discovery.test.ts": 0.066,+ "candidate-normalizer.test.ts": 13.829,+ "check-markdown.test.ts": 2.666,+ "classify-scan-severity.test.ts": 38.077,+ "classify-severity.test.ts": 0.073,+ "cli-authentication.test.ts": 227.941,+ "cli-classify-severity.test.ts": 0.106,+ "cli-cloud-publish.test.ts": 0.413,+ "cli-dedupe.test.ts": 0.1,+ "cli-deep-scan-summary.test.ts": 0.054,+ "cli-diagnostics.test.ts": 0.1,+ "cli-export.test.ts": 15.871,+ "cli-feedback.test.ts": 2.578,+ "cli-help.test.ts": 0.198,"cli-history-paths.test.ts": 0.009,- "cli-launcher.test.ts": 9.241,- "cli-patch-trust.test.ts": 3.655,- "cli-patch.test.ts": 8.605,- "cli-publish.test.ts": 0.583,- "cli-scan-prompts.test.ts": 0.919,- "cli-serve.test.ts": 7.776,- "cli-signals.test.ts": 0.061,- "cli-skills.test.ts": 2.774,- "cli-verify-fix.test.ts": 0.173,- "cli-workbench.test.ts": 0.241,- "cli.test.ts": 6.814,- "cloud-publish.test.ts": 9.022,- "codex-review.test.ts": 0.642,- "compact-diff-scan.test.ts": 33.15,- "completed-scan-handoff.test.ts": 0.003,- "component-scan.test.ts": 3.831,- "config.test.ts": 5.1,- "contract.test.ts": 9.095,- "cost-model.property.test.ts": 0.012,- "cost.test.ts": 1.574,- "custom-publish.test.ts": 0.582,- "custom-validation.test.ts": 20.415,- "deep-progress.test.ts": 0.007,- "deep-scan-parent-denials.test.ts": 0.013,- "deep-scan-reducer-recovery.test.ts": 0.527,- "deep-scan-timestamp-compat.test.ts": 1.981,- "deep-scan-windows-executable.test.ts": 0.031,- "deep-scan-workbench.test.ts": 29.291,- "deep-scan-worker-shutdown.test.ts": 0.009,- "diff-rank-input.test.ts": 2.241,- "errors.property.test.ts": 0.032,- "errors.test.ts": 0.006,- "finding-deduplication.test.ts": 0.608,- "finding-embeddings.test.ts": 1.515,- "finding-preview.test.ts": 0.368,- "finding-workflow-integration.test.ts": 58.802,- "finding-workflow-publication.test.ts": 3.961,- "finding-workflow.test.ts": 1.472,+ "cli-launcher.test.ts": 1.319,+ "cli-patch-results.test.ts": 5.409,+ "cli-patch-trust.test.ts": 9.679,+ "cli-patch.test.ts": 21.549,+ "cli-policy.test.ts": 22.256,+ "cli-project-config.test.ts": 4.89,+ "cli-publish.test.ts": 0.402,+ "cli-scan-import.test.ts": 0.102,+ "cli-scan-logs.test.ts": 7.695,+ "cli-scan-patch-settings.test.ts": 0.77,+ "cli-scan-prompts.test.ts": 0.901,+ "cli-serve.test.ts": 13.64,+ "cli-show-cost.test.ts": 0.085,+ "cli-signals.test.ts": 0.037,+ "cli-skill-chatgpt-provider-auth.test.ts": 269.629,+ "cli-skill-native-config.test.ts": 49.542,+ "cli-skills.test.ts": 3.198,+ "cli-suggest-owners.test.ts": 0.419,+ "cli-verify-fix.test.ts": 0.193,+ "cli-workbench.test.ts": 0.232,+ "cli.test.ts": 7.41,+ "cloud-publish.test.ts": 7.371,+ "codex-review.test.ts": 12.619,+ "compact-diff-scan.test.ts": 38.57,+ "completed-scan-handoff.test.ts": 0.004,+ "component-scan.test.ts": 19.591,+ "config.test.ts": 7.622,+ "container-ci-workflow.test.ts": 1.191,+ "container-entrypoint.test.ts": 0.0,+ "contract.test.ts": 10.574,+ "cost-context.test.ts": 0.003,+ "cost-model.property.test.ts": 0.021,+ "cost.test.ts": 1.515,+ "custom-publish.test.ts": 0.581,+ "custom-validation-example.test.ts": 0.444,+ "custom-validation.test.ts": 23.262,+ "dedupe-records.test.ts": 0.861,+ "deep-config.test.ts": 0.492,+ "deep-progress.test.ts": 0.005,+ "deep-review-input.test.ts": 15.492,+ "deep-scan-parent-denials.test.ts": 0.034,+ "deep-scan-reducer-recovery.test.ts": 0.544,+ "deep-scan-timestamp-compat.test.ts": 2.083,+ "deep-scan-windows-executable.test.ts": 0.033,+ "deep-scan-workbench.test.ts": 29.766,+ "deep-scan-worker-shutdown.test.ts": 0.024,+ "diff-rank-input.test.ts": 2.272,+ "effort-forwarding.test.ts": 0.172,+ "errors.property.test.ts": 0.005,+ "errors.test.ts": 0.001,+ "feedback.test.ts": 1.226,+ "finding-catalogue.test.ts": 11.43,+ "finding-deduplication.test.ts": 5.169,+ "finding-embeddings.test.ts": 2.258,+ "finding-preview.test.ts": 0.284,+ "finding-workflow-integration.test.ts": 166.129,+ "finding-workflow-publication.test.ts": 14.351,+ "finding-workflow.test.ts": 4.138,+ "findings-client-retry.test.ts": 0.003,"findings-dashboard.test.ts": 0.001,- "findings-server.test.ts": 36.179,- "github.test.ts": 0.094,- "knowledge-base.test.ts": 13.919,- "linear.test.ts": 0.002,- "mcp-launcher.test.ts": 0.284,- "multiscan.test.ts": 31.671,- "package-provenance.test.ts": 0.0,+ "findings-import.test.ts": 1.886,+ "findings-server.test.ts": 58.875,+ "github-actions-example.test.ts": 0.327,+ "github.test.ts": 0.05,+ "import-scan.test.ts": 15.313,+ "invoice-desk-workflow.test.ts": 1.181,+ "knowledge-base.test.ts": 7.043,+ "linear-comment-pagination.test.ts": 0.002,+ "linear-pagination.test.ts": 0.003,+ "linear.test.ts": 0.003,+ "mcp-launcher.test.ts": 3.656,+ "mock-scan.test.ts": 28.689,+ "multiscan.test.ts": 71.201,+ "package-provenance.test.ts": 0.001,+ "package-public-content.test.ts": 0.003,"package-smoke-timeouts.test.ts": 0.0,"package-tar-listing.test.ts": 0.0,- "patch-risk-contract.test.ts": 4.074,- "patch-tui.test.ts": 5.4,+ "patch-risk-contract.test.ts": 38.98,+ "patch-tui.test.ts": 4.659,"plugin-apps.test.ts": 0.001,- "plugin-finding-detail-contract.test.ts": 3.221,- "plugin-report-limits.test.ts": 2.521,- "prompt-only-start-timeout.test.ts": 0.009,- "publication-check.test.ts": 0.005,- "publication-events.test.ts": 0.005,- "publication-integration.test.ts": 15.871,- "publication-store.test.ts": 31.854,- "publication.test.ts": 1.7,- "publish.test.ts": 7.768,- "release-automation.test.ts": 41.22,+ "plugin-finding-detail-contract.test.ts": 3.659,+ "plugin-report-limits.test.ts": 2.249,+ "project-config.test.ts": 2.719,+ "prompt-only-start-timeout.test.ts": 0.012,+ "publication-check.test.ts": 0.008,+ "publication-events.test.ts": 0.01,+ "publication-integration.test.ts": 24.468,+ "publication-store.test.ts": 33.269,+ "publication.test.ts": 1.771,+ "publish.test.ts": 1.622,+ "published-install-smoke.test.ts": 0.068,+ "rank-pool.test.ts": 32.82,+ "rank-shards.test.ts": 15.229,+ "release-automation.test.ts": 35.575,"release-cut-workflow.test.ts": 0.0,- "repository-findings.test.ts": 0.277,- "result.test.ts": 0.008,- "runtime.test.ts": 134.065,- "sarif.test.ts": 1.416,+ "release-pr.test.ts": 91.813,+ "repository-findings.test.ts": 0.359,+ "result.test.ts": 0.006,+ "runtime-plugin-reuse.test.ts": 0.846,+ "runtime.test.ts": 157.186,+ "sandbox-probe.test.ts": 0.001,+ "sarif.test.ts": 1.437,"scan-activity.test.ts": 0.007,- "scan-comparison.property.test.ts": 0.16,- "scan-comparison.test.ts": 10.704,- "scan-dashboard.test.ts": 0.061,- "scan-history-renderer.test.ts": 0.005,- "scan-logs.test.ts": 0.139,- "scan-recovery.test.ts": 62.302,- "skeleton.test.ts": 0.03,- "stopped-scan-results.test.ts": 15.814,- "targets-large-output.test.ts": 11.48,- "targets.test.ts": 8.454,- "test-reports.test.ts": 1.222,- "trusted-executable.test.ts": 0.064,- "update-notice.test.ts": 0.052,- "workbench-canonical-paths.test.ts": 1.853,- "workbench-nested-git-utf8.test.ts": 0.364,- "workbench-patch.test.ts": 0.323,- "workbench-progress.test.ts": 0.802,- "workbench-remediation-timestamp.test.ts": 0.587,- "workbench-scan-history.test.ts": 0.547,- "workbench-scan-root-alias.test.ts": 0.276,- "workbench-windows-compatibility.test.ts": 1.479,+ "scan-comparison.property.test.ts": 0.65,+ "scan-comparison.test.ts": 8.199,+ "scan-dashboard.test.ts": 0.096,+ "scan-history-renderer.test.ts": 0.006,+ "scan-logs.test.ts": 0.35,+ "scan-matching-e2e.test.ts": 16.789,+ "scan-recipe.test.ts": 5.424,+ "scan-recovery.test.ts": 76.061,+ "scan-resume.test.ts": 151.317,+ "script-entrypoints.test.ts": 3.367,+ "sdk-project-config.test.ts": 0.939,+ "sdk-scan-prompts.test.ts": 1.712,+ "security-policy-helper.test.ts": 11.885,+ "security-policy.test.ts": 63.859,+ "shell.test.ts": 0.087,+ "skeleton.test.ts": 0.098,+ "stopped-scan-results.test.ts": 17.338,+ "suggest-owners.test.ts": 23.573,+ "targets-large-output.test.ts": 8.455,+ "targets.test.ts": 8.794,+ "test-reports.test.ts": 6.265,+ "test-shards.test.ts": 3.448,+ "trusted-executable.test.ts": 0.091,+ "update-notice.test.ts": 0.034,+ "workbench-canonical-paths.test.ts": 4.027,+ "workbench-nested-git-utf8.test.ts": 1.221,+ "workbench-patch.test.ts": 0.291,+ "workbench-progress.test.ts": 0.807,+ "workbench-remediation-timestamp.test.ts": 1.303,+ "workbench-scan-history.test.ts": 4.08,+ "workbench-scan-root-alias.test.ts": 0.298,+ "workbench-windows-compatibility.test.ts": 1.935,"worker-progress.property.test.ts": 0.013,- "worker-progress.test.ts": 0.003+ "worker-progress.test.ts": 0.003,+ "workflow-quality.test.ts": 0.0}}diff --git a/sdk/typescript/tests-ts/cli-authentication.test.ts b/sdk/typescript/tests-ts/cli-authentication.test.tsindex d51ec4f94..892238d9c 100644--- a/sdk/typescript/tests-ts/cli-authentication.test.ts+++ b/sdk/typescript/tests-ts/cli-authentication.test.ts@@ -1,4 +1,5 @@import { readJsonLines } from "./support/json.js";+import { runProviderSkill } from "./support/cli-provider-authentication.js";import { resolving } from "./support/promises.js";import { spawnSync } from "node:child_process";import { existsSync } from "node:fs";@@ -1259,90 +1260,6 @@ describe("CLI authentication", () => {});describe("skill authentication", () => {- async function runProviderSkill({- command = "patch",- auth = "api-key",- overrides,- environment,- ambientConfig,- storedCredentials = false,- }: {- command?: "validate" | "patch" | "verify-fix";- auth?: "auto" | "chatgpt" | "api-key";- overrides: readonly string[];- environment?: NodeJS.ProcessEnv;- ambientConfig?: string;- storedCredentials?: boolean;- }) {- const repository = join(stateDirectory, "repository");- const ambientHome = join(stateDirectory, "ambient");- const log = join(stateDirectory, "provider.jsonl");- await mkdir(repository);- await mkdir(ambientHome);- if (ambientConfig !== undefined) {- await writeFile(join(ambientHome, "config.toml"), ambientConfig);- }- if (storedCredentials) {- await writeFile(- join(ambientHome, "auth.json"),- JSON.stringify({- auth_mode: "apikey",- OPENAI_API_KEY: "SYNTHETIC_STORED_KEY",- }),- { mode: 0o600 },- );- }- const { stderr, runCli } = createCliTest(main);-- const status = await runCli(- [- command,- "Synthetic issue",- "--auth",- auth,- ...overrides.flatMap((value) => ["--codex", value]),- ],- dependencies({- currentDirectory: repository,- environment: {- ...environment,- CODEX_HOME: ambientHome,- SYNTHETIC_PROVIDER_LOG: log,- SYNTHETIC_SKILL_COMMAND: command,- },- onCodex: async (args, output, environment, input) => {- const originalOverrides = structuredClone(output?.codexOverrides);- const result = await runCodexSkillCommand(- [- fileURLToPath(- new URL("./fixtures/skill-provider-auth.mjs", import.meta.url),- ),- ...args,- ],- output,- { command: process.execPath },- environment,- input,- );- expect(output?.codexOverrides).toEqual(originalOverrides);- return result;- },- }),- );- const records = existsSync(log) ? await readJsonLines(log) : [];- if (ambientConfig !== undefined) {- expect(await readFile(join(ambientHome, "config.toml"), "utf8")).toBe(- ambientConfig,- );- }- return {- status,- stderr: stderr.text(),- launch: records[0],- requests: records.slice(1),- };- }-test.each([["validate", "auto", "gateway"],["validate", "api-key", "gateway"],@@ -1354,7 +1271,7 @@ describe("skill authentication", () => {] as const)("%s uses the custom provider env_key with %s auth (%s)",async (command, auth, provider) => {- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {command,auth,overrides: [@@ -1383,7 +1300,7 @@ describe("skill authentication", () => {);test("rejects a missing custom provider API key before launch", async () => {- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {overrides: ['model_provider="gateway"','model_providers.gateway.env_key="GATEWAY_API_KEY"',@@ -1397,7 +1314,7 @@ describe("skill authentication", () => {test.each(["patch", "verify-fix"] as const)("%s preserves valid names in unrelated ambient configuration",async (command) => {- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {command,overrides: [],ambientConfig: [@@ -1423,7 +1340,7 @@ describe("skill authentication", () => {test.each([true, false])("patch uses a custom provider table override with ambient selection (new key present: %p)",async (hasSelectedKey) => {- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {overrides: ['model_providers.gateway.env_key="GATEWAY_API_KEY"'],ambientConfig: ['model_provider="gateway"',@@ -1459,7 +1376,7 @@ describe("skill authentication", () => {] as const)("%s keeps ambient provider authentication with explicit selection (partial override: %p, profile: %p)",async (command, partialOverride, profile) => {- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {command,overrides: ['model_provider="gateway"',@@ -1513,7 +1430,7 @@ describe("skill authentication", () => {] as const)("patch ignores replacement authentication for native provider %s with %s auth",async (provider, auth) => {- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {auth,overrides: [`model_provider=${JSON.stringify(provider)}`],ambientConfig: [@@ -1540,7 +1457,7 @@ describe("skill authentication", () => {test.each(["patch", "verify-fix"] as const)("%s keeps native OpenAI authentication despite a provider table override",async (command) => {- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {command,overrides: ['model_provider="openai"'],ambientConfig: [@@ -1576,7 +1493,7 @@ describe("skill authentication", () => {] as const)("%s uses the custom provider key before OpenAI login with %s auth",async (command, auth) => {- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {command,auth,overrides: ['model_provider="gateway"'],@@ -1601,105 +1518,10 @@ describe("skill authentication", () => {},);- test.each(- (- [- ["validate", "override"],- ["patch", "override"],- ["verify-fix", "override"],- ["patch", "ambient"],- ["verify-fix", "ambient"],- ["patch", "profile"],- ["verify-fix", "profile"],- ] as const- ).flatMap(([command, source]) =>- [true, false, undefined].flatMap((requiresOpenAiAuth) =>- ["env_key", "bearer"].map(- (credential) =>- [command, source, requiresOpenAiAuth, credential] as const,- ),- ),- ),- )(- "%s removes the custom provider key and %s config for explicit ChatGPT auth (requires OpenAI: %p, credential: %s)",- async (command, source, requiresOpenAiAuth, credential) => {- const configuredEnvKey =- process.platform === "win32" ? "gateway_api_key" : "GATEWAY_API_KEY";- const environment = { GATEWAY_API_KEY: "SYNTHETIC_GATEWAY_KEY" };- const providerConfig = {- name: "Synthetic gateway",- base_url: "https://gateway.example.test/v1",- wire_api: "responses",- ...(requiresOpenAiAuth === undefined- ? {}- : { requires_openai_auth: requiresOpenAiAuth }),- };- const providerSettings = [- ...Object.entries(providerConfig).map(- ([key, value]) => `${key}=${JSON.stringify(value)}`,- ),- ...(credential === "env_key"- ? [`env_key=${JSON.stringify(configuredEnvKey)}`]- : []),- ...(credential === "bearer" || requiresOpenAiAuth === false- ? ['experimental_bearer_token="SYNTHETIC_FALLBACK_KEY"']- : []),- ];- const result = await runProviderSkill({- command,- auth: "chatgpt",- overrides:- source === "override"- ? [- 'model_provider="gateway"',- ...providerSettings.map(- (setting) => `model_providers.gateway.${setting}`,- ),- ]- : [],- ...(source === "override"- ? {}- : {- ambientConfig: [- ...(source === "profile"- ? ['profile="gateway-profile"', "[profiles.gateway-profile]"]- : []),- 'model_provider="gateway"',- "[model_providers.gateway]",- ...providerSettings,- ].join("\n"),- }),- environment,- storedCredentials: true,- });- expect(result.status, result.stderr).toBe(0);- expect(result.launch.environment).toEqual(- credential === "env_key" ? {} : environment,- );- expect(parseToml(result.launch.config)["model_providers"]).toEqual({- gateway: { ...providerConfig, requires_openai_auth: true },- });- const providerOverride = result.launch.args.findLast((arg: string) =>- arg.startsWith("model_providers="),- );- if (source === "override") {- expect(parseToml(providerOverride)["model_providers"]).toEqual({- gateway: { ...providerConfig, requires_openai_auth: true },- });- } else {- expect(providerOverride).toBeUndefined();- }- expect(result.requests.map((request) => request.method)).not.toContain(- "account/login/start",- );- expect(environment.GATEWAY_API_KEY).toBe("SYNTHETIC_GATEWAY_KEY");- },- );-test.each(["patch", "verify-fix"] as const)("%s keeps ambient provider credentials out of process arguments",async (command) => {- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {command,auth: "chatgpt",overrides: [@@ -1749,7 +1571,7 @@ describe("skill authentication", () => {test.each(["patch", "verify-fix"] as const)("%s rejects a missing custom provider key despite an available OpenAI key",async (command) => {- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {command,overrides: ['model_provider="gateway"'],ambientConfig: [@@ -1779,7 +1601,7 @@ describe("skill authentication", () => {async (command, envKey) => {const configuredEnvKey =process.platform === "win32" ? envKey.toLowerCase() : envKey;- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {command,overrides: ['model_provider="gateway"'],ambientConfig: [@@ -1809,7 +1631,7 @@ describe("skill authentication", () => {);test("resolves custom provider key casing according to the platform", async () => {- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {overrides: ['model_provider="gateway"','model_providers.gateway.env_key="GATEWAY_API_KEY"',@@ -1836,7 +1658,7 @@ describe("skill authentication", () => {] as const)("preserves OPENAI_API_KEY when configured as the %s provider key with %s auth",async (provider, auth) => {- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {auth,overrides: [`model_provider=${JSON.stringify(provider)}`,@@ -1880,7 +1702,7 @@ describe("skill authentication", () => {const settings = Object.entries(providerConfig).map(([key, value]) => `${key}=${JSON.stringify(value)}`,);- const result = await runProviderSkill({+ const result = await runProviderSkill(stateDirectory, {command,auth: "auto",overrides: [diff --git a/sdk/typescript/tests-ts/cli-skill-chatgpt-provider-auth.test.ts b/sdk/typescript/tests-ts/cli-skill-chatgpt-provider-auth.test.tsnew file mode 100644index 000000000..8b9d847fd--- /dev/null+++ b/sdk/typescript/tests-ts/cli-skill-chatgpt-provider-auth.test.ts@@ -0,0 +1,114 @@+import { realpath, rm } from "node:fs/promises";+import { afterEach, beforeEach, describe, expect, test } from "bun:test";+import { parse as parseToml } from "smol-toml";+import { runProviderSkill } from "./support/cli-provider-authentication.js";+import { temporaryDirectory } from "./support/temporary-directories.js";++let stateDirectory: string;++beforeEach(async () => {+ stateDirectory = await realpath(+ await temporaryDirectory("codex-security-cli-authentication-"),+ );+});++afterEach(async () => {+ await rm(stateDirectory, { recursive: true, force: true });+});++describe("skill authentication", () => {+ test.each(+ (+ [+ ["validate", "override"],+ ["patch", "override"],+ ["verify-fix", "override"],+ ["patch", "ambient"],+ ["verify-fix", "ambient"],+ ["patch", "profile"],+ ["verify-fix", "profile"],+ ] as const+ ).flatMap(([command, source]) =>+ [true, false, undefined].flatMap((requiresOpenAiAuth) =>+ ["env_key", "bearer"].map(+ (credential) =>+ [command, source, requiresOpenAiAuth, credential] as const,+ ),+ ),+ ),+ )(+ "%s removes the custom provider key and %s config for explicit ChatGPT auth (requires OpenAI: %p, credential: %s)",+ async (command, source, requiresOpenAiAuth, credential) => {+ const configuredEnvKey =+ process.platform === "win32" ? "gateway_api_key" : "GATEWAY_API_KEY";+ const environment = { GATEWAY_API_KEY: "SYNTHETIC_GATEWAY_KEY" };+ const providerConfig = {+ name: "Synthetic gateway",+ base_url: "https://gateway.example.test/v1",+ wire_api: "responses",+ ...(requiresOpenAiAuth === undefined+ ? {}+ : { requires_openai_auth: requiresOpenAiAuth }),+ };+ const providerSettings = [+ ...Object.entries(providerConfig).map(+ ([key, value]) => `${key}=${JSON.stringify(value)}`,+ ),+ ...(credential === "env_key"+ ? [`env_key=${JSON.stringify(configuredEnvKey)}`]+ : []),+ ...(credential === "bearer" || requiresOpenAiAuth === false+ ? ['experimental_bearer_token="SYNTHETIC_FALLBACK_KEY"']+ : []),+ ];+ const result = await runProviderSkill(stateDirectory, {+ command,+ auth: "chatgpt",+ overrides:+ source === "override"+ ? [+ 'model_provider="gateway"',+ ...providerSettings.map(+ (setting) => `model_providers.gateway.${setting}`,+ ),+ ]+ : [],+ ...(source === "override"+ ? {}+ : {+ ambientConfig: [+ ...(source === "profile"+ ? ['profile="gateway-profile"', "[profiles.gateway-profile]"]+ : []),+ 'model_provider="gateway"',+ "[model_providers.gateway]",+ ...providerSettings,+ ].join("\n"),+ }),+ environment,+ storedCredentials: true,+ });+ expect(result.status, result.stderr).toBe(0);+ expect(result.launch.environment).toEqual(+ credential === "env_key" ? {} : environment,+ );+ expect(parseToml(result.launch.config)["model_providers"]).toEqual({+ gateway: { ...providerConfig, requires_openai_auth: true },+ });+ const providerOverride = result.launch.args.findLast((arg: string) =>+ arg.startsWith("model_providers="),+ );+ if (source === "override") {+ expect(parseToml(providerOverride)["model_providers"]).toEqual({+ gateway: { ...providerConfig, requires_openai_auth: true },+ });+ } else {+ expect(providerOverride).toBeUndefined();+ }+ expect(result.requests.map((request) => request.method)).not.toContain(+ "account/login/start",+ );+ expect(environment.GATEWAY_API_KEY).toBe("SYNTHETIC_GATEWAY_KEY");+ },+ );+});diff --git a/sdk/typescript/tests-ts/support/cli-provider-authentication.ts b/sdk/typescript/tests-ts/support/cli-provider-authentication.tsnew file mode 100644index 000000000..7be95737a--- /dev/null+++ b/sdk/typescript/tests-ts/support/cli-provider-authentication.ts@@ -0,0 +1,97 @@+import { existsSync } from "node:fs";+import { mkdir, readFile, writeFile } from "node:fs/promises";+import { join } from "node:path";+import { fileURLToPath } from "node:url";+import { expect } from "bun:test";+import { main, runCodexSkillCommand } from "../../src/cli.js";+import { dependencies as cliDependencies } from "../cli-fixtures.js";+import { createCliTest } from "./cli-run.js";+import { readJsonLines } from "./json.js";++export async function runProviderSkill(+ stateDirectory: string,+ {+ command = "patch",+ auth = "api-key",+ overrides,+ environment,+ ambientConfig,+ storedCredentials = false,+ }: {+ command?: "validate" | "patch" | "verify-fix";+ auth?: "auto" | "chatgpt" | "api-key";+ overrides: readonly string[];+ environment?: NodeJS.ProcessEnv;+ ambientConfig?: string;+ storedCredentials?: boolean;+ },+) {+ const repository = join(stateDirectory, "repository");+ const ambientHome = join(stateDirectory, "ambient");+ const log = join(stateDirectory, "provider.jsonl");+ await mkdir(repository);+ await mkdir(ambientHome);+ if (ambientConfig !== undefined) {+ await writeFile(join(ambientHome, "config.toml"), ambientConfig);+ }+ if (storedCredentials) {+ await writeFile(+ join(ambientHome, "auth.json"),+ JSON.stringify({+ auth_mode: "apikey",+ OPENAI_API_KEY: "SYNTHETIC_STORED_KEY",+ }),+ { mode: 0o600 },+ );+ }+ const { stderr, runCli } = createCliTest(main);++ const status = await runCli(+ [+ command,+ "Synthetic issue",+ "--auth",+ auth,+ ...overrides.flatMap((value) => ["--codex", value]),+ ],+ cliDependencies({+ currentDirectory: repository,+ environment: {+ CODEX_SECURITY_STATE_DIR: stateDirectory,+ ...environment,+ CODEX_HOME: ambientHome,+ SYNTHETIC_PROVIDER_LOG: log,+ SYNTHETIC_SKILL_COMMAND: command,+ },+ onCodex: async (args, output, environment, input) => {+ const originalOverrides = structuredClone(output?.codexOverrides);+ const result = await runCodexSkillCommand(+ [+ fileURLToPath(+ new URL("../fixtures/skill-provider-auth.mjs", import.meta.url),+ ),+ ...args,+ ],+ output,+ { command: process.execPath },+ environment,+ input,+ );+ expect(output?.codexOverrides).toEqual(originalOverrides);+ return result;+ },+ }),+ );+ const records = existsSync(log) ? await readJsonLines(log) : [];+ if (ambientConfig !== undefined) {+ expect(await readFile(join(ambientHome, "config.toml"), "utf8")).toBe(+ ambientConfig,+ );+ }+ return {+ status,+ stderr: stderr.text(),+ launch: records[0],+ requests: records.slice(1),+ };+}