{
  "schemaVersion": 1,
  "fixtureSet": "mxaccess-gateway-parity-fixture-matrix",
  "contractName": "mxaccess-gateway",
  "gatewayProtocolVersion": 3,
  "workerProtocolVersion": 1,
  "sourceCaptureRoot": "C:/Users/dohertj2/Desktop/mxaccess/captures",
  "sourceDocs": [
    "C:/Users/dohertj2/Desktop/mxaccess/docs/MXAccess-Public-API.md",
    "C:/Users/dohertj2/Desktop/mxaccess/docs/Current-Sprint-State.md"
  ],
  "comparisonFormat": {
    "description": "Each parity run records the same command against direct MXAccess and the gateway-backed worker, then compares raw parity fields instead of client wrapper behavior.",
    "directMxAccess": {
      "requiredFields": [
        "method",
        "arguments",
        "returnedValue",
        "hresult",
        "exceptionType",
        "statuses",
        "events"
      ]
    },
    "gatewayResult": {
      "requiredFields": [
        "kind",
        "protocolStatus",
        "returnValue",
        "hresult",
        "statuses",
        "diagnosticMessage",
        "events"
      ]
    },
    "eventFields": [
      "family",
      "serverHandle",
      "itemHandle",
      "value",
      "quality",
      "sourceTimestamp",
      "statuses",
      "workerSequence",
      "workerTimestamp",
      "gatewayReceiveTimestamp",
      "hresult",
      "rawStatus"
    ],
    "comparisonKeys": [
      "hresult",
      "exceptionType",
      "returnedValue",
      "statusArrayShape",
      "statusRawFields",
      "eventFamilyOrder",
      "eventPayloadShape",
      "valueProjection",
      "rawFallbackMetadata"
    ]
  },
  "methodFixtures": [
    {
      "id": "method.register.basic",
      "method": "Register",
      "commandKind": "MX_COMMAND_KIND_REGISTER",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/001-register/harness.log",
        "captures/047-frida-com-proxy-register/harness.log"
      ],
      "assertions": [
        "preserve returned server handle in returnValue and RegisterReply",
        "preserve success HRESULT as 0",
        "do not emit MXAccess events for register"
      ]
    },
    {
      "id": "method.unregister.basic",
      "method": "Unregister",
      "commandKind": "MX_COMMAND_KIND_UNREGISTER",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/001-register/harness.log",
        "captures/109-native-post-remove-errors/harness.log"
      ],
      "assertions": [
        "preserve void return shape with explicit protocol success",
        "preserve HRESULT or COM exception details for invalid server handle",
        "close registered handle only after MXAccess succeeds"
      ]
    },
    {
      "id": "method.add-item.scalar",
      "method": "AddItem",
      "commandKind": "MX_COMMAND_KIND_ADD_ITEM",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/002-add-remove-scalar/harness.log",
        "captures/006-add-invalid/harness.log"
      ],
      "assertions": [
        "preserve returned item handle in returnValue and AddItemReply",
        "preserve invalid item reference HRESULT/status details",
        "do not prevalidate item definition in the gateway"
      ]
    },
    {
      "id": "method.add-item2.context",
      "method": "AddItem2",
      "commandKind": "MX_COMMAND_KIND_ADD_ITEM2",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/mxaccess-additem2-testint-context.log",
        "captures/121-frida-buffered-history-testhistoryvalue-context/harness.log"
      ],
      "assertions": [
        "pass item_definition and item_context exactly as supplied",
        "preserve returned item handle in returnValue and AddItem2Reply",
        "compare context-bearing reference resolution against direct MXAccess"
      ]
    },
    {
      "id": "method.remove-item.basic",
      "method": "RemoveItem",
      "commandKind": "MX_COMMAND_KIND_REMOVE_ITEM",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/002-add-remove-scalar/harness.log",
        "captures/109-native-post-remove-errors/harness.log"
      ],
      "assertions": [
        "preserve void return shape with explicit protocol success",
        "preserve post-remove and invalid-handle HRESULT/status behavior",
        "remove diagnostic handle state only after MXAccess succeeds"
      ]
    },
    {
      "id": "method.advise.supervisory-data-change",
      "method": "Advise",
      "commandKind": "MX_COMMAND_KIND_ADVISE",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/003-subscribe-scalars/harness.log",
        "captures/058-frida-subscribe-testint/harness.log"
      ],
      "assertions": [
        "preserve successful command reply shape",
        "forward OnDataChange with value, quality, timestamp, and status array",
        "preserve per-worker event order"
      ]
    },
    {
      "id": "method.unadvise.basic",
      "method": "UnAdvise",
      "commandKind": "MX_COMMAND_KIND_UN_ADVISE",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/058-frida-subscribe-testint/harness.log",
        "captures/007-subscribe-invalid/harness.log"
      ],
      "assertions": [
        "preserve void return shape with explicit protocol success",
        "preserve invalid item handle HRESULT/status behavior",
        "do not distinguish plain and supervisory cleanup beyond MXAccess behavior"
      ]
    },
    {
      "id": "method.advise-supervisory.basic",
      "method": "AdviseSupervisory",
      "commandKind": "MX_COMMAND_KIND_ADVISE_SUPERVISORY",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/058-frida-subscribe-testint/harness.log",
        "captures/105-frida-advise-shortdesc-prebound-fixed/harness.log"
      ],
      "assertions": [
        "keep AdviseSupervisory distinct from plain Advise in command kind",
        "forward native OnDataChange only when MXAccess emits it",
        "compare supervisory item status arrays without normalization"
      ]
    },
    {
      "id": "method.add-buffered-item.context",
      "method": "AddBufferedItem",
      "commandKind": "MX_COMMAND_KIND_ADD_BUFFERED_ITEM",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/079-frida-add-buffered-advise-testint/harness.log",
        "captures/120-frida-buffered-history-testhistoryvalue/harness.log",
        "captures/121-frida-buffered-history-testhistoryvalue-context/harness.log"
      ],
      "assertions": [
        "pass item_definition and item_context exactly as supplied",
        "preserve returned buffered item handle in returnValue and AddBufferedItemReply",
        "keep buffered registration distinct from normal AddItem2"
      ]
    },
    {
      "id": "method.set-buffered-update-interval.basic",
      "method": "SetBufferedUpdateInterval",
      "commandKind": "MX_COMMAND_KIND_SET_BUFFERED_UPDATE_INTERVAL",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/mxaccess-set-buffered-interval-1000.log",
        "captures/079-frida-add-buffered-advise-testint/harness.log"
      ],
      "assertions": [
        "preserve requested update interval without clamping in the gateway",
        "preserve void return shape with explicit protocol success",
        "compare buffered event cadence only in opt-in live runs"
      ]
    },
    {
      "id": "method.suspend.scan-state",
      "method": "Suspend",
      "commandKind": "MX_COMMAND_KIND_SUSPEND",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/077-frida-suspend-advised-scanstate/harness.log",
        "captures/118-frida-suspend-advised-scanstate-long/harness.log"
      ],
      "assertions": [
        "preserve out MxStatus in SuspendReply and repeated statuses",
        "preserve HRESULT separately from status detail",
        "do not synthesize OperationComplete if native MXAccess does not raise it"
      ]
    },
    {
      "id": "method.activate.scan-state",
      "method": "Activate",
      "commandKind": "MX_COMMAND_KIND_ACTIVATE",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/078-frida-activate-advised-scanstate/harness.log",
        "captures/119-frida-activate-advised-scanstate-long/harness.log"
      ],
      "assertions": [
        "preserve out MxStatus in ActivateReply and repeated statuses",
        "preserve HRESULT separately from status detail",
        "do not synthesize OperationComplete if native MXAccess does not raise it"
      ]
    },
    {
      "id": "method.write.value-status-matrix",
      "method": "Write",
      "commandKind": "MX_COMMAND_KIND_WRITE",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/023-frida-write-test-int-sequence-109-111/harness.log",
        "captures/024-frida-write-test-bool-sequence/harness.log",
        "captures/089-frida-write-testint-wrong-type/harness.log",
        "captures/090-frida-write-invalid-reference/harness.log",
        "captures/107-native-write-testint-current/harness.log"
      ],
      "assertions": [
        "preserve scalar and array value projections plus raw fallback metadata",
        "preserve wrong-type and invalid-reference HRESULT/status arrays",
        "forward OnWriteComplete only when native MXAccess emits it"
      ]
    },
    {
      "id": "method.write2.timestamped",
      "method": "Write2",
      "commandKind": "MX_COMMAND_KIND_WRITE2",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/042-frida-write2-test-int-timestamp/harness.log",
        "captures/066-frida-write2-test-bool-timestamp/harness.log",
        "captures/075-frida-write2-test-datetime-array-timestamp/harness.log"
      ],
      "assertions": [
        "preserve timestamp_value as an MXAccess VARIANT projection",
        "preserve write value shape and HRESULT/status arrays",
        "compare timestamped write completion events against direct MXAccess"
      ]
    },
    {
      "id": "method.write-secured.rejection-gap",
      "method": "WriteSecured",
      "commandKind": "MX_COMMAND_KIND_WRITE_SECURED",
      "status": "documented_gap",
      "captureReferences": [
        "captures/036-frida-write-secured-test-int/harness.log",
        "captures/111-frida-write-secured-auth-protectedvalue/harness.log",
        "captures/112-frida-write-secured-auth-verified-protectedvalue1/harness.log"
      ],
      "assertions": [
        "preserve observed 0x80004021 rejection before a value-bearing NMX body",
        "preserve current_user_id and verifier_user_id only as command inputs, not logs",
        "upgrade this gap to planned_fixture when a successful direct WriteSecured path is observed"
      ]
    },
    {
      "id": "method.write-secured2.authenticated",
      "method": "WriteSecured2",
      "commandKind": "MX_COMMAND_KIND_WRITE_SECURED2",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/113-frida-write-secured2-auth-protectedvalue/harness.log",
        "captures/116-frida-write-secured2-auth-verified-protectedvalue1/harness.log",
        "captures/117-frida-write-secured2-auth-testint/harness.log"
      ],
      "assertions": [
        "preserve authenticated timestamped secured write body shape",
        "preserve HRESULT/status arrays without logging credential-bearing values",
        "do not synthesize OnWriteComplete when direct MXAccess does not emit it"
      ]
    },
    {
      "id": "method.authenticate-user.basic",
      "method": "AuthenticateUser",
      "commandKind": "MX_COMMAND_KIND_AUTHENTICATE_USER",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/087-frida-authenticate-administrator-empty/harness.log",
        "captures/088-frida-authenticate-invalid-empty/harness.log"
      ],
      "assertions": [
        "preserve returned user id in returnValue and AuthenticateUserReply",
        "preserve invalid credential HRESULT/status behavior",
        "redact verify_user_password from logs and diagnostics"
      ]
    },
    {
      "id": "method.archestra-user-to-id.basic",
      "method": "ArchestrAUserToId",
      "commandKind": "MX_COMMAND_KIND_ARCHESTRA_USER_TO_ID",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/mxaccess-user-map-administrator.log",
        "captures/mxaccess-user-map-invalid.log"
      ],
      "assertions": [
        "preserve returned user id in returnValue and ArchestrAUserToIdReply",
        "preserve invalid user GUID HRESULT/status behavior",
        "compare raw mapping behavior without normalizing unknown users"
      ]
    }
  ],
  "eventFixtures": [
    {
      "id": "event.on-data-change.scalar",
      "family": "MX_EVENT_FAMILY_ON_DATA_CHANGE",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/003-subscribe-scalars/harness.log",
        "captures/106-native-subscribe-testint-current/harness.log"
      ],
      "assertions": [
        "preserve value, quality, timestamp, status array, and worker sequence"
      ]
    },
    {
      "id": "event.on-write-complete.status",
      "family": "MX_EVENT_FAMILY_ON_WRITE_COMPLETE",
      "status": "planned_fixture",
      "captureReferences": [
        "captures/008-write-test-int-same-value/harness.log",
        "captures/107-native-write-testint-current/harness.log"
      ],
      "assertions": [
        "preserve write-complete status array and optional HRESULT"
      ]
    },
    {
      "id": "event.operation-complete.native-trigger-gap",
      "family": "MX_EVENT_FAMILY_OPERATION_COMPLETE",
      "status": "documented_gap",
      "captureReferences": [
        "captures/077-frida-suspend-advised-scanstate/harness.log",
        "captures/118-frida-suspend-advised-scanstate-long/harness.log"
      ],
      "assertions": [
        "do not synthesize OperationComplete from Write or OnWriteComplete",
        "upgrade this gap when a public MXAccess trigger emits event family 3"
      ]
    },
    {
      "id": "event.on-buffered-data-change.batch-gap",
      "family": "MX_EVENT_FAMILY_ON_BUFFERED_DATA_CHANGE",
      "status": "documented_gap",
      "captureReferences": [
        "captures/120-frida-buffered-history-testhistoryvalue/harness.log",
        "captures/122-frida-buffered-history-testhistoryvalue-plainadvise/harness.log"
      ],
      "assertions": [
        "preserve raw buffered metadata until a public multi-sample event payload is observed",
        "upgrade this gap when OnBufferedDataChange batches are captured from MXAccess"
      ]
    }
  ],
  "scenarioGroups": [
    {
      "id": "invalid_handles",
      "description": "Invalid server, item, post-remove, and invalid-reference cases keep MXAccess-owned HRESULT and status behavior.",
      "fixtureIds": [
        "method.add-item.scalar",
        "method.remove-item.basic",
        "method.unadvise.basic",
        "method.write.value-status-matrix",
        "method.unregister.basic"
      ],
      "captureReferences": [
        "captures/006-add-invalid/harness.log",
        "captures/007-subscribe-invalid/harness.log",
        "captures/109-native-post-remove-errors/harness.log",
        "captures/110-native-invalid-handle-errors/harness.log"
      ]
    },
    {
      "id": "write_statuses",
      "description": "Write success, wrong type, invalid reference, scalar arrays, and completion-status cases compare HRESULT, status array, value projection, and event shape.",
      "fixtureIds": [
        "method.write.value-status-matrix",
        "method.write2.timestamped",
        "event.on-write-complete.status"
      ],
      "captureReferences": [
        "captures/089-frida-write-testint-wrong-type/harness.log",
        "captures/090-frida-write-invalid-reference/harness.log",
        "captures/091-frida-write-testint-double-type/harness.log",
        "captures/097-frida-write-bool-array-pattern/harness.log",
        "captures/107-native-write-testint-current/harness.log"
      ]
    },
    {
      "id": "secured_writes",
      "description": "Secured writes include observed WriteSecured rejection and authenticated WriteSecured2 success paths without logging credential-bearing values.",
      "fixtureIds": [
        "method.write-secured.rejection-gap",
        "method.write-secured2.authenticated",
        "method.authenticate-user.basic"
      ],
      "captureReferences": [
        "captures/036-frida-write-secured-test-int/harness.log",
        "captures/111-frida-write-secured-auth-protectedvalue/harness.log",
        "captures/113-frida-write-secured2-auth-protectedvalue/harness.log",
        "captures/117-frida-write-secured2-auth-testint/harness.log"
      ]
    },
    {
      "id": "add_item_context",
      "description": "Context-bearing item registration compares AddItem2 and buffered AddBufferedItem argument preservation.",
      "fixtureIds": [
        "method.add-item2.context",
        "method.add-buffered-item.context"
      ],
      "captureReferences": [
        "captures/mxaccess-additem2-testint-context.log",
        "captures/121-frida-buffered-history-testhistoryvalue-context/harness.log"
      ]
    },
    {
      "id": "buffered_registration",
      "description": "Buffered registration and interval setup are tracked separately from normal advice until a public buffered data-change batch is captured.",
      "fixtureIds": [
        "method.add-buffered-item.context",
        "method.set-buffered-update-interval.basic",
        "event.on-buffered-data-change.batch-gap"
      ],
      "captureReferences": [
        "captures/079-frida-add-buffered-advise-testint/harness.log",
        "captures/120-frida-buffered-history-testhistoryvalue/harness.log",
        "captures/122-frida-buffered-history-testhistoryvalue-plainadvise/harness.log"
      ]
    }
  ]
}
