{
  "schemaVersion": 1,
  "name": "browser-rc1",
  "packageVersion": "0.2.0-preview",
  "contractVersion": 8,
  "managedExports": [
    "GetVersion",
    "ParseBytes",
    "ParseWithDebug",
    "Serialize",
    "UpdateStream",
    "ResolveAddress",
    "GetStaticPlan"
  ],
  "operations": [
    "parse",
    "serialize",
    "update",
    "resolveAddress",
    "compile"
  ],
  "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",
    "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",
      "change": "Contract v8 (improvement plan 7.1): the envelope is camelCase - contractVersion, operation, success, root, data, debug, error - and `data` is the selected value itself (no root wrapper); the new `root` field names the root or path the operation selected. Debug items are {start, end, path, type, value}; error details are {code, message, path, offset, member, memberType, line, column} and carry the library's own message verbatim unless `redactDiagnostics` is set. Tagged values are {kind: \"enum\", enum, name, value, names?, remainder?}, {kind: \"union\", union, rawStorage, members, selectedMember}, and {kind: \"pointer\", address, depth, dereferenced, value}. Options: `root` replaces rootTypeName; bitfieldPacking, bitfieldAllocation, cLongWidth, trimFixedText, unknownMembers and redactDiagnostics are new. New operation resolveAddress (managed export ResolveAddress) and compile (the retained CompiledLayout also exposes serialize, update, resolveAddress and its root); update accepts any binary source."
    },
    {
      "contractVersion": 7,
      "date": "2026-09-18",
      "change": "Non-finite floats no longer fail a parse: a float32/float64 NaN, +Infinity, or -Infinity is projected as the string \"NaN\", \"Infinity\", or \"-Infinity\" (the convention already used for integers beyond Number's exact range), and the write path accepts those strings for float fields. The JavaScript static plan formats float32 values with the same tie-to-even shortest round-trip rule as the managed projection, so both parse paths return identical numbers."
    },
    {
      "contractVersion": 7,
      "date": "2026-09-14",
      "change": "Performance plan E3.3(b): a successful parse envelope carries Data as the parsed JSON value itself (an object with the selected root wrapper, e.g. Data.header.kind), no longer as JSON text to JSON.parse. Failure envelopes keep Data null; serialize/update keep returning bytes. Every value, option, error code and DebugData item is unchanged."
    },
    {
      "contractVersion": 6,
      "date": "2026-09-12",
      "change": "Performance plan E3.3/E3.7: the parse envelope is written without indentation straight from the parse result, and DebugData items no longer carry the field bytes as a comma-separated decimal string (Buffer removed); CurPos/EndPos identify the byte range in the caller's own input. Data stays JSON text with the selected root wrapper; every value is unchanged."
    },
    {
      "contractVersion": 6,
      "date": "2026-09-12",
      "change": "Performance plan E3.6: new managed export ParseBytes(definition, bytes, optionsJson, debug) used by the adapters to parse byte inputs up to 64 KiB on the calling thread; the envelope is unchanged."
    },
    {
      "contractVersion": 7,
      "date": "2026-09-14",
      "change": "Performance plan E3.9: new managed export GetStaticPlan(definition, optionsJson) returns the static read plan of a fully fixed root (the compiler's member offsets, codecs, counts, nested plans and enum tables) as JSON, or an empty string; the adapters' parse() executes such a plan with DataView in JavaScript and falls back to ParseBytes/ParseSource otherwise. The envelope and every value are unchanged."
    },
    {
      "contractVersion": 7,
      "date": "2026-09-16",
      "change": "dissect.cstruct parity (additive, no envelope, export, option, or error-code change): a value read from a `flag` declaration carries `Names` (the set members) and `Remainder` (bits no member covers) next to the unchanged `Enum`/`Name`/`Value` keys; a promoted (anonymous) struct or union member's fields sit directly on the parent object; `_` padding fields never appear; int48/int128/float16 values render like the existing wide integers and floats. Every pre-existing definition produces byte-identical envelopes."
    }
  ]
}
