{
  "authored_by": "DotWin",
  "title": "ARK Record Protocol version 0: test vectors",
  "arp": "0",
  "schema": "schemas/arp-envelope.schema.json",
  "content_hash": {
    "rule": "Lowercase hex SHA-256 of the UTF-8 bytes of the canonical content: the text alone when structured is absent or empty; otherwise the text, one newline, and the RFC 8785 canonical JSON of structured.",
    "vectors": [
      {
        "name": "text_only",
        "note": "Text alone: the UTF-8 bytes of the text exactly as given.",
        "content": {
          "text": "Growth is a change in kind; scale is more of the same kind."
        },
        "canonical": "Growth is a change in kind; scale is more of the same kind.",
        "sha256": "76ecc893f74b83848db37c1ce4dfd4b1afd010b2f50210d9c564ce5329454d51"
      },
      {
        "name": "text_with_structured",
        "note": "The text, one newline, then the canonical JSON of structured with its keys sorted at every level.",
        "content": {
          "text": "Decide by the cost of being wrong.",
          "structured": {
            "title": "Growth vs scale",
            "status": "decided",
            "weight": 1.5,
            "tags": [
              "ops",
              "strategy"
            ],
            "meta": {
              "zeta": 1,
              "alpha": true,
              "note": null
            }
          }
        },
        "canonical": "Decide by the cost of being wrong.\n{\"meta\":{\"alpha\":true,\"note\":null,\"zeta\":1},\"status\":\"decided\",\"tags\":[\"ops\",\"strategy\"],\"title\":\"Growth vs scale\",\"weight\":1.5}",
        "sha256": "7fbe16f2fc7c1c0f6c625a04cd9df18b3701591d92d6a4b39262cf66225724a0"
      },
      {
        "name": "empty_structured",
        "note": "An empty structured object hashes as text alone.",
        "content": {
          "text": "An empty structured object adds nothing.",
          "structured": {}
        },
        "canonical": "An empty structured object adds nothing.",
        "sha256": "daf150822e542c8bc8b6a865c06af34a2d5baf201ff3e65dcf81f27478a4d610"
      },
      {
        "name": "structured_only",
        "note": "With no text, the canonical bytes start with the newline.",
        "content": {
          "structured": {
            "habit": "Walk before the first call",
            "days": [
              1,
              2,
              3,
              4,
              5
            ]
          }
        },
        "canonical": "\n{\"days\":[1,2,3,4,5],\"habit\":\"Walk before the first call\"}",
        "sha256": "c0d3fc7a700687d1edabaab915aad3d7d341956c63efc802b29b64802aac0eea"
      },
      {
        "name": "whitespace_kept",
        "note": "Nothing is trimmed or normalised.",
        "content": {
          "text": "  Leading and trailing spaces stay.  \n"
        },
        "canonical": "  Leading and trailing spaces stay.  \n",
        "sha256": "65d3e9360da7f4882a09cb0679d8d1cbea2d4c22bdf76fede82f01d48644fb0b"
      },
      {
        "name": "unicode_text",
        "note": "Characters outside ASCII hash as their UTF-8 bytes.",
        "content": {
          "text": "Grüße aus Zürich, 東京, and a smile 🙂"
        },
        "canonical": "Grüße aus Zürich, 東京, and a smile 🙂",
        "sha256": "8a7b0b3c3df89f45d4bf0a8b559adafcdbd111e21578059a07c16f083ac0651d"
      },
      {
        "name": "numbers_and_key_order",
        "note": "Numbers take their shortest round-trip form; keys sort by UTF-16 code unit, so A comes before z and z before é.",
        "content": {
          "text": "Numbers and keys.",
          "structured": {
            "list": [
              10,
              2.5,
              0.1,
              1e+21,
              -3
            ],
            "keys": {
              "é": 1,
              "z": 2,
              "A": 3
            }
          }
        },
        "canonical": "Numbers and keys.\n{\"keys\":{\"A\":3,\"z\":2,\"é\":1},\"list\":[10,2.5,0.1,1e+21,-3]}",
        "sha256": "f9196f1965d1772601206ced59436b518a726614dcbb07eba941eeb2074fd26c"
      }
    ]
  },
  "envelopes": [
    {
      "name": "served_record",
      "note": "A record as ARKZ serves it. Its content_sha256 is the text_only vector.",
      "envelope": {
        "arp": "0",
        "id": "rec_4f7c2a90-1b3e-4c55-9d1a-2e6b8f0c7d31",
        "ref": "ark_insights:9b2d6e14-7a0c-4f3b-8e21-5c4d3a2b1f00",
        "ark": "ark:arkz:0c1d2e3f-4a5b-4c6d-8e7f-901a2b3c4d5e",
        "facet": "framework",
        "kind": "definition",
        "authorship": "self_paraphrase",
        "trust_tier": "T1",
        "privacy": "training",
        "subject": {
          "ref": "self"
        },
        "content": {
          "text": "Growth is a change in kind; scale is more of the same kind."
        },
        "domains": [
          "operations"
        ],
        "topics": [
          "growth vs scale"
        ],
        "time": {
          "captured_at": "2026-10-06T14:02:00Z",
          "valid_from": null,
          "valid_until": null
        },
        "provenance": {
          "source_kind": "knoa_session",
          "source_ref": null,
          "grant_id": null,
          "client_id": null,
          "content_sha256": "76ecc893f74b83848db37c1ce4dfd4b1afd010b2f50210d9c564ce5329454d51"
        },
        "lineage": {
          "supersedes": null,
          "superseded_by": null
        },
        "status": "accepted"
      }
    },
    {
      "name": "proposal",
      "note": "A proposal a source sends. Its content_sha256 is the text_with_structured vector; ARKZ assigns the rest.",
      "envelope": {
        "arp": "0",
        "ark": "ark:arkz:0c1d2e3f-4a5b-4c6d-8e7f-901a2b3c4d5e",
        "facet": "position_decision",
        "kind": "decision",
        "authorship": "self_structured",
        "privacy": "training",
        "content": {
          "text": "Decide by the cost of being wrong.",
          "structured": {
            "title": "Growth vs scale",
            "status": "decided",
            "weight": 1.5,
            "tags": [
              "ops",
              "strategy"
            ],
            "meta": {
              "zeta": 1,
              "alpha": true,
              "note": null
            }
          }
        },
        "provenance": {
          "source_kind": "podcast_transcript",
          "source_ref": "https://example.com/episodes/12",
          "content_sha256": "7fbe16f2fc7c1c0f6c625a04cd9df18b3701591d92d6a4b39262cf66225724a0"
        }
      }
    }
  ],
  "snapshot_root": {
    "rule": "leaf = SHA-256(0x00 || UTF-8(record_ref \"|\" hash \"|\" privacy \"|\" trust_tier)), where hash is content_sha256, else the SHA-256 of the stored text of content_structured, else \"-\"; records ordered by record_ref as UTF-8 bytes; node = SHA-256(0x01 || left || right) over the 32-byte digests, an odd last node paired with itself; the root of one leaf is that leaf; the root of none is SHA-256 of nothing.",
    "empty_root": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "vectors": [
      {
        "name": "empty",
        "note": "No records.",
        "records": [],
        "order": [],
        "leaves": [],
        "root": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
      },
      {
        "name": "one_record",
        "note": "One record: the root is its leaf.",
        "records": [
          {
            "record_ref": "ark_insights:9b2d6e14-7a0c-4f3b-8e21-5c4d3a2b1f00",
            "content_sha256": "76ecc893f74b83848db37c1ce4dfd4b1afd010b2f50210d9c564ce5329454d51",
            "content_structured_text": null,
            "privacy": "training",
            "trust_tier": "T1"
          }
        ],
        "order": [
          "ark_insights:9b2d6e14-7a0c-4f3b-8e21-5c4d3a2b1f00"
        ],
        "leaves": [
          "2b37d8f109012654eebfcce413d9550c388e092a6a37fdf1dd9387082ffb1952"
        ],
        "root": "2b37d8f109012654eebfcce413d9550c388e092a6a37fdf1dd9387082ffb1952"
      },
      {
        "name": "three_records_out_of_order",
        "note": "Three records given out of order: one with a content hash, one hashed from its stored structured text, one with neither. The odd last node pairs with itself.",
        "records": [
          {
            "record_ref": "journal_entries:5e1f0a2b-3c4d-4e5f-8a6b-7c8d9e0f1a2b",
            "content_sha256": null,
            "content_structured_text": null,
            "privacy": "licensable",
            "trust_tier": "T1"
          },
          {
            "record_ref": "ark_insights:9b2d6e14-7a0c-4f3b-8e21-5c4d3a2b1f00",
            "content_sha256": "76ecc893f74b83848db37c1ce4dfd4b1afd010b2f50210d9c564ce5329454d51",
            "content_structured_text": null,
            "privacy": "training",
            "trust_tier": "T1"
          },
          {
            "record_ref": "habits:1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
            "content_sha256": null,
            "content_structured_text": "{\"days\": [1, 2, 3, 4, 5], \"habit\": \"Walk before the first call\"}",
            "privacy": "training",
            "trust_tier": "T1"
          }
        ],
        "order": [
          "ark_insights:9b2d6e14-7a0c-4f3b-8e21-5c4d3a2b1f00",
          "habits:1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
          "journal_entries:5e1f0a2b-3c4d-4e5f-8a6b-7c8d9e0f1a2b"
        ],
        "leaves": [
          "2b37d8f109012654eebfcce413d9550c388e092a6a37fdf1dd9387082ffb1952",
          "7f6047a75023d3b6ac94e3a261be458fbd1e859ac2c997ac205de5245e2847e3",
          "934677aa6a11aac180378785e3a179a51026f3bf1d0599344234024f0b9b0f3d"
        ],
        "root": "dd637485e5db3d3038eb9b1f6b3661d20522d49339766a7a4e7a6641a5e11007"
      }
    ]
  }
}
