mail-address-semantics/mas-v0.2-spec/CONFORMANCE.md
tegwick c4719a238d MAS-WP-0008: v0.2 wording pass, statute-aware conformance corpus in the bundle
conformance/statute-aware.json (vendored as mas_conformance/statute_aware.json)
covers the 6.3 stand-in table, resource_id_case equivalence and the 12.1
destination results and refusals; mas test runs it. Misread refusals now
name the field that would change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 5787@bnt-lap001
Assistant-Session: 5db26b82-138b-40cc-9856-4d5eb0f752fd
2026-10-19 09:31:30 +02:00

3.2 KiB

MAS v0.2 Conformance (draft)

1. Test surfaces

An implementation can claim any of the following independently:

  • MAS-P1-PARSER
  • MAS-P2-PARSER
  • MAS-V0.2-GENERATOR
  • MAS-V0.2-STATUTE
  • MAS-V0.2-STATUTE-AWARE

2. Parser requirements

A parser claiming MAS-P1-PARSER MUST produce the expected result for every fixture whose profile is p1.

A parser claiming MAS-P2-PARSER MUST produce the expected result for every fixture whose profile is p2, and MUST also satisfy MAS-P1-PARSER.

The parsed object in the fixture file is normative for the test corpus.

A parser MUST NOT infer person, actor, or function from ., -, _.

3. Generator requirements

A generator:

  • MUST emit only grammar-valid canonical ASCII local-parts;
  • MUST NOT emit empty target, resource type, resource id, facet, or interaction;
  • MUST emit + before !;
  • MUST NOT emit more than one + or one !;
  • MUST NOT emit $ or ^;
  • MUST NOT emit both + and !;
  • MUST keep the encoded SMTP local-part at or below 64 octets.

Fixtures with generator_allowed: false may still be accepted by a P2 parser, but a conforming generator MUST NOT create them.

4. Statute requirements

A statute implementation MUST validate discovery documents using schema/mas-statute-v0.2.schema.json when mas_version is 0.2. A 0.1 statute is validated with the v0.1.1 schema and gets no v0.2 features.

It MUST NOT apply:

  • case folding,
  • dot folding,
  • address classification,
  • resource-type semantics,
  • interaction-mode semantics,

unless the exact-host statute successfully validates and declares them.

5. Statute-aware requirements (v0.2)

An implementation claiming MAS-V0.2-STATUTE-AWARE MUST produce the expected result for every case in conformance/statute-aware.json. Each case names one of the file's inline statutes, whose namespace is the host.

  • interpretation: the received local-part is read as canonical, using the listed stand_ins (§6.3). The parser alone never interprets stand-ins.
  • equivalence: a and b have the same equivalence key exactly when equivalent is true (§8, resource_id_case).
  • destination: applying the transforms in needs to local_part yields expect. When expect is null, the generator MUST refuse (§12.1). reason is informative, and refusal codes are not normative. allow_lossy marks an explicit request for a drop transform.

6. Discovery failure

Failure to retrieve or validate a statute:

  • does not invalidate the email address;
  • does invalidate any claim that MAS namespace semantics were discovered;
  • falls back to ordinary email handling plus exact local configuration.

7. Inheritance

Implementations are not required to implement inherits.

Implementations that do implement it MUST:

  • fetch the explicit URI only;
  • detect cycles;
  • treat inherited data as defaults;
  • never inherit explicit addresses registry entries;
  • let the child override inherited resource types and interaction modes.

8. Test command

The bundled reference parser can be run with:

python reference/mas_parser.py --self-test

The reference parser is non-normative; the grammar, specification, schema, and fixtures are normative for this draft.