<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-lee-mason-01" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" indexInclude="true">

<front>
<title abbrev="MaSON">Markdown Structured Object Notation (MaSON)</title><seriesInfo value="draft-lee-mason-01" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="DL" surname="Lee" fullname="Dustin Lee"><organization>Independent</organization><address><postal><street></street>
</postal><email>dlee@lemone.online</email>
<uri>https://github.com/LoanLemon/MaSON</uri>
</address></author><date year="2026" month="June" day="28"></date>
<area>Applications</area>
<workgroup>Independent Submission</workgroup>

<abstract>
<t>This document defines MaSON (Markdown Structured Object Notation), a lightweight data serialization format that maps standard Markdown syntax trees into structured key-value objects. MaSON is designed to maximize human readability and LLM token efficiency by eliminating bracket-based nesting and strict indentation rules. This updated specification introduces &quot;Compact Mode&quot; optimized for extreme token density, support for multi-line string encapsulation, and mixed-type array isolation via forced brackets.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>Data serialization formats play a critical role in configuration, distributed systems, and application state management. Traditional formats such as JSON (RFC 8259) offer deterministic parsing but present syntax overhead (e.g., explicit braces, quotation marks, and strict trailing comma rules) that impairs manual, human-authored editing. Alternative human-readable formats, notably YAML, resolve bracket verbosity but introduce structural fragility through strict multi-space indentation constraints.</t>
<t>Concurrently, the rise of Large Language Models (LLMs) has introduced a new serialization constraint: token optimization. Repetitive structural characters in JSON and YAML consume valuable context window resources when data structures are injected into generative AI system prompts.</t>
<t>This document defines MaSON (Markdown Structured Object Notation), a format designed to bridge human readability, machine parsing efficiency, and token density. MaSON repurposes ubiquitous Markdown (RFC 7763) layout paradigms—specifically headers and list delimiters—to establish object hierarchies without syntax-heavy nesting markers.</t>

<section anchor="requirements-language"><name>Requirements Language</name>
<t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;NOT RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"></xref> <xref target="RFC8174"></xref> when, and only when, they appear in all capitals, as shown here.</t>
</section>

<section anchor="semantic-reinterpretation-of-markdown"><name>Semantic Reinterpretation of Markdown</name>
<t>This specification intentionally assigns structured, machine-readable data serialization semantics to Markdown heading syntax beyond the purely presentational or structural document behaviors defined in RFC 7763. While a MaSON document remains syntactically valid Markdown, its document tree is explicitly mapped to associative data structures rather than an HTML visual layout.</t>
</section>
</section>

<section anchor="architectural-goals-and-core-paradigms"><name>Architectural Goals and Core Paradigms</name>
<t>The design of MaSON is governed by the following core architectural principles:</t>

<ul spacing="compact">
<li><strong>Visual Ubiquity:</strong> The serialization layout MUST closely mimic standard human-readable Markdown documentation. A non-technical user should be capable of modifying a MaSON configuration file using a basic text editor without violating language grammar rules.</li>
<li><strong>Indentation Independence:</strong> To prevent layout-based parsing errors common in formats like YAML, MaSON schemas MUST NOT rely on white-space or multi-space indentation depth to determine object or array scope boundaries.</li>
<li><strong>Token Efficiency:</strong> By removing structural punctuation, quotes, and structural padding, MaSON text structures seek to minimize the character-to-data footprint relative to equivalent JSON payloads, optimizing it for text-based LLM processing and prompt engineering workflows.</li>
<li><strong>Deterministic Bidirectional Equivalence:</strong> MaSON must support deterministic round-tripping. Serializing an active JSON object structure into MaSON text and immediately parsing it back into memory MUST yield an identical object topology, with specific handling for visual purity upon re-serialization.</li>
</ul>
</section>

<section anchor="syntax"><name>Syntax Specification</name>

