@openai/codex-security 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -12
- package/_bundled_plugin/.codex-plugin/plugin.json +1 -0
- package/_bundled_plugin/examples/completed-scan/findings.json +34 -34
- package/_bundled_plugin/examples/completed-scan/report.md +22 -31
- package/_bundled_plugin/examples/completed-scan/scan-manifest.json +27 -29
- package/_bundled_plugin/examples/{completed-scan → legacy-completed-scan}/coverage.json +1 -0
- package/_bundled_plugin/examples/legacy-completed-scan/findings.json +57 -0
- package/_bundled_plugin/examples/legacy-completed-scan/report.md +98 -0
- package/_bundled_plugin/examples/legacy-completed-scan/scan-manifest.json +43 -0
- package/_bundled_plugin/mcp/helpers.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/helpers.mjs.br.part-001 +0 -0
- package/_bundled_plugin/mcp/native/win32-arm64/windows.node +0 -0
- package/_bundled_plugin/mcp/native/win32-x64/windows.node +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-002 +0 -0
- package/_bundled_plugin/references/core-scan.md +2 -2
- package/_bundled_plugin/references/final-report.md +16 -6
- package/_bundled_plugin/references/scan-artifacts.md +6 -6
- package/_bundled_plugin/references/scan-contract.md +10 -12
- package/_bundled_plugin/references/threat-model.md +1 -1
- package/_bundled_plugin/schemas/scan-manifest.schema.json +36 -11
- package/_bundled_plugin/schemas/tools/scan-draft.schema.json +5 -5
- package/_bundled_plugin/scripts/deep_scan_workbench.py +1 -1
- package/_bundled_plugin/scripts/finalize_scan_contract.py +97 -20
- package/_bundled_plugin/scripts/report_projection.py +5 -2
- package/_bundled_plugin/scripts/review_state.py +68 -0
- package/_bundled_plugin/scripts/servicenow_avit.py +107 -0
- package/_bundled_plugin/scripts/validate_scan_contract.py +1 -2
- package/_bundled_plugin/scripts/workbench/retained_coverage.py +49 -37
- package/_bundled_plugin/scripts/workbench/retained_records.py +7 -7
- package/_bundled_plugin/scripts/workbench/saved_coverage.py +15 -15
- package/_bundled_plugin/scripts/workbench/saved_sources.py +24 -6
- package/_bundled_plugin/scripts/workbench_constants.py +0 -1
- package/_bundled_plugin/scripts/workbench_coverage_receipts.py +4 -4
- package/_bundled_plugin/scripts/workbench_db.py +5 -150
- package/_bundled_plugin/scripts/workbench_saved_results.py +169 -4
- package/_bundled_plugin/scripts/workbench_scan_history.py +12 -7
- package/_bundled_plugin/scripts/workbench_scan_start.py +4 -1
- package/_bundled_plugin/skills/publish-findings/SKILL.md +9 -3
- package/_bundled_plugin/skills/security-diff-scan/SKILL.md +1 -1
- package/_bundled_plugin/skills/security-scan/SKILL.md +7 -7
- package/_bundled_plugin/skills/track-findings/SKILL.md +1 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +50 -27
- package/dist/api.js.map +1 -1
- package/dist/artifact-export.d.ts +12 -3
- package/dist/artifact-export.d.ts.map +1 -1
- package/dist/artifact-export.js +30 -10
- package/dist/artifact-export.js.map +1 -1
- package/dist/cli-help.d.ts.map +1 -1
- package/dist/cli-help.js +1 -0
- package/dist/cli-help.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +69 -55
- package/dist/cli.js.map +1 -1
- package/dist/cloud-publish.d.ts.map +1 -1
- package/dist/cloud-publish.js +2 -23
- package/dist/cloud-publish.js.map +1 -1
- package/dist/contract.d.ts +4 -2
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +39 -21
- package/dist/contract.js.map +1 -1
- package/dist/custom-publish.js +2 -2
- package/dist/custom-publish.js.map +1 -1
- package/dist/custom-validation-prompt.d.ts.map +1 -1
- package/dist/custom-validation-prompt.js +14 -6
- package/dist/custom-validation-prompt.js.map +1 -1
- package/dist/custom-validation.d.ts.map +1 -1
- package/dist/custom-validation.js +17 -15
- package/dist/custom-validation.js.map +1 -1
- package/dist/deduplication/codex-review.d.ts.map +1 -1
- package/dist/deduplication/codex-review.js +2 -2
- package/dist/deduplication/codex-review.js.map +1 -1
- package/dist/deduplication/deduplication-prompts.d.ts +1 -0
- package/dist/deduplication/deduplication-prompts.d.ts.map +1 -1
- package/dist/deduplication/deduplication-prompts.js +3 -0
- package/dist/deduplication/deduplication-prompts.js.map +1 -1
- package/dist/deduplication/records-protocol.d.ts.map +1 -1
- package/dist/deduplication/records-protocol.js +21 -1
- package/dist/deduplication/records-protocol.js.map +1 -1
- package/dist/deduplication/scan.d.ts.map +1 -1
- package/dist/deduplication/scan.js +2 -2
- package/dist/deduplication/scan.js.map +1 -1
- package/dist/external-findings-local.d.ts +1 -0
- package/dist/external-findings-local.d.ts.map +1 -1
- package/dist/external-findings-local.js +25 -2
- package/dist/external-findings-local.js.map +1 -1
- package/dist/external-findings-publish.d.ts +1 -0
- package/dist/external-findings-publish.d.ts.map +1 -1
- package/dist/external-findings-publish.js +55 -26
- package/dist/external-findings-publish.js.map +1 -1
- package/dist/external-findings-read.d.ts +1 -0
- package/dist/external-findings-read.d.ts.map +1 -1
- package/dist/external-findings-read.js +10 -0
- package/dist/external-findings-read.js.map +1 -1
- package/dist/external-findings.d.ts +2 -0
- package/dist/external-findings.d.ts.map +1 -1
- package/dist/external-findings.js.map +1 -1
- package/dist/external-import-contract.d.ts +4 -0
- package/dist/external-import-contract.d.ts.map +1 -1
- package/dist/external-import-contract.js +34 -10
- package/dist/external-import-contract.js.map +1 -1
- package/dist/finding-workflow.d.ts +2 -0
- package/dist/finding-workflow.d.ts.map +1 -1
- package/dist/finding-workflow.js +3 -0
- package/dist/finding-workflow.js.map +1 -1
- package/dist/github-advisories.d.ts.map +1 -1
- package/dist/github-advisories.js +5 -5
- package/dist/github-advisories.js.map +1 -1
- package/dist/github-dependabot-findings.d.ts +6 -0
- package/dist/github-dependabot-findings.d.ts.map +1 -0
- package/dist/github-dependabot-findings.js +247 -0
- package/dist/github-dependabot-findings.js.map +1 -0
- package/dist/github-findings.d.ts.map +1 -1
- package/dist/github-findings.js +11 -4
- package/dist/github-findings.js.map +1 -1
- package/dist/github-identifiers.d.ts +4 -0
- package/dist/github-identifiers.d.ts.map +1 -0
- package/dist/github-identifiers.js +9 -0
- package/dist/github-identifiers.js.map +1 -0
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +4 -6
- package/dist/github.js.map +1 -1
- package/dist/host-protocol.d.ts +1 -1
- package/dist/host-protocol.d.ts.map +1 -1
- package/dist/host-protocol.js +2 -2
- package/dist/host-protocol.js.map +1 -1
- package/dist/hosted-scan.d.ts.map +1 -1
- package/dist/hosted-scan.js +13 -6
- package/dist/hosted-scan.js.map +1 -1
- package/dist/import-scan.js +16 -16
- package/dist/import-scan.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/knowledge-base.js +3 -0
- package/dist/knowledge-base.js.map +1 -1
- package/dist/mock-scan.d.ts +1 -2
- package/dist/mock-scan.d.ts.map +1 -1
- package/dist/mock-scan.js +12 -17
- package/dist/mock-scan.js.map +1 -1
- package/dist/models.d.ts +9 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js.map +1 -1
- package/dist/multiscan.d.ts.map +1 -1
- package/dist/multiscan.js +1 -6
- package/dist/multiscan.js.map +1 -1
- package/dist/native-json-findings.d.ts +30 -0
- package/dist/native-json-findings.d.ts.map +1 -0
- package/dist/native-json-findings.js +114 -0
- package/dist/native-json-findings.js.map +1 -0
- package/dist/opengrep-findings.d.ts +10 -0
- package/dist/opengrep-findings.d.ts.map +1 -0
- package/dist/opengrep-findings.js +198 -0
- package/dist/opengrep-findings.js.map +1 -0
- package/dist/patch-tui.d.ts.map +1 -1
- package/dist/patch-tui.js +2 -0
- package/dist/patch-tui.js.map +1 -1
- package/dist/publication.js +1 -2
- package/dist/publication.js.map +1 -1
- package/dist/record.d.ts +1 -0
- package/dist/record.d.ts.map +1 -1
- package/dist/record.js +10 -0
- package/dist/record.js.map +1 -1
- package/dist/result.d.ts +5 -3
- package/dist/result.d.ts.map +1 -1
- package/dist/result.js +9 -6
- package/dist/result.js.map +1 -1
- package/dist/scan-history-renderer.js +1 -1
- package/dist/scan-history-renderer.js.map +1 -1
- package/dist/scanner-import.d.ts +0 -1
- package/dist/scanner-import.d.ts.map +1 -1
- package/dist/scanner-import.js +9 -9
- package/dist/scanner-import.js.map +1 -1
- package/dist/security-policy.d.ts.map +1 -1
- package/dist/security-policy.js +16 -2
- package/dist/security-policy.js.map +1 -1
- package/dist/semgrep-findings.d.ts.map +1 -1
- package/dist/semgrep-findings.js +15 -82
- package/dist/semgrep-findings.js.map +1 -1
- package/docs/cli.md +55 -10
- package/docs/dedupe-records.md +15 -1
- package/docs/hosted-scans.md +14 -0
- package/package.json +5 -5
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";AA6CA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAEL,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,EAKL,gBAAgB,EAIhB,KAAK,aAAa,EACnB,MAAM,WAAW,CAAC;AAMnB,OAAO,EAcL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,sBAAsB,EAE5B,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACrB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGhF,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,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C5B,MAAM,GAAE,mBAAwB,GAC/B,aAAa,CAEf;AAGD,wBAAgB,aAAa,CAAC,WAAW,EAAE,kBAAkB,GAAG,MAAM,CAKrE;AAED,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,kBAAkB,EAC/B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,QAAQ,GAAE,OAAO,iBAAqC,GACrD,OAAO,CAAC,OAAO,CAAC,CAOlB;AA6sBD,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,kBAAkB,EAC/B,IAAI,GAAE,YAAgC,EACtC,aAAa,CAAC,EAAE,OAAO,EACvB,WAAW,UAAQ,EACnB,SAAS,UAAQ,GAChB,kBAAkB,CAiDpB;AAED,oFAAoF;AACpF,wBAAgB,wCAAwC,CACtD,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,MAAM,CAWR;AAuJD,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,GAEZ,cAAc,GACd,cAAc,GACd,WAAW,GACX,eAAe,GACf,SAAS,GACT,SAAS,CAgDZ;AA4BD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,UAAU,EAClB,uBAAuB,CAAC,EAAE,MAAM,GAC/B,UAAU,CA2CZ;AA+FD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAsKvE;AAmKD,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,kBAAkB,EAC/B,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,CAcpB"}
|
package/dist/api.js
CHANGED
|
@@ -43,7 +43,7 @@ import { AuthenticationRequiredError, CodexSecurityError, ConfigurationError, In
|
|
|
43
43
|
import { forwardExternalImportSetting } from "./external-imports-feature.js";
|
|
44
44
|
import { knowledgeBaseProtectedRoots, prepareKnowledgeBase, readKnowledgeBaseSnapshot, } from "./knowledge-base.js";
|
|
45
45
|
import { scanInputIdentity, saveScanKnowledge } from "./scan-inputs.js";
|
|
46
|
-
import { FindingWorkflow, workflowDigest } from "./finding-workflow.js";
|
|
46
|
+
import { FindingWorkflow, scanArtifactDigest, workflowDigest, } from "./finding-workflow.js";
|
|
47
47
|
import { reviewSqliteHome } from "./deduplication/codex-review.js";
|
|
48
48
|
import { ScanResult, } from "./result.js";
|
|
49
49
|
import { formatSecurityPolicyText, inspectSecurityPolicySources, readSecurityPolicySnapshot, requireUnchangedSecurityPolicy, resolveSecurityPolicyGuidance, resolveSecurityPolicyTarget, runSecurityPolicyStages, parseSecurityPolicyStageResult, securityPolicyDiff, securityPolicyProtectedRoots, requireSecurityPolicyRepositoryBinding, securityPolicyStageOutputSchema, } from "./security-policy.js";
|
|
@@ -219,7 +219,7 @@ export class CodexSecurity {
|
|
|
219
219
|
expectedScanId: state.scanId,
|
|
220
220
|
signal,
|
|
221
221
|
});
|
|
222
|
-
await workflow.bind({ artifactDigest:
|
|
222
|
+
await workflow.bind({ artifactDigest: scanArtifactDigest(contract) });
|
|
223
223
|
metadata ??= { threadId: "", turnResult: { status: "completed" } };
|
|
224
224
|
await workflow.complete("scan", metadata);
|
|
225
225
|
return new ScanResult({
|
|
@@ -250,11 +250,7 @@ export class CodexSecurity {
|
|
|
250
250
|
await workflow.bind({
|
|
251
251
|
scanId: result.manifest.scan.id,
|
|
252
252
|
scanDir: result.scanDir,
|
|
253
|
-
artifactDigest:
|
|
254
|
-
manifest: result.manifest,
|
|
255
|
-
findings: result.findings,
|
|
256
|
-
coverage: result.coverage,
|
|
257
|
-
}),
|
|
253
|
+
artifactDigest: scanArtifactDigest(result),
|
|
258
254
|
});
|
|
259
255
|
await workflow.complete("scan", metadata);
|
|
260
256
|
return result;
|
|
@@ -1604,7 +1600,7 @@ export class CodexSecurity {
|
|
|
1604
1600
|
await writeCustomValidationStatus(scanDir, { scanId, status: "pending" }, signal);
|
|
1605
1601
|
}
|
|
1606
1602
|
checkOpen();
|
|
1607
|
-
const basePrompt = scanPrompt(await targetInstruction(normalized, shellPluginRoot), mode, skillName, scanId, knowledgeBase !== null, options.resumeScanId !== undefined &&
|
|
1603
|
+
const basePrompt = scanPrompt(await targetInstruction(normalized, shellPluginRoot, this.#dependencies.hostedScan !== undefined), mode, skillName, scanId, knowledgeBase !== null, options.resumeScanId !== undefined &&
|
|
1608
1604
|
typeof registration["userContext"] === "string"
|
|
1609
1605
|
? registration["userContext"]
|
|
1610
1606
|
: options.scanPrompt, options.maxCostUsd !== undefined, discoveryPrompt, modelProvider, options.ownerSuggestions);
|
|
@@ -1941,7 +1937,6 @@ export class CodexSecurity {
|
|
|
1941
1937
|
...new Set([
|
|
1942
1938
|
"scan-manifest.json",
|
|
1943
1939
|
"findings.json",
|
|
1944
|
-
"coverage.json",
|
|
1945
1940
|
"report.md",
|
|
1946
1941
|
...(result.threatModelPath === null
|
|
1947
1942
|
? []
|
|
@@ -2850,7 +2845,7 @@ export class CodexSecurity {
|
|
|
2850
2845
|
}
|
|
2851
2846
|
throwIfAborted(signal, scanDir);
|
|
2852
2847
|
notifyObserver(options, "onScanStarted")();
|
|
2853
|
-
await writeMockScanDraft(scanDir, scanId,
|
|
2848
|
+
await writeMockScanDraft(scanDir, scanId, registration, signal);
|
|
2854
2849
|
const usage = {
|
|
2855
2850
|
input_tokens: 0,
|
|
2856
2851
|
cached_input_tokens: 0,
|
|
@@ -3204,14 +3199,21 @@ export async function runScanEvents(options) {
|
|
|
3204
3199
|
usage = finalizedUsage;
|
|
3205
3200
|
}
|
|
3206
3201
|
options.signal.throwIfAborted();
|
|
3207
|
-
await requireScanArtifacts(options.scanDir, ["scan-manifest.json", "findings.json"
|
|
3208
|
-
const [manifest, findings
|
|
3202
|
+
await requireScanArtifacts(options.scanDir, ["scan-manifest.json", "findings.json"], options.signal);
|
|
3203
|
+
const [manifest, findings] = await Promise.all(["scan-manifest.json", "findings.json"].map(async (name) => JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(await readScanFile(options.scanDir, name, name, options.signal)))));
|
|
3209
3204
|
const helper = (await import(__rewriteRelativeImportExtension(pathToFileURL(join(await bundledPluginRoot(), "mcp/helpers.mjs")).href))).default;
|
|
3210
3205
|
const draft = helper.parseCanonicalScanDraft({
|
|
3211
3206
|
scanId: options.scanId ?? manifest.scan.id,
|
|
3212
3207
|
manifest,
|
|
3213
3208
|
findings,
|
|
3214
|
-
|
|
3209
|
+
reviewState: manifest.scan.reviewState ??
|
|
3210
|
+
(manifest.scan.coverageRef
|
|
3211
|
+
? JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(await readScanFile(options.scanDir, "coverage.json", "legacy review state", options.signal)))
|
|
3212
|
+
: {
|
|
3213
|
+
surfaces: [],
|
|
3214
|
+
explicitExclusions: [],
|
|
3215
|
+
deferred: [],
|
|
3216
|
+
}),
|
|
3215
3217
|
});
|
|
3216
3218
|
options.signal.throwIfAborted();
|
|
3217
3219
|
if (draft.complete === false) {
|
|
@@ -3369,7 +3371,7 @@ function scanPrompt(targetDescription, mode, skillName, scanId, hasKnowledgeBase
|
|
|
3369
3371
|
`Use ${python} as <python_command> for plugin Python helper scripts (.py files); replace any literal python or python3 helper invocation with this exact interpreter.`,
|
|
3370
3372
|
`Repository root: ${shellEnvironmentReference("CODEX_SECURITY_REPOSITORY")}`,
|
|
3371
3373
|
`Use this exact scan directory for all scan output: ${shellEnvironmentReference("CODEX_SECURITY_SCAN_DIR")}`,
|
|
3372
|
-
`Use exactly ${JSON.stringify(scanId)} as the scan ID in the manifest
|
|
3374
|
+
`Use exactly ${JSON.stringify(scanId)} as the scan ID in the manifest and findings.`,
|
|
3373
3375
|
`Use exactly ${shellEnvironmentReference("CODEX_SECURITY_TARGET_ID")} as scan.target.targetId; do not derive a different target ID.`,
|
|
3374
3376
|
`Use exactly ${shellEnvironmentReference("CODEX_SECURITY_TARGET_DISPLAY_NAME")} as scan.target.displayName; do not infer a display name from the Git remote.`,
|
|
3375
3377
|
`Use exactly ${shellEnvironmentReference("CODEX_SECURITY_TARGET_KIND")} as scan.target.kind; do not infer the target kind from the checkout.`,
|
|
@@ -3404,7 +3406,7 @@ function scanPrompt(targetDescription, mode, skillName, scanId, hasKnowledgeBase
|
|
|
3404
3406
|
]
|
|
3405
3407
|
: skillName === "security-scan" || enforceCostLimit || customValidation
|
|
3406
3408
|
? [
|
|
3407
|
-
"Write the complete canonical scan-manifest.json
|
|
3409
|
+
"Write the complete canonical scan-manifest.json and findings.json with review bookkeeping in scan.reviewState, but do not finalize or seal them; the SDK workbench owns authoritative metadata, finalization, report generation, and sealing.",
|
|
3408
3410
|
]
|
|
3409
3411
|
: [
|
|
3410
3412
|
"Use record_codex_security_scan_draft and complete_codex_security_scan as directed by the selected skill; the workbench owns authoritative metadata, finalization, report generation, and sealing.",
|
|
@@ -3419,7 +3421,7 @@ function skillNameFor(target, mode) {
|
|
|
3419
3421
|
return "security-diff-scan";
|
|
3420
3422
|
return mode === "deep" ? "deep-security-scan" : "security-scan";
|
|
3421
3423
|
}
|
|
3422
|
-
async function targetInstruction(target, pluginRoot) {
|
|
3424
|
+
async function targetInstruction(target, pluginRoot, hosted) {
|
|
3423
3425
|
if (target.kind === "repository")
|
|
3424
3426
|
return "Scan target: the entire repository.";
|
|
3425
3427
|
if (target.kind === "paths") {
|
|
@@ -3434,16 +3436,33 @@ async function targetInstruction(target, pluginRoot) {
|
|
|
3434
3436
|
if (code !== "ENOENT" && code !== "ENOTDIR")
|
|
3435
3437
|
throw error;
|
|
3436
3438
|
}
|
|
3439
|
+
const inventory = shellEnvironmentReference("CODEX_SECURITY_SCAN_DIR", "/scoped-source-input.jsonl");
|
|
3440
|
+
const scopeArgs = `--repo ${shellEnvironmentReference("CODEX_SECURITY_REPOSITORY")} --scopes-file ${scopes} --out ${inventory}`;
|
|
3441
|
+
// CMD expands the environment references once, preserving percent signs in path values.
|
|
3442
|
+
const bindScopes = process.platform === "win32"
|
|
3443
|
+
? String.raw `cmd.exe /d /v:off /s /c '""%CODEX_SECURITY_PLUGIN_ROOT%\scripts\launch_codex_security_mcp.cmd" --helper bind-repo-scopes --scopes-file "%CODEX_SECURITY_TARGET_PATHS_FILE%" --manifest "%CODEX_SECURITY_SCAN_DIR%\scan-manifest.json""'`
|
|
3444
|
+
: `${helper} --helper bind-repo-scopes --scopes-file ${scopes} --manifest ${shellEnvironmentReference("CODEX_SECURITY_SCAN_DIR", "/scan-manifest.json")}`;
|
|
3445
|
+
const scanTarget = "Scan target paths: resolve every requested file and all non-ignored descendants of requested directories";
|
|
3446
|
+
const finalize = `Before finalization, preserve every requested scope with:\n${bindScopes}\nDo not print, evaluate, or modify the target-paths file.`;
|
|
3447
|
+
if (hosted && process.platform === "linux" && !legacyGenerator) {
|
|
3448
|
+
const capabilities = await pluginCapabilities(pluginRoot).catch(() => undefined);
|
|
3449
|
+
if (capabilities?.["hostedScopeInventory"] === 1) {
|
|
3450
|
+
const hostedHelper = `${helper} --helper make-hosted-repo-scope-input ${scopeArgs}`;
|
|
3451
|
+
return [
|
|
3452
|
+
`${scanTarget} using the hosted scope helper:`,
|
|
3453
|
+
`${hostedHelper} --state-dir ${shellEnvironmentReference("CODEX_SECURITY_STATE_DIR")}`,
|
|
3454
|
+
"Use the reported path. If a later shell cannot read it, use the path reported by this recovery command:",
|
|
3455
|
+
hostedHelper,
|
|
3456
|
+
finalize,
|
|
3457
|
+
].join("\n");
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3437
3460
|
const makeScope = legacyGenerator
|
|
3438
|
-
? `${pluginPythonCommand()} ${shellEnvironmentReference("CODEX_SECURITY_PLUGIN_ROOT", "/scripts/generate_rank_input.py")} make-repo-scope-input
|
|
3461
|
+
? `${pluginPythonCommand()} ${shellEnvironmentReference("CODEX_SECURITY_PLUGIN_ROOT", "/scripts/generate_rank_input.py")} make-repo-scope-input ${scopeArgs}`
|
|
3439
3462
|
: process.platform === "win32"
|
|
3440
3463
|
? String.raw `cmd.exe /d /v:off /s /c '""%CODEX_SECURITY_PLUGIN_ROOT%\scripts\launch_codex_security_mcp.cmd" --helper make-repo-scope-input --repo "%CODEX_SECURITY_REPOSITORY%\." --scopes-file "%CODEX_SECURITY_TARGET_PATHS_FILE%" --out "%CODEX_SECURITY_SCAN_DIR%\scoped-source-input.jsonl""'`
|
|
3441
|
-
: `${helper} --helper make-repo-scope-input
|
|
3442
|
-
|
|
3443
|
-
const bindScopes = process.platform === "win32"
|
|
3444
|
-
? String.raw `cmd.exe /d /v:off /s /c '""%CODEX_SECURITY_PLUGIN_ROOT%\scripts\launch_codex_security_mcp.cmd" --helper bind-repo-scopes --scopes-file "%CODEX_SECURITY_TARGET_PATHS_FILE%" --manifest "%CODEX_SECURITY_SCAN_DIR%\scan-manifest.json" --coverage "%CODEX_SECURITY_SCAN_DIR%\coverage.json""'`
|
|
3445
|
-
: `${shellEnvironmentReference("CODEX_SECURITY_PLUGIN_ROOT", "/scripts/launch_codex_security_mcp")} --helper bind-repo-scopes --scopes-file ${scopes} --manifest ${shellEnvironmentReference("CODEX_SECURITY_SCAN_DIR", "/scan-manifest.json")} --coverage ${shellEnvironmentReference("CODEX_SECURITY_SCAN_DIR", "/coverage.json")}`;
|
|
3446
|
-
return `Scan target paths: resolve every requested file and all non-ignored descendants of requested directories using ${makeScope}. Before finalization, preserve every requested scope with ${bindScopes}. Do not print, evaluate, or modify the target-paths file.`;
|
|
3464
|
+
: `${helper} --helper make-repo-scope-input ${scopeArgs}`;
|
|
3465
|
+
return `${scanTarget} using ${makeScope}. ${finalize}`;
|
|
3447
3466
|
}
|
|
3448
3467
|
if (target.kind === "refs") {
|
|
3449
3468
|
return `Scan target: Git diff from ${target.base} to ${target.head}.`;
|
|
@@ -3532,7 +3551,7 @@ async function requireScanArtifacts(scanDir, required, signal) {
|
|
|
3532
3551
|
}
|
|
3533
3552
|
}
|
|
3534
3553
|
async function collectResult(turnResult, threadId, scanDir, pluginRoot, expectation, signal, workbenchValidated = false, pythonPath, protectedRoot) {
|
|
3535
|
-
await requireScanArtifacts(scanDir, ["scan-manifest.json", "findings.json", "
|
|
3554
|
+
await requireScanArtifacts(scanDir, ["scan-manifest.json", "findings.json", "report.md"], signal);
|
|
3536
3555
|
const contract = await loadContract(scanDir, {
|
|
3537
3556
|
pluginRoot,
|
|
3538
3557
|
expectation,
|
|
@@ -4073,13 +4092,17 @@ export function scanPreflightCodexConfig(config) {
|
|
|
4073
4092
|
}
|
|
4074
4093
|
return result;
|
|
4075
4094
|
}
|
|
4076
|
-
async function
|
|
4077
|
-
const manifest = JSON.parse(await readFile(join(
|
|
4095
|
+
async function pluginCapabilities(pluginRoot) {
|
|
4096
|
+
const manifest = JSON.parse(await readFile(join(pluginRoot, ".codex-plugin", "plugin.json"), "utf8"));
|
|
4078
4097
|
const capabilities = isRecord(manifest)
|
|
4079
4098
|
? manifest["codexSecurity"]
|
|
4080
4099
|
: undefined;
|
|
4100
|
+
return isRecord(capabilities) ? capabilities : undefined;
|
|
4101
|
+
}
|
|
4102
|
+
async function requireCurrentDeepScanPlugin(runtime) {
|
|
4103
|
+
const capabilities = await pluginCapabilities(runtime.plugin.pluginRoot);
|
|
4081
4104
|
if (runtime.deepScanConfigPath === undefined ||
|
|
4082
|
-
|
|
4105
|
+
capabilities === undefined ||
|
|
4083
4106
|
capabilities["directDeepScanEngine"] !== 1 ||
|
|
4084
4107
|
capabilities["workerProviderSnapshot"] !== 4) {
|
|
4085
4108
|
throw new CodexSecurityError("Deep Scan requires the current plugin's direct engine and isolated worker runtime support. Update the custom plugin or use the bundled plugin.");
|