[spec-review] Update Safe Outputs conformance checker for recent spec changes#40737
Merged
pelikhan merged 1 commit intoJun 22, 2026
Merged
Conversation
The Safe Outputs specification (Section 8.2) requires that JSON-RPC 2.0 error responses use valid error codes (negative integers). The recently added mcp_server_core.cjs implements this requirement by: 1. Guarding against positive error codes (subprocess exit codes like 1, 2) 2. Serializing error messages with String() to avoid '[object Object]' when handlers throw plain objects (non-Error instances) This adds MCE-006 to the conformance checker to verify both behaviors are present in mcp_server_core.cjs, and bumps the script version from 1.24.0 to 1.25.0 while also explicitly documenting the spec version being checked (1.23.0). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pelikhan
approved these changes
Jun 22, 2026
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
Adds a new MCE-006 conformance check to
scripts/check-safe-outputs-conformance.shthat verifies the MCP server core (actions/setup/js/mcp_server_core.cjs) correctly implements JSON-RPC 2.0 error response rules as required by Safe Outputs Specification §8.2. Also splits the single combined version comment into separate spec version (1.23.0) and script version (1.25.0) lines for clarity.Changes
scripts/check-safe-outputs-conformance.sh— modifiedMCE-006addedcheck_mce_core_error_handling()which inspectsactions/setup/js/mcp_server_core.cjsfor two required behaviors (see below).mcp_server_core.cjscontains ae.code < 0(or equivalent) guard to prevent subprocess exit codes (positive integers like1,2) from being forwarded as JSON-RPC error codes; failure logged at CRITICAL severity.String()serialization of error messagesString(e.message)orString(err.message)to serialize error messages, preventing[object Object]appearing in error responses when a handler throws a plain object rather than anErrorinstance; failure logged at HIGH severity.mcp_server_core.cjsis absent entirely, the check emits a HIGH log and returns early rather than false-passing.# Version: 1.24.0 (2026-06-13)→ two lines:# Spec Version: 1.23.0 (2026-06-10)and# Script Version: 1.25.0 (2026-06-22).Motivation
mcp_server_core.cjswas recently updated to fix two latent JSON-RPC non-conformances:1or2; forwarding these directly as thecodefield of a JSON-RPC error object violates the JSON-RPC 2.0 spec, which requires error codes to be negative integers.[object Object]messages — when handler code throws a plain object (not anError), accessing.messagereturnsundefinedand serialisation yields the unhelpful string[object Object]. Wrapping withString()normalises this.MCE-006 locks in these fixes by making the conformance checker fail if either guard disappears from the file in future.
Risk
Low. This is a pure addition to a shell-based conformance checker script — no production code paths are modified. The new check only reads
mcp_server_core.cjsviagrep; it cannot alter behaviour at runtime. The worst-case outcome of a regression is a false-positive or false-negative conformance result, not a runtime failure.Checklist
actions/setup/js/mcp_server_core.cjs)set -eabort)CRITICAL; missingString()→HIGH1.24.0→1.25.0); spec version explicitly documented (1.23.0)Section 8.2) and describes both sub-checks