{
  "schemaVersion": 1,
  "name": "browser",
  "contractVersion": 10,
  "managedExports": [
    "GetVersion",
    "ParseBytes",
    "ParseSource",
    "InitializeCompiledLayout",
    "ParseCompiledSource",
    "ResolveAddress",
    "ResolveAddressCompiled",
    "Serialize",
    "UpdateStream",
    "TakeOutput",
    "GetStaticPlan"
  ],
  "operations": [
    "parse",
    "serialize",
    "update",
    "resolveAddress",
    "compile"
  ],
  "bridgeOperations": [
    "version",
    "staticPlan"
  ],
  "envelopeFields": [
    "contractVersion",
    "operation",
    "success",
    "root",
    "data",
    "debug",
    "error"
  ],
  "errorFields": [
    "code",
    "message",
    "path",
    "offset",
    "member",
    "memberType",
    "line",
    "column"
  ],
  "debugFields": [
    "start",
    "end",
    "path",
    "type",
    "value"
  ],
  "optionFields": [
    "addressingMode",
    "aligned",
    "bitfieldAllocation",
    "bitfieldPacking",
    "cLongWidth",
    "clearUnionStorage",
    "dereferencePointers",
    "littleEndian",
    "maxArrayElements",
    "maxDefinitionLength",
    "maxExpressionNestingDepth",
    "maxExpressionTokens",
    "maxLayoutNestingDepth",
    "maxNestingDepth",
    "maxPointerDepth",
    "maxPointerTargetBytes",
    "maxStringBytes",
    "maxTotalBytesRead",
    "maxTotalBytesWritten",
    "maxTraversalBytesRead",
    "maxTraversalNestingDepth",
    "maxTraversalPointerDepth",
    "maxTraversalPointerTargetBytes",
    "maxTraversalStringBytes",
    "origin",
    "pointerSize",
    "redactDiagnostics",
    "requireExistingPointerTarget",
    "root",
    "trimFixedText",
    "unknownMembers"
  ],
  "errorCodes": [
    "invalid-input",
    "invalid-json",
    "invalid-layout",
    "invalid-path",
    "operation-failed",
    "read-budget",
    "read-failed",
    "resource-exhausted",
    "write-budget",
    "write-failed"
  ],
  "compatibilityPolicy": "Exact until a reviewed contract-version increment updates this baseline.",
  "evidence": {
    "unitTests": 12,
    "bootstrapTests": 3,
    "browserTests": 8,
    "browserEngine": "Playwright Chromium"
  },
  "history": [
    {
      "contractVersion": 8,
      "date": "2026-09-18"
    },
    {
      "contractVersion": 7,
      "date": "2026-09-18"
    },
    {
      "contractVersion": 7,
      "date": "2026-09-14"
    },
    {
      "contractVersion": 6,
      "date": "2026-09-12"
    },
    {
      "contractVersion": 6,
      "date": "2026-09-12"
    },
    {
      "contractVersion": 7,
      "date": "2026-09-14"
    },
    {
      "contractVersion": 7,
      "date": "2026-09-16"
    },
    {
      "contractVersion": 8,
      "date": "2026-09-27",
      "change": "Managed export ParseWithDebug removed: the adapter parses with debug ranges through ParseBytes(definition, bytes, options, true), which returns the identical envelope. The unused SerializeCompiled and UpdateCompiled worker exports are removed. The JavaScript API, envelope, options and error codes are unchanged."
    },
    {
      "contractVersion": 9,
      "date": "2026-09-28",
      "change": "Every managed export except TakeOutput returns the same JSON envelope. GetVersion reports operation \"version\" with data {version}; GetStaticPlan reports operation \"staticPlan\" with data {root, plan}, or null when the layout has no static plan, and reports invalid options or input as a failure envelope instead of throwing. Serialize and UpdateStream return an envelope whose data is {byteLength}; the new TakeOutput export hands over the produced bytes and throws when none are pending, and failures use the error envelope instead of a thrown exception carrying error JSON. An invalid addressingMode or origin (including one outside the signed 64-bit range) is invalid-input with a specific message. The JavaScript package takes contractVersion from the managed envelopes. The public JavaScript functions, their envelopes, options and error codes are unchanged apart from the version; the raw adapter's serialize and updateStream now return the envelope instead of throwing."
    },
    {
      "contractVersion": 9,
      "date": "2026-09-30",
      "change": "ParseBytes, ParseSource and ParseCompiledSource return the unchanged envelope as UTF-8 bytes instead of a string, and the adapter decodes it with a UTF-8 TextDecoder: a returned .NET string is decoded as UTF-16 and failed in Node.js beyond 2^27 characters. An envelope longer than 536,870,888 bytes (V8's string limit) is a read-budget failure envelope. The source worker transfers parse envelope bytes to the page. The public JavaScript functions, the raw adapter, the envelope, options and error codes are unchanged; version 9 was not yet released."
    },
    {
      "contractVersion": 10,
      "date": "2026-10-02",
      "change": "New error code resource-exhausted: a failure caused by running out of memory (OutOfMemoryException, which includes InsufficientMemoryException), which used to be operation-failed. Exports, envelope, options and the other error codes are unchanged."
    }
  ]
}
