fix(plugin): align Deep Scan worker draft guidance with MCP input schema - #761
Open
Ultron09 wants to merge 1 commit into
Open
fix(plugin): align Deep Scan worker draft guidance with MCP input schema#761Ultron09 wants to merge 1 commit into
Ultron09 wants to merge 1 commit into
Conversation
Instruct Deep Scan workers and prompt templates to omit workbench-derived scope include/exclude paths, coverage metadata (mode, scanId, inventoryStrategy), and finding identities from record_codex_security_scan_draft payloads, preventing initial MCP -32602 validation failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Align Deep Scan worker instructions, prompt templates, continuations, and reference guidance with
scan-draft.schema.jsonby explicitly instructing workers to omit workbench-derived fields (scope.includePaths,scope.excludePaths,coverage.documentType,coverage.schemaVersion,coverage.scanId,coverage.mode,coverage.inventoryStrategy,coverage.receiptRefs, and finding identities) fromrecord_codex_security_scan_draftpayloads.Fixes #668.
Changes
Worker Templates & Continuations:
plugins/codex-security/mcp-app/templates/deep-scan/discovery.md, instruct discovery workers that the workbench derives authoritative target, scope paths, coverage mode, inventory strategy, surface IDs, missing deferred IDs, finding IDs, and fingerprints, and to omit these derived values from draft arguments.plugins/codex-security/mcp-app/src/deep-scan/worker-runner.ts, updatestandardScanCompletionContinuation,transientExecutionContinuation, andwriteValidationRetryPromptwith explicit guidance to omit workbench-derived fields.plugins/codex-security/mcp-app/src/server/compact-artifact-tools.ts, clarify tool descriptions forrecord_codex_security_scan_draftto omit workbench-derived metadata.Skills & References:
plugins/codex-security/references/core-scan.md, update Step 8 to clarify that draft payloads passed torecord_codex_security_scan_draftmust omit workbench-derived target, scope paths, coverage metadata, and finding identities.plugins/codex-security/references/scan-artifacts.md,final-report.md,skills/security-scan/SKILL.md, andskills/security-scan/references/desktop-scan.md, align draft guidance with the MCP schema.plugins/codex-security/schemas/tools/scan-draft.schema.json, add explicit descriptions toscopeandcoverageproperties inscanDraftInput.Tests:
plugins/codex-security/mcp-app/tests/test_deep_scan_templates.mjs, usefileURLToPathfor platform-neutral path resolution and assert guidance against derived fields in rendered discovery prompts.sdk/typescript/tests-ts/deep-scan-draft-guidance.test.ts, add regression test suite verifying prompt rendering, continuation guidance, and schema rejection of derived fields.Testing
bun test ./tests-ts/deep-scan-draft-guidance.test.ts(3 pass, 0 fail)bun test ./tests-ts/deep-scan-reducer-recovery.test.ts(4 pass, 0 fail)node plugins/codex-security/mcp-app/tests/test_deep_scan_templates.mjs(passed)pnpm --dir sdk/typescript run types(passed with 0 errors)pnpm --dir sdk/typescript run format(passed with 0 errors)uvx ruff==0.16.1 check&uvx ruff==0.16.1 format --check(All checks passed)python .github/scripts/check_plugin_source_compatibility.py(Plugin source compatibility checks passed)Risk and rollout
Low. This is a guidance and documentation alignment that prevents worker MCP
-32602validation retries while preserving the strict workbench schema and security boundaries.Public disclosure review