From e6c4ad509fcfa0b72774d5396aeb0ee9f8e8ffcc Mon Sep 17 00:00:00 2001 From: ahmer iqbal Date: Mon, 27 Jul 2026 23:13:49 +0530 Subject: [PATCH] fix: conformance tool Windows crash + local-business mediaType cleanup conformance/bin/conformance-test: reconfigure stdout/stderr to UTF-8 on startup so the tool no longer crashes on Windows (cp1252 default cannot encode the check/cross/warning symbols). Uses sys.stdout.reconfigure which is a no-op on Python < 3.7 and on terminals already in UTF-8 mode, so Linux/macOS behaviour is unchanged. conformance/examples/local-business/local-business-catalog.json: remove the redundant top-level `mediaType` field from both entries. The `type` field already carries the IANA media type; `mediaType` at entry level is not part of the ARD spec and was absent from all other catalog examples. Co-Authored-By: Claude Sonnet 4.6 --- conformance/bin/conformance-test | 5 +++++ .../examples/local-business/local-business-catalog.json | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/conformance/bin/conformance-test b/conformance/bin/conformance-test index be3513a..3131262 100755 --- a/conformance/bin/conformance-test +++ b/conformance/bin/conformance-test @@ -11,6 +11,11 @@ import json import urllib.request import urllib.error +# Ensure UTF-8 output on Windows (cp1252 default cannot encode ✓/✗/⚠) +if hasattr(sys.stdout, 'reconfigure'): + sys.stdout.reconfigure(encoding='utf-8', errors='replace') + sys.stderr.reconfigure(encoding='utf-8', errors='replace') + # Strict URN Regex matching urn:air::: URN_REGEX = re.compile(r"^urn:air:([a-zA-Z0-9.-]+)(?::([a-zA-Z0-9._:-]+))?:([a-zA-Z0-9._-]+)$") diff --git a/conformance/examples/local-business/local-business-catalog.json b/conformance/examples/local-business/local-business-catalog.json index 069b1b8..20cd4e3 100644 --- a/conformance/examples/local-business/local-business-catalog.json +++ b/conformance/examples/local-business/local-business-catalog.json @@ -10,7 +10,6 @@ "identifier": "urn:air:bobs-plumbing.example:agent:assistant", "displayName": "Bob's Plumbing & Drain AI Assistant", "type": "application/a2a-agent-card+json", - "mediaType": "application/a2a-agent-card+json", "url": "https://bobs-plumbing.example/.well-known/agent-card.json", "description": "Conversational A2A agent for a family-owned plumbing company in Minneapolis, MN. Answers service questions, checks technician availability, and books appointments over the A2A protocol.", "tags": ["local-business", "plumbing", "home-services"], @@ -48,7 +47,6 @@ "identifier": "urn:air:bobs-plumbing.example:mcp:storefront", "displayName": "Bob's Plumbing & Drain Storefront Tools", "type": "application/mcp-server-card+json", - "mediaType": "application/mcp-server-card+json", "description": "MCP server card for the business storefront: structured tools to check technician availability, request a quote, and look up hours and service area. Embedded inline via the data field (value-or-reference, ARD 3.4).", "tags": ["local-business", "booking", "quotes"], "capabilities": ["check_availability", "request_quote", "get_business_hours"],