mail-address-semantics/mas_conformance/statute_aware.json
tegwick a841ceec73 MAS-WP-0009 T01: independent JS implementation (impl/js), differential test, SCP-9
impl/js (Node, zero deps, written from the specs): parser, v0.2
statute-aware rules, signing, outside master. Passes addresses.json,
statute-aware.json and auth.json unchanged; its master passes the 11
slave-setup mode flows against the Python email side (ExternalMaster).
Differential testing vs mas_core found two unstated stand-in rules, now
SCP-9 in the v0.2 draft with fixtures si-011..013, dt-109; ABNF comments
no longer say v0.1. Runner: external masters, step errors fail the flow.

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 13:22:22 +02:00

460 lines
11 KiB
JSON

{
"description": "MAS v0.2 statute-aware cases: stand-in interpretation (6.3), resource_id_case equivalence (8), destination-transform results and refusals (12.1). Each case names a statute in 'statutes'; the host is the statute's namespace.",
"statutes": {
"stand-ins": {
"mas_version": "0.2",
"namespace": "great-service.example",
"profiles": {
"p1": true,
"p2": true
},
"resource_types": {
"ticket": {
"enabled": true,
"description": "Customer-service ticket",
"identifier_policy": "non-guessable-preferred"
}
},
"interaction_modes": {
"callback": {
"enabled": true,
"description": "Continue by a voice callback"
}
},
"equivalence": {
"local_part_case": "exact",
"dot_folding": false,
"resource_id_case": "insensitive"
},
"addresses": {
"support": {
"kind": "function"
},
"ticket": {
"kind": "function",
"intake_for": "ticket"
}
},
"alternate_syntax": {
"resource": true,
"interaction": true
}
},
"stand-ins-exact-ids": {
"mas_version": "0.2",
"namespace": "great-service.example",
"profiles": {
"p1": true,
"p2": true
},
"resource_types": {
"ticket": {
"enabled": true,
"description": "Customer-service ticket",
"identifier_policy": "non-guessable-preferred"
}
},
"interaction_modes": {
"callback": {
"enabled": true,
"description": "Continue by a voice callback"
}
},
"equivalence": {
"local_part_case": "exact",
"dot_folding": false,
"resource_id_case": "exact"
},
"addresses": {
"support": {
"kind": "function"
},
"ticket": {
"kind": "function",
"intake_for": "ticket"
}
},
"alternate_syntax": {
"resource": true,
"interaction": true
}
},
"no-stand-ins": {
"mas_version": "0.2",
"namespace": "great-service.example",
"profiles": {
"p1": true,
"p2": true
},
"resource_types": {
"ticket": {
"enabled": true,
"description": "Customer-service ticket",
"identifier_policy": "non-guessable-preferred"
}
},
"interaction_modes": {
"callback": {
"enabled": true,
"description": "Continue by a voice callback"
}
},
"equivalence": {
"local_part_case": "exact",
"dot_folding": false,
"resource_id_case": "exact"
},
"addresses": {
"support": {
"kind": "function"
},
"ticket": {
"kind": "function",
"intake_for": "ticket"
}
},
"alternate_syntax": {
"resource": false,
"interaction": false
}
},
"v0.1": {
"mas_version": "0.1",
"namespace": "great-service.example",
"profiles": {
"p1": true,
"p2": true
},
"resource_types": {
"ticket": {
"enabled": true,
"description": "Customer-service ticket",
"identifier_policy": "non-guessable-preferred"
}
},
"interaction_modes": {
"callback": {
"enabled": true,
"description": "Continue by a voice callback"
}
},
"equivalence": {
"local_part_case": "exact",
"dot_folding": false
},
"addresses": {
"support": {
"kind": "function"
},
"ticket": {
"kind": "function",
"intake_for": "ticket"
}
}
}
},
"interpretation": [
{
"id": "si-001",
"statute": "stand-ins",
"local_part": "ticket---callback",
"canonical": "ticket!callback",
"stand_ins": [
"interaction"
]
},
{
"id": "si-002",
"statute": "stand-ins",
"local_part": "ticket--gs1---callback",
"canonical": "ticket=gs1!callback",
"stand_ins": [
"interaction",
"resource"
]
},
{
"id": "si-003",
"statute": "stand-ins",
"local_part": "ticket--a---b",
"canonical": "ticket=a---b",
"stand_ins": [
"resource"
],
"note": "b is not an enabled mode"
},
{
"id": "si-004",
"statute": "stand-ins",
"local_part": "ticket--gs1+comments",
"canonical": "ticket=gs1+comments",
"stand_ins": [
"resource"
]
},
{
"id": "si-005",
"statute": "stand-ins",
"local_part": "support---callback",
"canonical": "support!callback",
"stand_ins": [
"interaction"
]
},
{
"id": "si-006",
"statute": "stand-ins",
"local_part": "invoice--x1",
"canonical": "invoice--x1",
"stand_ins": [],
"note": "undeclared resource type"
},
{
"id": "si-007",
"statute": "stand-ins",
"local_part": "ticket=gs1!callback",
"canonical": "ticket=gs1!callback",
"stand_ins": [],
"note": "already canonical"
},
{
"id": "si-008",
"statute": "no-stand-ins",
"local_part": "ticket--gs1",
"canonical": "ticket--gs1",
"stand_ins": [],
"note": "switch off"
},
{
"id": "si-009",
"statute": "no-stand-ins",
"local_part": "ticket---callback",
"canonical": "ticket---callback",
"stand_ins": []
},
{
"id": "si-010",
"statute": "v0.1",
"local_part": "ticket--gs1",
"canonical": "ticket--gs1",
"stand_ins": [],
"note": "v0.1 statute has no stand-ins"
},
{
"id": "si-011",
"statute": "stand-ins",
"local_part": "ticket---",
"canonical": "ticket---",
"stand_ins": [],
"note": "TYPE---... is never a resource stand-in (SCP-9)"
},
{
"id": "si-012",
"statute": "stand-ins",
"local_part": "ticket---chat",
"canonical": "ticket---chat",
"stand_ins": [],
"note": "chat not enabled; the id would begin with '-' (SCP-9)"
},
{
"id": "si-013",
"statute": "stand-ins",
"local_part": "q!---callback",
"canonical": "q!---callback",
"stand_ins": [],
"note": "already has '!': read canonically (SCP-9)"
}
],
"equivalence": [
{
"id": "eq-001",
"statute": "stand-ins",
"a": "ticket=GS-1",
"b": "ticket=gs-1",
"equivalent": true,
"note": "resource_id_case insensitive"
},
{
"id": "eq-002",
"statute": "stand-ins",
"a": "ticket--GS-85QJ8WC09P",
"b": "ticket=gs-85qj8wc09p",
"equivalent": true,
"note": "stand-in + insensitive id"
},
{
"id": "eq-003",
"statute": "stand-ins-exact-ids",
"a": "ticket=GS-1",
"b": "ticket=gs-1",
"equivalent": false,
"note": "resource_id_case exact"
},
{
"id": "eq-004",
"statute": "stand-ins",
"a": "Support",
"b": "support",
"equivalent": false,
"note": "only resource ids fold; local_part_case exact"
},
{
"id": "eq-005",
"statute": "stand-ins",
"a": "ticket=gs-1+comments",
"b": "ticket=gs-1",
"equivalent": true,
"note": "facet does not change the target"
}
],
"destination": [
{
"id": "dt-001",
"statute": "stand-ins",
"local_part": "ticket=GS-1+comments",
"needs": [],
"expect": "ticket=GS-1+comments"
},
{
"id": "dt-002",
"statute": "stand-ins",
"local_part": "ticket=GS-85QJ8WC09P+comments",
"needs": [
"resource-alternate",
"lowercase"
],
"expect": "ticket--gs-85qj8wc09p+comments",
"note": "IONOS forwarding form"
},
{
"id": "dt-003",
"statute": "stand-ins",
"local_part": "ticket=GS-85QJ8WC09P+comments",
"needs": [
"lowercase"
],
"expect": "ticket=gs-85qj8wc09p+comments",
"note": "Google Groups"
},
{
"id": "dt-004",
"statute": "stand-ins",
"local_part": "ticket!callback",
"needs": [
"interaction-alternate"
],
"expect": "ticket---callback"
},
{
"id": "dt-005",
"statute": "stand-ins",
"local_part": "support",
"needs": [
"resource-alternate",
"lowercase"
],
"expect": "support",
"note": "transforms apply only where they change something"
},
{
"id": "dt-006",
"statute": "stand-ins",
"local_part": "ticket!callback",
"needs": [
"drop-interaction"
],
"allow_lossy": true,
"expect": "ticket"
},
{
"id": "dt-101",
"statute": "no-stand-ins",
"local_part": "ticket=GS-1",
"needs": [
"resource-alternate"
],
"expect": null,
"reason": "statute does not enable the stand-in"
},
{
"id": "dt-102",
"statute": "v0.1",
"local_part": "ticket=GS-1",
"needs": [
"resource-alternate"
],
"expect": null,
"reason": "v0.1 statute"
},
{
"id": "dt-103",
"statute": "stand-ins-exact-ids",
"local_part": "ticket=GS-1",
"needs": [
"lowercase"
],
"expect": null,
"reason": "lower-casing changes an exact id"
},
{
"id": "dt-104",
"statute": "stand-ins",
"local_part": "ticket=RE=2026-4711",
"needs": [
"resource-alternate"
],
"expect": null,
"reason": "id contains '='; TYPE--ID would split at the first --"
},
{
"id": "dt-105",
"statute": "stand-ins",
"local_part": "ticket=gs-1+Comments",
"needs": [
"lowercase"
],
"expect": null,
"reason": "facet case would change"
},
{
"id": "dt-106",
"statute": "stand-ins",
"local_part": "ticket=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"needs": [
"resource-alternate"
],
"expect": null,
"reason": "65 octets after the transform"
},
{
"id": "dt-107",
"statute": "stand-ins",
"local_part": "ticket=gs-1+comments",
"needs": [
"drop-facet"
],
"expect": null,
"reason": "lossy transform without explicit request"
},
{
"id": "dt-108",
"statute": "stand-ins",
"local_part": "ticket=gs-1!chat",
"needs": [
"interaction-alternate"
],
"expect": null,
"reason": "mode not enabled by the statute"
},
{
"id": "dt-109",
"statute": "stand-ins",
"local_part": "ticket=-x",
"needs": [
"resource-alternate"
],
"expect": null,
"reason": "an id beginning with '-' cannot use the resource stand-in (SCP-9)"
}
]
}