<section anchor="document-structure-encoding-and-comments"><name>Document Structure, Encoding, and Comments</name>
<t>MaSON documents MUST be encoded using UTF-8. Line endings MUST be represented by a single Carriage Return and Line Feed (CRLF) sequence or a single Line Feed (LF) character. The parser MUST normalize line endings to a single uniform delimiter prior to processing.</t>
<t>The formal grammar rules specified via EBNF in Section {{formal-grammar}} describe the format's lexical structure. When parsing multi-byte sequences representing valid UTF-8 encoded Unicode scalar values outside the standard ASCII range, the parser MUST treat any continuous block of non-ASCII multibyte octets as a valid literal character sequence.</t>
<t>Lines where the first non-whitespace character consists of a double forward-slash sequence (<tt>//</tt>) or standard HTML comment blocks (``) MUST be treated as comment streams. Parsers MUST ignore comments and blank whitespace lines during lexical token processing.</t>
<t>To initialize the entire document as a top-level anonymous array rather than a root object, a bracketed token (e.g., <tt>[]</tt> or a property map like <tt>[id, name]</tt>) MAY be defined on the very first non-empty line of the file.</t>
</section>

<section anchor="structural-hierarchy-and-headers"><name>Structural Hierarchy and Headers</name>
<t>Object nesting depth and scope are defined structurally by Markdown heading tokens.</t>
<t>The document root represents an implicit top-level associative array (object) unless overridden by a top-level array token. A heading line beginning with one or more <tt>#</tt> characters followed by exactly one space character (0x20) MUST introduce a new nested object scope.</t>
<t>The number of <tt>#</tt> characters determines the absolute nesting depth:</t>

<ul spacing="compact">
<li>A single <tt>#</tt> denotes a direct child key of the root object.</li>
<li>Subsequent heading blocks with additional <tt>#</tt> characters (e.g., <tt>##</tt>, <tt>###</tt>) denote deeply nested child keys under the most recently declared parent object of a higher logical tier (fewer <tt>#</tt> characters).</li>
<li>A structural transition to a heading with fewer or equal <tt>#</tt> characters MUST cleanly close out all preceding active scopes up to that nesting depth.</li>
<li>Heading names are fully optional when defining elements of an array. Empty heading lines (e.g., <tt>##</tt>) or descriptive notes (e.g., <tt>## Alice (Admin)</tt>) do not affect the structured JSON properties.</li>
</ul>
</section>

<section anchor="key-value-pairs-multiline-values-and-escaping"><name>Key-Value Pairs, Multiline Values, and Escaping</name>
<t>Properties within a structural scope MUST be declared as a single-line key-value pair separated by a colon character (0x3A).</t>

<ul spacing="compact">
<li>Inline property keys MUST precede the colon separator and MUST NOT contain whitespace characters or control flags.</li>
<li>Conversely, a header key declared via heading tokens MAY contain internal horizontal whitespace characters, which MUST be preserved by the parser.</li>
<li>Optional space characters MAY follow the colon separator before the value payload begins.</li>
<li>Values MUST be treated as strings by default unless they conform to primitive data types defined in Section {{primitives}}.</li>
</ul>
<t><strong>Multiline Values:</strong> To support multi-line string blocks or formatted text, MaSON dynamically matches backtick delimiters (<tt>`</tt>).
* A block or string starts with any count of backticks <em>N</em> and ends with exactly <em>N</em> backticks. The surrounding delimiters on both ends MUST be stripped.
* If opening with 3 or more backticks (e.g., <tt>```javascript</tt>), a single alphanumeric language identifier following the backticks MUST be automatically parsed and stripped by the parser.</t>
<t><strong>Escaping:</strong> To permit structural characters inside property values or header keys, the backslash character (<tt>\</tt>, 0x5C) MUST act as an escape character. The sequence <tt>\:</tt> explicitly escapes a colon separator, <tt>\#</tt> escapes a header token, and <tt>\\</tt> escapes the backslash itself.</t>
</section>

<section anchor="lists-as-arrays"><name>Lists as Arrays</name>
<t>Sequential lines beginning with an asterisk (<tt>*</tt>, 0x2A), hyphen (<tt>-</tt>, 0x2D), or plus (<tt>+</tt>, 0x2B) followed by exactly one space character (0x20) MUST be parsed as sequential array items.</t>

<ul spacing="compact">
<li>If a bullet is parsed under an active heading, and the active heading is currently an empty object (<tt>{}</tt>), its container type MUST be morphed to an ordered array (<tt>[]</tt>).</li>
<li>If the container already has property keys, the bullet value MUST be pushed into an implicit <tt>_items</tt> key in that object to protect properties from silent deletion.</li>
</ul>
</section>

<section anchor="array-suffixes"><name>Array Suffixes, Compact Arrays, and Forced Brackets</name>

<section anchor="explicit-array-suffixes"><name>Explicit Array Suffixes</name>
<t>To prevent structural ambiguity when constructing arrays of complex objects, a header key MAY append an explicit array suffix consisting of opening and closing square brackets (<tt>[]</tt>, 0x5B 0x5D). Immediate child headers encountered beneath an explicit array declaration establish element boundaries but do not themselves become object keys in the mapped memory state.</t>
</section>

<section anchor="compact-arrays-and-property-maps"><name>Compact Arrays and Property Maps</name>
<t>To minimize token overhead for repetitive structures, inline arrays and property mappings MAY be declared directly on headings:
* <strong>Primitive Lists:</strong> A heading ending in <tt>(val1, val2)</tt> pushes those primitive values into the array.
* <strong>Property Maps:</strong> A heading ending in <tt>[key1, key2]</tt> (with or without <tt>()</tt>) maps subsequent nested child entries as objects with those positional keys, skipping the need to repeat keys for each array item.
* <strong>Top-Level Maps:</strong> The top-level document array can begin with a property map (e.g., <tt>[key1, key2]</tt>) on the first line to apply the mapping to all root array entries.</t>
</section>

<section anchor="forced-brackets"><name>Forced Brackets</name>
<t>For mixed-type arrays, appending <tt>[</tt> or <tt>{</tt> to a heading explicitly forces the parsed container type to be an array or object, respectively, until a matching closing bracket (<tt>]</tt> or <tt>}</tt>) is encountered on a line by itself or at the end of a value. This isolates nested structures within mixed-type sequences.</t>
</section>
</section>

<section anchor="formal-grammar"><name>Formal Grammar (EBNF)</name>
<t>The syntax of a MaSON document is defined formally using Extended Backus-Naur Form (EBNF). The semantic construction of hierarchical object depths and state stack validation based on these tokens MUST be governed exclusively by the processing rules defined in Section {{processing}}.</t>

<sourcecode type="ebnf"><![CDATA[document             = [ top_level_array | root_properties ] ;

(* Structural Core *)
top_level_array      = "[" , [ property_list ] , "]" , newline , { newline } , [ array_elements ] ;
root_properties      = { property_line | comment_line | newline } , [ heading_hierarchy ] ;

heading_hierarchy    = heading_line , { heading_content | heading_hierarchy } ;
heading_content      = property_line | array_bullet_line | comment_line | newline ;

(* Line Types *)
heading_line         = spaces , hash_sequence , spaces , heading_label , newline ;
property_line        = spaces , key , spaces , ":" , spaces , value , newline ;
array_bullet_line    = spaces , bullet_char , spaces , value , newline ;
comment_line         = spaces , "" , newline ;

(* Tokens and Identifiers *)
hash_sequence        = "#" , { "#" } ;
bullet_char          = "*" | "-" | "+" ;
spaces               = { " " | "\t" } ;
newline              = "\r\n" | "\n" ;

heading_label        = [ explicit_array_label | forced_array_label | forced_object_label | compact_array_label | literal_label ] ;
explicit_array_label = literal_label , "[]" ;
forced_array_label   = literal_label , "[" ;
forced_object_label  = literal_label , "{" ;
compact_array_label  = literal_label , [ "(" , primitive_list , ")" ] , [ "[" , property_list , "]" ] ;
primitive_list       = primitive_value , { "," , primitive_value } ;
property_list        = key , { "," , key } ;
literal_label        = { any_character_except_brackets_or_hash } ;

key                  = { any_character_except_colon_or_spaces } ;
value                = multiline_value | primitive_value ;

(* Values & Types *)
multiline_value      = backticks , [ language_tag ] , newline , multiline_text , backticks ;
backticks            = "`" , { "`" } ;
language_tag         = { letter } ;
multiline_text       = { any_character } ;

primitive_value      = boolean_literal | null_literal | number_literal | string_literal ;
boolean_literal      = "true" | "false" ;
null_literal         = "null" ;
number_literal       = [ "+" | "-" ] , digit , { digit } , [ "." , { digit } ] , [ ( "e" | "E" ) , [ "+" | "-" ] , { digit } ] ;
string_literal       = quoted_string | unquoted_string ;

quoted_string        = ( '"' , { escaped_char | any_char_except_double_quote } , '"' )
                     | ( "'" , { escaped_char | any_char_except_single_quote } , "'" ) ;
escaped_char         = "\\" , ( '"' | "'" | "`" | "\\" ) ;
unquoted_string      = { any_character_except_newline_and_trailing_spaces } ;

]]></sourcecode>
</section>
</section>

<section anchor="processing"><name>Processing, Stringification, and Behavior</name>

<section anchor="structural-scope-stack-operations"><name>Structural Scope Stack Operations</name>
<t>A MaSON parser MUST maintain an internal state stack to keep track of the active structural hierarchy while traversing a document linearly.</t>

<ul spacing="compact">
<li>Upon encountering a header with an absolute depth of N (where N is the count of <tt>#</tt> characters), the parser MUST examine the current depth of the state stack.</li>
<li>If N is exactly equal to the current stack depth plus one, the new object scope MUST be pushed onto the stack as a nested child of the active object.</li>
<li>If N is less than or equal to the current stack depth, the parser MUST repeatedly pop scopes off the stack until the stack depth equals N minus one, at which point the new object scope is instantiated and pushed.</li>
</ul>
</section>

<section anchor="primitives"><name>Primitive Value Coercion Rules</name>
<t>Values extracted from key-value properties or array lists MUST be evaluated against literal structural patterns to determine if they undergo data type coercion:</t>

<ul spacing="compact">
<li><strong>Null Coercion:</strong> The exact character sequence &quot;null&quot; (case-sensitive) MUST be coerced to a native null reference.</li>
<li><strong>Boolean Coercion:</strong> The exact character sequences &quot;true&quot; or &quot;false&quot; (case-sensitive) MUST be coerced to their respective native boolean definitions.</li>
<li><strong>Numeric Coercion:</strong> Character streams matching the <tt>number</tt> rule defined in Section {{formal-grammar}} MUST be coerced directly to native floating-point or integer numeric signatures. Any token sequence containing characters deviating from that structure MUST NOT undergo numeric coercion and falls back cleanly to a string representation.</li>
<li><strong>String Quoting:</strong> To force any numerical sequence or boolean value to remain a string, it MUST be wrapped in double or single quotes (e.g., <tt>zipCode: &quot;16801&quot;</tt>).</li>
</ul>
</section>

<section anchor="text-and-scope-trimming"><name>Text and Scope Trimming</name>
<t>Parsers MUST strip leading and trailing horizontal whitespace from both property keys and property values prior to evaluation or storage. Internal whitespace within a value payload MUST be preserved explicitly.</t>
</section>

<section anchor="duplicate-handling"><name>Duplicate Member Handling</name>
<t>If a document contains duplicate inline property keys within the same active object scope, the parser MUST enforce a last-assignment-wins strategy.</t>
<t>Conversely, if a nested sub-header configuration path matches a path that has been declared previously in the document stream, the parser MUST execute a deep recursive merge of the subsequent properties into the existing structure rather than overwriting or purging the original object hierarchy.</t>
</section>

<section anchor="stringification-and-visual-purity"><name>Stringification and Visual Purity</name>
<t>MaSON stringifiers MUST support bi-directional data integrity with two formatting modes:</t>

<ul spacing="compact">
<li><strong>Clean Mode (<tt>compact: false</tt>):</strong> Optimized for human readability, inserting blank lines between properties and collections.</li>
<li><strong>Compact Mode (<tt>compact: true</tt>):</strong> Minimizes token usage for LLMs, stripping empty lines and collapsing array-of-objects into dense tuple structures (e.g. <tt># users[name,age]</tt>).</li>
</ul>
<t><strong>No Forced Brackets on JSON Stringification:</strong> When parsing/converting from JSON back to MaSON via stringification, forced brackets (<tt>[</tt> or <tt>{</tt>) MUST NOT be introduced. The stringifier MUST automatically reorder array elements so that primitive/scalar types are written as simple bullet points first, and complex objects/arrays are placed last and serialized under clean heading syntax (<tt>#</tt> or <tt>#[]</tt>).</t>
</section>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>

<section anchor="resource-exhaustion-and-stack-overflow"><name>Resource Exhaustion and Stack Overflow</name>
<t>Because MaSON determines structural depth and nesting scope by the linear accumulation of heading tokens, naive implementations relying on recursive parsing strategies or unbounded internal state stacks are vulnerable to stack overflow or out-of-memory errors. Implementations MUST enforce an upper limit on maximum nesting depth (a RECOMMENDED default limit of 32 levels) to guarantee deterministic termination.</t>
</section>

<section anchor="type-coercion-and-key-injection"><name>Type Coercion and Key Injection</name>
<t>Parsers are expected to automatically coerce primitive string sequences. Implementations MUST validate that incoming token sequences do not trigger prototype pollution or unexpected type mutation behaviors within the execution environment.</t>
</section>

<section anchor="embedded-content-and-code-block-safety"><name>Embedded Content and Code Block Safety</name>
<t>MaSON implementations handling complex multiline inline values or embedded code blocks MUST treat the underlying isolated content strictly as static string fragments. Parsers MUST NOT evaluate or execute code blocks embedded within a document stream. Applications displaying data extracted from a MaSON payload MUST apply contextual sanitization to prevent downstream Cross-Site Scripting (XSS) or command injection vulnerabilities.</t>
</section>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>This document requests the registration of a new media type and file extension in accordance with the procedures defined in RFC 6838 <xref target="RFC6838"></xref>.</t>

<section anchor="media-type-registration-application-mason"><name>Media Type Registration: application/mason</name>
<t>Type name: application
Subtype name: mason
Required parameters: None
Optional parameters: charset (The value MUST be &quot;utf-8&quot;)
Encoding considerations: binary (UTF-8 encoded text)
Security considerations: See Section 5 of this document.
Interoperability considerations: MaSON is designed for cross-platform data interchange across server, browser, and language-model environments.
Published specification: This document.</t>
</section>

<section anchor="file-extension-registration"><name>File Extension Registration</name>
<t>The standard file extensions designated for MaSON structured data documents are &quot;.mason&quot; and &quot;.mson&quot;.</t>
</section>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6838.xml"/>
<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
</references>

<section anchor="references"><name>References</name>

<section anchor="normative-references"><name>Normative References</name>
</section>

<section anchor="informative-references"><name>Informative References</name>
</section>
</section>

<section anchor="structural-mapping-examples"><name>Structural Mapping Examples</name>

<section anchor="standard-structured-object-configuration"><name>Standard Structured Object Configuration</name>

<sourcecode type="mason"><![CDATA[# Server Setup
debugMode: false
maxRetries: 5

# Servers
* https://api.prod.coolapp.com
* https://api.backup.coolapp.com

# Database
driver: postgres

## Credentials
user: admin
host: localhost

]]></sourcecode>

<sourcecode type="json"><![CDATA[{
  "Server Setup": {
    "debugMode": false,
    "maxRetries": 5
  },
  "Servers": [
    "https://api.prod.coolapp.com",
    "https://api.backup.coolapp.com"
  ],
  "Database": {
    "driver": "postgres",
    "Credentials": {
      "user": "admin",
      "host": "localhost"
    }
  }
}

]]></sourcecode>
</section>

<section anchor="arrays-of-complex-objects-via-suffix-syntax"><name>Arrays of Complex Objects via Suffix Syntax</name>

<sourcecode type="mason"><![CDATA[# Cluster Infrastructure
environment: production

## Nodes[]

### Node Item
host: compute-01.local
capacity: 64

### Node Item
host: compute-02.local
capacity: 128

]]></sourcecode>

<sourcecode type="json"><![CDATA[{
  "Cluster Infrastructure": {
    "environment": "production",
    "Nodes": [
      {
        "host": "compute-01.local",
        "capacity": 64
      },
      {
        "host": "compute-02.local",
        "capacity": 128
      }
    ]
  }
}

]]></sourcecode>
</section>

<section anchor="multiline-string-blocks-with-language-tags"><name>Multiline String Blocks with Language Tags</name>

<sourcecode type="mason"><![CDATA[# Documentation
readme: ```markdown
Welcome to the project!
Use `npm run dev` to start.

]]></sourcecode>

<artwork><![CDATA[
```json
{
  "Documentation": {
    "readme": "Welcome to the project!\nUse `npm run dev` to start."
  }
}

]]></artwork>
</section>

<section anchor="compact-mode-arrays"><name>Compact Mode Arrays</name>

<sourcecode type="mason"><![CDATA[# MixedDataset
## PayloadMixedList(42, "100", false, null, 2026-06-27)[x, y, z]
###
1
2
33

]]></sourcecode>

<sourcecode type="json"><![CDATA[{
  "MixedDataset": {
    "PayloadMixedList": [
      42,
      "100",
      false,
      null,
      "2026-06-27",
      {
        "x": 1,
        "y": 2,
        "z": 33
      }
    ]
  }
}

]]></sourcecode>
</section>

<section anchor="forced-brackets-isolation-mixed-type-arrays"><name>Forced Brackets Isolation (Mixed-Type Arrays)</name>

<sourcecode type="mason"><![CDATA[# MixedDataset
## PayloadMixedList[]
### InnerArrayForcedBrackets[
x: 1
y: 2
z: 33]

### InnerObjectForcedBrackets{
x: 1
y: 2
z: 33}
* 42
* "100"

]]></sourcecode>

<sourcecode type="json"><![CDATA[{
  "MixedDataset": {
    "PayloadMixedList": [
      [
        {"x": 1},
        {"y": 2},
        {"z": 33}
      ],
      {
        "x": 1,
        "y": 2,
        "z": 33
      },
      42,
      "100"
    ]
  }
}

]]></sourcecode>
</section>

<section anchor="recursive-deep-merging-of-duplicate-headers"><name>Recursive Deep Merging of Duplicate Headers</name>

<sourcecode type="mason"><![CDATA[# Target Object
## Nested Child
initial_key: true

# Target Object
## Nested Child
appended_key: false

]]></sourcecode>

<sourcecode type="json"><![CDATA[{
  "Target Object": {
    "Nested Child": {
      "initial_key": true,
      "appended_key": false
    }
  }
}

]]></sourcecode>
</section>
</section>

<section anchor="complex-edge-case-and-tokenization-reference"><name>Complex Edge Case and Tokenization Reference</name>

<section anchor="token-and-character-density-methodology-and-comparison"><name>Token and Character Density Methodology and Comparison</name>
<t>The structural efficiency metrics detailed below were generated empirically by processing a single, logically identical Agent Configuration payload compiled across formats and evaluated using OpenAI's production &quot;cl100k_base&quot; tokenization algorithm. The benchmark results are illustrative rather than normative.</t>
<table>
<thead>
<tr>
<th>Format</th>
<th>Characters</th>
<th>Tokens (GPT-4)</th>
<th>Overhead Reduction</th>
</tr>
</thead>

<tbody>
<tr>
<td>JSON</td>
<td>194</td>
<td>58</td>
<td>Baseline</td>
</tr>

<tr>
<td>YAML</td>
<td>132</td>
<td>44</td>
<td>24.1%</td>
</tr>

<tr>
<td>MaSON</td>
<td>98</td>
<td>31</td>
<td>46.5%</td>
</tr>
</tbody>
</table><t>In this specific benchmark, MaSON reduced token count by approximately 46.5% relative to the JSON baseline.</t>
</section>

<section anchor="edge-case-matrix"><name>Edge Case Matrix</name>
<table>
<thead>
<tr>
<th>Input Payload (MaSON)</th>
<th>Resulting Memory State (JSON)</th>
</tr>
</thead>

<tbody>
<tr>
<td><tt>key: null</tt></td>
<td><tt>{ &quot;key&quot;: null }</tt></td>
</tr>

<tr>
<td><tt>msg: err\: failed</tt></td>
<td><tt>{ &quot;msg&quot;: &quot;err: failed&quot; }</tt></td>
</tr>

<tr>
<td><tt>hex: #ff0000</tt></td>
<td><tt>{ &quot;hex&quot;: &quot;#ff0000&quot; }</tt></td>
</tr>

<tr>
<td><tt># Empty Array[]</tt></td>
<td><tt>[]</tt></td>
</tr>

<tr>
<td><tt>script:</tt>javascript`</td>
<td>Strips language identifier <tt>javascript</tt></td>
</tr>
</tbody>
</table></section>
</section>

<section anchor="technical-design-rationale"><name>Technical Design Rationale</name>
<t>The design decisions governing the assembly of MaSON are structured to address specific historical limitations encountered in standard data serialization languages:</t>

<ul spacing="compact">
<li><strong>Headings vs Indentation:</strong> Standard indentation-based layouts (such as YAML) frequently create parsing vulnerabilities across distributed application boundaries due to non-visible structural spacing variants or text translation wrapping. By shifting dependency strictly to explicit, character-anchored heading tokens (The <tt>#</tt> element), MaSON decouples hierarchy entirely from spatial indent levels.</li>
<li><strong>Explicit [] Suffixing:</strong> While implicit layout scanning can determine list boundaries for primitive sequences, arrays tracking complex structures with dynamic nesting depths introduce deep tracking ambiguity. Enforcing an explicit <tt>[]</tt> suffix ensures that any multi-language compiler instantly knows the type-class of the upcoming frame tree without relying on heavy schema lookaheads.</li>
<li><strong>Omission of Closing Enclosures:</strong> Braces, brackets, and closing lines are heavily utilized by machines to clear stack frames but represent significant token redundancy when processed by text-transformer algorithms. MaSON shifts the responsibility of stack scope tracking from closing symbols to progressive line state shifts. In the benchmark corpus described in Appendix B, this strategy reduced token counts by approximately 46.5% compared to conventional JSON structures.</li>
</ul>
</section>

</back>

</rfc>
