Skip to content

Contracts ​

Describe and negotiate public contracts before using their operations. A contract declaration identifies schemas and versions; it does not grant permission to perform the declared effects.

Contract: nexa.contracts/100. API index.

Typical sequence ​

Define contracts during the allowed registration stage, then query compatibility and availability. A successful schema check validates the value against that schema; domain ownership and effect checks still apply.

Behavior and limits ​

WatchAvailability returns a subscription. Refresh dependent UI after availability changes, but do not silently rebind a required service to a different provider.

The recorded Host maps 9 of 9 operations in this group. A mapping is subject to permission, phase, scope, platform and business preconditions. Host snapshot identifies the source revision; negotiate against the actual installed Host.

Operations ​

DefineService · DefineProviderKind · DefineExtensionPoint · Describe · List · ValidateSchema · RegisterConsumer · WatchAvailability · CheckCompatibility

DefineService ​

PublicContract → RegistrationRef

PropertyContract
Local SDK method ID1
KindRegistration
Permissionnexa.contracts.write
Legal phasesInitialize
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdQualifiedIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.
VersionulongDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
SchemaSchemaRefExact schema identity, version and fingerprint used to validate Value.
MethodsServiceMethod[]Structured ServiceMethod value; follow its linked field contract. A bounded collection; do not assume an unbounded result or unspecified ordering.

Successful result

Retain the registration identity for the permitted update/release operation. Staged registrations become visible only at group activation.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Contracts_DefineService(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Contracts_DefineService_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

DefineProviderKind ​

ProviderKindDefinition → RegistrationRef

PropertyContract
Local SDK method ID2
KindRegistration
Permissionnexa.contracts.write
Legal phasesInitialize
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdQualifiedIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.
ContractPublicContractStructured PublicContract value; follow its linked field contract.
SelectionSelectionPolicyUse an exact enum member listed in the reference. The Host can support a subset for a particular operation.

Successful result

Retain the registration identity for the permitted update/release operation. Staged registrations become visible only at group activation.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Contracts_DefineProviderKind(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Contracts_DefineProviderKind_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

DefineExtensionPoint ​

ExtensionPointDefinition → RegistrationRef

PropertyContract
Local SDK method ID3
KindRegistration
Permissionnexa.contracts.write
Legal phasesInitialize
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdQualifiedIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.
InputSchemaRefStructured SchemaRef value; follow its linked field contract.
OutputSchemaRefStructured SchemaRef value; follow its linked field contract.
ModeExtensionModeUse an exact enum member listed in the reference. The Host can support a subset for a particular operation.
DeadlineMillisecondslongRequested deadline in milliseconds; queue time consumes this budget and caller deadlines can shorten it.
MergePolicystringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
OrderingOrderingPolicyUse an exact enum member listed in the reference. The Host can support a subset for a particular operation.
ReentryReentryPolicyUse an exact enum member listed in the reference. The Host can support a subset for a particular operation.
AllowedFieldsstring[]Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. A bounded collection; do not assume an unbounded result or unspecified ordering.
FailurePolicyProviderFailurePolicyHow this provider family reports callback failures; it does not automatically make retries safe.

Successful result

Retain the registration identity for the permitted update/release operation. Staged registrations become visible only at group activation.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Contracts_DefineExtensionPoint(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Contracts_DefineExtensionPoint_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Describe ​

ContractQuery → PublicContract

PropertyContract
Local SDK method ID4
KindQuery
Permissionnexa.contracts.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdQualifiedIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.
VersionulongDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.

Successful result

Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Contracts_Describe(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Contracts_Describe_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

List ​

PageRequest → Page<PublicContract> (wrapper, item)

PropertyContract
Local SDK method ID5
KindQuery
Permissionnexa.contracts.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
Cursorstring?Opaque continuation or observation cursor. Reuse only in the issuing query/scope; absence and invalidity are different. Nullable; omission is distinct from an empty value. No implicit default is promised by this type.
LimitlongRequested bound on returned items. The Host may impose a smaller domain-specific limit.

Successful result

Read Items and continue with NextCursor while preserving the original query. An absent cursor ends the sequence; an invalid cursor is an error.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Contracts_List(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Contracts_List_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

ValidateSchema ​

SchemaValidationRequest → ValidationReport

PropertyContract
Local SDK method ID6
KindQuery
Permissionnexa.contracts.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
SchemaSchemaRefExact schema identity, version and fingerprint used to validate Value.
ValueAbiValuePayload interpreted using the accompanying or declared schema; Null is not a substitute for an error.

Successful result

Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Contracts_ValidateSchema(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Contracts_ValidateSchema_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

RegisterConsumer ​

ConsumerDefinition → RegistrationRef

PropertyContract
Local SDK method ID7
KindRegistration
Permissionnexa.contracts.write
Legal phasesInitialize
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdQualifiedIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.
ContractQualifiedIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
VersionulongDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
HandlerulongCallback identifier registered by this plugin. A handler alone is not a public action or provider registration.

Successful result

Retain the registration identity for the permitted update/release operation. Staged registrations become visible only at group activation.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Contracts_RegisterConsumer(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Contracts_RegisterConsumer_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

WatchAvailability ​

QualifiedRequest → SubscriptionRef

PropertyContract
Local SDK method ID8
KindSubscription
Permissionnexa.contracts.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdQualifiedIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.

Successful result

Retain the subscription identity, consume bounded batches or callbacks as specified, handle gaps, and release it when no longer needed.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Contracts_WatchAvailability(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Contracts_WatchAvailability_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

CheckCompatibility ​

CompatibilityRequest → ValidationReport

PropertyContract
Local SDK method ID9
KindQuery
Permissionnexa.contracts.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
ContractQualifiedIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
VersionulongDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
SchemaDigeststringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.

Successful result

Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Contracts_CheckCompatibility(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Contracts_CheckCompatibility_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.


Source: NexaCL-Plugin-SDK · Apache-2.0.

Site documentation: CC BY-SA 4.0. Imported SDK documents: Apache-2.0 as marked.