You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdk/typescript/_bundled_plugin/references/scan-contract.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,8 @@ A sealed manifest records the completed timestamp and hashes for the canonical d
31
31
Choose the target kind based on the reviewed content, not the scan invocation:
32
32
`git_worktree` for a checked-out Git workspace, `directory_snapshot` for a non-Git directory, `git_diff` for a Git-backed change set, and `git_revision` for an exact immutable Git tree.
33
33
34
+
For a workbench-backed scan, use the recorded target contract instead of inferring the kind from the checkout. A clean Git checkout has `allowedKinds: ["git_revision"]`: use its recorded revision and omit `snapshotDigest`. A dirty checkout has `allowedKinds: ["git_worktree"]`: copy `requiredSnapshotDigest` exactly.
@@ -1273,6 +1322,7 @@ export async function runScanEvents(
1273
1322
options.pluginRoot,
1274
1323
options.expectation,
1275
1324
options.signal,
1325
+
options.workbenchValidated,
1276
1326
);
1277
1327
if(options.signal.aborted){
1278
1328
thrownewScanInterruptedError(
@@ -1326,6 +1376,9 @@ async function scanPrompt(
1326
1376
'Use exactly "$CODEX_SECURITY_SCAN_ID" as the scan ID in the manifest, findings, and coverage.',
1327
1377
'Use exactly "$CODEX_SECURITY_TARGET_ID" as scan.target.targetId; do not derive a different target ID.',
1328
1378
'Use exactly "$CODEX_SECURITY_TARGET_DISPLAY_NAME" as scan.target.displayName; do not infer a display name from the Git remote.',
1379
+
'Use exactly "$CODEX_SECURITY_TARGET_KIND" as scan.target.kind; do not infer the target kind from the checkout.',
1380
+
'When "$CODEX_SECURITY_TARGET_REVISION" is set, use its exact value as scan.target.revision.',
1381
+
'When "$CODEX_SECURITY_TARGET_SNAPSHOT_DIGEST" is set, use its exact value as scan.target.snapshotDigest. For git_revision, omit scan.target.snapshotDigest.',
1329
1382
'Use exactly "codex-security-plugin" as scan.producer.name.',
1330
1383
...(hasConfigPath
1331
1384
? [
@@ -1416,6 +1469,7 @@ async function collectResult(
1416
1469
pluginRoot: string,
1417
1470
expectation: ScanExpectation,
1418
1471
signal: AbortSignal,
1472
+
workbenchValidated=false,
1419
1473
): Promise<ScanResult>{
1420
1474
constrequired=[
1421
1475
"scan-manifest.json",
@@ -1440,6 +1494,7 @@ async function collectResult(
0 commit comments