{
  "description": "Materialize each segments array in order as UTF-8 text or hex bytes, multiplied by repeat (default 1), with no extra newline. Hash original bytes before any normalization. Expected writer validity requires the whole file contract, not only JSON Schema.",
  "cases": [
    {
      "id": "front-lf-6143",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n#"
        },
        {
          "text": "x",
          "repeat": 6080
        },
        {
          "text": "\n---\n"
        }
      ],
      "size": 6151,
      "sha256": "a62d8090659ffefe82e8b865fd71cefe108d2b1407f1ab60c5347df1972e4e84",
      "writer_valid": true,
      "frontmatter_bytes": 6143,
      "body_bytes": 0
    },
    {
      "id": "front-lf-6144",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n#"
        },
        {
          "text": "x",
          "repeat": 6081
        },
        {
          "text": "\n---\n"
        }
      ],
      "size": 6152,
      "sha256": "def80011b1a2b0d5b8aa63fde84980579874abf0a4ea68d349a9edc082de8fd9",
      "writer_valid": true,
      "frontmatter_bytes": 6144,
      "body_bytes": 0
    },
    {
      "id": "front-lf-6145",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n#"
        },
        {
          "text": "x",
          "repeat": 6082
        },
        {
          "text": "\n---\n"
        }
      ],
      "size": 6153,
      "sha256": "673a776d0e88bcd933c0dd2801ca9b93aab9a349109c674451a3f7d6fdf4ce38",
      "writer_valid": false,
      "frontmatter_bytes": 6145,
      "body_bytes": 0
    },
    {
      "id": "front-crlf-6143",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\r\nhumans: \"0.2\"\r\nid: sample\r\nname: Example\r\nupdated: \"2026-10-13\"\r\n#"
        },
        {
          "text": "x",
          "repeat": 6075
        },
        {
          "text": "\r\n---\r\n"
        }
      ],
      "size": 6153,
      "sha256": "732c884cbe3efec4cc95097dd3fcc78bb5b4525ccb6eb56caa8190a528d8dbf6",
      "writer_valid": true,
      "frontmatter_bytes": 6143,
      "body_bytes": 0
    },
    {
      "id": "front-crlf-6144",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\r\nhumans: \"0.2\"\r\nid: sample\r\nname: Example\r\nupdated: \"2026-10-13\"\r\n#"
        },
        {
          "text": "x",
          "repeat": 6076
        },
        {
          "text": "\r\n---\r\n"
        }
      ],
      "size": 6154,
      "sha256": "f1b9d118fd18537922103770ae4efe0cad53b919ee9dea58cb2949b2f4ac3de4",
      "writer_valid": true,
      "frontmatter_bytes": 6144,
      "body_bytes": 0
    },
    {
      "id": "front-crlf-6145",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\r\nhumans: \"0.2\"\r\nid: sample\r\nname: Example\r\nupdated: \"2026-10-13\"\r\n#"
        },
        {
          "text": "x",
          "repeat": 6077
        },
        {
          "text": "\r\n---\r\n"
        }
      ],
      "size": 6155,
      "sha256": "80b42de0f233526c6d35498ddb5da7c30c203af6bf77113b6c8cf853a81eeb59",
      "writer_valid": false,
      "frontmatter_bytes": 6145,
      "body_bytes": 0
    },
    {
      "id": "body-4095",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n---\n"
        },
        {
          "text": "x",
          "repeat": 4095
        }
      ],
      "size": 4164,
      "sha256": "f6efcfe55ac69317aac2a49291b5762a35baff4dc193da8d0e0b3938b8afc3e4",
      "writer_valid": true,
      "frontmatter_bytes": 61,
      "body_bytes": 4095
    },
    {
      "id": "body-4096",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n---\n"
        },
        {
          "text": "x",
          "repeat": 4096
        }
      ],
      "size": 4165,
      "sha256": "1d877e95b3dffb3133c2c4b915605c75b4a07e27fc9ce8f89e935fe761c763d3",
      "writer_valid": true,
      "frontmatter_bytes": 61,
      "body_bytes": 4096
    },
    {
      "id": "body-4097",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n---\n"
        },
        {
          "text": "x",
          "repeat": 4097
        }
      ],
      "size": 4166,
      "sha256": "ab3a0e45d807517a4f7920afb9898c1bcc0344e6176bace86ad7acd32c470ef4",
      "writer_valid": false,
      "frontmatter_bytes": 61,
      "body_bytes": 4097
    },
    {
      "id": "total-max-with-bom",
      "filename": "sample.md",
      "segments": [
        {
          "hex": "efbbbf"
        },
        {
          "text": "---\r\nhumans: \"0.2\"\r\nid: sample\r\nname: Example\r\nupdated: \"2026-10-13\"\r\n#"
        },
        {
          "text": "x",
          "repeat": 6076
        },
        {
          "text": "\r\n---\r\n"
        },
        {
          "text": "x",
          "repeat": 4096
        }
      ],
      "size": 10253,
      "sha256": "b73fa0829ba38d6782d1d0b3f5cf9aa428ad77a1c0045204376708d9f28fe33d",
      "writer_valid": true,
      "frontmatter_bytes": 6144,
      "body_bytes": 4096
    },
    {
      "id": "no-final-newline",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n---"
        }
      ],
      "size": 68,
      "sha256": "af83c2163d728fbda680f580de9ef90caa8513dcb8ed77e02cc89a674041e949",
      "writer_valid": true
    },
    {
      "id": "single-bom",
      "filename": "sample.md",
      "segments": [
        {
          "hex": "efbbbf"
        },
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n---\n"
        }
      ],
      "size": 72,
      "sha256": "ada25ae7e5e4090dc0625f88164d2c10c76b3b08b160f5b74a71d5df5f18d14f",
      "writer_valid": true
    },
    {
      "id": "double-bom",
      "filename": "sample.md",
      "segments": [
        {
          "hex": "efbbbfefbbbf"
        },
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n---\n"
        }
      ],
      "size": 75,
      "sha256": "77b9a8c7368d4469a1c85598c97674fbad25e1dd14880f06ca9502a02385820f",
      "writer_valid": false
    },
    {
      "id": "interior-bom",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n---\n﻿"
        }
      ],
      "size": 72,
      "sha256": "94a2b68fa4d2be51e21cdae8cffa158530a725677a27dc8c3d30556f1eb0af6d",
      "writer_valid": false
    },
    {
      "id": "bare-cr",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\rhumans: \"0.2\"\rid: sample\rname: Example\rupdated: \"2026-10-13\"\r---\r"
        }
      ],
      "size": 69,
      "sha256": "4c62640127fa84e60ff54751da3aa1fd87dc040fbe7ef65646386b37cd165b14",
      "writer_valid": false
    },
    {
      "id": "bad-utf8",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n---\n"
        },
        {
          "hex": "ff"
        }
      ],
      "size": 70,
      "sha256": "f3b0687212e54fc9f707f36aee196d3e441f0190169726a9237e720fec3d657f",
      "writer_valid": false
    },
    {
      "id": "truncated-utf8",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n---\n"
        },
        {
          "hex": "e282"
        }
      ],
      "size": 71,
      "sha256": "252561e40b1f4a2bbe7bf561fdb457d48d46b2e08c02c017df99532880d0ad91",
      "writer_valid": false
    },
    {
      "id": "overlong-utf8",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n---\n"
        },
        {
          "hex": "c0af"
        }
      ],
      "size": 71,
      "sha256": "c5264923f778c2ff96bf8a5e50eaf62e661da9d5531530ceeb3a7e8cf573b532",
      "writer_valid": false
    },
    {
      "id": "surrogate-utf8",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n---\n"
        },
        {
          "hex": "eda080"
        }
      ],
      "size": 72,
      "sha256": "d6cbeab9c65bb6b586edeec549a55edefdcdd64623fc82556030a48d651b1788",
      "writer_valid": false
    },
    {
      "id": "above-unicode",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n---\n"
        },
        {
          "hex": "f4908080"
        }
      ],
      "size": 73,
      "sha256": "667a9b14d5dd54e862e44a8001e49d354df52a8479d487fc130215ea4cd5f6f3",
      "writer_valid": false
    },
    {
      "id": "surrogate-escape",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\nnotes: \"\\uD800\"\n---\n"
        }
      ],
      "size": 85,
      "sha256": "6017aff78145718b5a10a482a62b223b90fbd81a09a6b26d2838a700075ced10",
      "writer_valid": false
    },
    {
      "id": "surrogate-unknown",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\nunknown: \"\\uD800\"\n---\n"
        }
      ],
      "size": 87,
      "sha256": "e1eeebeabfcea3e70a95fee04c4f76423d6125ce4d99f55da04c05d25b9ac329",
      "writer_valid": false,
      "reader_status": "none"
    },
    {
      "id": "year-zero",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"0000-02-29\"\n---\n"
        }
      ],
      "size": 69,
      "sha256": "9f88ee3b0d8300dece89b1459e4a4e8a4b8c3d8348bc59f988dcb5147523cb54",
      "writer_valid": true
    },
    {
      "id": "year-0099",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"0099-01-01\"\n---\n"
        }
      ],
      "size": 69,
      "sha256": "d600621d8df6320fec864709115f4a4eecaf2024e7a834a5518ba17d532d8634",
      "writer_valid": true
    },
    {
      "id": "year-0100-leap",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"0100-02-29\"\n---\n"
        }
      ],
      "size": 69,
      "sha256": "e1e85082419e71578a363cf89811b8e5c03c3593fa75f669ef00bd2f473eea9c",
      "writer_valid": false
    },
    {
      "id": "year-2000-leap",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2000-02-29\"\n---\n"
        }
      ],
      "size": 69,
      "sha256": "092c272cb6999fc650872440941a71e4971fb417fc4ad4eae44944d9410e8181",
      "writer_valid": true
    },
    {
      "id": "bad-date",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-02-30\"\n---\n"
        }
      ],
      "size": 69,
      "sha256": "7a63fd040b927fc083287eb3438eb74fb83271c1044bde82ba8fc08a7c80c4b0",
      "writer_valid": false
    },
    {
      "id": "unquoted-date",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: 2026-10-13\n---\n"
        }
      ],
      "size": 67,
      "sha256": "f1e41ce557817dd5271b4b05c621a3cfffe606e66a08697b0d959614b019622a",
      "writer_valid": true
    },
    {
      "id": "scalar-count-279",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\nnotes: \"😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀\"\n---\n"
        }
      ],
      "size": 1195,
      "sha256": "e77a41032fdcda94f073c25822cb66efc260fcece36007e0b180fbbfc961b527",
      "writer_valid": true
    },
    {
      "id": "scalar-count-280",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\nnotes: \"😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀\"\n---\n"
        }
      ],
      "size": 1199,
      "sha256": "0121c47bd6aeeba246687b14e96b99ff753153672aa1b526b85bf48643d02394",
      "writer_valid": true
    },
    {
      "id": "scalar-count-281",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\nnotes: \"😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀\"\n---\n"
        }
      ],
      "size": 1203,
      "sha256": "4a4f15b7e3168f0353659e5ca17a46b9c79549636a3bf8cf397fea1552ca5e53",
      "writer_valid": false
    },
    {
      "id": "duplicate-decoded-key",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\nreading: {tone: warm, \"\\u0074one\": direct}\n---\n"
        }
      ],
      "size": 112,
      "sha256": "71f3aac874dd127461f71317d1226588f0299076b152688938e5d0e9cea05d1c",
      "writer_valid": false
    },
    {
      "id": "yaml-directive",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n%YAML 1.2\n---\n"
        }
      ],
      "size": 79,
      "sha256": "29d4ad21ddf85ab79cbd22f09a587b0e720e2b996b4b0c85ea2d55cf40afe158",
      "writer_valid": false
    },
    {
      "id": "non-string-key",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\nreading: {1: warm}\n---\n"
        }
      ],
      "size": 88,
      "sha256": "3c474fdf871c2099cfb88b1b53e792e6006c916bd0283769853a84288b9bd2cf",
      "writer_valid": false
    },
    {
      "id": "replacement-scalar",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\nnotes: \"Literal �\"\n---\n"
        }
      ],
      "size": 90,
      "sha256": "93532c2031bc02adc030ba8dcafb56d84217164b3d121933c517a84eba876503",
      "writer_valid": true
    },
    {
      "id": "personal-whitespace-body",
      "filename": "me.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\n---\n\n"
        }
      ],
      "size": 70,
      "sha256": "6d95e7ebddb5ba8c1768ed21c9e7043c1891cc78644ad6f5563c2d4397d3057e",
      "writer_valid": false
    },
    {
      "id": "total-max-minus-one",
      "filename": "sample.md",
      "segments": [
        {
          "hex": "efbbbf"
        },
        {
          "text": "---\r\nhumans: \"0.2\"\r\nid: sample\r\nname: Example\r\nupdated: \"2026-10-13\"\r\n#"
        },
        {
          "text": "x",
          "repeat": 6076
        },
        {
          "text": "\r\n---\r\n"
        },
        {
          "text": "x",
          "repeat": 4095
        }
      ],
      "size": 10252,
      "sha256": "e0315ec8571bc769e04913996c54bca0e3ea0c07f8b8d7018d33d9025845e5a0",
      "writer_valid": true,
      "frontmatter_bytes": 6144,
      "body_bytes": 4095
    },
    {
      "id": "total-max-plus-one",
      "filename": "sample.md",
      "segments": [
        {
          "hex": "efbbbf"
        },
        {
          "text": "---\r\nhumans: \"0.2\"\r\nid: sample\r\nname: Example\r\nupdated: \"2026-10-13\"\r\n#"
        },
        {
          "text": "x",
          "repeat": 6076
        },
        {
          "text": "\r\n---\r\n"
        },
        {
          "text": "x",
          "repeat": 4097
        }
      ],
      "size": 10254,
      "sha256": "c8a50a7126f05da1938828c4db32e1171dfe1d7e3b79d1bc7ba7cf670f58b66f",
      "writer_valid": false,
      "frontmatter_bytes": 6144,
      "body_bytes": 4097
    },
    {
      "id": "unicode17-assigned-scalar",
      "filename": "sample.md",
      "segments": [
        {
          "text": "---\nhumans: \"0.2\"\nid: sample\nname: Example\nupdated: \"2026-10-13\"\nnotes: \"🫪\"\n---\n"
        }
      ],
      "size": 83,
      "sha256": "133f75c21a0b09bb0da590ae5970826fe09a94bd131c284c3c7882b39e2eb0ca",
      "writer_valid": true
    }
  ]
}
