mail-address-semantics/impl/js
tegwick f07576451a MAS v0.2 final (MAS-WP-0009 finished); residual MAS-WP-0014
Founder decision after the second implementation: close the two open gaps,
then declare v0.2 final. Section 13: parsers MUST reject over 64 octets
(fixtures p1-050/051); section 8: equivalence is between targets, key format
not normative. Draft markers removed, CHANGELOG dated 2026-10-19,
MAS_VERSION 0.2, mas_conformance vendors the v0.2 addresses.json. Mode
contract v0.1 stays draft: MAS-WP-0014 (independent email side).

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:35:10 +02:00
..
src MAS v0.2 final (MAS-WP-0009 finished); residual MAS-WP-0014 2026-10-19 13:35:10 +02:00
test MAS-WP-0009 T01: independent JS implementation (impl/js), differential test, SCP-9 2026-10-19 13:22:22 +02:00
package.json MAS-WP-0009 T01: independent JS implementation (impl/js), differential test, SCP-9 2026-10-19 13:22:22 +02:00
README.md MAS-WP-0009 T01: independent JS implementation (impl/js), differential test, SCP-9 2026-10-19 13:22:22 +02:00

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
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).