# MAS v0.2 Conformance ## 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. Handoff behavior (§7.1) is not tested here. Its conformance surfaces (`MAS-MODES-EMAIL-MASTER`, `MAS-MODES-EMAIL-SLAVE`) and fixtures are in `mas-modes-v0.1-spec/`. ## 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: ```bash python reference/mas_parser.py --self-test ``` The reference parser is non-normative; the grammar, specification, schema, and fixtures are normative for v0.2.