diff --git a/web4-standard/implementation/sdk/web4/errors.py b/web4-standard/implementation/sdk/web4/errors.py index e5988e7..0c5d8da 100644 --- a/web4-standard/implementation/sdk/web4/errors.py +++ b/web4-standard/implementation/sdk/web4/errors.py @@ -297,6 +297,49 @@ class ErrorMeta: 400, "Protocol downgrade attack detected", ), + # mcp-protocol.md §7.6 — Cross-Society MCP Errors + ErrorCode.CROSS_SOCIETY_UNRECOGNIZED_LCT: ErrorMeta( + ErrorCode.CROSS_SOCIETY_UNRECOGNIZED_LCT, + ErrorCategory.CROSS_SOCIETY, + "Unrecognized Cross-Society LCT", + 404, + "Responding society does not recognize the caller's LCT", + ), + ErrorCode.CROSS_SOCIETY_EXCHANGE_INVALID: ErrorMeta( + ErrorCode.CROSS_SOCIETY_EXCHANGE_INVALID, + ErrorCategory.CROSS_SOCIETY, + "Invalid Exchange Rate", + 400, + "Cross-society ATP exchange rate is invalid or expired", + ), + ErrorCode.CROSS_SOCIETY_LAW_CONFLICT: ErrorMeta( + ErrorCode.CROSS_SOCIETY_LAW_CONFLICT, + ErrorCategory.CROSS_SOCIETY, + "Law Oracle Conflict", + 409, + "Sender and responding societies have conflicting law oracles", + ), + ErrorCode.CROSS_SOCIETY_WITNESS_REQUIRED: ErrorMeta( + ErrorCode.CROSS_SOCIETY_WITNESS_REQUIRED, + ErrorCategory.CROSS_SOCIETY, + "Witness Required", + 403, + "Cross-society action requires a witness but none is available", + ), + ErrorCode.R7_REPUTATION_INVALID: ErrorMeta( + ErrorCode.R7_REPUTATION_INVALID, + ErrorCategory.CROSS_SOCIETY, + "Invalid R7 Reputation", + 400, + "R7 reputation envelope is malformed or signature invalid", + ), + ErrorCode.PROPAGATION_SCOPE_UNSUPPORTED: ErrorMeta( + ErrorCode.PROPAGATION_SCOPE_UNSUPPORTED, + ErrorCategory.CROSS_SOCIETY, + "Unsupported Propagation Scope", + 400, + "Responding society does not support the requested propagation scope", + ), } @@ -415,6 +458,12 @@ class ProtoError(Web4Error): pass +class CrossSocietyError(Web4Error): + """Error related to cross-society MCP operations (mcp-protocol.md §7.6).""" + + pass + + # Map categories to their subclass for from_problem_json dispatch _CATEGORY_SUBCLASS: Dict[ErrorCategory, type[Web4Error]] = { ErrorCategory.BINDING: BindingError, @@ -423,6 +472,7 @@ class ProtoError(Web4Error): ErrorCategory.AUTHZ: AuthzError, ErrorCategory.CRYPTO: CryptoError, ErrorCategory.PROTO: ProtoError, + ErrorCategory.CROSS_SOCIETY: CrossSocietyError, } diff --git a/web4-standard/testing/conformance/atp-operations.json b/web4-standard/testing/conformance/atp-operations.json index 31cbd90..6df5453 100644 --- a/web4-standard/testing/conformance/atp-operations.json +++ b/web4-standard/testing/conformance/atp-operations.json @@ -2,6 +2,12 @@ "$schema": "https://web4.io/schemas/test-vectors/v1.json", "suite": "ATP/ADP Operations", "version": "0.1.0", + "provenance": { + "authored_against_sdk_version": "0.27.0", + "shape_source_commit": "759eaefa", + "shapes": ["ATPAccount"], + "last_freshness_review": "2026-05-16" + }, "description": "Conformance test vectors for ATP/ADP economy operations. Conservation invariant MUST hold across all operations.", "account_vectors": [ diff --git a/web4-standard/testing/conformance/r6-r7-actions.json b/web4-standard/testing/conformance/r6-r7-actions.json index 35b6a44..97f898a 100644 --- a/web4-standard/testing/conformance/r6-r7-actions.json +++ b/web4-standard/testing/conformance/r6-r7-actions.json @@ -2,6 +2,12 @@ "$schema": "https://web4.io/schemas/test-vectors/v1.json", "suite": "R6/R7 Action Framework", "version": "0.1.0", + "provenance": { + "authored_against_sdk_version": "0.27.0", + "shape_source_commit": "d155b6a6", + "shapes": ["R7Action", "Rules", "Role", "Constraint", "Request", "ResourceRequirements", "Reference", "WitnessAttestation"], + "last_freshness_review": "2026-05-16" + }, "description": "Conformance test vectors for R6 (Rules/Role/Request/Reference/Resource→Result) and R7 (+Reputation) action framework.", "validation_vectors": [ diff --git a/web4-standard/testing/conformance/society-roles.json b/web4-standard/testing/conformance/society-roles.json index a3960b5..bd67d97 100644 --- a/web4-standard/testing/conformance/society-roles.json +++ b/web4-standard/testing/conformance/society-roles.json @@ -2,6 +2,12 @@ "$schema": "https://web4.io/schemas/test-vectors/v1.json", "suite": "Society & Role Operations", "version": "0.1.0", + "provenance": { + "authored_against_sdk_version": "0.27.0", + "shape_source_commit": "d155b6a6", + "shapes": ["RoleAssignment", "SocietyRole", "SocietyPhase"], + "last_freshness_review": "2026-05-16" + }, "description": "Conformance test vectors for Web4 society lifecycle and role management.", "bootstrap_vectors": [ diff --git a/web4-standard/testing/conformance/tensor-operations.json b/web4-standard/testing/conformance/tensor-operations.json index 32befcb..ce84f32 100644 --- a/web4-standard/testing/conformance/tensor-operations.json +++ b/web4-standard/testing/conformance/tensor-operations.json @@ -2,6 +2,12 @@ "$schema": "https://web4.io/schemas/test-vectors/v1.json", "suite": "T3/V3 Tensor Operations", "version": "0.1.0", + "provenance": { + "authored_against_sdk_version": "0.27.0", + "shape_source_commit": "759eaefa", + "shapes": ["T3", "V3"], + "last_freshness_review": "2026-05-16" + }, "description": "Conformance test vectors for T3 (Trust) and V3 (Value) tensor operations. Any compliant implementation MUST produce identical results for these inputs.", "t3_vectors": [