mail-address-semantics/impl/js/README.md
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

25 lines
1.3 KiB
Markdown

# mas-js: second, independent MAS implementation
Written from the specification texts and fixtures only, not ported from
`mas_core` (MAS-WP-0009). It uses Node 20+ and has zero dependencies.
| Module | Covers | Checked by |
|---|---|---|
| `src/parser.mjs` | canonical grammar, P1/P2 (address spec §4) | `mas-v0.2-spec/conformance/addresses.json` |
| `src/statute.mjs` | stand-ins (§6.3), equivalence (§8), destination transforms (§12.1), length (§13) | `mas-v0.2-spec/conformance/statute-aware.json` |
| `src/signing.mjs` | peer authentication (mode contract §7) | `mas-modes-v0.1-spec/conformance/auth.json` |
| `src/master.mjs` | outside master for email's slave role (mode contract §3.2) | `mas-modes-v0.1-spec/conformance/flows.json`, slave setups, run against the Python email side |
```bash
cd impl/js && node --test # the three bundles, read in place
cd ../.. && .venv/bin/pytest tests/test_js_impl.py tests/test_differential.py
```
`src/batch.mjs` evaluates parse, interpret and destination cases in bulk.
`tests/test_differential.py` compares it with `mas_core` over 1500
generated local-parts per operation. Its first run found two gaps in the
spec text (SCP-9).
Nothing in Python imports this code. The flow runner starts `master.mjs`
as a separate process and drives it only through its loopback control API
(`mas_modes/external.py`).