---
id: TST-COM-ORD-002
title: 'Commerce-contracts envelope: the schema'
kind: unit
product_area: commerce
module: orders
revision: 1
status: draft
source_sha:
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
repository: macroservice-libraries
files:
  - packages/commerce-contracts/src/envelope.spec.ts
implements:
  - ATS-COM-ORD-012-05
environment: mock
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 1
isolation: 'The suite owns its in-memory inputs, scripted responses and rendered component state.'
evidence:
  - provenance: test
    source: 'macroservice-libraries:packages/commerce-contracts/src/envelope.spec.ts'
    test_cases:
      - accepts an envelope for every operation
      - >-
        accepts a portal caller with its contact, the subject it buys for and the acting contact (contracts
        0.2.0)
      - 'accepts a member buying for their organization, and a public caller with neither subject nor contact'
      - >-
        keeps a caller of version 0.1.0 (no subject, no acting contact) readable, so a participant upgrades at
        its own pace
      - 'refuses a subject that is not a party, and an unknown access type'
      - refuses an unknown operation
      - refuses a missing caller
      - refuses an extra key
      - fixes the operation through envelopeOf
      - is version 1
      - accepts a major version as a string and refuses a dotted one
      - 'supports the current major alone at version 1, and the previous one from version 2'
      - answers whether a version is supported
      - answers whether a participant accepts a version
      - names a participant function by convention
scenario_coverage:
  - scenario: ATS-COM-ORD-012-05
    test_cases:
      - refuses an extra key
      - 'supports the current major alone at version 1, and the previous one from version 2'
    scope: >-
      The cited cases exercise the scenario’s listed fixture outcomes; this register makes no verified
      conformance claim.
dependency_evidence:
  provenance: test
  source: 'macroservice-libraries:packages/commerce-contracts/src/envelope.spec.ts'
  declared_by_test: 'the Zod schemas and the version helpers. Doubled: nothing.'
---

# Commerce-contracts envelope: the schema

## Verification Boundary

The unit suite checks the named contract or helper with controlled inputs.

## What This Suite Proves

The registered cases check commerce-contracts envelope: the schema with their fixture records and assertions. Scenario bindings name only the examples those cases exercise.

## What It Does Not Prove

A registered file supplies no run result or verified conformance by itself. Local fixtures do not establish deployed cross-service behavior or complete browser journeys.

## Real Dependencies and Test Doubles

Inputs and external responses are controlled in process; this suite establishes no deployed service behavior.

## Must Not Be Doubled

The named contract validation or component behavior under assertion must use its actual implementation.
